[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 15edd9b 23/36: Omit f-f hooks and more with TeX-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auctex 15edd9b 23/36: Omit f-f hooks and more with TeX-region-create |
Date: |
Fri, 28 Nov 2014 17:25:48 +0000 |
branch: externals/auctex
commit 15edd9b6047f7cdd46081f99226805dbd7625599
Author: Tassilo Horn <address@hidden>
Date: Tue Nov 18 09:33:28 2014 +0100
Omit f-f hooks and more with TeX-region-create
* tex-buf.el (TeX-region-create): Disable finding of appropriate
major-mode for region file. Also disable file-local vars, and
don't run find-file-hook functions. Also, make the region file
read-only to prevent accidental editing where actually the real
file should have been edited (happens easily with source
correlation mode).
---
ChangeLog | 9 +++++++++
tex-buf.el | 55 ++++++++++++++++++++++++++++++++-----------------------
2 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cf0acfd..e3cd0cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-11-18 Tassilo Horn <address@hidden>
+
+ * tex-buf.el (TeX-region-create): Disable finding of appropriate
+ major-mode for region file. Also disable file-local vars, and
+ don't run find-file-hook functions. Also, make the region file
+ read-only to prevent accidental editing where actually the real
+ file should have been edited (happens easily with source
+ correlation mode).
+
2014-11-16 Mos� Giordano <address@hidden>
* Makefile.in (WEMACSDATAROOTDIR, WEMACSSITELISP): New variables.
diff --git a/tex-buf.el b/tex-buf.el
index b6a3a31..3810ea9 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1414,7 +1414,14 @@ original file."
(font-lock-auto-fontify nil)
(font-lock-mode-enable-list nil)
;; And insert them into the FILE buffer.
- (file-buffer (let ((TeX-transient-master t))
+ (file-buffer (let (;; Don't query for master file
+ (TeX-transient-master t)
+ ;; Don't choose a special mode (and call its hooks)
+ (auto-mode-alist nil)
+ (magic-mode-alist nil)
+ (enable-local-variables nil)
+ ;; Don't run any f-f hooks
+ (find-file-hook nil))
(find-file-noselect file)))
;; But remember original content.
original-content
@@ -1462,29 +1469,31 @@ original file."
original (TeX-master-directory)))
master-name (TeX-quote-filename master-name))
(with-current-buffer file-buffer
- (setq buffer-undo-list t)
+ (setq buffer-read-only t
+ buffer-undo-list t)
(setq original-content (buffer-string))
- (erase-buffer)
- (when (boundp 'buffer-file-coding-system)
- (setq buffer-file-coding-system
- (with-current-buffer master-buffer buffer-file-coding-system)))
- (insert "\\message{ !name(" master-name ")}"
- header
- TeX-region-extra
- "\n\\message{ !name(" original ") !offset(")
- (insert (int-to-string (- offset
- (1+ (TeX-current-offset))))
- ") }\n"
- region
- "\n\\message{ !name(" master-name ") !offset(")
- (insert (int-to-string (- trailer-offset
- (1+ (TeX-current-offset))))
- ") }\n"
- trailer)
- (run-hooks 'TeX-region-hook)
- (if (string-equal (buffer-string) original-content)
- (set-buffer-modified-p nil)
- (save-buffer 0)))))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (when (boundp 'buffer-file-coding-system)
+ (setq buffer-file-coding-system
+ (with-current-buffer master-buffer buffer-file-coding-system)))
+ (insert "\\message{ !name(" master-name ")}"
+ header
+ TeX-region-extra
+ "\n\\message{ !name(" original ") !offset(")
+ (insert (int-to-string (- offset
+ (1+ (TeX-current-offset))))
+ ") }\n"
+ region
+ "\n\\message{ !name(" master-name ") !offset(")
+ (insert (int-to-string (- trailer-offset
+ (1+ (TeX-current-offset))))
+ ") }\n"
+ trailer)
+ (run-hooks 'TeX-region-hook)
+ (if (string-equal (buffer-string) original-content)
+ (set-buffer-modified-p nil)
+ (save-buffer 0))))))
(defun TeX-region-file (&optional extension nondirectory)
"Return TeX-region file name with EXTENSION.
- [elpa] externals/auctex 20c7209 27/36: Fix fontification of a couple of fontspec macros., (continued)
- [elpa] externals/auctex 20c7209 27/36: Fix fontification of a couple of fontspec macros., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0cb3759 26/36: Implement inverse/backward search for TeX regions., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0bae61a 18/36: Add `ifluatex.el' to Makefile.in, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex daa8a25 20/36: Update windows-package Make rule to new Emacs 24.4 package., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 622c054 22/36: Document presence of bashisms in some Make rules., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 904dfef 21/36: Fix structure of the package for Windows., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 3909e4c 06/36: Several changes suggested by byte-compiler warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex a3f4cac 29/36: Implement forward-search for View command on TeX-region., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0c2cfc8 09/36: Replace `read-string' with `TeX-read-string', Stefan Monnier, 2014/11/28
- [elpa] externals/auctex acf1c76 31/36: Document LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 15edd9b 23/36: Omit f-f hooks and more with TeX-region-create,
Stefan Monnier <=
- [elpa] externals/auctex 8f7c399 30/36: Implement LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e4101ed 25/36: Adapt bug intro text for debbugs., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 7b427a7 34/36: Merge ELPA changes fixing some byte-compile warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 58bd866 28/36: Fix indentation in LaTeX-env-figure in a corner case., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e1ec6a0 33/36: Make second argument of LaTeX-label optional., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 59ccf34 35/36: Check the viewer executable exists before opening it., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e739b85 32/36: Move preview/ to top-level., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex c390682 36/36: Merge from upstream., Stefan Monnier, 2014/11/28