I configured Emacs on one computer and copied
~/.emacs to a different computer. That other computer uses a newly installed operating system.
Both computers run Ubuntu 16.04 with the latest updates installed and both run Ecmacs 24.5.1 from the Ubuntu repositories.
When I opened a LaTeX document, I got this warning:
I created that document on the first computer using Emacs. On that computer, Emacs always puts this in the end of every LaTeX file (after
%%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End:
There is is suspicious
I didn't go into Emacs package manager and install anything (like
AUCTeX) yet, on the computer with the fresh installation. Still, LaTeX files are opened in
When I typed a
! as my response to the warning mentioned above, this was added to
'(safe-local-variable-values (quote ((TeX-master . t))))
Then, that warning went away on subsequent attempts. But there isn't even such a warning in the first place on the first computer, even though the
~/.emacs file was exactly the same.
There are other differences. Like when I press
C-c C-c in
LaTeX-mode to build the PDF, on the first computer, that's all that happens. On the new one, a buffer frame and a buffer are created, containing the
pdflatex command which was used to build the PDF and its console output.
C-c C-c on the first computer, the mini buffer says:
Command: (default LaTeX)
On the second one, it says:
Command: (default pdflatex)
I understand that
pdflatex is a program with an equally named package (in Ubuntu) and an equally named command to call it. But why is the default on the first computer
LaTeX? That is to say: Where is it configured?
Can someone please explain what's going on? If I want the exact same Emacs configuration on both computers, how should I go about it?
This is my
~/.emacs file after the change described above occurred:
(set-face-foreground 'minibuffer-prompt "red") (require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) (package-initialize) (defvar-local is-new-file-buffer nil) (defun save-new-file-before-kill () (when (and (not (buffer-file-name)) is-new-file-buffer (yes-or-no-p "New file has not been saved. Would you like to save before closing?")) (call-interactively 'save-buffer))) (add-hook 'kill-buffer-hook 'save-new-file-before-kill) (defun new-file (dir) (interactive "DCreate New File In: ") (let ((buffer (generate-new-buffer "<Unsaved File>"))) (switch-to-buffer buffer) (setq-local default-directory dir) (setq-local is-new-file-buffer t))) (global-set-key [(f12)] 'new-file) ;; Save all tempfiles in $TMPDIR/emacs$UID/ (defconst emacs-tmp-dir (format "%s/%s%s/" "/t" "emacs" (user-uid))) (setq backup-directory-alist `((".*" . ,emacs-tmp-dir))) (setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t))) (setq auto-save-list-file-prefix emacs-tmp-dir) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(LaTeX-indent-level 4) '(LaTeX-item-indent 0) '(TeX-brace-indent-level 4) '(indent-tabs-mode t) '(org-agenda-files (quote ("~/[I censored this path but it exists on both computers].org" "~/[a different path].org" "~/[and another one].org"))) '(safe-local-variable-values (quote ((TeX-master . t)))) '(show-paren-mode t) '(tool-bar-mode nil)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) ;; Bind C-tab to autocompletion in LaTeX-mode. (add-hook 'LaTeX-mode-hook (lambda() (local-set-key [C-tab] 'TeX-complete-symbol))) (setq LaTeX-paragraph-commands '("documentclass" "usepackage")) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) (add-hook 'LaTeX-mode-hook 'visual-line-mode) (add-hook 'LaTeX-mode-hook 'flyspell-mode) (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX t) (setq TeX-PDF-mode t) (setq org-startup-indented t) (add-hook 'org-mode-hook 'visual-line-mode) ;; Don't show welcome screen when opening Emacs. (setq inhibit-startup-screen t) ;; Highlight matching parentheses. (show-paren-mode 1) ;; Don't clutter the git repo with files by puttem them into a specially named folder. (defvar org-export-output-directory-prefix "built_files_ignored_by_git_" "prefix of directory used for org-mode export") (defadvice org-export-output-file-name (before org-add-export-dir activate) "Modifies org-export to place exported files in a different directory" (when (not pub-dir) (setq pub-dir (concat org-export-output-directory-prefix (substring extension 1))) (when (not (file-directory-p pub-dir)) (make-directory pub-dir)))) ;; Show line numbers. (global-linum-mode t) ;; Show column numbers. (setq column-number-mode t) ;; Agenda view key binding. (global-set-key [(control ?c) (?a)] 'org-agenda)
/t (mentioned in the code above) exists on both computers and in both cases is a symlink to a folder (which even is in the exact same location on both systems).