emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/tuareg cbe70da 5/8: Remove conditional use of add-functio


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg cbe70da 5/8: Remove conditional use of add-function, available on Emacs ≥ 24.4
Date: Mon, 13 Sep 2021 17:59:59 -0400 (EDT)

branch: elpa/tuareg
commit cbe70dad979edb285df0f4c162e98e981d1d6427
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Remove conditional use of add-function, available on Emacs ≥ 24.4
---
 tuareg.el | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index 6fde528..26d372c 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3065,14 +3065,6 @@ file outside _build? "))
             (message "File in _build.  C-x C-q to edit.")
             nil))))))
 
-(defmacro tuareg--eval-when-macrop (f form)
-  "Execute FORM but only when F is `fboundp' (because it's a macro).
-If F is not bound yet, then keep the code un-expanded and perform the
-expansion at run-time, if the run-time version of Emacs does know this macro."
-  (declare (debug (symbolp body)) (indent 1))
-  (if (fboundp f) form                  ;Macro expanded at compile-time.
-    `(if (fboundp ',f) (eval ',form)))) ;Macro expanded at run-time.
-
 (defun tuareg--hanging-eolp-advice ()
   "Recognize \"fun ..args.. ->\" at EOL as being hanging."
   (when (looking-at "fun\\_>")
@@ -3125,13 +3117,12 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
   (smie-setup tuareg-smie-grammar #'tuareg-smie-rules
               :forward-token #'tuareg-smie-forward-token
               :backward-token #'tuareg-smie-backward-token)
-  (tuareg--eval-when-macrop add-function
-    (when (boundp 'smie--hanging-eolp-function)
-      ;; FIXME: As its name implies, smie--hanging-eolp-function
-      ;; is not to be used by packages like us, but SMIE's maintainer
-      ;; hasn't provided any alternative so far :-(
-      (add-function :before (local 'smie--hanging-eolp-function)
-                    #'tuareg--hanging-eolp-advice)))
+  (when (boundp 'smie--hanging-eolp-function)
+    ;; FIXME: As its name implies, smie--hanging-eolp-function
+    ;; is not to be used by packages like us, but SMIE's maintainer
+    ;; hasn't provided any alternative so far :-(
+    (add-function :before (local 'smie--hanging-eolp-function)
+                  #'tuareg--hanging-eolp-advice))
   (add-hook 'smie-indent-functions #'tuareg-smie--args nil t)
   (add-hook 'smie-indent-functions #'tuareg-smie--inside-string nil t)
   (setq-local add-log-current-defun-function #'tuareg-current-fun-name)



reply via email to

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