;;;###autoload
(defcustom tex-dvi-view-command
- '(cond
- ((eq window-system 'x) "xdvi")
- ((eq window-system 'w32) "yap")
- (t "dvi2tty * | cat -s"))
+ `(cond
+ ((eq window-system 'x) ,(purecopy "xdvi"))
+ ((eq window-system 'w32) ,(purecopy "yap"))
+ (t ,(purecopy "dvi2tty * | cat -s")))
"*Command used by \\[tex-view] to display a `.dvi' file.
If it is a string, that specifies the command directly.
If this string contains an asterisk (`*'), that is replaced by the file name;
:group 'tex-view)
;;;###autoload
-(defcustom tex-show-queue-command "lpq"
+(defcustom tex-show-queue-command (purecopy "lpq")
"*Command used by \\[tex-show-print-queue] to show the print queue.
Should show the queue(s) that \\[tex-print] puts jobs on."
:type 'string
:group 'tex)
;;;###autoload
-(defcustom tex-open-quote "``"
+(defcustom tex-open-quote (purecopy "``")
"*String inserted by typing \\[tex-insert-quote] to open a quotation."
:type 'string
:options '("``" "\"<" "\"`" "<<" "«")
:group 'tex)
;;;###autoload
-(defcustom tex-close-quote "''"
+(defcustom tex-close-quote (purecopy "''")
"*String inserted by typing \\[tex-insert-quote] to close a quotation."
:type 'string
:options '("''" "\">" "\"'" ">>" "»")
,@tex-face-alist)
"Alist of face and LaTeX font name for facemenu.")
+(defun tex-facemenu-add-face-function (face end)
+ (or (cdr (assq face tex-face-alist))
+ (or (and (consp face)
+ (consp (car face))
+ (null (cdr face))
+ (eq major-mode 'latex-mode)
+ ;; This actually requires the `color' LaTeX package.
+ (cond ((eq (caar face) :foreground)
+ (format "{\\color{%s} " (cadr (car face))))
+ ((eq (caar face) :background)
+ (format "\\colorbox{%s}{" (cadr (car face))))))
+ (error "Face %s not configured for %s mode" face mode-name))))
+
;; This would be a lot simpler if we just used a regexp search,
;; but then it would be too slow.
(defun tex-guess-mode ()
(set (make-local-variable 'compare-windows-whitespace)
'tex-categorize-whitespace)
(set (make-local-variable 'facemenu-add-face-function)
- (lambda (face end)
- (or (cdr (assq face tex-face-alist))
- (error "Face %s not configured for %s mode" face mode-name))))
+ 'tex-facemenu-add-face-function)
(set (make-local-variable 'facemenu-end-add-face) "}")
(set (make-local-variable 'facemenu-remove-face-function) t)
(set (make-local-variable 'font-lock-defaults)
(setq directory (file-name-as-directory (expand-file-name directory)))
(if (not (file-directory-p directory))
(error "%s is not a directory" directory)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(setq default-directory directory))))
(defvar tex-send-command-modified-tick 0)