X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/aaef169dc63c4b557374540756865991e1bf6305..e0487df8766f3f91cbd08ed7857df2cca314f503:/lisp/isearch.el diff --git a/lisp/isearch.el b/lisp/isearch.el index ba700a893e..014c8efe18 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -116,8 +116,11 @@ When you put a space or spaces in the incremental regexp, it stands for this, unless it is inside of a regexp construct such as [...] or *, + or ?. You might want to use something like \"[ \\t\\r\\n]+\" instead. In the Customization buffer, that is `[' followed by a space, -a tab, a carriage return (control-M), a newline, and `]+'." - :type 'regexp +a tab, a carriage return (control-M), a newline, and `]+'. + +When this is nil, each space you type matches literally, against one space." + :type '(choice (const :tag "Find Spaces Literally" nil) + regexp) :group 'isearch) (defcustom search-invisible 'open @@ -827,21 +830,11 @@ NOPUSH is t and EDIT is t." (defun isearch-update-ring (string &optional regexp) "Add STRING to the beginning of the search ring. -REGEXP says which ring to use." - (if regexp - (if (or (null regexp-search-ring) - (not (string= string (car regexp-search-ring)))) - (progn - (push string regexp-search-ring) - (if (> (length regexp-search-ring) regexp-search-ring-max) - (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) - nil)))) - (if (or (null search-ring) - (not (string= string (car search-ring)))) - (progn - (push string search-ring) - (if (> (length search-ring) search-ring-max) - (setcdr (nthcdr (1- search-ring-max) search-ring) nil)))))) +REGEXP if non-nil says use the regexp search ring." + (add-to-history + (if regexp 'regexp-search-ring 'search-ring) + string + (if regexp regexp-search-ring-max search-ring-max))) ;; Switching buffers should first terminate isearch-mode. ;; ;; For Emacs 19, the frame switch event is handled. @@ -1693,12 +1686,15 @@ Isearch mode." (and (integerp main-event) (memq 'shift mods) (memq 'control mods) - (lookup-key isearch-mode-map - (let ((copy (copy-sequence key))) - (aset copy 0 - (- main-event (- ?\C-\S-a ?\C-a))) - copy) - nil))) + (not (memq (lookup-key isearch-mode-map + (let ((copy (copy-sequence key))) + (aset copy 0 + (- main-event + (- ?\C-\S-a ?\C-a))) + copy) + nil) + '(nil + isearch-other-control-char))))) (setcar keylist (- main-event (- ?\C-\S-a ?\C-a))) (cancel-kbd-macro-events) (apply 'isearch-unread keylist))