commit f5ed8ded9d0169b159280a7aad5baf5c1e4e1371 (HEAD, refs/remotes/origin/master) Author: Mattias Engdegård Date: Fri Aug 28 10:26:32 2020 +0200 * test/src/fileio-tests.el: Preserve HOME when a test fails diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index ba16068147..7baa4c7e2f 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -98,26 +98,24 @@ Also check that an encoding error can appear in a symlink." (ert-deftest fileio-tests--relative-HOME () "Test that expand-file-name works even when HOME is relative." - (let ((old-home (getenv "HOME"))) + (let ((process-environment (copy-sequence process-environment))) (setenv "HOME" "a/b/c") (should (equal (expand-file-name "~/foo") (expand-file-name "a/b/c/foo"))) (when (memq system-type '(ms-dos windows-nt)) ;; Test expansion of drive-relative file names. (setenv "HOME" "x:foo") - (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) - (setenv "HOME" old-home))) + (should (equal (expand-file-name "~/bar") "x:/foo/bar"))))) (ert-deftest fileio-tests--HOME-trailing-slash () "Test that expand-file-name of \"~\" respects trailing slash." - (let ((old-home (getenv "HOME"))) + (let ((process-environment (copy-sequence process-environment))) (dolist (home (if (memq system-type '(windows-nt ms-dos)) '("c:/a/b/c" "c:/a/b/c/") '("/a/b/c" "/a/b/c/"))) (setenv "HOME" home) - (should (equal (expand-file-name "~") (expand-file-name home)))) - (setenv "HOME" old-home))) + (should (equal (expand-file-name "~") (expand-file-name home)))))) (ert-deftest fileio-tests--expand-file-name-trailing-slash () (dolist (fooslashalias '("foo/" "foo//" "foo/." "foo//." "foo///././." commit 43d0fbd270dd34bf3c75354c9bd186df490a4875 Author: Eli Zaretskii Date: Fri Aug 28 09:58:50 2020 +0300 Fix most of fileio-tests on MS-Windows * test/src/fileio-tests.el (fileio-tests--HOME-trailing-slash) (fileio-tests--expand-file-name-trailing-slash): Account for drive letters in MS-Windows/MS-DOS file names. (Bug#26911) diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 8b76912f5e..ba16068147 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -111,7 +111,10 @@ Also check that an encoding error can appear in a symlink." (ert-deftest fileio-tests--HOME-trailing-slash () "Test that expand-file-name of \"~\" respects trailing slash." (let ((old-home (getenv "HOME"))) - (dolist (home '("/a/b/c" "/a/b/c/")) + (dolist (home + (if (memq system-type '(windows-nt ms-dos)) + '("c:/a/b/c" "c:/a/b/c/") + '("/a/b/c" "/a/b/c/"))) (setenv "HOME" home) (should (equal (expand-file-name "~") (expand-file-name home)))) (setenv "HOME" old-home))) @@ -119,13 +122,26 @@ Also check that an encoding error can appear in a symlink." (ert-deftest fileio-tests--expand-file-name-trailing-slash () (dolist (fooslashalias '("foo/" "foo//" "foo/." "foo//." "foo///././." "foo/a/..")) - (should (equal (expand-file-name fooslashalias "/") "/foo/")) - (should (equal (expand-file-name (concat "/" fooslashalias)) "/foo/"))) - (should (equal (expand-file-name "." "/usr/spool/") "/usr/spool/")) - (should (equal (expand-file-name "" "/usr/spool/") "/usr/spool/")) + (if (memq system-type '(windows-nt ms-dos)) + (progn + (should (equal (expand-file-name fooslashalias "c:/") "c:/foo/")) + (should (equal (expand-file-name (concat "c:/" fooslashalias)) + "c:/foo/")) + (should (equal (expand-file-name "." "c:/usr/spool/") + "c:/usr/spool/")) + (should (equal (expand-file-name "" "c:/usr/spool/") + "c:/usr/spool/"))) + (should (equal (expand-file-name fooslashalias "/") "/foo/")) + (should (equal (expand-file-name (concat "/" fooslashalias)) "/foo/")) + (should (equal (expand-file-name "." "/usr/spool/") "/usr/spool/")) + (should (equal (expand-file-name "" "/usr/spool/") "/usr/spool/")))) ;; Trailing "B/C/.." means B must be a directory. - (should (equal (expand-file-name "/a/b/c/..") "/a/b/")) - (should (equal (expand-file-name "/a/b/c/../") "/a/b/"))) + (if (memq system-type '(windows-nt ms-dos)) + (progn + (should (equal (expand-file-name "c:/a/b/c/..") "c:/a/b/")) + (should (equal (expand-file-name "c:/a/b/c/../") "c:/a/b/"))) + (should (equal (expand-file-name "/a/b/c/..") "/a/b/")) + (should (equal (expand-file-name "/a/b/c/../") "/a/b/")))) (ert-deftest fileio-tests--insert-file-interrupt () (let ((text "-*- coding: binary -*-\n\xc3\xc3help") commit 0bbc84630f12e848e19c39dce01f3d14559bf70b Author: Paul Eggert Date: Thu Aug 27 14:46:52 2020 -0700 Fix recently-introduced expand-file-name bug The bug was that (expand-file-name "~") returned something like "/home/eggert/" instead of "/home/eggert". Problem reported by Mattias Engdegård (Bug#26911#27). * src/fileio.c (Fexpand_file_name): When concatenating NEWDIR to NM, instead of stripping trailing slashes from NEWDIR (which can turn non-symlinks into symlinks), strip leading slashes from NM. This also simplifies the code by removing no-longer-needed DOS_NT special-casing. Also, remove an unnecessary ‘target[length] = 0;’ as that byte will be overwritten by the next memcpy anyway. * test/src/fileio-tests.el (fileio-tests--HOME-trailing-slash): New test. diff --git a/src/fileio.c b/src/fileio.c index b70dff1c22..47e5e46a00 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -827,9 +827,9 @@ the root directory. */) ptrdiff_t tlen; #ifdef DOS_NT int drive = 0; - bool collapse_newdir = true; bool is_escaped = 0; #endif /* DOS_NT */ + bool collapse_newdir = true; ptrdiff_t length, nbytes; Lisp_Object handler, result, handled_name; bool multibyte; @@ -1183,9 +1183,7 @@ the root directory. */) newdir = SSDATA (hdir); newdirlim = newdir + SBYTES (hdir); } -#ifdef DOS_NT collapse_newdir = false; -#endif } else /* ~user/filename */ { @@ -1205,9 +1203,7 @@ the root directory. */) while (*++nm && !IS_DIRECTORY_SEP (*nm)) continue; -#ifdef DOS_NT collapse_newdir = false; -#endif } /* If we don't find a user of that name, leave the name @@ -1374,12 +1370,7 @@ the root directory. */) } #endif /* DOS_NT */ - /* Ignore any slash at the end of newdir, unless newdir is - just "/" or "//". */ length = newdirlim - newdir; - while (length > 1 && IS_DIRECTORY_SEP (newdir[length - 1]) - && ! (length == 2 && IS_DIRECTORY_SEP (newdir[0]))) - length--; /* Now concatenate the directory and name to new space in the stack frame. */ tlen = length + file_name_as_directory_slop + (nmlim - nm) + 1; @@ -1398,25 +1389,22 @@ the root directory. */) if (newdir) { - if (IS_DIRECTORY_SEP (nm[0])) + if (!collapse_newdir) { -#ifdef DOS_NT - /* If newdir is effectively "C:/", then the drive letter will have - been stripped and newdir will be "/". Concatenating with an - absolute directory in nm produces "//", which will then be - incorrectly treated as a network share. Ignore newdir in - this case (keeping the drive letter). */ - if (!(drive && nm[0] && IS_DIRECTORY_SEP (newdir[0]) - && newdir[1] == '\0')) -#endif - { - memcpy (target, newdir, length); - target[length] = 0; - nbytes = length; - } + /* With ~ or ~user, leave NEWDIR as-is to avoid transforming + it from a symlink (or a regular file!) into a directory. */ + memcpy (target, newdir, length); + nbytes = length; } else nbytes = file_name_as_directory (target, newdir, length, multibyte); + + /* If TARGET ends in a directory separator, omit leading + directory separators from NM so that concatenating a TARGET "/" + to an NM "/foo" does not result in the incorrect "//foo". */ + if (nbytes && IS_DIRECTORY_SEP (target[nbytes - 1])) + while (IS_DIRECTORY_SEP (nm[0])) + nm++; } memcpy (target + nbytes, nm, nmlim - nm + 1); diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 1516590795..8b76912f5e 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -108,6 +108,14 @@ Also check that an encoding error can appear in a symlink." (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) (setenv "HOME" old-home))) +(ert-deftest fileio-tests--HOME-trailing-slash () + "Test that expand-file-name of \"~\" respects trailing slash." + (let ((old-home (getenv "HOME"))) + (dolist (home '("/a/b/c" "/a/b/c/")) + (setenv "HOME" home) + (should (equal (expand-file-name "~") (expand-file-name home)))) + (setenv "HOME" old-home))) + (ert-deftest fileio-tests--expand-file-name-trailing-slash () (dolist (fooslashalias '("foo/" "foo//" "foo/." "foo//." "foo///././." "foo/a/..")) commit 1153b238aef5a48bbecd5a58cd6a14dae9ec1d2f Author: Eric Abrahamsen Date: Thu Aug 27 08:00:14 2020 -0700 Set Gnus server 'closed status in gnus-close-server * lisp/gnus/gnus-int.el (gnus-close-server): Set 'closed status here. * lisp/gnus/gnus-group.el (gnus-group-suspend): Not here. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 97e10a37a2..d613bc86ad 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4300,8 +4300,7 @@ The hook `gnus-suspend-gnus-hook' is called before actually suspending." ;; Closing all the backends is useful (for instance) when when the ;; IP addresses have changed and you need to reconnect. (dolist (elem gnus-opened-servers) - (gnus-close-server (car elem)) - (setcar (cdr elem) 'closed)) + (gnus-close-server (car elem))) (when group-buf (bury-buffer group-buf) (delete-windows-on group-buf t)))) diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 60ebc07c34..da385a1802 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -351,9 +351,12 @@ If it is down, start it up (again)." "Close the connection to GNUS-COMMAND-METHOD." (when (stringp gnus-command-method) (setq gnus-command-method (gnus-server-to-method gnus-command-method))) - (funcall (gnus-get-function gnus-command-method 'close-server) - (nth 1 gnus-command-method) - (nthcdr 2 gnus-command-method))) + (prog1 + (funcall (gnus-get-function gnus-command-method 'close-server) + (nth 1 gnus-command-method) + (nthcdr 2 gnus-command-method)) + (when-let ((elem (assoc gnus-command-method gnus-opened-servers))) + (setf (nth 1 elem) 'closed)))) (defun gnus-request-list (gnus-command-method) "Request the active file from GNUS-COMMAND-METHOD." commit 6ff37fc439f9a921cfced62d784050b9ae9c0c77 Author: Eric Abrahamsen Date: Thu Aug 27 13:57:03 2020 -0700 Switch Gnus D-Bus signal from :session to :system * lisp/gnus/gnus-dbus.el (gnus-dbus-register-sleep-signal): Apparently this needs to be :system -- perhaps because PrepareForSleep is a system-level event? diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el index dbfa7fb693..8fbeffba43 100644 --- a/lisp/gnus/gnus-dbus.el +++ b/lisp/gnus/gnus-dbus.el @@ -44,7 +44,7 @@ Used to unregister the signal.") "Use `dbus-register-signal' to close servers on sleep." (when (featurep 'dbusbind) (setq gnus-dbus-sleep-registration-object - (dbus-register-signal :session + (dbus-register-signal :system "org.freedesktop.login1" "/org/freedesktop/login1" "org.freedesktop.login1.Manager" commit 0016f5f149f4ca07cbe79aec54b316d8b0722aad Author: Michael Albinus Date: Thu Aug 27 20:34:36 2020 +0200 Adapt tramp-tests * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name) (tramp-test05-expand-file-name-relative): Adapt tests. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index aa00c07f79..297167416d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2131,16 +2131,19 @@ is greater than 10. (expand-file-name "/method:host:/path/../file") "/method:host:/file")) (should (string-equal - (expand-file-name "/method:host:/path/.") "/method:host:/path/")) + (expand-file-name "/method:host:/path/.") + (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) (should (string-equal (expand-file-name "/method:host:/path/..") "/method:host:/")) (should (string-equal - (expand-file-name "." "/method:host:/path/") "/method:host:/path/")) + (expand-file-name "." "/method:host:/path/") + (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) (should (string-equal - (expand-file-name "" "/method:host:/path/") "/method:host:/path/")) + (expand-file-name "" "/method:host:/path/") + (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) ;; Quoting local part. (should (string-equal @@ -2159,14 +2162,8 @@ is greater than 10. (ert-deftest tramp-test05-expand-file-name-relative () "Check `expand-file-name'." (skip-unless (tramp--test-enabled)) - - ;; These are the methods the test doesn't fail. - (when (or (tramp--test-adb-p) (tramp--test-ange-ftp-p) (tramp--test-gvfs-p) - (tramp--test-rclone-p) - (tramp--test-smb-p)) - (setf (ert-test-expected-result-type - (ert-get-test 'tramp-test05-expand-file-name-relative)) - :passed)) + ;; The bugs are fixed in Emacs 28.1. + (skip-unless (tramp--test-emacs28-p)) (should (string-equal commit 85f42836b6698e7fcfba9aaea7216e267e10c91b Author: Eli Zaretskii Date: Thu Aug 27 20:06:33 2020 +0300 ; * etc/NEWS: Fix formatting of a recently-added entry. diff --git a/etc/NEWS b/etc/NEWS index 8b9bd07a98..964b626d7b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -241,8 +241,7 @@ time zones will use a form like "+0100" instead of "CET". ** Dired --- -*** Broken and circular links are shown with the new - 'dired-broken-symlink' face. +*** Broken and circular links are shown with the 'dired-broken-symlink' face. *** '=' ('dired-diff') will now put all backup files into the 'M-n' history. When using '=' on a file with backup files, the default file to use commit 01819490b6964b2f60782e4b836c60f5cce58d84 Author: Mauro Aranda Date: Thu Aug 27 16:22:35 2020 +0200 Keep the user theme in sync when marking a variable as set * lisp/custom.el (customize-mark-as-set): Keep the user theme in sync even if the new value of the variable is the saved-value or the standard-value. If we don't do this, custom themes might end up stepping over the user preferences in a session (bug#28904). diff --git a/lisp/custom.el b/lisp/custom.el index db7f6a056d..7581457ce8 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -758,6 +758,9 @@ Return non-nil if the `customized-value' property actually changed." (progn (put symbol 'customized-value (list (custom-quote value))) (custom-push-theme 'theme-value symbol 'user 'set (custom-quote value))) + (custom-push-theme 'theme-value symbol 'user + (if (get symbol 'saved-value) 'set 'reset) + (custom-quote value)) (put symbol 'customized-value nil)) ;; Changed? (not (equal customized (get symbol 'customized-value))))) commit 19bff57f609854f257780f20043e96fb2eddc713 Author: Lars Ingebrigtsen Date: Thu Aug 27 14:46:27 2020 +0200 Make minibuf-eldef respect minibuffer-default-prompt-format * lisp/minibuf-eldef.el (minibuffer-default--in-prompt-regexps): Take minibuffer-default-prompt-format into account. diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el index 01672c027f..a32d21abb3 100644 --- a/lisp/minibuf-eldef.el +++ b/lisp/minibuf-eldef.el @@ -36,10 +36,24 @@ (defvar minibuffer-eldef-shorten-default) (defun minibuffer-default--in-prompt-regexps () - `(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'" - 1 ,(if minibuffer-eldef-shorten-default " [\\2]")) - ("([^(]+?\\(, default\\(?: is\\)? \\(.*\\)\\)):? \\'" 1) - ("\\( \\[.*\\]\\):? *\\'" 1))) + (cons + (list + (concat + "\\(" + (if (string-match "%s" minibuffer-default-prompt-format) + (concat + (regexp-quote (substring minibuffer-default-prompt-format + 0 (match-beginning 0))) + ".*" + (regexp-quote (substring minibuffer-default-prompt-format + (match-end 0)))) + (regexp-quote minibuffer-default-prompt-format)) + ": *\\)") + 1) + `(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'" + 1 ,(if minibuffer-eldef-shorten-default " [\\2]")) + ("([^(]+?\\(, default\\(?: is\\)? \\(.*\\)\\)):? \\'" 1) + ("\\( \\[.*\\]\\):? *\\'" 1)))) (defcustom minibuffer-eldef-shorten-default nil "If non-nil, shorten \"(default ...)\" to \"[...]\" in minibuffer prompts." commit 6a95676cce0c4fa634f11f7f7679077063983f6c Author: Stefan Kangas Date: Thu Aug 27 13:38:37 2020 +0200 Substitute command keys in display-local-help * lisp/help-at-pt.el (display-local-help): Pass 'help-echo' property through 'substitute-command-keys' before displaying to be consistent with tooltips. (Bug#37628) This was discussed in: https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00090.html diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el index e184c78264..1d9e051a8c 100644 --- a/lisp/help-at-pt.el +++ b/lisp/help-at-pt.el @@ -92,13 +92,16 @@ the `kbd-help' property at point. If `kbd-help' does not produce a string, but the `help-echo' property does, then that string is printed instead. +The string is passed through `substitute-command-keys' before it +is displayed. + A numeric argument ARG prevents display of a message in case there is no help. While ARG can be used interactively, it is mainly meant for use from Lisp." (interactive "P") (let ((help (help-at-pt-kbd-string))) (if help - (message "%s" help) + (message "%s" (substitute-command-keys help)) (if (not arg) (message "No local help at point"))))) (defvar help-at-pt-timer nil commit ed3c971534283b9af2f13e71bf975ed448f2c225 Author: Stephen Berman Date: Thu Aug 27 13:53:22 2020 +0200 Prevent spurious tabs by RET in todo-edit-mode (bug#43068) * lisp/calendar/todo-mode.el (todo-key-bindings-t) (todo-edit-mode-map): Remove remapping of `newline' to `newline-and-indent'. (todo-modes-set-1): Remove local setting of `indent-line-function'. (todo-edit-mode): Locally set `indent-line-function' to `todo-indent'. * test/lisp/calendar/todo-mode-tests.el (todo-test-move-item05): Prevent interactive test failure. (Until the addition of testcat4 to todo-test-1.todo, the test passed by chance, since testcat3 is empty and has no archived items.) (todo-test-edit-item-date-month): Refer to bug number. (todo-test-multiline-item-indentation-1) (todo-test-multiline-item-indentation-2) (todo-test-multiline-item-indentation-3): New tests. * test/lisp/calendar/todo-mode-resources/todo-test-1.todo: Remove spurious tabs from testcat1. diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 4f513d3386..0e4446f77d 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -6440,8 +6440,7 @@ Filtered Items mode following todo (not done) items." ("i" todo-insert-item) ("k" todo-delete-item) ("m" todo-move-item) - ("u" todo-item-undone) - ([remap newline] newline-and-indent)) + ("u" todo-item-undone)) "List of key bindings for Todo mode only.") (defvar todo-key-bindings-t+a+f @@ -6507,7 +6506,6 @@ Filtered Items mode following todo (not done) items." (defvar todo-edit-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-x\C-q" 'todo-edit-quit) - (define-key map [remap newline] 'newline-and-indent) map) "Todo Edit mode keymap.") @@ -6666,7 +6664,6 @@ Added to `window-configuration-change-hook' in Todo mode." (setq-local font-lock-defaults '(todo-font-lock-keywords t)) (setq-local revert-buffer-function #'todo-revert-buffer) (setq-local tab-width todo-indent-to-here) - (setq-local indent-line-function #'todo-indent) (when todo-wrap-lines (visual-line-mode) (setq wrap-prefix (make-string todo-indent-to-here 32)))) @@ -6741,6 +6738,7 @@ Added to `window-configuration-change-hook' in Todo mode." \\{todo-edit-mode-map}" (todo-modes-set-1) + (setq-local indent-line-function #'todo-indent) (if (> (buffer-size) (- (point-max) (point-min))) ;; Editing one item in an indirect buffer, so buffer-file-name is nil. (setq-local todo-current-todo-file todo-global-current-todo-file) diff --git a/test/lisp/calendar/todo-mode-resources/todo-test-1.todo b/test/lisp/calendar/todo-mode-resources/todo-test-1.todo index 557134fd45..2375772fbe 100644 --- a/test/lisp/calendar/todo-mode-resources/todo-test-1.todo +++ b/test/lisp/calendar/todo-mode-resources/todo-test-1.todo @@ -1,8 +1,8 @@ (("testcat1" . [2 0 2 1]) ("testcat2" . [3 0 1 1]) ("testcat3" . [0 0 0 0]) ("testcat4" . [1 0 0 0])) --==-- testcat1 [May 29, 2017] testcat1 item3 - has more than one line - to test item highlighting + has more than one line + to test item highlighting [Jul 3, 2017] testcat1 item4 ==--== DONE diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index a19612ee56..1fbd39478c 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el @@ -414,8 +414,15 @@ the top done item should be the first done item." (should (todo-done-item-p)) (forward-line -1) (should (looking-at todo-category-done)) - ;; Make sure marked items are no longer in first category. - (todo-backward-category) + ;; Make sure marked items are no longer in first category. Since + ;; cat1 now contains no todo or done items but does have archived + ;; items, todo-backward-category would skip it by default, so + ;; prevent this. (FIXME: Without this let-binding, + ;; todo-backward-category selects the nonempty cat4 and this test + ;; fails as expected when run interactively but not in a batch + ;; run -- why?) + (let (todo-skip-archived-categories) + (todo-backward-category)) (should (eq (point-min) (point-max))) ; All todo items were moved. ;; This passes when run interactively but fails in a batch run: ;; the message is displayed but (current-message) evaluates to @@ -848,7 +855,7 @@ should display the previously current (or default) todo file." (should (equal todo-current-todo-file todo-test-file-1)) (delete-file (concat file "~"))))) -(ert-deftest todo-test-edit-item-date-month () +(ert-deftest todo-test-edit-item-date-month () ; bug#42976 #3 and #4 "Test incrementing and decrementing the month of an item's date. If the change in month crosses a year boundary, the year of the item's date should be adjusted accordingly." @@ -892,8 +899,50 @@ item's date should be adjusted accordingly." (todo-edit-item--header 'month 25) (should (equal (funcall get-date) "Feb 1, 2022")) (todo-edit-item--header 'month -25) - (should (equal (funcall get-date) "Jan 1, 2020")) - ))) + (should (equal (funcall get-date) "Jan 1, 2020"))))) + +(ert-deftest todo-test-multiline-item-indentation-1 () + "Test inserting a multine item containing a hard line break. +After insertion the second line of the item should begin with a +tab character." + (with-todo-test + (let* ((item0 "Test inserting a multine item") + (item1 "containing a hard line break.") + (item (concat item0 "\n" item1))) + (todo-test--show 1) + (todo-test--insert-item item 1) + (re-search-forward (concat todo-date-string-start todo-date-pattern + (regexp-quote todo-nondiary-end) " ") + (line-end-position) t) + (should (looking-at (regexp-quote (concat item0 "\n\t" item1))))))) + +(ert-deftest todo-test-multiline-item-indentation-2 () ; bug#43068 + "Test editing an item by adding text on a new line. +After quitting todo-edit-mode the second line of the item should +begin with a tab character." + (with-todo-test + (todo-test--show 2) + (let* ((item0 (todo-item-string)) + (item1 "Second line.")) + (todo-edit-item--text 'multiline) + (insert (concat "\n" item1)) + (todo-edit-quit) + (goto-char (line-beginning-position)) + (should (looking-at (regexp-quote (concat item0 "\n\t" item1))))))) + +(ert-deftest todo-test-multiline-item-indentation-3 () + "Test adding an unindented new line to an item using todo-edit-file. +Attempting to quit todo-edit-mode should signal a user-error, +since all non-initial item lines must begin with whitespace." + (with-todo-test + (todo-test--show 2) + (let* ((item0 (todo-item-string)) + (item1 "Second line.")) + (todo-edit-file) + (should (looking-at (regexp-quote item0))) + (goto-char (line-end-position)) + (insert (concat "\n" item1)) + (should-error (todo-edit-quit) :type 'user-error)))) (provide 'todo-mode-tests) ;;; todo-mode-tests.el ends here commit 4cf5d2ebee5ac45a435c991e4c0ad12be619d26b Author: Stefan Kangas Date: Thu Aug 27 11:58:27 2020 +0200 Minor clean up in flyspell.el * lisp/textmodes/flyspell.el (flyspell-buffers): Declare obsolete. (flyspell--prev-meta-tab-binding): Doc fix. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index b631b126d5..9805928721 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -398,8 +398,8 @@ like \"Some." (let ((f (get-text-property (1- (point)) 'face))) (memq f flyspell-prog-text-faces)))) -;; Records the binding of M-TAB in effect before flyspell was activated. -(defvar flyspell--prev-meta-tab-binding) +(defvar flyspell--prev-meta-tab-binding nil + "Records the binding of M-TAB in effect before flyspell was activated.") ;;;###autoload (defun flyspell-prog-mode () @@ -550,12 +550,9 @@ in your init file. (custom-add-option 'text-mode-hook 'turn-on-flyspell) -;;*---------------------------------------------------------------------*/ -;;* flyspell-buffers ... */ -;;* ------------------------------------------------------------- */ -;;* For remembering buffers running flyspell */ -;;*---------------------------------------------------------------------*/ -(defvar flyspell-buffers nil) +(defvar flyspell-buffers nil + "For remembering buffers running flyspell") +(make-obsolete-variable 'flyspell-buffers "not used." "28.1") ;;*---------------------------------------------------------------------*/ ;;* flyspell-minibuffer-p ... */ commit bdc1f193470633adcd860db4b05a9fe951bd375b Author: Tino Calancha Date: Thu Aug 27 11:51:30 2020 +0200 dired: Show broken/circular links w/ different face * lisp/dired.el (dired-broken-symlink): New face. (dired-font-lock-keywords): Use it for broken/circular links (Bug#39145). * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1): Announce this change. diff --git a/etc/NEWS b/etc/NEWS index 6e04a1cf89..8b9bd07a98 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -240,6 +240,10 @@ time zones will use a form like "+0100" instead of "CET". ** Dired +--- +*** Broken and circular links are shown with the new + 'dired-broken-symlink' face. + *** '=' ('dired-diff') will now put all backup files into the 'M-n' history. When using '=' on a file with backup files, the default file to use for diffing is the newest backup file. You can now use 'M-n' to quickly diff --git a/lisp/dired.el b/lisp/dired.el index 08d0468851..d122869a5e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -534,6 +534,14 @@ Subexpression 2 must end right before the \\n.") (defvar dired-symlink-face 'dired-symlink "Face name used for symbolic links.") +(defface dired-broken-symlink + '((((class color)) + :foreground "yellow1" :background "red1" :weight bold) + (t :weight bold :slant italic :underline t)) + "Face used for broken symbolic links." + :group 'dired-faces + :version "28.1") + (defface dired-special '((t (:inherit font-lock-variable-name-face))) "Face used for sockets, pipes, block devices and char devices." @@ -597,6 +605,20 @@ Subexpression 2 must end right before the \\n.") (list dired-re-dir '(".+" (dired-move-to-filename) nil (0 dired-directory-face))) ;; + ;; Broken Symbolic link. + (list dired-re-sym + (list (lambda (end) + (let* ((file (dired-file-name-at-point)) + (truename (ignore-errors (file-truename file)))) + ;; either not existent target or circular link + (and (not (and truename (file-exists-p truename))) + (search-forward-regexp "\\(.+\\) \\(->\\) ?\\(.+\\)" end t)))) + '(dired-move-to-filename) + nil + '(1 'dired-broken-symlink) + '(2 dired-symlink-face) + '(3 'dired-broken-symlink))) + ;; ;; Symbolic link to a directory. (list dired-re-sym (list (lambda (end) commit f40260f121d41d50fda428e789d22b125e24f407 Author: Stefan Kangas Date: Thu Aug 27 11:38:00 2020 +0200 Only show flyspell welcome message interactively * lisp/textmodes/flyspell.el (flyspell-mode): Only show welcome message when called interactively. (Bug#43065) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index f90a128b01..b631b126d5 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -533,7 +533,7 @@ in your init file. (progn (when flyspell-use-mouse-3-for-menu (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t)) - (flyspell-mode-on t)) + (flyspell-mode-on (called-interactively-p 'interactive))) (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) (flyspell-mode -1))) (flyspell-mode-off))) commit 2fd9860481833434367834926d14a0dc299edcce Author: Stefan Kangas Date: Thu Aug 27 07:58:17 2020 +0200 Add ASTEC-X issue to PROBLEMS * etc/PROBLEMS: Mention problem with multiple monitors on proprietary X Server ASTEC-X. (Bug#36779) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index f68a183c5d..67537f6e33 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1602,6 +1602,12 @@ even if you should be able to paste, and similar). You can get back menus on each frame by starting emacs like this: % env UBUNTU_MENUPROXY= emacs +*** Mouse click coordinates not recognized correctly on multiple monitors. + +This happens on the proprietary X server ASTEC-X when the number of +monitors is changed after the server has started. A workaround is to +restart the X server after the monitor configuration has been changed. + * Runtime problems on character terminals ** The meta key does not work on xterm. commit 4766006d3c79db8162aa72e01242806b9f0d2f76 Author: Stefan Kangas Date: Thu Aug 27 07:07:39 2020 +0200 Fix flyspell welcome message * lisp/textmodes/flyspell.el (flyspell-mode, flyspell-mode-on): Fix showing welcome message when `flyspell-issue-welcome-flag' and `flyspell-issue-message-flag' are both non-nil. (Bug#43065) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 78a74de4e8..f90a128b01 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -533,7 +533,7 @@ in your init file. (progn (when flyspell-use-mouse-3-for-menu (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t)) - (flyspell-mode-on)) + (flyspell-mode-on t)) (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) (flyspell-mode -1))) (flyspell-mode-off))) @@ -611,8 +611,12 @@ in your init file. ;;*---------------------------------------------------------------------*/ ;;* flyspell-mode-on ... */ ;;*---------------------------------------------------------------------*/ -(defun flyspell-mode-on () - "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead." +(defun flyspell-mode-on (&optional show-msg) + "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead. + +If optional argument SHOW-MSG is non-nil, show a welcome message +if `flyspell-issue-message-flag' and `flyspell-issue-welcome-flag' +are both non-nil." (ispell-set-spellchecker-params) ; Initialize variables and dicts alists (setq ispell-highlight-face 'flyspell-incorrect) ;; local dictionaries setup @@ -644,16 +648,17 @@ in your init file. (setq flyspell-generic-check-word-predicate mode-predicate))) ;; the welcome message (if (and flyspell-issue-message-flag - flyspell-issue-welcome-flag - (called-interactively-p 'interactive)) + flyspell-issue-welcome-flag + show-msg) (let* ((binding (where-is-internal 'flyspell-auto-correct-word nil 'non-ascii)) (mouse-button (if flyspell-use-mouse-3-for-menu "Mouse-3" "Mouse-2"))) - (message "Welcome to Flyspell. Use %s to correct words." - (if binding - (format "%s or %s" (key-description binding) mouse-button) - (format "%s" mouse-button)))))) + (message (format-message + "Welcome to Flyspell. Use %s to correct words." + (if binding + (format "`%s' or `%s'" (key-description binding) mouse-button) + (format "`%s'" mouse-button))))))) ;;*---------------------------------------------------------------------*/ ;;* flyspell-delay-commands ... */