aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-02-06 23:18:02 -0800
committerGlenn Morris2014-02-06 23:18:02 -0800
commit99cf38598cd4ac71407b542ba0054fa0df018eb1 (patch)
tree20a2135ebc933ece0c87cef64a66b99fa51c3005
parente4eaacacc664e5469558350521add4f0b4163818 (diff)
downloademacs-99cf38598cd4ac71407b542ba0054fa0df018eb1.tar.gz
emacs-99cf38598cd4ac71407b542ba0054fa0df018eb1.zip
Some hi-lock doc
* doc/emacs/display.texi (Highlight Interactively): Mention hi-lock-auto-select-face. * lisp/hi-lock.el (hi-lock-auto-select-face, hi-lock-line-face-buffer) (hi-lock-face-buffer, hi-lock-face-phrase-buffer) (hi-lock-face-symbol-at-point, hi-lock-read-face-name): Doc tweaks. * etc/NEWS: Related edits.
-rw-r--r--doc/emacs/ChangeLog3
-rw-r--r--doc/emacs/display.texi10
-rw-r--r--etc/NEWS10
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/hi-lock.el46
5 files changed, 42 insertions, 31 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 2ee669e7da5..1a884452dbe 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,5 +1,8 @@
12014-02-07 Glenn Morris <rgm@gnu.org> 12014-02-07 Glenn Morris <rgm@gnu.org>
2 2
3 * display.texi (Highlight Interactively):
4 Mention hi-lock-auto-select-face.
5
3 * anti.texi (Antinews): Fix typo. 6 * anti.texi (Antinews): Fix typo.
4 7
5 * ack.texi (Acknowledgments): No longer mention obsolete files. 8 * ack.texi (Acknowledgments): No longer mention obsolete files.
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index d9fd819c219..d53c80acafd 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -928,6 +928,12 @@ highlighting, Hi Lock provides several of its own and these are
928pre-loaded into a list of default values. While being prompted 928pre-loaded into a list of default values. While being prompted
929for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. 929for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
930 930
931@vindex hi-lock-auto-select-face
932Setting the option @code{hi-lock-auto-select-face} to a non-@code{nil}
933value causes this command (and other Hi Lock commands that read faces)
934to automatically choose the next face from the default list without
935prompting.
936
931You can use this command multiple times, specifying various regular 937You can use this command multiple times, specifying various regular
932expressions to highlight in different ways. 938expressions to highlight in different ways.
933 939
@@ -976,8 +982,8 @@ initial lower-case letters will become case insensitive.
976@findex highlight-symbol-at-point 982@findex highlight-symbol-at-point
977@cindex symbol, highlighting 983@cindex symbol, highlighting
978@cindex highlighting symbol at point 984@cindex highlighting symbol at point
979Highlight the symbol found near point without prompting, using the next 985Highlight the symbol found near point, using the next available face
980available face automatically (@code{highlight-symbol-at-point}). 986(@code{highlight-symbol-at-point}).
981 987
982@item M-s h w 988@item M-s h w
983@itemx C-x w b 989@itemx C-x w b
diff --git a/etc/NEWS b/etc/NEWS
index e2dcadb559f..35e673a8076 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -607,13 +607,13 @@ callers to fit the image to a frame other than the selected frame.
607 607
608** Hi-Lock 608** Hi-Lock
609 609
610*** New option `hi-lock-auto-select-face'. When non-nil, hi-lock commands 610+++
611will cycle through faces in `hi-lock-face-defaults' without prompting. 611*** New global command `M-s h .' (`highlight-symbol-at-point') highlights
612the symbol found near point.
612 613
613+++ 614+++
614*** New global command `M-s h .' (`highlight-symbol-at-point') 615*** New option `hi-lock-auto-select-face'. When non-nil, hi-lock commands
615highlights the symbol found near point without prompting, 616will cycle through faces in `hi-lock-face-defaults' without prompting.
616using the next face automatically.
617 617
618** New Imenu option `imenu-generic-skip-comments-and-strings'. 618** New Imenu option `imenu-generic-skip-comments-and-strings'.
619 619
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 18587c06e31..97fc72e90ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12014-02-07 Glenn Morris <rgm@gnu.org> 12014-02-07 Glenn Morris <rgm@gnu.org>
2 2
3 * hi-lock.el (hi-lock-auto-select-face, hi-lock-line-face-buffer)
4 (hi-lock-face-buffer, hi-lock-face-phrase-buffer)
5 (hi-lock-face-symbol-at-point, hi-lock-read-face-name): Doc tweaks.
6
3 * obsolete/iswitchb.el: Move to obsolete/. 7 * obsolete/iswitchb.el: Move to obsolete/.
4 * simple.el (iswitchb-mode): Add manual autoloads to ease transition, 8 * simple.el (iswitchb-mode): Add manual autoloads to ease transition,
5 since obsolete/ is not scanned for autoloads. 9 since obsolete/ is not scanned for autoloads.
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index fb0136f034b..78efd8671c4 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -136,9 +136,9 @@ patterns."
136(put 'hi-lock-file-patterns-policy 'risky-local-variable t) 136(put 'hi-lock-file-patterns-policy 'risky-local-variable t)
137 137
138(defcustom hi-lock-auto-select-face nil 138(defcustom hi-lock-auto-select-face nil
139 "Non-nil if highlighting commands should not prompt for face names. 139 "Non-nil means highlighting commands do not prompt for the face to use.
140When non-nil, each hi-lock command will cycle through faces in 140Instead, each hi-lock command will cycle through the faces in
141`hi-lock-face-defaults' without prompting." 141`hi-lock-face-defaults'."
142 :type 'boolean 142 :type 'boolean
143 :version "24.4") 143 :version "24.4")
144 144
@@ -410,9 +410,8 @@ versions before 22 use the following in your init file:
410;;;###autoload 410;;;###autoload
411(defun hi-lock-line-face-buffer (regexp &optional face) 411(defun hi-lock-line-face-buffer (regexp &optional face)
412 "Set face of all lines containing a match of REGEXP to FACE. 412 "Set face of all lines containing a match of REGEXP to FACE.
413Interactively, prompt for REGEXP then FACE. Use 413Interactively, prompt for REGEXP using `read-regexp', then FACE.
414`read-regexp-defaults-function' to customize default 414Use the global history list for FACE.
415value(s) of REGEXP. Use the global history list for FACE.
416 415
417Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, 416Use Font lock mode, if enabled, to highlight REGEXP. Otherwise,
418use overlays for highlighting. If overlays are used, the 417use overlays for highlighting. If overlays are used, the
@@ -435,9 +434,8 @@ highlighting will not update as you type."
435;;;###autoload 434;;;###autoload
436(defun hi-lock-face-buffer (regexp &optional face) 435(defun hi-lock-face-buffer (regexp &optional face)
437 "Set face of each match of REGEXP to FACE. 436 "Set face of each match of REGEXP to FACE.
438Interactively, prompt for REGEXP then FACE. Use 437Interactively, prompt for REGEXP using `read-regexp', then FACE.
439`read-regexp-defaults-function' to customize default 438Use the global history list for FACE.
440value(s) of REGEXP. Use the global history list for FACE.
441 439
442Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, 440Use Font lock mode, if enabled, to highlight REGEXP. Otherwise,
443use overlays for highlighting. If overlays are used, the 441use overlays for highlighting. If overlays are used, the
@@ -456,12 +454,12 @@ highlighting will not update as you type."
456;;;###autoload 454;;;###autoload
457(defun hi-lock-face-phrase-buffer (regexp &optional face) 455(defun hi-lock-face-phrase-buffer (regexp &optional face)
458 "Set face of each match of phrase REGEXP to FACE. 456 "Set face of each match of phrase REGEXP to FACE.
459Interactively, prompt for REGEXP then FACE. Use 457Interactively, prompt for REGEXP using `read-regexp', then FACE.
460`read-regexp-defaults-function' to customize default 458Use the global history list for FACE.
461value(s) of REGEXP. Use the global history list for FACE. When 459
462called interactively, replace whitespace in user provided regexp 460When called interactively, replace whitespace in user-provided
463with arbitrary whitespace and make initial lower-case letters 461regexp with arbitrary whitespace, and make initial lower-case
464case-insensitive before highlighting with `hi-lock-set-pattern'. 462letters case-insensitive, before highlighting with `hi-lock-set-pattern'.
465 463
466Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, 464Use Font lock mode, if enabled, to highlight REGEXP. Otherwise,
467use overlays for highlighting. If overlays are used, the 465use overlays for highlighting. If overlays are used, the
@@ -480,14 +478,13 @@ highlighting will not update as you type."
480(defalias 'highlight-symbol-at-point 'hi-lock-face-symbol-at-point) 478(defalias 'highlight-symbol-at-point 'hi-lock-face-symbol-at-point)
481;;;###autoload 479;;;###autoload
482(defun hi-lock-face-symbol-at-point () 480(defun hi-lock-face-symbol-at-point ()
483 "Set face of each match of the symbol at point. 481 "Highlight each instance of the symbol at point.
484Use `find-tag-default-as-symbol-regexp' to retrieve the symbol at point. 482Uses the next face from `hi-lock-face-defaults' without prompting,
485Use non-nil `hi-lock-auto-select-face' to retrieve the next face 483unless you use a prefix argument.
486from `hi-lock-face-defaults' automatically. 484Uses `find-tag-default-as-symbol-regexp' to retrieve the symbol at point.
487 485
488Use Font lock mode, if enabled, to highlight symbol at point. 486This uses Font lock mode if it is enabled; otherwise it uses overlays,
489Otherwise, use overlays for highlighting. If overlays are used, 487in which case the highlighting will not update as you type."
490the highlighting will not update as you type."
491 (interactive) 488 (interactive)
492 (let* ((regexp (hi-lock-regexp-okay 489 (let* ((regexp (hi-lock-regexp-okay
493 (find-tag-default-as-symbol-regexp))) 490 (find-tag-default-as-symbol-regexp)))
@@ -663,7 +660,8 @@ not suitable."
663(defun hi-lock-read-face-name () 660(defun hi-lock-read-face-name ()
664 "Return face for interactive highlighting. 661 "Return face for interactive highlighting.
665When `hi-lock-auto-select-face' is non-nil, just return the next face. 662When `hi-lock-auto-select-face' is non-nil, just return the next face.
666Otherwise, read face name from minibuffer with completion and history." 663Otherwise, or with a prefix argument, read a face from the minibuffer
664with completion and history."
667 (unless hi-lock-interactive-patterns 665 (unless hi-lock-interactive-patterns
668 (setq hi-lock--unused-faces hi-lock-face-defaults)) 666 (setq hi-lock--unused-faces hi-lock-face-defaults))
669 (let* ((last-used-face 667 (let* ((last-used-face