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: Xah
Subject: Re: How to get rid of *GNU Emacs* buffer on start-up?
Date: Tue, 16 Sep 2008 13:57:59 -0700 (PDT)
User-agent: G2/1.0

On Sep 16, 1:44 am, Charles Sebold <address@hidden> wrote:
> On 16 Sep 2008, Davin Pearson wrote:
>
> > Every time I start Emacs I have to bury to *GNU Emacs buffer.  This
> > is a little bit annoying having to do this.  If I can't kill this
> > buffer, then I would at least prefer the default-directory of that
> > buffer to be "~/" so that I can easily load a file that I want to
> > edit.  The following code is what I have written to accomplish that
> > task but sadly it doesn't appear to work.
>
> 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.

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

I think emacs should get rid of the lisp scratch buffer completely.
Instead, have Ctrl+n for New File, that creates a new buffer named
“untitled” and default to text mode. The default mode can be
customized to set to lisp mode for those who wishes of course.

following is a excerpt
--------------------------

Q: I find the “*scratch*” buffer useful...

A: Just about anything, once it is exposed to human animals, a
significant number will find it useful. This is a matter of habit and
conditioning and applies to all aspects of human habit or behavior, as
you'll find people in cultures into things you couldn't dream of.
(such as body modification as flattening their breasts, widening a
hole in lower lips... to lesser degree tattoo, muscle bulking... or
sexual preferences and fetishes such as shit-eating... , or food
intake habits (eating/drinking/diet habits) ...)

Suppose you have random features in a software, and give this software
to a large number of people to use for few decades. Chances are, every
feature will be useful to a good sized number of people. People, in a
sense, adapt their work habits to the features.

The issue about emacs's “*scratch*” “buffer” is that:

    * It is not useful by 99% of letter writers. If they wanted a
scratch pad, they can open a new document and not save it. This way is
familiar to all software users.
    * The “*scratch*” “buffer” is primarily designed for elisp
programers. (it defaults to lisp mode) Majority of people who use
emacs are not lisp coders. For lisp coders, they can easily customize
their emacs to have a “*scratch*” “buffer”.
    * The “*scratch*” “buffer” is a intrusive idiosyncrasy. It is
persistent, cannot be closed (it regenerates). It is foreign to all
programers. This idiosyncrasy is the first thing presented to users,
and it persists.

---------------------------------------------

I have made a implementation of my suggestion solution. It will be
incorporated into my ergonomic keybinding in the next version.

Here's the basics:

(global-set-key (kbd "C-n") 'new-empty-buffer) ; Open New File

(defun new-empty-buffer ()
  "Opens a new empty buffer."
  (interactive)
  (let ((buf (generate-new-buffer "untitled")))
    (switch-to-buffer buf)
    (funcall (and initial-major-mode))
    (setq buffer-offer-save t)))
;; note: emacs won't offer to save a buffer that's
;; not associated with a file,
;; even if buffer-modified-p is true.
;; One work around is to define your own my-kill-buffer function
;; that wraps around kill-buffer, and check on the buffer modification
;; status to offer save
;; This custome kill buffer is close-current-buffer.

For the command close-current-buffer, see:
 http://xahlee.org/emacs/modern_operations.el

  Xah
∑ http://xahlee.org/

reply via email to

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