* [PATCH] Option for clock and timer to be displayed in frame-title
@ 2012-02-28 21:44 g.kettleborough
2012-02-28 22:51 ` Bernt Hansen
2012-04-23 13:12 ` Bastien
0 siblings, 2 replies; 11+ messages in thread
From: g.kettleborough @ 2012-02-28 21:44 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 484 bytes --]
Attached is a patch that gives the option to show the clock and timer
information in the frame title as well as the mode line (or both or
neither). I find this useful as there is often not enough room in the
mode line but there is enough in the frame title.
I am in the process of assigning my copyright to the FSF for this and
hopefully future org-mode contributions. I submit the patch now and
request comments as this is my first contribution to the project.
Thanks,
George.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch --]
[-- Type: text/x-diff, Size: 7625 bytes --]
From 3e29d48fb34e51a81544b1734dd75207c943d567 Mon Sep 17 00:00:00 2001
From: George Kettleborough <g.kettleborough@member.fsf.org>
Date: Tue, 28 Feb 2012 00:51:10 +0000
Subject: [PATCH] Option for clock and timer to be displayed in frame-title
---
lisp/org-clock.el | 43 +++++++++++++++++++++++++++++++++++--------
lisp/org-timer.el | 43 +++++++++++++++++++++++++++++++++++--------
2 files changed, 70 insertions(+), 16 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9206608..1a800b6 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -323,6 +323,15 @@ play with them."
:version "24.1"
:type 'boolean)
+(defcustom org-clock-clocked-in-display 'mode-line
+ "Where should the clocked in status be displayed."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
This hook is run before anything happens to the task that
@@ -1170,18 +1179,28 @@ the clocking selection, associated with the letter `d'."
(save-excursion (org-back-to-heading t) (point))
(buffer-base-buffer))
(setq org-clock-has-been-used t)
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-mode-line-string))))
+ ;; add to mode line
+ (when (or (eq org-clock-clocked-in-display 'mode-line)
+ (eq org-clock-clocked-in-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-mode-line-string)))))
+ ;; add to frame title
+ (when (or (eq org-clock-clocked-in-display 'frame-title)
+ (eq org-clock-clocked-in-display 'both))
+ (or (memq 'org-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(" " org-mode-line-string)))))
(org-clock-update-mode-line)
(when org-clock-mode-line-timer
(cancel-timer org-clock-mode-line-timer)
(setq org-clock-mode-line-timer nil))
- (setq org-clock-mode-line-timer
- (run-with-timer org-clock-update-period
- org-clock-update-period
- 'org-clock-update-mode-line))
+ (when org-clock-clocked-in-display
+ (setq org-clock-mode-line-timer
+ (run-with-timer org-clock-update-period
+ org-clock-update-period
+ 'org-clock-update-mode-line)))
(when org-clock-idle-timer
(cancel-timer org-clock-idle-timer)
(setq org-clock-idle-timer nil))
@@ -1329,6 +1348,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(when (not (org-clocking-p))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-mode-line-string frame-title-format))
(force-mode-line-update)
(if fail-quietly (throw 'exit t) (error "No active clock")))
(let (ts te s h m remove)
@@ -1373,6 +1394,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(setq org-clock-idle-timer nil))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-mode-line-string frame-title-format))
(when org-clock-out-switch-to-state
(save-excursion
(org-back-to-heading t)
@@ -1472,6 +1495,8 @@ UPDOWN tells whether to change 'up or 'down."
(when (not (org-clocking-p))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-mode-line-string frame-title-format))
(force-mode-line-update)
(error "No active clock"))
(save-excursion ; Do not replace this with `with-current-buffer'.
@@ -1484,6 +1509,8 @@ UPDOWN tells whether to change 'up or 'down."
(move-marker org-clock-hd-marker nil)
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-mode-line-string frame-title-format))
(force-mode-line-update)
(message "Clock canceled")
(run-hooks 'org-clock-cancel-hook))
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index a3bde0f..b39d362 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -56,6 +56,15 @@ When 0, the user is prompted for a value."
:version "24.1"
:type 'number)
+(defcustom org-timer-display 'mode-line
+ "Where to display timer."
+ :group 'org-time
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
(defvar org-timer-start-hook nil
"Hook run after relative timer is started.")
@@ -270,10 +279,17 @@ If the integer is negative, the string will start with \"-\"."
(defun org-timer-set-mode-line (value)
"Set the mode-line display of the relative timer.
VALUE can be `on', `off', or `pause'."
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-timer-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-timer-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
(cond
((equal value 'off)
(when org-timer-mode-line-timer
@@ -281,21 +297,32 @@ VALUE can be `on', `off', or `pause'."
(setq org-timer-mode-line-timer nil))
(setq global-mode-string
(delq 'org-timer-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-timer-mode-line-string frame-title-format))
(force-mode-line-update))
((equal value 'pause)
(when org-timer-mode-line-timer
(cancel-timer org-timer-mode-line-timer)
(setq org-timer-mode-line-timer nil)))
((equal value 'on)
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
(or global-mode-string (setq global-mode-string '("")))
(or (memq 'org-timer-mode-line-string global-mode-string)
(setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
(org-timer-update-mode-line)
(when org-timer-mode-line-timer
- (cancel-timer org-timer-mode-line-timer))
- (setq org-timer-mode-line-timer
- (run-with-timer 1 1 'org-timer-update-mode-line)))))
+ (cancel-timer org-timer-mode-line-timer)
+ (setq org-timer-mode-line-timer nil))
+ (when org-timer-display
+ (setq org-timer-mode-line-timer
+ (run-with-timer 1 1 'org-timer-update-mode-line))))))
(defun org-timer-update-mode-line ()
"Update the timer time in the mode line."
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-02-28 21:44 [PATCH] Option for clock and timer to be displayed in frame-title g.kettleborough
@ 2012-02-28 22:51 ` Bernt Hansen
2012-02-29 17:26 ` George Kettleborough
2012-04-23 13:12 ` Bastien
1 sibling, 1 reply; 11+ messages in thread
From: Bernt Hansen @ 2012-02-28 22:51 UTC (permalink / raw)
To: g.kettleborough; +Cc: emacs-orgmode
g.kettleborough@uea.ac.uk writes:
> Attached is a patch that gives the option to show the clock and timer
> information in the frame title as well as the mode line (or both or
> neither). I find this useful as there is often not enough room in the
> mode line but there is enough in the frame title.
>
> I am in the process of assigning my copyright to the FSF for this and
> hopefully future org-mode contributions. I submit the patch now and
> request comments as this is my first contribution to the project.
Hi George!
Thanks for the patch!
First comment :)
This patch needs a changelog entry in the commit text and a long
description would also be appreciated. The long description allows us
to see the purpose of the patch and how to use it without the necessity
to read and parse any of the code changes.
Thanks and Regards,
Bernt
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-02-28 22:51 ` Bernt Hansen
@ 2012-02-29 17:26 ` George Kettleborough
2012-03-01 1:43 ` Bernt Hansen
0 siblings, 1 reply; 11+ messages in thread
From: George Kettleborough @ 2012-02-29 17:26 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
On Tue, Feb 28 2012, Bernt Hansen wrote:
> This patch needs a changelog entry in the commit text and a long
> description would also be appreciated. The long description allows us
> to see the purpose of the patch and how to use it without the necessity
> to read and parse any of the code changes.
Ok, I've done a changelog entry. I hope this is what is expected.
(Also fixed a minor bug in original patch and added better documentation
to the new custom variable).
The patch adds options to both org-clock and org-timer regarding how the
current clock/timer is displayed. Currently they are both displayed in
the mode line. This is not ideal since if you split your window
horizontally then the mode line becomes quite short so often the clock
is truncated and the timer might not even be visible.
The new options control whether the clock/timer is displayed in the mode
line and/or frame title. The frame title is usually wasted space for
people running a graphical version of emacs so it is quite useful there
I think.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch --]
[-- Type: text/x-diff, Size: 9062 bytes --]
From 23b45a824a6118a6aa51ae1ad734747b54ee2f08 Mon Sep 17 00:00:00 2001
From: George Kettleborough <g.kettleborough@member.fsf.org>
Date: Wed, 29 Feb 2012 17:04:22 +0000
Subject: [PATCH] Option for clock and timer to be displayed in frame-title
* lisp/org-clock.el: Add variable org-clock-clocked-in-display which controls
whether the current clock is displayed in the mode line and/or frame title.
* lisp/org-timer.el: Add variable org-timer-display which controls whether the
current timer is displayed in the mode line and/or frame title.
This allows the clock and timer to be displayed in the frame title instead of,
or as well as, the mode line. This is useful for people with limited space in
the mode line but with ample space in the frame title.
---
lisp/org-clock.el | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
lisp/org-timer.el | 50 ++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 86 insertions(+), 16 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9206608..b5a9a1b 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -323,6 +323,22 @@ play with them."
:version "24.1"
:type 'boolean)
+(defcustom org-clock-clocked-in-display 'mode-line
+ "When clocked in for a task, org-mode can display the current
+task and accumulated time in the mode line and/or frame title.
+Allowed values are:
+
+both displays in both mode line and frame title
+mode-line displays only in mode line (default)
+frame-title displays only in frame title
+nil current clock is not displayed"
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
This hook is run before anything happens to the task that
@@ -345,6 +361,8 @@ to add an effort property.")
(defvar org-mode-line-string "")
(put 'org-mode-line-string 'risky-local-variable t)
+(defvar org-frame-title-string '(" " org-mode-line-string))
+
(defvar org-clock-mode-line-timer nil)
(defvar org-clock-idle-timer nil)
(defvar org-clock-heading) ; defined in org.el
@@ -1170,18 +1188,28 @@ the clocking selection, associated with the letter `d'."
(save-excursion (org-back-to-heading t) (point))
(buffer-base-buffer))
(setq org-clock-has-been-used t)
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-mode-line-string))))
+ ;; add to mode line
+ (when (or (eq org-clock-clocked-in-display 'mode-line)
+ (eq org-clock-clocked-in-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-mode-line-string)))))
+ ;; add to frame title
+ (when (or (eq org-clock-clocked-in-display 'frame-title)
+ (eq org-clock-clocked-in-display 'both))
+ (or (memq 'org-frame-title-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-frame-title-string)))))
(org-clock-update-mode-line)
(when org-clock-mode-line-timer
(cancel-timer org-clock-mode-line-timer)
(setq org-clock-mode-line-timer nil))
- (setq org-clock-mode-line-timer
- (run-with-timer org-clock-update-period
- org-clock-update-period
- 'org-clock-update-mode-line))
+ (when org-clock-clocked-in-display
+ (setq org-clock-mode-line-timer
+ (run-with-timer org-clock-update-period
+ org-clock-update-period
+ 'org-clock-update-mode-line)))
(when org-clock-idle-timer
(cancel-timer org-clock-idle-timer)
(setq org-clock-idle-timer nil))
@@ -1329,6 +1357,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(when (not (org-clocking-p))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-frame-title-string frame-title-format))
(force-mode-line-update)
(if fail-quietly (throw 'exit t) (error "No active clock")))
(let (ts te s h m remove)
@@ -1373,6 +1403,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(setq org-clock-idle-timer nil))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-frame-title-string frame-title-format))
(when org-clock-out-switch-to-state
(save-excursion
(org-back-to-heading t)
@@ -1472,6 +1504,8 @@ UPDOWN tells whether to change 'up or 'down."
(when (not (org-clocking-p))
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-frame-title-string frame-title-format))
(force-mode-line-update)
(error "No active clock"))
(save-excursion ; Do not replace this with `with-current-buffer'.
@@ -1484,6 +1518,8 @@ UPDOWN tells whether to change 'up or 'down."
(move-marker org-clock-hd-marker nil)
(setq global-mode-string
(delq 'org-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-frame-title-string frame-title-format))
(force-mode-line-update)
(message "Clock canceled")
(run-hooks 'org-clock-cancel-hook))
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index a3bde0f..0734c11 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -56,6 +56,22 @@ When 0, the user is prompted for a value."
:version "24.1"
:type 'number)
+(defcustom org-timer-display 'mode-line
+ "When a timer is running, org-mode can display it in the mode
+line and/or frame title.
+Allowed values are:
+
+both displays in both mode line and frame title
+mode-line displays only in mode line (default)
+frame-title displays only in frame title
+nil current timer is not displayed"
+ :group 'org-time
+ :type '(choice
+ (const :tag "Mode line" mode-line)
+ (const :tag "Frame title" frame-title)
+ (const :tag "Both" both)
+ (const :tag "None" nil)))
+
(defvar org-timer-start-hook nil
"Hook run after relative timer is started.")
@@ -270,10 +286,17 @@ If the integer is negative, the string will start with \"-\"."
(defun org-timer-set-mode-line (value)
"Set the mode-line display of the relative timer.
VALUE can be `on', `off', or `pause'."
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-timer-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
+ (or global-mode-string (setq global-mode-string '("")))
+ (or (memq 'org-timer-mode-line-string global-mode-string)
+ (setq global-mode-string
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
(cond
((equal value 'off)
(when org-timer-mode-line-timer
@@ -281,21 +304,32 @@ VALUE can be `on', `off', or `pause'."
(setq org-timer-mode-line-timer nil))
(setq global-mode-string
(delq 'org-timer-mode-line-string global-mode-string))
+ (setq frame-title-format
+ (delq 'org-timer-mode-line-string frame-title-format))
(force-mode-line-update))
((equal value 'pause)
(when org-timer-mode-line-timer
(cancel-timer org-timer-mode-line-timer)
(setq org-timer-mode-line-timer nil)))
((equal value 'on)
+ (when (or (eq org-timer-display 'mode-line)
+ (eq org-timer-display 'both))
(or global-mode-string (setq global-mode-string '("")))
(or (memq 'org-timer-mode-line-string global-mode-string)
(setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
+ (append global-mode-string '(org-timer-mode-line-string)))))
+ (when (or (eq org-timer-display 'frame-title)
+ (eq org-timer-display 'both))
+ (or (memq 'org-timer-mode-line-string frame-title-format)
+ (setq frame-title-format
+ (append frame-title-format '(org-timer-mode-line-string)))))
(org-timer-update-mode-line)
(when org-timer-mode-line-timer
- (cancel-timer org-timer-mode-line-timer))
- (setq org-timer-mode-line-timer
- (run-with-timer 1 1 'org-timer-update-mode-line)))))
+ (cancel-timer org-timer-mode-line-timer)
+ (setq org-timer-mode-line-timer nil))
+ (when org-timer-display
+ (setq org-timer-mode-line-timer
+ (run-with-timer 1 1 'org-timer-update-mode-line))))))
(defun org-timer-update-mode-line ()
"Update the timer time in the mode line."
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-02-29 17:26 ` George Kettleborough
@ 2012-03-01 1:43 ` Bernt Hansen
2012-03-06 17:35 ` Bernt Hansen
0 siblings, 1 reply; 11+ messages in thread
From: Bernt Hansen @ 2012-03-01 1:43 UTC (permalink / raw)
To: George Kettleborough; +Cc: emacs-orgmode@gnu.org
George Kettleborough <g.kettleborough@uea.ac.uk> writes:
> On Tue, Feb 28 2012, Bernt Hansen wrote:
>> This patch needs a changelog entry in the commit text and a long
>> description would also be appreciated. The long description allows us
>> to see the purpose of the patch and how to use it without the necessity
>> to read and parse any of the code changes.
>
> Ok, I've done a changelog entry. I hope this is what is expected.
> (Also fixed a minor bug in original patch and added better documentation
> to the new custom variable).
>
> The patch adds options to both org-clock and org-timer regarding how the
> current clock/timer is displayed. Currently they are both displayed in
> the mode line. This is not ideal since if you split your window
> horizontally then the mode line becomes quite short so often the clock
> is truncated and the timer might not even be visible.
>
> The new options control whether the clock/timer is displayed in the mode
> line and/or frame title. The frame title is usually wasted space for
> people running a graphical version of emacs so it is quite useful there
> I think.
Thanks! I use frames on Windows at work and no frames on Linux (in
xmonad) at home. I tend to run with emacs full screen so I haven't
my modeline is long enough for me -- but it will be interesting to see
how the frame title clock works.
Regards,
Bernt
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-01 1:43 ` Bernt Hansen
@ 2012-03-06 17:35 ` Bernt Hansen
2012-03-06 17:43 ` Bernt Hansen
2012-03-06 18:00 ` George Kettleborough
0 siblings, 2 replies; 11+ messages in thread
From: Bernt Hansen @ 2012-03-06 17:35 UTC (permalink / raw)
To: George Kettleborough; +Cc: emacs-orgmode@gnu.org
Bernt Hansen <bernt@norang.ca> writes:
> George Kettleborough <g.kettleborough@uea.ac.uk> writes:
>
>> On Tue, Feb 28 2012, Bernt Hansen wrote:
>>> This patch needs a changelog entry in the commit text and a long
>>> description would also be appreciated. The long description allows us
>>> to see the purpose of the patch and how to use it without the necessity
>>> to read and parse any of the code changes.
>>
>> Ok, I've done a changelog entry. I hope this is what is expected.
>> (Also fixed a minor bug in original patch and added better documentation
>> to the new custom variable).
>>
>> The patch adds options to both org-clock and org-timer regarding how the
>> current clock/timer is displayed. Currently they are both displayed in
>> the mode line. This is not ideal since if you split your window
>> horizontally then the mode line becomes quite short so often the clock
>> is truncated and the timer might not even be visible.
>>
>> The new options control whether the clock/timer is displayed in the mode
>> line and/or frame title. The frame title is usually wasted space for
>> people running a graphical version of emacs so it is quite useful there
>> I think.
>
> Thanks! I use frames on Windows at work and no frames on Linux (in
> xmonad) at home. I tend to run with emacs full screen so I haven't
> my modeline is long enough for me -- but it will be interesting to see
> how the frame title clock works.
Hi George,
I tried this patch at work and it hangs my Emacs session in Windows on
startup. It's totally unresponsive and I have to kill the process with
the task manager.
I think there's an implementation problem here but I don't have any
other useful information about what it might be.
Regards,
Bernt
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-06 17:35 ` Bernt Hansen
@ 2012-03-06 17:43 ` Bernt Hansen
2012-03-06 18:00 ` George Kettleborough
1 sibling, 0 replies; 11+ messages in thread
From: Bernt Hansen @ 2012-03-06 17:43 UTC (permalink / raw)
To: George Kettleborough; +Cc: emacs-orgmode@gnu.org
Bernt Hansen <bernt@norang.ca> writes:
> Bernt Hansen <bernt@norang.ca> writes:
>
>> George Kettleborough <g.kettleborough@uea.ac.uk> writes:
>>
>>> On Tue, Feb 28 2012, Bernt Hansen wrote:
>>>> This patch needs a changelog entry in the commit text and a long
>>>> description would also be appreciated. The long description allows us
>>>> to see the purpose of the patch and how to use it without the necessity
>>>> to read and parse any of the code changes.
>>>
>>> Ok, I've done a changelog entry. I hope this is what is expected.
>>> (Also fixed a minor bug in original patch and added better documentation
>>> to the new custom variable).
>>>
>>> The patch adds options to both org-clock and org-timer regarding how the
>>> current clock/timer is displayed. Currently they are both displayed in
>>> the mode line. This is not ideal since if you split your window
>>> horizontally then the mode line becomes quite short so often the clock
>>> is truncated and the timer might not even be visible.
>>>
>>> The new options control whether the clock/timer is displayed in the mode
>>> line and/or frame title. The frame title is usually wasted space for
>>> people running a graphical version of emacs so it is quite useful there
>>> I think.
>>
>> Thanks! I use frames on Windows at work and no frames on Linux (in
>> xmonad) at home. I tend to run with emacs full screen so I haven't
>> my modeline is long enough for me -- but it will be interesting to see
>> how the frame title clock works.
>
> Hi George,
>
> I tried this patch at work and it hangs my Emacs session in Windows on
> startup. It's totally unresponsive and I have to kill the process with
> the task manager.
>
> I think there's an implementation problem here but I don't have any
> other useful information about what it might be.
Nevermind... it seems to be working on Windows now. I'm not sure what
happened the first time. I'll report any other issues I find with this.
Thanks!
Regards,
Bernt
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-06 17:35 ` Bernt Hansen
2012-03-06 17:43 ` Bernt Hansen
@ 2012-03-06 18:00 ` George Kettleborough
2012-03-06 18:34 ` Jos'h Fuller
2012-03-06 19:59 ` Bernt Hansen
1 sibling, 2 replies; 11+ messages in thread
From: George Kettleborough @ 2012-03-06 18:00 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode@gnu.org
Hi Bernt,
On Tue, Mar 06 2012, Bernt Hansen wrote:
> I tried this patch at work and it hangs my Emacs session in Windows on
> startup. It's totally unresponsive and I have to kill the process with
> the task manager.
>
> I think there's an implementation problem here but I don't have any
> other useful information about what it might be.
Thanks for testing the patch. That's quite alarming and I have no idea
why this would happen. Can you change the frame title by doing (setq
frame-title-format ...) on Windows emacs normally? I don't currently
have any Windows boxen to test this on unfortunately.
Also, what emacs version are you running?
Thanks,
George.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-06 18:00 ` George Kettleborough
@ 2012-03-06 18:34 ` Jos'h Fuller
2012-03-06 18:48 ` Nick Dokos
2012-03-06 19:59 ` Bernt Hansen
1 sibling, 1 reply; 11+ messages in thread
From: Jos'h Fuller @ 2012-03-06 18:34 UTC (permalink / raw)
To: George Kettleborough, Bernt Hansen; +Cc: emacs-orgmode@gnu.org
Hi!
> Can you change the frame title by doing (setq
> frame-title-format ...) on Windows emacs normally?
Just to let you know, I am using Windows Emacs 23.2.1 (i386-mingw-nt5.2.3790)
I tried:
(setq-frame-title-format "This is a test.")
in the *scratch* window and got:
Debugger entered--Lisp error: (void-function setq-frame-title-format)
(setq-frame-title-format "This is a test.")
eval((setq-frame-title-format "This is a test."))
eval-last-sexp-1(t)
eval-last-sexp(t)
eval-print-last-sexp()
call-interactively(eval-print-last-sexp nil nil)
I'm a little behind the current Emacs, but not that much. However, I have noticed other frame and window manipulation functions that are available on UNIX, but not Windows.
Hope this helps!
_______________________________________________________________________________
Jos'h Fuller, Production Programmer
Arc Productions Ltd.
p: 416.682.5237 | f: 416.682.5209 | http://www.arcproductions.com
230 Richmond Street East | Toronto, ON M5A 1P4 |
> -----Original Message-----
> From: emacs-orgmode-bounces+jos'h.fuller=arcproductions.com@gnu.org
> [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions.com@gnu.org]
> On Behalf Of George Kettleborough
> Sent: Tuesday, March 06, 2012 1:01 PM
> To: Bernt Hansen
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] [PATCH] Option for clock and timer to be displayed in
> frame-title
>
> Hi Bernt,
>
> On Tue, Mar 06 2012, Bernt Hansen wrote:
> > I tried this patch at work and it hangs my Emacs session in Windows
> on
> > startup. It's totally unresponsive and I have to kill the process
> with
> > the task manager.
> >
> > I think there's an implementation problem here but I don't have any
> > other useful information about what it might be.
>
> Thanks for testing the patch. That's quite alarming and I have no idea
> why this would happen. Can you change the frame title by doing (setq
> frame-title-format ...) on Windows emacs normally? I don't currently
> have any Windows boxen to test this on unfortunately.
>
> Also, what emacs version are you running?
>
> Thanks,
>
> George.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-06 18:34 ` Jos'h Fuller
@ 2012-03-06 18:48 ` Nick Dokos
0 siblings, 0 replies; 11+ messages in thread
From: Nick Dokos @ 2012-03-06 18:48 UTC (permalink / raw)
To: Jos'h Fuller
Cc: George Kettleborough, Bernt Hansen, nicholas.dokos,
emacs-orgmode@gnu.org
Jos'h Fuller <Jos'h.Fuller@arcproductions.com> wrote:
> Hi!
>
> > Can you change the frame title by doing (setq
> > frame-title-format ...) on Windows emacs normally?
>
> Just to let you know, I am using Windows Emacs 23.2.1 (i386-mingw-nt5.2.3790)
>
> I tried:
>
> (setq-frame-title-format "This is a test.")
>
The correct invocation is
(setq frame-title-format "This is a test.")
frame-title-format is a variable.
Nick
> in the *scratch* window and got:
>
> Debugger entered--Lisp error: (void-function setq-frame-title-format)
> (setq-frame-title-format "This is a test.")
> eval((setq-frame-title-format "This is a test."))
> eval-last-sexp-1(t)
> eval-last-sexp(t)
> eval-print-last-sexp()
> call-interactively(eval-print-last-sexp nil nil)
>
> I'm a little behind the current Emacs, but not that much. However, I have noticed other frame and window manipulation functions that are available on UNIX, but not Windows.
>
> Hope this helps!
>
>
> _______________________________________________________________________________
>
> Jos'h Fuller, Production Programmer
>
> Arc Productions Ltd.
>
> p: 416.682.5237 | f: 416.682.5209 | http://www.arcproductions.com
> 230 Richmond Street East | Toronto, ON M5A 1P4 |
>
>
> > -----Original Message-----
> > From: emacs-orgmode-bounces+jos'h.fuller=arcproductions.com@gnu.org
> > [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions.com@gnu.org]
> > On Behalf Of George Kettleborough
> > Sent: Tuesday, March 06, 2012 1:01 PM
> > To: Bernt Hansen
> > Cc: emacs-orgmode@gnu.org
> > Subject: Re: [O] [PATCH] Option for clock and timer to be displayed in
> > frame-title
> >
> > Hi Bernt,
> >
> > On Tue, Mar 06 2012, Bernt Hansen wrote:
> > > I tried this patch at work and it hangs my Emacs session in Windows
> > on
> > > startup. It's totally unresponsive and I have to kill the process
> > with
> > > the task manager.
> > >
> > > I think there's an implementation problem here but I don't have any
> > > other useful information about what it might be.
> >
> > Thanks for testing the patch. That's quite alarming and I have no idea
> > why this would happen. Can you change the frame title by doing (setq
> > frame-title-format ...) on Windows emacs normally? I don't currently
> > have any Windows boxen to test this on unfortunately.
> >
> > Also, what emacs version are you running?
> >
> > Thanks,
> >
> > George.
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-03-06 18:00 ` George Kettleborough
2012-03-06 18:34 ` Jos'h Fuller
@ 2012-03-06 19:59 ` Bernt Hansen
1 sibling, 0 replies; 11+ messages in thread
From: Bernt Hansen @ 2012-03-06 19:59 UTC (permalink / raw)
To: George Kettleborough; +Cc: emacs-orgmode@gnu.org
George Kettleborough <g.kettleborough@uea.ac.uk> writes:
> Hi Bernt,
>
> On Tue, Mar 06 2012, Bernt Hansen wrote:
>> I tried this patch at work and it hangs my Emacs session in Windows on
>> startup. It's totally unresponsive and I have to kill the process with
>> the task manager.
>>
>> I think there's an implementation problem here but I don't have any
>> other useful information about what it might be.
>
> Thanks for testing the patch. That's quite alarming and I have no idea
> why this would happen. Can you change the frame title by doing (setq
> frame-title-format ...) on Windows emacs normally? I don't currently
> have any Windows boxen to test this on unfortunately.
>
> Also, what emacs version are you running?
Yes it was a bit alarming... but it seems to be working for now
GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO
I don't have frames on my Linux machine and I find the time in the title
hard to find since it's the same colour as the rest of the frame title.
I think I'll stick to the modeline for now. Most of my windows are
fullscreen so that works for me.
Regards,
Bernt
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Option for clock and timer to be displayed in frame-title
2012-02-28 21:44 [PATCH] Option for clock and timer to be displayed in frame-title g.kettleborough
2012-02-28 22:51 ` Bernt Hansen
@ 2012-04-23 13:12 ` Bastien
1 sibling, 0 replies; 11+ messages in thread
From: Bastien @ 2012-04-23 13:12 UTC (permalink / raw)
To: g.kettleborough; +Cc: emacs-orgmode
g.kettleborough@uea.ac.uk writes:
> Attached is a patch that gives the option to show the clock and timer
> information in the frame title as well as the mode line (or both or
> neither). I find this useful as there is often not enough room in the
> mode line but there is enough in the frame title.
This has been applied to master.
Please test and confirm it works as expected.
--
Bastien
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-04-23 13:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 21:44 [PATCH] Option for clock and timer to be displayed in frame-title g.kettleborough
2012-02-28 22:51 ` Bernt Hansen
2012-02-29 17:26 ` George Kettleborough
2012-03-01 1:43 ` Bernt Hansen
2012-03-06 17:35 ` Bernt Hansen
2012-03-06 17:43 ` Bernt Hansen
2012-03-06 18:00 ` George Kettleborough
2012-03-06 18:34 ` Jos'h Fuller
2012-03-06 18:48 ` Nick Dokos
2012-03-06 19:59 ` Bernt Hansen
2012-04-23 13:12 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).