From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Burgess Newsgroups: gmane.emacs.devel Subject: [PATCH] Replace inhibit-startup-buffer-menu Date: Mon, 6 Oct 2014 20:50:21 +0100 Message-ID: <20141006195021.GA6395@embecosm.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1412625097 20422 80.91.229.3 (6 Oct 2014 19:51:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Oct 2014 19:51:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 06 21:51:30 2014 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 1XbEJZ-00021X-OI for ged-emacs-devel@m.gmane.org; Mon, 06 Oct 2014 21:51:25 +0200 Original-Received: from localhost ([::1]:54037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbEJZ-00065W-FI for ged-emacs-devel@m.gmane.org; Mon, 06 Oct 2014 15:51:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbEIi-0005Yl-9p for emacs-devel@gnu.org; Mon, 06 Oct 2014 15:50:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbEIb-0001fp-RX for emacs-devel@gnu.org; Mon, 06 Oct 2014 15:50:32 -0400 Original-Received: from mail-wi0-f175.google.com ([209.85.212.175]:41260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbEIb-0001eb-Jl for emacs-devel@gnu.org; Mon, 06 Oct 2014 15:50:25 -0400 Original-Received: by mail-wi0-f175.google.com with SMTP id d1so5742851wiv.8 for ; Mon, 06 Oct 2014 12:50:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=vRnDKO1ykx3xm78k0ajUPuPk5Co3Fw5ovGh8LQCCl88=; b=RRlK/v+GZAneSXa3rGQNMu2reQ3MAfz7REYuZ39lpWrVGbKF1+x/MGFkMW/7q6sLQY WCV+AxqFGpKhrKhf8wMeSfqyvRgNTdBbalPGV8K38R19e/EjYSPZXbYTZMM7vv/41GM3 D0K8y2pF+CRsnd5VX7EWdJ/nxxl4izwvvPpX+ZCEdxGOSuC32kkgg+xEiwRiwGqaef1l jJTMysuLhTFmCopSpbGoTwv2N0CPwKWYBmvLTb+y4gV2ZZ890hMkF5j5Axn0JSumQFKg CFC8Wt3HPmeY4Lzb0S2oQ2kWrs92s1sTfLHshHBjfyPBQ++5p9WEV5VU4CMiqs/Ov2yA DJTg== X-Gm-Message-State: ALoCoQlipkGdtAvbKDuabGa4fjOjg4lhGR+5UNjZI1gYJzuGRf/0XE5BwcwAOJ+usoNSpHEDQ1Vb X-Received: by 10.180.96.71 with SMTP id dq7mr22195958wib.66.1412625023853; Mon, 06 Oct 2014 12:50:23 -0700 (PDT) Original-Received: from localhost (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by mx.google.com with ESMTPSA id am1sm18299391wjc.29.2014.10.06.12.50.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Oct 2014 12:50:23 -0700 (PDT) Content-Disposition: inline X-Operating-System: Linux/3.16.3-200.fc20.x86_64 (x86_64) X-Uptime: 20:24:19 up 9:20, 15 users, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.175 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:175046 Archived-At: When opening multiple file from the command line emacs uses `list-buffers' to display a list of buffers. This is fine, except that I normally use an alternative package for displaying a buffer list, it would be nice if I could use something other than `list-buffers' for this initial buffer list. The patch below makes inhibit-startup-buffer-menu obsolete, and introduces startup-buffer-menu-function. This new variable is by default `list-buffers', and so the current behaviour is maintained. Setting startup-buffer-menu-function to nil turns off the buffer list, or it can be set to a function, the intention being that the function should display the buffer list. I'm could probably achieve the same result by using inhibit-startup-buffer-menu and emacs-startup-hook, but this felt like a neater, more obvious solution. All feedback welcome, thanks, Andrew lisp/ChangeLog: 2014-10-06 Andrew Burgess * startup.el (inhibit-startup-buffer-menu): Make obsolete. (startup-buffer-menu-function): New user-option. (command-line-1): When startup-buffer-menu-function is a function call it to display the buffer list. etc/NEWS: [ In the section "* Startup Changes in Emacs 24.4" ] ** The user option `inhibit-startup-buffer-menu' is now obsolete, instead use the new `startup-buffer-menu-function'. ** New user option `startup-buffer-menu-function', setting this to nil turns off the initial buffer menu, alternatively, set this to a function that will display the buffer list. === modified file 'lisp/startup.el' *** lisp/startup.el 2014-08-29 22:13:43 +0000 --- lisp/startup.el 2014-10-06 19:16:18 +0000 *************** startup message unless he personally act *** 99,104 **** --- 99,117 ---- :type 'boolean :group 'initialization) + (defcustom startup-buffer-menu-function 'list-buffers + "Function to display buffer list when more than 2 files are loaded. + Setting this to nil will turn off the buffer list when 2 or more + files are loaded, otherwise set this to a function that will + display the buffer list." + :type '(choice + (const :tag "No buffer list" nil) + (function :tag "List function")) + :group 'initialization) + + (make-obsolete-variable 'inhibit-startup-buffer-menu + 'startup-buffer-menu-function "24.3") + (defvar command-switch-alist nil "Alist of command-line switches. Elements look like (SWITCH-STRING . HANDLER-FUNCTION). *************** A fancy display is used on graphic displ *** 2433,2440 **** (and (> file-count 2) (not noninteractive) (not inhibit-startup-buffer-menu) (or (get-buffer-window first-file-buffer) ! (list-buffers))) ;; Display a startup screen, after some preparations. --- 2446,2455 ---- (and (> file-count 2) (not noninteractive) (not inhibit-startup-buffer-menu) + startup-buffer-menu-function + (functionp startup-buffer-menu-function) (or (get-buffer-window first-file-buffer) ! (funcall startup-buffer-menu-function))) ;; Display a startup screen, after some preparations.