Commit ba343182 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

*** empty log message ***

parent e6dfdce5
......@@ -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 name hook exp count)
(forward-line 1)
(while (progn (forward-line 1)
(not (eolp)))
;;; 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
......@@ -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:
(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)
(if elt
......@@ -408,8 +410,12 @@ Whilst editing the command, the following commands are available:
"No preceding item in minibuffer history"))
(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))))
(if minibuffer-history-sexp-flag
(prin1-to-string elt)
(goto-char (point-min)))))
(defun previous-history-element (n)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment