From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 21:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13251@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135612465228214 (code B ref -1); Fri, 21 Dec 2012 21:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2012 21:17:32 +0000 Received: from localhost ([127.0.0.1]:54661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm9yF-0007L0-PT for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47472) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm9yD-0007Ks-1V for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm9xt-0008DR-CX for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:40066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xt-0008DN-8l for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xo-0002Nc-PQ for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:17:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm9xj-0008AW-V1 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:17:04 -0500 Received: from mail-we0-f180.google.com ([74.125.82.180]:44794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xj-00089z-Kh for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:16:59 -0500 Received: by mail-we0-f180.google.com with SMTP id t57so2387814wey.11 for ; Fri, 21 Dec 2012 13:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=j97R9WL/cRL3hbK/y8vpeAUXIHKk/3lzpP0lqtmgnR0=; b=kpoeZRGZDt69laykklWlm4JfyQBftJuIZVKaLvweUb26lOuQlJ80M35BtC2S1UxnnN o81q9Ups9D2aa5XSYnIwl3xYuOtZW2wj2JhFszy4R53Gt78jfQFNHv1ZDGKi++hVkUcZ P2aOxNczvWbmrGDJRO1iSWn3y/DQR5Tc/72SAiYibn7/v36nfEaaynzHdgSSRIhrkjlb kUOPccx0hE2c3mn6ZwTU+3vNXpSdmNHLFAfYRux67DUlc4C8DNRwHWJIl2BeVRCVUkP1 CgtqX+TOTMqBWoVYYC9WoZ+7UUwv5SY6CmqgzdZm8fPOA3M00RuHzhtTiLpDdEf98gzi VfxQ== MIME-Version: 1.0 Received: by 10.180.82.69 with SMTP id g5mr25738724wiy.21.1356124618834; Fri, 21 Dec 2012 13:16:58 -0800 (PST) Received: by 10.217.47.138 with HTTP; Fri, 21 Dec 2012 13:16:58 -0800 (PST) Date: Sat, 22 Dec 2012 00:16:58 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/alternative; boundary=f46d0442838a2d455f04d1635e08 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) --f46d0442838a2d455f04d1635e08 Content-Type: text/plain; charset=UTF-8 // Discussion in devel. https://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html Short: I want to be able to set buffer that will be displayed in window of newly created frame. I need it for my emacs package, that will save and restore some emacs state including last window configurations, opened and displayed buffers and such. I tried this: add hook to `after-make-frame-functions'. Inside this hook I do `(switch-to-buffer )' and frame is switched to that at first, but after a short time it's switched to *scratch*. The one way I found how to overcome this behaviour is by setting the `initial-buffer-choice' in the `after-make-frame-functions' hook. One drawback of this approach is that it could only be set to name of file, t or nil and so there is no way to force switching to buffer without underlying file. This could be fixed int server.el:1258 replacing (unless (or files commands) (if (stringp initial-buffer-choice) (find-file initial-buffer-choice) (switch-to-buffer (get-buffer-create "*scratch*") 'norecord))) to (unless (or files commands) (switch-to-buffer (get-buffer-create (or (cond ((stringp initial-buffer-choice) (find-file-noselect initial-buffer-choice)) ((functionp initial-buffer-choice) (funcall initial-buffer-choice))) "*scratch*")) 'norecord)) and modified defcustom in in startup.el:41 would be: (defcustom initial-buffer-choice nil "Buffer to show after starting Emacs. If the value is nil and `inhibit-startup-screen' is nil, show the startup screen. If the value is a string, visit the specified file or directory using `find-file'. If t, open the `*scratch*' buffer. If function, switch to a buffer returned by this function. A string value also causes emacsclient to open the specified file or directory when no target file is specified." :type '(choice (const :tag "Startup screen" nil) (directory :tag "Directory" :value "~/") (file :tag "File" :value "~/.emacs") (function :tag "Function") (const :tag "Lisp scratch buffer" t)) :version "23.1" :group 'initialization) This code allows setting `initial-buffer-choice' to a function returning needed buffer. --f46d0442838a2d455f04d1635e08 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
// Discussion in devel. https= ://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html
Short:
I want to be able to set buffer that will be displayed in window of ne= wly created frame.
I need it for my emacs package, that will save and re= store some emacs state including
last window configurations, opened and = displayed buffers and such.
I tried this: add hook to `after-make-frame-functions'. Inside this hoo= k I do
`(switch-to-buffer <some-buffer>)' and frame is switche= d to that <some-buffer> at first,
but after a short time it's = switched to *scratch*.

The one way I found how to overcome this behaviour is by set= ting the
`initial-buffer-choice' in the `after-make-frame-functions&= #39; hook. One drawback of this
approach is that it could onl= y be set to name of file, t or nil and so there is no way to
force switching to buffer without underlying file. This could be fixed int server.el:1258
replacin= g

=C2=A0 (unless (or files commands)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (if (stringp initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (find-file initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (switch-to-buffer (get-= buffer-create "*scratch*")
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 'norecord)))
to
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (= or files commands)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (switch-to-buffer
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (get-buffer-create
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (cond=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((stringp initial-buffer-choice) (find= -file-noselect initial-buffer-choice))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((functionp initial-buffer-choice) (funca= ll initial-buffer-choice)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "*scratch= *"))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 'norecord))

and modified defcustom in in= startup.el:41 would be:

(defcustom initial-buffer-choice nil
=C2=A0 "Buffer = to show after starting Emacs.
If the value is nil and `inhibit-startup-s= creen' is nil, show the
startup screen.=C2=A0 If the value is a stri= ng, visit the specified file
or directory using `find-file'.=C2=A0 If t, open the `*scratch*'buffer. If function, switch to a buffer returned by this function.

= A string value also causes emacsclient to open the specified file
or dir= ectory when no target file is specified."
=C2=A0 :type '(choice
=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0= =C2=A0=C2=A0 :tag "Startup screen" nil)
=C2=A0=C2=A0=C2=A0 =C2= =A0 (directory :tag "Directory" :value "~/")
=C2=A0= =C2=A0=C2=A0 =C2=A0 (file=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :tag "File&quo= t; :value "~/.emacs")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (function=C2=A0 :tag "Function")=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0=C2=A0=C2=A0 :tag "Lisp = scratch buffer" t))
=C2=A0 :version "23.1"
=C2=A0 :gro= up 'initialization)

This code allows setting `initial-buffer-cho= ice' to a function returning needed buffer.

--f46d0442838a2d455f04d1635e08-- From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 21:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.135612542729456 (code B ref 13251); Fri, 21 Dec 2012 21:31:01 +0000 Received: (at 13251) by debbugs.gnu.org; 21 Dec 2012 21:30:27 +0000 Received: from localhost ([127.0.0.1]:54675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmAAk-0007f2-N4 for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:30:27 -0500 Received: from mail-we0-f182.google.com ([74.125.82.182]:36772) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmAAe-0007ep-Ny for 13251@debbugs.gnu.org; Fri, 21 Dec 2012 16:30:24 -0500 Received: by mail-we0-f182.google.com with SMTP id u54so2456118wey.27 for <13251@debbugs.gnu.org>; Fri, 21 Dec 2012 13:30:04 -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=DmZDXfHjYqmRF8PPgBKM/QrbLv9YGhlweb9Xod7Yd9g=; b=XYFOxhoux9knUHofhM5uZFmJvHQG92isHZhqtXhHwEkDd1GWBPKvIAQfMpZO0RTZ1I LPcst3u8/UGevNI3FsN+BtISIJuPUaNwtbZ/2mpiQQmwfvYfRxn0oCJvYio04GcqSLpt kbRS9ey0iePag30ecfKbym1qt8Z2vfTcWpBcxjEUacltPBc8GZN5ygtlk8+HwxjVua0u PaJwDUj3VUz3PDnJW6zvtknWM8DkH8LjI7wtnVuRY6D1NkmquwYRG2UX8+ZdexdzVzUq giAiAHwITxopaqOttIwtXKOEf6X/5K+DORBw2v5q84E+5CujzJnZAHQyEiVv7ggIfb7w dp7g== MIME-Version: 1.0 Received: by 10.180.82.69 with SMTP id g5mr25776727wiy.21.1356125404106; Fri, 21 Dec 2012 13:30:04 -0800 (PST) Received: by 10.217.47.138 with HTTP; Fri, 21 Dec 2012 13:30:03 -0800 (PST) In-Reply-To: References: Date: Sat, 22 Dec 2012 00:30:03 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/alternative; boundary=f46d0442838afb8fdd04d1638cf7 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --f46d0442838afb8fdd04d1638cf7 Content-Type: text/plain; charset=UTF-8 ah sorry, don't need that `or' in server.el: (unless (or files commands) (switch-to-buffer (get-buffer-create (cond ((stringp initial-buffer-choice) (find-file-noselect initial-buffer-choice)) ((functionp initial-buffer-choice) (funcall initial-buffer-choice)) (t "*scratch*"))) 'norecord)) 2012/12/22 Constantin Kulikov > // Discussion in devel. > https://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html > Short: > I want to be able to set buffer that will be displayed in window of newly > created frame. > I need it for my emacs package, that will save and restore some emacs > state including > last window configurations, opened and displayed buffers and such. > I tried this: add hook to `after-make-frame-functions'. Inside this hook I > do > `(switch-to-buffer )' and frame is switched to that > at first, > but after a short time it's switched to *scratch*. > > The one way I found how to overcome this behaviour is by setting the > `initial-buffer-choice' in the `after-make-frame-functions' hook. One > drawback of this > approach is that it could only be set to name of file, t or nil and so > there is no way to > force switching to buffer without underlying file. This could be fixed int > server.el:1258 > replacing > > (unless (or files commands) > (if (stringp initial-buffer-choice) > (find-file initial-buffer-choice) > (switch-to-buffer (get-buffer-create "*scratch*") > 'norecord))) > > to > (unless (or files commands) > (switch-to-buffer > (get-buffer-create > (or (cond > ((stringp initial-buffer-choice) (find-file-noselect > initial-buffer-choice)) > ((functionp initial-buffer-choice) (funcall > initial-buffer-choice))) > "*scratch*")) > 'norecord)) > > and modified defcustom in in startup.el:41 would be: > > (defcustom initial-buffer-choice nil > "Buffer to show after starting Emacs. > If the value is nil and `inhibit-startup-screen' is nil, show the > startup screen. If the value is a string, visit the specified file > or directory using `find-file'. If t, open the `*scratch*' > buffer. If function, switch to a buffer returned by this function. > > A string value also causes emacsclient to open the specified file > or directory when no target file is specified." > :type '(choice > (const :tag "Startup screen" nil) > (directory :tag "Directory" :value "~/") > (file :tag "File" :value "~/.emacs") > (function :tag "Function") > (const :tag "Lisp scratch buffer" t)) > :version "23.1" > :group 'initialization) > > This code allows setting `initial-buffer-choice' to a function returning > needed buffer. > > --f46d0442838afb8fdd04d1638cf7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
ah sorry, don't need that `or' in server.el:
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (or files co= mmands)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (switch-to-buffer
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (get-buffer-create
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((= stringp initial-buffer-choice) (find-file-noselect initial-buffer-choice))<= br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ((functionp initial-buffer-choice) (funcall initial-buffer-choice= ))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (t "*scratch*")))
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'norecord))

=


2012/12/22 Constantin Kulikov <zxnotdead@gmail.com>
// Discussion in devel. https= ://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html
Short:
I want to be able to set buffer that will be displayed in window of ne= wly created frame.
I need it for my emacs package, that will save and re= store some emacs state including
last window configurations, opened and = displayed buffers and such.
I tried this: add hook to `after-make-frame-functions'. Inside this hoo= k I do
`(switch-to-buffer <some-buffer>)' and frame is switche= d to that <some-buffer> at first,
but after a short time it's = switched to *scratch*.

The one way I found how to overcome this behaviour is by set= ting the
`initial-buffer-choice' in the `after-make-frame-functions&= #39; hook. One drawback of this
approach is that it could onl= y be set to name of file, t or nil and so there is no way to
force switching to buffer without underlying file. This could be fixed int server.el:1258
replacin= g

=C2=A0 (unless (or files commands)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (if (stringp initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (find-file initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (switch-to-buffer (get-= buffer-create "*scratch*")
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 'norecord)))
to
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (= or files commands)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (switch-to-buffer
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (get-buffer-create
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (cond=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((stringp initial-buffer-choice) (find= -file-noselect initial-buffer-choice))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((functionp initial-buffer-choice) (funca= ll initial-buffer-choice)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "*scratch= *"))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 'norecord))

and modified defcustom in in= startup.el:41 would be:

(defcustom initial-buffer-choice nil
=C2=A0 "Buffer = to show after starting Emacs.
If the value is nil and `inhibit-startup-s= creen' is nil, show the
startup screen.=C2=A0 If the value is a stri= ng, visit the specified file
or directory using `find-file'.=C2=A0 If t, open the `*scratch*'buffer. If function, switch to a buffer returned by this function.

= A string value also causes emacsclient to open the specified file
or dir= ectory when no target file is specified."
=C2=A0 :type '(choice
=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0= =C2=A0=C2=A0 :tag "Startup screen" nil)
=C2=A0=C2=A0=C2=A0 =C2= =A0 (directory :tag "Directory" :value "~/")
=C2=A0= =C2=A0=C2=A0 =C2=A0 (file=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :tag "File&quo= t; :value "~/.emacs")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (function=C2=A0 :tag "Function")=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0=C2=A0=C2=A0 :tag "Lisp = scratch buffer" t))
=C2=A0 :version "23.1"
=C2=A0 :gro= up 'initialization)

This code allows setting `initial-buffer-cho= ice' to a function returning needed buffer.


--f46d0442838afb8fdd04d1638cf7-- From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2012 15:43:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Constantin Kulikov Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.135619097215364 (code B ref 13251); Sat, 22 Dec 2012 15:43:03 +0000 Received: (at 13251) by debbugs.gnu.org; 22 Dec 2012 15:42:52 +0000 Received: from localhost ([127.0.0.1]:55659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmRDw-0003zk-3q for submit@debbugs.gnu.org; Sat, 22 Dec 2012 10:42:52 -0500 Received: from mout.gmx.net ([212.227.17.21]:53802) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmRDs-0003zb-MT for 13251@debbugs.gnu.org; Sat, 22 Dec 2012 10:42:49 -0500 Received: from mailout-de.gmx.net ([10.1.76.33]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LyPqS-1SzIbS1dDy-015oPT for <13251@debbugs.gnu.org>; Sat, 22 Dec 2012 16:42:28 +0100 Received: (qmail invoked by alias); 22 Dec 2012 15:42:28 -0000 Received: from 62-47-46-229.adsl.highway.telekom.at (EHLO [62.47.46.229]) [62.47.46.229] by mail.gmx.net (mp033) with SMTP; 22 Dec 2012 16:42:28 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/fpRdkEx3fySuK28dygtdHVVjZXRvGPAlw9dFKFF q5/ZQLzxe5YMZq Message-ID: <50D5D4DD.5020905@gmx.at> Date: Sat, 22 Dec 2012 16:42:21 +0100 From: martin rudalics MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > (defcustom initial-buffer-choice nil > "Buffer to show after starting Emacs. > If the value is nil and `inhibit-startup-screen' is nil, show the > startup screen. If the value is a string, visit the specified file > or directory using `find-file'. If t, open the `*scratch*' > buffer. If function, switch to a buffer returned by this function. As for the last sentence I'd prefer "If it is a function, switch to the buffer returned by that function." > A string value also causes emacsclient to open the specified file > or directory when no target file is specified." > :type '(choice > (const :tag "Startup screen" nil) > (directory :tag "Directory" :value "~/") > (file :tag "File" :value "~/.emacs") > (function :tag "Function") > (const :tag "Lisp scratch buffer" t)) > :version "23.1" Too late for "23.1" use "24.4" instead. > :group 'initialization) > > This code allows setting `initial-buffer-choice' to a function returning > needed buffer. Could you please send us a patch based on these remarks (including the change you sketched in your second mail)? Thanks, martin From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2012 19:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.13562059116482 (code B ref 13251); Sat, 22 Dec 2012 19:52:02 +0000 Received: (at 13251) by debbugs.gnu.org; 22 Dec 2012 19:51:51 +0000 Received: from localhost ([127.0.0.1]:55865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmV6s-0001gT-Ox for submit@debbugs.gnu.org; Sat, 22 Dec 2012 14:51:51 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:37845) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmV6p-0001gL-Nz for 13251@debbugs.gnu.org; Sat, 22 Dec 2012 14:51:48 -0500 Received: by mail-wg0-f54.google.com with SMTP id fg15so2619299wgb.21 for <13251@debbugs.gnu.org>; Sat, 22 Dec 2012 11:51:26 -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 :cc:content-type; bh=qIvFAveo9DuG9GGLqtWmAvF5BH2MPkQyZPKcpsxhav0=; b=jZEBK5/ED8jk+ShyQCeuw6PpU0Ba0Nc8D8Lw16QXmFAdATwMIvdqz5vIERN6d4z4WB lhgoif5gAK8XKRpDzKkBBR+KgUsSf5l1KqeoK36bMZoF9MEYk/7ilr8jg+0PO4+o7eWK jPdgZU4TEtKfiazf+j4pMRxHiBs7vvzO/4QPnPDUVvCKVAJGQ/cgbTHCR1UBfKui+Un6 vJPABRrnjmF1oCHnIRaN7INYEr44ro78fz5Mmsym4zahGTJyySCB2B1cilGmXsQLdjaK d+TgfgDWtwkhgyC1ClsXpwrSFPUsbq9n3t6pM9mufUeHl/7tvfkrLqtPmFd/OQcksngM RI2g== MIME-Version: 1.0 Received: by 10.194.235.6 with SMTP id ui6mr29745181wjc.12.1356205886129; Sat, 22 Dec 2012 11:51:26 -0800 (PST) Received: by 10.217.47.138 with HTTP; Sat, 22 Dec 2012 11:51:25 -0800 (PST) In-Reply-To: <50D5D4DD.5020905@gmx.at> References: <50D5D4DD.5020905@gmx.at> Date: Sat, 22 Dec 2012 22:51:25 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/mixed; boundary=089e01493bd015c65304d1764a70 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --089e01493bd015c65304d1764a70 Content-Type: multipart/alternative; boundary=089e01493bd015c65004d1764a6e --089e01493bd015c65004d1764a6e Content-Type: text/plain; charset=UTF-8 Thanks for the tips. 2012/12/22 martin rudalics > > (defcustom initial-buffer-choice nil > > "Buffer to show after starting Emacs. > > If the value is nil and `inhibit-startup-screen' is nil, show the > > startup screen. If the value is a string, visit the specified file > > or directory using `find-file'. If t, open the `*scratch*' > > buffer. If function, switch to a buffer returned by this function. > > As for the last sentence I'd prefer "If it is a function, switch to the > buffer returned by that function." > > > A string value also causes emacsclient to open the specified file > > or directory when no target file is specified." > > :type '(choice > > (const :tag "Startup screen" nil) > > (directory :tag "Directory" :value "~/") > > (file :tag "File" :value "~/.emacs") > > (function :tag "Function") > > (const :tag "Lisp scratch buffer" t)) > > :version "23.1" > > Too late for "23.1" use "24.4" instead. > > > :group 'initialization) > > > > This code allows setting `initial-buffer-choice' to a function returning > > needed buffer. > > Could you please send us a patch based on these remarks (including the > change you sketched in your second mail)? > > Thanks, martin > --089e01493bd015c65004d1764a6e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the tips.



2012/12/22 martin rudalics= <rudalics@gmx.at>
> (defcustom initial-buffer-choice nil > =C2=A0 "Buffer to show after starting Emacs.
> If the value is nil and `inhibit-startup-screen' is nil, show the<= br> > startup screen. =C2=A0If the value is a string, visit the specified fi= le
> or directory using `find-file'. =C2=A0If t, open the `*scratch*= 9;
> buffer. If function, switch to a buffer returned by this function.

As for the last sentence I'd prefer "If it is a function, switch t= o the
buffer returned by that function."

> A string value also causes emacsclient to open the specified file
> or directory when no target file is specified."
> =C2=A0 :type '(choice
> =C2=A0 =C2=A0 =C2=A0 (const =C2=A0 =C2=A0 :tag "Startup screen&qu= ot; nil)
> =C2=A0 =C2=A0 =C2=A0 (directory :tag "Directory" :value &quo= t;~/")
> =C2=A0 =C2=A0 =C2=A0 (file =C2=A0 =C2=A0 =C2=A0:tag "File" := value "~/.emacs")
> =C2=A0 =C2=A0 =C2=A0 (function =C2=A0:tag "Function")
> =C2=A0 =C2=A0 =C2=A0 (const =C2=A0 =C2=A0 :tag "Lisp scratch buff= er" t))
> =C2=A0 :version "23.1"

Too late for "23.1" use "24.4" instead.

> =C2=A0 :group 'initialization)
>
> This code allows setting `initial-buffer-choice' to a function ret= urning
> needed buffer.

Could you please send us a patch based on these remarks (including the
change you sketched in your second mail)?

Thanks, martin

--089e01493bd015c65004d1764a6e-- --089e01493bd015c65304d1764a70 Content-Type: application/octet-stream; name="initial-buffer-choice-as-function.patch" Content-Disposition: attachment; filename="initial-buffer-choice-as-function.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hb15s7gw0 PT09IG1vZGlmaWVkIGZpbGUgJ2xpc3Avc2VydmVyLmVsJwotLS0gbG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J5IiA6dmFsdWUgIn4vIikKIAkgIChmaWxlICAgICAgOnRhZyAiRmlsZSIgOnZh bHVlICJ+Ly5lbWFjcyIpCisgICAgICAgICAgKGZ1bmN0aW9uICA6dGFnICJGdW5jdGlvbiIpCiAJ ICAoY29uc3QgICAgIDp0YWcgIkxpc3Agc2NyYXRjaCBidWZmZXIiIHQpKQotICA6dmVyc2lvbiAi MjMuMSIKKyAgOnZlcnNpb24gIjI0LjQiCiAgIDpncm91cCAnaW5pdGlhbGl6YXRpb24pCiAKIChk ZWZjdXN0b20gaW5oaWJpdC1zdGFydHVwLXNjcmVlbiBuaWwKCg== --089e01493bd015c65304d1764a70-- From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Dec 2012 20:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.13562075339053 (code B ref 13251); Sat, 22 Dec 2012 20:19:02 +0000 Received: (at 13251) by debbugs.gnu.org; 22 Dec 2012 20:18:53 +0000 Received: from localhost ([127.0.0.1]:55882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmVX2-0002Lx-Qu for submit@debbugs.gnu.org; Sat, 22 Dec 2012 15:18:53 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:34797) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmVX0-0002Lp-Bp for 13251@debbugs.gnu.org; Sat, 22 Dec 2012 15:18:51 -0500 Received: by mail-wi0-f175.google.com with SMTP id hm11so5796776wib.2 for <13251@debbugs.gnu.org>; Sat, 22 Dec 2012 12:18:29 -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 :cc:content-type; bh=2py6H3ip3RJ6ANcX/lIZIEiEG9bEWvGbFouAI+cr3Io=; b=e4ZdlmSNSHTfb7iBzbzLlBCAeMwowXc3ZVEKwEavNe0NolaOR+0BKf9FggPeW/9U6B 5ikSQ86CDQrDTZdQLRxGADkd/6H5kbiFLUAbatnBoHg/o6E9geVOf9bxQYm7YytKXjIB 7K5l5qx7gAJuyW2FpRZL37tz+yfYBg/jQNC6cHoAkNNW7AuqhkxVjW3DaJZHn+S42Y5e znC+kCzqyYSQseS4qg/9yT6uydsvkrkVWW0C4eBoiDAYbaneF9iK+wC9BQtGrXpeY7Ha 8YCZLZTuJvad3OZ42hi7uGyWWBCtX2yHaKIZ1sEx5JydMyzMyhamSSFJqSlXD8VM9fjL oriQ== MIME-Version: 1.0 Received: by 10.180.101.99 with SMTP id ff3mr28962929wib.21.1356207508916; Sat, 22 Dec 2012 12:18:28 -0800 (PST) Received: by 10.217.47.138 with HTTP; Sat, 22 Dec 2012 12:18:28 -0800 (PST) In-Reply-To: References: <50D5D4DD.5020905@gmx.at> Date: Sat, 22 Dec 2012 23:18:28 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/mixed; boundary=f46d044280e8cf8aec04d176aafb X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --f46d044280e8cf8aec04d176aafb Content-Type: multipart/alternative; boundary=f46d044280e8cf8ae704d176aaf9 --f46d044280e8cf8ae704d176aaf9 Content-Type: text/plain; charset=UTF-8 argh. :( Sorry made a small typo in patch attached in previous message. 2012/12/22 Constantin Kulikov > Thanks for the tips. > > > > 2012/12/22 martin rudalics > >> > (defcustom initial-buffer-choice nil >> > "Buffer to show after starting Emacs. >> > If the value is nil and `inhibit-startup-screen' is nil, show the >> > startup screen. If the value is a string, visit the specified file >> > or directory using `find-file'. If t, open the `*scratch*' >> > buffer. If function, switch to a buffer returned by this function. >> >> As for the last sentence I'd prefer "If it is a function, switch to the >> buffer returned by that function." >> >> > A string value also causes emacsclient to open the specified file >> > or directory when no target file is specified." >> > :type '(choice >> > (const :tag "Startup screen" nil) >> > (directory :tag "Directory" :value "~/") >> > (file :tag "File" :value "~/.emacs") >> > (function :tag "Function") >> > (const :tag "Lisp scratch buffer" t)) >> > :version "23.1" >> >> Too late for "23.1" use "24.4" instead. >> >> > :group 'initialization) >> > >> > This code allows setting `initial-buffer-choice' to a function returning >> > needed buffer. >> >> Could you please send us a patch based on these remarks (including the >> change you sketched in your second mail)? >> >> Thanks, martin >> > > --f46d044280e8cf8ae704d176aaf9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
argh. :( Sorry made a small typo in patch attached in= previous message.



2012/12/22 Constantin Kulikov &l= t;zxnotdead@gmail.= com>
Thanks for the tips.


2012/12/22 martin rudalics <rudalics@gmx.= at>
> (defcustom initial-buffer-choice nil > =C2=A0 "Buffer to show after starting Emacs.
> If the value is nil and `inhibit-startup-screen' is nil, show the<= br> > startup screen. =C2=A0If the value is a string, visit the specified fi= le
> or directory using `find-file'. =C2=A0If t, open the `*scratch*= 9;
> buffer. If function, switch to a buffer returned by this function.

As for the last sentence I'd prefer "If it is a function, switch t= o the
buffer returned by that function."

> A string value also causes emacsclient to open the specified file
> or directory when no target file is specified."
> =C2=A0 :type '(choice
> =C2=A0 =C2=A0 =C2=A0 (const =C2=A0 =C2=A0 :tag "Startup screen&qu= ot; nil)
> =C2=A0 =C2=A0 =C2=A0 (directory :tag "Directory" :value &quo= t;~/")
> =C2=A0 =C2=A0 =C2=A0 (file =C2=A0 =C2=A0 =C2=A0:tag "File" := value "~/.emacs")
> =C2=A0 =C2=A0 =C2=A0 (function =C2=A0:tag "Function")
> =C2=A0 =C2=A0 =C2=A0 (const =C2=A0 =C2=A0 :tag "Lisp scratch buff= er" t))
> =C2=A0 :version "23.1"

Too late for "23.1" use "24.4" instead.

> =C2=A0 :group 'initialization)
>
> This code allows setting `initial-buffer-choice' to a function ret= urning
> needed buffer.

Could you please send us a patch based on these remarks (including the
change you sketched in your second mail)?

Thanks, martin


--f46d044280e8cf8ae704d176aaf9-- --f46d044280e8cf8aec04d176aafb Content-Type: application/octet-stream; name="initial-buffer-choice-as-function.patch" Content-Disposition: attachment; filename="initial-buffer-choice-as-function.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hb16q6ww1 PT09IG1vZGlmaWVkIGZpbGUgJ2xpc3Avc2VydmVyLmVsJwotLS0gbGlzcC9zZXJ2ZXIuZWwJMjAx Mi0xMS0wOSAwNjoyODoyNyArMDAwMAorKysgbGlzcC9zZXJ2ZXIuZWwJMjAxMi0xMi0yMiAxOToz Njo1NyArMDAwMApAQCAtMTI1NiwxMiArMTI1NiwxOCBAQAogICAgICAgICAgIChtYXBjICdmdW5j YWxsIChucmV2ZXJzZSBjb21tYW5kcykpCiAKIAkgIDs7IElmIHdlIHdlcmUgdG9sZCBvbmx5IHRv IG9wZW4gYSBuZXcgY2xpZW50LCBvYmV5Ci0JICA7OyBgaW5pdGlhbC1idWZmZXItY2hvaWNlJyBp ZiBpdCBzcGVjaWZpZXMgYSBmaWxlLgotCSAgKHVubGVzcyAob3IgZmlsZXMgY29tbWFuZHMpCi0J ICAgIChpZiAoc3RyaW5ncCBpbml0aWFsLWJ1ZmZlci1jaG9pY2UpCi0JCShmaW5kLWZpbGUgaW5p dGlhbC1idWZmZXItY2hvaWNlKQotCSAgICAgIChzd2l0Y2gtdG8tYnVmZmVyIChnZXQtYnVmZmVy LWNyZWF0ZSAiKnNjcmF0Y2gqIikKLQkJCQknbm9yZWN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VkIGZpbGUKIG9yIGRpcmVjdG9yeSB1c2luZyBgZmluZC1maWxlJy4gIElmIHQsIG9wZW4gdGhl IGAqc2NyYXRjaConCi1idWZmZXIuCitidWZmZXIuIElmIGZ1bmN0aW9uLCBzd2l0Y2ggdG8gYSBi dWZmZXIgcmV0dXJuZWQgYnkgdGhpcyBmdW5jdGlvbi4KIAogQSBzdHJpbmcgdmFsdWUgYWxzbyBj YXVzZXMgZW1hY3NjbGllbnQgdG8gb3BlbiB0aGUgc3BlY2lmaWVkIGZpbGUKIG9yIGRpcmVjdG9y eSB3aGVuIG5vIHRhcmdldCBmaWxlIGlzIHNwZWNpZmllZC4iCkBAIC01MSw4ICs1MSw5IEBACiAJ ICAoY29uc3QgICAgIDp0YWcgIlN0YXJ0dXAgc2NyZWVuIiBuaWwpCiAJICAoZGlyZWN0b3J5IDp0 YWcgIkRpcmVjdG9yeSIgOnZhbHVlICJ+LyIpCiAJICAoZmlsZSAgICAgIDp0YWcgIkZpbGUiIDp2 YWx1ZSAifi8uZW1hY3MiKQorICAgICAgICAgIChmdW5jdGlvbiAgOnRhZyAiRnVuY3Rpb24iKQog CSAgKGNvbnN0ICAgICA6dGFnICJMaXNwIHNjcmF0Y2ggYnVmZmVyIiB0KSkKLSAgOnZlcnNpb24g IjIzLjEiCisgIDp2ZXJzaW9uICIyNC40IgogICA6Z3JvdXAgJ2luaXRpYWxpemF0aW9uKQogCiAo ZGVmY3VzdG9tIGluaGliaXQtc3RhcnR1cC1zY3JlZW4gbmlsCgo= --f46d044280e8cf8aec04d176aafb-- From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Dec 2012 10:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Constantin Kulikov Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.135625768629153 (code B ref 13251); Sun, 23 Dec 2012 10:15:02 +0000 Received: (at 13251) by debbugs.gnu.org; 23 Dec 2012 10:14:46 +0000 Received: from localhost ([127.0.0.1]:56201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmiZy-0007aA-Dc for submit@debbugs.gnu.org; Sun, 23 Dec 2012 05:14:46 -0500 Received: from mout.gmx.net ([212.227.17.21]:49865) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmiZw-0007a2-FN for 13251@debbugs.gnu.org; Sun, 23 Dec 2012 05:14:45 -0500 Received: from mailout-de.gmx.net ([10.1.76.35]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MQKg6-1TeymM2Tng-00ThIl for <13251@debbugs.gnu.org>; Sun, 23 Dec 2012 11:14:18 +0100 Received: (qmail invoked by alias); 23 Dec 2012 10:14:18 -0000 Received: from 62-47-62-46.adsl.highway.telekom.at (EHLO [62.47.62.46]) [62.47.62.46] by mail.gmx.net (mp035) with SMTP; 23 Dec 2012 11:14:18 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18zC5gBIYMzx8moAgzLxyOlYVkRNBtHkVvY2CjH30 q6tvywaOvapSKN Message-ID: <50D6D972.4010704@gmx.at> Date: Sun, 23 Dec 2012 11:14:10 +0100 From: martin rudalics MIME-Version: 1.0 References: <50D5D4DD.5020905@gmx.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > Thanks for the tips. Thanks for the patch. Unfortunately, we are not yet done :-( > === modified file 'lisp/server.el' > --- lisp/server.el 2012-11-09 06:28:27 +0000 > +++ lisp/server.el 2012-12-22 19:36:57 +0000 > @@ -1256,12 +1256,18 @@ > (mapc 'funcall (nreverse commands)) > > ;; 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))) > + ;; `initial-buffer-choice' if it specifies a file > + ;; or a function > + (unless (or files commands) Here we have to make sure that we do _not_ switch to *scratch* when `initial-buffer-choice' is nil but show the initial start screen. > + (switch-to-buffer > + (get-buffer-create > + (cond > + ((stringp initial-buffer-choice) > + (find-file-noselect initial-buffer-choice)) > + ((functionp initial-buffer-choice) > + (funcall initial-buffer-choice)) Let's make sure that both `find-file-noselect' and the function called via `initial-buffer-choice' really returned a live buffer. So please add a call to `buffer-live-p' for these cases. Which also means that Stefan's initial proposal for a let-bound `buf' is the better choice ;-) (he's usually always right in these things). > + (t "*scratch*"))) > + 'norecord)) > > ;; Delete the client if necessary. > (cond > > === modified file 'lisp/startup.el' > --- lisp/startup.el 2012-12-01 02:08:30 +0000 > +++ lisp/startup.el 2012-12-22 20:09:27 +0000 > @@ -43,7 +43,7 @@ > If the value is nil and `inhibit-startup-screen' is nil, show the > startup screen. If the value is a string, visit the specified file > or directory using `find-file'. I suppose this is no longer true. Let's say "switch to a buffer visiting the file or directory specified by the string" instead. > If t, open the `*scratch*' > -buffer. This should come after the function item. Note that we are not overly precise in the doc-string - any non-nil value of `initial-buffer-choice' will show *scratch*. But it's better to not tell that in the doc-string so we have room for future changes - just like the one you proposed. > +buffer. If function, switch to a buffer returned by this function. "If the value is a function, switch to the buffer returned by that function." seems more precise here. > A string value also causes emacsclient to open the specified file > or directory when no target file is specified." > @@ -51,8 +51,9 @@ > (const :tag "Startup screen" nil) > (directory :tag "Directory" :value "~/") > (file :tag "File" :value "~/.emacs") > + (function :tag "Function") > (const :tag "Lisp scratch buffer" t)) > - :version "23.1" > + :version "24.4" > :group 'initialization) > > (defcustom inhibit-startup-screen nil And now comes the last problem. The function `command-line-1' (in startup.el) contains these lines: (when (eq initial-buffer-choice t) ;; When initial-buffer-choice equals t make sure that *scratch* ;; exists. (get-buffer-create "*scratch*")) I'd remove them because we can handle them here: (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)))) If we allow `initial-buffer-choice' to specify a function, we have to handle it here in the same way as in server.el. martin From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Fwd: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Dec 2012 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.13562822929077 (code B ref 13251); Sun, 23 Dec 2012 17:05:01 +0000 Received: (at 13251) by debbugs.gnu.org; 23 Dec 2012 17:04:52 +0000 Received: from localhost ([127.0.0.1]:56976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tmoyq-0002MK-Jf for submit@debbugs.gnu.org; Sun, 23 Dec 2012 12:04:52 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:37126) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tmoyo-0002MB-Cp for 13251@debbugs.gnu.org; Sun, 23 Dec 2012 12:04:51 -0500 Received: by mail-we0-f173.google.com with SMTP id z2so3003809wey.32 for <13251@debbugs.gnu.org>; Sun, 23 Dec 2012 09:04:24 -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=AKtf5NKUi63nx4WZZbNfXDtgMyPYZPS0LtfofElfD1M=; b=klTisQVJQ154J7+zTD/72bxecTvjIG6dZ5LEO4l9V4FhrYpAoTxfPGDQdDit4zQ7Tp y9kmJaCAeWDECNTmXwehi7B7shKpgiRof+Zxwv5clRHW53qW40BDmNhSZ76TPEwMhAZm V8GOP6ION2k1EGlgFcLMA9qbatJnU+9f+imjwQY7sR6mdAQuXjRX25nT6LvwEGU8LadW VL7yXiFUsmcUhzqWrW7BhftC0rcnZFbB2DzRoA1QIJPO9gtYYvTZlNiZt0cfhSZgNPwM 5MSaRzMILvoGRGR2ZQPGqA7FgglYtDwWZvj8i1dEQlupBW0RXN//D7qFR4RwXDrIr27I 3PXg== MIME-Version: 1.0 Received: by 10.194.235.6 with SMTP id ui6mr32543561wjc.12.1356282264194; Sun, 23 Dec 2012 09:04:24 -0800 (PST) Received: by 10.217.47.138 with HTTP; Sun, 23 Dec 2012 09:04:24 -0800 (PST) In-Reply-To: References: <50D5D4DD.5020905@gmx.at> <50D6D972.4010704@gmx.at> Date: Sun, 23 Dec 2012 20:04:24 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/mixed; boundary=089e01493bd0928fea04d18812be X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --089e01493bd0928fea04d18812be Content-Type: multipart/alternative; boundary=089e01493bd0928fe604d18812bc --089e01493bd0928fe604d18812bc Content-Type: text/plain; charset=UTF-8 ---------- Forwarded message ---------- From: Constantin Kulikov Date: 2012/12/23 Subject: Re: bug#13251: Wishlist: Add ability to set initial buffer for new frames. To: martin rudalics another attempt... --089e01493bd0928fe604d18812bc Content-Type: text/html; charset=UTF-8


---------- Forwarded message ----------
From: Constantin Kulikov <zxnotdead@gmail.com>
Date: 2012/12/23
Subject: Re: bug#13251: Wishlist: Add ability to set initial buffer for new frames.
To: martin rudalics <rudalics@gmx.at>


another attempt...

--089e01493bd0928fe604d18812bc-- --089e01493bd0928fea04d18812be Content-Type: application/octet-stream; name="initial-buffer-choice-as-function.patch" Content-Disposition: attachment; filename="initial-buffer-choice-as-function.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hb2f6bbi0 PT09IG1vZGlmaWVkIGZpbGUgJ2xpc3Avc2VydmVyLmVsJwotLS0gbGlzcC9zZXJ2ZXIuZWwJMjAx Mi0xMS0wOSAwNjoyODoyNyArMDAwMAorKysgbGlzcC9zZXJ2ZXIuZWwJMjAxMi0xMi0yMyAxNjo1 NTowNSArMDAwMApAQCAtMTI1NiwxMiArMTI1NiwyMSBAQAogICAgICAgICAgIChtYXBjICdmdW5j YWxsIChucmV2ZXJzZSBjb21tYW5kcykpCiAKIAkgIDs7IElmIHdlIHdlcmUgdG9sZCBvbmx5IHRv IG9wZW4gYSBuZXcgY2xpZW50LCBvYmV5Ci0JICA7OyBgaW5pdGlhbC1idWZmZXItY2hvaWNlJyBp ZiBpdCBzcGVjaWZpZXMgYSBmaWxlLgotCSAgKHVubGVzcyAob3IgZmlsZXMgY29tbWFuZHMpCi0J ICAgIChpZiAoc3RyaW5ncCBpbml0aWFsLWJ1ZmZlci1jaG9pY2UpCi0JCShmaW5kLWZpbGUgaW5p dGlhbC1idWZmZXItY2hvaWNlKQotCSAgICAgIChzd2l0Y2gtdG8tYnVmZmVyIChnZXQtYnVmZmVy LWNyZWF0ZSAiKnNjcmF0Y2gqIikKLQkJCQknbm9yZWNvcmQpKSkKKwkgIDs7IGBpbml0aWFsLWJ1 ZmZlci1jaG9pY2UnIGlmIGl0IHNwZWNpZmllcyBhIGZpbGUKKyAgICAgICAgICA7OyBvciBhIGZ1 bmN0aW9uLgorICAgICAgICAgICh1bmxlc3MgKG9yIGZpbGVzIGNvbW1hbmRzKQorICAgICAgICAg ICAgKGxldCAoKGJ1ZgorICAgICAgICAgICAgICAgICAgIChjb25kCisgICAgICAgICAgICAgICAg ICAgICgoc3RyaW5ncCBpbml0aWFsLWJ1ZmZlci1jaG9pY2UpCisgICAgICAgICAgICAgICAgICAg ICAoZmluZC1maWxlLW5vc2VsZWN0IGluaXRpYWwtYnVmZmVyLWNob2ljZSkpCisgICAgICAgICAg ICAgICAgICAgICgoZnVuY3Rpb25wIGluaXRpYWwtYnVmZmVyLWNob2ljZSkKKyAgICAgICAgICAg ICAgICAgICAgIChmdW5jYWxsIGluaXRpYWwtYnVmZmVyLWNob2ljZSkpKSkpCisgICAgICAgICAg ICAgIChjb25kICgoYnVmZmVyLWxpdmUtcCBidWYpCisgICAgICAgICAgICAgICAgICAgICAoc3dp dGNoLXRvLWJ1ZmZlciBidWYgJ25vcmVjb3JkKSkKKyAgICAgICAgICAgICAgICAgICAgKChhbmQg KGVxIG5pbCBidWYpIChlcSBuaWwgaW5oaWJpdC1zdGFydHVwLXNjcmVlbikpCisgICAgICAgICAg ICAgICAgICAgICAoZGlzcGxheS1zdGFydHVwLXNjcmVlbikpCisgICAgICAgICAgICAgICAgICAg ICh0IChzd2l0Y2gtdG8tYnVmZmVyCisgICAgICAgICAgICAgICAgICAgICAgICAoZ2V0LWJ1ZmZl ci1jcmVhdGUgIipzY3JhdGNoKiIpKSkpKSkKIAogICAgICAgICAgIDs7IERlbGV0ZSB0aGUgY2xp ZW50IGlmIG5lY2Vzc2FyeS4KICAgICAgICAgICAoY29uZAoKPT09IG1vZGlmaWVkIGZpbGUgJ2xp c3Avc3RhcnR1cC5lbCcKLS0tIGxpc3Avc3RhcnR1cC5lbAkyMDEyLTEyLTAxIDAyOj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AgICAod2hlbiBpbml0aWFs LWJ1ZmZlci1jaG9pY2UKLSAgICAgIChjb25kICgoZXEgaW5pdGlhbC1idWZmZXItY2hvaWNlIHQp Ci0JICAgICAoc3dpdGNoLXRvLWJ1ZmZlciAoZ2V0LWJ1ZmZlci1jcmVhdGUgIipzY3JhdGNoKiIp KSkKLQkgICAgKChzdHJpbmdwIGluaXRpYWwtYnVmZmVyLWNob2ljZSkKLQkgICAgIChmaW5kLWZp bGUgaW5pdGlhbC1idWZmZXItY2hvaWNlKSkpKQorICAgICAgKGxldCAoKGJ1ZgorICAgICAgICAg ICAgIChjb25kCisgICAgICAgICAgICAgICgoc3RyaW5ncCBpbml0aWFsLWJ1ZmZlci1jaG9pY2Up CisgICAgICAgICAgICAgICAoZmluZC1maWxlLW5vc2VsZWN0IGluaXRpYWwtYnVmZmVyLWNob2lj ZSkpCisgICAgICAgICAgICAgICgoZnVuY3Rpb25wIGluaXRpYWwtYnVmZmVyLWNob2ljZSkKKyAg ICAgICAgICAgICAgIChmdW5jYWxsIGluaXRpYWwtYnVmZmVyLWNob2ljZSkpKSkpCisgICAgICAg IChpZiAoYnVmZmVyLWxpdmUtcCBidWYpCisgICAgICAgICAgICAoc3dpdGNoLXRvLWJ1ZmZlciBi dWYgJ25vcmVjb3JkKQorICAgICAgICAgIChzd2l0Y2gtdG8tYnVmZmVyIChnZXQtYnVmZmVyLWNy ZWF0ZSAiKnNjcmF0Y2gqIikgJ25vcmVjb3JkKSkpKQogCiAgICAgKGlmIChvciBpbmhpYml0LXN0 YXJ0dXAtc2NyZWVuCiAJICAgIGluaXRpYWwtYnVmZmVyLWNob2ljZQoK --089e01493bd0928fea04d18812be-- From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Dec 2012 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Constantin Kulikov Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.13563723604213 (code B ref 13251); Mon, 24 Dec 2012 18:06:02 +0000 Received: (at 13251) by debbugs.gnu.org; 24 Dec 2012 18:06:00 +0000 Received: from localhost ([127.0.0.1]:58413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnCPX-00015t-8B for submit@debbugs.gnu.org; Mon, 24 Dec 2012 13:06:00 -0500 Received: from mout.gmx.net ([212.227.15.18]:60488) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnCPQ-00015f-Gm for 13251@debbugs.gnu.org; Mon, 24 Dec 2012 13:05:57 -0500 Received: from mailout-de.gmx.net ([10.1.76.1]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LoscP-1T845E3J1f-00gpDz for <13251@debbugs.gnu.org>; Mon, 24 Dec 2012 19:05:19 +0100 Received: (qmail invoked by alias); 24 Dec 2012 18:05:19 -0000 Received: from 62-47-43-37.adsl.highway.telekom.at (EHLO [62.47.43.37]) [62.47.43.37] by mail.gmx.net (mp001) with SMTP; 24 Dec 2012 19:05:19 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18tUOQWClwtRGHWOzAe0VCGWozvW04+pL6ETSIpfA 60U7GYUhVaNvJm Message-ID: <50D89955.7050609@gmx.at> Date: Mon, 24 Dec 2012 19:05:09 +0100 From: martin rudalics MIME-Version: 1.0 References: <50D5D4DD.5020905@gmx.at> <50D6D972.4010704@gmx.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > another attempt... Committed as a combination of your previous and present patch. Please have a look. Thanks, martin From unknown Tue Jun 17 01:50:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13251: Wishlist: Add ability to set initial buffer for new frames. Resent-From: Constantin Kulikov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Dec 2012 19:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: 13251@debbugs.gnu.org Received: via spool by 13251-submit@debbugs.gnu.org id=B13251.135637785912275 (code B ref 13251); Mon, 24 Dec 2012 19:38:03 +0000 Received: (at 13251) by debbugs.gnu.org; 24 Dec 2012 19:37:39 +0000 Received: from localhost ([127.0.0.1]:58448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnDqF-0003Bv-5s for submit@debbugs.gnu.org; Mon, 24 Dec 2012 14:37:39 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:36423) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnDqD-0003BT-0E for 13251@debbugs.gnu.org; Mon, 24 Dec 2012 14:37:38 -0500 Received: by mail-we0-f175.google.com with SMTP id z53so3444341wey.20 for <13251@debbugs.gnu.org>; Mon, 24 Dec 2012 11:37:04 -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 :cc:content-type; bh=RGjg5M68o2gvhTupmBEKi0HXAhsrQtvB7gy4tg9mdL0=; b=Y7+UOuTqlAP1oPJvYM1PGkwrJl6gBXusiIHzgDwKcpJ863R+b5Xq2CWQlSCiUsbLvC dR5b/UEnQtkGH2FKrXFxvKMro4cbZDE/HVzglloBU3RwFzGgjfbZQMzLmAEyuTEVokGM Mo/ojxEdZBFlLEhRs73sYn4nWDr6+O8AYDAMojCDslpsouzPt6S5mSVLVtBMyvPqF+fq fLpbG2DLswo+Kw8zd4Nj98VUO4+COP/QEGoRiJ4OAv1UpnmkNbU/r4IUFfFM7/jPGmHI 0qUpPmSC/TnK8ect80q/v03UC1OWOdsmZ7NMk+OXx/hbMo3D8Uv3fx0sjbruIi1vS610 Znig== MIME-Version: 1.0 Received: by 10.180.82.69 with SMTP id g5mr36709926wiy.21.1356377824209; Mon, 24 Dec 2012 11:37:04 -0800 (PST) Received: by 10.217.47.138 with HTTP; Mon, 24 Dec 2012 11:37:04 -0800 (PST) In-Reply-To: <50D89955.7050609@gmx.at> References: <50D5D4DD.5020905@gmx.at> <50D6D972.4010704@gmx.at> <50D89955.7050609@gmx.at> Date: Mon, 24 Dec 2012 22:37:04 +0300 Message-ID: From: Constantin Kulikov Content-Type: multipart/alternative; boundary=f46d0442838a64aadb04d19e5262 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --f46d0442838a64aadb04d19e5262 Content-Type: text/plain; charset=UTF-8 seems it works as I need. Thanks. 2012/12/24 martin rudalics > > another attempt... > > Committed as a combination of your previous and present patch. Please > have a look. > > Thanks, martin > --f46d0442838a64aadb04d19e5262 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
seems it works as I need. Thanks.


2012/12/24 martin rudalics <ru= dalics@gmx.at>
> another attempt...

Committed as a combination of your previous and present patch. =C2=A0Please=
have a look.

Thanks, martin

--f46d0442838a64aadb04d19e5262-- From unknown Tue Jun 17 01:50:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Constantin Kulikov Subject: bug#13251: closed (Re: bug#13251: Wishlist: Add ability to set initial buffer for new frames.) Message-ID: References: <50E3E9C6.8040501@gmx.at> X-Gnu-PR-Message: they-closed 13251 X-Gnu-PR-Package: emacs Reply-To: 13251@debbugs.gnu.org Date: Wed, 02 Jan 2013 08:05:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1357113903-10849-1" This is a multi-part message in MIME format... ------------=_1357113903-10849-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13251: Wishlist: Add ability to set initial buffer for new frames. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13251@debbugs.gnu.org. --=20 13251: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13251 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1357113903-10849-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13251-done) by debbugs.gnu.org; 2 Jan 2013 08:04:43 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqJJa-0002o8-J8 for submit@debbugs.gnu.org; Wed, 02 Jan 2013 03:04:42 -0500 Received: from mout.gmx.net ([212.227.15.19]:63951) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqJJY-0002nz-8k for 13251-done@debbugs.gnu.org; Wed, 02 Jan 2013 03:04:41 -0500 Received: from mailout-de.gmx.net ([10.1.76.24]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0M3PXK-1SzJ4B2hfs-00qzFN for <13251-done@debbugs.gnu.org>; Wed, 02 Jan 2013 09:03:19 +0100 Received: (qmail invoked by alias); 02 Jan 2013 08:03:19 -0000 Received: from 62-47-60-197.adsl.highway.telekom.at (EHLO [62.47.60.197]) [62.47.60.197] by mail.gmx.net (mp024) with SMTP; 02 Jan 2013 09:03:19 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18BmvcSkpUB3jGxIiN3A3tj4U7Z4sX3LS1L2u4qqt DEDGbl4Yxl/oOd Message-ID: <50E3E9C6.8040501@gmx.at> Date: Wed, 02 Jan 2013 09:03:18 +0100 From: martin rudalics MIME-Version: 1.0 To: Constantin Kulikov Subject: Re: bug#13251: Wishlist: Add ability to set initial buffer for new frames. References: <50D5D4DD.5020905@gmx.at> <50D6D972.4010704@gmx.at> <50D89955.7050609@gmx.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13251-done Cc: 13251-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) > seems it works as I need. Thanks. Bug closed. Thanks, martin ------------=_1357113903-10849-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Dec 2012 21:17:32 +0000 Received: from localhost ([127.0.0.1]:54661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm9yF-0007L0-PT for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47472) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm9yD-0007Ks-1V for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm9xt-0008DR-CX for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:40066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xt-0008DN-8l for submit@debbugs.gnu.org; Fri, 21 Dec 2012 16:17:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xo-0002Nc-PQ for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:17:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm9xj-0008AW-V1 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:17:04 -0500 Received: from mail-we0-f180.google.com ([74.125.82.180]:44794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm9xj-00089z-Kh for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 16:16:59 -0500 Received: by mail-we0-f180.google.com with SMTP id t57so2387814wey.11 for ; Fri, 21 Dec 2012 13:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=j97R9WL/cRL3hbK/y8vpeAUXIHKk/3lzpP0lqtmgnR0=; b=kpoeZRGZDt69laykklWlm4JfyQBftJuIZVKaLvweUb26lOuQlJ80M35BtC2S1UxnnN o81q9Ups9D2aa5XSYnIwl3xYuOtZW2wj2JhFszy4R53Gt78jfQFNHv1ZDGKi++hVkUcZ P2aOxNczvWbmrGDJRO1iSWn3y/DQR5Tc/72SAiYibn7/v36nfEaaynzHdgSSRIhrkjlb kUOPccx0hE2c3mn6ZwTU+3vNXpSdmNHLFAfYRux67DUlc4C8DNRwHWJIl2BeVRCVUkP1 CgtqX+TOTMqBWoVYYC9WoZ+7UUwv5SY6CmqgzdZm8fPOA3M00RuHzhtTiLpDdEf98gzi VfxQ== MIME-Version: 1.0 Received: by 10.180.82.69 with SMTP id g5mr25738724wiy.21.1356124618834; Fri, 21 Dec 2012 13:16:58 -0800 (PST) Received: by 10.217.47.138 with HTTP; Fri, 21 Dec 2012 13:16:58 -0800 (PST) Date: Sat, 22 Dec 2012 00:16:58 +0300 Message-ID: Subject: Wishlist: Add ability to set initial buffer for new frames. From: Constantin Kulikov To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=f46d0442838a2d455f04d1635e08 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) --f46d0442838a2d455f04d1635e08 Content-Type: text/plain; charset=UTF-8 // Discussion in devel. https://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html Short: I want to be able to set buffer that will be displayed in window of newly created frame. I need it for my emacs package, that will save and restore some emacs state including last window configurations, opened and displayed buffers and such. I tried this: add hook to `after-make-frame-functions'. Inside this hook I do `(switch-to-buffer )' and frame is switched to that at first, but after a short time it's switched to *scratch*. The one way I found how to overcome this behaviour is by setting the `initial-buffer-choice' in the `after-make-frame-functions' hook. One drawback of this approach is that it could only be set to name of file, t or nil and so there is no way to force switching to buffer without underlying file. This could be fixed int server.el:1258 replacing (unless (or files commands) (if (stringp initial-buffer-choice) (find-file initial-buffer-choice) (switch-to-buffer (get-buffer-create "*scratch*") 'norecord))) to (unless (or files commands) (switch-to-buffer (get-buffer-create (or (cond ((stringp initial-buffer-choice) (find-file-noselect initial-buffer-choice)) ((functionp initial-buffer-choice) (funcall initial-buffer-choice))) "*scratch*")) 'norecord)) and modified defcustom in in startup.el:41 would be: (defcustom initial-buffer-choice nil "Buffer to show after starting Emacs. If the value is nil and `inhibit-startup-screen' is nil, show the startup screen. If the value is a string, visit the specified file or directory using `find-file'. If t, open the `*scratch*' buffer. If function, switch to a buffer returned by this function. A string value also causes emacsclient to open the specified file or directory when no target file is specified." :type '(choice (const :tag "Startup screen" nil) (directory :tag "Directory" :value "~/") (file :tag "File" :value "~/.emacs") (function :tag "Function") (const :tag "Lisp scratch buffer" t)) :version "23.1" :group 'initialization) This code allows setting `initial-buffer-choice' to a function returning needed buffer. --f46d0442838a2d455f04d1635e08 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
// Discussion in devel. https= ://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00521.html
Short:
I want to be able to set buffer that will be displayed in window of ne= wly created frame.
I need it for my emacs package, that will save and re= store some emacs state including
last window configurations, opened and = displayed buffers and such.
I tried this: add hook to `after-make-frame-functions'. Inside this hoo= k I do
`(switch-to-buffer <some-buffer>)' and frame is switche= d to that <some-buffer> at first,
but after a short time it's = switched to *scratch*.

The one way I found how to overcome this behaviour is by set= ting the
`initial-buffer-choice' in the `after-make-frame-functions&= #39; hook. One drawback of this
approach is that it could onl= y be set to name of file, t or nil and so there is no way to
force switching to buffer without underlying file. This could be fixed int server.el:1258
replacin= g

=C2=A0 (unless (or files commands)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (if (stringp initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (find-file initial-buffer-choice)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (switch-to-buffer (get-= buffer-create "*scratch*")
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 'norecord)))
to
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (= or files commands)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (switch-to-buffer
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (get-buffer-create
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (cond=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((stringp initial-buffer-choice) (find= -file-noselect initial-buffer-choice))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((functionp initial-buffer-choice) (funca= ll initial-buffer-choice)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "*scratch= *"))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 'norecord))

and modified defcustom in in= startup.el:41 would be:

(defcustom initial-buffer-choice nil
=C2=A0 "Buffer = to show after starting Emacs.
If the value is nil and `inhibit-startup-s= creen' is nil, show the
startup screen.=C2=A0 If the value is a stri= ng, visit the specified file
or directory using `find-file'.=C2=A0 If t, open the `*scratch*'buffer. If function, switch to a buffer returned by this function.

= A string value also causes emacsclient to open the specified file
or dir= ectory when no target file is specified."
=C2=A0 :type '(choice
=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0= =C2=A0=C2=A0 :tag "Startup screen" nil)
=C2=A0=C2=A0=C2=A0 =C2= =A0 (directory :tag "Directory" :value "~/")
=C2=A0= =C2=A0=C2=A0 =C2=A0 (file=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :tag "File&quo= t; :value "~/.emacs")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (function=C2=A0 :tag "Function")=C2=A0=C2=A0=C2=A0 =C2=A0 (const=C2=A0=C2=A0=C2=A0=C2=A0 :tag "Lisp = scratch buffer" t))
=C2=A0 :version "23.1"
=C2=A0 :gro= up 'initialization)

This code allows setting `initial-buffer-cho= ice' to a function returning needed buffer.

--f46d0442838a2d455f04d1635e08-- ------------=_1357113903-10849-1--