From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wang Lei Newsgroups: gmane.emacs.help Subject: Re: Postfixing ' emacs' to all frame titles. Date: Sat, 31 Jul 2010 15:30:16 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1280561474 21602 80.91.229.12 (31 Jul 2010 07:31:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Jul 2010 07:31:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: filebat Mark Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 31 09:31:12 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Of6XE-0001cj-E9 for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jul 2010 09:31:08 +0200 Original-Received: from localhost ([127.0.0.1]:48965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Of6XD-0006Rp-KS for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jul 2010 03:31:07 -0400 Original-Received: from [140.186.70.92] (port=33279 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Of6WS-0006Rg-0l for help-gnu-emacs@gnu.org; Sat, 31 Jul 2010 03:30:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Of6WQ-0000ud-QH for help-gnu-emacs@gnu.org; Sat, 31 Jul 2010 03:30:19 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:57397) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Of6WQ-0000uQ-NA for help-gnu-emacs@gnu.org; Sat, 31 Jul 2010 03:30:18 -0400 Original-Received: by qwk4 with SMTP id 4so635121qwk.0 for ; Sat, 31 Jul 2010 00:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=QUnhWO6mXvm65mxyyYuc9AeZzfkURjAfxFCVM9WYhTw=; b=BlvjpNUk7R2ugQc5zovjLWpi1t3u+FnHje9ckX75aPP8yLQ6K/IOLwN6vAuqVz8U4u 3UGge4rlST7X9fVYCijmgXM8S59xmeXhYs8CsaCW1ddXdbWVS9Yjl8QdTOV6zkGyGJvT nr+qaHCALGR3t6gOvvu3l690eg5N4egPW7p2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=X+55AzKtc8g8wZ0FrBZXio9WiukdGSKBFJyqWGFY65pNWHc87Mf3RTF2hBcb6FnorI aLrjBELTvShen3Nu1vTPlj/h9sZQO6ii++mrDwdWNqo+PXoznw51CFaY5oZOo+6XnCV7 BfsEfGKyRCZY9AFUi3LPRHuWtRY9V99xCIVXE= Original-Received: by 10.220.126.130 with SMTP id c2mr1870747vcs.165.1280561417061; Sat, 31 Jul 2010 00:30:17 -0700 (PDT) Original-Received: by 10.220.161.141 with HTTP; Sat, 31 Jul 2010 00:30:16 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74367 Archived-At: On 7/31/10, filebat Mark wrote: > Hi Lennart > > I tried (setq frame-title-format "%f - Emacs"), it's cool. > > However, the full filename of "%f" is usually too long. > Can I truncate the string with fixed length? > > Regards, > Denny You can try this. (setq frame-title-format '(:eval (concat (if (< 10 (length buffer-file-name)) (concat (substring buffer-file-name 0 6) "...") buffer-file-name) "- Emacs"))) I assume 10 is the max length of filename than you want to. > > On 7/28/10, Lennart Borgman wrote: >> >> On Wed, Jul 28, 2010 at 3:14 PM, Kevin Rodgers >> wrote: >> > >> > Tim Visher wrote: >> >> >> >> Hi everyone, >> >> >> >> I'm wondering if there's a simple way to postfix ' emacs' to all frame >> >> titles without resorting to [elisp from the web][1]. Couldn't find >> >> anything in Chapter 25 but I didn't search much harder than that. >> >> >> >> [1]: http://www.emacswiki.org/emacs/FrameTitle >> > >> > No, you need to use Emacs Lisp: that is the "format" of customizations >> > in ~/.emacs (M-x customize notwithstanding). >> > >> > Here's what I use: >> > >> > (setq frame-title-format >> > '("" invocation-name "-" emacs-version "@" system-name ":" >> > (buffer-file-name "%f" "%b"))) >> >> >> >> In EmacsW32 I use >> >> (setq frame-title-format "%b - Emacs") >> >> This is probably what people on ms windows expect. Is that what people >> on other GUI systems expect as well? >> >> > > > -- > Thanks & Regards > > Denny Zhang > -- Regards, Lei