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. 400609e380524a6b30798


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 400609e380524a6b307983e2b6084271ff310c12
Date: Tue, 01 Sep 2015 06:22:48 +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  400609e380524a6b307983e2b6084271ff310c12 (commit)
      from  dbc87df41c22a68d98629c65653afa07cfb5e398 (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 400609e380524a6b307983e2b6084271ff310c12
Author: Tassilo Horn <address@hidden>
Date:   Tue Sep 1 08:22:14 2015 +0200

    New TeX--if-macro-fboundp compatibility macro
    
    * tex.el (TeX--if-macro-fboundp): New portability macro.
    (VirTeX-common-initialization): Use it.

diff --git a/ChangeLog b/ChangeLog
index 5057a0a..dde5951 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-01  Tassilo Horn  <address@hidden>
+
+       * tex.el (TeX--if-macro-fboundp): New portability macro.
+       (VirTeX-common-initialization): Use it.
+
 2015-08-31  Mosè Giordano  <address@hidden>
 
        * tex-buf.el (TeX-previous-error): Delete point in error message.
diff --git a/tex.el b/tex.el
index 0868d10..3e43bb4 100644
--- a/tex.el
+++ b/tex.el
@@ -583,6 +583,26 @@ the name of the file being processed, with an optional 
extension."
 
 ;;; Portability.
 
+(defmacro TeX--if-macro-fboundp (name then &rest else)
+  "Execute THEN if macro NAME is bound and ELSE otherwise.
+Essentially,
+
+  (TeX--if-macro-fboundp name then else...)
+
+is equivalent to
+
+  (if (fboundp 'name) then else...)
+
+but takes care of byte-compilation issues where the byte-code for
+the latter could signal an error if it has been compiled with
+emacs 24.1 and is then later run by emacs 24.5."
+  (declare (indent 2) (debug (symbolp form)))
+  (if (fboundp name)            ;If macro exists at compile-time, just use it.
+      then
+    `(if (fboundp ',name)       ;Else, check if it exists at run-time.
+        (eval ',then)          ;If it does, then run the then code.
+       ,@else)))                ;Otherwise, run the else code.
+
 (require 'easymenu)
 
 (eval-and-compile
@@ -3458,7 +3478,7 @@ The algorithm is as follows:
   (when (and (boundp 'tex--prettify-symbols-alist)
             (boundp 'prettify-symbols-compose-predicate))
     (set (make-local-variable 'prettify-symbols-alist) 
tex--prettify-symbols-alist)
-    (if (fboundp 'add-function)
+    (TeX--if-macro-fboundp add-function
        (add-function :override (local 'prettify-symbols-compose-predicate)
                      #'tex--prettify-symbols-compose-p)
       (set (make-local-variable 'prettify-symbols-compose-predicate)

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

Summary of changes:
 ChangeLog |    5 +++++
 tex.el    |   22 +++++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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