all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: mar@centrum.cz (Martin)
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs: Problems of the Scratch Buffer
Date: Fri, 20 Apr 2012 13:31:33 +0200	[thread overview]
Message-ID: <20120420113133.GD5197@chocholous.lan> (raw)
In-Reply-To: <aca08ae8-12d7-4bf3-97aa-ff97df91884d@iu9g2000pbc.googlegroups.com>

just a little script I have written for myself:

- - - -

(setq create-selection-buffer-counter 0)
(defun create-selection-buffer()
    "Creates a buffer that contains primary X selection."
    (interactive)
    (setq create-selection-buffer-counter (+ create-selection-buffer-counter 1))
    (setq sel-buf-name
        (concat "selection-buffer-" (int-to-string create-selection-buffer-counter)))
    (set-buffer (get-buffer-create sel-buf-name))
    (yank)
    (set-window-buffer nil (get-buffer-create sel-buf-name)))

- - - -

Simple function that automatically creates a new named buffer with whatever
you have in clipboard

m.

On Wed, Apr 18, 2012 at 05:00:20AM -0700, Xah Lee wrote:
> for entertainment purpose only.
>
> 〈Emacs: Problems of the Scratch Buffer〉
> http://xahlee.org/emacs/modernization_scratch_buffer.html
>
> ---------------------------------------------
>
> Emacs: Problems of the Scratch Buffer
>  By Xah Lee, 2008-09, …, 2012-04-18
>
> Here are reasons that the scratch buffer is not useful to most people:
>
>  1.It is not useful for 99% of emacs users. If people wanted a scratch
> pad, they can open a new document and not save it. This way is
> familiar to all software users.
>  2.The “*scratch*” “buffer” is designed for emacs lisp programers. (it
> defaults to lisp-interaction-mode.) 99% of emacs users are not lisp
> coders.
>  3.The “*scratch*” “buffer” is a INTRUSIVE IDIOSYNCRASY. New users are
> not familiar what it is. It is the first thing presented to users, and
> it persists.
>
> Scratch Buffer is Inconvenient
>
> Here are reasons that a alternative to “*scratch*” “buffer” is more
> useful:
>
>  1.There is no easy, intuitive way to create multiple scratch buffers.
> (it is done by calling switch-to-buffer 【Ctrl+x b】 then give a name
> that is not one of existing buffers.)
>  2.When the scratch buffer is closed, emacs does not prompt user to
> save it. This easily causes data loss.
>  3.A scratch pad can be very useful not just for temporary elisp code
> but for any scratch notes or programing in other languages. (For
> example, well known programer Stevey Yegg in his popular blog article
> Effective Emacs↗, considers creating new temp buffer as a top 10 tip
> in emacs productivity.)
>  4.Emacs does not provide a user level function to create a new
> buffer. It has menu 〖File▸Open file…〗 (a wrapper to the find-file
> command), which immediately prompt user for a full file path. This is
> annoying. Modern apps's New File command actually just create a new
> untitled file without prompting, and prompt only when user wants to
> save it. If user closes it, it prompts for saving.
>
> Proposed Fix: Adding a “new-buffer” Command
>
> I propose that emacs should add a command “new-buffer” with menu
> 〖File▸New〗. Once called, it should create a empty buffer titled
> {untitled, untitled<2>, untitled<3>, …}.
>
>  1.Users can now create multiple temp buffers easily, by just calling
> “new-buffer”. No more work-around using “switch-to-buffer” method.
>  2.Data lose is prevented because closing any unsaved buffer will
> prompt for save.
>  3.For lisp coders, new buffer can default to a lisp mode. Other
> programers can default it to python mode, ruby mode, etc.
>
>  1.No more redundant and mysterious “*scratch*” concept.
>  2.The menu command “New” is a widely adopted standard among apps
> across Mac, Windows, Linux.
>  3.A “new-buffer” command completely cover the functionality of
> emacs's “*scratch*” buffer.
>  4.The name “untitled” is conventional, widely understood.
>
> Implementation
>
> The above suggestion is implemented in ErgoEmacs Keybinding, where you
> simply press 【Ctrl+n】 to create a new buffer.
>



  parent reply	other threads:[~2012-04-20 11:31 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 12:00 Emacs: Problems of the Scratch Buffer Xah Lee
2012-04-18 12:31 ` Joe Corneli
2012-04-18 16:57 ` Steinar Bang
2012-04-18 17:33   ` Ludwig, Mark
2012-04-18 18:15     ` Juanma Barranquero
2012-04-18 18:16       ` Juanma Barranquero
2012-04-19 21:08     ` Steinar Bang
     [not found]   ` <mailman.169.1334770417.751.help-gnu-emacs@gnu.org>
2012-04-18 21:11     ` Chiron
2012-04-18 23:56       ` Ludwig, Mark
2012-04-19 10:34         ` Tassilo Horn
2012-04-18 17:01 ` Mark Skilbeck
2012-04-18 19:33 ` Aaron Meurer
2012-04-18 20:22   ` Deniz Dogan
2012-04-19  5:55     ` Kevin Rodgers
2012-04-19  5:58   ` Kevin Rodgers
2012-04-19 20:47 ` Bug Dout
2012-04-19 21:11   ` Chiron
2012-04-19 22:41     ` Ludwig, Mark
     [not found]     ` <mailman.260.1334875302.751.help-gnu-emacs@gnu.org>
2012-04-20  3:27       ` Pascal J. Bourguignon
2012-04-20  3:53         ` Aaron Meurer
2012-04-20 11:08     ` Fritz Wuehler
2012-04-20 11:48     ` Richard Riley
     [not found]     ` <mailman.304.1334922534.751.help-gnu-emacs@gnu.org>
2012-04-21  3:53       ` Chiron
2012-04-21  8:16         ` Joost Kremers
2012-04-21 12:43           ` Chiron
2012-04-21 12:47             ` Jambunathan K
2012-04-21 14:10             ` Eli Zaretskii
     [not found]             ` <mailman.373.1335012467.751.help-gnu-emacs@gnu.org>
2012-04-21 14:42               ` Chiron
2012-04-21 14:49                 ` Joe Corneli
     [not found]                 ` <mailman.381.1335019797.751.help-gnu-emacs@gnu.org>
2012-04-21 15:04                   ` Chiron
     [not found]             ` <mailman.379.1335017454.751.help-gnu-emacs@gnu.org>
2012-04-21 14:46               ` Chiron
2012-04-21 15:34                 ` Eli Zaretskii
2012-04-21 16:15                 ` Dan Espen
2012-04-21 16:58                   ` Chiron
     [not found]                 ` <mailman.389.1335022448.751.help-gnu-emacs@gnu.org>
2012-04-21 16:32                   ` Chiron
2012-04-21 16:52                     ` Eli Zaretskii
     [not found]                     ` <mailman.396.1335027140.751.help-gnu-emacs@gnu.org>
2012-04-21 17:09                       ` Chiron
2012-04-21 17:36                     ` Dan Espen
2012-04-21 23:01                     ` Bastien
2012-04-23 11:52             ` Joost Kremers
2012-04-24  7:40               ` rusi
2012-04-24 11:35                 ` Richard Riley
2012-04-24 13:44                   ` ken
2012-04-25 10:39                     ` Thien-Thi Nguyen
2012-04-25 12:41                       ` ken
2012-04-25 21:51                       ` Jambunathan K
     [not found]                       ` <mailman.42.1335390728.855.help-gnu-emacs@gnu.org>
2012-04-26 17:25                         ` rusi
2012-04-26 17:48                           ` Bastien
     [not found]                     ` <mailman.619.1335350542.751.help-gnu-emacs@gnu.org>
2012-04-26 19:08                       ` Xah Lee
2012-04-24 14:33                 ` Dan Espen
2012-04-24 18:40                   ` PJ Weisberg
2012-04-21  8:36         ` Thien-Thi Nguyen
2012-04-21  9:48           ` Joe Corneli
     [not found]         ` <mailman.362.1334997514.751.help-gnu-emacs@gnu.org>
2012-04-21 12:35           ` Chiron
2012-04-21 13:31             ` Pascal J. Bourguignon
2012-04-21 15:01               ` Chiron
2012-04-21 14:07             ` Eli Zaretskii
     [not found]             ` <mailman.378.1335017298.751.help-gnu-emacs@gnu.org>
2012-04-21 14:52               ` Pascal J. Bourguignon
2012-04-21 15:15                 ` Jambunathan K
2012-04-21 16:03                   ` Jambunathan K
2012-04-21 14:59               ` Chiron
2012-04-21 15:35                 ` Eli Zaretskii
     [not found]                 ` <mailman.390.1335022565.751.help-gnu-emacs@gnu.org>
2012-04-21 16:47                   ` Chiron
2012-04-21 17:07             ` Thien-Thi Nguyen
     [not found]             ` <mailman.398.1335028190.751.help-gnu-emacs@gnu.org>
2012-04-21 17:14               ` Chiron
2012-04-21 17:47                 ` Juanma Barranquero
     [not found]                 ` <mailman.401.1335030473.751.help-gnu-emacs@gnu.org>
2012-04-21 18:03                   ` Chiron
2012-04-21 21:34             ` Jason Earl
2012-04-21 14:39         ` Stefan Monnier
2012-04-21 15:03           ` Chiron
2012-04-20 11:31 ` Martin [this message]
2012-04-21  3:14 ` Stefan Monnier
2012-04-21  3:25   ` Dan Espen
2012-04-21 14:38     ` Stefan Monnier
2012-04-21 16:08       ` Dan Espen
2012-04-21 16:50         ` Chiron
2012-04-21 17:30           ` Dan Espen
2012-04-21 22:13             ` Ludwig, Mark
2012-04-22 10:00           ` Petter Gustad
2012-04-22 10:27             ` Richard Riley
2012-06-12 19:25             ` Nikolai Alekseev
2012-06-12 19:24         ` Nikolai Alekseev

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=20120420113133.GD5197@chocholous.lan \
    --to=mar@centrum.cz \
    --cc=help-gnu-emacs@gnu.org \
    /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.