* How can I restart *scratch* buffer?
@ 2019-09-02 12:10 李淼
2019-09-02 12:22 ` YUE Daian
2019-09-02 15:30 ` Marcin Borkowski
0 siblings, 2 replies; 16+ messages in thread
From: 李淼 @ 2019-09-02 12:10 UTC (permalink / raw)
To: help-gnu-emacs
Sometimes I accidentally turn off the *scratch* buffer while I'm using
emacs. How can I restart *scratch* buffer without restarting emacs?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 12:10 How can I restart *scratch* buffer? 李淼
@ 2019-09-02 12:22 ` YUE Daian
2019-09-02 12:24 ` YUE Daian
[not found] ` <CALrvcGLBQhJG5wtb41Y2uhx0HECvWFyeSfwvY=T8LG=1NfO0XQ@mail.gmail.com>
2019-09-02 15:30 ` Marcin Borkowski
1 sibling, 2 replies; 16+ messages in thread
From: YUE Daian @ 2019-09-02 12:22 UTC (permalink / raw)
To: 李淼, help-gnu-emacs
On 2019-09-02 20:10, 李淼 <flypigonsky@gmail.com> wrote:
> Sometimes I accidentally turn off the *scratch* buffer while I'm using
> emacs. How can I restart *scratch* buffer without restarting emacs?
Simply create a new buffer named *scratch*.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 12:22 ` YUE Daian
@ 2019-09-02 12:24 ` YUE Daian
2019-09-02 12:33 ` Joost Kremers
[not found] ` <CALrvcGLBQhJG5wtb41Y2uhx0HECvWFyeSfwvY=T8LG=1NfO0XQ@mail.gmail.com>
1 sibling, 1 reply; 16+ messages in thread
From: YUE Daian @ 2019-09-02 12:24 UTC (permalink / raw)
To: 李淼, help-gnu-emacs
On 2019-09-02 20:22, YUE Daian <sheepduke@gmail.com> wrote:
> On 2019-09-02 20:10, 李淼 <flypigonsky@gmail.com> wrote:
>> Sometimes I accidentally turn off the *scratch* buffer while I'm using
>> emacs. How can I restart *scratch* buffer without restarting emacs?
>
> Simply create a new buffer named *scratch*.
Oh, and make it emacs-lisp-mode.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 12:24 ` YUE Daian
@ 2019-09-02 12:33 ` Joost Kremers
2019-09-02 13:07 ` Michael Heerdegen
2019-09-02 14:15 ` Alberto Luaces
0 siblings, 2 replies; 16+ messages in thread
From: Joost Kremers @ 2019-09-02 12:33 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: 李淼
On Mon, Sep 02 2019, YUE Daian wrote:
> On 2019-09-02 20:22, YUE Daian <sheepduke@gmail.com> wrote:
>> On 2019-09-02 20:10, 李淼 <flypigonsky@gmail.com> wrote:
>>> Sometimes I accidentally turn off the *scratch* buffer while
>>> I'm using
>>> emacs. How can I restart *scratch* buffer without restarting
>>> emacs?
>>
>> Simply create a new buffer named *scratch*.
>
> Oh, and make it emacs-lisp-mode.
lisp-interaction-mode, to be precise.
--
Joost Kremers
Life has its moments
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 12:33 ` Joost Kremers
@ 2019-09-02 13:07 ` Michael Heerdegen
2019-09-02 14:15 ` Alberto Luaces
1 sibling, 0 replies; 16+ messages in thread
From: Michael Heerdegen @ 2019-09-02 13:07 UTC (permalink / raw)
To: Joost Kremers; +Cc: help-gnu-emacs, 李淼
Joost Kremers <joostkremers@fastmail.fm> writes:
> >> Simply create a new buffer named *scratch*.
> >
> > Oh, and make it emacs-lisp-mode.
>
> lisp-interaction-mode, to be precise.
Doesn't that happen automatically?
Michael.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 12:33 ` Joost Kremers
2019-09-02 13:07 ` Michael Heerdegen
@ 2019-09-02 14:15 ` Alberto Luaces
2019-09-02 14:46 ` 李不显
1 sibling, 1 reply; 16+ messages in thread
From: Alberto Luaces @ 2019-09-02 14:15 UTC (permalink / raw)
To: help-gnu-emacs
Joost Kremers writes:
> On Mon, Sep 02 2019, YUE Daian wrote:
>> On 2019-09-02 20:22, YUE Daian <sheepduke@gmail.com> wrote:
>>> On 2019-09-02 20:10, 李淼 <flypigonsky@gmail.com> wrote:
>>>> Sometimes I accidentally turn off the *scratch* buffer while I'm
>>>> using
>>>> emacs. How can I restart *scratch* buffer without restarting
>>>> emacs?
>>>
>>> Simply create a new buffer named *scratch*.
>>
>> Oh, and make it emacs-lisp-mode.
>
> lisp-interaction-mode, to be precise.
Sometimes is easier to remember to use normal-mode.
--
Alberto
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 14:15 ` Alberto Luaces
@ 2019-09-02 14:46 ` 李不显
0 siblings, 0 replies; 16+ messages in thread
From: 李不显 @ 2019-09-02 14:46 UTC (permalink / raw)
To: Alberto Luaces; +Cc: help-gnu-emacs
Now I have figured out the difference between buffer and file, and have a
new understanding of different modes. Thank you for your answers. :)
Alberto Luaces <aluaces@udc.es> 于2019年9月2日周一 下午10:16写道:
> Joost Kremers writes:
>
> > On Mon, Sep 02 2019, YUE Daian wrote:
> >> On 2019-09-02 20:22, YUE Daian <sheepduke@gmail.com> wrote:
> >>> On 2019-09-02 20:10, 李淼 <flypigonsky@gmail.com> wrote:
> >>>> Sometimes I accidentally turn off the *scratch* buffer while I'm
> >>>> using
> >>>> emacs. How can I restart *scratch* buffer without restarting
> >>>> emacs?
> >>>
> >>> Simply create a new buffer named *scratch*.
> >>
> >> Oh, and make it emacs-lisp-mode.
> >
> > lisp-interaction-mode, to be precise.
>
> Sometimes is easier to remember to use normal-mode.
>
> --
> Alberto
>
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <CALrvcGLBQhJG5wtb41Y2uhx0HECvWFyeSfwvY=T8LG=1NfO0XQ@mail.gmail.com>]
* Re: How can I restart *scratch* buffer?
2019-09-02 12:10 How can I restart *scratch* buffer? 李淼
2019-09-02 12:22 ` YUE Daian
@ 2019-09-02 15:30 ` Marcin Borkowski
2019-09-08 12:29 ` 李不显
1 sibling, 1 reply; 16+ messages in thread
From: Marcin Borkowski @ 2019-09-02 15:30 UTC (permalink / raw)
To: 李淼; +Cc: help-gnu-emacs
On 2019-09-02, at 14:10, 李淼 <flypigonsky@gmail.com> wrote:
> Sometimes I accidentally turn off the *scratch* buffer while I'm using
> emacs. How can I restart *scratch* buffer without restarting emacs?
How about M-: (startup--get-buffer-create-scratch) RET?
M-: stuff is necessary because this is a non-interactive function. It
is also internal (because it contains two dashes) and undocumented
(because it does not contain a docstring). Use at your own risk.
Hth,
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-02 15:30 ` Marcin Borkowski
@ 2019-09-08 12:29 ` 李不显
2019-09-08 12:56 ` Amin Bandali
0 siblings, 1 reply; 16+ messages in thread
From: 李不显 @ 2019-09-08 12:29 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: help-gnu-emacs
Marcin Borkowski <mbork@mbork.pl> 于2019年9月2日周一 下午11:30写道:
>
> On 2019-09-02, at 14:10, 李淼 <flypigonsky@gmail.com> wrote:
>
> > Sometimes I accidentally turn off the *scratch* buffer while I'm using
> > emacs. How can I restart *scratch* buffer without restarting emacs?
>
> How about M-: (startup--get-buffer-create-scratch) RET?
>
> M-: stuff is necessary because this is a non-interactive function. It
> is also internal (because it contains two dashes) and undocumented
> (because it does not contain a docstring). Use at your own risk.
>
> Hth,
>
> --
> Marcin Borkowski
> http://mbork.pl
I tried to do this, but *backtrace* says:
Debugger entered--Lisp error: (void-function
startup-get-buffer-create-scratch)
(startup-get-buffer-create-scratch)
eval((startup-get-buffer-create-scratch) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 12:29 ` 李不显
@ 2019-09-08 12:56 ` Amin Bandali
2019-09-08 13:25 ` Stefan Monnier
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Amin Bandali @ 2019-09-08 12:56 UTC (permalink / raw)
To: 李不显; +Cc: help-gnu-emacs
Hi,
李不显 <flypigonsky@gmail.com> writes:
> Marcin Borkowski <mbork@mbork.pl> 于2019年9月2日周一 下午11:30写道:
[...]
>> How about M-: (startup--get-buffer-create-scratch) RET?
[...]
>
>
> I tried to do this, but *backtrace* says:
>
> Debugger entered--Lisp error: (void-function
> startup-get-buffer-create-scratch)
> (startup-get-buffer-create-scratch)
> eval((startup-get-buffer-create-scratch) nil)
> elisp--eval-last-sexp(nil)
> eval-last-sexp(nil)
> funcall-interactively(eval-last-sexp nil)
> call-interactively(eval-last-sexp nil nil)
> command-execute(eval-last-sexp)
There’s a typo; notice that there needs to be two dashes between
“startup” and “get”.
You seem to have used:
startup-get-buffer-create-scratch
Instead, try using:
startup--get-buffer-create-scratch
Hope that helps.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 12:56 ` Amin Bandali
@ 2019-09-08 13:25 ` Stefan Monnier
2019-09-08 19:59 ` Marcin Borkowski
2019-09-08 20:32 ` 李不显
2019-09-08 20:43 ` 李不显
2 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier @ 2019-09-08 13:25 UTC (permalink / raw)
To: help-gnu-emacs
> Instead, try using:
> startup--get-buffer-create-scratch
Note that this is new in Emacs-27. Also, the 2 dashes indicate that
this is an internal function. It may disappear or be renamed or do
something completely different in a later version.
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 13:25 ` Stefan Monnier
@ 2019-09-08 19:59 ` Marcin Borkowski
2019-09-08 20:21 ` 李不显
0 siblings, 1 reply; 16+ messages in thread
From: Marcin Borkowski @ 2019-09-08 19:59 UTC (permalink / raw)
To: Stefan Monnier; +Cc: help-gnu-emacs
On 2019-09-08, at 15:25, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> Instead, try using:
>> startup--get-buffer-create-scratch
>
> Note that this is new in Emacs-27. Also, the 2 dashes indicate that
> this is an internal function. It may disappear or be renamed or do
> something completely different in a later version.
Yes, I warned about it in my email.
Would it make sense to provide a UI for resetting the *scratch* buffer,
i.e., exposing `startup--get-buffer-create-scratch' (perhaps as
something like `switch-to-scratch-buffer' or so)?
Best,
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 19:59 ` Marcin Borkowski
@ 2019-09-08 20:21 ` 李不显
0 siblings, 0 replies; 16+ messages in thread
From: 李不显 @ 2019-09-08 20:21 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: help-gnu-emacs, Stefan Monnier
Marcin Borkowski <mbork@mbork.pl> 于2019年9月9日周一 上午3:59写道:
>
> On 2019-09-08, at 15:25, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> >> Instead, try using:
> >> startup--get-buffer-create-scratch
> >
> > Note that this is new in Emacs-27. Also, the 2 dashes indicate that
> > this is an internal function. It may disappear or be renamed or do
> > something completely different in a later version.
>
> Yes, I warned about it in my email.
>
> Would it make sense to provide a UI for resetting the *scratch* buffer,
> i.e., exposing `startup--get-buffer-create-scratch' (perhaps as
> something like `switch-to-scratch-buffer' or so)?
>
> Best,
>
> --
> Marcin Borkowski
> http://mbork.pl
>
> Thank you for your reply. The problem has been solved in so many ways that
it is well solved. It's amazing how many people follow and respond to such
a simple question. Emacser is friendly to rookies :)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 12:56 ` Amin Bandali
2019-09-08 13:25 ` Stefan Monnier
@ 2019-09-08 20:32 ` 李不显
2019-09-08 20:43 ` 李不显
2 siblings, 0 replies; 16+ messages in thread
From: 李不显 @ 2019-09-08 20:32 UTC (permalink / raw)
Cc: help-gnu-emacs
Amin Bandali <bandali@gnu.org> 于2019年9月8日周日 下午8:57写道:
> Hi,
>
> 李不显 <flypigonsky@gmail.com> writes:
>
> > Marcin Borkowski <mbork@mbork.pl> 于2019年9月2日周一 下午11:30写道:
> [...]
> >> How about M-: (startup--get-buffer-create-scratch) RET?
> [...]
> >
> >
> > I tried to do this, but *backtrace* says:
> >
> > Debugger entered--Lisp error: (void-function
> > startup-get-buffer-create-scratch)
> > (startup-get-buffer-create-scratch)
> > eval((startup-get-buffer-create-scratch) nil)
> > elisp--eval-last-sexp(nil)
> > eval-last-sexp(nil)
> > funcall-interactively(eval-last-sexp nil)
> > call-interactively(eval-last-sexp nil nil)
> > command-execute(eval-last-sexp)
>
> There’s a typo; notice that there needs to be two dashes between
> “startup” and “get”.
>
> You seem to have used:
> startup-get-buffer-create-scratch
>
> Instead, try using:
> startup--get-buffer-create-scratch
>
> Hope that helps.
>
I was careless before. I clearly saw it, but I forgot it when I typed it. :)
Thank you for your help!
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: How can I restart *scratch* buffer?
2019-09-08 12:56 ` Amin Bandali
2019-09-08 13:25 ` Stefan Monnier
2019-09-08 20:32 ` 李不显
@ 2019-09-08 20:43 ` 李不显
2 siblings, 0 replies; 16+ messages in thread
From: 李不显 @ 2019-09-08 20:43 UTC (permalink / raw)
To: help-gnu-emacs
Amin Bandali <bandali@gnu.org> 于2019年9月8日周日 下午8:57写道:
> Hi,
>
> 李不显 <flypigonsky@gmail.com> writes:
>
> > Marcin Borkowski <mbork@mbork.pl> 于2019年9月2日周一 下午11:30写道:
> [...]
> >> How about M-: (startup--get-buffer-create-scratch) RET?
> [...]
> >
> >
> > I tried to do this, but *backtrace* says:
> >
> > Debugger entered--Lisp error: (void-function
> > startup-get-buffer-create-scratch)
> > (startup-get-buffer-create-scratch)
> > eval((startup-get-buffer-create-scratch) nil)
> > elisp--eval-last-sexp(nil)
> > eval-last-sexp(nil)
> > funcall-interactively(eval-last-sexp nil)
> > call-interactively(eval-last-sexp nil nil)
> > command-execute(eval-last-sexp)
>
> There’s a typo; notice that there needs to be two dashes between
> “startup” and “get”.
>
> You seem to have used:
> startup-get-buffer-create-scratch
>
> Instead, try using:
> startup--get-buffer-create-scratch
>
> Hope that helps.
>
I was careless before. I clearly saw it, but I forgot it when I typed it. :)
Thank you for your help!
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2019-09-08 20:43 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 12:10 How can I restart *scratch* buffer? 李淼
2019-09-02 12:22 ` YUE Daian
2019-09-02 12:24 ` YUE Daian
2019-09-02 12:33 ` Joost Kremers
2019-09-02 13:07 ` Michael Heerdegen
2019-09-02 14:15 ` Alberto Luaces
2019-09-02 14:46 ` 李不显
[not found] ` <CALrvcGLBQhJG5wtb41Y2uhx0HECvWFyeSfwvY=T8LG=1NfO0XQ@mail.gmail.com>
[not found] ` <87woeq6qgo.fsf@work.i-did-not-set--mail-host-address--so-tickle-me>
2019-09-08 12:16 ` Fwd: " 李不显
2019-09-02 15:30 ` Marcin Borkowski
2019-09-08 12:29 ` 李不显
2019-09-08 12:56 ` Amin Bandali
2019-09-08 13:25 ` Stefan Monnier
2019-09-08 19:59 ` Marcin Borkowski
2019-09-08 20:21 ` 李不显
2019-09-08 20:32 ` 李不显
2019-09-08 20:43 ` 李不显
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).