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

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

[nongnu] elpa/tuareg 2618ad7 2/3: Use add-function to adapt blink-matchi


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 2618ad7 2/3: Use add-function to adapt blink-matching-check-function to comments
Date: Thu, 9 Sep 2021 06:57:41 -0400 (EDT)

branch: elpa/tuareg
commit 2618ad738a75a67ddb07ed7c9c246ffe546b85e3
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Use add-function to adapt blink-matching-check-function to comments
---
 tuareg.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index d041c5b..b6fa95c 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3087,19 +3087,19 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
                 (forward-comment 1)
                 (eq (point) pt))))))
 
-(defun tuareg--blink-matching-check (start end)
+(defun tuareg--blink-matching-check (orig-fun &rest args)
+  ;; FIXME: Should we merge this with `tuareg--show-paren'?
   (if (tuareg--point-after-comment-p)
       ;; Immediately after a comment-ending "*)" -- no mismatch error.
       nil
-    (smie-blink-matching-check start end)))
+    (apply orig-fun args)))
 
 (defvar show-paren-data-function); Silence the byte-compiler
-(declare-function show-paren--default "paren" ())
 
-(defun tuareg--show-paren ()
+(defun tuareg--show-paren (orig-fun)
   (if (or (tuareg--point-before-comment-p) (tuareg--point-after-comment-p))
       nil
-    (show-paren--default)))
+    (funcall orig-fun)))
 
 (defun tuareg--common-mode-setup ()
   (setq-local syntax-propertize-function #'tuareg-syntax-propertize)
@@ -3107,7 +3107,8 @@ 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)
-  (setq-local blink-matching-check-function #'tuareg--blink-matching-check)
+  (add-function :around (local 'blink-matching-check-function)
+                #'tuareg--blink-matching-check)
   (tuareg--eval-when-macrop add-function
     (when (boundp 'smie--hanging-eolp-function)
       ;; FIXME: As its name implies, smie--hanging-eolp-function
@@ -3118,7 +3119,8 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
   (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)
-  (setq-local show-paren-data-function #'tuareg--show-paren)
+  (add-function :around (local 'show-paren-data-function)
+                #'tuareg--show-paren)
   (setq prettify-symbols-alist
         (if tuareg-prettify-symbols-full
             (append tuareg-prettify-symbols-basic-alist



reply via email to

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