OpenBSD CVS

CVS log for src/usr.bin/mg/def.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.180 / (download) - annotate - [select for diffs], Fri Apr 21 13:39:37 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.179: +4 -1 lines
Diff to previous 1.179 (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.179 / (download) - annotate - [select for diffs], Mon Apr 17 09:49:04 2023 UTC (13 months ago) by op
Branch: MAIN
Changes since 1.178: +1 -5 lines
Diff to previous 1.178 (colored)

resurrect mg' no-tab-mode

It's a mode that makes mg insert spaces up to the next tab stop upon
pressing TAB, along with the various tweaks needed in other places so
for e.g. auto-indent-mode also uses spaces.

This is not just an unifdef NOTAB: even under no-tab-mode mg should
consider literal TAB characters wide up to the next tab stop, while the
hidden code considered hard tabs to be just control character (i.e. ^I)
with width of two columns.  I'm also introducing the helper function
doindent() in utils.c to de-obfuscate the insertion of tabs/spaces until
the given column.

ok tb@

Revision 1.178 / (download) - annotate - [select for diffs], Thu Mar 30 19:00:02 2023 UTC (13 months, 2 weeks ago) by op
Branch: MAIN
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored)

don't access(conffile)

This removes a few access(2) calls in the configuration file handling.
startupfile() now opens and return the file and to avoid surprises it
also uses a caller-provided buffer to store the filename.  This also
removes the extra adjustpath() that load() did: it has been moved to
evalfile() only.

with help, fixes and ok tb@

Revision 1.177 / (download) - annotate - [select for diffs], Thu Oct 20 18:59:24 2022 UTC (18 months, 4 weeks ago) by op
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.176: +4 -1 lines
Diff to previous 1.176 (colored)

add zap-to-char and zap-up-to-char; bind zap-to-char to M-z.

ok florian@

Revision 1.176 / (download) - annotate - [select for diffs], Thu May 6 14:16:12 2021 UTC (3 years 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
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored)

Add the line number of an error to error messages.

Revision 1.175 / (download) - annotate - [select for diffs], Thu May 6 12:44:21 2021 UTC (3 years ago) by lum
Branch: MAIN
Changes since 1.174: +2 -1 lines
Diff to previous 1.174 (colored)

Add a number to parameters for ewprintf() via beeping.

Revision 1.174 / (download) - annotate - [select for diffs], Mon May 3 12:18:43 2021 UTC (3 years ago) by lum
Branch: MAIN
Changes since 1.173: +14 -1 lines
Diff to previous 1.173 (colored)

When parsing a variable value within double quotes, allow an escaped
\" to be accomodated for. Also, move the variable structure to be
global in scope within mg.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Apr 22 19:50:55 2021 UTC (3 years ago) by lum
Branch: MAIN
Changes since 1.172: +2 -1 lines
Diff to previous 1.172 (colored)

Add a non-interactive version of query-replace-regexp function called
replace-regexp. Unfortunately query-replace-regexp can't be used in a
startup file.

Revision 1.172 / (download) - annotate - [select for diffs], Tue Apr 20 10:02:50 2021 UTC (3 years ago) by lum
Branch: MAIN
Changes since 1.171: +2 -1 lines
Diff to previous 1.171 (colored)

Add 'dired-jump' from Philip K. <philip@warpmail.net> sent to tech@
over a year ago. Comments and testing from gkoehler@. Thanks to both.
Also, some modifications from me.

Revision 1.171 / (download) - annotate - [select for diffs], Thu Mar 25 12:46:11 2021 UTC (3 years, 1 month ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.170: +3 -3 lines
Diff to previous 1.170 (colored)

Use length of line to indicate end of characters to process in
foundparen(). No intended functional change. regress tests ok and they
all use excline().

Revision 1.170 / (download) - annotate - [select for diffs], Sun Mar 21 12:56:16 2021 UTC (3 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

Add quoted strings capability in list values, no special chars
detection in between them though.  Add limitation to characters
allowed in symbol names, equivalent to mg function names (A-Za-z-),
quite restrictive but can grow of course. If value is not quoted and
is not a variable, give an error.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Mar 20 09:00:49 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.168: +2 -1 lines
Diff to previous 1.168 (colored)

Add a 'batch' mode to mg via the '-b' command line option which will
initialise a pty, run the specified file of mg commands and then exit.

This is to facilitate mg fitting into the OpenBSD regress test
framework and be able to run via a cron job.

Revision 1.168 / (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.167: +3 -1 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Tue Feb 23 08:10:51 2021 UTC (3 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

Allow the user to specify a path to the mg startup file on the command line.

Revision 1.166 / (download) - annotate - [select for diffs], Sun Feb 9 10:13:13 2020 UTC (4 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.165: +6 -10 lines
Diff to previous 1.165 (colored)

Do not define variables in def.h since this will lead to duplicate definitions
in every source file that includes def.h
Found by gcc10 in portable in gentoo and fedora.
Patch from Ulrich Mueller (ulm AT gentoo.org) via Han Boetes, thanks!
Ok tb

Revision 1.165 / (download) - annotate - [select for diffs], Thu Jul 18 10:55:11 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.164: +20 -20 lines
Diff to previous 1.164 (colored)

Make indentation consistent. This has been bugging me for a while now.

Revision 1.164 / (download) - annotate - [select for diffs], Thu Jul 18 05:57:48 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.163: +7 -1 lines
Diff to previous 1.163 (colored)

Add some more basic interpreter functionality to mg. Needs a lot more
work, including a proper parser.

Revision 1.163 / (download) - annotate - [select for diffs], Wed Jul 17 18:18:37 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.162: +3 -1 lines
Diff to previous 1.162 (colored)

Add two dobeep functions to make calls to the system bell require
fewer lines. While working in extend.c change relevant calls to
dobeep.

Revision 1.162 / (download) - annotate - [select for diffs], Wed Jul 3 18:11:07 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.161: +2 -1 lines
Diff to previous 1.161 (colored)

selfinsert() can't be called directly from a startup file or by
'eval-current-buffer' since it is by design, meant to be called interactively
as characters are typed in a buffer. ask_selfinsert() allows selfinsert() to
be used by excline(). Having ask_selfinsert() helps with regression testing.
No manual page entry since use case is a bit obscure. See 'insert' command.

Revision 1.161 / (download) - annotate - [select for diffs], Tue Jul 2 16:25:39 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.160: +1 -2 lines
Diff to previous 1.160 (colored)

I totally forgot about the instance where blink-and-insert can be
called from the mg startup file. My previous diff broke that instance.
So this diff reverts my change but adds a man page line to
blink-and-insert in case someone should try to use it interactively,
again.  Also, should anyone ever want to add an interactive version of
blink-and-insert in the future, the code is there. And the code could
be useful in another, related instance.

Revision 1.160 / (download) - annotate - [select for diffs], Wed Jun 26 16:42:30 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.159: +2 -1 lines
Diff to previous 1.159 (colored)

This diff makes blink-and-insert do as the man page says it should do.
If you do 'M-x blink-and-insert', you are asked for a character. mg
will then insert it at the current cursor position and then search
backwards for a corresponding match.

Revision 1.159 / (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.158: +3 -3 lines
Diff to previous 1.158 (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.158 / (download) - annotate - [select for diffs], Sat Jun 22 10:21:57 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.157: +2 -2 lines
Diff to previous 1.157 (colored)

This diff moves the check for a newline at the end of a buffer (when
saving it) earlier. This means data doesn't 'disappear' from the file
on disk while the user answers 'yes' or 'no'.

Revision 1.157 / (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.156: +3 -1 lines
Diff to previous 1.156 (colored)

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

Revision 1.156 / (download) - annotate - [select for diffs], Wed Aug 29 07:50:16 2018 UTC (5 years, 8 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.155: +2 -1 lines
Diff to previous 1.155 (colored)

Add set-case-replaced to toggle case-preserving replace on or off.

By default, replacing "foo" with "bar" turns "FOO" into "BAR".
With case-replace turned off, "FOO" will turn into "bar".

OK florian@ tb@

Revision 1.155 / (download) - annotate - [select for diffs], Thu Apr 14 17:05:32 2016 UTC (8 years, 1 month ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.154: +3 -1 lines
Diff to previous 1.154 (colored)

Add 'sentence-end-double-space'.

If you prefer "lighter" punctuation and one space between sentences,
for example:

Mr and Mrs Jones are from the UK. They arrived today.

over more liberal use of full stops and double spaces between
sentences:

Mr. and Mrs. Jones are from the U.K.  They arrived today.

then toggling 'sentence-end-double-space' will make mg's
fill-paragraph function format text using one space instead of two
(the default) between sentences. However, be careful, should you have
a double spaced document and accidentally "format" it to have single
spaces, then you may have a problem. mg won't be able to revert the
formatting for you (unless you have a previous version of the text in
the "undo" history, or are using mg's backup facility and haven't
opened and saved multiple times!).

Comments from schwarze@

Revision 1.154 / (download) - annotate - [select for diffs], Sat Jan 2 10:39:19 2016 UTC (8 years, 4 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.153: +2 -1 lines
Diff to previous 1.153 (colored)

Add dired-find-alternate-file.

Revision 1.153 / (download) - annotate - [select for diffs], Tue Dec 29 19:44:32 2015 UTC (8 years, 4 months ago) by lum
Branch: MAIN
Changes since 1.152: +2 -1 lines
Diff to previous 1.152 (colored)

Add transpose-words, ok jasper@.
Limited to one iteration until 'undo' is looked into.

Revision 1.152 / (download) - annotate - [select for diffs], Thu Oct 29 19:46:47 2015 UTC (8 years, 6 months ago) by lum
Branch: MAIN
Changes since 1.151: +2 -1 lines
Diff to previous 1.151 (colored)

Fix opening dired from the command line. Incorrect cursor placement
and make the error more useful when there is a problem opening a
directory. Reported by and ok jasper@

Revision 1.151 / (download) - annotate - [select for diffs], Mon Oct 12 19:08:39 2015 UTC (8 years, 7 months ago) by lum
Branch: MAIN
Changes since 1.150: +3 -2 lines
Diff to previous 1.150 (colored)

Maintain a list of files marked for deletion while refreshing a dired
buffer. Previously, when refreshing the buffer the files marked for
deletion would be lost.

Since the relationship between the files that have been marked for
deletion and those that exist on disk is volatile, I have chosen to
implement the discovery of marked files during the refresh function as
opposed to maintaining a dired buffer specific list.

Revision 1.150 / (download) - annotate - [select for diffs], Tue Sep 29 02:07:49 2015 UTC (8 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.149: +3 -2 lines
Diff to previous 1.149 (colored)

Mark eread(), veread(), and eformat() as printf-like and
Convert eread(buf, a2, a3, a4) to eread("%s", a2, a3, a4, buf)

ok millert@ lum@

Revision 1.149 / (download) - annotate - [select for diffs], Sat Sep 26 15:03:15 2015 UTC (8 years, 7 months ago) by lum
Branch: MAIN
Changes since 1.148: +2 -1 lines
Diff to previous 1.148 (colored)

Add transpose-paragraphs. ok jasper@

Revision 1.148 / (download) - annotate - [select for diffs], Thu Sep 24 07:07:59 2015 UTC (8 years, 7 months ago) by lum
Branch: MAIN
Changes since 1.147: +2 -1 lines
Diff to previous 1.147 (colored)

Add mark-paragraph. ok jasper@

Revision 1.147 / (download) - annotate - [select for diffs], Wed Jun 3 23:40:01 2015 UTC (8 years, 11 months ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.146: +2 -12 lines
Diff to previous 1.146 (colored)

Remove unused defines and functions.
"Looks fine." deraadt@

Revision 1.146 / (download) - annotate - [select for diffs], Fri May 8 12:35:08 2015 UTC (9 years ago) by bcallah
Branch: MAIN
Changes since 1.145: +1 -2 lines
Diff to previous 1.145 (colored)

Remove ereply prototype since it is never used. Tweak a comment to reflect
ereply removal.
ok jasper@ florian@

Revision 1.145 / (download) - annotate - [select for diffs], Wed Mar 25 20:53:31 2015 UTC (9 years, 1 month ago) by bcallah
Branch: MAIN
Changes since 1.144: +1 -3 lines
Diff to previous 1.144 (colored)

unifdef -U NO_DPROMPT and GOSREC.
NO_DPROMPT has been around since the import of mg2a and it has never been
considered a "(Common) compile-time option" in the Makefile.
Assume everyone has been running mg this way since at least 2000 if not
already in the 90s.

Same with GOSREC. Has always been there but it looks like no one noticed
it (and no one was running with it). Indeed, the mg tutorial appears to be
oblivious to GOSREC being an option.

With this commit there are no more #ifndef blocks in mg. Only a couple of
#ifdef blocks remain.

ok lum@

Revision 1.144 / (download) - annotate - [select for diffs], Wed Mar 25 12:25:36 2015 UTC (9 years, 1 month ago) by bcallah
Branch: MAIN
Changes since 1.143: +11 -2 lines
Diff to previous 1.143 (colored)

We really don't need ttydef.h -- it is like sysdef.h -- once useful because
supported a lot of systems and nothing was standardized. But now it only
4 defines. Move those defines into def.h since ttydef.h is only sourced in
def.h

While here, MAKEBACKUP has the same #ifdef dance that LINENOMODE had. Set
it directly to TRUE and remove the #ifdef block.

ok florian@

Revision 1.143 / (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.142: +19 -3 lines
Diff to previous 1.142 (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.142 / (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.141: +2 -2 lines
Diff to previous 1.141 (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.141 / (download) - annotate - [select for diffs], Thu Apr 3 20:17:12 2014 UTC (10 years, 1 month ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.140: +3 -2 lines
Diff to previous 1.140 (colored)

When finding a file in a non-existant directory:

C-x C-f ~/no/dir/here/fn

offer to make the directory by pressing 'y', instead of suggesting the
make-directory command. ok jasper@

Revision 1.140 / (download) - annotate - [select for diffs], Sat Mar 22 11:05:37 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.139: +1 -2 lines
Diff to previous 1.139 (colored)

donebell is no longer required.

Revision 1.139 / (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.138: +2 -2 lines
Diff to previous 1.138 (colored)

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

Revision 1.138 / (download) - annotate - [select for diffs], Fri May 31 18:03:43 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.137: +11 -2 lines
Diff to previous 1.137 (colored)

Make the system bell toggleable via 'audible-bell', and if switched
off, make available an alternative 'visible-bell'.

ok florian@ jasper@ Feedback Sunil Nimmagadda.

Revision 1.137 / (download) - annotate - [select for diffs], Thu May 30 04:17:25 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.136: +2 -1 lines
Diff to previous 1.136 (colored)

Reuse the makedir() function in dir.c for dired's
dired-create-directory command.
ok jasper@

Revision 1.136 / (download) - annotate - [select for diffs], Wed May 22 19:23:45 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.135: +2 -1 lines
Diff to previous 1.135 (colored)

Shuffle shell-command-on-region around to give shell-command.
ok florian@ jasper@
Testing Sunil Nimmagadda

Revision 1.135 / (download) - annotate - [select for diffs], Mon Mar 25 11:41:44 2013 UTC (11 years, 1 month ago) by florian
Branch: MAIN
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

Display the window's column number in mode line not the
column number of the active window.
OK jasper@

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

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

Revision 1.133 / (download) - annotate - [select for diffs], Thu Dec 27 18:49:59 2012 UTC (11 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.132: +3 -1 lines
Diff to previous 1.132 (colored)

Move code for shell-command-on-region around to make pipeio() usable
in other functions.
ok jasper@, benno@

Revision 1.132 / (download) - annotate - [select for diffs], Tue Dec 4 10:54:20 2012 UTC (11 years, 5 months ago) by florian
Branch: MAIN
Changes since 1.131: +2 -1 lines
Diff to previous 1.131 (colored)

Bring back column numbers and make them configurable, off by default
to not kill slow serial lines.
Committing my independently written, slightly different version, as
requested by jasper@.

OK jasper@, OK reyk@ for jasper@'s version of the diff
"Sure, if you think so then." deraadt@

Revision 1.131 / (download) - annotate - [select for diffs], Tue Nov 27 19:46:46 2012 UTC (11 years, 5 months ago) by jasper
Branch: MAIN
Changes since 1.130: +2 -1 lines
Diff to previous 1.130 (colored)

- add 'make-directory' (not bound to any shortcut).

feedback from florian@ lum@
ok florian@

Revision 1.130 / (download) - annotate - [select for diffs], Tue Nov 27 19:45:01 2012 UTC (11 years, 5 months ago) by jasper
Branch: MAIN
Changes since 1.129: +2 -1 lines
Diff to previous 1.129 (colored)

- move prototype of expandtilder() to def.h; needed by an upcoming diff.

Revision 1.129 / (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.128: +1 -2 lines
Diff to previous 1.128 (colored)

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

ok lum, jasper, benno

Revision 1.128 / (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.127: +2 -2 lines
Diff to previous 1.127 (colored)

This should be void.

Revision 1.127 / (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.126: +4 -1 lines
Diff to previous 1.126 (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.126 / (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.125: +3 -1 lines
Diff to previous 1.125 (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.125 / (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.124: +2 -1 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Thu Jun 14 17:21:22 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.123: +3 -1 lines
Diff to previous 1.123 (colored)

Allow mg to save backup files to a users home directory.
Suggestions from eric@ and Sunil Nimmagadda.
Remarks deraadt@.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Jun 7 15:15:04 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.122: +19 -1 lines
Diff to previous 1.122 (colored)

Add some cscope support to mg. From Sunil Nimmagadda.  Due to some
structural limitations in mg, mg doesn't behave exactly the same as
emacs cscope (see the README) but is still very usable.

man page bits reviewed by jmc@, otherwise tested and reviewed by
myself.

Revision 1.122 / (download) - annotate - [select for diffs], Tue May 29 05:40:36 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.121: +4 -4 lines
Diff to previous 1.121 (colored)

Increase the size of some window variables from char to int. This diff
improves mg on screens (xterms) with lots of lines.  Testing done by
naddy@ and myself.

Revision 1.121 / (download) - annotate - [select for diffs], Fri May 25 04:56:58 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.120: +8 -8 lines
Diff to previous 1.120 (colored)

Remove static FILE pointer used for handling files in fileio.c. Pass
by reference instead. This allows the mg startup file to open other
files without unexpected things happening.

Discussed with Sunil Nimmagadda.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Apr 12 04:47:59 2012 UTC (12 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.119: +1 -9 lines
Diff to previous 1.119 (colored)

Remove the conditional directives NO_MACRO and NO_STARTUP.
They have not compiled for numerous years.
ok kjell@ millert@

Revision 1.119 / (download) - annotate - [select for diffs], Wed Apr 11 17:51:10 2012 UTC (12 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.118: +3 -1 lines
Diff to previous 1.118 (colored)

Add:
 1. C-x h to mark whole buffer.
 2. M-| to pipe current region to external command.
From Sunil Nimmagadda.

Feedback from deraadt@ and myself. ok for man page amendments from jmc@

Revision 1.118 / (download) - annotate - [select for diffs], Sat Dec 10 14:09:48 2011 UTC (12 years, 5 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.117: +1 -3 lines
Diff to previous 1.117 (colored)

mail.c was removed 3 yrs 5 months ago.

Revision 1.117 / (download) - annotate - [select for diffs], Mon Nov 28 04:41:39 2011 UTC (12 years, 5 months ago) by lum
Branch: MAIN
Changes since 1.116: +7 -2 lines
Diff to previous 1.116 (colored)

Add some ctags support to mg. From Sunil Nimmagadda.

Man page review and suggestions from jmc@

Revewied and tested by myself, and ok deraadt@

Revision 1.116 / (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_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.115: +2 -1 lines
Diff to previous 1.115 (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.115 / (download) - annotate - [select for diffs], Tue Jan 18 16:25:40 2011 UTC (13 years, 4 months ago) by kjell
Branch: MAIN
Changes since 1.114: +2 -1 lines
Diff to previous 1.114 (colored)

Add join-line, bound to M-^
Join the current line to the previous.

original diff by Henri Kemppainen. minor mod to add undo boundaries.
Thanks!

Revision 1.114 / (download) - annotate - [select for diffs], Mon Jan 17 03:12:06 2011 UTC (13 years, 4 months ago) by kjell
Branch: MAIN
Changes since 1.113: +2 -1 lines
Diff to previous 1.113 (colored)

Add back-to-indentation. (M-m)
Move the dot to the first non-whitespace character on the current line.
from Henri Kemppainen . ok theo

Revision 1.113 / (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.112: +4 -3 lines
Diff to previous 1.112 (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.112 / (download) - annotate - [select for diffs], Fri Jun 5 18:02:06 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.111: +8 -6 lines
Diff to previous 1.111 (colored)

emacs handles the undo of a region kill (C-w) differently than a line kill
(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

Revision 1.111 / (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.110: +11 -5 lines
Diff to previous 1.110 (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.110 / (download) - annotate - [select for diffs], Thu Jun 4 23:31:47 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (colored)

Fix problem where line numbers get out of sync on a region-kill (C-w).
Noticed and ok matthieu@

Revision 1.109 / (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.108: +3 -3 lines
Diff to previous 1.108 (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.108 / (download) - annotate - [select for diffs], Mon Sep 15 16:13:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.107: +4 -4 lines
Diff to previous 1.107 (colored)

Expose the undo commands as proper mg functions.
This should have no functional change on undo, but it does facilitate
testing undo behavior.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Sep 15 16:11:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
Changes since 1.106: +7 -2 lines
Diff to previous 1.106 (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.106 / (download) - annotate - [select for diffs], Sat Jun 14 08:39:30 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.105: +2 -1 lines
Diff to previous 1.105 (colored)

Add compile (c-C c-P) to the c-mode keymap (export from grep.c)
Also, attempt to make indent an atomic undo operation.

Revision 1.105 / (download) - annotate - [select for diffs], Sat Jun 14 07:38:53 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.104: +2 -1 lines
Diff to previous 1.104 (colored)

unf*ck undo.
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.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Jun 13 19:10:17 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.103: +2 -1 lines
Diff to previous 1.103 (colored)

phessler noted that c-mode ignored blinking braces.
Add "c-handle-special-brace" which does a blink and indent, rather
than just a selfinsert and indent

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jun 12 01:58:44 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.102: +7 -1 lines
Diff to previous 1.102 (colored)

Introduce a basic c-mode to mg.

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

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jun 11 23:18:33 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.101: +4 -1 lines
Diff to previous 1.101 (colored)

Add delete-leading-space, delete-trailing-space,
indent-current-line utility functions for stripping leading/trailing
whitespace, and setting a fixed indent respectively.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jun 10 23:23:53 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.100: +2 -1 lines
Diff to previous 1.100 (colored)

Add a clear-mark function.
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@

Revision 1.100 / (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_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.99: +2 -1 lines
Diff to previous 1.99 (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.99 / (download) - annotate - [select for diffs], Wed Feb 21 23:33:12 2007 UTC (17 years, 3 months ago) by deanna
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

Fix a reference to WFHARD in a comment; it was renamed WFFULL months
ago.

ok kjell

Revision 1.98 / (download) - annotate - [select for diffs], Sun Nov 19 16:51:19 2006 UTC (17 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

spacing

Revision 1.97 / (download) - annotate - [select for diffs], Fri Nov 17 08:45:31 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.96: +3 -2 lines
Diff to previous 1.96 (colored)

Fix a needless inversion of flag names; i.e. change them from the
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@

Revision 1.96 / (download) - annotate - [select for diffs], Tue Aug 1 22:16:03 2006 UTC (17 years, 9 months ago) by jason
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.95: +1 -3 lines
Diff to previous 1.95 (colored)

* move sys/queue.h inclusion to sysdef.h (it's system specific)
* 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

Revision 1.95 / (download) - annotate - [select for diffs], Tue Jul 25 08:27:09 2006 UTC (17 years, 9 months ago) by kjell
Branch: MAIN
Changes since 1.94: +5 -1 lines
Diff to previous 1.94 (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.94 / (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.93: +3 -3 lines
Diff to previous 1.93 (colored)

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

Revision 1.93 / (download) - annotate - [select for diffs], Sat Jul 8 17:56:10 2006 UTC (17 years, 10 months ago) by kjell
Branch: MAIN
Changes since 1.92: +4 -2 lines
Diff to previous 1.92 (colored)

Introduce a 'MODIFIED' boundary type for undo records.
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.

Revision 1.92 / (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.91: +7 -1 lines
Diff to previous 1.91 (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.91 / (download) - annotate - [select for diffs], Thu Jun 1 05:34:52 2006 UTC (17 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

make // /~ path rewriting optional in adjustname() and use it everywhere
except for the command line specified files.  ok kjell,cloder

Revision 1.90 / (download) - annotate - [select for diffs], Mon May 29 00:02:23 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.89: +1 -1 lines
Diff to previous 1.89 (colored)

Another mnemonic rename, missed the first time.
Also missed the ok cloder.

Revision 1.89 / (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.88: +3 -3 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Sat May 27 21:20:11 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored)

Move mg "line to c-string" functionality to a function.

Revision 1.87 / (download) - annotate - [select for diffs], Mon May 8 21:24:24 2006 UTC (18 years ago) by kjell
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

spacing

Revision 1.86 / (download) - annotate - [select for diffs], Tue May 2 17:10:25 2006 UTC (18 years ago) by kjell
Branch: MAIN
Changes since 1.85: +7 -4 lines
Diff to previous 1.85 (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.85 / (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.84: +2 -1 lines
Diff to previous 1.84 (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.84 / (download) - annotate - [select for diffs], Mon Apr 3 02:43:22 2006 UTC (18 years, 1 month ago) by kjell
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

fixed "text in message line would get stuck there" issue.
feedback from Philip Guenther and Han Boetes

Revision 1.83 / (download) - annotate - [select for diffs], Sat Feb 25 14:40:16 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.82: +2 -1 lines
Diff to previous 1.82 (colored)

Fix a coredump occurring when the terminal is resized while mg is
suspended. Problem reported and fixed tested by reyk@; tweak by
kjell@; ok kjell@

Revision 1.82 / (download) - annotate - [select for diffs], Tue Dec 20 06:17:36 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Tue Dec 13 07:20:13 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

Last round of easy delinting.

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

More name-clash delinting

Revision 1.79 / (download) - annotate - [select for diffs], Tue Dec 13 05:23:03 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

If you're going to pass a length parameter, you should use it.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Nov 22 05:02:44 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.77: +6 -3 lines
Diff to previous 1.77 (colored)

Move kill-related commands to their own file.
This will help move to a kill-ring.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Nov 20 03:24:17 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.76: +3 -8 lines
Diff to previous 1.76 (colored)

toast NO_DIRED #ifdef; ok kjell

Revision 1.76 / (download) - annotate - [select for diffs], Fri Nov 18 23:37:30 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.75: +2 -1 lines
Diff to previous 1.75 (colored)

Split kill buffer code into a separate function.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Nov 18 23:15:00 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.74: +9 -10 lines
Diff to previous 1.74 (colored)

clean up some comments after theo's cleanup

Revision 1.74 / (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.73: +296 -296 lines
Diff to previous 1.73 (colored)

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

Revision 1.73 / (download) - annotate - [select for diffs], Fri Nov 18 17:35:17 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

Casefold on replace was killed ages ago (it was wrong). Remove a
leftover (unused) variable.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Nov 7 23:32:20 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.71: +1 -13 lines
Diff to previous 1.71 (colored)

Move most of the dired hooks into dired.c.  While here, enable some
dired functions that were written, but not bound to keys. No other
functional change.

Tested by Han Boetes.

Revision 1.71 / (download) - annotate - [select for diffs], Fri Oct 14 06:41:47 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.70: +4 -3 lines
Diff to previous 1.70 (colored)

move the dired routines into dired.c where they belong.
ok cloder@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Oct 13 20:23:01 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.69: +2 -1 lines
Diff to previous 1.69 (colored)

Make dired buffer read-only by default.
Noticed by Han Boetes

Revision 1.69 / (download) - annotate - [select for diffs], Thu Oct 13 19:46:45 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.68: +4 -1 lines
Diff to previous 1.68 (colored)

Use dired mode automatically if file specified for loading is
a directory. Modified version of patch from Han Boetes.
ok cloder@

Revision 1.68 / (download) - annotate - [select for diffs], Thu Oct 13 05:24:52 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

Make mg's grep and compile more path-aware, by defaulting to
the path of the invoking buffer.
Also, make subshell output look more like emacs (show directory,
completion time). oked at one point by deraadt@

Revision 1.67 / (download) - annotate - [select for diffs], Tue Oct 11 01:08:53 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.66: +5 -5 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Tue Oct 11 00:50:00 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.65: +4 -1 lines
Diff to previous 1.65 (colored)

Enable the 'next-error' (C-x `) keybinding by default.
Niklas, this one is for you.
ok deraadt@, cloder@

Revision 1.65 / (download) - annotate - [select for diffs], Thu Oct 6 16:48:00 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

Make mg undo much more emacs like (and correct).
Undo boundaries are now placed at newlines, and undo
of search-replace works as expected. Fixes bad behaviour
reported by matthieu

Ok deraadt@, beck@

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

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

Revision 1.63 / (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.62: +2 -1 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Mon May 30 13:13:50 2005 UTC (18 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.61: +2 -1 lines
Diff to previous 1.61 (colored)

add find-alternate-file command and binding for ^X^V; ok cloder
(you're welcome kjell)

Revision 1.61 / (download) - annotate - [select for diffs], Fri May 27 08:08:18 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored)

Add emacs-style replace-string function that does not prompt you
to confirm replacements.
OK jason, deraadt

Revision 1.60 / (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.59: +33 -34 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Sat Mar 12 06:16:07 2005 UTC (19 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

spacing

Revision 1.58 / (download) - annotate - [select for diffs], Thu Mar 10 18:27:47 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.57: +2 -3 lines
Diff to previous 1.57 (colored)

fix more BACKUP/NOBACKUP/NO_BACKUP confusion, again no binary change.
spotted by jmc@

Revision 1.57 / (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.56: +3 -2 lines
Diff to previous 1.56 (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.56 / (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.55: +3 -3 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Fri Jul 9 13:50:39 2004 UTC (19 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored)

when saving a file, check whether it is newline terminated and if it is not,
prompt the user and add the newline if he agrees.

tested by a lot of helpful tech@ guys, approved by henning

Revision 1.54 / (download) - annotate - [select for diffs], Tue Jan 27 23:43:37 2004 UTC (20 years, 3 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.53: +3 -1 lines
Diff to previous 1.53 (colored)

make mail-mode more intelligent on middle-of-line insertions, and add a
comment to change the wrapping column. (mail-set-margin)

tested by henning and phessler, thanks!

Revision 1.53 / (download) - annotate - [select for diffs], Sat Nov 29 17:28:40 2003 UTC (20 years, 5 months ago) by vincent
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

save the previous undo position as an offset in the buffer instead of
a line/offset pair

Revision 1.52 / (download) - annotate - [select for diffs], Sun Nov 9 01:11:14 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

remove the only use of the hackish undo_add_custom function.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Nov 9 00:20:06 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
Changes since 1.50: +1 -2 lines
Diff to previous 1.50 (colored)

remove unused structure element

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 27 11:21:12 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored)

fix crash on startup by using the good allocation routine in edinit()

spotted and ok by henning

Revision 1.49 / (download) - annotate - [select for diffs], Tue Oct 21 22:48:07 2003 UTC (20 years, 7 months ago) by vincent
Branch: MAIN
Changes since 1.48: +19 -17 lines
Diff to previous 1.48 (colored)

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

Revision 1.48 / (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.47: +3 -1 lines
Diff to previous 1.47 (colored)

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

Revision 1.47 / (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.46: +4 -4 lines
Diff to previous 1.46 (colored)

protos

ok deraadt

Revision 1.46 / (download) - annotate - [select for diffs], Mon May 5 11:12:07 2003 UTC (21 years ago) by vincent
Branch: MAIN
Changes since 1.45: +4 -1 lines
Diff to previous 1.45 (colored)

add a mail-mode, to do automatic line-wrapping.

(at the same time, change the command line parsing to support a
 -f <mode> that is slightly different from the one in gnu emacs,
we apply it to all buffers created from command line arguments,
so you can use "mg -f mail-mode" as your editor. manpage change
coming soon)

ok henning

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jan 6 17:04:09 2003 UTC (21 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

support +number; rewritten from buggy code by mjc@bitz.ca, vincent ok

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 24 14:08:33 2002 UTC (21 years, 10 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.43: +1 -2 lines
Diff to previous 1.43 (colored)

 remove the CHANGE undo record type, use a combination of delete and insert
to have the same behavior in a simpler way.

 ok art@

Revision 1.43 / (download) - annotate - [select for diffs], Mon Jul 1 14:33:44 2002 UTC (21 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.42: +11 -11 lines
Diff to previous 1.42 (colored)

KNF + ansi; from zyrnix (only the easy part of his diffs)

Revision 1.42 / (download) - annotate - [select for diffs], Fri Jun 21 00:54:55 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

remove the "extern" for a variable that does not exist anymore.

Revision 1.41 / (download) - annotate - [select for diffs], Wed May 29 12:41:42 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.40: +6 -1 lines
Diff to previous 1.40 (colored)

 add an "auto-execute" feature, that allows binding function calls to
certain patterns. for example, `auto-execute "*.c" auto-indent-mode'.

 ok art@

Revision 1.40 / (download) - annotate - [select for diffs], Wed May 29 12:32:51 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

 add a function to visit a file read-only mapped to C-x C-v

 ok art@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Mar 18 01:45:54 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.38: +16 -15 lines
Diff to previous 1.38 (colored)

 Enter the new undo code.  it is still disabled since it has bugs, but it's
somewhat more useful....

 ok millert@ + no objections on ICB

Revision 1.38 / (download) - annotate - [select for diffs], Sat Mar 16 20:29:21 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

 This should've been commited yesterday, before the funmap change.

 ok millert@

Revision 1.37 / (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.36: +5 -1 lines
Diff to previous 1.36 (colored)

 add readonly buffer support
 plus some KNF

 ok art@

Revision 1.36 / (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.35: +10 -10 lines
Diff to previous 1.35 (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.35 / (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.34: +5 -4 lines
Diff to previous 1.34 (colored)

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

Revision 1.34 / (download) - annotate - [select for diffs], Thu Feb 21 15:27:29 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

KNF

Revision 1.33 / (download) - annotate - [select for diffs], Thu Feb 21 04:21:05 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored)

 Save undo records for newline insertions.

 That makes mg behave more like GNU emacs.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Feb 21 04:16:27 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)


 Don't ignore the argument to undo. (makes ^U work)

Revision 1.31 / (download) - annotate - [select for diffs], Thu Feb 21 00:02:04 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +3 -1 lines
Diff to previous 1.30 (colored)

signal-safe window size changing

Revision 1.30 / (download) - annotate - [select for diffs], Wed Feb 20 22:30:54 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.29: +35 -2 lines
Diff to previous 1.29 (colored)

 Add undo code to mg.

 needs further hacking.

 ok `whole bunch of people on icb'@

Revision 1.29 / (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.28: +224 -224 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Thu Feb 14 22:58:20 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

d_makename now takes a length parameter so we can remove the
strcpy call.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Feb 14 13:41:44 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

spelling

Revision 1.26 / (download) - annotate - [select for diffs], Wed Feb 13 22:36:58 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.25: +3 -7 lines
Diff to previous 1.25 (colored)

 Make mg malloc the l_text element instead of reallocating whole LINE
 structures all the time.

Revision 1.25 / (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.24: +2 -2 lines
Diff to previous 1.24 (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.24 / (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.23: +2 -1 lines
Diff to previous 1.23 (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.23 / (download) - annotate - [select for diffs], Thu Jan 10 12:13:35 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.22: +1 -2 lines
Diff to previous 1.22 (colored)

Clean up tty resizing code.
Catch SIGWINCH and resize and refresh the screen.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jan 8 12:29:27 2002 UTC (22 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

typo; mjc@bitz.ca

Revision 1.21 / (download) - annotate - [select for diffs], Thu May 24 10:43:16 2001 UTC (23 years ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.20: +0 -1 lines
Diff to previous 1.20 (colored)

Make the keymap/mode table growable in runtime.

Revision 1.20 / (download) - annotate - [select for diffs], Thu May 24 10:10:00 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.19: +1 -0 lines
Diff to previous 1.19 (colored)

Add a missing piece of something I committed by accident that I
planned to add later.

A new flag to veread (and caller) called EFDEF that indicates that
when a user is prompted for input, a default value is given from start
in the output buffer.

Revision 1.19 / (download) - annotate - [select for diffs], Thu May 24 09:47:33 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.18: +1 -4 lines
Diff to previous 1.18 (colored)

Break out function -> name mappings to an own file.
Add a possibility to dynamically extend the function table.

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

spaces

Revision 1.17 / (download) - annotate - [select for diffs], Wed May 23 23:29:47 2001 UTC (23 years ago) by mickey
Branch: MAIN
Changes since 1.16: +3 -4 lines
Diff to previous 1.16 (colored)

cinfo is const, keyname() and findbind() take buffer size to use strlcpy vs cpy+len

Revision 1.16 / (download) - annotate - [select for diffs], Wed May 23 22:20:35 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.15: +33 -52 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Wed May 23 21:59:45 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

No need to export nfunct and functnames now that help doesn't use them
anymore. nfunct isn't used anywhere.

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 23 21:42:34 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

export free_file_list. XXX - it doesn't belong in echo.c and it's the wrong name.

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

kill complete_function. Not used anymore.

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

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

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

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

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

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

Revision 1.9 / (download) - annotate - [select for diffs], Thu May 3 20:40:22 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Add a delay (in miliseconds) argument to ttwait.

Revision 1.8 / (download) - annotate - [select for diffs], Thu May 3 12:57:22 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

 * Let make_file_list always append a '/' at the end of directories.
   This makes filename TAB-completion more useful, now you don't need to
   write that '/' manually.
 * random cleanups including using snprintf and memcmp where open-coded
   equivalents were used, waitpid instead of 'while (wait() != pid);', etc.

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

raise the file name and buffer name sizes

Revision 1.6 / (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.5: +2 -0 lines
Diff to previous 1.5 (colored)

$OpenBSD$

Revision 1.5 / (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.4: +306 -185 lines
Diff to previous 1.4 (colored)

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

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

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

Revision 1.3 / (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.2: +7 -7 lines
Diff to previous 1.2 (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.2 / (download) - annotate - [select for diffs], Fri Feb 25 19:13:21 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +0 -6 lines
Diff to previous 1.1 (colored)

further pruning

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.