all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 47146@debbugs.gnu.org, Markus Triska <triska@metalevel.at>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Date: Thu, 18 Mar 2021 15:03:29 +0100	[thread overview]
Message-ID: <87eegch83y.fsf@igel.home> (raw)
In-Reply-To: <87y2elrp46.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 18 Mar 2021 06:46:01 +0100")

On Mär 18 2021, Lars Ingebrigtsen wrote:

> Markus Triska <triska@metalevel.at> writes:
>
>> Starting Emacs with:
>>
>>     $ emacs -Q
>>
>> I get the following indentation:
>>
>>     (defun word (arg)
>>       (pcase arg
>>         ('love
>>          'amour)
>>         ('always
>>          'toujours)
>>         ('if
>>             'si)
>>         ('emacs
>>          'emacs)))
>
> I guess `lisp-indent-calc-next' is interpreting the "('if" as if it were
> "(if"?

It's lisp-indent-function that calculates the indentation.  It is called
with a pps state where start of last complete sexp terminated points to
`if' and start of innermost containing list points to the preceding
paren.  It then determines that `if' has a lisp-indent-function property
of 2.

So if there is any bug, it is probably in parse-partial-sexp.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





      parent reply	other threads:[~2021-03-18 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 21:08 bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode Markus Triska
2021-03-18  5:46 ` Lars Ingebrigtsen
2021-03-18 13:51   ` Stefan Monnier
2021-03-18 14:03   ` Andreas Schwab [this message]

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=87eegch83y.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=47146@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=triska@metalevel.at \
    /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.