[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fbfc3bd: Separate values 'override' and 'append' in 'outline-mino
From: |
Juri Linkov |
Subject: |
master fbfc3bd: Separate values 'override' and 'append' in 'outline-minor-mode-highlight' |
Date: |
Sat, 13 Mar 2021 16:33:27 -0500 (EST) |
branch: master
commit fbfc3bd31748015dfab9213ebedb99513a9cb2b9
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
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)'.
---
lisp/outline.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lisp/outline.el b/lisp/outline.el
index b4d37b2..79029a6 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -207,9 +207,10 @@ in the file it applies to.")
(list 'face nil
'keymap outline-mode-cycle-map)))
(outline-font-lock-face))
- (when (and outline-minor-mode
- (eq outline-minor-mode-highlight 'override))
- 'append)
+ (when outline-minor-mode
+ (pcase outline-minor-mode-highlight
+ ('override t)
+ ('append 'append)))
t)))
"Additional expressions to highlight in Outline mode.")
@@ -340,10 +341,12 @@ Typing these keys anywhere outside heading lines uses
their default bindings."
Non-nil value works well only when outline font-lock keywords
don't conflict with the major mode's font-lock keywords.
When t, it puts outline faces only if there are no major mode's faces
-on headings. When `override', it tries to append outline faces
-to major mode's faces."
+on headings. When `override', it completely overwrites major mode's
+faces with outline faces. When `append', it tries to append outline
+faces to major mode's faces."
:type '(choice (const :tag "No highlighting" nil)
- (const :tag "Append to major mode faces" override)
+ (const :tag "Overwrite major mode faces" override)
+ (const :tag "Append outline faces to major mode faces" append)
(const :tag "Highlight separately from major mode faces" t))
:version "28.1")
;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable
'booleanp)
@@ -359,6 +362,7 @@ to major mode's faces."
(overlay-put overlay 'outline-overlay t)
(when (or (eq outline-minor-mode-highlight 'override)
(and (eq outline-minor-mode-highlight t)
+ (goto-char (match-beginning 0))
(not (get-text-property (point) 'face))))
(overlay-put overlay 'face (outline-font-lock-face)))
(when outline-minor-mode-cycle
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master fbfc3bd: Separate values 'override' and 'append' in 'outline-minor-mode-highlight',
Juri Linkov <=