From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode Date: Tue, 08 Nov 2022 21:32:03 +0200 Message-ID: <83a651xmx8.fsf@gnu.org> References: <86k045b70e.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, 53981@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 08 20:33:07 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osULK-0001eu-P7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Nov 2022 20:33:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osULH-00025m-Gg; Tue, 08 Nov 2022 14:33:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osULG-00025Y-7C for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 14:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osULF-0003av-Vn for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 14:33:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1osULF-00017D-Oh for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 14:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Nov 2022 19:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53981 X-GNU-PR-Package: emacs Original-Received: via spool by 53981-submit@debbugs.gnu.org id=B53981.16679359454245 (code B ref 53981); Tue, 08 Nov 2022 19:33:01 +0000 Original-Received: (at 53981) by debbugs.gnu.org; 8 Nov 2022 19:32:25 +0000 Original-Received: from localhost ([127.0.0.1]:38199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osUKe-00016P-W0 for submit@debbugs.gnu.org; Tue, 08 Nov 2022 14:32:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osUKd-00016D-0q for 53981@debbugs.gnu.org; Tue, 08 Nov 2022 14:32:23 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osUKX-0003KA-1I; Tue, 08 Nov 2022 14:32:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=q8QfDZT7W0PxHvlSjLg8LoE7V3Hp6P6LRgsXYxnigNg=; b=MF+VbAoqSrcG Nlt9vYzwyG1AZh4nj7kOr5D7rPwJXYaya90ZiVLuwjPJKpLF+t95iVtVXA07qP9guigQWkz88/eJ9 ctW+kbGnpE7Q8jeE262xgrLYpEF9yl2VoYzTGWZVgvQDRh3i5RuquoNNY0xGN+Fst5du07baWTYU9 aeUW3K08ctnqaWTXcl4SwKIpM8ZRzvcd4y/IH3efWzo+tgz6G8IaBzCFA370JLrws+s3cwu1/E4eV tqiQlqwC+m4yMVCJbUa/qEIv4MPkJ4q8LBIIhmwu9Q3Vr4LjVtzvwJxcCX1GJ9LcdjkvujhaQb2sk VDHwnGvhVVW8uoBsFxXy7g==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osUKW-0008SM-Cl; Tue, 08 Nov 2022 14:32:16 -0500 In-Reply-To: <86k045b70e.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 08 Nov 2022 21:12:45 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247357 Archived-At: > Cc: 53981@debbugs.gnu.org > From: Juri Linkov > 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.)