Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Truncate the task name in emacs mode-line

Tags:

emacs

org-mode

While org-clock-in a task, the task name will be shown on the mode-line. But some of my task names are too long. Is there any function to truncate the display name in the mode line?

Thanks.

like image 404
James.Y Avatar asked Jan 25 '13 03:01

James.Y


1 Answers

You can tune this according to your taste:

(setq org-clock-heading-function
      (lambda ()
        (let ((str (nth 4 (org-heading-components))))
          (if (> (length str) 6)
              (substring str 0 6)))))
like image 55
artscan Avatar answered Oct 14 '22 09:10

artscan