Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ba343182
Commit
ba343182
authored
Jul 24, 1992
by
Richard M. Stallman
Browse files
*** empty log message ***
parent
e6dfdce5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
38 deletions
+14
-38
lisp/abbrev.el
lisp/abbrev.el
+1
-1
lisp/replace.el
lisp/replace.el
+2
-32
lisp/simple.el
lisp/simple.el
+11
-5
No files found.
lisp/abbrev.el
View file @
ba343182
...
...
@@ -125,7 +125,7 @@ the ones defined from the buffer now."
(while (and (not (eobp)) (re-search-forward "
^
(
" nil t))
(let* ((buf (current-buffer))
(table (read buf))
abbrevs)
abbrevs
name hook exp count
)
(forward-line 1)
(while (progn (forward-line 1)
(not (eolp)))
...
...
lisp/replace.el
View file @
ba343182
;;; replace.el --- replace commands for Emacs.
;; Copyright (C) 1985, 86, 87, 88, 89, 90, 91, 92 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
...
...
@@ -367,7 +365,7 @@ which will run faster and do exactly what you probably want."
(next-rotate-count 0)
(replace-count 0)
(lastrepl nil) ;Position after last match considered.
(match-a
fter
t))
(match-a
gain
t))
(if (stringp replacements)
(setq next-replacement replacements)
(or repeat-count (setq repeat-count 1)))
...
...
@@ -502,33 +500,5 @@ which will run faster and do exactly what you probably want."
(
if
replaced
(
setq
replace-count
(
1+
replace-count
)))
))
(
setq
lastrepl
(
point
))
)
(
and
keep-going
stack
)
))
(defun map-query-replace-regexp (regexp to-strings &optional arg)
"
Replace
some
matches
for
REGEXP
with
various
strings,
in
rotation.
The
second
argument
TO-STRINGS
contains
the
replacement
strings,
separated
by
spaces.
This
command
works
like
`
query-replace-regexp
'
except
that
each
successive
replacement
uses
the
next
successive
replacement
string,
wrapping
around
from
the
last
such
string
to
the
first.
Non-interactively,
TO-STRINGS
may
be
a
list
of
replacement
strings.
A
prefix
argument
N
says
to
use
each
replacement
string
N
times
before
rotating
to
the
next.
"
(interactive "
sMap
query
replace
(
regexp
)
:
\nsQuery
replace
%s
with
(
space-separated
strings
)
:
\nP
")
(let (replacements)
(if (listp to-strings)
(setq replacements to-strings)
(while (/= (length to-strings) 0)
(if (string-match "
" to-strings)
(setq replacements
(append replacements
(list (substring to-strings 0
(string-match "
" to-strings))))
to-strings (substring to-strings
(1+ (string-match "
" to-strings))))
(setq replacements (append replacements (list to-strings))
to-strings ""))))
(perform-replace regexp replacements t t nil arg))
(message "
Done
"
)
)
;;; replace.el ends here
lisp/simple.el
View file @
ba343182
...
...
@@ -353,8 +353,9 @@ the minibuffer, then read and evaluate the result."
;; (defvar repeat-complex-command nil)
(
defvar
minibuffer-history
nil
)
(
defvar
minibuffer-history-variable
'minibuffer-history
)
(
defvar
minibuffer-history-position
nil
)
(
defvar
minibuffer-history-sexp-flag
nil
)
(
setq
minibuffer-history-variable
'minibuffer-history
)
(
setq
minibuffer-history-position
nil
)
(
define-key
minibuffer-local-map
"\en"
'next-history-element
)
(
define-key
minibuffer-local-ns-map
"\en"
'next-history-element
)
...
...
@@ -380,8 +381,9 @@ it is added to the front of the command history.
Whilst editing the command, the following commands are available:
\\{repeat-complex-command-map}"
(
interactive
"p"
)
(
let
((
elt
(
nth
(
1-
repeat-complex-command-
arg
)
command-history
))
(
let
((
elt
(
nth
(
1-
arg
)
command-history
))
(
minibuffer-history-position
arg
)
(
minibuffer-history-sexp-flag
t
)
(
repeat-complex-command-flag
t
)
newcmd
)
(
if
elt
...
...
@@ -408,8 +410,12 @@ Whilst editing the command, the following commands are available:
"No preceding item in minibuffer history"
))
(
erase-buffer
)
(
setq
minibuffer-history-position
narg
)
(
insert
(
prin1-to-string
(
nth
(
1-
minibuffer-history-position
)
(
symbol-value
minibuffer-history-variable
))))
(
let
((
elt
(
nth
(
1-
minibuffer-history-position
)
(
symbol-value
minibuffer-history-variable
))))
(
insert
(
if
minibuffer-history-sexp-flag
(
prin1-to-string
elt
)
elt
))))
(
goto-char
(
point-min
))))
)
(
defun
previous-history-element
(
n
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment