aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2018-08-04 11:55:03 -0400
committerNoam Postavsky2018-08-04 11:55:03 -0400
commit6328d2ff6f4c6c845b610e8011a36d489d9445a2 (patch)
treeeb816e2a03a93d5e45042449a581ae8f759167c0
parentc27bd469f1a6f962798caaa584c36ccbe5e42936 (diff)
parent951c5a127fb6f8b34c23fced0943101a41af74ad (diff)
downloademacs-6328d2ff6f4c6c845b610e8011a36d489d9445a2.tar.gz
emacs-6328d2ff6f4c6c845b610e8011a36d489d9445a2.zip
Merge from emacs-26
951c5a127f Fix wdired test failure when byte compiled (bug#32318) 0252f7311f * test/lisp/wdired-tests.el (wdired-test-symlink-name): Ne... dd51434714 Fix url's thing-at-point beginning-op (Bug#32028)
-rw-r--r--lisp/thingatpt.el2
-rw-r--r--test/lisp/wdired-tests.el24
2 files changed, 25 insertions, 1 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 4612e95bb0e..7fcb3bc2b73 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -484,7 +484,7 @@ looks like an email address, \"ftp://\" if it starts with
484 484
485(put 'url 'end-op (lambda () (end-of-thing 'url))) 485(put 'url 'end-op (lambda () (end-of-thing 'url)))
486 486
487(put 'url 'beginning-op (lambda () (end-of-thing 'url))) 487(put 'url 'beginning-op (lambda () (beginning-of-thing 'url)))
488 488
489;; The normal thingatpt mechanism doesn't work for complex regexps. 489;; The normal thingatpt mechanism doesn't work for complex regexps.
490;; This should work for almost any regexp wherever we are in the 490;; This should work for almost any regexp wherever we are in the
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el
index 7199470ea96..b4ef4ab2486 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -21,6 +21,9 @@
21 21
22(require 'ert) 22(require 'ert)
23(require 'dired) 23(require 'dired)
24(require 'wdired)
25
26(defvar dired-query) ; Pacify byte compiler.
24 27
25(ert-deftest wdired-test-bug32173-01 () 28(ert-deftest wdired-test-bug32173-01 ()
26 "Test using non-nil wdired-use-interactive-rename. 29 "Test using non-nil wdired-use-interactive-rename.
@@ -74,6 +77,27 @@ Aborting an edit should leaving original file name unchanged."
74 (if buf (kill-buffer buf)) 77 (if buf (kill-buffer buf))
75 (delete-directory test-dir t))))) 78 (delete-directory test-dir t)))))
76 79
80(ert-deftest wdired-test-symlink-name ()
81 "Test the file name of a symbolic link.
82The Dired and WDired functions returning the name should include
83only the name before the link arrow."
84 (let* ((test-dir (make-temp-file "test-dir-" t))
85 (link-name "foo"))
86 (let ((buf (find-file-noselect test-dir)))
87 (unwind-protect
88 (with-current-buffer buf
89 (make-symbolic-link "./bar/baz" link-name)
90 (revert-buffer)
91 (let* ((file-name (dired-get-filename))
92 (dir-part (file-name-directory file-name))
93 (lf-name (concat dir-part link-name)))
94 (should (equal file-name lf-name))
95 (dired-toggle-read-only)
96 (should (equal (wdired-get-filename) lf-name))
97 (dired-toggle-read-only)))
98 (if buf (kill-buffer buf))
99 (delete-directory test-dir t)))))
100
77(ert-deftest wdired-test-unfinished-edit-01 () 101(ert-deftest wdired-test-unfinished-edit-01 ()
78 "Test editing a file name without saving the change. 102 "Test editing a file name without saving the change.
79Finding the new name should be possible while still in 103Finding the new name should be possible while still in