all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 31656@debbugs.gnu.org, stefan@automata.se
Subject: bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode
Date: Sat, 02 Jun 2018 09:34:21 -0400	[thread overview]
Message-ID: <87tvql9usi.fsf@gmail.com> (raw)
In-Reply-To: <5B129ABE.5040102@gmx.at> (martin rudalics's message of "Sat, 02 Jun 2018 15:25:18 +0200")

martin rudalics <rudalics@gmx.at> writes:

>>> Are there no use cases where we would want M-q outside of syntactic
>>> strings?
>>
>> Okay, I can think of one possibility: if you've pasted a long single
>> line consisting of a quoted list of symbols, then M-q could be a
>> convenient way of breaking it up into multiple lines.  With M-q disabled
>> in Lisp code, you would need to copy the data to a temp non-lisp-mode
>> buffer in order to do that, so a bit more inconvenient.
>
> Don't we want to fill comments as well?

Yes, we lost a bit of context there; comment filling is taken care of at
the top of lisp-fill-paragraph, I wasn't proposing to disable that.

    (defun lisp-fill-paragraph (&optional justify)
      [...]
      (or (fill-comment-paragraph justify)
          ;; Since fill-comment-paragraph returned nil, that means we're not in
          ;; a comment: Point is on a program line; we are interested
          ;; particularly in docstring lines.
          ;; [...] This setting has the consequence of inhibiting
          ;; filling many program lines that are not docstrings, which is sensible,
          ;; because the user probably asked to fill program lines by accident, or
          ;; expecting indentation (perhaps we should try to do indenting in that
          ;; case).[...]
+      (when (nth 3 (syntax-ppss))       ; Only fill inside strings.
          (let ((paragraph-start
                 (concat paragraph-start
                         "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
            (paragraph-separate
             (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
                (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
                                      (derived-mode-p 'emacs-lisp-mode))
                                 emacs-lisp-docstring-fill-column
                               fill-column)))
-	(fill-paragraph justify))
+	  (fill-paragraph justify)))
          ;; Never return nil.
          t))





  reply	other threads:[~2018-06-02 13:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 12:50 bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode Stefan Guath
2018-06-01  9:20 ` Eli Zaretskii
2018-06-01  9:39   ` Noam Postavsky
2018-06-01 10:36     ` Stefan Guath
2018-06-01 12:52       ` Eli Zaretskii
2018-06-01 14:34         ` Stefan Guath
2018-06-01 15:10           ` Eli Zaretskii
2018-06-01 12:43     ` Eli Zaretskii
2018-06-02  1:45       ` Noam Postavsky
2018-06-02  6:41         ` Eli Zaretskii
2018-06-02 13:07           ` Noam Postavsky
2018-06-02 13:25             ` martin rudalics
2018-06-02 13:34               ` Noam Postavsky [this message]
2018-06-02 14:09             ` Eli Zaretskii
2018-06-03 12:51               ` Stefan Guath
2020-08-22 15:23             ` Lars Ingebrigtsen
2022-04-13  3:06               ` Lars Ingebrigtsen

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=87tvql9usi.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31656@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    --cc=stefan@automata.se \
    /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.