all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <rms@gnu.org>, <ams@gnu.org>
Cc: kfogel@red-bean.com, sdl.web@gmail.com, emacs-devel@gnu.org
Subject: RE: Scratch buffer annoyance
Date: Tue, 17 Jul 2007 10:48:53 -0700	[thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACEEKKCAAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1IAocL-0007Fy-9k@fencepost.gnu.org>

>     Wouldn't it be smarter to make the initial splash screen the current
>     buffer when Emacs starts instead?  It would make sense for that to be
>     read-only, and when one does C-x C-q, it could for example clear it
>     and toggle the read-only status of the buffer (with a brief note in
>     the initial splash screen that one can do C-x C-q to convert it into a
>     "scratch" buffer).
>
> It is an interesting idea.  What do others think?

There are two different questions: (1) what to do about saving *scratch*,
and (2) what to show/visit when Emacs is started.

1. Wrt #1, I agree with some others that *scratch* should not be read-only,
and it should not be automatically saved -  it is a scratch pad. And I think
you should not be asked whether you want to save it - "scratch" means
scratch, just as "toss" means toss. IOW, I prefer the traditional behavior.
I don't feel strongly about this, however.

I figure that you can use *scratch* without expecting to save or be reminded
about saving, or else you can visit a new file, in which case you are
reminded about saving. You also have the option, if you change your mind, of
using `C-x C-w' to save *scratch* to a file. If you want a file named
*scratch* from the beginning, then use `C-x C-f *scratch*' and set the mode
to `lisp-interaction-mode'. I use *scratch* rarely - I usually open a
throwaway file foo.el.


2. Wrt #2, I prefer my idea of having a user option, `visit-on-startup', to
specify the startup behavior. The default value could be whatever you like,
but users should be able to customize it. I personally prefer that the
default behavior be to visit a directory with Dired, and that the default
directory be `~/':

(defcustom visit-on-startup "~/"
  "What Emacs visits initially."
  :type '(choice
          (directory :tag "Directory"        :value "~/")
          (file      :tag "File"             :value "~/new.txt")
          (const     :tag "*scratch* buffer" :value "*scratch*")
          (const     :tag "Splash screen"    nil))
  :group 'emacs)

Note that if you visit a file or directory first, `C-x b' will quickly give
you *scratch*. IMO, *scratch* should definitely not be the default.

If the value is nil, then the current behavior is used: show the splash
screen. I suspect that you (RMS) will want the default value to be nil.

If you (RMS) in fact want the splash screen to _always_ show at first, then
we can eliminate the nil value, and `visit-on-startup' could then also
determine what is shown after the splash screen disappears (instead of
always showing *scratch*):

(defcustom visit-on-startup "~/"
  "What Emacs visits after the start-up splash screen."
  :type '(choice
          (directory :tag "Directory"        :value "~/")
          (file      :tag "File"             :value "~/new.txt")
          (const     :tag "*scratch* buffer" :value "*scratch*"))
  :group 'emacs)

The code that uses `visit-on-startup' could do something like this, when the
splash screen goes bye-bye:

(if (string= "*scratch*" visit-on-startup)
    (switch-to-buffer "*scratch*"))
  (find-file visit-on-startup))

If it's deemed important, we could have two different choices for a startup
file: `file' (new or existing) and `new-file' (new only). That way, a user
could be sure to start with a new file if s?he wanted - the name could add
"<2>" etc. as needed. BTW, is (file :must-match nil) allowed in a `choice'?
I see only (file :must-match t) documented.


3. Related to #1
: We could have a user option that is an alist of buffer names. When you
quit Emacs or kill such a buffer, the buffer is either automatically saved
or you are prompted to save it. The alist keys would be buffer names and the
values would be either `ask' or a file name (absolute or relative).

Those who want to save *scratch* should then be able to do so either with
prompting or without, and either in the same file each time or in a
different (relative) file, depending on the current default-directory. Those
of us who don't want to save *scratch* would not have an alist entry for it.
I'd argue for the default value of the option to be nil.

Perhaps something such as this exists already, but I'm unaware of it.

  parent reply	other threads:[~2007-07-17 17:48 UTC|newest]

Thread overview: 218+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06  0:06 Scratch buffer annoyance Chong Yidong
2007-07-06  4:12 ` Stefan Monnier
2007-07-15 21:37 ` Leo
2007-07-15 22:19   ` David Reitter
2007-07-15 22:42     ` Zhang Wei
2007-07-15 22:52     ` Juri Linkov
2007-07-16 15:49     ` Richard Stallman
2007-07-15 22:24   ` Karl Fogel
2007-07-16 20:32     ` Alfred M. Szmidt
2007-07-17 15:05       ` Richard Stallman
2007-07-17 15:28         ` David Reitter
2007-07-17 15:50           ` Tassilo Horn
2007-07-17 16:00             ` Johan Bockgård
2007-07-17 16:04             ` David Reitter
2007-07-17 16:57               ` Tassilo Horn
2007-07-17 19:37                 ` Robert J. Chassell
2007-07-17 22:15                   ` David Reitter
2007-07-18 14:11                   ` Richard Stallman
2007-07-18 15:53                     ` Robert J. Chassell
2007-07-17 18:42             ` Alfred M. Szmidt
2007-07-17 19:50               ` Tassilo Horn
2007-07-17 20:01                 ` Alfred M. Szmidt
2007-07-17 16:02           ` David Kastrup
2007-07-17 16:10             ` David Reitter
2007-07-18 20:53             ` Richard Stallman
2007-07-18 21:28               ` David Kastrup
2007-07-19 21:20                 ` Richard Stallman
2007-07-17 18:42           ` Alfred M. Szmidt
2007-07-17 18:55             ` David Kastrup
2007-07-17 20:31               ` Mathias Dahl
2007-07-17 21:56               ` Jason Rumney
2007-07-18  0:35                 ` Johan Bockgård
2007-07-17 19:59             ` Tassilo Horn
2007-07-17 20:28               ` Andreas Schwab
2007-07-18  9:22                 ` Jan Djärv
2007-07-18 10:23                   ` Tassilo Horn
2007-07-18 10:56                     ` Jan Djärv
2007-07-18 20:53               ` Richard Stallman
2007-07-18 20:53             ` Richard Stallman
2007-07-18 14:11           ` Richard Stallman
2007-07-17 16:36         ` Chong Yidong
2007-07-18 20:53           ` Richard Stallman
2007-07-17 17:48         ` Drew Adams [this message]
2007-07-18 20:29           ` Juri Linkov
2007-07-19  0:00             ` Drew Adams
2007-07-19 14:25             ` Mathias Dahl
2007-07-19 14:45               ` David Kastrup
2007-07-19 15:44               ` Peter Lee
2007-07-20 13:42                 ` Richard Stallman
2007-07-20 21:01                   ` Drew Adams
2007-07-21  8:54                     ` Mathias Dahl
2007-07-21  9:35                       ` David Kastrup
2007-07-21  9:48                         ` David Kastrup
2007-07-21 15:14                           ` Drew Adams
2007-07-21 15:46                             ` David Kastrup
2007-07-22 10:05                               ` Richard Stallman
2007-07-22 10:40                                 ` David Kastrup
2007-07-23  4:29                                   ` Richard Stallman
2007-07-22  1:49                             ` Richard Stallman
2007-07-22 13:26                               ` Drew Adams
2007-07-23  4:28                                 ` Richard Stallman
2007-07-21 18:07                   ` Juri Linkov
2007-07-23  4:28                     ` Richard Stallman
2007-07-23 21:45                       ` Juri Linkov
2007-07-24 16:45                         ` Richard Stallman
2007-07-25  0:12                           ` Juri Linkov
2007-07-25  5:24                             ` David Kastrup
2007-07-27 21:20                               ` Juri Linkov
2007-07-27 21:16                             ` Juri Linkov
2007-07-29  2:23                               ` Richard Stallman
2007-07-29  9:18                                 ` Juri Linkov
2007-07-29  9:46                                   ` David Kastrup
2007-07-29 14:28                                     ` Drew Adams
2007-07-30 16:44                                   ` Richard Stallman
2007-07-31  8:51                                   ` Miles Bader
2007-07-31 13:09                                     ` Stefan Monnier
2007-07-31 14:29                                       ` David Kastrup
2007-07-31 20:22                                         ` Richard Stallman
2007-08-01  4:34                                       ` Miles Bader
2007-08-01  4:35                                       ` Miles Bader
2007-08-01  5:14                                       ` Drew Adams
2007-08-01  5:55                                         ` David Kastrup
2007-08-01  6:18                                           ` Drew Adams
2007-08-01  7:46                                             ` David Kastrup
2007-08-01 14:32                                               ` Drew Adams
2007-08-01  8:34                                         ` Jason Rumney
2007-08-01 14:32                                           ` Drew Adams
2007-08-01 15:41                                             ` Andreas Schwab
2007-08-01 16:53                                               ` Drew Adams
2007-08-01 17:19                                                 ` Stefan Monnier
2007-08-01 17:54                                                   ` Drew Adams
2007-07-31  8:54                                   ` Miles Bader
2007-07-31 13:09                                   ` Stefan Monnier
2007-07-31 14:29                                   ` Andreas Schwab
2007-07-31 14:42                                     ` David Kastrup
2007-08-01 16:45                                       ` Juri Linkov
2007-08-01 17:05                                         ` Drew Adams
2007-08-01 18:09                                           ` David Kastrup
2007-08-01 18:29                                             ` Drew Adams
2007-08-01 19:43                                               ` David Kastrup
2007-08-01 19:54                                                 ` Davis Herring
2007-08-01 21:09                                                   ` David Kastrup
2007-08-01 23:15                                                     ` Miles Bader
2007-08-01 23:21                                                       ` Davis Herring
2007-08-02  0:45                                                         ` Miles Bader
2007-08-02 23:42                                                       ` Richard Stallman
2007-08-03 18:16                                                         ` Juri Linkov
2007-08-03 22:02                                                           ` Richard Stallman
2007-08-04  7:02                                                             ` David Kastrup
2007-08-05  3:05                                                               ` Richard Stallman
2007-08-05  6:57                                                                 ` David Kastrup
2007-08-05 20:54                                                                   ` Richard Stallman
2007-08-05 16:59                                                                 ` Juri Linkov
2007-08-06 14:19                                                                   ` Richard Stallman
2007-08-06 14:35                                                                     ` David Kastrup
2007-08-07  1:22                                                                       ` Richard Stallman
2007-08-07  6:13                                                                         ` David Kastrup
2007-08-07 20:11                                                                           ` Richard Stallman
2007-08-07 20:57                                                                             ` David Kastrup
2007-08-09  0:07                                                                               ` Richard Stallman
2007-08-09 19:54                                                                                 ` Juri Linkov
2007-08-09 22:24                                                                                   ` Andreas Schwab
2007-08-11  5:05                                                                                   ` Richard Stallman
2007-08-19 23:16                                                                                     ` buffer-auto-mode-alist (was: Scratch buffer annoyance) Juri Linkov
2007-08-20 18:31                                                                                       ` Richard Stallman
2007-08-08 22:59                                                                     ` Scratch buffer annoyance Juri Linkov
2007-08-08 23:53                                                                       ` David Kastrup
2007-08-09 19:47                                                                         ` Juri Linkov
2007-08-09 20:09                                                                           ` David Kastrup
2007-08-11  5:05                                                                           ` Richard Stallman
2007-08-12 20:45                                                                             ` Juri Linkov
2007-08-12 23:20                                                                               ` Johan Bockgård
2007-08-13  5:00                                                                               ` Richard Stallman
2007-08-13  5:57                                                                                 ` David Kastrup
2007-08-14  0:28                                                                                   ` Richard Stallman
2007-08-15 23:32                                                                                     ` Juri Linkov
2007-08-16  0:59                                                                                       ` Glenn Morris
2007-08-16 20:11                                                                                         ` Juri Linkov
2007-08-17  4:50                                                                                           ` Richard Stallman
2007-08-17 22:35                                                                                             ` Juri Linkov
2007-08-19  0:44                                                                                               ` Richard Stallman
2007-08-19 14:45                                                                                                 ` Juri Linkov
2007-08-19 22:30                                                                                                   ` Richard Stallman
2007-08-17 23:32                                                                                             ` Glenn Morris
2007-08-19 14:50                                                                                               ` Juri Linkov
2007-08-19 22:30                                                                                                 ` Richard Stallman
2007-08-19 23:21                                                                                                   ` Juri Linkov
2007-08-20 18:31                                                                                                     ` Richard Stallman
2007-08-20 23:28                                                                                                       ` Juri Linkov
2007-08-21  9:07                                                                                                         ` Mathias Dahl
2007-08-21 23:23                                                                                                         ` Richard Stallman
2007-08-23  0:14                                                                                                           ` Juri Linkov
2007-08-23 20:58                                                                                                             ` Richard Stallman
2007-08-25 14:28                                                                                                               ` Juri Linkov
2007-08-25 17:06                                                                                                                 ` Thien-Thi Nguyen
2007-08-25 19:44                                                                                                                 ` Stefan Monnier
2007-08-25 19:53                                                                                                                   ` David Kastrup
2007-08-25 20:38                                                                                                                     ` Stefan Monnier
2007-08-25 23:33                                                                                                                     ` Stephen J. Turnbull
2007-08-26  5:33                                                                                                                       ` David Kastrup
2007-08-26 14:56                                                                                                                 ` Richard Stallman
2007-08-26 23:45                                                                                                                   ` Juri Linkov
     [not found]                                                                                                                     ` <E1IPj9w-0003bw-4e@fencepost.gnu.org>
2007-09-02 21:01                                                                                                                       ` Juri Linkov
2007-09-03 18:25                                                                                                                         ` Richard Stallman
2007-09-03 23:46                                                                                                                           ` Juri Linkov
2007-09-04 16:45                                                                                                                             ` Richard Stallman
2007-09-04 22:57                                                                                                                               ` Juri Linkov
2007-09-05 20:02                                                                                                                                 ` Richard Stallman
2007-09-06 14:54                                                                                                                                   ` Juri Linkov
2007-09-07  6:32                                                                                                                                     ` Richard Stallman
2007-09-07  8:57                                                                                                                                       ` Juri Linkov
2007-09-08  7:00                                                                                                                                         ` Richard Stallman
2007-09-07  6:32                                                                                                                                     ` Richard Stallman
2007-09-07  8:55                                                                                                                                       ` Juri Linkov
2007-09-08  7:00                                                                                                                                         ` Richard Stallman
2007-09-07  6:32                                                                                                                                     ` Richard Stallman
2007-09-07  8:56                                                                                                                                       ` Juri Linkov
2007-09-07 17:56                                                                                                                                         ` Glenn Morris
2007-09-07 22:54                                                                                                                                           ` Juri Linkov
2007-09-08 19:47                                                                                                                                             ` Richard Stallman
2007-09-09 12:35                                                                                                                                               ` Juri Linkov
2007-09-09 20:06                                                                                                                                                 ` Richard Stallman
2007-09-07  6:32                                                                                                                                     ` Richard Stallman
2007-09-09 12:36                                                                                                                                       ` Juri Linkov
2007-09-09 20:06                                                                                                                                         ` Richard Stallman
2007-09-07  6:32                                                                                                                                     ` Richard Stallman
2007-08-19 15:30                                                                                               ` Mathias Dahl
2007-08-19 17:48                                                                                                 ` Juri Linkov
2007-08-20 15:17                                                                                                   ` Richard Stallman
2007-08-19 22:30                                                                                                 ` Richard Stallman
2007-08-19 23:21                                                                                                   ` Juri Linkov
2007-08-20 18:31                                                                                                     ` Richard Stallman
2007-08-20 23:29                                                                                                       ` Juri Linkov
2007-08-20  2:29                                                                                                   ` Glenn Morris
2007-08-20  8:13                                                                                                     ` Mathias Dahl
2007-08-20 18:30                                                                                                     ` Richard Stallman
2007-08-20 23:28                                                                                                       ` Juri Linkov
2007-08-21 23:23                                                                                                         ` Richard Stallman
2007-08-16  2:42                                                                                       ` Richard Stallman
2007-08-16 20:12                                                                                         ` Juri Linkov
2007-08-17  4:50                                                                                           ` Richard Stallman
2007-08-19 14:55                                                                                       ` Juri Linkov
2007-08-19 22:30                                                                                         ` Richard Stallman
2007-08-13 23:30                                                                                 ` Juri Linkov
2007-08-02 15:09                                                   ` Stefan Monnier
2007-08-02 23:42                                                     ` Richard Stallman
2007-07-19 18:28             ` Alfred M. Szmidt
2007-07-21 17:13             ` Dieter Wilhelm
2007-07-21 18:12               ` Juri Linkov
2007-07-21 18:52                 ` Drew Adams
2007-07-21 19:24                   ` David Kastrup
2007-07-22 18:37                     ` Richard Stallman
2007-07-22 19:09                       ` David Kastrup
2007-07-22 21:43                         ` Juri Linkov
2007-07-23 18:07                           ` Richard Stallman
2007-07-22 19:41                   ` Drew Adams
2007-07-22 19:58                     ` David Kastrup
2007-07-18 20:53           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BNELLINCGFJLDJIKDGACEEKKCAAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=ams@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    --cc=rms@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.