From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Random832 Newsgroups: gmane.emacs.help Subject: Re: Question on frame title Date: Thu, 15 Oct 2015 13:30:20 -0400 Message-ID: <87y4f4hwer.fsf@fastmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444930360 25871 80.91.229.3 (15 Oct 2015 17:32:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 17:32:40 +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:32:34 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 1ZmmOF-0002XW-S5 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 19:32:32 +0200 Original-Received: from localhost ([::1]:48876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmOF-0000Sw-1X for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 13:32:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmMm-0000Py-Cn for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:31:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmmMh-0001d7-7D for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:31:00 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmmMh-0001d0-0G for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 13:30:55 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZmmMd-0000p7-9P for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 19:30:51 +0200 Original-Received: from c-68-39-146-59.hsd1.in.comcast.net ([68.39.146.59]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2015 19:30:51 +0200 Original-Received: from random832 by c-68-39-146-59.hsd1.in.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Oct 2015 19:30:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-68-39-146-59.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:XxCgceG4CoHXMQ7Qj/9GVAWNwa0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:107659 Archived-At: Benny Sum writes: > 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? I think you can do this with an :eval like this: I included the default frame-title-format and put your info_data command after it, since it won't work on non-files. (setq frame-title-format '("" (multiple-frames "%b" ("" invocation-name "@" system-name)) " " (:eval (when (stringp (buffer-file-name)) (shell-command-to-string (concat "info_data " (shell-quote-argument (buffer-file-name)))))))) This will re-execute the info-data command every time you switch buffers. If the command is expensive, you may want to store the value in a buffer-local variable.