From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: How to only show org-timer indicator on active mode-line not all mode-lines? Date: Wed, 17 Aug 2016 19:40:01 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113c990cd0fb8c053a42ee4e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZzD2-0001po-HP for emacs-orgmode@gnu.org; Wed, 17 Aug 2016 07:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZzD0-0003uK-BO for emacs-orgmode@gnu.org; Wed, 17 Aug 2016 07:40:35 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZzD0-0003u0-0X for emacs-orgmode@gnu.org; Wed, 17 Aug 2016 07:40:34 -0400 Received: by mail-wm0-x235.google.com with SMTP id o80so226658974wme.1 for ; Wed, 17 Aug 2016 04:40:33 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org-mode --001a113c990cd0fb8c053a42ee4e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I setup org-timer indicator in mode-line with this. (setq-default mode-line-format (quote ( ;; org-timer (:eval (unless (not org-timer-countdown-timer) (propertize (let* ((rtime (decode-time (time-subtract (timer--time org-timer-countdown-timer) (current-time)))) (rmins (nth 1 rtime)) (rsecs (nth 0 rtime))) (format "=F0=9F=95=94 %d:%d" rmins rsecs)) 'face '(:foreground "cyan" :weight bold) 'help-echo "org-timer"))) ))) I hope this org-time indicator only show in active mode-line instead of all mode-lines. I hope to find a general way which can add any extra indicator not just org-timer. I can just put my upper code without too much modification into that general way. I also posted a post on Emacs.SE https://emacs.stackexchange.com/questions/26222/how-to-only-show-thing-in-a= ctive-mode-line-instead-of-all-mode-lines How to do it? [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --001a113c990cd0fb8c053a42ee4e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I setup org-timer indicator in mode-line with this.

(setq-default
=C2=A0mode-line-format
=C2=A0(quote
= =C2=A0 (
=C2=A0 =C2=A0;; org-timer=
=C2=A0 =C2=A0(:eval
<= /div>
=C2=A0 =C2=A0 (unless (not org-timer-countdow= n-timer)
=C2=A0 =C2=A0 =C2=A0 (pro= pertize (let* ((rtime (decode-time
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(time-subtract
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (time= r--time org-timer-countdown-timer)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (current-time))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(rmins (nth 1 rtime))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(rsecs (nth 0 rtime)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "=F0=9F=95=94 %d:%d" rmin= s rsecs))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'face '(:foreground "cy= an" :weight bold)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'help-echo "o= rg-timer")))

=C2=A0 =C2=A0)))


I hope this org-time indicator only show in a= ctive mode-line instead of all mode-lines.

I hope to find = a general way which can add any extra indicator not just org-timer. I can j= ust put my upper code without too much modification into that general way.<= br>


How to do it?

<= div dir=3D"ltr">
[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key finge= rprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog:= http://stardiv= iner.github.io/
--001a113c990cd0fb8c053a42ee4e--