GNU bug report logs - #73175
30.0.60; toggling emacs-news-view-mode doesn't remove buttons

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Wed, 11 Sep 2024 09:43:02 UTC

Severity: normal

Tags: fixed

Found in version 30.0.60

Fixed in version 31.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73175 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#73175: 30.0.60; toggling emacs-news-view-mode doesn't remove buttons
Date: Tue, 24 Sep 2024 17:59:23 +0200
>>>>> On Tue, 24 Sep 2024 15:25:14 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> Cc: 73175 <at> debbugs.gnu.org
    >> From: Robert Pluim <rpluim <at> gmail.com>
    >> Date: Tue, 24 Sep 2024 11:29:45 +0200
    >> 
    >> Hmm, `buttonize-region' isnʼt in the elisp manual. Iʼm assuming
    >> emacs-30 is still open for documentation changes

    Eli> Yes, thanks.

OK. Done.

Iʼve just remembered that button.el can use either overlays or text
properties to make buttons, so `unbuttonize-region' should look like
this:

(defun unbuttonize-region (start end)
  "Remove all the buttons between START and END.
This removes both text-property and overlay based buttons."
  (dolist (o (overlays-in start end))
    (when (overlay-get o 'button)
      (delete-overlay o)))
  (with-silent-modifications
    (remove-text-properties start end
                            (button--properties nil nil nil))
    (add-face-text-property start end
                            'button nil)))


Robert
-- 




This bug report was last modified 224 days ago.

Previous Next


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