From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] switch to file buffer from command line args regardless of `initial-buffer-choice' Date: Fri, 13 Mar 2015 18:11:19 -0400 Message-ID: References: <1425283676.2563.0@mail.samertm.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426284712 5762 80.91.229.3 (13 Mar 2015 22:11:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Mar 2015 22:11:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Samer Masterson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 13 23:11:44 2015 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 1YWXnz-0000Rk-FH for ged-emacs-devel@m.gmane.org; Fri, 13 Mar 2015 23:11:43 +0100 Original-Received: from localhost ([::1]:38853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXny-0005SP-Kr for ged-emacs-devel@m.gmane.org; Fri, 13 Mar 2015 18:11:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXnh-0005SC-U3 for emacs-devel@gnu.org; Fri, 13 Mar 2015 18:11:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWXnc-0004MO-6C for emacs-devel@gnu.org; Fri, 13 Mar 2015 18:11:25 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:49223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWXnc-0004M1-2J for emacs-devel@gnu.org; Fri, 13 Mar 2015 18:11:20 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgJAPOG1lRFxLnr/2dsb2JhbABbgwaDX8Y4BAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAjOIwEBAQcCAR+PeAeEKgWpcoFFIoIygVgignMBAQE X-IPAS-Result: AlgJAPOG1lRFxLnr/2dsb2JhbABbgwaDX8Y4BAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAjOIwEBAQcCAR+PeAeEKgWpcoFFIoIygVgignMBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113506932" Original-Received: from 69-196-185-235.dsl.teksavvy.com (HELO pastel.home) ([69.196.185.235]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Mar 2015 18:11:19 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 76D06FA0; Fri, 13 Mar 2015 18:11:19 -0400 (EDT) In-Reply-To: <1425283676.2563.0@mail.samertm.com> (Samer Masterson's message of "Mon, 02 Mar 2015 00:07:56 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:183859 Archived-At: > This patch always opens `initial-buffer-choice', but displays the file > buffer if emacs is given a file as a command line argument. IIUC the problem you're trying to fix is specific to initial-buffer-choice and does not happen to the default *scratch*. Right? > - (switch-to-buffer > - (if (buffer-live-p buf) buf (get-buffer-create "*scratch*")) > - 'norecord))) > + (unless (> file-count 0) > + (switch-to-buffer > + (if (buffer-live-p buf) buf (get-buffer-create "*scratch*")) > + 'norecord)))) So I don't understand why this patch applies to a part of the code that handles initial-buffer-choice and *scratch* in a similar way. Stefan