GNU bug report logs - #53981
28.0.91; shortdoc: Add support for outline-minor-mode

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 13 Feb 2022 22:40:02 UTC

Severity: wishlist

Found in version 28.0.91

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #52 received at 53981 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: mail <at> daniel-mendler.de, 53981 <at> debbugs.gnu.org
Subject: Re: bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode
Date: Tue, 08 Nov 2022 21:32:03 +0200
> Cc: 53981 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Tue, 08 Nov 2022 21:12:45 +0200
> 
> @@ -474,16 +485,17 @@ outline-minor-mode-highlight-buffer
>    ;; Fallback to overlays when font-lock is unsupported.
>    (save-excursion
>      (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))))
> -          (overlay-put overlay 'outline-highlight t)
> -          ;; 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)
> -                         (not (get-text-property (match-beginning 0) 'face))))
> -            (overlay-put overlay 'face (outline-font-lock-face))))
> -        (goto-char (match-end 0))))))
> +    (while (if outline-search-function
> +               (funcall outline-search-function)
> +             (re-search-forward outline-regexp nil t))

This changes the effect of the code because the new code searches for
a different regexp.

> @@ -877,17 +903,21 @@ outline-next-visible-heading
>      (while (and (not (bobp)) (< arg 0))
>        (while (and (not (bobp))
>  		  (setq found-heading-p
> -			(re-search-backward
> -			 (concat "^\\(?:" outline-regexp "\\)")
> -			 nil 'move))
> +			(if outline-search-function
> +                            (funcall outline-search-function nil 'backward)
> +                          (re-search-backward
> +			   (concat "^\\(?:" outline-regexp "\\)")
> +			   nil 'move)))
>  		  (outline-invisible-p)))
>        (setq arg (1+ arg)))
>      (while (and (not (eobp)) (> arg 0))
>        (while (and (not (eobp))
>  		  (setq found-heading-p
> -			(re-search-forward
> -			 (concat "^\\(?:" outline-regexp "\\)")
> -			 nil 'move))
> +			(if outline-search-function
> +                            (funcall outline-search-function)
> +                          (re-search-forward
> +			   (concat "^\\(?:" outline-regexp "\\)")
> +			   nil 'move)))
>  		  (outline-invisible-p (match-beginning 0))))

These two loops cons a new string each iteration.  (So did the
original code, but if we are touching this, might as well fix that.)




This bug report was last modified 2 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.