(define-key map "\M-\C-s" 'isearch-repeat-forward)
(define-key map "\M-\C-r" 'isearch-repeat-backward)
(define-key map "\177" 'isearch-delete-char)
- (define-key map [backspace] 'isearch-delete-char)
+ (define-key map [backspace] 'undefined) ;bug#20466.
(define-key map "\C-g" 'isearch-abort)
;; This assumes \e is the meta-prefix-char.
"Stack of search status elements.
Each element is an `isearch--state' struct where the slots are
[STRING MESSAGE POINT SUCCESS FORWARD OTHER-END WORD
- INVALID-REGEXP WRAPPED BARRIER WITHIN-BRACKETS CASE-FOLD-SEARCH]")
+ ERROR WRAPPED BARRIER CASE-FOLD-SEARCH]")
(defvar isearch-string "") ; The current search string.
(defvar isearch-message "") ; text-char-description version of isearch-string
(nconc minor-mode-alist
(list '(isearch-mode isearch-mode))))
-(defvar isearch-mode nil) ;; Name of the minor mode, if non-nil.
-(make-variable-buffer-local 'isearch-mode)
+(defvar-local isearch-mode nil) ;; Name of the minor mode, if non-nil.
(define-key global-map "\C-s" 'isearch-forward)
(define-key esc-map "\C-s" 'isearch-forward-regexp)
(isearch-update)))))
\f
+(defvar cursor-sensor-inhibit)
;; isearch-mode only sets up incremental search for the minor mode.
;; All the work is done by the isearch-mode commands.
(add-hook 'post-command-hook 'isearch-post-command-hook)
(add-hook 'mouse-leave-buffer-hook 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)
+ (make-local-variable 'cursor-sensor-inhibit)
+ (unless (boundp 'cursor-sensor-inhibit)
+ (setq cursor-sensor-inhibit nil))
+ ;; Suspend things like cursor-intangible during Isearch so we can search even
+ ;; within intangible text.
+ (push 'isearch cursor-sensor-inhibit)
;; isearch-mode can be made modal (in the sense of not returning to
;; the calling function until searching is completed) by entering
(remove-hook 'mouse-leave-buffer-hook 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(setq isearch-lazy-highlight-start nil)
+ (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))
;; Called by all commands that terminate isearch-mode.
;; If NOPUSH is non-nil, we don't push the string on the search ring.
(defun isearch-yank-x-selection ()
"Pull current X selection into search string."
(interactive)
- (isearch-yank-string (x-get-selection))
- ;; If `x-get-selection' returned the text from the active region,
+ (isearch-yank-string (gui-get-selection))
+ ;; If `gui-get-selection' returned the text from the active region,
;; then it "used" the mark which we should hence deactivate.
(when select-active-regions (deactivate-mark)))
(isearch-process-search-char char count))))
(defun isearch-process-search-char (char &optional count)
+ "Add CHAR to the search string, COUNT times.
+Search is updated accordingly."
;; * and ? are special in regexps when not preceded by \.
;; } and | are special in regexps when preceded by \.
;; Nothing special for + because it matches at least once.
;; isearch in their own way, they should set the
;; `isearch-open-invisible-temporary' to a function doing this.
(funcall (overlay-get ov 'isearch-open-invisible-temporary) ov nil)
- ;; Store the values for the `invisible' and `intangible'
- ;; properties, and then set them to nil. This way the text hidden
- ;; by this overlay becomes visible.
+ ;; Store the values for the `invisible' property, and then set it to nil.
+ ;; This way the text hidden by this overlay becomes visible.
- ;; Do we really need to set the `intangible' property to t? Can we
- ;; have the point inside an overlay with an `intangible' property?
;; In 19.34 this does not exist so I cannot test it.
(overlay-put ov 'isearch-invisible (overlay-get ov 'invisible))
- (overlay-put ov 'isearch-intangible (overlay-get ov 'intangible))
- (overlay-put ov 'invisible nil)
- (overlay-put ov 'intangible nil)))
+ (overlay-put ov 'invisible nil)))
;; This is called at the end of isearch. It will open the overlays
;; this function, not by us tweaking the overlay properties.
(fct-temp (overlay-get ov 'isearch-open-invisible-temporary)))
(when (or inside-overlay (not fct-temp))
- ;; restore the values for the `invisible' and `intangible'
- ;; properties
+ ;; restore the values for the `invisible' properties.
(overlay-put ov 'invisible (overlay-get ov 'isearch-invisible))
- (overlay-put ov 'intangible (overlay-get ov 'isearch-intangible))
- (overlay-put ov 'isearch-invisible nil)
- (overlay-put ov 'isearch-intangible nil))
+ (overlay-put ov 'isearch-invisible nil))
(if inside-overlay
(funcall (overlay-get ov 'isearch-open-invisible) ov)
(if fct-temp
;; properties.
(funcall fct-temp ov t)
(overlay-put ov 'invisible (overlay-get ov 'isearch-invisible))
- (overlay-put ov 'intangible (overlay-get ov 'isearch-intangible))
- (overlay-put ov 'isearch-invisible nil)
- (overlay-put ov 'isearch-intangible nil)))))))
+ (overlay-put ov 'isearch-invisible nil)))))))
(defun isearch-range-invisible (beg end)