auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 15edd9b6047f7cdd46081


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 15edd9b6047f7cdd46081f99226805dbd7625599
Date: Tue, 18 Nov 2014 08:34:07 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  15edd9b6047f7cdd46081f99226805dbd7625599 (commit)
      from  622c054f56d56050bec3172fecff22bf090b06cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
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).

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.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |    9 +++++++++
 tex-buf.el |   55 ++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 41 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]