From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-clock mode-line format configuration Date: Wed, 27 Jan 2010 14:39:21 +0100 Message-ID: References: <9599D4D8-9556-4676-9754-82EA3FEF9E01@gmail.com> <48AC00D2-F7E0-47AE-8384-B4A59C63C9CE@gmail.com> <8D7DA60E-87DD-4816-8C21-542A534EF8EE@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Na87J-00074R-Ln for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 08:39:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Na87E-00072r-7K for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 08:39:32 -0500 Received: from [199.232.76.173] (port=36008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na87E-00072l-3O for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 08:39:28 -0500 Received: from mail-fx0-f216.google.com ([209.85.220.216]:42010) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Na87D-0002B9-Hn for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 08:39:27 -0500 Received: by fxm8 with SMTP id 8so4924319fxm.26 for ; Wed, 27 Jan 2010 05:39:26 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Kiwon Um Cc: emacs-orgmode@gnu.org On Jan 27, 2010, at 2:33 PM, Kiwon Um wrote: > Carsten Dominik 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)))))