commit 3b79ff617918adcc775fce392504da1fb4b2030a (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Fri Sep 18 20:30:00 2020 +0200 Fix typo in project-kill-buffers * lisp/progmodes/project.el (project-kill-buffers): Fix typo. Reported by Manuel Uberti diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7fa19d3c6d..39120457b6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1105,7 +1105,7 @@ identical. Only the buffers that match a condition in `project-kill-buffer-conditions' will be killed. If NO-CONFIRM is non-nil, the command will not ask the user for confirmation. NO-CONFIRM is always nil when the command is invoked -interactivly." +interactively." (interactive) (let* ((pr (project-current t)) (bufs (project--buffers-to-kill pr))) commit a1d9463ae7b00623bb52186e92be6d3388ca188b Author: Andrii Kolomoiets Date: Sat Sep 5 22:18:59 2020 +0300 Save and restore point in ewoc-invalidate * lisp/emacs-lisp/ewoc.el (ewoc--refresh-node): Save and restore point line and column offset. (eowc-map) (ewoc--invalidate) (ewoc-set-hf): Don't use save-excursion * lisp/vc/vc-dir.el (vc-dir-update): Don't save/restore point on calling 'ewoc-invalidate'. diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index 78ada3e076..5112322cfd 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -205,15 +205,26 @@ NODE and leaving the new node's start there. Return the new node." (defun ewoc--refresh-node (pp node dll) "Redisplay the element represented by NODE using the pretty-printer PP." - (let ((inhibit-read-only t) - (m (ewoc--node-start-marker node)) - (R (ewoc--node-right node))) - ;; First, remove the string from the buffer: - (delete-region m (ewoc--node-start-marker R)) - ;; Calculate and insert the string. - (goto-char m) - (funcall pp (ewoc--node-data node)) - (ewoc--adjust m (point) R dll))) + (let* ((m (ewoc--node-start-marker node)) + (R (ewoc--node-right node)) + (end (ewoc--node-start-marker R)) + (inhibit-read-only t) + (offset (if (= (point) end) + 'end + (when (< m (point) end) + (- (point) m))))) + (save-excursion + ;; First, remove the string from the buffer: + (delete-region m end) + ;; Calculate and insert the string. + (goto-char m) + (funcall pp (ewoc--node-data node)) + (setq end (point)) + (ewoc--adjust m (point) R dll)) + (when offset + (goto-char (if (eq offset 'end) + end + (min (+ m offset) (1- end))))))) (defun ewoc--wrap (func) (lambda (data) @@ -342,11 +353,10 @@ arguments will be passed to MAP-FUNCTION." ((footer (ewoc--footer ewoc)) (pp (ewoc--pretty-printer ewoc)) (node (ewoc--node-nth dll 1))) - (save-excursion - (while (not (eq node footer)) - (if (apply map-function (ewoc--node-data node) args) - (ewoc--refresh-node pp node dll)) - (setq node (ewoc--node-next dll node)))))) + (while (not (eq node footer)) + (if (apply map-function (ewoc--node-data node) args) + (ewoc--refresh-node pp node dll)) + (setq node (ewoc--node-next dll node))))) (defun ewoc-delete (ewoc &rest nodes) "Delete NODES from EWOC." @@ -461,9 +471,8 @@ If the EWOC is empty, nil is returned." Delete current text first, thus effecting a \"refresh\"." (ewoc--set-buffer-bind-dll-let* ewoc ((pp (ewoc--pretty-printer ewoc))) - (save-excursion - (dolist (node nodes) - (ewoc--refresh-node pp node dll))))) + (dolist (node nodes) + (ewoc--refresh-node pp node dll)))) (defun ewoc-goto-prev (ewoc arg) "Move point to the ARGth previous element in EWOC. @@ -566,9 +575,8 @@ Return nil if the buffer has been deleted." (hf-pp (ewoc--hf-pp ewoc))) (setf (ewoc--node-data head) header (ewoc--node-data foot) footer) - (save-excursion - (ewoc--refresh-node hf-pp head dll) - (ewoc--refresh-node hf-pp foot dll)))) + (ewoc--refresh-node hf-pp head dll) + (ewoc--refresh-node hf-pp foot dll))) (provide 'ewoc) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 6c219005ce..cdf8ab984e 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -451,11 +451,7 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." (setf (vc-dir-fileinfo->state (ewoc-data node)) (nth 1 entry)) (setf (vc-dir-fileinfo->extra (ewoc-data node)) (nth 2 entry)) (setf (vc-dir-fileinfo->needs-update (ewoc-data node)) nil) - ;; `ewoc-invalidate' will kill line and insert new text, - ;; let's keep point column. - (let ((p (point))) - (ewoc-invalidate vc-ewoc node) - (goto-char p))) + (ewoc-invalidate vc-ewoc node)) ;; If the state is nil, the file does not exist ;; anymore, so remember the entry so we can remove ;; it after we are done inserting all ENTRIES. commit d470cff770db7309f330528b0cc7b21514caff91 Author: Adam Sjøgren Date: Fri Sep 18 16:22:55 2020 +0200 Make emacs-uptime insert at point with prefix arg * lisp/time.el (emacs-uptime): Insert at point when called with prefix argument. (Bug#20112) diff --git a/lisp/time.el b/lisp/time.el index e2fab4a141..cb3a8470ed 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -588,19 +588,23 @@ To turn off the world time display, go to the window and type `\\[quit-window]'. (world-clock-cancel-timer))) ;;;###autoload -(defun emacs-uptime (&optional format) +(defun emacs-uptime (&optional format here) "Return a string giving the uptime of this instance of Emacs. FORMAT is a string to format the result, using `format-seconds'. -For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"." - (interactive) +For example, the Unix uptime command format is \"%D, %z%2h:%.2m\". +If the optional argument HERE is non-nil, insert string at +point." + (interactive "i\nP") (let ((str (format-seconds (or format "%Y, %D, %H, %M, %z%S") (time-convert (time-since before-init-time) 'integer)))) - (if (called-interactively-p 'interactive) - (message "%s" str) - str))) + (if here + (insert str) + (if (called-interactively-p 'interactive) + (message "%s" str) + str)))) ;;;###autoload (defun emacs-init-time () commit 5938fec07b49de9098091e65f66348bdfa6054f8 Author: Stefan Kangas Date: Fri Sep 18 14:43:34 2020 +0200 Doc fix in directory-free-space-program * lisp/files.el (directory-free-space-program): Doc fix; there is no need to repeat that its obsolete here since it will be shown by customize, describe-variable, etc. automatically. diff --git a/lisp/files.el b/lisp/files.el index e6629d2a21..07d66c9d38 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6814,9 +6814,7 @@ We assume the output has the format of `df'. The value of this variable must be just a command name or file name; if you want to specify options, use `directory-free-space-args'. -A value of nil disables this feature. - -This variable is obsolete; Emacs no longer uses it." +A value of nil disables this feature." :type '(choice (string :tag "Program") (const :tag "None" nil)) :group 'dired) (make-obsolete-variable 'directory-free-space-program commit 610be8f64db24f64fadc754a2e88cc59f1adb355 Author: Lars Ingebrigtsen Date: Fri Sep 18 15:03:03 2020 +0200 Fix the defcustom type of eww-retrieve-command * lisp/net/eww.el (eww-retrieve-command): The type is a list of strings. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2717dfbe79..8918be0d2e 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -141,7 +141,7 @@ this should be a list where the first item is the program, and the rest are the arguments." :version "28.1" :type '(choice (const :tag "Use `url-retrieve'" nil) - (list string))) + (repeat string))) (defcustom eww-use-external-browser-for-content-type "\\`\\(video/\\|audio/\\|application/ogg\\)" commit 635666e7bfca0117eeec6c769b02d71383607093 Author: Lars Ingebrigtsen Date: Fri Sep 18 13:28:12 2020 +0200 Use a widget for the face link in Customize buffers * doc/lispref/customize.texi (Common Keywords): Document it. * lisp/cus-edit.el (custom-face-value-create): Use a widget instead of a button so that TAB works (bug#20664). * lisp/wid-edit.el (face-link): New widget. (widget-face-link-action): New action. diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index c35444f581..8591247079 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -124,6 +124,11 @@ Link to the documentation of a variable; @var{variable} is a string which specifies the name of the variable to describe with @code{describe-variable} when the user invokes this link. +@item (face-link @var{face}) +Link to the documentation of a face; @var{face} is a string which +specifies the name of the face to describe with @code{describe-face} +when the user invokes this link. + @item (custom-group-link @var{group}) Link to another customization group. Invoking it creates a new customization buffer for @var{group}. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 9626b3cf81..a62b623c44 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3571,9 +3571,13 @@ the present value is saved to its :shown-value property instead." buttons) ;; Face name (tag). (insert " ") - (insert-text-button tag - 'action (lambda (&rest _x) - (find-face-definition symbol))) + (push (widget-create-child-and-convert + widget 'face-link + :button-face 'link + :tag tag + :action (lambda (&rest _x) + (find-face-definition symbol))) + buttons) (insert (cond ((eq custom-buffer-style 'face) " ") ((string-match-p "face\\'" tag) ":") diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 5ac52777f8..13d850a57f 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1917,6 +1917,16 @@ If END is omitted, it defaults to the length of LIST." "Show the variable specified by WIDGET." (describe-variable (widget-value widget))) +;;; The `face-link' Widget. + +(define-widget 'face-link 'link + "A link to an Emacs face." + :action 'widget-face-link-action) + +(defun widget-face-link-action (widget &optional _event) + "Show the variable specified by WIDGET." + (describe-face (widget-value widget))) + ;;; The `file-link' Widget. (define-widget 'file-link 'link commit b23beef3f2fecdd179b448dca5ab6d51c9580f92 Author: Michael Albinus Date: Fri Sep 18 11:17:42 2020 +0200 Fix error in D-Bus test * test/lisp/net/dbus-tests.el (dbus-test04-register-method): Do not check for error message text. (dbus--test-signal-handler): Fix docstring. (dbus--test-timeout-handler): New defun. (dbus-test05-register-signal) (dbus-test06-register-property-emits-signal): Use it. diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 18c2a2ad6d..8affc2ddd4 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -222,12 +222,12 @@ This includes initialization and closing the bus." ;; The service is not registered yet. (should (equal - (should-error - (dbus-call-method - :session dbus--test-service dbus--test-path - dbus--test-interface method1 :timeout 10 "foo")) - `(dbus-error - ,dbus-error-service-unknown "The name is not activatable"))) + (butlast + (should-error + (dbus-call-method + :session dbus--test-service dbus--test-path + dbus--test-interface method1 :timeout 10 "foo"))) + `(dbus-error ,dbus-error-service-unknown))) ;; Register. (should @@ -283,7 +283,6 @@ This includes initialization and closing the bus." (should-not (dbus-unregister-object registered)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-call-method @@ -298,9 +297,13 @@ This includes initialization and closing the bus." "Received signal value in `dbus--test-signal-handler'.") (defun dbus--test-signal-handler (&rest args) - "Signal handler for `dbus-test05-register-signal'." + "Signal handler for `dbus-test*-signal'." (setq dbus--test-signal-received args)) +(defun dbus--test-timeout-handler (&rest _ignore) + "Timeout handler, reporting a failed test." + (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) + (ert-deftest dbus-test05-register-signal () "Check signal registration for an own service." (skip-unless dbus--test-enabled-session-bus) @@ -327,8 +330,9 @@ This includes initialization and closing the bus." (dbus-send-signal :session dbus--test-service dbus--test-path dbus--test-interface member "foo") - (while (null dbus--test-signal-received) - (read-event nil nil 0.1)) + (with-timeout (1 (dbus--test-timeout-handler)) + (while (null dbus--test-signal-received) + (read-event nil nil 0.1))) (should (equal dbus--test-signal-received '("foo"))) ;; Send two arguments, compound types. @@ -337,8 +341,9 @@ This includes initialization and closing the bus." :session dbus--test-service dbus--test-path dbus--test-interface member '(:array :byte 1 :byte 2 :byte 3) '(:variant :string "bar")) - (while (null dbus--test-signal-received) - (read-event nil nil 0.1)) + (with-timeout (1 (dbus--test-timeout-handler)) + (while (null dbus--test-signal-received) + (read-event nil nil 0.1))) (should (equal dbus--test-signal-received '((1 2 3) ("bar")))) ;; Unregister signal. @@ -385,7 +390,6 @@ This includes initialization and closing the bus." (let ((dbus-show-dbus-errors t)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-set-property @@ -416,7 +420,6 @@ This includes initialization and closing the bus." (let ((dbus-show-dbus-errors t)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-get-property @@ -469,7 +472,6 @@ This includes initialization and closing the bus." (let ((dbus-show-dbus-errors t)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-get-property @@ -483,7 +485,6 @@ This includes initialization and closing the bus." (let ((dbus-show-dbus-errors t)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-set-property @@ -522,7 +523,6 @@ This includes initialization and closing the bus." (let ((dbus-show-dbus-errors t)) (should (equal - ;; We don't care the error message text. (butlast (should-error (dbus-get-property @@ -716,8 +716,9 @@ This includes initialization and closing the bus." dbus--test-interface property :readwrite "foo" 'emits-signal) `((:property :session ,dbus--test-interface ,property) (,dbus--test-service ,dbus--test-path)))) - (while (null dbus--test-signal-received) - (read-event nil nil 0.1)) + (with-timeout (1 (dbus--test-timeout-handler)) + (while (null dbus--test-signal-received) + (read-event nil nil 0.1))) ;; It returns two arguments, "changed_properties" (an array of ;; dict entries) and "invalidated_properties" (an array of ;; strings). @@ -739,8 +740,9 @@ This includes initialization and closing the bus." dbus--test-interface property '(:array :byte 1 :byte 2 :byte 3)) '(1 2 3))) - (while (null dbus--test-signal-received) - (read-event nil nil 0.1)) + (with-timeout (1 (dbus--test-timeout-handler)) + (while (null dbus--test-signal-received) + (read-event nil nil 0.1))) (should (equal dbus--test-signal-received `(((,property ((((1) (2) (3)))))) ()))) commit 013ac76b89a2e2f8d8240cfd84958109bb25340f Author: Michael Albinus Date: Fri Sep 18 11:17:17 2020 +0200 * lisp/progmodes/cperl-mode.el (cperl-set-style): Fix docstring. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 8804e83fce..d35eab15a2 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6245,7 +6245,8 @@ See examples in `cperl-style-examples'.") "Set CPerl mode variables to use one of several different indentation styles. The arguments are a string representing the desired style. The list of styles is in `cperl-style-alist', available styles -are CPerl, PBP, PerlStyle, GNU, K&R, BSD, C++ and Whitesmith. +are \"CPerl\", \"PBP\", \"PerlStyle\", \"GNU\", \"K&R\", \"BSD\", \"C++\" +and \"Whitesmith\". The current value of style is memorized (unless there is a memorized data already), may be restored by `cperl-set-style-back'. commit 1283d3a5b297afade98073de4cc4732e904bda59 Author: Dmitry Gutov Date: Fri Sep 18 12:15:46 2020 +0300 Fix typo, reported by Manuel Uberti * lisp/progmodes/project.el (project-kill-buffer-conditions): Fix typo. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7180ba317c..7fa19d3c6d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1021,7 +1021,7 @@ Each condition is either: The car can be one of the following: * `major-mode': the buffer is killed if the buffer's major mode is eq to the cons-cell's cdr - * `defived-mode': the buffer is killed if the buffer's major + * `derived-mode': the buffer is killed if the buffer's major mode is derived from the major mode denoted by the cons-cell's cdr * `not': the cdr is interpreted as a negation of a condition. commit a22fdc962003b9f46fe839a37d64d80427bec850 Author: Eli Zaretskii Date: Fri Sep 18 11:43:12 2020 +0300 Minor cleanup of last change * src/termchar.h (struct tty_display_info): * src/term.c (turn_on_face, tty_capable_p): Reformat new code. diff --git a/src/term.c b/src/term.c index 22035f4fe3..3f528585ba 100644 --- a/src/term.c +++ b/src/term.c @@ -1931,7 +1931,8 @@ turn_on_face (struct frame *f, int face_id) if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) OUTPUT1_IF (tty, tty->TS_enter_underline_mode); - if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) + if (face->tty_strike_through_p + && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) OUTPUT1_IF (tty, tty->TS_enter_strike_through_mode); if (tty->TN_max_colors > 0) @@ -2010,12 +2011,20 @@ tty_capable_p (struct tty_display_info *tty, unsigned int caps) if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \ return 0; - TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE); - TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); - TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); - TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); - TTY_CAPABLE_P_TRY (tty, TTY_CAP_ITALIC, tty->TS_enter_italic_mode, NC_ITALIC); - TTY_CAPABLE_P_TRY (tty, TTY_CAP_STRIKE_THROUGH, tty->TS_enter_strike_through_mode, NC_STRIKE_THROUGH); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, + NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_ITALIC, tty->TS_enter_italic_mode, NC_ITALIC); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_STRIKE_THROUGH, tty->TS_enter_strike_through_mode, + NC_STRIKE_THROUGH); /* We can do it! */ return 1; diff --git a/src/termchar.h b/src/termchar.h index a8b3051767..c967e7d04f 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -136,7 +136,8 @@ struct tty_display_info const char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */ const char *TS_exit_underline_mode; /* "us" -- start underlining. */ const char *TS_enter_underline_mode; /* "ue" -- end underlining. */ - const char *TS_enter_strike_through_mode; /* "smxx" -- turn on strike-through mode. */ + const char *TS_enter_strike_through_mode; /* "smxx" -- turn on strike-through + mode. */ /* "as"/"ae" -- start/end alternate character set. Not really supported, yet. */