all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: npostavs@users.sourceforge.net
Cc: Kaushal Modi <kaushal.modi@gmail.com>, 26619@debbugs.gnu.org
Subject: bug#26619: 26.0.50; Wrong indentation in emacs-lisp-mode
Date: Thu, 27 Apr 2017 13:52:15 +0200	[thread overview]
Message-ID: <87wpa62hlc.fsf@drachen> (raw)
In-Reply-To: <87h91aol5y.fsf@users.sourceforge.net> (npostavs's message of "Wed, 26 Apr 2017 18:31:53 -0400")

npostavs@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.





  reply	other threads:[~2017-04-27 11:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23  7:17 bug#26619: 26.0.50; Wrong indentation in emacs-lisp-mode Tino Calancha
2017-04-23 14:51 ` npostavs
2017-04-24 21:03 ` Kaushal Modi
2017-04-26  3:05   ` Michael Heerdegen
2017-04-26  3:22   ` npostavs
2017-04-26  3:29     ` Michael Heerdegen
2017-04-26  3:53       ` npostavs
2017-04-26  4:00         ` Michael Heerdegen
2017-04-26 18:27         ` Kaushal Modi
2017-04-26 22:31           ` npostavs
2017-04-27 11:52             ` Michael Heerdegen [this message]
2017-04-29  2:20               ` npostavs
2017-04-29 12:00                 ` Michael Heerdegen
2017-05-05 15:55                 ` Kaushal Modi
2017-05-05 22:43                   ` npostavs
2017-05-06  1:58                     ` Kaushal Modi
2017-05-06  2:42                       ` npostavs
2017-05-08 12:46                       ` Michael Heerdegen
2017-05-10  0:57                         ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpa62hlc.fsf@drachen \
    --to=michael_heerdegen@web.de \
    --cc=26619@debbugs.gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.