auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Re: Usability of docTeX-mode


From: David Kastrup
Subject: Re: [AUCTeX-devel] Re: Usability of docTeX-mode
Date: Sun, 23 Jul 2006 16:52:57 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> * David Kastrup (2006-07-22) writes:
>
>> (defcustom foo '(c d e)
>>   "Some var."
>>   :set 'TeX-local-list-setter)
>> (make-local-variable 'foo)
>> (add-to-list 'foo 'a)
>> (add-to-list 'foo 'b)
>> (customize-variable 'foo)
>
> Evaluating the defcustom form results in
>
> Debugger entered--Lisp error: (void-variable foo)

Uh yes.  One would probably have to check for boundness:

(defun TeX-local-list-setter (var value)
  (when (boundp var)
    (let ((old (symbol-value var)) tail)
      (dolist (buffer (buffer-list))
        (when (local-variable-p var buffer)
          (with-current-buffer buffer
            (setq tail (symbol-value var))
            (while (consp tail)
              (if (eq (cdr tail) old)
                  (progn
                    (setcdr tail value)
                    (setq tail nil))
                (setq tail (cdr tail)))))))))
  (custom-set-default var value))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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