unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to get rid of default lines in the *scratch* buffer
@ 2014-12-09 16:49 chickenkinwing
  2014-12-09 17:04 ` Marco Wahl
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: chickenkinwing @ 2014-12-09 16:49 UTC (permalink / raw)
  To: help-gnu-emacs

By default, the *scratch* buffer contains 2 lines of
"-- Press Enter here to update --".

I find it a major annoyance for me. I have to remove them manually.

Is there a way to automatically get rid of these lines (to make scratch buffer empty) when the *scratch* buffer starts?

Thanks


Peter


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
  2014-12-09 16:49 How to get rid of default lines in the *scratch* buffer chickenkinwing
@ 2014-12-09 17:04 ` Marco Wahl
  2014-12-09 17:11   ` Rusi
  2014-12-10  2:54 ` Robert Thorpe
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Marco Wahl @ 2014-12-09 17:04 UTC (permalink / raw)
  To: help-gnu-emacs

chickenkinwing@gmail.com writes:

> By default, the *scratch* buffer contains 2 lines of
> "-- Press Enter here to update --".
>
> I find it a major annoyance for me. I have to remove them manually.
>
> Is there a way to automatically get rid of these lines (to make scratch buffer empty) when the *scratch* buffer starts?
>

What about M-x customize-variable initial-scratch-message?  Does this help?

-- 
http://www.wahlzone.de
GPG: 0x49010A040A3AE6F2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
  2014-12-09 17:04 ` Marco Wahl
@ 2014-12-09 17:11   ` Rusi
  0 siblings, 0 replies; 8+ messages in thread
From: Rusi @ 2014-12-09 17:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, December 9, 2014 10:34:25 PM UTC+5:30, Marco Wahl wrote:
> chickenkinwing wrote:
> 
> > By default, the *scratch* buffer contains 2 lines of
> > "-- Press Enter here to update --".
> >
> > I find it a major annoyance for me. I have to remove them manually.
> >
> > Is there a way to automatically get rid of these lines (to make scratch buffer empty) when the *scratch* buffer starts?
> >
> 
> What about M-x customize-variable initial-scratch-message?  Does this help?

Also look at the variable inhibit-startup-message


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
  2014-12-09 16:49 How to get rid of default lines in the *scratch* buffer chickenkinwing
  2014-12-09 17:04 ` Marco Wahl
@ 2014-12-10  2:54 ` Robert Thorpe
       [not found] ` <mailman.15713.1418180083.1147.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Thorpe @ 2014-12-10  2:54 UTC (permalink / raw)
  To: chickenkinwing; +Cc: help-gnu-emacs

chickenkinwing@gmail.com writes:

> By default, the *scratch* buffer contains 2 lines of
> "-- Press Enter here to update --".
>
> I find it a major annoyance for me. I have to remove them manually.
>
> Is there a way to automatically get rid of these lines (to make scratch buffer empty) when the *scratch* buffer starts?

I don't have any lines saying "-- Press Enter here to update --" in my *scratch*.

Does this happen to you with emacs -Q ?

I think you have a package that's outputting text to the wrong buffer on
initialization.

To delete the normal lines in scratch do (delete-region (point-min)
(point-max)) in *scratch*.

BR,
Robert Thorpe



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
       [not found] ` <mailman.15713.1418180083.1147.help-gnu-emacs@gnu.org>
@ 2014-12-10  4:08   ` chickenkinwing
  2014-12-10 13:53     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: chickenkinwing @ 2014-12-10  4:08 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks everyone for posting replies to my question.

With emacs -Q, I did not get the 2 lines.

My .emacs already has these lines:
(setq inhibit-startup-message t)                      
(setq initial-scratch-message nil)    

I am leaning to agree with the hypothesis put forth by Robert Thorpe: wrong output buffer for 2 packages during initialization.

I am too lazy to find out which.

So, I put the following 2 statements at the end of my .emacs file.
And it kills all text in the *scratch* at startup.

(switch-to-buffer-other-frame "*scratch*")
(delete-region (point-min) (point-max))

Thanks, Robert, specifically for the delete-region function suggestion.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
  2014-12-09 16:49 How to get rid of default lines in the *scratch* buffer chickenkinwing
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.15713.1418180083.1147.help-gnu-emacs@gnu.org>
@ 2014-12-10 10:38 ` Nicolas Richard
       [not found] ` <mailman.15723.1418207966.1147.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 8+ messages in thread
From: Nicolas Richard @ 2014-12-10 10:38 UTC (permalink / raw)
  To: chickenkinwing; +Cc: help-gnu-emacs

chickenkinwing@gmail.com writes:
> By default, the *scratch* buffer contains 2 lines of
> "-- Press Enter here to update --".

That might be twittering-mode. It uses those lines, exactly.

-- 
Nicolas Richard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
  2014-12-10  4:08   ` chickenkinwing
@ 2014-12-10 13:53     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2014-12-10 13:53 UTC (permalink / raw)
  To: help-gnu-emacs

> (switch-to-buffer-other-frame "*scratch*")
> (delete-region (point-min) (point-max))

If you only want to empty the buffer, without any other side effects
(such as displaying the buffer elsewhere):

   (with-current-buffer "*scratch*" (delete-region (point-min) (point-max)))

or just

   (with-current-buffer "*scratch*" (erase-buffer))


-- Stefan






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get rid of default lines in the *scratch* buffer
       [not found] ` <mailman.15723.1418207966.1147.help-gnu-emacs@gnu.org>
@ 2014-12-11  1:14   ` chickenkinwing
  0 siblings, 0 replies; 8+ messages in thread
From: chickenkinwing @ 2014-12-11  1:14 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks, Nicolas Richard.  Indeed, it is twittering-mode which outputs those 2 lines to *scratch*.

Problem solved, thanks everyone for responding.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-11  1:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 16:49 How to get rid of default lines in the *scratch* buffer chickenkinwing
2014-12-09 17:04 ` Marco Wahl
2014-12-09 17:11   ` Rusi
2014-12-10  2:54 ` Robert Thorpe
     [not found] ` <mailman.15713.1418180083.1147.help-gnu-emacs@gnu.org>
2014-12-10  4:08   ` chickenkinwing
2014-12-10 13:53     ` Stefan Monnier
2014-12-10 10:38 ` Nicolas Richard
     [not found] ` <mailman.15723.1418207966.1147.help-gnu-emacs@gnu.org>
2014-12-11  1:14   ` chickenkinwing

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).