* go to next unsaved buffer
@ 2002-07-02 8:11 Dan Jacobson
2002-07-02 10:38 ` Paul Stoeber
0 siblings, 1 reply; 10+ messages in thread
From: Dan Jacobson @ 2002-07-02 8:11 UTC (permalink / raw)
Idea: go to next unwritten file (or whatever you call them).
The proposed "go to next unwritten file command", which merely goes
down the buffer list looking for files that are modified but not
written, will come in handy when:
It's 2:42 and the Royal Ball will start in 5 minutes. Last time this
happened you just hit C-x s y y y y y without actually looking at
what you were saving. Bad move.
Now with the new proposed command, you don't have to dig those buffers
out of the buffer list, you just run the command, and it's like "next
please". And yes, if the current buffer is unwritten when the command
is executed, it cycles to the end of the list (bury-buffer) no matter
what... until there are one or none left...
Ah yes, I forgot to dot that i. Ah yes, I forgot to cross that t.
Yes, no more hurriedly written buffers. Each one is brought before
your face for final adjustment and approval.
I propose 'em, you implement them.
--
http://jidanni.org/ Taiwan(04)25854780
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: go to next unsaved buffer
2002-07-02 8:11 go to next unsaved buffer Dan Jacobson
@ 2002-07-02 10:38 ` Paul Stoeber
2002-07-03 5:30 ` Dan Jacobson
0 siblings, 1 reply; 10+ messages in thread
From: Paul Stoeber @ 2002-07-02 10:38 UTC (permalink / raw)
Cc: bug-gnu-emacs
On Tue, Jul 02, 2002 at 04:11:34PM +0800, Dan Jacobson wrote:
> It's 2:42 and the Royal Ball will start in 5 minutes. Last time this
> happened you just hit C-x s y y y y y without actually looking at
> what you were saving. Bad move.
[...]
> Yes, no more hurriedly written buffers. Each one is brought before
> your face for final adjustment and approval.
`save-some-buffers' already has this: C-r. Type C-M-c to exit from
the recursive edit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: go to next unsaved buffer
2002-07-02 10:38 ` Paul Stoeber
@ 2002-07-03 5:30 ` Dan Jacobson
2002-07-03 12:16 ` Paul Stoeber
0 siblings, 1 reply; 10+ messages in thread
From: Dan Jacobson @ 2002-07-03 5:30 UTC (permalink / raw)
>>>>> "Paul" == Paul Stoeber <paul.stoeber@stud.tu-ilmenau.de> writes:
Paul> On Tue, Jul 02, 2002 at 04:11:34PM +0800, Dan Jacobson wrote:
>> It's 2:42 and the Royal Ball will start in 5 minutes. Last time this
>> happened you just hit C-x s y y y y y without actually looking at
>> what you were saving. Bad move.
Paul> [...]
>> Yes, no more hurriedly written buffers. Each one is brought before
>> your face for final adjustment and approval.
Paul> `save-some-buffers' already has this: C-r. Type C-M-c to exit from
Paul> the recursive edit.
It is a bug that C-h k C-x s does not mention this.
By the way I just tired what you mentioned. Seems like a great way to
get all confused. I ended up with lots of [[[ ]]] in the modeline and
I had to hit exit-recursive-edit several times to get out. Anyway, my
idea is simpler in that you aren't under the gun of being in the
middle of answering the question of saving each buffer.
--
http://jidanni.org/ Taiwan(04)25854780
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: go to next unsaved buffer
2002-07-03 5:30 ` Dan Jacobson
@ 2002-07-03 12:16 ` Paul Stoeber
2002-07-03 18:57 ` Andreas Schwab
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Paul Stoeber @ 2002-07-03 12:16 UTC (permalink / raw)
Cc: bug-gnu-emacs, emacs-devel
On Wed, Jul 03, 2002 at 01:30:16PM +0800, Dan Jacobson wrote:
> Paul> `save-some-buffers' already has this: C-r. Type C-M-c to exit from
> Paul> the recursive edit.
>
> It is a bug that C-h k C-x s does not mention this.
The prompt "Save file /tmp/1? (y, n, !, ., q, C-r or C-h)"
mentions C-r, and C-h explains it.
> By the way I just tired what you mentioned. Seems like a great way to
> get all confused. I ended up with lots of [[[ ]]] in the modeline and
> I had to hit exit-recursive-edit several times to get out.
C-r puts you into view-mode. Does this cause the problem?
It can be turned off with M-x view-mode.
> Anyway, my
> idea is simpler in that you aren't under the gun of being in the
> middle of answering the question of saving each buffer.
I've tried your idea, and it's actually more comfortable than the
the dialog with `save-some-buffers'.
A problem is: what is an "unsaved buffer"?
;; This function should be factored out of `save-some-buffers',
;; which is a moving target (see the thread
;; "[jidanni@deadspam.com: modeline doesn't divulge buffer will go bye bye]"
;; on emacs-devel).
(defun buffer-unsaved-p (buffer)
"The definition of \"unsaved buffer\" for `switch-to-next-unsaved-buffer'."
(and (buffer-modified-p buffer)
(or (buffer-file-name buffer)
(not (string-match "\\`[ *]" (buffer-name buffer))))))
(defun switch-to-next-unsaved-buffer ()
"Switch to next unsaved buffer if any.
The function `buffer-unsaved-p' defines \"unsaved buffer\"."
(interactive)
(catch 'return
(if (buffer-unsaved-p (current-buffer))
(bury-buffer (current-buffer)))
(dolist (buffer (buffer-list))
(if (buffer-unsaved-p buffer)
(if (eq buffer (current-buffer))
(error "No other unsaved buffers")
(switch-to-buffer buffer)
(throw 'return nil))))
(error "No unsaved buffers")))
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: go to next unsaved buffer
2002-07-03 12:16 ` Paul Stoeber
@ 2002-07-03 18:57 ` Andreas Schwab
2002-07-04 6:59 ` Dan Jacobson
[not found] ` <200207041824.g64IOXw06480@aztec.santafe.edu>
2 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2002-07-03 18:57 UTC (permalink / raw)
Cc: Dan Jacobson, bug-gnu-emacs, emacs-devel
Paul Stoeber <paul.stoeber@stud.tu-ilmenau.de> writes:
|> C-r puts you into view-mode. Does this cause the problem?
|> It can be turned off with M-x view-mode.
Or just type `e' (View-exit).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: go to next unsaved buffer
2002-07-03 12:16 ` Paul Stoeber
2002-07-03 18:57 ` Andreas Schwab
@ 2002-07-04 6:59 ` Dan Jacobson
[not found] ` <200207041824.g64IOXw06480@aztec.santafe.edu>
2 siblings, 0 replies; 10+ messages in thread
From: Dan Jacobson @ 2002-07-04 6:59 UTC (permalink / raw)
Cc: bug-gnu-emacs, emacs-devel
>>>>> "P" == Paul Stoeber <paul.stoeber@stud.tu-ilmenau.de> writes:
P> On Wed, Jul 03, 2002 at 01:30:16PM +0800, Dan Jacobson wrote:
Paul> `save-some-buffers' already has this: C-r. Type C-M-c to exit from
Paul> the recursive edit.
>>
>> It is a bug that C-h k C-x s does not mention this.
P> The prompt "Save file /tmp/1? (y, n, !, ., q, C-r or C-h)"
P> mentions C-r, and C-h explains it.
not good enough. I want to know what I am in for before I press the
key, that's only fair and square. What if all the C-s features were
only learnable once one was already searching. [p.s. not talking
about reading Info here, just C-h k]
>> By the way I just tired what you mentioned. Seems like a great way to
>> get all confused. I ended up with lots of [[[ ]]] in the modeline and
>> I had to hit exit-recursive-edit several times to get out.
>> idea is simpler in that you aren't under the gun of being in the
>> middle of answering the question of saving each buffer.
P> I've tried your idea, and it's actually more comfortable than the
P> the dialog with `save-some-buffers'.
P> A problem is: what is an "unsaved buffer"?
i mean the kind that C-x s would ask about, with files attached.
Oh, and then there's some gnus draft buffers too...
P> (defun switch-to-next-unsaved-buffer ()
a quick test of your function seems that it does it all... hope to see
it in emacs soon, along with an official keybinding. Pretty darn
handy actually.
uh oh, want to exclude modified *scratch* type buffers... and some
users would want *shell* to be included which seems not to now...
ok, this all should have customization instructions...
better yet, a handy 'only-if-file-associated 'processes[-too]
.... etc. predicates list...
--
http://jidanni.org/ Taiwan(04)25854780
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <200207041824.g64IOXw06480@aztec.santafe.edu>]
end of thread, other threads:[~2002-07-06 10:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-02 8:11 go to next unsaved buffer Dan Jacobson
2002-07-02 10:38 ` Paul Stoeber
2002-07-03 5:30 ` Dan Jacobson
2002-07-03 12:16 ` Paul Stoeber
2002-07-03 18:57 ` Andreas Schwab
2002-07-04 6:59 ` Dan Jacobson
[not found] ` <200207041824.g64IOXw06480@aztec.santafe.edu>
[not found] ` <20020704200235.GA8913@xyz>
2002-07-04 21:46 ` more official key bindings for us follow the leader types Dan Jacobson
2002-07-05 8:54 ` Miles Bader
[not found] ` <200207052205.g65M5tS08539@aztec.santafe.edu>
2002-07-06 7:37 ` bind me a/k/a leadership in the key binding dept Dan Jacobson
2002-07-06 10:42 ` 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).