GNU bug report logs - #26619
26.0.50; Wrong indentation in emacs-lisp-mode

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sun, 23 Apr 2017 07:18:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.50

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #37 received at 26619 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: npostavs <at> users.sourceforge.net
Cc: 26619 <at> debbugs.gnu.org, Kaushal Modi <kaushal.modi <at> gmail.com>
Subject: Re: bug#26619: 26.0.50; Wrong indentation in emacs-lisp-mode
Date: Thu, 27 Apr 2017 13:52:15 +0200
npostavs <at> users.sourceforge.net writes:

> Um, right, I didn't test that patch properly, it doesn't work at all.
> Here's a fix for it, cumulative diff also attached.

Thanks.

Here is a recipe of a problem with that new patch: I have this code:

#+begin_src emacs-lisp
(defun el-search--split (matcher1 matcher2 list)
  "Helper for the \"append\" pattern type.

When a splitting of LIST into two lists L1, L2 exist so that Li
is matched by MATCHERi, return (L1 L2) for such Li, else return
nil."
  (let ((try-match (lambda (list1 list2)
                     (when (and (el-search--match-p matcher1 list1)
                                (el-search--match-p matcher2 list2))
                       (list list1 list2))))
        (list1 list) (list2 '()) (match nil))
    ;; don't use recursion, this could hit `max-lisp-eval-depth'
    (while (and (not (setq match (funcall try-match list1 list2)))
                (consp list1))
      (let ((last-list1 (last list1)))
        (if-let ((cdr-last-list1 (cdr last-list1)))
            ;; list1 is a dotted list.  Then list2 must be empty.
            (progn (setcdr last-list1 nil)
                   (setq list2 cdr-last-list1))
          (setq list1 (butlast list1 1)
                list2 (cons (car last-list1) list2)))))
    match))
#+end_src

I mark the region between the forth line of the defun's body, with point
at the open paren of "(list list1 list2)", and the end of the defun.
Hitting C-M-\ results in all but the first line of the region given an
indentation of zero.


TIA,

Michael.




This bug report was last modified 8 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.