You can verify tests are broken if you
M-x load-file slime-cl-indent.el
then evaluate the following in *scratch*
(progn (setq lisp-indent-function 'common-lisp-indent-function) (common-lisp-run-indentation-tests t))
The root cause is complicated. Setting comment-column to nil in the buffer used for testing fixes things.
Bob
Index: slime-cl-indent-test.txt =================================================================== RCS file: /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt,v retrieving revision 1.22 diff -u -r1.22 slime-cl-indent-test.txt --- slime-cl-indent-test.txt 13 Apr 2012 16:16:11 -0000 1.22 +++ slime-cl-indent-test.txt 22 Nov 2013 23:26:18 -0000 @@ -348,9 +348,6 @@ (bar))
;;; Test: 32 -;; -;; comment-indent-function: (lambda () nil) -;; comment-column: nil
(unknown (;; KLUDGE: comment-indent hackery to get ;; the comment right. Otherwise we get a Index: slime-cl-indent.el =================================================================== RCS file: /project/slime/cvsroot/slime/contrib/slime-cl-indent.el,v retrieving revision 1.68 diff -u -r1.68 slime-cl-indent.el --- slime-cl-indent.el 3 Jan 2013 12:40:52 -0000 1.68 +++ slime-cl-indent.el 22 Nov 2013 23:26:18 -0000 @@ -33,6 +33,8 @@
;;; Code:
+(require 'cl) + (defgroup lisp-indent nil "Indentation in Lisp." :group 'lisp) @@ -1755,6 +1757,11 @@ (defun common-lisp-indent-test (name bindings test) (with-temp-buffer (lisp-mode) + ;; We've installed a comment-indent-function that returns nil, so that + ;; comment-indent always calls indent-according-to-mode. Unfortunately, it + ;; shifts comments to comment-column, if there's text before the comment. + ;; Turn that behavior off by setting comment-column to nil. + (setq comment-column nil) (setq indent-tabs-mode nil) (common-lisp-set-style "common-lisp-indent-test") (dolist (bind bindings)
On Sat, Nov 23 2013, Robert Brown wrote:
The root cause is complicated. Setting comment-column to nil in the buffer used for testing fixes things.
Setting comment-column to nil doesn't seem right, because it's supposed to be an integer. E.g. M-x set-variable RET comment-column RET nil RET doesn't work. Also if comment-column is nil then M-; aka comment-dwim no longer works.
Setting comment-indent-function to (lambda () nil) is also questionable because that sends stuff like:
(defun foo () ; )
into an endless recursion.
To fix Test 32, the best solution would be to use change comment-inline-offset from 1 to 0. Unfortunately, comment-inline-offset only exist since Emacs 24.
Helmut
Thanks for taking a look at my patch for fixing the tests of slime-cl-indent.
I agree that setting comment-column to nil is generally not right, but it's a buffer-local variable and my change only sets it to nil in the buffer that's used for testing slime-cl-indent code. The last change to slime-cl-indent.el removed code that sets it to nil for all Common Lisp buffers. That's why tests are currently broken.
I can take another look at the testing code, to see if there's another way to fix things. Many of the tests are broken right now. If using comment-inline-offset words, can I employ it, or do you require that test code work on Emacs 23?
Also, does the endless recursion you mentioned occur when executing indent-sexp or when hitting TAB on one of the lines or code?
Thanks again.
Bob
On Sun, Nov 24, 2013 at 8:05 AM, Helmut Eller eller.helmut@gmail.com wrote:
On Sat, Nov 23 2013, Robert Brown wrote:
The root cause is complicated. Setting comment-column to nil in the buffer used for testing fixes things.
Setting comment-column to nil doesn't seem right, because it's supposed to be an integer. E.g. M-x set-variable RET comment-column RET nil RET doesn't work. Also if comment-column is nil then M-; aka comment-dwim no longer works.
Setting comment-indent-function to (lambda () nil) is also questionable because that sends stuff like:
(defun foo () ; )
into an endless recursion.
To fix Test 32, the best solution would be to use change comment-inline-offset from 1 to 0. Unfortunately, comment-inline-offset only exist since Emacs 24.
Helmut