[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/isearch.el,v
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/isearch.el,v |
Date: |
Wed, 25 Jun 2008 20:21:43 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 08/06/25 20:21:41
Index: isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.321
retrieving revision 1.322
diff -u -b -r1.321 -r1.322
--- isearch.el 11 May 2008 20:30:26 -0000 1.321
+++ isearch.el 25 Jun 2008 20:21:36 -0000 1.322
@@ -494,6 +494,7 @@
(define-key map [?\M-%] 'isearch-query-replace)
(define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
(define-key map "\M-so" 'isearch-occur)
+ (define-key map "\M-shr" 'isearch-highlight-regexp)
map)
"Keymap for `isearch-mode'.")
@@ -1364,6 +1365,26 @@
(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 (regexp &optional face)
+ "Run `highlight-regexp' with regexp from the current search string.
+Interactively, REGEXP is the current search regexp or a quoted search
+string. FACE has the same meaning as in `highlight-regexp'."
+ (interactive
+ (list
+ (progn
+ (require 'hi-lock nil t)
+ (hi-lock-regexp-okay
+ (if isearch-regexp isearch-string (regexp-quote isearch-string))))
+ (hi-lock-read-face-name)))
+ (isearch-done)
+ (isearch-clean-overlays)
+ ;; (add-to-history 'hi-lock-regexp-history regexp)
+ (let ((case-fold-search isearch-case-fold-search))
+ (hi-lock-face-buffer regexp face)))
+
(defun isearch-delete-char ()
"Discard last input item and move point back.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/isearch.el,v,
Juri Linkov <=