Mercurial > emacs
changeset 862:46630543d659
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 24 Jul 1992 06:09:27 +0000 |
parents | 345296f94a1e |
children | 427299469901 |
files | lisp/abbrev.el lisp/replace.el lisp/simple.el |
diffstat | 3 files changed, 14 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/abbrev.el Fri Jul 24 05:00:23 1992 +0000 +++ b/lisp/abbrev.el Fri Jul 24 06:09:27 1992 +0000 @@ -125,7 +125,7 @@ (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)))
--- a/lisp/replace.el Fri Jul 24 05:00:23 1992 +0000 +++ b/lisp/replace.el Fri Jul 24 06:09:27 1992 +0000 @@ -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 @@ (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 @@ (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
--- a/lisp/simple.el Fri Jul 24 05:00:23 1992 +0000 +++ b/lisp/simple.el Fri Jul 24 06:09:27 1992 +0000 @@ -353,8 +353,9 @@ ;; (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 @@ 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 @@ "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)