[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding switch to *scratch* buffer after creating new frame with

From: Константин Куликов
Subject: Re: Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c'
Date: Thu, 20 Dec 2012 15:13:58 +0300

//sorry, for send you double ;p

>We probably should verify that the buffer is live
yes, it's reasonable

>file a bug report for this
only after discussion on this mail-list :)

>which buffer you want to show here in practice
it's could be just *any* buffer

>set to such a buffer and that buffer does not exist?
then, I think that we could fall back to *scratch*

>add an appropriate customization type for `initial-buffer-choice'
I don't think that it's will be useful for users to customise, but who knows...
>It doesn't sound like a good idea, in particular so
Here the scenario:
I want new frames to switch to some buffer so I added hook to
Inside this hook I do `(switch-to-buffer <some-buffer>)' the window on this
frame is switched to that <some-buffer> at first, but after a short time it's
switched to *scratch*. So as I think it would be better that
`after-make-frame-functions' will be called after this 'default switching to
*scratch* behaviour' is performed. And than will be no need for me to
add code to server.el.
// New version:
          (unless (or files commands)
            (let ((type (type-of initial-buffer-choice))
                  (buf "*scratch*"))
               ((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)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]