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

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

[nongnu] elpa/jade-mode 449df109fc 074/128: fix unbound variable referen


From: ELPA Syncer
Subject: [nongnu] elpa/jade-mode 449df109fc 074/128: fix unbound variable reference in let binding
Date: Sat, 29 Jan 2022 08:24:48 -0500 (EST)

branch: elpa/jade-mode
commit 449df109fc2699371a32387fe09f126733ec1dec
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Commit: Mitchel Humpherys <mitchelh@codeaurora.org>

    fix unbound variable reference in let binding
    
    In 40efeb499a8, the let binding in (sws-move-region) was changed such
    that the `first-indent' variable is bound to the value of the
    `indent-diff' variable, rather than just creating two empty bindings for
    two separate variables.  Since the `indent-diff' variable doesn't exist
    we take a void variable exception:
    
        Debugger entered--Lisp error: (void-variable indent-diff)
          (let ((first-indent indent-diff) (num-lines-indented 
(count-lines-region begin end))) (goto-char begin) (setq first-indent 
(current-indentation)) (sws-indent-to (funcall prog first-indent 
sws-tab-width)) (setq indent-diff (- (current-indentation) first-indent)) 
(forward-line 1) (let ((--dotimes-limit-- (- num-lines-indented 1)) (i 0)) 
(while (< i --dotimes-limit--) (sws-indent-to (+ (current-indentation) 
indent-diff)) (forward-line 1) (setq i (1+ i)))))
          (save-excursion (let ((first-indent indent-diff) (num-lines-indented 
(count-lines-region begin end))) (goto-char begin) (setq first-indent 
(current-indentation)) (sws-indent-to (funcall prog first-indent 
sws-tab-width)) (setq indent-diff (- (current-indentation) first-indent)) 
(forward-line 1) (let ((--dotimes-limit-- (- num-lines-indented 1)) (i 0)) 
(while (< i --dotimes-limit--) (sws-indent-to (+ (current-indentation) 
indent-diff)) (forward-line 1) (setq i (1+ i))))))
          sws-move-region(1 55 +)
          sws-indent-region(1 55)
          indent-region(1 55 nil)
          call-interactively(indent-region nil nil)
          command-execute(indent-region)
    
    Fix this by going back to binding `indent-diff' to a new variable.
---
 sws-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sws-mode.el b/sws-mode.el
index 902d1aac1f..aac0f92dd0 100644
--- a/sws-mode.el
+++ b/sws-mode.el
@@ -82,7 +82,7 @@
 (defun sws-move-region (begin end prog)
   "Moves left is dir is null, otherwise right. prog is '+ or '-"
   (save-excursion
-    (let ((first-indent indent-diff)
+    (let (first-indent indent-diff
          (num-lines-indented (count-lines-region begin end))
          )
       (goto-char begin)



reply via email to

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