[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Overriding switch to *scratch* buffer after creating new frame with
From: |
Thien-Thi Nguyen |
Subject: |
Re: Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c' |
Date: |
Thu, 20 Dec 2012 15:46:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
() martin rudalics <rudalics@gmx.at>
() Thu, 20 Dec 2012 14:52:31 +0100
> (unless (or files commands)
> (let ((type (type-of initial-buffer-choice))
> (buf "*scratch*"))
> (cond
> ((eq 'string type) (setq buf (find-file-noselect
initial-buffer-choice)))
> ((eq 'buffer type) (when (buffer-live-p initial-buffer-choice)
> (setq buf initial-buffer-choice))))
> (switch-to-buffer (get-buffer-create buf) 'norecord)))
Looks good to me.
It would be better w/o local vars and ‘setq’, though.
--
Thien-Thi Nguyen ..................................... GPG key: 4C807502
. NB: ttn at glug dot org is not me .
. (and has not been since 2007 or so) .
. ACCEPT NO SUBSTITUTES .
........... please send technical questions to mailing lists ...........
pgp3G8O6AOVU8.pgp
Description: PGP signature