OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.50 / (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_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.49: +1 -8 lines
Diff to previous 1.49 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Dec 26 19:16:02 2022 UTC (16 months, 3 weeks ago) by jmc
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

spelling fixes; from paul tagliamonte
amendments to his diff are noted on tech

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

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

ok florian@

Revision 1.47 / (download) - annotate - [select for diffs], Wed Jul 11 12:21:37 2018 UTC (5 years, 10 months ago) by krw
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, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored)

When in incremental search handle ^M (a.k.a. <cr>) like ^[ (a.k.a.
<esc>). i.e. exit incremental search and set the mark. This is what
emacs does.

pointers, suggestions and ok florian@

Revision 1.46 / (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_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

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

From Scott Cheloha <scottcheloha@gmail.com>

ok florian@

Revision 1.45 / (download) - annotate - [select for diffs], Tue May 30 07:05:22 2017 UTC (6 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.44: +8 -8 lines
Diff to previous 1.44 (colored)

fix -Wshadow warnings.
Found by bcallah, thanks!

Revision 1.44 / (download) - annotate - [select for diffs], Thu Mar 19 21:22:15 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.43: +6 -3 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Thu Mar 20 07:47:29 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.42: +9 -1 lines
Diff to previous 1.42 (colored)

Add some missing dobeeps.
ok florian@

Revision 1.42 / (download) - annotate - [select for diffs], Fri May 31 18:03:45 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.41: +14 -14 lines
Diff to previous 1.41 (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.41 / (download) - annotate - [select for diffs], Fri Sep 7 19:01:56 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.40: +6 -3 lines
Diff to previous 1.40 (colored)

Make C-r not screw up the line counter if the pattern ends up not
matching.

More goodness from Florian Obser. (and a tweak by me)

Revision 1.40 / (download) - annotate - [select for diffs], Fri May 25 05:16:59 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.39: +25 -17 lines
Diff to previous 1.39 (colored)

Allow searching (C-s or C-r) to wrap around the ends of a buffer.
Even if the search string is located at the beginning or end of a
buffer.

Revision 1.39 / (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.38: +1 -7 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jan 21 19:10:13 2011 UTC (13 years, 4 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.37: +2 -1 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Thu Jun 4 02:23:37 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.36: +9 -9 lines
Diff to previous 1.36 (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.36 / (download) - annotate - [select for diffs], Thu Jun 12 21:58:33 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.35: +11 -3 lines
Diff to previous 1.35 (colored)

incremental search isn't allowed in macros, so if your fingers
automatically go there during a macro def, the macro recording
is CANCELED. This sucks rocks.

This fixes the incremental searches to
automagically invoke the non-incremental varieties during
macro recording and playback.

ok art

Revision 1.35 / (download) - annotate - [select for diffs], Tue Feb 13 17:50:26 2007 UTC (17 years, 3 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.34: +17 -19 lines
Diff to previous 1.34 (colored)

Fix a problem with wrapped incremental searches.
Basically, on wrap, the line pointer and offset would get out of sync, leading
to incorrect line numbers or a segfault.
Deanna Phillips did all the work of spotting it tracking it down to the
right function. Thanks!
While here, add emacs-like messages for wrapped and failed incremental
searches. Tested by Deanna.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Nov 18 22:46:16 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.33: +12 -4 lines
Diff to previous 1.33 (colored)

1. Fix line numbering/mark line bug in isearch.
To reproduce, set mark, move, isearch, then swap mark and point.
2. store mark in save structure (to reproduce search on a pattern twice,
 then backspace to back up the search stack)
Both from Peter De Wachter (debian bug#391827) Thanks!

Revision 1.33 / (download) - annotate - [select for diffs], Fri Nov 17 03:24:31 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.32: +11 -7 lines
Diff to previous 1.32 (colored)

fix a segfault on isearch. Using ^W to add more than NPAT chars to the
search pattern had an off-by-one. Fix this and one other irritating behavior
with long search patterns.
Noted (similar diff proposed) and tested by deanna phillips

Revision 1.32 / (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.31: +3 -3 lines
Diff to previous 1.31 (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.31 / (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.30: +7 -7 lines
Diff to previous 1.30 (colored)

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

Revision 1.30 / (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.29: +22 -4 lines
Diff to previous 1.29 (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.29 / (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.28: +3 -3 lines
Diff to previous 1.28 (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.28 / (download) - annotate - [select for diffs], Fri Feb 3 13:57:03 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

Fix off by one ocurring if ^W immediate follows ^S; testing marc@;
ok kjell@; PR 4991

Revision 1.27 / (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.26: +5 -2 lines
Diff to previous 1.26 (colored)

More name-clash delinting

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

do some silly de-linting

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

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

Revision 1.24 / (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.23: +5 -5 lines
Diff to previous 1.23 (colored)

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

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 11 01:00:41 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.22: +11 -10 lines
Diff to previous 1.22 (colored)

Allow the more traditional emacs keybindings during search/replace, too
(i.e. 'y' to accept, 'n' to skip, and <CR> to end)
ok deraadt@, cloder@

Revision 1.22 / (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.21: +4 -4 lines
Diff to previous 1.21 (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.21 / (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.20: +3 -1 lines
Diff to previous 1.20 (colored)

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

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 14 00:55:45 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.19: +5 -3 lines
Diff to previous 1.19 (colored)

Three more ereply that should be ereads. This fixes henning's "replace
with null string is busted" observation.

ok henning@, cloder@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 5 05:15:56 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

if functions permits null reply from minibuffer, use eread (with
EFNUL), not ereply.
ok cloder

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jun 3 15:16:22 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.17: +41 -2 lines
Diff to previous 1.17 (colored)

Like emacs, handle ^W during incremental search.  Pressing ^W during
search will add the rest of the word from the current buffer to the
pattern buffer.  Testing and comments by kjell and marc

Revision 1.17 / (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.16: +39 -1 lines
Diff to previous 1.16 (colored)

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

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

Fix dumb bug in initial prompt for search-forward
OK jason, kjell

Revision 1.15 / (download) - annotate - [select for diffs], Fri May 27 05:55:12 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.14: +5 -3 lines
Diff to previous 1.14 (colored)

Do not dump core if user hits ^g to exit minibuffer from search-forward.
Found by deraadt, ok kjell

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 25 23:04:39 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.13: +23 -3 lines
Diff to previous 1.13 (colored)

Incremental search will now wrap to beginning (or end if backwards) if
you hit the search key again after a failure. OK jason

Revision 1.13 / (download) - annotate - [select for diffs], Mon May 23 20:39:44 2005 UTC (19 years ago) by jason
Branch: MAIN
Changes since 1.12: +17 -9 lines
Diff to previous 1.12 (colored)

make ^S/^R behave like 'emacs': mixed case patterns forces a case sensitive
search.  all lower case patterns is a case insensitive search; ok art

Revision 1.12 / (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.11: +40 -41 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Thu Jul 22 01:25:25 2004 UTC (19 years, 10 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.10: +16 -14 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Tue May 20 03:08:55 2003 UTC (21 years ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.9: +21 -35 lines
Diff to previous 1.9 (colored)

Finish KNF of prototypes.  That should be all of them.
OK vincent@

Revision 1.9 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:49 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.8: +11 -11 lines
Diff to previous 1.8 (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.8 / (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.7: +4 -4 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Thu May 24 03:05:26 2001 UTC (23 years ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.6: +23 -23 lines
Diff to previous 1.6 (colored)

spaces

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

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

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 3 20:43:12 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.4: +9 -1 lines
Diff to previous 1.4 (colored)

Fix another annoying feature in mg. When I try to use the keypad to
escape from I-search (I don't know if it's legal, but it works in emacs)
the initial ESC in the sequence is caugth by I-search (which exits), but
not the rest of it which ends up written into the buffer.

This is extra annoying when we don't have undo.

Note that this is better than emacs because the ESC is removed if nothing
indicating a multi-char sequence comes within 300 miliseconds. (Try to ESC
from I-search in emacs and then press 'x').

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

$OpenBSD$

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

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

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

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

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 25 19:08:50 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.