From 965cffd89cd5727c46a1b0999bef440f8e316742 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Tue, 19 Sep 2017 22:21:37 -0400 Subject: Rename timer-list to list-timers * doc/emacs/anti.texi (Antinews): * doc/lispref/os.texi (Timers): * etc/NEWS: * lisp/emacs-lisp/timer-list.el: (timer-list-mode): Rename timer-list to list-timers. --- lisp/emacs-lisp/timer-list.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 44a315f9806..69c67419835 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -25,7 +25,7 @@ ;;; Code: ;;;###autoload -(defun timer-list (&optional _ignore-auto _nonconfirm) +(defun list-timers (&optional _ignore-auto _nonconfirm) "List all timers in a buffer." (interactive) (pop-to-buffer-same-window (get-buffer-create "*timer-list*")) @@ -67,7 +67,7 @@ (goto-char (point-min))) ;; This command can be destructive if they don't know what they are ;; doing. Kids, don't try this at home! -;;;###autoload (put 'timer-list 'disabled "Beware: manually canceling timers can ruin your Emacs session.") +;;;###autoload (put 'list-timers 'disabled "Beware: manually canceling timers can ruin your Emacs session.") (defvar timer-list-mode-map (let ((map (make-sparse-keymap))) @@ -84,7 +84,7 @@ (setq bidi-paragraph-direction 'left-to-right) (setq truncate-lines t) (buffer-disable-undo) - (setq-local revert-buffer-function 'timer-list) + (setq-local revert-buffer-function #'list-timers) (setq buffer-read-only t) (setq header-line-format (format "%4s %10s %8s %s" -- cgit v1.2.3 From 68baca3ee142b42de0bbe4eba84945780fd157d6 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Thu, 21 Sep 2017 13:35:45 -0700 Subject: Catch more messages in ert-with-message-capture * lisp/emacs-lisp/ert-x.el (ert-with-message-capture): Capture messages from prin1, princ and print. (ert--make-message-advice): New function. (ert--make-print-advice): New function. --- lisp/emacs-lisp/ert-x.el | 57 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 6d9a7d9211a..5af5262e5da 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -286,27 +286,60 @@ BUFFER defaults to current buffer. Does not modify BUFFER." (defmacro ert-with-message-capture (var &rest body) - "Execute BODY while collecting anything written with `message' in VAR. + "Execute BODY while collecting messages in VAR. -Capture all messages produced by `message' when it is called from -Lisp, and concatenate them separated by newlines into one string. +Capture messages issued by Lisp code and concatenate them +separated by newlines into one string. This includes messages +written by `message' as well as objects printed by `print', +`prin1' and `princ' to the echo area. Messages issued from C +code using the above mentioned functions will not be captured. This is useful for separating the issuance of messages by the code under test from the behavior of the *Messages* buffer." (declare (debug (symbolp body)) (indent 1)) - (let ((g-advice (gensym))) + (let ((g-message-advice (gensym)) + (g-print-advice (gensym)) + (g-collector (gensym))) `(let* ((,var "") - (,g-advice (lambda (func &rest args) - (if (or (null args) (equal (car args) "")) - (apply func args) - (let ((msg (apply #'format-message args))) - (setq ,var (concat ,var msg "\n")) - (funcall func "%s" msg)))))) - (advice-add 'message :around ,g-advice) + (,g-collector (lambda (msg) (setq ,var (concat ,var msg)))) + (,g-message-advice (ert--make-message-advice ,g-collector)) + (,g-print-advice (ert--make-print-advice ,g-collector))) + (advice-add 'message :around ,g-message-advice) + (advice-add 'prin1 :around ,g-print-advice) + (advice-add 'princ :around ,g-print-advice) + (advice-add 'print :around ,g-print-advice) (unwind-protect (progn ,@body) - (advice-remove 'message ,g-advice))))) + (advice-remove 'print ,g-print-advice) + (advice-remove 'princ ,g-print-advice) + (advice-remove 'prin1 ,g-print-advice) + (advice-remove 'message ,g-message-advice))))) + +(defun ert--make-message-advice (collector) + "Create around advice for `message' for `ert-collect-messages'. +COLLECTOR will be called with the message before it is passed +to the real `message'." + (lambda (func &rest args) + (if (or (null args) (equal (car args) "")) + (apply func args) + (let ((msg (apply #'format-message args))) + (funcall collector (concat msg "\n")) + (funcall func "%s" msg))))) + +(defun ert--make-print-advice (collector) + "Create around advice for print functions for `ert-collect-messsges'. +The created advice function will just call the original function +unless the output is going to the echo area (when PRINTCHARFUN is +t or PRINTCHARFUN is nil and `standard-output' is t). If the +output is destined for the echo area, the advice function will +convert it to a string and pass it to COLLECTOR first." + (lambda (func object &optional printcharfun) + (if (not (eq t (or printcharfun standard-output))) + (funcall func object printcharfun) + (funcall collector (with-output-to-string + (funcall func object))) + (funcall func object printcharfun)))) (provide 'ert-x) -- cgit v1.2.3 From f656ccdb4384564001ae181c66f2a242bc31a849 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Fri, 22 Sep 2017 16:34:31 -0400 Subject: ; Fix typo * lisp/emacs-lisp/subr-x.el: Nix extra parenthesis. --- lisp/emacs-lisp/subr-x.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 077ad22c75d..edba6550fa2 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -128,7 +128,7 @@ binding value is nil. If all are non-nil, the value of THEN is returned, or the last form in ELSE is returned. Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds -SYMBOL to the value of VALUEFORM). An element can additionally +SYMBOL to the value of VALUEFORM. An element can additionally be of the form (VALUEFORM), which is evaluated and checked for nil; i.e. SYMBOL can be omitted if only the test result is of interest." -- cgit v1.2.3 From f2b2201594b59ff758347644a84cdc8f6b046ec9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 23 Sep 2017 00:34:01 -0700 Subject: ; Spelling and URL fixes --- ChangeLog.2 | 4 ++-- ChangeLog.3 | 8 ++++---- etc/NEWS | 2 +- lisp/calendar/cal-tex.el | 2 +- lisp/emacs-lisp/ert-x.el | 2 +- lisp/org/ChangeLog.1 | 4 ++-- test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el | 2 +- test/lisp/emacs-lisp/edebug-tests.el | 6 +++--- test/lisp/vc/smerge-mode-tests.el | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/ChangeLog.2 b/ChangeLog.2 index bd1800b3307..e789722a4d6 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -4808,7 +4808,7 @@ Link from (emacs)Exiting to (lisp)Killing Emacs * doc/emacs/entering.texi (Exiting): Link to the lispref - manual for further customisations (bug#15445). + manual for further customizations (bug#15445). (cherry picked from commit bc5f27aa099cdde02ca66e71501b89300685ab28) @@ -7845,7 +7845,7 @@ 2016-02-20 Lars Ingebrigtsen - Allow customising the article mode cursor behavior + Allow customizing the article mode cursor behavior * doc/misc/gnus.texi (HTML): Mention gnus-article-show-cursor. diff --git a/ChangeLog.3 b/ChangeLog.3 index 9f43511991c..9e622cef90f 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -12949,7 +12949,7 @@ Link from (emacs)Exiting to (lisp)Killing Emacs * doc/emacs/entering.texi (Exiting): Link to the lispref - manual for further customisations (bug#15445). + manual for further customizations (bug#15445). 2016-04-29 Lars Ingebrigtsen @@ -13159,7 +13159,7 @@ Move the diff command to "Operate" in ibuffer * lisp/ibuffer.el (ibuffer-mode-operate-map): Move the diff - command to the "Operate" menu, and remove the customisation + command to the "Operate" menu, and remove the customization entry to make the "View" menu more logical (bug#1150). 2016-04-27 Lars Ingebrigtsen @@ -16589,7 +16589,7 @@ really changed. (save_window_save): Set the pixel_height_before_size_change and pixel_width_before_size_change fields. - (Vwindow_size_change_functions): Move here definiton from xdisp.c. + (Vwindow_size_change_functions): Move here definition from xdisp.c. * src/xdisp.c (prepare_menu_bars, redisplay_internal): Call run_window_size_change_functions. (Vwindow_size_change_functions): Move definition to window.c. @@ -16842,7 +16842,7 @@ 5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir 1cb1268 Fix todo-mode item date editing bugs 1e996cf Fix "[:upper:]" for non-ASCII characters - 896f993 Allow customising the article mode cursor behavior + 896f993 Allow customizing the article mode cursor behavior 24c1c1d Use pop-to-buffer-same-window in woman.el 2a75f64 New filenotify test for bug#22736 c9bccf7 Report critical battery errors diff --git a/etc/NEWS b/etc/NEWS index 280ab64f37c..34561acae56 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1893,7 +1893,7 @@ of frame decorations on macOS 10.9+. ** Mousewheel and trackpad scrolling on macOS 10.7+ now behaves more like the macOS default. The new variables 'ns-use-system-mwheel-acceleration', 'ns-touchpad-scroll-line-height' -and 'ns-touchpad-use-momentum' can be used to customise the behavior. +and 'ns-touchpad-use-momentum' can be used to customize the behavior. ---------------------------------------------------------------------- diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 72db03e5e60..1d295606f23 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -266,7 +266,7 @@ specified in ARGS. When ARGS is omitted, by default the option \"12pt,a4paper\" is passed. When ARGS has any other value, then no option is passed to the class. -Insert the \"\\usepacakge{geometry}\" directive when ARGS +Insert the \"\\usepackage{geometry}\" directive when ARGS contains the \"landscape\" string." (set-buffer (generate-new-buffer cal-tex-buffer)) (save-match-data diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 5af5262e5da..71d46c11077 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -328,7 +328,7 @@ to the real `message'." (funcall func "%s" msg))))) (defun ert--make-print-advice (collector) - "Create around advice for print functions for `ert-collect-messsges'. + "Create around advice for print functions for `ert-collect-messages'. The created advice function will just call the original function unless the output is going to the echo area (when PRINTCHARFUN is t or PRINTCHARFUN is nil and `standard-output' is t). If the diff --git a/lisp/org/ChangeLog.1 b/lisp/org/ChangeLog.1 index 366a3ee9fcd..ee50f6fb040 100644 --- a/lisp/org/ChangeLog.1 +++ b/lisp/org/ChangeLog.1 @@ -5015,10 +5015,10 @@ * ox-latex.el (org-latex-listings): Update docstring. * org-pcomplete.el (pcomplete/org-mode/file-option/options): - Apply changes to export back-end definiton. + Apply changes to export back-end definition. * org.el (org-get-export-keywords): Apply changes to export - back-end definiton. + back-end definition. * ox-html.el (org-html--format-toc-headline): Make use of anonymous back-ends. diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el index 0cc7b1e8b4e..f52a2b1896c 100644 --- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el +++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el @@ -17,7 +17,7 @@ ;; 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 `http://www.gnu.org/licenses/'. +;; along with this program. If not, see . ;;; Commentary: diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 037278e772c..02f4d1c5abe 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -17,7 +17,7 @@ ;; 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 `http://www.gnu.org/licenses/'. +;; along with this program. If not, see . ;;; Commentary: @@ -310,7 +310,7 @@ Then clear edebug-tests' saved messages." (setq edebug-tests-messages "")) (defun edebug-tests-locate-def (def-name) - "Search for a definiton of DEF-NAME from the start of the current buffer. + "Search for a definition of DEF-NAME from the start of the current buffer. Place point at the end of DEF-NAME in the buffer." (goto-char (point-min)) (re-search-forward (concat "def\\S-+ edebug-test-code-" def-name))) @@ -584,7 +584,7 @@ test and possibly others should be updated." (ert-deftest edebug-tests-error-trying-to-set-breakpoint-in-uninstrumented-code () - "Edebug refuses to set a breakpoint in uninsented code." + "Edebug refuses to set a breakpoint in uninstrumented code." (edebug-tests-with-normal-env (edebug-tests-setup-@ "fac" '(5) t) (let* ((debug-on-error nil) diff --git a/test/lisp/vc/smerge-mode-tests.el b/test/lisp/vc/smerge-mode-tests.el index 204a4b93ab5..10d090632da 100644 --- a/test/lisp/vc/smerge-mode-tests.el +++ b/test/lisp/vc/smerge-mode-tests.el @@ -15,7 +15,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . +;; along with GNU Emacs. If not, see . ;;; Code: -- cgit v1.2.3