unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Константин Куликов" <zxnotdead@gmail.com>
Cc: 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 12:05:33 +0100	[thread overview]
Message-ID: <50D2F0FD.30804@gmx.at> (raw)
In-Reply-To: <CAFkz2yrZ3wuMiyNY2edNLDG4jTAfNKXb5mvC6OYqu+0xE94Qgg@mail.gmail.com>

 > found how code it more correct:
 > No need to change anything in startup.el
 > Code for server.el will be:
 >
 >           (unless (or files commands)
 >             (let ((type (type-of initial-buffer-choice)))
 >               (cond
 >                ((eq 'string type) (find-file initial-buffer-choice))
 >                ((eq 'buffer type) (switch-to-buffer initial-buffer-choice
 >                                                     'norecord))
 >                (t (switch-to-buffer (get-buffer-create "*scratch*")
 >                                     'norecord)))))
 >
 > So, someone who has write access to emacs, maybe add this change to trunk?
 > (if u see no bugs with this code of course =p)

We probably should verify that the buffer is live and add an appropriate
customization type for `initial-buffer-choice'.

In any case, please file a bug report for this, preferably marked as a
wishlist item.  And, as further motivation, tell which buffer you want
to show here in practice.  This is far from obvious since initially we
usually have only two non-file-visiting buffers - *Messages* and
*scratch*.

Just received this:

 > hint: For example it's could be needed if you want to restore to last
 > opened buffer on new frame(and it could be buffer like *ielm* or
 > *ansi-term*, etc).

Where do you get this from if you have `initial-buffer-choice' set to
such a buffer and that buffer does not exist?  It doesn't sound like a
good idea, in particular so, because `switch-to-buffer' leaves it to
`set-window-buffer' to bark about displaying a deleted buffer.

Thanks, martin



  reply	other threads:[~2012-12-20 11:05 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   ` martin rudalics [this message]
2012-12-20 12:13     ` Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c' Константин Куликов

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=50D2F0FD.30804@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=zxnotdead@gmail.com \
    /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).