unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Use *scratch* for startup messages?
@ 2013-01-09 23:48 Florian Lindner
  2013-01-09 23:53 ` Christopher Schmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Lindner @ 2013-01-09 23:48 UTC (permalink / raw)
  To: help-gnu-emacs

Hello!

I have (setq inhibit-startup-message t) so I start up with the
*scratch* buffer which I hardly ever use. A thought crossed my mind to
use this buffer as a output for some user generated start up messages,
such as org-mode's TODO list or content of refile buffer, ...

So when Emacs starts, it presents a scratch buffer with my current
TODO list. All other properties of the buffer keep the same (like it's
not being saved).

Since I consider myself still novice with Emacs I'm unsure how to
program that into my .emacs and if there problems with this to be
expected....

Thanks for any thoughts!

Florian



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

* Re: Use *scratch* for startup messages?
  2013-01-09 23:48 Use *scratch* for startup messages? Florian Lindner
@ 2013-01-09 23:53 ` Christopher Schmidt
  2013-01-10  2:37   ` drain
  2013-01-10 10:14   ` Florian Lindner
  0 siblings, 2 replies; 6+ messages in thread
From: Christopher Schmidt @ 2013-01-09 23:53 UTC (permalink / raw)
  To: help-gnu-emacs

Florian Lindner <mailinglists@xgm.de> writes:
> I have (setq inhibit-startup-message t) so I start up with the
> *scratch* buffer which I hardly ever use. A thought crossed my mind to
> use this buffer as a output for some user generated start up messages,
> such as org-mode's TODO list or content of refile buffer, ...
>
> So when Emacs starts, it presents a scratch buffer with my current
> TODO list. All other properties of the buffer keep the same (like it's
> not being saved).
>
> Since I consider myself still novice with Emacs I'm unsure how to
> program that into my .emacs and if there problems with this to be
> expected....

with-current-buffer should be fine.

    (with-current-buffer "*scratch*"
      (insert "Ich bin im Skratsch"))

    (with-current-buffer "*scratch*"
      (insert
       (save-window-excursion
         (org-agenda-list)
         (buffer-string))))

        Christopher



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

* Re: Use *scratch* for startup messages?
  2013-01-09 23:53 ` Christopher Schmidt
@ 2013-01-10  2:37   ` drain
  2013-01-10 19:56     ` Stefan Monnier
  2013-01-10 10:14   ` Florian Lindner
  1 sibling, 1 reply; 6+ messages in thread
From: drain @ 2013-01-10  2:37 UTC (permalink / raw)
  To: Help-gnu-emacs

If you have any of this information stored in a custom file (org file
perhaps), you might want to go an even simpler route:

(switch-to-buffer (find-file "~/agenda/my-custom-agenda.org"))

or

(switch-to-buffer (find-file "~/agenda/my-custom-agenda.txt"))

etc.



--
View this message in context: http://emacs.1067599.n5.nabble.com/Use-scratch-for-startup-messages-tp274852p274858.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



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

* Re: Use *scratch* for startup messages?
  2013-01-09 23:53 ` Christopher Schmidt
  2013-01-10  2:37   ` drain
@ 2013-01-10 10:14   ` Florian Lindner
  2013-01-10 10:45     ` Christopher Schmidt
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Lindner @ 2013-01-10 10:14 UTC (permalink / raw)
  To: help-gnu-emacs

Am Mittwoch, 9. Januar 2013, 23:53:44 schrieb Christopher Schmidt:
> Florian Lindner <mailinglists@xgm.de> writes:
> > I have (setq inhibit-startup-message t) so I start up with the
> > *scratch* buffer which I hardly ever use. A thought crossed my mind to
> > use this buffer as a output for some user generated start up messages,
> > such as org-mode's TODO list or content of refile buffer, ...
> > 
> > So when Emacs starts, it presents a scratch buffer with my current
> > TODO list. All other properties of the buffer keep the same (like it's
> > not being saved).
> > 
> > Since I consider myself still novice with Emacs I'm unsure how to
> > program that into my .emacs and if there problems with this to be
> > expected....
> 
> with-current-buffer should be fine.
> 
>     (with-current-buffer "*scratch*"
>       (insert "Ich bin im Skratsch"))
> 
>     (with-current-buffer "*scratch*"
>       (insert
>        (save-window-excursion
>          (org-agenda-list)
>          (buffer-string))))

Thanks! I have now:

(with-current-buffer "*scratch*"
      (insert
       (save-window-excursion
       org-todo-list)))

but I get: Symbol's value as variable is void: org-todo-list

I tried some shots, like (load "org") but none of that made it. What's the 
best way to load org-mode at the start? (or make this symbol available)

Regards,
Florian



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

* Re: Use *scratch* for startup messages?
  2013-01-10 10:14   ` Florian Lindner
@ 2013-01-10 10:45     ` Christopher Schmidt
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Schmidt @ 2013-01-10 10:45 UTC (permalink / raw)
  To: help-gnu-emacs

Florian Lindner <mailinglists@xgm.de> writes:
> (with-current-buffer "*scratch*"
>       (insert
>        (save-window-excursion
>        org-todo-list)))
         ^^^^^^^^^^^^^
>
> but I get: Symbol's value as variable is void: org-todo-list

    (org-todo-list)
    (buffer-string)

BTW you can evaluate any function or form, e.g. split-window-below (C-x
2), split-window-right (C-x 3) or other-window (C-x o), to build an
arbitrary window configuration after startup.

    (run-at-time
     nil nil
     (lambda ()
       (split-window-below)
       (switch-to-buffer (save-window-excursion
                           (org-todo-list)
                           (current-buffer)))
       (other-window 1)
       (switch-to-buffer (with-current-buffer (get-buffer-create "<3")
                           (insert "RMS")
                           (current-buffer)))))

I use run-at-time so the configuration is set after Emacs messes with
the window configuration due to initial-buffer-choice.  Emacs does this
after running after-init-hook.

        Christopher



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

* Re: Use *scratch* for startup messages?
  2013-01-10  2:37   ` drain
@ 2013-01-10 19:56     ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2013-01-10 19:56 UTC (permalink / raw)
  To: help-gnu-emacs

> (switch-to-buffer (find-file "~/agenda/my-custom-agenda.org"))

There's a redundancy here: find-file = switch-to-buffer + find-file-noselect

So either use find-file and drop the switch-to-buffer, or replace
find-file with find-file-noselect.


        Stefan




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

end of thread, other threads:[~2013-01-10 19:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 23:48 Use *scratch* for startup messages? Florian Lindner
2013-01-09 23:53 ` Christopher Schmidt
2013-01-10  2:37   ` drain
2013-01-10 19:56     ` Stefan Monnier
2013-01-10 10:14   ` Florian Lindner
2013-01-10 10:45     ` Christopher Schmidt

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