;;; isearch.el --- incremental search minor mode
-;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001,
+;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
:type 'boolean
:group 'isearch)
-(defcustom search-whitespace-regexp "\\s-+"
+(defcustom search-whitespace-regexp (purecopy "\\s-+")
"If non-nil, regular expression to match a sequence of whitespace chars.
This applies to regular expression incremental search.
When you put a space or spaces in the incremental regexp, it stands for
"Face for lazy highlighting of matches other than the current one."
:group 'lazy-highlight
:group 'basic-faces)
-(put 'isearch-lazy-highlight-face 'face-alias 'lazy-highlight)
+(define-obsolete-face-alias 'isearch-lazy-highlight-face 'lazy-highlight "22.1")
(defvar lazy-highlight-face 'lazy-highlight)
(define-obsolete-variable-alias 'isearch-lazy-highlight-face
'lazy-highlight-face
(eval-when-compile (require 'help-macro))
(make-help-screen isearch-help-for-help-internal
- "Type a help option: [bkm] or ?"
+ (purecopy "Type a help option: [bkm] or ?")
"You have typed %THIS-KEY%, the help character. Type a Help option:
\(Type \\<help-map>\\[help-quit] to exit the Help command.)
(defvar isearch-just-started nil)
(defvar isearch-start-hscroll 0) ; hscroll when starting the search.
-; case-fold-search while searching.
-; either nil, t, or 'yes. 'yes means the same as t except that mixed
-; case in the search string is ignored.
+;; case-fold-search while searching.
+;; either nil, t, or 'yes. 'yes means the same as t except that mixed
+;; case in the search string is ignored.
(defvar isearch-case-fold-search nil)
(defvar isearch-last-case-fold-search nil)
(search-upper-case nil))
(occur regexp nlines)))
-(declare-function hi-lock-regexp-okay "hi-lock" (regexp))
(declare-function hi-lock-read-face-name "hi-lock" ())
(defun isearch-highlight-regexp ()
(interactive "p")
(if (eobp)
(insert
- (save-excursion
- (set-buffer (cadr (buffer-list)))
+ (with-current-buffer (cadr (buffer-list))
(buffer-substring-no-properties
(point) (progn (forward-char arg) (point)))))
(forward-char arg)))
(windowp window)
(or (> (minibuffer-depth) 0)
(not (window-minibuffer-p window))))
- (save-excursion
- (set-buffer (window-buffer window))
+ (with-current-buffer (window-buffer window)
(isearch-done)
(isearch-clean-overlays))
(isearch-done)
(let* ((func (isearch-search-fun))
(pos1 (save-excursion (funcall func string bound noerror)))
pos2)
- (when (and (char-table-p translation-table-for-input)
- (multibyte-string-p string)
- ;; Minor optimization.
- (string-match-p "[^[:ascii:]]" string))
+ (when (and
+ ;; Avoid "obsolete" warnings for translation-table-for-input.
+ (with-no-warnings
+ (char-table-p translation-table-for-input))
+ (multibyte-string-p string)
+ ;; Minor optimization.
+ (string-match-p "[^[:ascii:]]" string))
(let ((translated
(apply 'string
(mapcar (lambda (c)
- (or (aref translation-table-for-input c) c))
+ (or
+ ;; Avoid "obsolete" warnings for
+ ;; translation-table-for-input.
+ (with-no-warnings
+ (aref translation-table-for-input c))
+ c))
string)))
match-data)
(when translated
(defun isearch-text-char-description (c)
(cond
- ((< c ?\s) (format "^%c" (+ c 64)))
- ((= c ?\^?) "^?")
+ ((< c ?\s) (propertize (format "^%c" (+ c 64)) 'face 'escape-glyph))
+ ((= c ?\^?) (propertize "^?" 'face 'escape-glyph))
(t (char-to-string c))))
;; General function to unread characters or events.