Ralf Angeli <[EMAIL PROTECTED]> 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


_______________________________________________
auctex-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to