From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Clemente Subject: Local variables Date: Wed, 05 Aug 2009 12:39:07 +0200 Message-ID: <87my6ek0j8.fsf@CPU107.opentrends.net> References: <53A4771F-8F19-480A-B12E-01349D00B6D5@uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYdu4-0000Ca-7p for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 06:39:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYdtz-00008o-NF for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 06:39:27 -0400 Received: from [199.232.76.173] (port=32768 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYdtz-00008k-KP for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 06:39:23 -0400 Received: from an-out-0708.google.com ([209.85.132.248]:12177) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYdty-0005gF-Qg for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 06:39:23 -0400 Received: by an-out-0708.google.com with SMTP id b6so3258723ana.21 for ; Wed, 05 Aug 2009 03:39:21 -0700 (PDT) In-Reply-To: <53A4771F-8F19-480A-B12E-01349D00B6D5@uva.nl> (Carsten Dominik's message of "Tue, 4 Aug 2009 23:15:37 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode List Hi, El dt, ago 04 2009 a les 23:15, Carsten Dominik va escriure: > General mechanism for local variable settings > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =E2=80=A6 > > A line like: > > #+BIND: variable value > > > will bind the variable to value. For example, the line > =E2=80=A6 1. That's very useful and makes .org file distribution much easier since co= nfiguration is self-contained. Thanks. 2. I find that it doesn't work. For instance, this buffer --------- #+BIND: org-export-with-section-numbers nil * one something --------- and this one: --------- #+BIND: org-export-with-section-numbers t * one something --------- Export the same content, with section numbers. Only with this: #+OPTIONS: num:nil can I export without section numbers. Running org 6.29a on latest Emacs from CVS from today. I get no other err= or messages. 3. I found it created one problem with custom time dates. I can't export th= is buffer: -------- #+STARTUP: customtime #+BIND: org-time-stamp-custom-formats '("<%d.m%m.%Y>" . "<%d.m%m.%Y %H:%M>") # (setq org-time-stamp-custom-formats '("<%d.m%m.%Y>" . "<%d.m%m.%Y %H:%M>"= )) a date: <2006-03-25 s=C3=A1b> -------- It fails with: Debugger entered--Lisp error: (wrong-type-argument arrayp quote) substring(quote 1 -1) (concat (if inactive "[" "<") (substring tf 1 -1) (if inactive "]" ">")) (format-time-string (concat (if inactive "[" "<") (substring tf 1 -1) (if= inactive "]" ">")) (apply (quote encode-time) time)) =E2=80=A6 org-translate-time(#("<2006-03-25 s\x00e1\ b>" 0 1 (fontified t) 1 2 (fon= tified t display #("25.m03.2006" 0 11 ...)) 2 3 (fontified t org-dwidth t o= rg-dwidth-n 3 display #("25.m03.2006" 0 11 ...)) 3 15 (fontified t display = #("25.m03.2006" 0 11 ...)) 15 16 (fontified t rear-nonsticky (mouse-face hi= ghlight keymap invisible intangible help-echo org-linked-text)))) It fails only if I have that #+BIND line. You may eval or not the (setq), as needed; it's there only to test. 4. Being able to change any variable is dangerous. =E2=80=9ELocal variables= =E2=80=9C in Emacs have a confirmation dialog which asks whether you really= want to change them; org may need something similar if it reimplements loc= al variables. Restricting changes to variables whose name is org-.* probably doesn't p= revent code execution, and anyway the good thing about #+BIND: is being abl= e to change anything. So maybe a confirmation dialog can be used, or a swit= ch. Thanks -- Daniel