diff options
| author | Glenn Morris | 2014-02-06 23:18:02 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-02-06 23:18:02 -0800 |
| commit | 99cf38598cd4ac71407b542ba0054fa0df018eb1 (patch) | |
| tree | 20a2135ebc933ece0c87cef64a66b99fa51c3005 | |
| parent | e4eaacacc664e5469558350521add4f0b4163818 (diff) | |
| download | emacs-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/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 10 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/hi-lock.el | 46 |
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 @@ | |||
| 1 | 2014-02-07 Glenn Morris <rgm@gnu.org> | 1 | 2014-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 | |||
| 928 | pre-loaded into a list of default values. While being prompted | 928 | pre-loaded into a list of default values. While being prompted |
| 929 | for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. | 929 | for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. |
| 930 | 930 | ||
| 931 | @vindex hi-lock-auto-select-face | ||
| 932 | Setting the option @code{hi-lock-auto-select-face} to a non-@code{nil} | ||
| 933 | value causes this command (and other Hi Lock commands that read faces) | ||
| 934 | to automatically choose the next face from the default list without | ||
| 935 | prompting. | ||
| 936 | |||
| 931 | You can use this command multiple times, specifying various regular | 937 | You can use this command multiple times, specifying various regular |
| 932 | expressions to highlight in different ways. | 938 | expressions 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 |
| 979 | Highlight the symbol found near point without prompting, using the next | 985 | Highlight the symbol found near point, using the next available face |
| 980 | available 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 |
| @@ -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 | +++ |
| 611 | will cycle through faces in `hi-lock-face-defaults' without prompting. | 611 | *** New global command `M-s h .' (`highlight-symbol-at-point') highlights |
| 612 | the 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 |
| 615 | highlights the symbol found near point without prompting, | 616 | will cycle through faces in `hi-lock-face-defaults' without prompting. |
| 616 | using 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 @@ | |||
| 1 | 2014-02-07 Glenn Morris <rgm@gnu.org> | 1 | 2014-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. |
| 140 | When non-nil, each hi-lock command will cycle through faces in | 140 | Instead, 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. |
| 413 | Interactively, prompt for REGEXP then FACE. Use | 413 | Interactively, prompt for REGEXP using `read-regexp', then FACE. |
| 414 | `read-regexp-defaults-function' to customize default | 414 | Use the global history list for FACE. |
| 415 | value(s) of REGEXP. Use the global history list for FACE. | ||
| 416 | 415 | ||
| 417 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, | 416 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, |
| 418 | use overlays for highlighting. If overlays are used, the | 417 | use 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. |
| 438 | Interactively, prompt for REGEXP then FACE. Use | 437 | Interactively, prompt for REGEXP using `read-regexp', then FACE. |
| 439 | `read-regexp-defaults-function' to customize default | 438 | Use the global history list for FACE. |
| 440 | value(s) of REGEXP. Use the global history list for FACE. | ||
| 441 | 439 | ||
| 442 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, | 440 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, |
| 443 | use overlays for highlighting. If overlays are used, the | 441 | use 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. |
| 459 | Interactively, prompt for REGEXP then FACE. Use | 457 | Interactively, prompt for REGEXP using `read-regexp', then FACE. |
| 460 | `read-regexp-defaults-function' to customize default | 458 | Use the global history list for FACE. |
| 461 | value(s) of REGEXP. Use the global history list for FACE. When | 459 | |
| 462 | called interactively, replace whitespace in user provided regexp | 460 | When called interactively, replace whitespace in user-provided |
| 463 | with arbitrary whitespace and make initial lower-case letters | 461 | regexp with arbitrary whitespace, and make initial lower-case |
| 464 | case-insensitive before highlighting with `hi-lock-set-pattern'. | 462 | letters case-insensitive, before highlighting with `hi-lock-set-pattern'. |
| 465 | 463 | ||
| 466 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, | 464 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, |
| 467 | use overlays for highlighting. If overlays are used, the | 465 | use 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. |
| 484 | Use `find-tag-default-as-symbol-regexp' to retrieve the symbol at point. | 482 | Uses the next face from `hi-lock-face-defaults' without prompting, |
| 485 | Use non-nil `hi-lock-auto-select-face' to retrieve the next face | 483 | unless you use a prefix argument. |
| 486 | from `hi-lock-face-defaults' automatically. | 484 | Uses `find-tag-default-as-symbol-regexp' to retrieve the symbol at point. |
| 487 | 485 | ||
| 488 | Use Font lock mode, if enabled, to highlight symbol at point. | 486 | This uses Font lock mode if it is enabled; otherwise it uses overlays, |
| 489 | Otherwise, use overlays for highlighting. If overlays are used, | 487 | in which case the highlighting will not update as you type." |
| 490 | the 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. |
| 665 | When `hi-lock-auto-select-face' is non-nil, just return the next face. | 662 | When `hi-lock-auto-select-face' is non-nil, just return the next face. |
| 666 | Otherwise, read face name from minibuffer with completion and history." | 663 | Otherwise, or with a prefix argument, read a face from the minibuffer |
| 664 | with 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 |