Hi, When AUCTeX creates LaTeX buffers anhd files with `TeX-region-create' it uses the function `find-file-noselect', which is wrong since it triggers all modes and hooks that should not be triggered in such a case.
I'll give you an example of why this should be avoided: I cooked my own template/auto-insert/skeleton functionality using yasnippet, and I mainly use it for LaTeX files. I would like the template functionality to apply only if I create the file by hand, and not whenever some Lisp code does that (e.g. `TeX-region-create'). In particular, my template function interactively asks which kind of template I want if I visit and empty LaTeX buffer, and this should not happen when the region file is created. See also: http://emacs.stackexchange.com/questions/2868/whats-wrong-with-find-file-noselect/ ------------------------------------------------------------------------ Emacs : GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2014-10-22 on tcs52.csc.kth.se Package: 11.88 current state: ============== (setq AUCTeX-date "2014-10-29" window-system 'x LaTeX-version "2e" TeX-style-path '("~/.emacs.d/auctex" "/afs/nada.kth.se/home/u/u1l1szqu/.emacs.d/elpa/auctex-11.88/style" "/afs/nada.kth.se/home/u/u1l1szqu/.emacs.d/auctex/auto" "~/.emacs.d/auctex/style" "~/lavori/latex/style/" "auto" "style") TeX-auto-save t TeX-parse-self t TeX-master t TeX-command-list '(("View" "%V" TeX-run-discard-or-function nil t :help "Run Viewer") ("TeX" "%(PDF)%(tex) %(extraopts) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output") ("Makeinfo HTML" "makeinfo %(extraopts) --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "%(PDF)amstex %(extraopts) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") ("ConTeXt" "texexec --once --texutil %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once") ("ConTeXt Full" "texexec %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion") ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX") ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber") ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file") ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX-run-command t t :help "Generate PostScript file") ("Index" "makeindex %s" TeX-run-command nil t :help "Create index file") ("Xindy" "texindy %s" TeX-run-command nil t :help "Run xindy to create index file") ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness") ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for common mistakes") ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") ("Other" "" TeX-run-command t t :help "Run an arbitrary command")) ) -- Massimo Lauria KTH Royal Institute of Technology School of Computer Science and Communication Osquars Backe 2, SE-100 44 Stockholm, Sweden +46 (0) 73 8008 125 (Cell.) httlp://www.csc.kth.se/~lauria/ _______________________________________________ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex