From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: org-habit config tinypatch Date: Mon, 17 Sep 2012 19:02:29 +0200 Message-ID: <87txuwk2fu.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDeiT-0004Xm-Nt for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 13:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDeiN-0001Lg-QN for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 13:02:37 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:52602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDeiN-0001LD-Kc for emacs-orgmode@gnu.org; Mon, 17 Sep 2012 13:02:31 -0400 Received: by wgbdt14 with SMTP id dt14so1372544wgb.30 for ; Mon, 17 Sep 2012 10:02:30 -0700 (PDT) In-Reply-To: (Robert Horn's message of "Mon, 17 Sep 2012 06:42:26 -0400") 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: Robert Horn Cc: Org-mode Hi Robert, Robert Horn writes: > This patch fixes my problem, but indicates that there is a startup > sequencing issue that may also affect other parts of org. > > First the patch > > --- org-agenda.el~ 2012-09-12 21:24:27.000000000 -0400 > +++ org-agenda.el 2012-09-17 06:02:45.000000000 -0400 > @@ -90,7 +90,7 @@ > (defvar org-mobile-force-id-on-agenda-items) ; defined in org-mobile.el > (defvar org-habit-show-habits) ; defined in org-habit.el > (defvar org-habit-show-habits-only-for-today) > -(defvar org-habit-show-all-today nil) > +(defvar org-habit-show-all-today) ; defined in org-habit.el > > ;; Defined somewhere in this file, but used before definition. > (defvar org-agenda-buffer-name "*Org Agenda*") Thanks. I've applied a patch that does not (defvar ... nil), since we only defvar here to silent the byte-compiler, not to initialize the var. The rest of my change check whether the variable has been already initialized (boundp '...) so that the agenda does not choke. > Second, the symptom > > Without this patch the emacs config shows the "show-all-today" as having > been changed outside the config process, and it is set to "nil" rather > than the setting in the .emacs file. It shows this immediately upon > startup when the config option is started and nothing else has been done. > > If I understand defvar properly, this means that the org-agenda is being > evaluated before the .emacs, which is not what I expected at all. So > either I don't understand defvar properly or the order of evaluation at > startup is not what I thought. Either way, there are possibly other > defvars that need fixing. > > Now that org-habit is part of the base org-mode, perhaps the proper fix > is to remove those three defvars. Someone who understands the startup > sequence should make that decision. This is weird. If the variable has been set through .emacs.el or the .emacs-custom.el file at startup, then defvar'ing it to nil should not do anything. (setq ahem 3) => 3 (defvar ahem nil) => ahem (eval ahem) => 3 If you don't have the above results, perhaps you should report this as an Emacs bug. Thanks, -- Bastien