From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#9286: fill-paragraph destroys URLs Date: Sat, 20 Aug 2011 15:58:52 -0400 Message-ID: <87obzjhn2b.fsf@stupidchicken.com> References: <87k4ajbpyi.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1313870398 5624 80.91.229.12 (20 Aug 2011 19:59:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Aug 2011 19:59:58 +0000 (UTC) Cc: 9286@debbugs.gnu.org, jidanni@jidanni.org To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 20 21:59:54 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qurhy-0007oF-3Y for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Aug 2011 21:59:54 +0200 Original-Received: from localhost ([::1]:34107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qurhx-0006DU-MQ for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Aug 2011 15:59:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qurhv-00069w-0m for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2011 15:59:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qurhu-0008GL-5a for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2011 15:59:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qurhu-0008GH-2q for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2011 15:59:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qurk1-0002eW-Lb; Sat, 20 Aug 2011 16:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Aug 2011 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9286 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9286-submit@debbugs.gnu.org id=B9286.131387048510148 (code B ref 9286); Sat, 20 Aug 2011 20:02:01 +0000 Original-Received: (at 9286) by debbugs.gnu.org; 20 Aug 2011 20:01:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QurjQ-0002dd-N9 for submit@debbugs.gnu.org; Sat, 20 Aug 2011 16:01:24 -0400 Original-Received: from vm-emlprdomr-05.its.yale.edu ([130.132.50.146]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QurjD-0002dL-AN for 9286@debbugs.gnu.org; Sat, 20 Aug 2011 16:01:23 -0400 Original-Received: from furball ([64.134.100.139]) (authenticated bits=0) by vm-emlprdomr-05.its.yale.edu (8.14.4/8.14.4) with ESMTP id p7KJwq3s009069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 20 Aug 2011 15:58:53 -0400 In-Reply-To: <87k4ajbpyi.fsf@jidanni.org> (jidanni@jidanni.org's message of "Fri, 12 Aug 2011 05:25:41 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.146 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 20 Aug 2011 16:02:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50176 Archived-At: If I am decoding the jidanni-speak correctly, his complaint is doing M-q on a buffer containing asdf =E5=9C=8B turns the text into asdf=E5=9C=8B instead of what he wants: asdf =E5=9C=8B 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. *** 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)))))) =20=20 (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)))))) =20=20 (goto-char from)