OpenBSD CVS

CVS log for src/usr.bin/mg/buffer.c


[BACK] Up to [local] / src / usr.bin / mg

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.114 / (download) - annotate - [select for diffs], Fri Apr 21 13:39:36 2023 UTC (12 months, 4 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.113: +35 -1 lines
Diff to previous 1.113 (colored)

mg: allow to change the tab width

This makes the tab width customizable per-buffer.  The new function
`set-tab-width' changes it for the current buffer or the default value
for new buffers if called with a prefix argument (or from the startup
file.)

The default tab width is still 8 column.

Together with the newly resurrected no-tab-mode, allows to use mg for a
variety of programming languages and coding styles.

Note that it's not possible to call set-tab-width with auto-execute in
the startup file due to limitations in how auto-execute and the parser
work.

ok tb@

Revision 1.113 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:11 2023 UTC (14 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.112: +1 -12 lines
Diff to previous 1.112 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.112 / (download) - annotate - [select for diffs], Fri Mar 26 15:02:10 2021 UTC (3 years, 1 month ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

Invert the 'R' indicator which seems rather unintuitive at the moment,
currently a '*' next to a file's name indicates it is writable. With
this diff it now means it is read-only. Also make the active buffer
indicator more visible:'.'->'>'.

Revision 1.111 / (download) - annotate - [select for diffs], Tue Mar 23 18:40:29 2021 UTC (3 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.110: +4 -4 lines
Diff to previous 1.110 (colored)

Use a pointer called bufp to point to a buffer called bufn
consistantly.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Mar 18 18:09:21 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.109: +11 -3 lines
Diff to previous 1.109 (colored)

From Joachim Wiberg's version of mg.

"This patch makes sure to clear the status/echo line after killing and
switching buffers by name.  Otherwise the kill/switch prompt lingers"

Revision 1.109 / (download) - annotate - [select for diffs], Mon Mar 1 10:51:14 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.108: +3 -1 lines
Diff to previous 1.108 (colored)

Put the hardcoded '\n' character which is found throughout mg into a
buffer specific variable. The diff should not produce any behavourial
changes in mg.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Feb 28 15:30:35 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.107: +16 -29 lines
Diff to previous 1.107 (colored)

Add dobeep functions that take messages to buffer.c and cscope.c
No functional change intended.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Jun 24 14:57:56 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.106: +2 -2 lines
Diff to previous 1.106 (colored)

switch-to-buffer (C-x b) doesn't cancel properly if C-g is pressed.
It doesn't show 'Quit'. By returning ABORT, it behaves as expected
when C-g is pressed (like all other functions that use the
minibuffer).

Revision 1.106 / (download) - annotate - [select for diffs], Sat Jun 22 15:38:15 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

Tidy up the comments:
1. two spelling mistakes.
2. change references to keystrokes, same as man page (UP-low).
3. update a filename reference to reality.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Dec 13 14:59:16 2018 UTC (5 years, 5 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.104: +23 -1 lines
Diff to previous 1.104 (colored)

Allow all non-ephemeral buffers to be toggled writable or read-only
while mg is running: toggle-read-only-all

Revision 1.104 / (download) - annotate - [select for diffs], Sun Aug 6 04:39:45 2017 UTC (6 years, 9 months ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.103: +5 -5 lines
Diff to previous 1.103 (colored)

Present the default choice before the colon in prompts. Matches GNU Emacs
behavior.

From Scott Cheloha <scottcheloha@gmail.com>

ok florian@

Revision 1.103 / (download) - annotate - [select for diffs], Mon Mar 13 20:32:58 2017 UTC (7 years, 2 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.102: +4 -1 lines
Diff to previous 1.102 (colored)

When aborting switch-to-buffer keep current buffer instead of
switching to *scratch*. (Which seems to be the least useful thing to
do.)
This brings mg in line with emacs.
OK lum; deraadt@ was bugged by this, too

Revision 1.102 / (download) - annotate - [select for diffs], Wed Sep 7 11:42:01 2016 UTC (7 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.101: +8 -3 lines
Diff to previous 1.101 (colored)

Source Joachim Nilsson:

 Found by Coverity Scan.  The popbuf() function iterated over a list to
 find a wp pointer, then sent it to showbuffer() which immediately went
 ahead and dereferenced it.  This patch simply adds a NULL pointer check
 before calling showbuffer(), if NULL then just return NULL to callee.

ok awolk@ millert@

Revision 1.101 / (download) - annotate - [select for diffs], Wed Aug 31 12:22:28 2016 UTC (7 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.100: +14 -17 lines
Diff to previous 1.100 (colored)

Fix a bug reported by Han Boetes. Easily reproducible via:

mg
c-x b RET
c-x k RET

mg segvs. Initial diff from Joachim Nilsson. This diff tested
by Han and Joachim and ok florian@ jasper@

Revision 1.100 / (download) - annotate - [select for diffs], Sat Oct 10 08:35:26 2015 UTC (8 years, 7 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (colored)

Call onlywind() properly.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Sep 26 21:51:58 2015 UTC (8 years, 7 months ago) by jasper
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

whitespace

Revision 1.98 / (download) - annotate - [select for diffs], Mon Mar 23 12:31:19 2015 UTC (9 years, 1 month ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.97: +1 -3 lines
Diff to previous 1.97 (colored)

DIFFTOOL has to be defined for mg to build. TCSASOFT is defined via
termios.h so we don't need the code for when it is not defined.
ok reyk@

Revision 1.97 / (download) - annotate - [select for diffs], Thu Mar 19 21:48:05 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

More unifdef cleanup:
-UDIRED_XMAPS and -UFUND_XMAPS: you can't build mg the other way.
-DTIOCGWINSZ: you have this if you have term.h
Remove a #define TERMCAP which isn't being used.

Remove defines for NDIRED_XMAPS, NFUND_XMAPS, and IMAPEXT. They are all
defined to be 0 and are only ever used in addition. We don't need to add 0.
Simply lines that were using those defines.
ok florian@

Revision 1.96 / (download) - annotate - [select for diffs], Thu Mar 19 21:22:15 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.95: +11 -4 lines
Diff to previous 1.95 (colored)

Clean up the includes in mg.
This does the following:
Moves all POSIX headers from sysdef.h into the individual .c files so that
each file now only includes what it needs. All headers are properly sorted.
Moves the remainder of sysdef.h to other files (mostly def.h) and deletes
sysdef.h now that it's no longer contains anything.
Tweak a comment that references sysdef.h so that it no longer does that.
ok florian@

Revision 1.95 / (download) - annotate - [select for diffs], Mon Mar 16 13:47:48 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

Change the internal name of the newline function to deconflict with a
function of the same name in term.h. This is the first step towards
cleaning up mg's includes. No user-visible changes.
ok florian@

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jun 12 16:29:41 2014 UTC (9 years, 11 months ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.93: +2 -3 lines
Diff to previous 1.93 (colored)

Remove a comparison that is always true. Reported by clang.
Merge the new if into a single line, requested by florian@
ok matthew@ florian@

Revision 1.93 / (download) - annotate - [select for diffs], Thu Mar 20 07:47:29 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.92: +12 -1 lines
Diff to previous 1.92 (colored)

Add some missing dobeeps.
ok florian@

Revision 1.92 / (download) - annotate - [select for diffs], Mon Dec 23 14:58:16 2013 UTC (10 years, 4 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.91: +28 -1 lines
Diff to previous 1.91 (colored)

Move findbuffer() to buffer.c.
ok florian@

Revision 1.91 / (download) - annotate - [select for diffs], Sun Jun 2 10:09:21 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.90: +7 -5 lines
Diff to previous 1.90 (colored)

Add the 'quit-window' dired command and receive a basic English lesson
from jmc@ again.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Feb 17 10:30:26 2013 UTC (11 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.89: +4 -6 lines
Diff to previous 1.89 (colored)

Replace hand rolled TAILQ_REMOVE with example from queue(3).
While this did work in this particular case because the
list was no longer used it at least sets a bad example.
ok benno, jasper, lum

Revision 1.89 / (download) - annotate - [select for diffs], Fri Feb 15 15:12:25 2013 UTC (11 years, 3 months ago) by florian
Branch: MAIN
Changes since 1.88: +8 -1 lines
Diff to previous 1.88 (colored)

cleanup undo history in revert-buffer
problem spotted, initial diff and ok lum@

Revision 1.88 / (download) - annotate - [select for diffs], Thu Dec 27 18:51:52 2012 UTC (11 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.87: +76 -1 lines
Diff to previous 1.87 (colored)

diff-buffer-with-file
input gsoares@, Sunil Nimmagadda, jasper@
ok jasper@, benno@

Revision 1.87 / (download) - annotate - [select for diffs], Tue Nov 6 18:04:10 2012 UTC (11 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.86: +1 -2 lines
Diff to previous 1.86 (colored)

Remove never read struct member, found while investigating a llvm
report.

ok lum, jasper, benno

Revision 1.86 / (download) - annotate - [select for diffs], Sat Nov 3 14:51:41 2012 UTC (11 years, 6 months ago) by haesbaert
Branch: MAIN
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

This should be void.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Oct 23 20:51:17 2012 UTC (11 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.84: +10 -12 lines
Diff to previous 1.84 (colored)

Use correct file for revert-buffer; do not ignore abort.

ok lum, jasper, benno

Revision 1.84 / (download) - annotate - [select for diffs], Mon Oct 22 08:31:42 2012 UTC (11 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.83: +39 -24 lines
Diff to previous 1.83 (colored)

Add (r)evert prompt to "File changed on disk; really edit the buffer"
prompt.

input, ok lum@, man bit ok jmc@, ok benno@

Revision 1.83 / (download) - annotate - [select for diffs], Mon Oct 22 08:22:04 2012 UTC (11 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.82: +6 -2 lines
Diff to previous 1.82 (colored)

Check for dirty buffer on buffer change.

ok jasper@, benno@

Revision 1.82 / (download) - annotate - [select for diffs], Fri Oct 12 21:13:46 2012 UTC (11 years, 7 months ago) by jasper
Branch: MAIN
Changes since 1.81: +44 -2 lines
Diff to previous 1.81 (colored)

- implement "revert-buffer", which reverts the current buffer to what's on disk
- split gotoline() into the argument handling part and the part that actually
  goes to the specified line number so it can be re-used by revertbuffer()

input/ok florian@ haesbaert@

Revision 1.81 / (download) - annotate - [select for diffs], Fri Aug 31 18:06:42 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

Allow an error message for a filename that is too long to be seen and
let the error stop mg exiting when C-x C-c is called.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Aug 30 06:25:30 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.79: +1 -3 lines
Diff to previous 1.79 (colored)

Some line counter goodness from Florian Obser.

If you open an already open buffer via C-x C-f, odd things can happen
with the cursor and line counter for that buffer. This diff stops that
behaviour and no regressions viewable.

Revision 1.79 / (download) - annotate - [select for diffs], Thu Aug 30 06:09:12 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.78: +7 -4 lines
Diff to previous 1.78 (colored)

This diff allows the user to decide what to do with buffers that
experience write errors during C-x C-c (exiting mg). Emacs stops the
exiting process when it encounters problem buffers and lets the user
decide what to do, currently mg continues exiting and the contents of
these buffers are lost. This diff bring mg more into line with emacs.

Review and observations from Sunil Nimmagadda.

Revision 1.78 / (download) - annotate - [select for diffs], Wed Mar 14 13:56:35 2012 UTC (12 years, 2 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.77: +2 -5 lines
Diff to previous 1.77 (colored)

Remove the NO_HELP conditional directives. If defined, mg will not compile and
has not done so for numerous years. Not hard to fix, but just remove anyway.
ok kjell@ millert@

Revision 1.77 / (download) - annotate - [select for diffs], Sun Jan 23 00:45:03 2011 UTC (13 years, 3 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.76: +2 -3 lines
Diff to previous 1.76 (colored)

Wrap basename,dirname with xbasename, xdirname funtions,
which have fewer special cases, and use the strlcpy/strlcat
src/dst/buffer len semantic. More portable to boot.
Discussion and feedback from Henri Kemppainen

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jan 21 19:10:13 2011 UTC (13 years, 4 months ago) by kjell
Branch: MAIN
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored)

It volates style(9), but in mg, #include"def.h" goes first. 'twas the way it was built. no binary change here. confirmed by lum@, tested by Henri Kemppainen

Revision 1.75 / (download) - annotate - [select for diffs], Tue Jan 18 17:35:42 2011 UTC (13 years, 4 months ago) by lum
Branch: MAIN
Changes since 1.74: +3 -1 lines
Diff to previous 1.74 (colored)

Add missing prototypes and move dired.c to "extensions" in Makefile.
ok kjell@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jun 30 19:12:54 2010 UTC (13 years, 10 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.73: +5 -4 lines
Diff to previous 1.73 (colored)

you keep saying LIST_END. I do not think it means what you think it
means.

If we hit an OOM condition, mg started to try and dump the older undo buffer
entries in order to be able to continue. OTOH, it was grabbing this entry with
LIST_END, which like all *_END() list macros evaluates to NULL.

Do what we actually want and switch that list to a TAILQ and use
TAILQ_LAST to grab the last entry.

Wrote this a loooooong time ago after a mail from Matthew Dempsky on
bugs@. ok kjell@, beck@ also looked at this months ago and thought it
was alright.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jun 5 18:37:13 2009 UTC (14 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.72: +21 -21 lines
Diff to previous 1.72 (colored)

swap function order to bring into scope

Revision 1.72 / (download) - annotate - [select for diffs], Thu Jun 4 23:56:50 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.71: +22 -4 lines
Diff to previous 1.71 (colored)

If a buffer is created with a name that starts and ends with an askerisk
(e.g. *scratch*, *Completions*, *grep*) it is considered throwaway; i.e.
the user will NOT be prompted to save changes when the buffer is killed.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Jun 4 23:39:37 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.70: +26 -10 lines
Diff to previous 1.70 (colored)

Add the notion of an "ephemeral" popup, so we can flag a window
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@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Jun 4 02:23:37 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.69: +8 -8 lines
Diff to previous 1.69 (colored)

Rename w_flag to w_rflag. This is not a general purpose
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.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jun 2 18:52:42 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.68: +6 -4 lines
Diff to previous 1.68 (colored)

Fix up some comments to match reality

Revision 1.68 / (download) - annotate - [select for diffs], Mon Sep 15 16:11:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.67: +31 -3 lines
Diff to previous 1.67 (colored)

Enable dirty buffer detection in mg.
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

Revision 1.67 / (download) - annotate - [select for diffs], Mon May 28 17:52:17 2007 UTC (16 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.66: +5 -2 lines
Diff to previous 1.66 (colored)

Add a global-wd-mode command, which toggles between the current
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.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Nov 19 16:51:19 2006 UTC (17 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored)

spacing

Revision 1.65 / (download) - annotate - [select for diffs], Sat Nov 18 23:05:24 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.64: +9 -11 lines
Diff to previous 1.64 (colored)

Move buffer name allocation into bnew() where it belongs

Revision 1.64 / (download) - annotate - [select for diffs], Sat Nov 18 19:27:27 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (colored)

Fix line number bug (actually, dot-mark bug). to reproduce:
-split window into two
-open a file, set the mark
-switch windows, open same file, exchange point-and-mark
from peter de wachter (Debian bug#391827)

Revision 1.63 / (download) - annotate - [select for diffs], Tue Jul 25 08:27:09 2006 UTC (17 years, 9 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.62: +5 -5 lines
Diff to previous 1.62 (colored)

Add bfirstlp(), blastlp() macros, returning the first and last lines
of a buffer respectively. Removes an ugly construction than necessitated
"go to first line"-type comments throughout the code.
No binary change

Revision 1.62 / (download) - annotate - [select for diffs], Tue Jul 25 08:22:32 2006 UTC (17 years, 9 months ago) by kjell
Branch: MAIN
Changes since 1.61: +16 -16 lines
Diff to previous 1.61 (colored)

Rename the header line of a buffer to b_headp, from the remarkably
unintuitive b_linep. No binary change.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jul 8 17:50:30 2006 UTC (17 years, 10 months ago) by kjell
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

Fix a trio of bugs in line numbering: adjusting linenos after undo,
cutting a block, and off-by-one linecount. Initial bug discovered by
jason

Revision 1.60 / (download) - annotate - [select for diffs], Thu Jun 1 09:00:50 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.59: +12 -1 lines
Diff to previous 1.59 (colored)

Display line number in the mg statusbar.  Yes, it seems like a fugly
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

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jun 1 01:41:49 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.58: +3 -2 lines
Diff to previous 1.58 (colored)

find-file-other-window and find-buffer-other-window should split
the window if you ask for whatever file you are currently visiting.
pointed out, ok beck@

Revision 1.58 / (download) - annotate - [select for diffs], Sun May 28 23:30:16 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.57: +7 -7 lines
Diff to previous 1.57 (colored)

Make Window Flags more mnemonic (and less dumb); i.e.
WFHARD -> WFFULL (Redraw full window)
WFFORCE -> WFFRAME (Reframe window).
No binary change

Revision 1.57 / (download) - annotate - [select for diffs], Tue May 2 17:10:25 2006 UTC (18 years ago) by kjell
Branch: MAIN
Changes since 1.56: +56 -13 lines
Diff to previous 1.56 (colored)

Make buffers store their own working directory. This makes things like
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.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Apr 6 05:28:17 2006 UTC (18 years, 1 month ago) by kjell
Branch: MAIN
Changes since 1.55: +29 -2 lines
Diff to previous 1.55 (colored)

Fix a bug whereby a written buffer (^X^W) would not have the correct
trailing buffer number appended (e.g. "file<2>") in case an existing
buffer shared its basename().

Revision 1.55 / (download) - annotate - [select for diffs], Mon Apr 3 00:40:56 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored)

lint love; ok kjell

Revision 1.54 / (download) - annotate - [select for diffs], Tue Dec 20 06:17:35 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Clean up the ugly casted frees. In one case, this meant eliminating a nasty
struct/union/casting nightmare when building the list of names for filename
completion. In particular, be consistent about strduping and freeing
the list data.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Dec 13 06:01:26 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.52: +5 -5 lines
Diff to previous 1.52 (colored)

More name-clash delinting

Revision 1.52 / (download) - annotate - [select for diffs], Fri Nov 18 20:56:52 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.51: +47 -48 lines
Diff to previous 1.51 (colored)

greedy use of typedef struct was making code harder to read; ok kjell cloder

Revision 1.51 / (download) - annotate - [select for diffs], Sun Nov 13 07:49:02 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.50: +10 -6 lines
Diff to previous 1.50 (colored)

Better error checking of snprintfs. From Han Boetes.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Oct 14 19:46:46 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

add missing /* ARGSUSED */ to quiet lint.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 14 06:44:49 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Whoops. C-x C-v (filevisitalt) didn't work on inital scratch buffer.
It does now. Noted by deraadt.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Oct 13 20:28:49 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

spacing

Revision 1.47 / (download) - annotate - [select for diffs], Thu Oct 13 05:34:11 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.46: +5 -6 lines
Diff to previous 1.46 (colored)

KNF and minor cleanup. Remove an impossible condition check.
Also, remove annoying "now readonly" message, as this information
is already reflected in the statusbar

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 11 01:08:52 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.45: +12 -1 lines
Diff to previous 1.45 (colored)

A while back, undo records were moved from the BUFFER struct to MGWIN.
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@

Revision 1.45 / (download) - annotate - [select for diffs], Wed Sep 28 06:37:52 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

fix buflist mode; pr 4524; from jason

Revision 1.44 / (download) - annotate - [select for diffs], Tue Aug 9 00:53:48 2005 UTC (18 years, 9 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.43: +4 -4 lines
Diff to previous 1.43 (colored)

Clean up eread handling in mg. (basically, fallout from the 'enter often
means abort' behaviour added during the hackathon). Eliminates
redundant ereply function, fixes miscellaneous cores when aborting,
and move a number of assumed pathnames into the prompt text, since
they are used there anyway. All changes consistent with emacs behavior

ok beck@ many, many moons ago.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jun 14 18:14:40 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.42: +3 -1 lines
Diff to previous 1.42 (colored)

Add explicit public domain notices to all public domain files.
ok millert@, deraadt@

Revision 1.42 / (download) - annotate - [select for diffs], Fri Jun 3 15:18:05 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.41: +13 -8 lines
Diff to previous 1.41 (colored)

Fix memory leak.  OK kjell, with comments by beck and kjell

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jun 3 08:23:12 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.40: +4 -3 lines
Diff to previous 1.40 (colored)

Clean up find-alternate-file (C-x C-v) so abort returns to original
file, like its emacs ancestor.

ok cloder@

Revision 1.40 / (download) - annotate - [select for diffs], Tue May 31 20:38:59 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.39: +6 -6 lines
Diff to previous 1.39 (colored)

fix broken minibuffer defaults introduced in echo.c:1.33
adds eread flag EFDEF allowing null minibuffer response
noticed by otto
ok cloder@ jason@, works otto@

Revision 1.39 / (download) - annotate - [select for diffs], Wed May 25 05:57:32 2005 UTC (18 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.38: +31 -5 lines
Diff to previous 1.38 (colored)

'1' in buffer-list mode should open the listed buffer in its own window
(ie. it's just like ^M, except for a call to onlywind()).

Revision 1.38 / (download) - annotate - [select for diffs], Sun May 15 21:19:08 2005 UTC (19 years ago) by cloder
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Fix insert-buffer prompt format string. strlcpy returns size_t, not int
(from Han Boetes). Improve error messages (from Han Boetes).
OK otto, jaredy, beck

Revision 1.37 / (download) - annotate - [select for diffs], Sun Apr 3 02:09:28 2005 UTC (19 years, 1 month ago) by db
Branch: MAIN
Changes since 1.36: +80 -80 lines
Diff to previous 1.36 (colored)

This is a no binary change which does:

- spelling, punctuation fixes
- variable declaration lineup
- use parentheses for return and sizeof
- K&R function declarations -> ANSI
- other minor code beautification

ok henning@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Mar 10 16:58:57 2005 UTC (19 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.35: +5 -6 lines
Diff to previous 1.35 (colored)

spacing

Revision 1.35 / (download) - annotate - [select for diffs], Wed Mar 9 16:20:48 2005 UTC (19 years, 2 months ago) by jfb
Branch: MAIN
Changes since 1.34: +11 -5 lines
Diff to previous 1.34 (colored)

fix mg's behaviour with regards to files on which we do not have
write access.  diff originally from vincent@ and forgotten for
a while.

ok rohee@, "toss it in, i'll bitch if it doesn't work" henning@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 22 01:25:24 2004 UTC (19 years, 10 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.33: +25 -29 lines
Diff to previous 1.33 (colored)

stage 1 of the infinite minibuffer work - add support for on the fly
buffer reallocation in veread().  This commit only changes the API.
All the buffers have exactly the same bounds as before for now.

tested by a couple of my very helpful testers!

Revision 1.33 / (download) - annotate - [select for diffs], Tue Oct 21 22:48:07 2003 UTC (20 years, 7 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.32: +1 -11 lines
Diff to previous 1.32 (colored)

make undo records per MGWIN, not per BUFFER...

Revision 1.32 / (download) - annotate - [select for diffs], Fri Aug 15 23:23:18 2003 UTC (20 years, 9 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.31: +7 -4 lines
Diff to previous 1.31 (colored)

make dired work more like emacs. (well, make it _work_, and then add a
bunch of missing commands)

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jun 26 23:04:10 2003 UTC (20 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

protos

ok deraadt

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jul 25 16:40:57 2002 UTC (21 years, 9 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.29: +7 -15 lines
Diff to previous 1.29 (colored)

use vasprintf() instead of vsnprintf + malloc + vsnprintf hack;idea from deraadt

ok art

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 19 22:05:58 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.28: +7 -5 lines
Diff to previous 1.28 (colored)

initialize some undo-related variables.

ok deraadt@

Revision 1.28 / (download) - annotate - [select for diffs], Sat Mar 16 19:30:29 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

 Make these special buffers readonly by default. ok art@

Revision 1.27 / (download) - annotate - [select for diffs], Sat Mar 16 04:17:36 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.26: +18 -3 lines
Diff to previous 1.26 (colored)

 add readonly buffer support
 plus some KNF

 ok art@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 11 13:02:56 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.25: +17 -32 lines
Diff to previous 1.25 (colored)

  * Move to ANSI function definitions.
  * Add a whole lot of consts where I thought it made sense

   no ok, but no objections either...

Revision 1.25 / (download) - annotate - [select for diffs], Tue Mar 5 20:31:10 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.24: +7 -4 lines
Diff to previous 1.24 (colored)

 Fix a ridiculous bug I introduced in the buffer code.  Free the undo records
list correctly.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Feb 26 00:45:45 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.23: +7 -1 lines
Diff to previous 1.23 (colored)

keep undo records in the BUFFER structures insteda of having a huge list.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Feb 21 00:04:10 2002 UTC (22 years, 3 months ago) by dhartmei
Branch: MAIN
Changes since 1.22: +5 -2 lines
Diff to previous 1.22 (colored)

It seems you need to have hacked mg at some point to be considered a
true old fart, so here's my contribution ;)

Don't use the same va_list twice without re-va_start()ing it, doesn't
work on macppc.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:49 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Feb 14 14:24:21 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +12 -12 lines
Diff to previous 1.20 (colored)

some KNF

Revision 1.20 / (download) - annotate - [select for diffs], Wed Feb 13 03:03:49 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.19: +2 -3 lines
Diff to previous 1.19 (colored)

 * Replace unsafe strcpy and strcat calls to safe strlcpy and strlcat.
 * Be a little bit more verbose about some errors
 * Fix some memory leaks in fileio.c

ok deraadt@, art@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 18 09:40:07 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.18: +81 -3 lines
Diff to previous 1.18 (colored)

When listing buffers, detect if the buffer name is too long to fit in the
designated space and if it's too long, truncate it correctly and print
a '$'-sign at the end of the name.

Add support for selecting a buffer with ^M in the buffer list.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jan 18 08:37:08 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Remove the NROW and NCOL limits. The static arrays are now replaced with
dynamically allocated memory.
Code written by Vincent Labrecque <limitln@Psyfreaks.CA> with some minor
tweaks by me.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Nov 25 07:34:17 2001 UTC (22 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

snprintf makes me happy

Revision 1.16 / (download) - annotate - [select for diffs], Sat Aug 18 21:36:11 2001 UTC (22 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.15: +5 -1 lines
Diff to previous 1.15 (colored)

handle vsnprintf returning -1

Revision 1.15 / (download) - annotate - [select for diffs], Thu May 24 03:05:20 2001 UTC (23 years ago) by mickey
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

spaces

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 23 22:36:13 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.13: +3 -5 lines
Diff to previous 1.13 (colored)

Get rid of unnecessary casts of NULL.

Revision 1.13 / (download) - annotate - [select for diffs], Wed May 23 22:26:24 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.12: +2 -3 lines
Diff to previous 1.12 (colored)

sprintf instead of two strcpy (there was a bug here)

Revision 1.12 / (download) - annotate - [select for diffs], Wed May 23 22:20:34 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

remove VOID. We're way beyond the point where this could build with an
ancient compiler.

Revision 1.11 / (download) - annotate - [select for diffs], Wed May 23 15:50:27 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.10: +19 -74 lines
Diff to previous 1.10 (colored)

Creatively use addlinef when listing buffers (C-X-C-B).

This also fixes the strange formatting that showed up when the maximal buffer
name grew. Now the "Size" column starts in the middle of the visible window
instead of far outside.

Revision 1.10 / (download) - annotate - [select for diffs], Wed May 23 15:46:25 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Don't include the trailing NUL in output.

Revision 1.9 / (download) - annotate - [select for diffs], Wed May 23 15:39:35 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.8: +1 -11 lines
Diff to previous 1.8 (colored)

It's unnecessary to have addline as a function. Make it a macro.

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 23 15:35:10 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.7: +24 -15 lines
Diff to previous 1.7 (colored)

Add addlinef that's an addline with printf-style format arguments.
Make addline a wrapper around addlinef. (should go away)

Revision 1.7 / (download) - annotate - [select for diffs], Fri May 4 22:00:35 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

Cleanups in filename and buffer name handling.
Mostly just using libc instead of rolling our own.

Revision 1.6 / (download) - annotate - [select for diffs], Fri May 4 21:47:41 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Qick fix for an overflow in C-X C-B.
This function needs a lot of work.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 29 01:58:06 2001 UTC (23 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.4: +2 -0 lines
Diff to previous 1.4 (colored)

$OpenBSD$

Revision 1.4 / (download) - annotate - [select for diffs], Fri Sep 1 14:59:08 2000 UTC (23 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.3: +9 -13 lines
Diff to previous 1.3 (colored)

More -Wall anmd KNF, from op2@tomahawk.SQUiSH.org

Revision 1.3 / (download) - annotate - [select for diffs], Thu Apr 13 06:12:13 2000 UTC (24 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.2: +300 -239 lines
Diff to previous 1.2 (colored)

The start of KNF + -Wall.  The code has been run through indent but
needs hand fixup.  I stopped at keymap.c...

Revision 1.2 / (download) - annotate - [select for diffs], Sat Feb 26 22:53:16 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.1: +11 -11 lines
Diff to previous 1.1 (colored)

change WINDOW -> MGWIN to avoid curses type conflict
convert to terminfo in tty*.c
add support for some keypad function keys (arrows, pgup, pgdown)

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 25 19:08:46 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN

initial import of mg2a

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.