aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJuri Linkov2013-06-03 11:51:50 +0300
committerJuri Linkov2013-06-03 11:51:50 +0300
commite5e4a94293d5a9a157557e53b4fea4e5d280673e (patch)
tree2384760b1e0aae2ec3622021c6438463ed8fb0af /doc
parent26b3353ad0200b6e3dae8bacbf61c7c069a26b2a (diff)
downloademacs-e5e4a94293d5a9a157557e53b4fea4e5d280673e.tar.gz
emacs-e5e4a94293d5a9a157557e53b4fea4e5d280673e.zip
Search and highlight symbol at point.
* doc/emacs/display.texi (Highlight Interactively): Add global keybindings with the key prefix `M-s h'. Document old command `highlight-phrase'. Document new command `highlight-symbol-at-point'. * lisp/bindings.el (search-map): Bind `highlight-symbol-at-point' to `M-s h .'. * lisp/hi-lock.el (highlight-symbol-at-point): New alias for the new command `hi-lock-face-symbol-at-point'. (hi-lock-face-symbol-at-point): New command. (hi-lock-map): Bind `highlight-symbol-at-point' to `C-x w .'. (hi-lock-menu): Add `highlight-symbol-at-point'. (hi-lock-mode): Doc fix. * lisp/isearch.el (isearch-forward-symbol-at-point): New command. (search-map): Bind `isearch-forward-symbol-at-point' to `M-s .'. (isearch-highlight-regexp): Add a regexp which matches words/symbols for word/symbol mode. * lisp/subr.el (find-tag-default-bounds): New function with the body mostly moved from `find-tag-default'. (find-tag-default): Move most code to `find-tag-default-bounds', call it and apply `buffer-substring-no-properties' afterwards. Fixes: debbugs:14427
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog6
-rw-r--r--doc/emacs/display.texi48
2 files changed, 46 insertions, 8 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b1f9fb2a40d..f0b89a15fcc 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,9 @@
12013-06-03 Juri Linkov <juri@jurta.org>
2
3 * display.texi (Highlight Interactively): Add global keybindings
4 with the key prefix `M-s h'. Document old command `highlight-phrase'.
5 Document new command `highlight-symbol-at-point'.
6
12013-06-01 Glenn Morris <rgm@gnu.org> 72013-06-01 Glenn Morris <rgm@gnu.org>
2 8
3 * programs.texi (Semantic): Fix typo. 9 * programs.texi (Semantic): Fix typo.
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index f5ec8946e1b..482d7e7741a 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -903,14 +903,16 @@ that you specify explicitly the regular expressions to highlight. You
903control them with these commands: 903control them with these commands:
904 904
905@table @kbd 905@table @kbd
906@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} 906@item M-s h r @var{regexp} @key{RET} @var{face} @key{RET}
907@itemx C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
908@kindex M-s h r
907@kindex C-x w h 909@kindex C-x w h
908@findex highlight-regexp 910@findex highlight-regexp
909Highlight text that matches @var{regexp} using face @var{face} 911Highlight text that matches @var{regexp} using face @var{face}
910(@code{highlight-regexp}). The highlighting will remain as long as 912(@code{highlight-regexp}). The highlighting will remain as long as
911the buffer is loaded. For example, to highlight all occurrences of 913the buffer is loaded. For example, to highlight all occurrences of
912the word ``whim'' using the default face (a yellow background) 914the word ``whim'' using the default face (a yellow background)
913@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for 915@kbd{M-s h r whim @key{RET} @key{RET}}. Any face can be used for
914highlighting, Hi Lock provides several of its own and these are 916highlighting, Hi Lock provides several of its own and these are
915pre-loaded into a list of default values. While being prompted 917pre-loaded into a list of default values. While being prompted
916for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. 918for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
@@ -918,7 +920,9 @@ for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
918You can use this command multiple times, specifying various regular 920You can use this command multiple times, specifying various regular
919expressions to highlight in different ways. 921expressions to highlight in different ways.
920 922
921@item C-x w r @var{regexp} @key{RET} 923@item M-s h u @var{regexp} @key{RET}
924@itemx C-x w r @var{regexp} @key{RET}
925@kindex M-s h u
922@kindex C-x w r 926@kindex C-x w r
923@findex unhighlight-regexp 927@findex unhighlight-regexp
924Unhighlight @var{regexp} (@code{unhighlight-regexp}). 928Unhighlight @var{regexp} (@code{unhighlight-regexp}).
@@ -926,13 +930,15 @@ Unhighlight @var{regexp} (@code{unhighlight-regexp}).
926If you invoke this from the menu, you select the expression to 930If you invoke this from the menu, you select the expression to
927unhighlight from a list. If you invoke this from the keyboard, you 931unhighlight from a list. If you invoke this from the keyboard, you
928use the minibuffer. It will show the most recently added regular 932use the minibuffer. It will show the most recently added regular
929expression; use @kbd{M-p} to show the next older expression and 933expression; use @kbd{M-n} to show the next older expression and
930@kbd{M-n} to select the next newer expression. (You can also type the 934@kbd{M-p} to select the next newer expression. (You can also type the
931expression by hand, with completion.) When the expression you want to 935expression by hand, with completion.) When the expression you want to
932unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit 936unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
933the minibuffer and unhighlight it. 937the minibuffer and unhighlight it.
934 938
935@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} 939@item M-s h l @var{regexp} @key{RET} @var{face} @key{RET}
940@itemx C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
941@kindex M-s h l
936@kindex C-x w l 942@kindex C-x w l
937@findex highlight-lines-matching-regexp 943@findex highlight-lines-matching-regexp
938@cindex lines, highlighting 944@cindex lines, highlighting
@@ -940,7 +946,31 @@ the minibuffer and unhighlight it.
940Highlight entire lines containing a match for @var{regexp}, using face 946Highlight entire lines containing a match for @var{regexp}, using face
941@var{face} (@code{highlight-lines-matching-regexp}). 947@var{face} (@code{highlight-lines-matching-regexp}).
942 948
943@item C-x w b 949@item M-s h p @var{phrase} @key{RET} @var{face} @key{RET}
950@itemx C-x w p @var{phrase} @key{RET} @var{face} @key{RET}
951@kindex M-s h p
952@kindex C-x w p
953@findex highlight-phrase
954@cindex phrase, highlighting
955@cindex highlighting phrase
956Highlight matches of @var{phrase}, using face @var{face}
957(@code{highlight-phrase}). @var{phrase} can be any regexp,
958but spaces will be replaced by matches to whitespace and
959initial lower-case letters will become case insensitive.
960
961@item M-s h .
962@itemx C-x w .
963@kindex M-s h .
964@kindex C-x w .
965@findex highlight-symbol-at-point
966@cindex symbol, highlighting
967@cindex highlighting symbol at point
968Highlight the symbol found near point without prompting, using the next
969available face automatically (@code{highlight-symbol-at-point}).
970
971@item M-s h w
972@itemx C-x w b
973@kindex M-s h w
944@kindex C-x w b 974@kindex C-x w b
945@findex hi-lock-write-interactive-patterns 975@findex hi-lock-write-interactive-patterns
946Insert all the current highlighting regexp/face pairs into the buffer 976Insert all the current highlighting regexp/face pairs into the buffer
@@ -952,7 +982,9 @@ These patterns are extracted from the comments, if appropriate, if you
952invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while 982invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while
953Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}). 983Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}).
954 984
955@item C-x w i 985@item M-s h f
986@itemx C-x w i
987@kindex M-s h f
956@kindex C-x w i 988@kindex C-x w i
957@findex hi-lock-find-patterns 989@findex hi-lock-find-patterns
958Extract regexp/face pairs from comments in the current buffer 990Extract regexp/face pairs from comments in the current buffer