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

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

[nongnu] elpa/sly 41f4d65: Fix #457: be careful when setting lisp-indent


From: ELPA Syncer
Subject: [nongnu] elpa/sly 41f4d65: Fix #457: be careful when setting lisp-indent-function early
Date: Sat, 10 Jul 2021 05:57:20 -0400 (EDT)

branch: elpa/sly
commit 41f4d650485217aa1f2afa7c159418f103a09231
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Fix #457: be careful when setting lisp-indent-function early
    
    Probably better to just `require` sly-cl-indent.el at this point.
    Better yet, that file could just be put in Emacs as it provides better
    offline indentation anyway.
    
    * sly.el (sly--lisp-indent-function): New helper.
    (sly-editing-mode): Use it.
---
 sly.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sly.el b/sly.el
index cbb042b..a2a2ba4 100644
--- a/sly.el
+++ b/sly.el
@@ -592,12 +592,18 @@ interactive command.\".")
   ;; See gh#166
   (set (make-local-variable 'company-tooltip-align-annotations) t))
 
+(defun sly--lisp-indent-function (&rest args)
+  (let ((fn (if (fboundp 'sly-common-lisp-indent-function)
+                #'sly-common-lisp-indent-function
+              #'lisp-indent-function)))
+    (apply fn args)))
+
 ;;;###autoload
 (define-minor-mode sly-editing-mode
   "Minor mode for editing `lisp-mode' buffers."
   nil nil nil
   (sly-mode 1)
-  (setq-local lisp-indent-function 'sly-common-lisp-indent-function))
+  (setq-local lisp-indent-function #'sly--lisp-indent-function))
 
 (define-minor-mode sly-popup-buffer-mode
   "Minor mode for all read-only SLY buffers"



reply via email to

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