From: Lars Ingebrigtsen <larsi@gnus.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 34463@debbugs.gnu.org, jidanni@jidanni.org,
Kenichi Handa <handa@m17n.org>,
9286@debbugs.gnu.org
Subject: bug#9286: fill-paragraph destroys URLs
Date: Thu, 10 Oct 2019 00:30:54 +0200 [thread overview]
Message-ID: <87blupzh41.fsf@gnus.org> (raw)
In-Reply-To: <87obzjhn2b.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 20 Aug 2011 15:58:52 -0400")
Chong Yidong <cyd@stupidchicken.com> writes:
> If I am decoding the jidanni-speak correctly, his complaint is doing M-q
> on a buffer containing
>
> asdf
> 國
>
> turns the text into
>
> asdf國
>
> instead of what he wants:
>
> asdf 國
>
> This is because line joining does not include a space if *either*
> character on each side of the newline has the ?| (line-breakable)
> category and an entry in fill-nospace-between-words-table. To get the
> behavior jidanni wants, we could change it so that *both* the characters
> must have this property; see attached patch.
>
> But I am not sure this is TRT in general. Handa-san, could you weigh in
> with an opinion? Adding a space seems more or less correct to me, but I
> am no expert.
This problem is still present in Emacs 27. This patch, from 2011, was
never applied. I think Chong's proposal sounds logical, but like him,
I'm (ahem) no expert.
> *** lisp/textmodes/fill.el 2011-07-16 20:05:54 +0000
> --- lisp/textmodes/fill.el 2011-08-20 19:52:41 +0000
> ***************
> *** 482,491 ****
> (replace-match (get-text-property (match-beginning 0) 'fill-space))
> (let ((prev (char-before (match-beginning 0)))
> (next (following-char)))
> ! (if (and (or (aref (char-category-set next) ?|)
> ! (aref (char-category-set prev) ?|))
> ! (or (aref fill-nospace-between-words-table next)
> ! (aref fill-nospace-between-words-table prev)))
> (delete-char -1))))))
>
> (goto-char from)
> --- 482,491 ----
> (replace-match (get-text-property (match-beginning 0) 'fill-space))
> (let ((prev (char-before (match-beginning 0)))
> (next (following-char)))
> ! (if (and (aref (char-category-set next) ?|)
> ! (aref (char-category-set prev) ?|)
> ! (aref fill-nospace-between-words-table next)
> ! (aref fill-nospace-between-words-table prev))
> (delete-char -1))))))
>
> (goto-char from)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2019-10-09 22:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 21:25 bug#9286: fill-paragraph destroys URLs jidanni
2011-08-20 19:58 ` Chong Yidong
2019-10-09 22:30 ` Lars Ingebrigtsen [this message]
2019-10-10 7:43 ` Eli Zaretskii
2019-10-11 6:58 ` bug#34463: " Lars Ingebrigtsen
2019-11-23 14:00 ` Lars Ingebrigtsen
2011-08-20 20:04 ` jidanni
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=87blupzh41.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=34463@debbugs.gnu.org \
--cc=9286@debbugs.gnu.org \
--cc=cyd@stupidchicken.com \
--cc=handa@m17n.org \
--cc=jidanni@jidanni.org \
/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).