From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: master 2f181d60323 3/6: pp.el (pp-fill): New default pp function
Date: Fri, 14 Jul 2023 05:31:26 +0200 [thread overview]
Message-ID: <87bkgfrwxd.fsf@web.de> (raw)
In-Reply-To: <20230617220622.EC118C1925A@vcs2.savannah.gnu.org> (Stefan Monnier via Mailing list for Emacs changes's message of "Sat, 17 Jun 2023 18:06:22 -0400 (EDT)")
Stefan Monnier via Mailing list for Emacs changes <emacs-diffs@gnu.org>
writes:
> branch: master
> commit 2f181d60323bd9e0196775828de633100479f4c2
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
> pp.el (pp-fill): New default pp function
> [...]
> + (when (and paired (not (eq ?\" (char-after paired))))
> + ;; The sexp has sub-parts, so let's try and spread
> + ;; them over several lines.
> + (save-excursion
> + (goto-char beg)
> + (when (looking-at "(\\([^][()\" \t\n;']+\\)")
> + ;; Inside an expression of the form (SYM ARG1
> + ;; ARG2 ... ARGn) where SYM has a `lisp-indent-function'
> + ;; property that's a number, insert a newline after
> + ;; the corresponding ARGi, because it tends to lead to
> + ;; more natural and less indented code.
> + (let* ((sym (intern-soft (match-string 1)))
> + (lif (and sym (get sym 'lisp-indent-function))))
> + (if (eq lif 'defun) (setq lif 2))
> + (when (natnump lif)
> + (goto-char (match-end 0))
> + (forward-sexp lif)
I only want to give the hint that this `forward-sexp' in the last line
will error when the programmer has, e.g., commented out the body of a
lambda expression. Or the user wants to fill automatically created code
that looks like that, for whatever reason.
Michael.
next prev parent reply other threads:[~2023-07-14 3:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <168703958196.28351.5331986860123726819@vcs2.savannah.gnu.org>
2023-06-18 16:02 ` master updated (cd8d3f3379e -> 1b0348d9593) Michael Albinus
2023-06-18 18:28 ` Stefan Monnier
2023-06-18 18:30 ` Eli Zaretskii
2023-06-18 18:39 ` Eli Zaretskii
2023-06-18 21:39 ` Jim Porter
[not found] ` <20230617220622.EC118C1925A@vcs2.savannah.gnu.org>
2023-07-14 3:31 ` Michael Heerdegen [this message]
2023-07-14 4:57 ` master 2f181d60323 3/6: pp.el (pp-fill): New default pp function Stefan Monnier
2023-07-15 2:48 ` Michael Heerdegen
2023-07-15 15:19 ` Stefan Monnier
2023-07-17 9:58 ` Eric S Fraga
2023-07-17 12:24 ` Eric S Fraga
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkgfrwxd.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).