aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-06-25 20:22:14 +0000
committerJuri Linkov2008-06-25 20:22:14 +0000
commit11c9f489a444c58ea1c03a6908aa8bf889407699 (patch)
treeee9bd59c7f14e7b655fab08e0c162cab5ee85730
parent56d62ee1fba23e69035e5146a12323cdfb60ea9b (diff)
downloademacs-11c9f489a444c58ea1c03a6908aa8bf889407699.tar.gz
emacs-11c9f489a444c58ea1c03a6908aa8bf889407699.zip
(isearch-mode-map): Bind `M-s h r' to `isearch-highlight-regexp'.
(isearch-highlight-regexp): New function.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/isearch.el21
2 files changed, 35 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f38bacea410..7813d033429 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12008-06-25 Juri Linkov <juri@jurta.org>
2
3 * bindings.el (goto-map): New variable. Rebind goto-related
4 commands to this `M-g' prefix keymap.
5 (search-map): New variable for `M-s' prefix keymap.
6 Bind `M-s o' to `occur', `M-shr' to `highlight-regexp', `M-shp' to
7 `highlight-phrase', `M-shl' to `highlight-lines-matching-regexp',
8 `M-shu' to `unhighlight-regexp', `M-shf' to `hi-lock-find-patterns',
9 `M-shw' to `hi-lock-write-interactive-patterns'.
10
11 * isearch.el (isearch-mode-map): Bind `M-s h r' to
12 `isearch-highlight-regexp'.
13 (isearch-highlight-regexp): New function.
14
12008-06-25 Stefan Monnier <monnier@iro.umontreal.ca> 152008-06-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 16
3 * info.el (Info-bookmark-make-record): 17 * info.el (Info-bookmark-make-record):
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 213653ff919..130685fb882 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -494,6 +494,7 @@ This is like `describe-bindings', but displays only isearch keys."
494 (define-key map [?\M-%] 'isearch-query-replace) 494 (define-key map [?\M-%] 'isearch-query-replace)
495 (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) 495 (define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
496 (define-key map "\M-so" 'isearch-occur) 496 (define-key map "\M-so" 'isearch-occur)
497 (define-key map "\M-shr" 'isearch-highlight-regexp)
497 498
498 map) 499 map)
499 "Keymap for `isearch-mode'.") 500 "Keymap for `isearch-mode'.")
@@ -1364,6 +1365,26 @@ string. NLINES has the same meaning as in `occur'."
1364 (search-upper-case nil)) 1365 (search-upper-case nil))
1365 (occur regexp nlines))) 1366 (occur regexp nlines)))
1366 1367
1368(declare-function hi-lock-regexp-okay "hi-lock" (regexp))
1369(declare-function hi-lock-read-face-name "hi-lock" ())
1370
1371(defun isearch-highlight-regexp (regexp &optional face)
1372 "Run `highlight-regexp' with regexp from the current search string.
1373Interactively, REGEXP is the current search regexp or a quoted search
1374string. FACE has the same meaning as in `highlight-regexp'."
1375 (interactive
1376 (list
1377 (progn
1378 (require 'hi-lock nil t)
1379 (hi-lock-regexp-okay
1380 (if isearch-regexp isearch-string (regexp-quote isearch-string))))
1381 (hi-lock-read-face-name)))
1382 (isearch-done)
1383 (isearch-clean-overlays)
1384 ;; (add-to-history 'hi-lock-regexp-history regexp)
1385 (let ((case-fold-search isearch-case-fold-search))
1386 (hi-lock-face-buffer regexp face)))
1387
1367 1388
1368(defun isearch-delete-char () 1389(defun isearch-delete-char ()
1369 "Discard last input item and move point back. 1390 "Discard last input item and move point back.