[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 400609e 18/78: New TeX--if-macro-fboundp compati
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 400609e 18/78: New TeX--if-macro-fboundp compatibility macro |
Date: |
Mon, 19 Oct 2015 09:10:44 +0000 |
branch: externals/auctex
commit 400609e380524a6b307983e2b6084271ff310c12
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
New TeX--if-macro-fboundp compatibility macro
* tex.el (TeX--if-macro-fboundp): New portability macro.
(VirTeX-common-initialization): Use it.
---
ChangeLog | 5 +++++
tex.el | 22 +++++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletions(-)
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)
- [elpa] externals/auctex 5b0b215 03/78: Setup preview menu/keymap only once., (continued)
- [elpa] externals/auctex 5b0b215 03/78: Setup preview menu/keymap only once., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 2648a58 06/78: New function to read labels., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex be9f14a 02/78: Add the missing starred version of \AddEnumerateCounter., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 30be9cc 09/78: Add support for prettify-symbols-mode, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex eff71a7 10/78: Change | syntax to punctuation; fixes bug#21366, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex a4d23f6 07/78: Add menu and new functions for error overview., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex a85d7c6 15/78: Add support for undocumented macros `\captionbox[*]'., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex a3e3ab8 14/78: Add new style transparent.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 8d5acb0 13/78: Do not indent the content of `filecontents[*]' env., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 57338ec 24/78: Improve my last commit, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 400609e 18/78: New TeX--if-macro-fboundp compatibility macro,
Tassilo Horn <=
- [elpa] externals/auctex 08ab3c1 23/78: Allow hiding ^ and _ script signs, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 0b3a6e8 12/78: Do not indent the content of `Form' environment., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 40963e5 08/78: Check engine before running LaTeX command., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 33cee84 19/78: Allow TeX-command-sequence to process the region, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 513490f 22/78: Implement multi-level script fontification, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 76eb240 25/78: Docfix, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex a07f436 16/78: Implement TeX-update., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex dbc87df 17/78: Generate PDF via dvips+ps2pdf., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex dd9adef 21/78: Case-sensitive mode detection + AMS-TeX fixes, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex da7419f 42/78: Add new style AlegreyaSans.el., Tassilo Horn, 2015/10/19