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

entered into RCS

parent c7784735
...@@ -301,8 +301,8 @@ Default value, nil, means edit the string instead.") ...@@ -301,8 +301,8 @@ Default value, nil, means edit the string instead.")
(or minibuffer-local-isearch-map (or minibuffer-local-isearch-map
(let ((map (copy-keymap minibuffer-local-map))) (let ((map (copy-keymap minibuffer-local-map)))
(define-key map "\r" 'isearch-nonincremental-exit-minibuffer) (define-key map "\r" 'isearch-nonincremental-exit-minibuffer)
;; (define-key map "\M-n" 'isearch-ring-advance-edit) (define-key map "\M-n" 'isearch-ring-advance-edit)
;; (define-key map "\M-p" 'isearch-ring-retreat-edit) (define-key map "\M-p" 'isearch-ring-retreat-edit)
(define-key map "\M-\t" 'isearch-complete-edit) (define-key map "\M-\t" 'isearch-complete-edit)
(define-key map "\C-s" 'isearch-forward-exit-minibuffer) (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
(define-key map "\C-r" 'isearch-reverse-exit-minibuffer) (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
...@@ -555,8 +555,9 @@ is treated as a regexp. See \\[isearch-forward] for more info." ...@@ -555,8 +555,9 @@ is treated as a regexp. See \\[isearch-forward] for more info."
) )
(defun isearch-done () (defun isearch-done (&optional nopush)
;; Called by all commands that terminate isearch-mode. ;; Called by all commands that terminate isearch-mode.
;; If NOPUSH is non-nil, we don't push the string on the search ring.
(use-local-map isearch-old-local-map) (use-local-map isearch-old-local-map)
;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs
(isearch-dehighlight t) (isearch-dehighlight t)
...@@ -578,7 +579,7 @@ is treated as a regexp. See \\[isearch-forward] for more info." ...@@ -578,7 +579,7 @@ is treated as a regexp. See \\[isearch-forward] for more info."
(setq isearch-mode nil) (setq isearch-mode nil)
(set-buffer-modified-p (buffer-modified-p)) ;; update modeline (set-buffer-modified-p (buffer-modified-p)) ;; update modeline
(if (> (length isearch-string) 0) (if (and (> (length isearch-string) 0) (not nopush))
;; Update the ring data. ;; Update the ring data.
(if isearch-regexp (if isearch-regexp
(if (or (null regexp-search-ring) (if (or (null regexp-search-ring)
...@@ -684,7 +685,7 @@ If first char entered is \\[isearch-yank-word], then do word search instead." ...@@ -684,7 +685,7 @@ If first char entered is \\[isearch-yank-word], then do word search instead."
;; This is so that the user can do anything without failure, ;; This is so that the user can do anything without failure,
;; like switch buffers and start another isearch, and return. ;; like switch buffers and start another isearch, and return.
(condition-case err (condition-case err
(isearch-done) (isearch-done t)
(exit nil)) ; was recursive editing (exit nil)) ; was recursive editing
(isearch-message) ;; for read-char (isearch-message) ;; for read-char
...@@ -715,20 +716,11 @@ If first char entered is \\[isearch-yank-word], then do word search instead." ...@@ -715,20 +716,11 @@ If first char entered is \\[isearch-yank-word], then do word search instead."
(isearch-unread e)) (isearch-unread e))
(setq cursor-in-echo-area nil) (setq cursor-in-echo-area nil)
(setq isearch-new-string (setq isearch-new-string
(let ((search-ring search-ring) (let (junk-ring)
(regexp-search-ring regexp-search-ring))
(read-from-minibuffer (isearch-message-prefix) (read-from-minibuffer (isearch-message-prefix)
isearch-string isearch-string
minibuffer-local-isearch-map nil minibuffer-local-isearch-map nil
(cons 'junk-ring))
(if isearch-regexp
'regexp-search-ring
'search-ring)
(or
(if isearch-regexp
regexp-search-ring-yank-pointer
search-ring-yank-pointer)
0))))
isearch-new-message (mapconcat 'text-char-description isearch-new-message (mapconcat 'text-char-description
isearch-new-string ""))) isearch-new-string "")))
;; Always resume isearching by restarting it. ;; Always resume isearching by restarting it.
...@@ -793,7 +785,7 @@ Use `isearch-exit' to quit without signalling." ...@@ -793,7 +785,7 @@ Use `isearch-exit' to quit without signalling."
;; If search is successful, move back to starting point ;; If search is successful, move back to starting point
;; and really do quit. ;; and really do quit.
(progn (goto-char isearch-opoint) (progn (goto-char isearch-opoint)
(isearch-done) ; exit isearch (isearch-done t) ; exit isearch
(signal 'quit nil)) ; and pass on quit signal (signal 'quit nil)) ; and pass on quit signal
;; If search is failing, rub out until it is once more successful. ;; If search is failing, rub out until it is once more successful.
(while (not isearch-success) (isearch-pop-state)) (while (not isearch-success) (isearch-pop-state))
...@@ -981,45 +973,35 @@ If no previous match was done, just beep." ...@@ -981,45 +973,35 @@ If no previous match was done, just beep."
"Any other control char => unread it and exit the search normally. "Any other control char => unread it and exit the search normally.
But only if `search-exit-option' is non-nil, the default. But only if `search-exit-option' is non-nil, the default.
If it is the symbol `edit', the search string is edited in the minibuffer If it is the symbol `edit', the search string is edited in the minibuffer
and the control char is unread so that it is applied to the editing." and the control char is unread so that it applies to editing the string."
(interactive) (interactive)
(cond (cond ((eq search-exit-option 'edit)
((eq search-exit-option 'edit) (isearch-unread (isearch-last-command-char))
(isearch-unread (isearch-last-command-char)) (isearch-edit-string))
(isearch-edit-string)) (search-exit-option;; any other non-nil value
(search-exit-option ;; any other non-nil value (isearch-unread (isearch-last-command-char))
(isearch-unread (isearch-last-command-char)) (isearch-done))
(isearch-done)) (t;; search-exit-option is nil
(t ;; search-exit-option is nil (isearch-process-search-char (isearch-last-command-char)))))
(isearch-process-search-char (isearch-last-command-char)))
))
(defun isearch-other-meta-char () (defun isearch-other-meta-char ()
"Any other meta char => exit the search normally and reexecute the whole key. "Any other meta char => exit the search normally and reread the character.
But only if `search-exit-option' is non-nil." But only if `search-exit-option' is non-nil, the default.
;; This will probably work in place of isearch-other-control-char too, If it is the symbol `edit', the search string is edited in the minibuffer
;; but here we use unwind-protect and command-execute since it is and the meta character is unread so that it applies to editing the string."
;; a multi-char key we would want to unread.
(interactive) (interactive)
(cond (cond ((eq search-exit-option 'edit)
(search-exit-option (let ((key (this-command-keys)))
(unwind-protect (isearch-unread (+ 128 (aref key (1- (length key))))))
;; Exit recursive edit and restore the outside keymap. (isearch-edit-string))
(isearch-done) (search-exit-option
;; Reexecute the key with the outside keymap. (let ((key (this-command-keys)))
;; Note: this doesnt work unless the entered key is the same (isearch-unread (+ 128 (aref key (1- (length key))))))
;; as some outside key since command-execute only takes whole keys. (isearch-done))
;; So three character keys typically will not work! (t;; otherwise nil
;; Also, executing the command here may not work if isearch was (isearch-process-search-string (this-command-keys)
;; invoked non-interactively, since other input may be expected. (this-command-keys)))))
;; We also can't do isearch-edit-string as in -other-control-char.
;; because we need to set unread-command-key, if that existed.
;; So a new unread-command-key would solve all these problems.
(command-execute (this-command-keys))))
(t ;; otherwise nil
(isearch-process-search-string (this-command-keys) (this-command-keys))
)))
(defun isearch-quote-char () (defun isearch-quote-char ()
...@@ -1125,22 +1107,14 @@ If not in regexp mode, activate word search." ...@@ -1125,22 +1107,14 @@ If not in regexp mode, activate word search."
(set yank-pointer-name (set yank-pointer-name
(setq yank-pointer (setq yank-pointer
(% (+ (or yank-pointer 0) (% (+ (or yank-pointer 0)
(if advance (+ length (% n length)))) ;; Add LENGTH here to ensure a positive result.
length
(% (- n) length))
length))) length)))
(if (= minibuffer-history-position narg)
(error (if (= minibuffer-history-position 1)
"End of history; no next item"
"Beginning of history; no preceding item"))
(erase-buffer) (erase-buffer)
(setq minibuffer-history-position narg) (insert (nth yank-pointer ring))
(let ((elt (nth (1- minibuffer-history-position) (goto-char (point-max))))))
(symbol-value minibuffer-history-variable))))
(insert
(if minibuffer-history-sexp-flag
(prin1-to-string elt)
elt)))
(goto-char (point-min))))))
(defun isearch-ring-retreat-edit (n) (defun isearch-ring-retreat-edit (n)
"Inserts the previous element of the search history into the minibuffer." "Inserts the previous element of the search history into the minibuffer."
......
...@@ -558,7 +558,8 @@ Returns nil if line starts inside a string, t if in a comment." ...@@ -558,7 +558,8 @@ Returns nil if line starts inside a string, t if in a comment."
;; Recognize the DEFUN macro in Emacs. ;; Recognize the DEFUN macro in Emacs.
(if (save-excursion (if (save-excursion
;; Move down to the (putative) argnames line. ;; Move down to the (putative) argnames line.
(while (not (looking-at " *[({}#/]")) (while (and (not (eobp))
(not (looking-at " *[({}#/]")))
(forward-line 1)) (forward-line 1))
;; Go back to the DEFUN, if it is one. ;; Go back to the DEFUN, if it is one.
(condition-case nil (condition-case nil
......
...@@ -127,9 +127,9 @@ enum Lisp_Type ...@@ -127,9 +127,9 @@ enum Lisp_Type
Lisp_Buffer_Local_Value, Lisp_Buffer_Local_Value,
/* Like Lisp_Buffer_Local_Value with one difference: /* Like Lisp_Buffer_Local_Value with one difference:
merely setting the variable while some buffer is current merely setting the variable while some buffer is current
does not cause that buffer to have its own local value of this variable. does not cause that buffer to have its own local value of this variable.
Only make-local-variable does that. */ Only make-local-variable does that. */
Lisp_Some_Buffer_Local_Value, Lisp_Some_Buffer_Local_Value,
......
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