GNU bug report logs - #68648
30.0.50; read-only-mode-hook's are not executed when buffer-read-only is t

Previous Next

Package: emacs;

Reported by: Björn Bidar <bjorn.bidar <at> thaodan.de>

Date: Sun, 21 Jan 2024 20:36:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: bjorn.bidar <at> thaodan.de, Björn, Bidar, via, Bug, reports, for, GNU, Emacs, 68648 <at> debbugs.gnu.org
Subject: bug#68648: 30.0.50; read-only-mode-hook's are not executed when buffer-read-only is t
Date: Mon, 22 Jan 2024 11:00:47 +0200
On January 21, 2024 10:35:26 PM GMT+02:00, "Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> wrote:
> I noticed when opening a file which isn't readable that
> read-only-mode-hooks are not executed.
> 
> 1. (add-hook 'read-only-mode-hook (lambda () (print "foobar")))
> 2. open file that is read-only
> 3. foobar should be print but isn't.


That's because read-only-mode is not entered when you visit a write-protected file.  Maybe we should call the hook anyway, I'm not sure.  We don't honor view-read-only either in these cases, for the same reason.





This bug report was last modified 1 year and 103 days ago.

Previous Next


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