summaryrefslogtreecommitdiff
path: root/usr.bin/mg/def.h
AgeCommit message (Collapse)Author
2009-06-05emacs handles the undo of a region kill (C-w) differently than a line killKjell Wooding
(C-k) with respect to cursor position. The former leaves the cursor at the end, the latter at the beginning of the region. emacs is wacky. Make mg undo do the same. ok deraadt
2009-06-04Add the notion of an "ephemeral" popup, so we can flag a windowKjell Wooding
for destruction at a later date. (in the process, add a window flag field) This fixes an issue noted by maja: namely, the *completion* window that pops up when you try to complete a filename on buffer load would destroy any second window that you happened to have open. ok maja@
2009-06-04Fix problem where line numbers get out of sync on a region-kill (C-w).Kjell Wooding
Noticed and ok matthieu@
2009-06-04Rename w_flag to w_rflag. This is not a general purposeKjell Wooding
flag: it is for redisplay options only. I need an additional all-purpose flag, so renaming removes the desire to wrongly overload the existing one. Turdshine. No functional chage.
2008-09-15Expose the undo commands as proper mg functions.Kjell Wooding
This should have no functional change on undo, but it does facilitate testing undo behavior.
2008-09-15Enable dirty buffer detection in mg.Kjell Wooding
Emulate the emacs behavior: after suspend/resume, buffer switch, or at save time, warn (prompt) the user if the file has been modified on disk in the interim. This has already saved my butt numerous times. ok phessler
2008-06-14Add compile (c-C c-P) to the c-mode keymap (export from grep.c)Kjell Wooding
Also, attempt to make indent an atomic undo operation.
2008-06-14unf*ck undo.Kjell Wooding
No seriously. Reposition the cursor to the start of the redo position, like emacs. This gets us halfway to being emacs-finger-friendly. For the rest, introduce a rptcount variable to count successive invocations of the same function. This means undo will abort properly on C-g, and other such interruptions. This is a lot of diff for a simple-seeming problem. Emacs undo is hard.
2008-06-13phessler noted that c-mode ignored blinking braces.Kjell Wooding
Add "c-handle-special-brace" which does a blink and indent, rather than just a selfinsert and indent
2008-06-12Introduce a basic c-mode to mg.Kjell Wooding
The intent of this mode is NOT to copy emacs's monster cc-mode. It is intended to handle basic KNF-format C, assisting with indentation (to catch obvious typos), and strip trailing whitespace. It is NOT enabled unless you ask for it (c-mode). Basically, tab on start-of-line whitespace acts like tab. Otherwise, tab indents. Please try it out and let me know where it falls down. Feedback Reyk, phessler. "hack in tree" from henning, theo
2008-06-11Add delete-leading-space, delete-trailing-space,Kjell Wooding
indent-current-line utility functions for stripping leading/trailing whitespace, and setting a fixed indent respectively.
2008-06-10Add a clear-mark function.Kjell Wooding
Use it to clear the region it is copied (M-w), or yanked (C-w). This matches xemacs behavior, is not horribly different from gnu emacs, and way less wrong than the current behavior. Noticed by Han Boetes. ok otto@
2007-05-28Add a global-wd-mode command, which toggles between the currentKjell Wooding
behavior (every buffer maintains its own cwd) and the old behavior of one global working directory. This makes it slightly easier to hack on things like kernel code, where compilation, etc, are initiated from a different directory than you are working in. While here, fix setting/handling of global wd.
2007-02-21Fix a reference to WFHARD in a comment; it was renamed WFFULL monthsDeanna Phillips
ago. ok kjell
2006-11-19spacingTheo de Raadt
2006-11-17Fix a needless inversion of flag names; i.e. change them from theKjell Wooding
negative to the positive. undo_boundary_enable(TRUE) makes a LOT more sense than undo_no_boundary(FALSE). While here, whack a global, and fix a bug noted by otto: undoing a file insertion sometimes left stray characters around. ok beck@, otto@
2006-08-01* move sys/queue.h inclusion to sysdef.h (it's system specific)Jason Wright
* add <signal.h> to sysdef.h (needed for sig_atomic_t on linux, and we get it by accident on OpenBSD) * remove <signal.h> from tty.c/spawn.c (not needed now that it's in sysdef.h) ok beck
2006-07-25Add bfirstlp(), blastlp() macros, returning the first and last linesKjell Wooding
of a buffer respectively. Removes an ugly construction than necessitated "go to first line"-type comments throughout the code. No binary change
2006-07-25Rename the header line of a buffer to b_headp, from the remarkablyKjell Wooding
unintuitive b_linep. No binary change.
2006-07-08Introduce a 'MODIFIED' boundary type for undo records.Kjell Wooding
This allows undo to clear the modified flag when undo-ing all the way from a loaded buffer. Originally whipped up at c2k6 after proddings from beck. jason@ ok.
2006-06-01Display line number in the mg statusbar. Yes, it seems like a fuglyKjell Wooding
way to do it, but all the clever and pretty ways utterly failed. Basic use seems fine. We'll turdshine the special cases later. If it bothers you, use M-x line-number-mode, or put same in your ~/.mg file to disable. ok cloder, jason
2006-06-01make // /~ path rewriting optional in adjustname() and use it everywhereJason Wright
except for the command line specified files. ok kjell,cloder
2006-05-29Another mnemonic rename, missed the first time.Kjell Wooding
Also missed the ok cloder.
2006-05-28Make Window Flags more mnemonic (and less dumb); i.e.Kjell Wooding
WFHARD -> WFFULL (Redraw full window) WFFORCE -> WFFRAME (Reframe window). No binary change
2006-05-27Move mg "line to c-string" functionality to a function.Kjell Wooding
2006-05-08spacingKjell Wooding
2006-05-02Make buffers store their own working directory. This makes things likeKjell Wooding
grep, compile, lint work as expected (act on current buffer's cwd). Display this path when opening or replacing a file, rather than relying on the user to guess, or remember.
2006-04-06Fix a bug whereby a written buffer (^X^W) would not have the correctKjell Wooding
trailing buffer number appended (e.g. "file<2>") in case an existing buffer shared its basename().
2006-04-03fixed "text in message line would get stuck there" issue.Kjell Wooding
feedback from Philip Guenther and Han Boetes
2006-02-25Fix a coredump occurring when the terminal is resized while mg isOtto Moerbeek
suspended. Problem reported and fixed tested by reyk@; tweak by kjell@; ok kjell@
2005-12-20Clean up the ugly casted frees. In one case, this meant eliminating a nastyKjell Wooding
struct/union/casting nightmare when building the list of names for filename completion. In particular, be consistent about strduping and freeing the list data.
2005-12-13Last round of easy delinting.Kjell Wooding
2005-12-13More name-clash delintingKjell Wooding
2005-12-13If you're going to pass a length parameter, you should use it.Kjell Wooding
2005-11-22Move kill-related commands to their own file.Kjell Wooding
This will help move to a kill-ring.
2005-11-20toast NO_DIRED #ifdef; ok kjellTheo de Raadt
2005-11-18Split kill buffer code into a separate function.Kjell Wooding
2005-11-18clean up some comments after theo's cleanupKjell Wooding
2005-11-18greedy use of typedef struct was making code harder to read; ok kjell cloderTheo de Raadt
2005-11-18Casefold on replace was killed ages ago (it was wrong). Remove aKjell Wooding
leftover (unused) variable.
2005-11-07Move most of the dired hooks into dired.c. While here, enable someKjell Wooding
dired functions that were written, but not bound to keys. No other functional change. Tested by Han Boetes.
2005-10-14move the dired routines into dired.c where they belong.Kjell Wooding
ok cloder@
2005-10-13Make dired buffer read-only by default.Kjell Wooding
Noticed by Han Boetes
2005-10-13Use dired mode automatically if file specified for loading isKjell Wooding
a directory. Modified version of patch from Han Boetes. ok cloder@
2005-10-13Make mg's grep and compile more path-aware, by defaulting toKjell Wooding
the path of the invoking buffer. Also, make subshell output look more like emacs (show directory, completion time). oked at one point by deraadt@
2005-10-11A while back, undo records were moved from the BUFFER struct to MGWIN.Kjell Wooding
This is nonsensical, and utterly broken if you are undo-ing across multiple buffers. Change them back to being associated with the BUFFER struct. (effectively, just revert the original change) ok deraadt@
2005-10-11Enable the 'next-error' (C-x `) keybinding by default.Kjell Wooding
Niklas, this one is for you. ok deraadt@, cloder@
2005-10-06Make mg undo much more emacs like (and correct).Kjell Wooding
Undo boundaries are now placed at newlines, and undo of search-replace works as expected. Fixes bad behaviour reported by matthieu Ok deraadt@, beck@
2005-06-14Add explicit public domain notices to all public domain files.Kjell Wooding
ok millert@, deraadt@
2005-05-31fix broken minibuffer defaults introduced in echo.c:1.33Kjell Wooding
adds eread flag EFDEF allowing null minibuffer response noticed by otto ok cloder@ jason@, works otto@