emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6328d2f 1/6: Merge from emacs-26


From: Noam Postavsky
Subject: [Emacs-diffs] master 6328d2f 1/6: Merge from emacs-26
Date: Sat, 4 Aug 2018 11:56:23 -0400 (EDT)

branch: master
commit 6328d2ff6f4c6c845b610e8011a36d489d9445a2
Merge: c27bd46 951c5a1
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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)
---
 lisp/thingatpt.el         |  2 +-
 test/lisp/wdired-tests.el | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 4612e95..7fcb3bc 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -484,7 +484,7 @@ looks like an email address, \"ftp://\"; if it starts with
 
 (put 'url 'end-op (lambda () (end-of-thing 'url)))
 
-(put 'url 'beginning-op (lambda () (end-of-thing 'url)))
+(put 'url 'beginning-op (lambda () (beginning-of-thing 'url)))
 
 ;; The normal thingatpt mechanism doesn't work for complex regexps.
 ;; 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 7199470..b4ef4ab 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -21,6 +21,9 @@
 
 (require 'ert)
 (require 'dired)
+(require 'wdired)
+
+(defvar dired-query)                    ; Pacify byte compiler.
 
 (ert-deftest wdired-test-bug32173-01 ()
   "Test using non-nil wdired-use-interactive-rename.
@@ -74,6 +77,27 @@ Aborting an edit should leaving original file name 
unchanged."
        (if buf (kill-buffer buf))
        (delete-directory test-dir t)))))
 
+(ert-deftest wdired-test-symlink-name ()
+  "Test the file name of a symbolic link.
+The Dired and WDired functions returning the name should include
+only the name before the link arrow."
+  (let* ((test-dir (make-temp-file "test-dir-" t))
+         (link-name "foo"))
+    (let ((buf (find-file-noselect test-dir)))
+      (unwind-protect
+         (with-current-buffer buf
+            (make-symbolic-link "./bar/baz" link-name)
+            (revert-buffer)
+            (let* ((file-name (dired-get-filename))
+                   (dir-part (file-name-directory file-name))
+                   (lf-name (concat dir-part link-name)))
+             (should (equal file-name lf-name))
+             (dired-toggle-read-only)
+             (should (equal (wdired-get-filename) lf-name))
+             (dired-toggle-read-only)))
+       (if buf (kill-buffer buf))
+       (delete-directory test-dir t)))))
+
 (ert-deftest wdired-test-unfinished-edit-01 ()
   "Test editing a file name without saving the change.
 Finding the new name should be possible while still in



reply via email to

[Prev in Thread] Current Thread [Next in Thread]