emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [HELP} trying to figure out how to figure out?


From: Bastien
Subject: Re: [O] [HELP} trying to figure out how to figure out?
Date: Tue, 19 Jul 2011 02:05:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Matthew,

(defconst ...) defines a constant, i.e. a symbol which value
will not change.

What happens here is that org.el defines org-outline-regexp
as a constant, whereas some functions use org-outline-regexp
as a symbol for a temporary value (used in let constructs).

See for example the macro `org-with-limited-levels' in org-macs.el:

#+begin_src emacs-lisp
(defmacro org-with-limited-levels (&rest body)
  "Execute BODY with limited number of outline levels."
  `(let* ((org-outline-regexp (org-get-limited-outline-regexp)))
     ,@body))
#+end_src emacs-lisp


The let* construct uses org-outline-regexp to store a temporary
value...  which 100% conflicts (!) with the idea of org-outline-regexp
being a constant.

Thanks for spotting at this!

I've just pushed this fix:

  
http://orgmode.org/w/?p=org-mode.git;a=commit;h=08fc6384bcb3937d933f21d0b12c818603d8a279

PS: some compilation warnings depend on the Emacs version you use,
it's always a good idea to tell what version of Emacs you use.

-- 
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]