summaryrefslogtreecommitdiff
path: root/lisp/outline.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2022-08-30 20:09:20 +0300
committerJuri Linkov <juri@linkov.net>2022-08-30 20:09:20 +0300
commit7804536e4e6dd7fa57d38b9b6c6835ae316bff50 (patch)
treef105e0bc8439d965f4fb5ec901e22c8b8a4ed4a9 /lisp/outline.el
parente1e60e51bf324aaa2137075827c4d08a331a7bef (diff)
downloademacs-7804536e4e6dd7fa57d38b9b6c6835ae316bff50.tar.gz
Fix 744ed0ceeed7472a160fea7154939cf641205577 from bug#57082 (bug#57176)
* lisp/outline.el (outline-minor-mode-highlight-buffer): Handle 'append'. (outline-minor-mode): Call outline--fix-up-all-buttons when font-lock is used. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix regexp.
Diffstat (limited to 'lisp/outline.el')
-rw-r--r--lisp/outline.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/outline.el b/lisp/outline.el
index 3250b62f1e7..857ac9562fd 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -427,15 +427,14 @@ outline font-lock faces to those of major mode."
(goto-char (point-min))
(let ((regexp (concat "^\\(?:" outline-regexp "\\).*$")))
(while (re-search-forward regexp nil t)
- (let ((overlay (make-overlay (match-beginning 0)
- (match-end 0))))
+ (let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
(overlay-put overlay 'outline-overlay t)
- (when (or (eq outline-minor-mode-highlight 'override)
+ ;; FIXME: Is it possible to override all underlying face attributes?
+ (when (or (memq outline-minor-mode-highlight '(append override))
(and (eq outline-minor-mode-highlight t)
- (goto-char (match-beginning 0))
- (not (get-text-property (point) 'face))))
+ (not (get-text-property (match-beginning 0) 'face))))
(overlay-put overlay 'face (outline-font-lock-face)))
- (when (and (outline--use-buttons-p) (outline-on-heading-p))
+ (when (outline--use-buttons-p)
(outline--insert-open-button)))
(goto-char (match-end 0))))))
@@ -452,10 +451,12 @@ See the command `outline-mode' for more information on this mode."
(if outline-minor-mode
(progn
(when outline-minor-mode-highlight
- (when (and global-font-lock-mode (font-lock-specified-p major-mode))
- (font-lock-add-keywords nil outline-font-lock-keywords t)
- (font-lock-flush))
- (outline-minor-mode-highlight-buffer))
+ (if (and global-font-lock-mode (font-lock-specified-p major-mode))
+ (progn
+ (font-lock-add-keywords nil outline-font-lock-keywords t)
+ (font-lock-flush)
+ (outline--fix-up-all-buttons))
+ (outline-minor-mode-highlight-buffer)))
;; Turn off this mode if we change major modes.
(add-hook 'change-major-mode-hook
(lambda () (outline-minor-mode -1))