all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wang Lei <f3d27b@gmail.com>
To: filebat Mark <filebat.mark@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Postfixing ' emacs' to all frame titles.
Date: Sat, 31 Jul 2010 15:30:16 +0800	[thread overview]
Message-ID: <AANLkTi=QKv+cw+_ySvaxGei5Q7GiAjSbHcmfopW_7b5r@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimQ39jSx21cOAqCP+5fzDBqEmxPLHbQ-k-jPxn_@mail.gmail.com>

On 7/31/10, filebat Mark <filebat.mark@gmail.com> 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 <lennart.borgman@gmail.com> wrote:
>>
>> On Wed, Jul 28, 2010 at 3:14 PM, Kevin Rodgers
>> <kevin.d.rodgers@gmail.com> 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



  reply	other threads:[~2010-07-31  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 15:45 Postfixing ' emacs' to all frame titles Tim Visher
2010-07-28 13:14 ` Kevin Rodgers
2010-07-28 13:23   ` Lennart Borgman
2010-07-29  7:13     ` Kevin Rodgers
2010-07-29 11:59       ` Tim Visher
2010-07-31  3:41     ` filebat Mark
2010-07-31  7:30       ` Wang Lei [this message]
2010-07-31  9:40         ` filebat Mark
     [not found] <mailman.2.1280245551.14022.help-gnu-emacs@gnu.org>
2010-07-27 17:02 ` Ilya Zakharevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=QKv+cw+_ySvaxGei5Q7GiAjSbHcmfopW_7b5r@mail.gmail.com' \
    --to=f3d27b@gmail.com \
    --cc=filebat.mark@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.