emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-clock mode-line format configuration
@ 2010-01-26 10:00 Kiwon Um
  2010-01-26 13:07 ` Manish
  2010-01-26 22:02 ` Carsten Dominik
  0 siblings, 2 replies; 10+ messages in thread
From: Kiwon Um @ 2010-01-26 10:00 UTC (permalink / raw)
  To: emacs-orgmode

Dear orgmode dev team:

When the clock is started on an item, the item is shown on the mode
line. But the string on the mode line just shows the raw string of the
item, so sometimes it looks ugly when it contains a link.

So I suggest to make it customizable, or to vanish the link string, e.g.
using
 (replace-regexp-in-string "\\[\\[.*\\]\\[\\(.*\\)\\]\\]" "\\1" str)

Sincerely,

Kiwon Um

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-26 10:00 org-clock mode-line format configuration Kiwon Um
@ 2010-01-26 13:07 ` Manish
  2010-01-26 22:02 ` Carsten Dominik
  1 sibling, 0 replies; 10+ messages in thread
From: Manish @ 2010-01-26 13:07 UTC (permalink / raw)
  To: Kiwon Um; +Cc: emacs-orgmode

+1

On Tue, Jan 26, 2010 at 3:30 PM, Kiwon Um wrote:
> Dear orgmode dev team:
>
> When the clock is started on an item, the item is shown on the mode
> line. But the string on the mode line just shows the raw string of the
> item, so sometimes it looks ugly when it contains a link.
>
> So I suggest to make it customizable, or to vanish the link string, e.g.
> using
>  (replace-regexp-in-string "\\[\\[.*\\]\\[\\(.*\\)\\]\\]" "\\1" str)
>
> Sincerely,
>
> Kiwon Um
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-26 10:00 org-clock mode-line format configuration Kiwon Um
  2010-01-26 13:07 ` Manish
@ 2010-01-26 22:02 ` Carsten Dominik
  2010-01-27  9:25   ` Kiwon Um
  1 sibling, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2010-01-26 22:02 UTC (permalink / raw)
  To: Kiwon Um; +Cc: emacs-orgmode


On Jan 26, 2010, at 11:00 AM, Kiwon Um wrote:

> Dear orgmode dev team:
>
> When the clock is started on an item, the item is shown on the mode
> line. But the string on the mode line just shows the raw string of the
> item, so sometimes it looks ugly when it contains a link.
>
> So I suggest to make it customizable,

It is customizable, see the variable org-clock-heading-function

> or to vanish the link string, e.g.
> using
> (replace-regexp-in-string "\\[\\[.*\\]\\[\\(.*\\)\\]\\]" "\\1" str)

Yes, that makes sense, I have added this.  I have changed the "*" parts
to non-greedy though, in case there are several links in the line.

- Carsten

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-26 22:02 ` Carsten Dominik
@ 2010-01-27  9:25   ` Kiwon Um
  2010-01-27 12:59     ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: Kiwon Um @ 2010-01-27  9:25 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Jan 26, 2010, at 11:00 AM, Kiwon Um wrote:
>
>> Dear orgmode dev team:
>>
>> When the clock is started on an item, the item is shown on the mode
>> line. But the string on the mode line just shows the raw string of the
>> item, so sometimes it looks ugly when it contains a link.
>>
>> So I suggest to make it customizable,
>
> It is customizable, see the variable org-clock-heading-function
>

Would you please show me the function defun doing what I want?  I have
no idea to how to build org-clock-heading.

>> or to vanish the link string, e.g.
>> using
>> (replace-regexp-in-string "\\[\\[.*\\]\\[\\(.*\\)\\]\\]" "\\1" str)
>
> Yes, that makes sense, I have added this.  I have changed the "*" parts
> to non-greedy though, in case there are several links in the line.
>

Cool. I missed that.
(replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" s))

Kiwon Um

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27  9:25   ` Kiwon Um
@ 2010-01-27 12:59     ` Carsten Dominik
  2010-01-27 13:12       ` Kiwon Um
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2010-01-27 12:59 UTC (permalink / raw)
  To: Kiwon Um; +Cc: emacs-orgmode


On Jan 27, 2010, at 10:25 AM, Kiwon Um wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Jan 26, 2010, at 11:00 AM, Kiwon Um wrote:
>>
>>> Dear orgmode dev team:
>>>
>>> When the clock is started on an item, the item is shown on the mode
>>> line. But the string on the mode line just shows the raw string of  
>>> the
>>> item, so sometimes it looks ugly when it contains a link.
>>>
>>> So I suggest to make it customizable,
>>
>> It is customizable, see the variable org-clock-heading-function
>>
>
> Would you please show me the function defun doing what I want?  I have
> no idea to how to build org-clock-heading.

Untested:

(setq org-clock-heading-function
       (lambda ()
	(replace-regexp-in-string
	 "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
	 (nth 4 org-heading-components))))

>
>>> or to vanish the link string, e.g.
>>> using
>>> (replace-regexp-in-string "\\[\\[.*\\]\\[\\(.*\\)\\]\\]" "\\1" str)
>>
>> Yes, that makes sense, I have added this.  I have changed the "*"  
>> parts
>> to non-greedy though, in case there are several links in the line.
>>
>
> Cool. I missed that.
> (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" s))
>
> Kiwon Um

- Carsten

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27 12:59     ` Carsten Dominik
@ 2010-01-27 13:12       ` Kiwon Um
  2010-01-27 13:22         ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: Kiwon Um @ 2010-01-27 13:12 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Jan 27, 2010, at 10:25 AM, Kiwon Um wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> On Jan 26, 2010, at 11:00 AM, Kiwon Um wrote:
>>>
>>>> Dear orgmode dev team:
>>>>
>>>> When the clock is started on an item, the item is shown on the mode
>>>> line. But the string on the mode line just shows the raw string of
>>>> the
>>>> item, so sometimes it looks ugly when it contains a link.
>>>>
>>>> So I suggest to make it customizable,
>>>
>>> It is customizable, see the variable org-clock-heading-function
>>>
>>
>> Would you please show me the function defun doing what I want?  I have
>> no idea to how to build org-clock-heading.
>
> Untested:
>
> (setq org-clock-heading-function
>       (lambda ()
> 	(replace-regexp-in-string
> 	 "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
> 	 (nth 4 org-heading-components))))
>

This code doesn't work. According to the documentation for the variable
org-clock-heading-function, the result should be org-clock-heading, not
a string.

Kiwon Um

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27 13:12       ` Kiwon Um
@ 2010-01-27 13:22         ` Carsten Dominik
  2010-01-27 13:33           ` Kiwon Um
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2010-01-27 13:22 UTC (permalink / raw)
  To: Kiwon Um; +Cc: emacs-orgmode

Hi Um,

not, the result value has to be a string.

- Carsten

On Jan 27, 2010, at 2:12 PM, Kiwon Um wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Jan 27, 2010, at 10:25 AM, Kiwon Um wrote:
>>
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>
>>>> On Jan 26, 2010, at 11:00 AM, Kiwon Um wrote:
>>>>
>>>>> Dear orgmode dev team:
>>>>>
>>>>> When the clock is started on an item, the item is shown on the  
>>>>> mode
>>>>> line. But the string on the mode line just shows the raw string of
>>>>> the
>>>>> item, so sometimes it looks ugly when it contains a link.
>>>>>
>>>>> So I suggest to make it customizable,
>>>>
>>>> It is customizable, see the variable org-clock-heading-function
>>>>
>>>
>>> Would you please show me the function defun doing what I want?  I  
>>> have
>>> no idea to how to build org-clock-heading.
>>
>> Untested:
>>
>> (setq org-clock-heading-function
>>      (lambda ()
>> 	(replace-regexp-in-string
>> 	 "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
>> 	 (nth 4 org-heading-components))))
>>
>
> This code doesn't work. According to the documentation for the  
> variable
> org-clock-heading-function, the result should be org-clock-heading,  
> not
> a string.
>
> Kiwon Um

- Carsten

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27 13:22         ` Carsten Dominik
@ 2010-01-27 13:33           ` Kiwon Um
  2010-01-27 13:39             ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: Kiwon Um @ 2010-01-27 13:33 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> Hi Um,
>
> not, the result value has to be a string.
>

Hi Carsten, hmmm... If you are right, it's an easy problem as long as
I'm able to know the variable name containing the string for the mode
line at the moment, isn't it?

Kiwon Um

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27 13:33           ` Kiwon Um
@ 2010-01-27 13:39             ` Carsten Dominik
  2010-01-27 14:23               ` Kiwon Um
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2010-01-27 13:39 UTC (permalink / raw)
  To: Kiwon Um; +Cc: emacs-orgmode


On Jan 27, 2010, at 2:33 PM, Kiwon Um wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> Hi Um,
>>
>> not, the result value has to be a string.
>>
>
> Hi Carsten, hmmm... If you are right, it's an easy problem as long as
> I'm able to know the variable name containing the string for the mode
> line at the moment, isn't it?

No, you are misunderstanding.

the variable org-clock-heading-function hast to be set to a function.
A form starting with `lambda' is a function.

The function needs to return a string, and that string will  
automatically end up
in the variable `org-clock-heading', which is then used to create the  
string
in the mode line.

Clearer now?

I had a typo in the function:

(setq org-clock-heading-function
      (lambda ()
	(replace-regexp-in-string
	 "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
	 (nth 4 (org-heading-components)))))

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: org-clock mode-line format configuration
  2010-01-27 13:39             ` Carsten Dominik
@ 2010-01-27 14:23               ` Kiwon Um
  0 siblings, 0 replies; 10+ messages in thread
From: Kiwon Um @ 2010-01-27 14:23 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

2010/1/27 Carsten Dominik <carsten.dominik@gmail.com>:
>
> On Jan 27, 2010, at 2:33 PM, Kiwon Um wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> Hi Um,
>>>
>>> not, the result value has to be a string.
>>>
>>
>> Hi Carsten, hmmm... If you are right, it's an easy problem as long as
>> I'm able to know the variable name containing the string for the mode
>> line at the moment, isn't it?
>
> No, you are misunderstanding.
>
> the variable org-clock-heading-function hast to be set to a function.
> A form starting with `lambda' is a function.
>
> The function needs to return a string, and that string will automatically
> end up
> in the variable `org-clock-heading', which is then used to create the string
> in the mode line.
>
> Clearer now?
>
> I had a typo in the function:
>
> (setq org-clock-heading-function
>     (lambda ()
>        (replace-regexp-in-string
>         "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
>         (nth 4 (org-heading-components)))))
>

Cool! Now it's clear.
Really thanks for your kind replies. :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-27 14:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-26 10:00 org-clock mode-line format configuration Kiwon Um
2010-01-26 13:07 ` Manish
2010-01-26 22:02 ` Carsten Dominik
2010-01-27  9:25   ` Kiwon Um
2010-01-27 12:59     ` Carsten Dominik
2010-01-27 13:12       ` Kiwon Um
2010-01-27 13:22         ` Carsten Dominik
2010-01-27 13:33           ` Kiwon Um
2010-01-27 13:39             ` Carsten Dominik
2010-01-27 14:23               ` Kiwon Um

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).