* Postfixing ' emacs' to all frame titles.
@ 2010-07-27 15:45 Tim Visher
2010-07-28 13:14 ` Kevin Rodgers
0 siblings, 1 reply; 9+ messages in thread
From: Tim Visher @ 2010-07-27 15:45 UTC (permalink / raw)
To: emacs
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
Thanks in advance!
--
In Christ,
Timmy V.
http://blog.twonegatives.com/
http://five.sentenc.es/ - Spend less time on e-mail
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
[not found] <mailman.2.1280245551.14022.help-gnu-emacs@gnu.org>
@ 2010-07-27 17:02 ` Ilya Zakharevich
0 siblings, 0 replies; 9+ messages in thread
From: Ilya Zakharevich @ 2010-07-27 17:02 UTC (permalink / raw)
To: help-gnu-emacs
On 2010-07-27, Tim Visher <tim.visher@gmail.com> 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
I'm using
(setq need-app-name-in-title (not (eq window-system 'pm)))
(setq frame-title-format '((need-app-name-in-title "Emacs: " "")
;; contains "Emacs: " for special buffers
;; mode-line-buffer-identification
(buffer-file-name
;; "%f"
mode-line-buffer-identification
;;; (:eval (mode-line-replace-regexp-in-alist-with-prop
;;; buffer-file-name
;;; mode-line-abbreviation-alist
;;; (car mode-line-buffer-identification)))
"%b")))
(This may or may not be dependent on mode-line.el which provides
meaningful buffer names.)
Hope this helps,
Ilya
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
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
0 siblings, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2010-07-28 13:14 UTC (permalink / raw)
To: help-gnu-emacs
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")))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
2010-07-28 13:14 ` Kevin Rodgers
@ 2010-07-28 13:23 ` Lennart Borgman
2010-07-29 7:13 ` Kevin Rodgers
2010-07-31 3:41 ` filebat Mark
0 siblings, 2 replies; 9+ messages in thread
From: Lennart Borgman @ 2010-07-28 13:23 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
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
1 sibling, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2010-07-29 7:13 UTC (permalink / raw)
To: help-gnu-emacs
Lennart Borgman wrote:
> On Wed, Jul 28, 2010 at 3:14 PM, Kevin Rodgers
> <kevin.d.rodgers@gmail.com> wrote:
>> 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?
I am stuck on Microsoft Windows at work, and there I expect (just like
a different proprietary platform I use at home):
* to know which version of Emacs is actually running (emacs-version);
* to know whether it is running on my local desktop or a remote server
e.g. via RDP or Xming (system-name);
* to know whether the buffer is visiting a file or not; and if so,
what the full path is to a file (%f); otherwise, what Emacs has
named it (%b).
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
2010-07-29 7:13 ` Kevin Rodgers
@ 2010-07-29 11:59 ` Tim Visher
0 siblings, 0 replies; 9+ messages in thread
From: Tim Visher @ 2010-07-29 11:59 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
Thanks everyone. Exactly what I was looking for.
On Thu, Jul 29, 2010 at 3:13 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> Lennart Borgman wrote:
>>
>> On Wed, Jul 28, 2010 at 3:14 PM, Kevin Rodgers
>> <kevin.d.rodgers@gmail.com> wrote:
>>>
>>> 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?
>
> I am stuck on Microsoft Windows at work, and there I expect (just like
> a different proprietary platform I use at home):
>
> * to know which version of Emacs is actually running (emacs-version);
>
> * to know whether it is running on my local desktop or a remote server
> e.g. via RDP or Xming (system-name);
>
> * to know whether the buffer is visiting a file or not; and if so,
> what the full path is to a file (%f); otherwise, what Emacs has
> named it (%b).
>
> --
> Kevin Rodgers
> Denver, Colorado, USA
>
>
>
--
In Christ,
Timmy V.
http://blog.twonegatives.com/
http://five.sentenc.es/ - Spend less time on e-mail
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
2010-07-28 13:23 ` Lennart Borgman
2010-07-29 7:13 ` Kevin Rodgers
@ 2010-07-31 3:41 ` filebat Mark
2010-07-31 7:30 ` Wang Lei
1 sibling, 1 reply; 9+ messages in thread
From: filebat Mark @ 2010-07-31 3:41 UTC (permalink / raw)
To: Lennart Borgman; +Cc: help-gnu-emacs, Kevin Rodgers
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
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
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
[-- Attachment #2: Type: text/html, Size: 1938 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
2010-07-31 3:41 ` filebat Mark
@ 2010-07-31 7:30 ` Wang Lei
2010-07-31 9:40 ` filebat Mark
0 siblings, 1 reply; 9+ messages in thread
From: Wang Lei @ 2010-07-31 7:30 UTC (permalink / raw)
To: filebat Mark; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Postfixing ' emacs' to all frame titles.
2010-07-31 7:30 ` Wang Lei
@ 2010-07-31 9:40 ` filebat Mark
0 siblings, 0 replies; 9+ messages in thread
From: filebat Mark @ 2010-07-31 9:40 UTC (permalink / raw)
To: Wang Lei; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 3147 bytes --]
Thanks, Lei, your code works. And I has extended it to a lisp codesnnipet,
which is exactly what I want.
I post it here, in case others need it.
Notice: There is an enhancement here, which is replacing setq with local
variables.
I tried to do this, but has failed, due to my poor lisp.
Since this is a minor issue for me, so I keep lazy here. ^-^
;; -------------------------- separator --------------------------
(setq frame-title-format
'(:eval (concat "Ask 5 why, Denny! -- " (buffer-name) " -- "
(progn
(if buffer-file-name
(setq buffer_name_str buffer-file-name)
(setq buffer_name_str ""))
(if (< (length buffer_name_str) 50)
buffer_name_str
(concat (substring buffer_name_str 0 20) "..."
(substring buffer_name_str
(- (length buffer_name_str) 30)
(length buffer_name_str))
))))))
;; -------------------------- separator --------------------------
Regards,
Denny
On Sat, Jul 31, 2010 at 3:30 PM, Wang Lei <f3d27b@gmail.com> wrote:
> 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
>
--
Thanks & Regards
Denny Zhang
[-- Attachment #2: Type: text/html, Size: 4580 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-07-31 9:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).