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: Re: Question on frame title Date: Thu, 15 Oct 2015 19:21:27 +0200 Message-ID: <876128dp48.fsf@mbork.pl> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444929798 16582 80.91.229.3 (15 Oct 2015 17:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 17:23:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 15 19:23:12 2015 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 1ZmmFC-0001Pw-SX for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 19:23:11 +0200 Original-Received: from localhost ([::1]:48808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmFC-0005Io-67 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 13:23:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmDi-0005F1-Pi for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:21:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmmDf-00062e-N6 for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:21:38 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:59818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmDf-00062I-Gs for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:21:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B1C248F2009 for ; Thu, 15 Oct 2015 19:21:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k5+K8UggVOlg for ; Thu, 15 Oct 2015 19:21:32 +0200 (CEST) Original-Received: from localhost (103-115.echostar.pl [213.156.103.115]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 6C1C38F2004 for ; Thu, 15 Oct 2015 19:21:32 +0200 (CEST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 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:107658 Archived-At: On 2015-10-15, at 18:43, Benny Sum wrote: > ls is just as an example. I want to do unix command to get the revision control of a file. Ultimately, here is what I want to do: > > Say unix command: >> info_data filename > -> revision number of the file from the database > > (setq frame-title-format > (list (format "%s" (shell-command-to-string(concat "info-data " " %b "))))) > > So, I just use ls -1 as an example of unix command. > > But the problem is that it seems I don't have filename correctly. It says I can't access the filename. Did you try the command and see if that works for you? Yes I did - in fact, it was as simple as putting the point in the right place in your email and pressing C-x C-e;-). One problem is that you probably want %f, not %b. A bigger problem there *might* be with your approach is the timing: apparently, you want the frame title to be updated whenever you switch buffers, right? This probably means that you want (:eval ...). Another approach could be to use a symbol as frame-title-format (like in (setq frame-title-format 'foo) and make the variable foo contain what you want to have displayed. If there were a `buffer-switch-hook', you could then update it there. It seems tere is no such thing, but yu could e.g. advise switch-to-buffer (or maybe some other function). Hth, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University