diff options
| author | Juri Linkov | 2021-03-13 23:33:14 +0200 |
|---|---|---|
| committer | Juri Linkov | 2021-03-13 23:33:14 +0200 |
| commit | fbfc3bd31748015dfab9213ebedb99513a9cb2b9 (patch) | |
| tree | f936feb0243b09afdf9ba38247965fceb4515a9e | |
| parent | 34b49ee8e9ff5b8615aa0c6f3de41be59d7557df (diff) | |
| download | emacs-fbfc3bd31748015dfab9213ebedb99513a9cb2b9.tar.gz emacs-fbfc3bd31748015dfab9213ebedb99513a9cb2b9.zip | |
Separate values 'override' and 'append' in 'outline-minor-mode-highlight'
* lisp/outline.el (outline-font-lock-keywords): Handle 'override' and 'append'
separately.
(outline-minor-mode-highlight): Separate values 'override' and 'append'.
(outline-minor-mode-highlight-buffer): Go to match-beginning
before checking '(point)'.
| -rw-r--r-- | lisp/outline.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/outline.el b/lisp/outline.el index b4d37b2207f..79029a6e5e7 100644 --- a/lisp/outline.el +++ b/lisp/outline.el | |||
| @@ -207,9 +207,10 @@ in the file it applies to.") | |||
| 207 | (list 'face nil | 207 | (list 'face nil |
| 208 | 'keymap outline-mode-cycle-map))) | 208 | 'keymap outline-mode-cycle-map))) |
| 209 | (outline-font-lock-face)) | 209 | (outline-font-lock-face)) |
| 210 | (when (and outline-minor-mode | 210 | (when outline-minor-mode |
| 211 | (eq outline-minor-mode-highlight 'override)) | 211 | (pcase outline-minor-mode-highlight |
| 212 | 'append) | 212 | ('override t) |
| 213 | ('append 'append))) | ||
| 213 | t))) | 214 | t))) |
| 214 | "Additional expressions to highlight in Outline mode.") | 215 | "Additional expressions to highlight in Outline mode.") |
| 215 | 216 | ||
| @@ -340,10 +341,12 @@ Typing these keys anywhere outside heading lines uses their default bindings." | |||
| 340 | Non-nil value works well only when outline font-lock keywords | 341 | Non-nil value works well only when outline font-lock keywords |
| 341 | don't conflict with the major mode's font-lock keywords. | 342 | don't conflict with the major mode's font-lock keywords. |
| 342 | When t, it puts outline faces only if there are no major mode's faces | 343 | When t, it puts outline faces only if there are no major mode's faces |
| 343 | on headings. When `override', it tries to append outline faces | 344 | on headings. When `override', it completely overwrites major mode's |
| 344 | to major mode's faces." | 345 | faces with outline faces. When `append', it tries to append outline |
| 346 | faces to major mode's faces." | ||
| 345 | :type '(choice (const :tag "No highlighting" nil) | 347 | :type '(choice (const :tag "No highlighting" nil) |
| 346 | (const :tag "Append to major mode faces" override) | 348 | (const :tag "Overwrite major mode faces" override) |
| 349 | (const :tag "Append outline faces to major mode faces" append) | ||
| 347 | (const :tag "Highlight separately from major mode faces" t)) | 350 | (const :tag "Highlight separately from major mode faces" t)) |
| 348 | :version "28.1") | 351 | :version "28.1") |
| 349 | ;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable 'booleanp) | 352 | ;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable 'booleanp) |
| @@ -359,6 +362,7 @@ to major mode's faces." | |||
| 359 | (overlay-put overlay 'outline-overlay t) | 362 | (overlay-put overlay 'outline-overlay t) |
| 360 | (when (or (eq outline-minor-mode-highlight 'override) | 363 | (when (or (eq outline-minor-mode-highlight 'override) |
| 361 | (and (eq outline-minor-mode-highlight t) | 364 | (and (eq outline-minor-mode-highlight t) |
| 365 | (goto-char (match-beginning 0)) | ||
| 362 | (not (get-text-property (point) 'face)))) | 366 | (not (get-text-property (point) 'face)))) |
| 363 | (overlay-put overlay 'face (outline-font-lock-face))) | 367 | (overlay-put overlay 'face (outline-font-lock-face))) |
| 364 | (when outline-minor-mode-cycle | 368 | (when outline-minor-mode-cycle |