* bug#7292: view-mode clobbers speedbar bindings
@ 2010-10-28 0:03 Ryan Twitchell
2010-10-28 3:01 ` Glenn Morris
0 siblings, 1 reply; 6+ messages in thread
From: Ryan Twitchell @ 2010-10-28 0:03 UTC (permalink / raw)
To: 7292
Hi,
A number of speedbar's bindings, such as 'n' and 'p', do not work with
view-mode enabled in the speedbar buffer (which makes no sense anyway).
This is relevant when view-read-only is set, causing speedbar-mode to
implicitly enable view-mode.
For my part, I have redefined speedbar-mode in my .emacs file as follows:
(require 'speedbar)
(defvar real-speedbar-mode #'speedbar-mode)
(defun speedbar-mode ()
(let ((view-read-only nil))
(funcall #'real-speedbar-mode)))
This appears to solve the problem. speedbar-mode calls
toggle-read-only; binding view-read-only to nil around that call should
be a more permanent fix.
M-x emacs-version
GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of
2010-09-26 on falconsrevenge
Thanks,
Ryan Twitchell
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#7292: view-mode clobbers speedbar bindings
2010-10-28 0:03 bug#7292: view-mode clobbers speedbar bindings Ryan Twitchell
@ 2010-10-28 3:01 ` Glenn Morris
2010-10-28 3:11 ` Ryan Twitchell
0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2010-10-28 3:01 UTC (permalink / raw)
To: Ryan Twitchell; +Cc: 7292
Ryan Twitchell wrote:
> speedbar-mode calls toggle-read-only;
Why does it do this, as opposed to `(setq buffer-read-only t)'?
(I notice a few other files call toggle-read-only as well. Seems odd.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#7292: view-mode clobbers speedbar bindings
2010-10-28 3:01 ` Glenn Morris
@ 2010-10-28 3:11 ` Ryan Twitchell
2010-10-29 7:49 ` Glenn Morris
0 siblings, 1 reply; 6+ messages in thread
From: Ryan Twitchell @ 2010-10-28 3:11 UTC (permalink / raw)
To: Glenn Morris; +Cc: 7292
On 10/27/2010 11:01 PM, Glenn Morris wrote:
> Ryan Twitchell wrote:
>
>> speedbar-mode calls toggle-read-only;
> Why does it do this, as opposed to `(setq buffer-read-only t)'?
>
> (I notice a few other files call toggle-read-only as well. Seems odd.)
A fair question. I suppose this is just caution: toggle-read-only will
always "do the right thing" to make sure the buffer is read-only, though
setting buffer-read-only should be sufficient.
Ryan Twitchell
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#7292: view-mode clobbers speedbar bindings
2010-10-28 3:11 ` Ryan Twitchell
@ 2010-10-29 7:49 ` Glenn Morris
2010-10-29 16:00 ` Stefan Monnier
0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2010-10-29 7:49 UTC (permalink / raw)
To: Ryan Twitchell; +Cc: 7292
Ryan Twitchell wrote:
>> (I notice a few other files call toggle-read-only as well. Seems odd.)
>
> A fair question. I suppose this is just caution: toggle-read-only will
> always "do the right thing" to make sure the buffer is read-only, though
> setting buffer-read-only should be sufficient.
That doesn't make sense to me. I replace several inappropriate uses,
including the speedbar one.
I wonder if toggle-read-only should even be added to
byte-compile-interactive-only-functions.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#7292: view-mode clobbers speedbar bindings
2010-10-29 7:49 ` Glenn Morris
@ 2010-10-29 16:00 ` Stefan Monnier
2011-11-10 2:19 ` Glenn Morris
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2010-10-29 16:00 UTC (permalink / raw)
To: Glenn Morris; +Cc: 7292, Ryan Twitchell
>>> (I notice a few other files call toggle-read-only as well. Seems odd.)
>> A fair question. I suppose this is just caution: toggle-read-only will
>> always "do the right thing" to make sure the buffer is read-only, though
>> setting buffer-read-only should be sufficient.
> That doesn't make sense to me. I replace several inappropriate uses,
> including the speedbar one.
> I wonder if toggle-read-only should even be added to
> byte-compile-interactive-only-functions.
I wonder as well. I know I'm to blame for some of the calls to
toggle-read-only, because I thought it might be better to use the
higher-level function. But indeed it seems that was a mistake.
So let's add it to byte-compile-interactive-only-functions (with
a comment about why); and if it turns out that there are many cases
where calling it from Elisp makes sense, then we'll get to learn which
are the cases where it makes sense.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#7292: view-mode clobbers speedbar bindings
2010-10-29 16:00 ` Stefan Monnier
@ 2011-11-10 2:19 ` Glenn Morris
0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2011-11-10 2:19 UTC (permalink / raw)
To: 7292-done
Version: 24.0.92
Stefan Monnier wrote:
> So let's add it to byte-compile-interactive-only-functions (with
> a comment about why); and if it turns out that there are many cases
> where calling it from Elisp makes sense, then we'll get to learn which
> are the cases where it makes sense.
Done.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-10 2:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28 0:03 bug#7292: view-mode clobbers speedbar bindings Ryan Twitchell
2010-10-28 3:01 ` Glenn Morris
2010-10-28 3:11 ` Ryan Twitchell
2010-10-29 7:49 ` Glenn Morris
2010-10-29 16:00 ` Stefan Monnier
2011-11-10 2:19 ` Glenn Morris
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).