emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: George Kettleborough <g.kettleborough@uea.ac.uk>
Cc: Matt Lundin <mdl@imapmail.org>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	Mike McLean <mike.mclean@pobox.com>
Subject: Re: Org Clock Timer in Frame Title bug
Date: Sun, 29 Apr 2012 11:37:48 +0200	[thread overview]
Message-ID: <87wr4yg9eo.fsf@altern.org> (raw)
In-Reply-To: <uw7wr509fz2.fsf@cmp-d-8k1gx2j.cmp.uea.ac.uk> (George Kettleborough's message of "Sat, 28 Apr 2012 13:51:45 +0100")

Hi George,

George Kettleborough <g.kettleborough@uea.ac.uk> writes:

> Checking (listp frame-title-format) ensures there will be no error when
> calling delq, but it doesn't fix the feature.  If the user's
> frame-title-format is not a list then the feature will not work for no
> apparent reason.  The same thing goes for global-mode-string too, which
> the current release of org-mode modifies.
>
> For the clock and timer display features to work as intended both of
> these variables need to be lists with either a string or a list as the
> first element.  Note that simply being a list is not enough, it must
> contain a string or list as first element.  This format causes the
> elements of the list to be treated as mode-line-formats recursively.

`global-mode-string' and ̀frame-title-format' are list by default
and they cannot be customized.  They can be manually set to a string,
but that's a mistake (okay, `global-mode-string' is a misleading name.)

> The following in both org-clock.el and org-timer.el will ensure both
> variables have the correct format to begin with:
>
> (unless (and (listp frame-title-format)
>              (or (stringp (first frame-title-format))
>                  (listp (first frame-title-format))))
>   (setq frame-title-format (list "" frame-title-format)))
>
> (unless (and (listp global-mode-string)
>              (or (stringp (first global-mode-string))
>                  (listp (first global-mode-string))))
>   (setq global-mode-string (list "" global-mode-string)))

This can go into .emacs.el for those who set those two variables to a
string... but they should not do it in the first place, right?

> It might be better to do this just once in org.el or org-install.el,
> since maybe other modules might want to put stuff in the mode-line or
> frame-title.
>
> Of course the user or another mode might edit either of the variables to
> something bad (like a symbol or string) afterwards.  Maybe this should
> be done every time before clock-in/timer-start or any time we wish to
> append stuff to either of these lists?

Org cannot fix all cases where the user is setting a variable to
something that is non-standard.  For this issue, it's already nice
to not produce an error when the user set `global-mode-string' and
`frame-title-format' to "" instead of ("").

Or am I overlooking something?

-- 
 Bastien

  reply	other threads:[~2012-04-29  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21 23:45 Org Clock Timer in Frame Title bug Mike McLean
2012-04-22  0:43 ` Matt Lundin
2012-04-22  7:02   ` Bastien
2012-04-28 12:51   ` George Kettleborough
2012-04-29  9:37     ` Bastien [this message]
2012-04-30 13:47       ` George Kettleborough
2012-05-05 13:49         ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wr4yg9eo.fsf@altern.org \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=g.kettleborough@uea.ac.uk \
    --cc=mdl@imapmail.org \
    --cc=mike.mclean@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).