summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/replace.el34
-rw-r--r--lisp/simple.el16
3 files changed, 14 insertions, 38 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 1c6b3d2bb2e..13693883ecf 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -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)))
diff --git a/lisp/replace.el b/lisp/replace.el
index 8b30b69bde1..01dbeb5558a 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1,8 +1,6 @@
;;; 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-after t))
+ (match-again 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
diff --git a/lisp/simple.el b/lisp/simple.el
index ce91a7840b7..59211c9db20 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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)