From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Overriding switch to *scratch* buffer after creating new frame with 'emacsclient -c' Date: Thu, 20 Dec 2012 12:05:33 +0100 Message-ID: <50D2F0FD.30804@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1356001549 3909 80.91.229.3 (20 Dec 2012 11:05:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2012 11:05:49 +0000 (UTC) Cc: emacs-devel To: =?UTF-8?B?0JrQvtC90YHRgtCw0L3RgtC40L0g0JrRg9C70LjQutC+0LI=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 20 12:06:04 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tldws-00019x-GL for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 12:05:58 +0100 Original-Received: from localhost ([::1]:54833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tldwe-0003ok-Pg for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 06:05:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tldwa-0003oW-W5 for emacs-devel@gnu.org; Thu, 20 Dec 2012 06:05:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TldwZ-0006oZ-JA for emacs-devel@gnu.org; Thu, 20 Dec 2012 06:05:40 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:63012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TldwZ-0006oU-9Y for emacs-devel@gnu.org; Thu, 20 Dec 2012 06:05:39 -0500 Original-Received: from mailout-de.gmx.net ([10.1.76.40]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0M21kz-1SwZlB2KIl-00u3Ga for ; Thu, 20 Dec 2012 12:05:38 +0100 Original-Received: (qmail invoked by alias); 20 Dec 2012 11:05:38 -0000 Original-Received: from 62-47-36-61.adsl.highway.telekom.at (EHLO [62.47.36.61]) [62.47.36.61] by mail.gmx.net (mp040) with SMTP; 20 Dec 2012 12:05:38 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18gg7oMSQYgY/jfpqUfz1GgwEHqOR6/LFqgCLGHi3 qJo7R3k4o6fthg In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155682 Archived-At: > 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