From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#24622: 26.0.50; lisp-fill-paragraph broken Date: Sun, 22 Oct 2017 02:10:47 -0600 Message-ID: <87h8urvbzs.fsf@gmail.com> References: <57F536BC.7060306@gmx.at> <877evziy62.fsf@gmail.com> <83zi8kc43j.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1508659876 20543 195.159.176.226 (22 Oct 2017 08:11:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 08:11:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: larsi@gnus.org, 24622@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 22 10:11:12 2017 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 1e6BLg-0004Oy-JK for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 10:11:08 +0200 Original-Received: from localhost ([::1]:60426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6BLm-000719-F0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 04:11:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6BLf-000710-ML for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 04:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6BLa-0003rg-Mh for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 04:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6BLa-0003rV-Hx for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 04:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6BLa-0003tP-9M for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 04:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2017 08:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24622 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24622-submit@debbugs.gnu.org id=B24622.150865985714952 (code B ref 24622); Sun, 22 Oct 2017 08:11:02 +0000 Original-Received: (at 24622) by debbugs.gnu.org; 22 Oct 2017 08:10:57 +0000 Original-Received: from localhost ([127.0.0.1]:54896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6BLV-0003t6-FU for submit@debbugs.gnu.org; Sun, 22 Oct 2017 04:10:57 -0400 Original-Received: from mail-io0-f182.google.com ([209.85.223.182]:44336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6BLU-0003su-GM for 24622@debbugs.gnu.org; Sun, 22 Oct 2017 04:10:56 -0400 Original-Received: by mail-io0-f182.google.com with SMTP id m16so17183917iod.1 for <24622@debbugs.gnu.org>; Sun, 22 Oct 2017 01:10:56 -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; bh=Osj9Uy2RbzyXdS7eWJql0CwetGt9mrNM4z88nhlTNWw=; b=ghqXW0rlk1tKp/IWbhk7iYAi8iCMjEhymPLVJoGrdBedU2f8kG/g7HEAy3gmgxR8AC y+9ZKl7c7I+1/ioEWUMersvESboHOotbvfrlqXVVIL9v8DTkT1doYLCBWaS6ebXOK3Ed 7SkqQ8OkH1pxzWo88iebU6hEz6DnuiwnA+XS2jnSwrT6oETyRE0SZk2mg/Xex3zKMzFe kRNd71vKNmvAEhNW6LppBRDiEoZMuxYlyeGInF79Dml8LZ6doCfv0BipIu/M5IoTVJ9Q vyP9jxqOB64K/dteUkFMP3Ft5NbKHg+1ObJ0LaKmajUJJyEiqUL5u2FcLnyaOdWh9zca 6EwQ== 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; bh=Osj9Uy2RbzyXdS7eWJql0CwetGt9mrNM4z88nhlTNWw=; b=CZ8IIckhdymGwcMMsBVL06TNV2eVtbuBCcZ88Ogrlz5AZ+bq1sihHft4HiPKsFUNms W9QHWDVh7LR4ltYO61S1DOoNtDHfu1srvf93WuRjmWFs0ef0hwZZO5nEH/C3M4oMERL1 rMO0yVvYqUpiUGVpaIQNW3CqfBZUOs6oyEFyTVCnbnoNhH1Mza0/2pqN/Hi+GnmFO/y+ SOLn4JHKlHaWfbwB5x3cWh/Ym7yG3Mtlg/rN1ZEo86DvNmayawbh4ki8a8xaFssHKmgr Hnhh6BdjDuzYn2Yvo+fC9Ln3yarfcqQd+3wnykvsM0//VQZfURQf+w1JQgiglHiy53+z kDGg== X-Gm-Message-State: AMCzsaVUUcMSsnMTWPGTGLWOxwk7gyVXosHXiliNyr+8uDG+1wsHPvfE GxPx6lIaeZ05PpH/cocpFki41A== X-Google-Smtp-Source: ABhQp+S37RcANevr8MQHYvxx86x5GbIMteWUK5gcs0ZN5XdKIYI5vc72zaa6rTRKww8eryh8iJbJig== X-Received: by 10.107.201.69 with SMTP id z66mr12014592iof.118.1508659850728; Sun, 22 Oct 2017 01:10:50 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id g195sm1261844itc.14.2017.10.22.01.10.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2017 01:10:49 -0700 (PDT) In-Reply-To: <83zi8kc43j.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Oct 2017 11:11:44 +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:138842 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Since there were no more comments, please push to the release branch. > > Thanks. I added some tests to the patch. Is the following acceptable? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Don-t-fill-keywords-after-Emacs-Lisp-docstring.patch Content-Description: fill >From f3bdd14347be5ba2e8e8ca91a9b056b768398f73 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sun, 22 Oct 2017 01:46:05 -0600 Subject: [PATCH] Don't fill keywords after Emacs Lisp docstring This approach does mean that keywords that have spaces before them inside of docstrings aren't filled, but I think this is should be fine until Bug#28937 is fixed. * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Add a colon to paragraph-start unconditionally, but require that it proceeds at least one space. (Bug#24622) * test/lisp/emacs-lisp/lisp-tests.el: New tests for Bug#24622 and Bug#7751. --- lisp/emacs-lisp/lisp-mode.el | 11 +++-------- test/lisp/emacs-lisp/lisp-tests.el | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fd12635d85..93435e1b4b 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1267,7 +1267,8 @@ lisp-fill-paragraph ;; case). The `;' and `:' stop the paragraph being filled at following ;; comment lines and at keywords (e.g., in `defcustom'). Left parens are ;; escaped to keep font-locking, filling, & paren matching in the source - ;; file happy. + ;; file happy. The `:' must be preceded by whitespace so that keywords + ;; inside of the docstring don't start new paragraphs (Bug#7751). ;; ;; `paragraph-separate': A clever regexp distinguishes the first line of ;; a docstring and identifies it as a paragraph separator, so that it @@ -1280,13 +1281,7 @@ lisp-fill-paragraph ;; `emacs-lisp-docstring-fill-column' if that value is an integer. (let ((paragraph-start (concat paragraph-start - (format "\\|\\s-*\\([(;%s\"]\\|`(\\|#'(\\)" - ;; If we're inside a string (like the doc - ;; string), don't consider a colon to be - ;; a paragraph-start character. - (if (nth 3 (syntax-ppss)) - "" - ":")))) + "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)")) (paragraph-separate (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) (fill-column (if (and (integerp emacs-lisp-docstring-fill-column) diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el index ae1302bdce..6fb2f8adc9 100644 --- a/test/lisp/emacs-lisp/lisp-tests.el +++ b/test/lisp/emacs-lisp/lisp-tests.el @@ -589,5 +589,36 @@ elisp-tests-with-temp-buffer (should (= (point) before)) (should (= (mark) after)))) +(ert-deftest lisp-fill-paragraph-colon () + "Keywords below Emacs Lisp docstrings should not be filled (Bug#24622). +Keywords inside docstrings should be filled (Bug#7751)." + (elisp-tests-with-temp-buffer + " +\(defcustom custom value + \"First\n +Second\n +=!inside=Third line\" + =!keywords=:type 'sexp + :version \"26.1\" + :group 'lisp-tests)" + (goto-char inside) + (fill-paragraph) + (goto-char keywords) + (beginning-of-line) + (should (looking-at " :type 'sexp\n :version \"26.1\"\n :"))) + (elisp-tests-with-temp-buffer + " +\(defun foo () + \"Summary. +=!inside=Testing keywords: :one :two :three\" + (body))" ; FIXME: Remove parens around body to test bug#28937 once it's fixed + (goto-char inside) + (let ((emacs-lisp-docstring-fill-column 30)) + (fill-paragraph)) + (forward-line) + (should (looking-at ":three")) + (end-of-line) + (should-not (eq (preceding-char) ?\))))) + (provide 'lisp-tests) ;;; lisp-tests.el ends here -- 2.14.2 --=-=-= Content-Type: text/plain I added in a reference to bug#28937, which I just reported. Fixing that would fix also fix this bug, but that solution might not be ready for Emacs 26. --=-=-=--