From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Get current buffer name from command line? Date: Wed, 13 Aug 2014 13:32:34 +0200 Organization: WMI UAM Message-ID: <20140813133234.6805a417@aga-netbook> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1407929615 3688 80.91.229.3 (13 Aug 2014 11:33:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2014 11:33:35 +0000 (UTC) To: GNU Emacs users list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 13 13:33:30 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1XHWnz-0000QH-Az for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 13:33:23 +0200 Original-Received: from localhost ([::1]:46767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHWny-0002tE-Sg for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 07:33:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHWnh-0002t1-Hh for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 07:33:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHWnc-0004Cp-1q for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 07:33:05 -0400 Original-Received: from msg.wmi.amu.edu.pl ([150.254.78.50]:43820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHWnb-00044J-Rd for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 07:32:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id A519845791 for ; Wed, 13 Aug 2014 13:32:36 +0200 (CEST) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jOfTkRijaD0B for ; Wed, 13 Aug 2014 13:32:36 +0200 (CEST) Original-Received: from aga-netbook (unknown [IPv6:2001:808:114:6:3846:6a89:fdf7:6ccf]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 8154F45761 for ; Wed, 13 Aug 2014 13:32:35 +0200 (CEST) X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.20; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 150.254.78.50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99185 Archived-At: Hello, this is not something I really need, but I was wondering whether I can get the (name of) the current buffer from command line? Here is an interesting exchange I had with Eshell ("*GNU Emacs*" being the *other* buffer): Welcome to the Emacs shell ~ $ emacsclient -e "(current-buffer)" # ~ $ emacsclient -e "(other-buffer)" # ~ $ emacsclient -e "(progn (bury-buffer) (current-buffer))" # ~ $ emacsclient -e "(progn (kill-buffer) (current-buffer))" # ~ $ emacsclient -e "(progn (kill-buffer) (other-buffer))" # ~ $ I looked into both the Emacs manual and the Elisp manual, but found nothing to explain this behavior (I expected to see # at least once...) Best, -- Marcin Borkowski room B3-46, phone no +48 61 829 5375 http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University