help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get rid of *GNU Emacs* buffer on start-up?


From: Giorgos Keramidas
Subject: Re: How to get rid of *GNU Emacs* buffer on start-up?
Date: Wed, 17 Sep 2008 04:22:01 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Tue, 16 Sep 2008 13:57:59 -0700 (PDT), Xah <xahlee@gmail.com> wrote:
> On Sep 16, 1:44 am, Charles Sebold <cseb...@gmail.com> wrote:
>> In addition to everything else that's been said, I've noticed that
>> hitting "q" deletes the buffer and sends me to the good old *scratch*
>> buffer, too.  I just got used to doing that.
>
> I think the existance of the lisp scratch buffer is one of the major
> usability problem of emacs that prevents emacs from being widely
> adopted by most text editing audience.

Hi Xah,

For what it's worth, I think I would appreciate an option that makes the
current behavior of the *scratch* buffer tunable, i.e. by an option like:

    (defvar scratch-buffer-uses-fundamental-mode nil
      "Non-nil makes the *scratch* buffer use `fundamental-mode'.

    Emacs recreates the *scratch* buffer in `lisp-interaction-mode'.
    If you are not really interested to use `lisp-interaction-mode',
    but you would prefer to start all scratch buffers in
    `fundamental-mode', to start editing text instead of typing Lisp
    expressions, set the `scratch-buffer-uses-fundamental-mode'
    variable to a non-nil value.")

> I wrote some detail about it here:
> http://xahlee.org/emacs/modernization.html

But I don't like the `personal attack' style that this text uses, and I
don't really agree with *all* the proposed `modernization' features.

If you were to split that document into smaller `features' and one of
them was a proposal to add an option for the default mode of *scratch*
buffers, and a good description of how you would suggest that we add a
prompt for *scratch* buffers that are modified, I would be more than
willing to help you with the testing and integration of any patches to
the main Emacs source tree.

My own idea about *scratch* buffers that do not fire up only in the
current `lisp-interaction-mode' state is something like:

  * Add an option that may be set to a non-nil value to make *scratch*
    buffers use `fundamental-mode', or even better, an option that
    defines _which_ mode a *startup* buffer should use.

    Two possible variations of this option would be:

    ;;; Boolean option
    ;; A boolean option that makes *scratch* buffers fire up in
    ;; `fundamental-mode' by default.  The option would be set to `nil'
    ;; by default, but it should be easy to tweak the option once and
    ;; keep it set forever.

    (defcustom scratch-buffer-uses-fundamental-mode nil
      "Non-nil makes the *scratch* buffer use `fundamental-mode'.

    Emacs recreates the *scratch* buffer in `lisp-interaction-mode'.
    If you are not really interested to use `lisp-interaction-mode',
    but you would prefer to start all scratch buffers in
    `fundamental-mode', to start editing text instead of typing Lisp
    expressions, set the `scratch-buffer-uses-fundamental-mode'
    variable to a non-nil value."
      :type 'boolean
      :group 'editing-basics
      :group 'convenience)

    ;;; A list of choices.
    ;; Still set to the default `lisp-interaction-mode'
    (defcustom scratch-buffer-startup-mode 'lisp-interaction-mode
      "The default mode to use for *scratch* buffers.

    If the value is `lisp' start in lisp-interaction-mode.
    If the value is `text' start in text-mode.
    If the value is `fundamental' start in whatever mode has been
    configured as the default `fundamental-mode'.
    If the value is a function, use that function to set-up the
    startup mode of *scratch* buffers."
      :type '(choice (const :tag "Lisp interaction mode" 'lisp)
                     (const :tag "Text mode" 'text)
                     (const :tag "Fundamental mode" 'fundamental)
                     (function :tag "Custom mode"))
      :group 'editing-basics
      :group 'convenience)

  * Add the scratch buffer to the list of buffers that trigger a prompt
    if they are modified and the user types `C-x C-c' to leave Emacs.

    Right now one can open _one_ scratch buffer only.  Emacs uses
    `buffer-modified-p' as the only criterion, but this doesn't work for
    scratch buffers now.  It should probably be an option too, or even a
    function that checks `scratch-buffer-startup-mode' and decides.  I
    haven't thought too much about this yet, so I am not sure if it
    sounds like a sensible thing to do.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]