* Re: Bind `q' to `quit-window' or similar in *Messages*
@ 2010-02-04 3:24 Roland Winkler
2010-02-04 4:27 ` Miles Bader
0 siblings, 1 reply; 7+ messages in thread
From: Roland Winkler @ 2010-02-04 3:24 UTC (permalink / raw)
To: miles; +Cc: emacs-devel
> It's set to t to avoid generating zillions of useless undo entries.
>
> That's pretty reasonable given that 99.99% of the time, people
> _don't_ edit *Messages*, and yet it changes a lot.
>
> It's silly to start changing *Messages* with the idea that people
> are editing it, because that's almost never the case.
...which brings us back to the original request: most often it is
used for viewing what is happening, so that most people probably
were happy if `q' had the same quit-window binding it has in other
buffers that are not intended for editing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bind `q' to `quit-window' or similar in *Messages*
2010-02-04 3:24 Bind `q' to `quit-window' or similar in *Messages* Roland Winkler
@ 2010-02-04 4:27 ` Miles Bader
2010-02-04 8:15 ` Tassilo Horn
2010-02-04 15:33 ` Stefan Monnier
0 siblings, 2 replies; 7+ messages in thread
From: Miles Bader @ 2010-02-04 4:27 UTC (permalink / raw)
To: Roland Winkler; +Cc: emacs-devel
Roland Winkler <rwinkler@niu.edu> writes:
> ...which brings us back to the original request: most often it is
> used for viewing what is happening, so that most people probably
> were happy if `q' had the same quit-window binding it has in other
> buffers that are not intended for editing.
Indeed.
-Miles
--
"Nah, there's no bigger atheist than me. Well, I take that back.
I'm a cancer screening away from going agnostic and a biopsy away
from full-fledged Christian." [Adam Carolla]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bind `q' to `quit-window' or similar in *Messages*
2010-02-04 4:27 ` Miles Bader
@ 2010-02-04 8:15 ` Tassilo Horn
2010-02-04 8:24 ` Tassilo Horn
2010-02-04 15:33 ` Stefan Monnier
1 sibling, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2010-02-04 8:15 UTC (permalink / raw)
To: emacs-devel
Miles Bader <miles@gnu.org> writes:
> Roland Winkler <rwinkler@niu.edu> writes:
>> ...which brings us back to the original request: most often it is
>> used for viewing what is happening, so that most people probably were
>> happy if `q' had the same quit-window binding it has in other buffers
>> that are not intended for editing.
>
> Indeed.
99% of the time, I use it that way, too. But when debugging some elisp
code, I sometimes add markers there, like Drew pointed out. So how
about this idea:
- *Messages* is read-only
- `q' buries the buffer
- `m' is bound to a new command that provides an interface to
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bind `q' to `quit-window' or similar in *Messages*
2010-02-04 8:15 ` Tassilo Horn
@ 2010-02-04 8:24 ` Tassilo Horn
0 siblings, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2010-02-04 8:24 UTC (permalink / raw)
To: emacs-devel
Tassilo Horn <tassilo@member.fsf.org> writes:
Ups, sorry. I'm sick, and my head fell on the keyboard sending the
message before it was finished... :-)
>> Roland Winkler <rwinkler@niu.edu> writes:
>>> ...which brings us back to the original request: most often it is
>>> used for viewing what is happening, so that most people probably were
>>> happy if `q' had the same quit-window binding it has in other buffers
>>> that are not intended for editing.
>>
>> Indeed.
>
> 99% of the time, I use it that way, too. But when debugging some elisp
> code, I sometimes add markers there, like Drew pointed out. So how
> about this idea:
>
> - *Messages* is read-only
> - `q' buries the buffer
> - `m' is bound to a new command that provides an interface to
Ok, `m' would be bound to a new command that provides an interface to
`message'. It would read a format string, and if that contains %s and
friends, it would read those (with elisp completion).
That way, I could quickly add a marker with
m ##################### RET
or get some more useful informations with
m %d^2 = %d RET 3 RET (* 3 3) RET.
One problem I see, is that would always append to *Messages*, and I
guess some users want to be able to write anywhere...
Bye,
Tassilo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bind `q' to `quit-window' or similar in *Messages*
2010-02-04 4:27 ` Miles Bader
2010-02-04 8:15 ` Tassilo Horn
@ 2010-02-04 15:33 ` Stefan Monnier
2010-02-04 16:58 ` C-x C-q and undo [was: Bind `q' to `quit-window' or similar in *Messages*] Drew Adams
2010-02-04 23:40 ` Bind `q' to `quit-window' or similar in *Messages* Miles Bader
1 sibling, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2010-02-04 15:33 UTC (permalink / raw)
To: Miles Bader; +Cc: Roland Winkler, emacs-devel
>> ...which brings us back to the original request: most often it is
>> used for viewing what is happening, so that most people probably
>> were happy if `q' had the same quit-window binding it has in other
>> buffers that are not intended for editing.
> Indeed.
Agreed. I think we need:
1- define a major mode for it with `q' bound to quit-window.
2- default it to read-only.
The major-mode will make it possible for people to add keybindings
and things.
Stefan
PS: BTW, I've often felt that C-x C-q should turn on the undo-log when
making a buffer writeable. It hasn't bothered me enough to actually
code it up and try it, but maybe people could try it out and see if it
leads to problems.
^ permalink raw reply [flat|nested] 7+ messages in thread
* C-x C-q and undo [was: Bind `q' to `quit-window' or similar in *Messages*]
2010-02-04 15:33 ` Stefan Monnier
@ 2010-02-04 16:58 ` Drew Adams
2010-02-04 23:40 ` Bind `q' to `quit-window' or similar in *Messages* Miles Bader
1 sibling, 0 replies; 7+ messages in thread
From: Drew Adams @ 2010-02-04 16:58 UTC (permalink / raw)
To: emacs-devel; +Cc: 'Stefan Monnier'
> I've often felt that C-x C-q should turn on the undo-log when
> making a buffer writeable. It hasn't bothered me enough to actually
> code it up and try it, but maybe people could try it out and see if it
> leads to problems.
I was wondering the same thing.
But maybe the two should not always be coupled.
It's easy enough to enable undo, with command `buffer-enable-undo'. Of course,
that's not bound to a key, by default. (Likewise, disabling.)
The prefix arg for `C-x C-q' is used only to specify on or off explicitly. One
possibility would be to have plain `C-u' toggle read-only and call
`buffer-enable-undo' or `buffer-disable-undo' as appropriate. So:
C-1 C-x C-q would turn read-only ON (and not affect undo)
C- C-x C-q would turn read-only OFF " " " "
C-u C-x C-q would toggle read-only and turn undo on/off accordingly
Even more flexible: We could have an option, `toggle-read-only-affects-undo'. If
non-nil, then `C-x C-q' without `C-u' would affect undo; with `C-u' it would not
affect undo. If nil, the behavior would be reversed: without `C-u' would not
affect undo; with `C-u' it would affect undo.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bind `q' to `quit-window' or similar in *Messages*
2010-02-04 15:33 ` Stefan Monnier
2010-02-04 16:58 ` C-x C-q and undo [was: Bind `q' to `quit-window' or similar in *Messages*] Drew Adams
@ 2010-02-04 23:40 ` Miles Bader
1 sibling, 0 replies; 7+ messages in thread
From: Miles Bader @ 2010-02-04 23:40 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Roland Winkler, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> PS: BTW, I've often felt that C-x C-q should turn on the undo-log when
> making a buffer writeable. It hasn't bothered me enough to actually
> code it up and try it, but maybe people could try it out and see if it
> leads to problems.
Undo in a buffer that's frequently updated automatically can be
pretty annoying...
It would actually be nice if there were some way to make undo only
operate on user edits, and simply ignore automatic insertions etc
(this is a problem in comint too), but I get the impression that's not
entirely trivial, since the undo-list contains absolute positions.
[There was a previous thread on this too; forget what the resolution
was, but I think there was some existing code written for some mode or
another to do this.]
-Miles
--
"Most attacks seem to take place at night, during a rainstorm, uphill,
where four map sheets join." -- Anon. British Officer in WW I
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-02-04 23:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 3:24 Bind `q' to `quit-window' or similar in *Messages* Roland Winkler
2010-02-04 4:27 ` Miles Bader
2010-02-04 8:15 ` Tassilo Horn
2010-02-04 8:24 ` Tassilo Horn
2010-02-04 15:33 ` Stefan Monnier
2010-02-04 16:58 ` C-x C-q and undo [was: Bind `q' to `quit-window' or similar in *Messages*] Drew Adams
2010-02-04 23:40 ` Bind `q' to `quit-window' or similar in *Messages* Miles Bader
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).