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

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

[nongnu] elpa/lua-mode 0407042 153/468: Make lua-with-silent-modificatio


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 0407042 153/468: Make lua-with-silent-modifications available during byte-compilation
Date: Thu, 5 Aug 2021 04:58:26 -0400 (EDT)

branch: elpa/lua-mode
commit 04070420b505402bf00a659052551f68f3937bf8
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    Make lua-with-silent-modifications available during byte-compilation
---
 lua-mode.el | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 4ec6212..3b6c6fc 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1323,23 +1323,24 @@ left out."
 (define-key lua-mode-menu [search-documentation]
   '("Search Documentation" . lua-search-documentation))
 
-;; Emacs 23.3 introduced with-silent-modifications macro
-;; use it if it's available, otherwise define a replacement for that
-(if (fboundp 'with-silent-modifications)
-    (defalias 'lua-with-silent-modifications 'with-silent-modifications)
+(eval-and-compile
+  ;; Emacs 23.3 introduced with-silent-modifications macro
+  ;; use it if it's available, otherwise define a replacement for that
+  (if (fboundp 'with-silent-modifications)
+      (defalias 'lua-with-silent-modifications 'with-silent-modifications)
 
-  (defmacro lua-with-silent-modifications (body)
-    "Execute BODY, pretending it does not modifies the buffer.
+    (defmacro lua-with-silent-modifications (body)
+      "Execute BODY, pretending it does not modifies the buffer.
 
 This is a reimplementation of macro `with-silent-modifications'
 for Emacsen that doesn't contain one (pre-23.3)."
-    (let ((old-modified-p (buffer-modified-p))
-          (inhibit-modification-hooks t)
-          (buffer-undo-list t))
+      (let ((old-modified-p (buffer-modified-p))
+            (inhibit-modification-hooks t)
+            (buffer-undo-list t))
 
-      (unwind-protect
-          ,@body
-        (set-buffer-modified-p old-modified-p)))))
+        (unwind-protect
+            ,@body
+          (set-buffer-modified-p old-modified-p))))))
 
 (defsubst lua-put-char-property (pos property value &optional object)
   (lua-with-silent-modifications



reply via email to

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