diff options
| author | Eli Zaretskii | 2018-08-15 05:37:45 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-08-15 05:37:45 +0300 |
| commit | bcdb2d9733118a6529a66e12c3f2dc7662370c15 (patch) | |
| tree | bc1c7fbaa0a2416122de31bf0787e6022bbef6e8 | |
| parent | cc5a23d40bfa7a832f7a6fb7a016557ac1416559 (diff) | |
| download | emacs-bcdb2d9733118a6529a66e12c3f2dc7662370c15.tar.gz emacs-bcdb2d9733118a6529a66e12c3f2dc7662370c15.zip | |
Improve documentation of last change
* lisp/hi-lock.el (hi-lock-set-pattern, hi-lock-face-buffer):
Improve the doc strings. (Bug#32365)
* etc/NEWS:
* doc/emacs/display.texi (Highlight Interactively): Clarify
wording.
| -rw-r--r-- | doc/emacs/display.texi | 7 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/hi-lock.el | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index fe4936d85a1..d9a08b974f6 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -974,9 +974,10 @@ the buffer is loaded. For example, to highlight all occurrences of | |||
| 974 | the word ``whim'' using the default face (a yellow background), type | 974 | the word ``whim'' using the default face (a yellow background), type |
| 975 | @kbd{M-s h r whim @key{RET} @key{RET}}. Any face can be used for | 975 | @kbd{M-s h r whim @key{RET} @key{RET}}. Any face can be used for |
| 976 | highlighting, Hi Lock provides several of its own and these are | 976 | highlighting, Hi Lock provides several of its own and these are |
| 977 | pre-loaded into a list of default values. While being prompted | 977 | pre-loaded into a list of default values. While being prompted for a |
| 978 | for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. A prefix | 978 | face use @kbd{M-n} and @kbd{M-p} to cycle through them. A prefix |
| 979 | argument limits the highlighting to the corresponding subexpression. | 979 | numeric argument limits the highlighting to the corresponding |
| 980 | subexpression. | ||
| 980 | 981 | ||
| 981 | @vindex hi-lock-auto-select-face | 982 | @vindex hi-lock-auto-select-face |
| 982 | Setting the option @code{hi-lock-auto-select-face} to a non-@code{nil} | 983 | Setting the option @code{hi-lock-auto-select-face} to a non-@code{nil} |
| @@ -720,7 +720,8 @@ UUID at point. | |||
| 720 | 720 | ||
| 721 | +++ | 721 | +++ |
| 722 | *** 'highlight-regexp' can now highlight subexpressions. | 722 | *** 'highlight-regexp' can now highlight subexpressions. |
| 723 | The command accepts a prefix argument to choose the subexpression. | 723 | The now command accepts a prefix numeric argument to choose the |
| 724 | subexpression. | ||
| 724 | 725 | ||
| 725 | 726 | ||
| 726 | * New Modes and Packages in Emacs 27.1 | 727 | * New Modes and Packages in Emacs 27.1 |
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 23820cda587..08b58117dd0 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el | |||
| @@ -433,7 +433,8 @@ highlighting will not update as you type." | |||
| 433 | "Set face of each match of REGEXP to FACE. | 433 | "Set face of each match of REGEXP to FACE. |
| 434 | Interactively, prompt for REGEXP using `read-regexp', then FACE. | 434 | Interactively, prompt for REGEXP using `read-regexp', then FACE. |
| 435 | Use the global history list for FACE. Limit face setting to the | 435 | Use the global history list for FACE. Limit face setting to the |
| 436 | corresponding SUBEXP of REGEXP. | 436 | corresponding SUBEXP (interactively, the prefix argument) of REGEXP. |
| 437 | If SUBEXP is omitted or nil, the entire REGEXP is highlighted. | ||
| 437 | 438 | ||
| 438 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, | 439 | Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, |
| 439 | use overlays for highlighting. If overlays are used, the | 440 | use overlays for highlighting. If overlays are used, the |
| @@ -689,7 +690,9 @@ with completion and history." | |||
| 689 | (intern face))) | 690 | (intern face))) |
| 690 | 691 | ||
| 691 | (defun hi-lock-set-pattern (regexp face &optional subexp) | 692 | (defun hi-lock-set-pattern (regexp face &optional subexp) |
| 692 | "Highlight SUBEXP of REGEXP with face FACE." | 693 | "Highlight SUBEXP of REGEXP with face FACE. |
| 694 | If omitted or nil, SUBEXP defaults to zero, i.e. the entire | ||
| 695 | REGEXP is highlighted." | ||
| 693 | ;; Hashcons the regexp, so it can be passed to remove-overlays later. | 696 | ;; Hashcons the regexp, so it can be passed to remove-overlays later. |
| 694 | (setq regexp (hi-lock--hashcons regexp)) | 697 | (setq regexp (hi-lock--hashcons regexp)) |
| 695 | (setq subexp (or subexp 0)) | 698 | (setq subexp (or subexp 0)) |