From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode Date: Fri, 01 Jun 2018 05:39:39 -0400 Message-ID: <87bmcuc0bo.fsf@gmail.com> References: <83sh66g8wb.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527846013 19070 195.159.176.226 (1 Jun 2018 09:40:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 09:40:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 31656@debbugs.gnu.org, Stefan Guath To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 01 11:40:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOgXY-0004qs-Sy for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 11:40:09 +0200 Original-Received: from localhost ([::1]:54474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOgZg-0001QR-1h for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 05:42:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOgXV-00089q-Vg for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 05:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOgXS-0007Vd-RK for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 05:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOgXS-0007UP-NK for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 05:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fOgXS-0007Pa-B0 for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 05:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jun 2018 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31656 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31656-submit@debbugs.gnu.org id=B31656.152784599028467 (code B ref 31656); Fri, 01 Jun 2018 09:40:02 +0000 Original-Received: (at 31656) by debbugs.gnu.org; 1 Jun 2018 09:39:50 +0000 Original-Received: from localhost ([127.0.0.1]:56804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOgXG-0007P4-BM for submit@debbugs.gnu.org; Fri, 01 Jun 2018 05:39:50 -0400 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:34951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOgXD-0007Oq-5P for 31656@debbugs.gnu.org; Fri, 01 Jun 2018 05:39:49 -0400 Original-Received: by mail-io0-f175.google.com with SMTP id u4-v6so5269232iof.2 for <31656@debbugs.gnu.org>; Fri, 01 Jun 2018 02:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=f4nzEY6cuw8bL4nm/KRl2gSTv+VkUhwpQRV53dIeBz8=; b=MlWSZwQX9oxyOAs6+Z3UagcOwHu5jMSQKayzUkscgpzv2Mw/Eg7Zu3mXyNfQTERNan C5q84FO7DpzR3ZQGvoVciko4oX6FvfZcG2mjyMYkXZF0HqamInCyDwC2FQP+zb6gDYKy LPykceLnqlOI74X1mwkoQwx7SiiVbjCtb8QMOiknO/mRmy5ukYbak0ebS8aC5rAmdPwo IX2Jlz0kr9wA/CTfSIJmjshTVDDooZPNLUEKVO1xX5y0UhPvnkfiHV2BBS+O0XbmRMkb Gm1cxw3qTg7JgZjbzXVtHccBrwB1lA0THTmsWM0BVcgZi9CI6qWHfTk9HmJRB4PDH3PN QPHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=f4nzEY6cuw8bL4nm/KRl2gSTv+VkUhwpQRV53dIeBz8=; b=g45Bi6M2WeAce6N8idheFdzHe88aqtqI6CpGBa+o6n371nWSfwlA+iXNhBJ5t95m9F JZQ8YYm/ZMXtOMuLEZqHmZ/HLTFJLliuYZ9O6QJCqTLf58FND5E1B4iURE/I7kXpX9zL MnA9bJpFbdNGd9W2HM5lSsLLZV22tbJSnZyChW+4MEqLQRT3rwrrTRHokksJ/CwjCKy+ 9BmZW7vLWbGNutinNj/zvf4q91noW9JMcyGg8MxOjzrBKSGkuPuNKqQ92c3xq8SNTFuK DfdhqJzUnWKPrE1J0GxoGg83ilKFZkUveWdOQk/ZAbht5d93nN2gMVWhPWJCHf7t3R24 oyxg== X-Gm-Message-State: ALKqPwdCmiT7DeLeQ3Rkq1unGWyCoTAegLWWMgWaA34eddbkS0mi4xto l6rZ1IsI5BvZnxJ8rVOfWg2Fwg== X-Google-Smtp-Source: ADUXVKLJopBdFZktLdD1HnQyNcMGklsqyxhKoFOl1jY9lcQ2E06LPwY7a9GUU9XX6CHZs0G06jPiuQ== X-Received: by 2002:a6b:1502:: with SMTP id 2-v6mr10126268iov.18.1527845981332; Fri, 01 Jun 2018 02:39:41 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g26-v6sm215847iti.0.2018.06.01.02.39.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Jun 2018 02:39:40 -0700 (PDT) In-Reply-To: <83sh66g8wb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Jun 2018 12:20:52 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:146812 Archived-At: Eli Zaretskii writes: >> From: Stefan Guath >> Date: Wed, 30 May 2018 14:50:01 +0200 >>=20 >> `emacs-lisp-docstring-fill-column' shadows `fill-column' in too many cas= es in emacs-lisp-mode. The >> documentation of `emacs-lisp-docstring-fill-column' states: "Value of = =E2=80=98fill-column=E2=80=99 to use when filling a >> docstring". But it incorrectly seems to be used in a lot more cases than= just in a docstring (the only case that >> I've found where =E2=80=98fill-column=E2=80=99 is actually respected is = within comments). A work-around is to set >> `emacs-lisp-docstring-fill-column' to nil, but it would be nice to have = it working properly instead. >>=20 >> I might be missing something, but think the incorrect behavior is to be = found in `lisp-fill-paragraph' that is >> invoked by `fill-paragraph' through `fill-paragraph-function'. It seems = like `lisp-fill-paragraph' unconditionally >> sets `fill-column' to `emacs-lisp-docstring-fill-column' without checkin= g whether point is within a doc string >> first. The only requirements for enable shadowing currently seems to be = "(and (integerp >> emacs-lisp-docstring-fill-column) (derived-mode-p 'emacs-lisp-mode))", w= hich doesn't seems sufficient. > > AFAICT, this behavior was in Emacs since about forever (since 1995, t > be precise). So maybe we just need to adjust the doc string to > reflect the reality? > > Or are there real-life use cases where this behavior is grossly > inappropriate? I don't think it makes sense to apply normal plain text filling rules to code. Maybe it doesn't come up much because people don't usually call M-q on code, and usually lines of code are kept short enough that they wouldn't get filled anyway. But picking a random example from rgrep ^.\{100,\}$ on the Emacs code base: (defun feedmail-default-date-generator (maybe-file) "Default function for generating Date: header contents." (feedmail-say-debug ">in-> feedmail-default-date-generator") (when maybe-file (feedmail-say-debug (concat "4 cre " (feedmail-rfc822-date (nth 4 (file= -attributes maybe-file))))) (feedmail-say-debug (concat "5 mod " (feedmail-rfc822-date (nth 5 (file= -attributes maybe-file))))) (feedmail-say-debug (concat "6 sta " (feedmail-rfc822-date (nth 6 (file= -attributes maybe-file)))))) (let ((date-time)) (if (and (not feedmail-queue-use-send-time-for-date) maybe-file) (setq date-time (nth 5 (file-attributes maybe-file)))) (feedmail-rfc822-date date-time)) ) Running M-q on every line turns it into this nonsense: (defun feedmail-default-date-generator (maybe-file) "Default function for generating Date: header contents." (feedmail-say-debug ">in-> feedmail-default-date-generator") (when maybe-file (feedmail-say-debug (concat "4 cre " (feedmail-rfc822-date (nth 4 (file-attributes maybe-file))))) (feedmail-say-debug (concat "5 mod " (feedmail-rfc822-date (nth 5 (file-attributes maybe-file))))) (feedmail-say-debug (concat "6 sta " (feedmail-rfc822-date (nth 6 (file-attributes maybe-file)))))) (let ((date-time)) (if (and (not feedmail-queue-use-send-time-for-date) maybe-file) (setq date-time (nth 5 (file-attributes maybe-file)))) (feedmail-rfc822-date date-time)) )