unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Константин Куликов" <zxnotdead@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c'
Date: Thu, 20 Dec 2012 15:13:58 +0300	[thread overview]
Message-ID: <CAFkz2yqJ0ptAKXQiENh9oOr4S-_bA6DxFTVVsBHB512mRYpoog@mail.gmail.com> (raw)
In-Reply-To: <50D2F0FD.30804@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]

//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
`after-make-frame-functions'.
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*"))
              (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)))

[-- Attachment #2: Type: text/html, Size: 2299 bytes --]

      reply	other threads:[~2012-12-20 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFkz2yroLhknptDnWyC9B1fbZKEwTCV-T0VttHQiwZoaAW-j6A@mail.gmail.com>
2012-12-20  8:36 ` Константин Куликов
2012-12-20 11:05   ` Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c' martin rudalics
2012-12-20 12:13     ` Константин Куликов [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFkz2yqJ0ptAKXQiENh9oOr4S-_bA6DxFTVVsBHB512mRYpoog@mail.gmail.com \
    --to=zxnotdead@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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