From a012ec766c9d9bac0a56e814589a4b3b93311c28 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sun, 22 Oct 2017 01:46:05 -0600 Subject: 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 follows 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 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fd12635d85c..93435e1b4bb 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1267,7 +1267,8 @@ and initial semicolons." ;; 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 @@ and initial semicolons." ;; `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) -- cgit v1.2.3 From 928a106939080df7df6ea158318f5afa5579ddcf Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Mon, 16 Oct 2017 11:40:38 -0700 Subject: Fix Edebug specs for map-let and with-maps-do * lisp/emacs-lisp/map.el (map-let): Fix Edebug spec (bug#24777). * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Fix Edebug spec. --- lisp/emacs-lisp/map.el | 3 ++- test/lisp/emacs-lisp/map-tests.el | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index 0f9a74422b4..2a3e1d0a4b0 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -73,7 +73,8 @@ KEYS can also be a list of (KEY VARNAME) pairs, in which case KEY is an unquoted form. MAP can be a list, hash-table or array." - (declare (indent 2) (debug t)) + (declare (indent 2) + (debug ((&rest &or symbolp ([form symbolp])) form body))) `(pcase-let ((,(map--make-pcase-patterns keys) ,map)) ,@body)) diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el index 0a888d88b72..a434c9bd066 100644 --- a/test/lisp/emacs-lisp/map-tests.el +++ b/test/lisp/emacs-lisp/map-tests.el @@ -36,7 +36,7 @@ Each map is built from the following alist data: Evaluate BODY for each created map. \(fn (var map) body)" - (declare (indent 1) (debug t)) + (declare (indent 1) (debug (symbolp body))) (let ((alist (make-symbol "alist")) (vec (make-symbol "vec")) (ht (make-symbol "ht"))) -- cgit v1.2.3 From 0c536a20fb4833bafea1c2a14b9ff2bac2a3ebd8 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Tue, 10 Oct 2017 15:46:53 -0700 Subject: Display commit in package description, if available (Bug#28637) MELPA includes a :commit field in its packages (https://github.com/melpa/package-build/pull/6). You can use this to tell if MELPA has processed a recently-merged change. This commit adds that metadata to the package description buffer. * lisp/emacs-lisp/package.el: Display commit in package description. Copyright-paperwork-exempt: yes --- lisp/emacs-lisp/package.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8b101c1323c..dd05c70dc8e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2260,6 +2260,7 @@ Otherwise no newline is inserted." (archive (if desc (package-desc-archive desc))) (extras (and desc (package-desc-extras desc))) (homepage (cdr (assoc :url extras))) + (commit (cdr (assoc :commit extras))) (keywords (if desc (package-desc--keywords desc))) (built-in (eq pkg-dir 'builtin)) (installable (and archive (not built-in))) @@ -2332,6 +2333,8 @@ Otherwise no newline is inserted." (and version (package--print-help-section "Version" (package-version-join version))) + (when commit + (package--print-help-section "Commit" commit)) (when desc (package--print-help-section "Summary" (package-desc-summary desc))) -- cgit v1.2.3 From 7f089aa5f6d208209b2cfef8e0d3d9530e191248 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Fri, 27 Oct 2017 20:21:26 +0900 Subject: Require seq in rmc.el * lisp/emacs-lisp/rmc.el: Require seq (Bug#28975). * test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice): Add test. --- lisp/emacs-lisp/rmc.el | 2 ++ test/lisp/emacs-lisp/rmc-tests.el | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/lisp/emacs-lisp/rmc-tests.el (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 0be6971992c..ca11c596638 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -23,6 +23,8 @@ ;;; Code: +(require 'seq) + ;;;###autoload (defun read-multiple-choice (prompt choices) "Ask user a multiple choice question. diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el new file mode 100644 index 00000000000..7ab79fda774 --- /dev/null +++ b/test/lisp/emacs-lisp/rmc-tests.el @@ -0,0 +1,41 @@ +;;; rmc-tests.el --- Test suite for rmc.el -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; Author: Tino Calancha +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'rmc) +(eval-when-compile (require 'cl-lib)) + + +(ert-deftest test-read-multiple-choice () + (dolist (char '(?y ?n)) + (cl-letf* (((symbol-function #'read-char) (lambda () char)) + (str (if (eq char ?y) "yes" "no"))) + (should (equal (list char str) + (read-multiple-choice "Do it? " '((?y "yes") (?n "no")))))))) + + +(provide 'rmc-tests) +;;; rmc-tests.el ends here -- cgit v1.2.3