From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Org Clock Timer in Frame Title bug Date: Sun, 29 Apr 2012 11:37:48 +0200 Message-ID: <87wr4yg9eo.fsf@altern.org> References: <8DD2D644-3CB5-4F40-9801-90C3AA577438@pobox.com> <87d37038b7.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOQei-00020p-FR for emacs-orgmode@gnu.org; Sun, 29 Apr 2012 05:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOQeg-0005eT-KO for emacs-orgmode@gnu.org; Sun, 29 Apr 2012 05:43:00 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:35745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOQeg-0005a4-BS for emacs-orgmode@gnu.org; Sun, 29 Apr 2012 05:42:58 -0400 Received: by mail-wg0-f49.google.com with SMTP id ds1so1494548wgb.30 for ; Sun, 29 Apr 2012 02:42:57 -0700 (PDT) In-Reply-To: (George Kettleborough's message of "Sat, 28 Apr 2012 13:51:45 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: George Kettleborough Cc: Matt Lundin , "emacs-orgmode@gnu.org" , Mike McLean Hi George, George Kettleborough 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