GNU bug report logs -
#24472
25.1; Emacs crashes when clicking on OSX menu bar when opening file with tramp
Previous Next
Reported by: Souvik Banerjee <souvik1997 <at> gmail.com>
Date: Mon, 19 Sep 2016 19:48:01 UTC
Severity: normal
Tags: confirmed
Merged with 37299,
37557
Found in versions 25.1, 26.3, 27.0.50
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Marc Herbert <marc.herbert <at> gmail.com> writes:
Hi Marc,
> I leveraged the milder symptoms in 26.1 to debug the issue and found a
> workaround/fix. I then upgraded to 26.3 and ta-da: the crashes are
> gone!
>
> The root cause is in menu-bar.el which defines the revert-buffer item like this:
>
> '(menu-item "Revert Buffer" revert-buffer
> :enable (or (blah) (blah)
> (and buffer-file-number
> (or (buffer-modified-p)
> (not (verify-visited-file-modtime
> (current-buffer))))))
>
> This greys out the "Revert Buffer" menu item when (among others) no
> one modified the file outside Emacs.
>
> verify-visited-file-modtime calls
> tramp-sh-handle-verify-visited-file-modtime that temporarily hardcodes
> remote-file-name-inhibit-cache to 't that causes the network accesses
> that cause the delays and/or crashes.
Excellent analysis!
> After a few other attempts, my final workaround is dead simple: remove
> the "Revert Buffer" item from the menu by adding this one line to your
> .emacs file:
>
> (define-key global-map [menu-bar file revert-buffer] nil)
>
> Enjoy. I think it's better than a "workaround" actually, it's almost a
> "feature" that I'm going to keep that in my .emacs file permanently
> because trying to use the network every time you click the menubar is
> just... silly?
Isn't this too heavy? Wouldn't it be sufficient to avoid the
`verify-visited-file-modtime' call in case the buffer is visiting a
remote file? Something like
(and buffer-file-number
(or (buffer-modified-p)
(file-remote-p default-directory)
(not (verify-visited-file-modtime
(current-buffer))))))
> I also tried to hack menu-bar.el directly but any change I made to it
> was completely ignored. Anyone knows why?
Hmm. Have you recompiled the whole Emacs after your change? Maybe menu-bar.elc
is dumped into Emacs?
Best regards, Michael.
This bug report was last modified 4 years and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.