From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?0JrQvtC90YHRgtCw0L3RgtC40L0g0JrRg9C70LjQutC+0LI=?= Newsgroups: gmane.emacs.devel Subject: Re: Date: Thu, 20 Dec 2012 11:36:03 +0300 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d044271060e9b1f04d1449fbc X-Trace: ger.gmane.org 1355999900 22122 80.91.229.3 (20 Dec 2012 10:38:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2012 10:38:20 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 20 11:38:34 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 1TldWA-0007wg-JH for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 11:38:22 +0100 Original-Received: from localhost ([::1]:44802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TldVx-0004IO-1M for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2012 05:38:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlbbq-0006ZS-Qu for emacs-devel@gnu.org; Thu, 20 Dec 2012 03:36:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tlbbp-00041v-7V for emacs-devel@gnu.org; Thu, 20 Dec 2012 03:36:06 -0500 Original-Received: from mail-la0-f47.google.com ([209.85.215.47]:36259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlbbo-0003za-R5 for emacs-devel@gnu.org; Thu, 20 Dec 2012 03:36:05 -0500 Original-Received: by mail-la0-f47.google.com with SMTP id u2so2486587lag.20 for ; Thu, 20 Dec 2012 00:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=dQwvW+SS6/r4ywl/SB1G4waQs/A2fJATXzHsWCtYDJw=; b=jGadQaAmwvfZ6m7j8qiF2XiEef+L2Qo+dNVL8GQjg/oifVKl6L04xL4iuaMapGyk1j 7kY37qV1d0yrXKZoii9wb34IoS3iIqCpJBdqQQfoRVSqtI1qMxpcxIYNp9XOlKnsKoCC DSNJjZoLnThKRIVuZpkynxxSzb5XHP3uNf60iZaBDTP6SJ6lE+MqbDNUFycwTMNf//jQ rziIKv4sfRi/8NMxl1h8i80n2iONrBIhkTS/XNX1dFPx6JRDClDQLZEJ4YoNX0ZHkZLG mR0cdsqKnrdgpdSxjTrhZwOEHAzUgn0yv6/hTYb9y46QXXX20Vb7Rehvdjlq0gOKuIql OyXg== Original-Received: by 10.152.125.240 with SMTP id mt16mr8097613lab.17.1355992563358; Thu, 20 Dec 2012 00:36:03 -0800 (PST) Original-Received: by 10.114.1.51 with HTTP; Thu, 20 Dec 2012 00:36:03 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.47 X-Mailman-Approved-At: Thu, 20 Dec 2012 05:38:06 -0500 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:155681 Archived-At: --f46d044271060e9b1f04d1449fbc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 =3Dp) 2012/12/20 =D0=9A=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8=D0=BD =D0= =9A=D1=83=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2 > I discribed my problem here: > http://comments.gmane.org/gmane.emacs.help/88218 . > short: > > when you run 'emacsclient -c' the new frame created and window in that > frame is switched to > > *scratch* buffer or file with name that is set in > `initial-buffer-choice'. > So, I can set `initial-buffer-choice' in the `after-make-frame-functions' > to switch to buffer other than *scratch* on frame creation, but can't set > somehow to buffer without underlying file. > > I found place where this behaviour handled(server.el:1258): > > ;; If we were told only to open a new client, obey > ;; `initial-buffer-choice' if it specifies a file. > (unless (or files commands) > (if (stringp initial-buffer-choice) > (find-file initial-buffer-choice) > (switch-to-buffer (get-buffer-create "*scratch*") > 'norecord))) > > Changed it to this: > (unless (or files commands) > (typecase initial-buffer-choice > (string (find-file initial-buffer-choice)) > (buffer (switch-to-buffer initial-buffer-choice 'norecord)) > (t (switch-to-buffer (get-buffer-create "*scratch*") > 'norecord))) > > then emacsclient -c it create frame and after short time destroys it with > error: > "*ERROR*: Wrong type argument: stringp, #" > > ok. I grepped sources, find startup.el:2325 : > (when initial-buffer-choice > (cond ((eq initial-buffer-choice t) > (switch-to-buffer (get-buffer-create "*scratch*"))) > ((stringp initial-buffer-choice) > (find-file initial-buffer-choice)))) > > replaced it to: > (when initial-buffer-choice > (typecase initial-buffer-choice > (symbol (when (eq initial-buffer-choice t) > (switch-to-buffer (get-buffer-create "*scratch*")))) > (string (find-file initial-buffer-choice)) > (buffer (switch-to-buffer initial-buffer-choice)))) > > But still get same error: > "*ERROR*: Wrong type argument: stringp, #" > >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