emacs-devel
[Top][All Lists]
Advanced

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

Re: Bug in lisp indentation


From: Thien-Thi Nguyen
Subject: Re: Bug in lisp indentation
Date: Sat, 14 Jul 2007 22:46:39 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux)

() Stefan Monnier <address@hidden>
() Sat, 14 Jul 2007 16:04:18 -0400

   That's wrong when you have things like

          (sdfgsdg dfgsd
                   asfgasfg) (dfg)
        <TAB>sfgsfg

   You want something along the lines of

      (while (not (at-indentation-p)) (forward-sexp -1))

indeed.  i've reworked the adjustment to be more specific.
below is try #3.  it does not address the case above, however
it does not change the current behavior for it, either.

        * emacs-lisp/lisp-mode.el (calculate-lisp-indent):
        In the case of constant symbol alignment, consider the
        sexp actually at indentation to be the "last sexp".

thi


______________________________________________________
diff -c -r1.202 lisp-mode.el
*** lisp-mode.el        6 Jul 2007 17:26:29 -0000       1.202
--- lisp-mode.el        14 Jul 2007 20:38:40 -0000
***************
*** 930,935 ****
--- 930,945 ----
                         (goto-char indent-point)
                         (skip-chars-forward " \t")
                         (looking-at ":"))
+                      ;; The last sexp may not be the first sexp on the line
+                      ;; where it begins, so find that one, instead.
+                      (save-excursion
+                        (goto-char calculate-lisp-indent-last-sexp)
+                        (while (and (not (looking-back "^[ \t]*"))
+                                    (or (not containing-sexp)
+                                        (< (1+ containing-sexp) (point))))
+                          (forward-sexp -1)
+                          (backward-prefix-chars))
+                        (setq calculate-lisp-indent-last-sexp (point)))
                       (> calculate-lisp-indent-last-sexp
                          (save-excursion
                            (goto-char (1+ containing-sexp))




reply via email to

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