GNU bug report logs - #11298
24.0.95; (WISH) Re-look scratch buffers

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Sat, 21 Apr 2012 15:57:02 UTC

Severity: wishlist

Merged with 1109

Found in version 24.0.95

Done: Jambunathan K <kjambunathan <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11298 <at> debbugs.gnu.org
Subject: bug#11298: 24.0.95; (WISH) Re-look scratch buffers
Date: Sun, 22 Apr 2012 02:20:01 +0530
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> 1. Allow multiple scratch buffers one for each mode the user is
>>    interested in.
>
> We do not disallow that, so could you be more specific in what you mean
> by that?
>

Instead of creating one scratch buffer, make changes such a way that N
scratch buffers are created. N = 0, 1, 2, 3 etc etc.

>>    The defcustom can have a solitary text-mode entry.
>
> Which defcustom?

This defcustom will be newly introduced as part of this change.  Let's
call it `scratch-buffer-modes'.  With the below setting,

  (setq scratch-buffer-modes '(emacs-lisp-mode org-mode))

I will get 2 scratch buffers by default on startup.  One *org-scratch*
in org-mode and one *emacs-lisp-scratch* in emacs-lisp mode.

If someone is unhappy with having any scratch buffers at all, then one
could just do a

  (setq scratch-buffer-mode nil)


>>       C-u C-x b can offer to create *scratch-%s* (or %s-scratch) in
>>       %s-mode.
>
> Interesting idea.  It might not even need a C-u: we could simply make
> C-x b query the user for a major-mode when the buffer doesn't exist yet
> (and we could try and take a hint from the buffer name to guess a good
> default: e.g. looking for a major-mode name in the buffer name, or
> matching the buffer name against auto-mode-alist).

Whatever is chosen, this prompt "No buffer matching whatever, create one
(y/n)?" should be removed.  This is annoying.  I am not destroying
things.  I am not sure why the world is against people creating stuff
:-).

A sensible name *must* be offered, which I can just RET with possibly a
minor modification.

>> 3. I think it is not the scratch buffer that is idiosyncratic but the
>>    /name/.  Instead of using scratch one could call it say a notes
>>    buffer or a temp buffer.
>
> I'm not married to "*scratch*", but "notes" sounds like something you'd
> want to save, and "temp" sounds like something that might disappear
> without warning.

May be, marry scratch buffer with emacs-lock-mode...

I don't use persistent scratch buffers. 

A persistent scratch buffer could be same as what we now call an
`initial-buffer-choice'.  Only difference is that the file is
~/.emacs.d/scratch ("secretly" chosen by the Emacs).




This bug report was last modified 11 years and 187 days ago.

Previous Next


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