[OS X Emacs] Re: Re: Wiki code not working: Symbol's function

Hofert Jan Marius marius.hofert at math.ethz.ch
Mon Sep 12 11:14:37 EDT 2011


Dear David,

thanks for helping.

I tried this:

(require 'tex-site)
(defun guess-TeX-master (filename)
      "Guess the master file for FILENAME from currently open .tex files."
      (let ((candidate nil)
            (filename (file-name-nondirectory filename)))
        (save-excursion
          (dolist (buffer (buffer-list))
            (with-current-buffer buffer
              (let ((name (buffer-name))
                    (file buffer-file-name))
                (if (and file (string-match "\\.tex$" file))
                    (progn
                      (goto-char (point-min))
                      (if (re-search-forward (concat "\\\\input{" filename "}") nil t)
                          (setq candidate file))
                      (if (re-search-forward (concat "\\\\include{" (file-name-sans-extension filename) "}") nil t)
                          (setq candidate file))))))))
        (if candidate
            (message "TeX master document: %s" (file-name-nondirectory candidate)))
        candidate))
(setq 'LaTeX-mode-hook
	'(lambda ()
		(setq TeX-master (guess-TeX-master (buffer-file-name)))))

I obtained the same error as before:

An error has occurred while loading `~/Library/Preferences/Aquamacs Emacs/Preferences.el (or .elc)':
Wrong type argument: symbolp, (quote LaTeX-mode-hook)

Just in case this is helpful, I'm working on a MacBook Pro running 10.6.8 with the very latest version of Aquamacs. 

Cheers,

Marius




More information about the MacOSX-Emacs mailing list