From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#57082: 29.0.50; emacs-news-view-mode breakage Date: Tue, 09 Aug 2022 18:18:11 +0200 Message-ID: <87zggdxuf0.fsf@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17597"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 57082@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 09 18:24:45 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 1oLS26-0004I0-I8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 18:24:42 +0200 Original-Received: from localhost ([::1]:57214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLS25-0004iK-Gn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 12:24:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLRwd-0006Iv-MQ for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 12:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLRwd-0002KZ-Cs for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 12:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLRwd-0001K9-6n for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 12:19:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Aug 2022 16:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57082 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16600619305054 (code B ref -1); Tue, 09 Aug 2022 16:19:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Aug 2022 16:18:50 +0000 Original-Received: from localhost ([127.0.0.1]:44616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLRwQ-0001JS-30 for submit@debbugs.gnu.org; Tue, 09 Aug 2022 12:18:50 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLRwO-0001JJ-5W for submit@debbugs.gnu.org; Tue, 09 Aug 2022 12:18:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLRw6-0005ot-DB for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 12:18:40 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:60057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLRvs-0002H6-2m for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 12:18:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1660061892; bh=r6LTtcZSuFexKr5AfdUKXLY/5jnQO4Qj9VUoThzr5N0=; h=X-UI-Sender-Class:From:To:Subject:Date; b=Su16gIYJK4G3PiHvlsOe9X4EPKcN5B2ItxH933DYYGvVwiGuRlqxmtBtq7hUW8UGL ufg82h1y6IixLMnx4ZeDR9wx0ApVTiXNRmRM6S9VheSnd1lef3jIbVuq89ZtBjyU3H 5sfMP9h0BNzc0r2YFUAkcti04IA5PM3mTLinE1q4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobelfs2 ([89.246.38.154]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mk0JM-1nfXY41ivo-00kQZp for ; Tue, 09 Aug 2022 18:18:12 +0200 X-Provags-ID: V03:K1:Jr1Vk6/QT8dYyjgi7VOCJdcMTMNTxt2JEYyOHr19jPwSIdJWfX7 k4OQ/2P07fW0I6+A/mTh+mpE5tIKl5Uo+HS8wqRzNyqsEmg5XK+rbzZZaxGT0UaIV9ZJEKZ FVKnpylI4966xlSWi15aNG8YHcUQHYwPgJgq5eSiQgWqjOs3u30sU/p0dnVu1GZlA2/BBPc ttjuxLHfD05FHONY49wtA== X-UI-Out-Filterresults: notjunk:1;V03:K0:TgUhaWPLbyM=:Od6O8MPMUfK/1QHeGzR9sa vQ9i76UWzRd7zavuRluWD6a+pMFDIqk7712d5a3YAhzoKYm2L+xqPx1YlAzXdBp3ppesj96B/ k185ASDw3f/h6wVZdviHLBpFhJiJ63wgnrW9Tr5EzpKLgzL5MmVA9/taP0UhT3y6ybGnk8cAG paSrfj2QgQiGa6UU+XdbykiDwEZg1ymFL9hEzrHwny+1b2s1sV3YFdJ0CHVmXNTfzMqA3oGwd QpZmmUF0PIo5bRs0M0wd23mcXUw0TO4QuvBXnZ9Mg6Uel/NSL0MYi5O7gyhlDb45u/rK1PEJe y24H5WbGlm3+FGYneTX7HXSwZMLimUVzvxWrJWYHTQkMcpUYYdx4VXtEc1Lm7H9JQEdNgN2R7 Yz3hL2GBEiP8B28FC9qnWA5v7eIgn335bjgIm+M5j+picQ7cBGCKAYLjBP9o0XHdc/s1B/n83 6/V81fxATtZMPQupfL/5ze4eMaR/qFTCKY8BBr/gKvWwZcpcQLE9rEE/ASMw36QnSsLE1MUqq wZGLK2UL98CXRs6j+aq0sbgz+JUQQjbPUd/RTKOrBkMzymKVrGgowjFjbXBJ7O4WCGAXK4LVQ FBCYdUP35qOKVn22MfW5Ylj48W1mWC7SitbIxdLUn6kE+HtdcSKwTTGUZ1PCyIHYi8L2M7DKD jrJy5/xyPDYa1k8rg9oLB/tJqU1MiSpTHuN+20UxAVaUP9bU3HnzkPm2wVkWWmR9DlF6mOM/h ne9MmJ5M0yy/z4UA2PCpQ9oAclOhTFxeSznWWFd/YiLZFDeCuuTaoIj3ik4tKq3RP83yKLS8 Received-SPF: pass client-ip=212.227.17.21; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:239164 Archived-At: --=-=-= Content-Type: text/plain 0. emacs -Q 1. Type `C-h n' => The NEWS buffer is displayed without icons on the header lines, although the value of `outline-minor-mode-use-buttons' is `(derived-mode . special-mode)'. 2. Type `C-c C-n' to move point to the first NEWS header "* Installation Changes in Emacs 29.1" and then type TAB => Now there is an outline-close icon (emoji) at the beginning of the header, the header has lost its first-level fontification and the NEWS buffer is flagged as modified in the mode line. But instead of hiding the current header line's body as per outline-cycle, there is no other change in the buffer. 3. Type TAB again => forward-button is executed instead of outline-cycle, indicating that the line with the icon is now not being treated as an outline header line. And typing `M-< C-c C-n' now puts point on the first second level header below the line with the icon. 4. Move point back to the icon and type RET => The icon changes to outline-open but there is otherwise no change in the outline structure, and the message "Before first heading" is displayed. 5. Type `C-c @ C-q' (outline-hide-sublevels) => The outline-close icon is inserted at the start of the second-level header below the current line and after the icon only "..." is displayed, i.e. all remaing text in the buffer has vanished. Repeatedly typing RET toggles the icon between outline-open and outline-close and displays the message "Before first heading" but the text remains hidden. (Typing `C-c @ C-a' unhides the text.) The attached patch appears to fix the problems described above, but the only buffer using outline-minor-mode beside NEWS that I've tested it on is *Help* showing the output of describe-bindings, and the seems to work as expected with the patch (and due to the patch is not flagged as modified, though that isn't important for *Help*.) In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-08-09 built on strobelfs2 Repository revision: f1f1912658556e2f2a39cdae0da7ea2b8564d861 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Linux From Scratch r11.0-165 Configured using: 'configure --with-xinput2 --with-xwidgets 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: NEWS + outline patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/outline.el b/lisp/outline.el index 7750f9a75d..35524a79a9 100644 =2D-- a/lisp/outline.el +++ b/lisp/outline.el @@ -435,7 +435,7 @@ outline-minor-mode-highlight-buffer (goto-char (match-beginning 0)) (not (get-text-property (point) 'face)))) (overlay-put overlay 'face (outline-font-lock-face))) - (when (outline--use-buttons-p) + (when (and (outline--use-buttons-p) (outline-on-heading-p)) (outline--insert-open-button))) (goto-char (match-end 0)))))) @@ -452,11 +452,10 @@ outline-minor-mode (if outline-minor-mode (progn (when outline-minor-mode-highlight - (if (and global-font-lock-mode (font-lock-specified-p major-mod= e)) - (progn - (font-lock-add-keywords nil outline-font-lock-keywords t) - (font-lock-flush)) - (outline-minor-mode-highlight-buffer))) + (when (and global-font-lock-mode (font-lock-specified-p major-m= ode)) + (font-lock-add-keywords nil outline-font-lock-keywords t) + (font-lock-flush)) + (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)) @@ -1011,32 +1010,34 @@ outline--make-button-overlay o)) (defun outline--insert-open-button () - (save-excursion - (beginning-of-line) - (when (derived-mode-p 'special-mode) - (let ((inhibit-read-only t)) - (insert " ") - (beginning-of-line))) - (let ((o (outline--make-button-overlay 'open))) - (overlay-put o 'help-echo "Click to hide") - (overlay-put o 'keymap - (define-keymap - "RET" #'outline-hide-subtree - "" #'outline-hide-subtree))))) + (with-silent-modifications + (save-excursion + (beginning-of-line) + (when (derived-mode-p 'special-mode) + (let ((inhibit-read-only t)) + (insert " ") + (beginning-of-line))) + (let ((o (outline--make-button-overlay 'open))) + (overlay-put o 'help-echo "Click to hide") + (overlay-put o 'keymap + (define-keymap + "RET" #'outline-hide-subtree + "" #'outline-hide-subtree)))))) (defun outline--insert-close-button () - (save-excursion - (beginning-of-line) - (when (derived-mode-p 'special-mode) - (let ((inhibit-read-only t)) - (insert " ") - (beginning-of-line))) - (let ((o (outline--make-button-overlay 'close))) - (overlay-put o 'help-echo "Click to show") - (overlay-put o 'keymap - (define-keymap - "RET" #'outline-show-subtree - "" #'outline-show-subtree))))) + (with-silent-modifications + (save-excursion + (beginning-of-line) + (when (derived-mode-p 'special-mode) + (let ((inhibit-read-only t)) + (insert " ") + (beginning-of-line))) + (let ((o (outline--make-button-overlay 'close))) + (overlay-put o 'help-echo "Click to show") + (overlay-put o 'keymap + (define-keymap + "RET" #'outline-show-subtree + "" #'outline-show-subtree)))))) (defun outline--fix-up-all-buttons (&optional from to) (when from diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news= -mode.el index c7fa9fa2b2..e6e1f03728 100644 =2D-- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -69,11 +69,9 @@ emacs-news-mode-font-lock-keywords (defun emacs-news--mode-common () (setq-local font-lock-defaults '(emacs-news-mode-font-lock-keywords t)) - (setq-local outline-regexp "\\*+ " + (setq-local outline-regexp "\\(:? +\\)?\\(\\*+\\) " outline-minor-mode-cycle t - ;; We subtract one from the level, because we have a - ;; space after the asterisks. - outline-level (lambda () (1- (length (match-string 0)))) + outline-level (lambda () (length (match-string 2))) outline-minor-mode-highlight 'append) (outline-minor-mode)) --=-=-=--