From: Tino Calancha <tino.calancha@gmail.com>
To: 39280@debbugs.gnu.org
Subject: bug#39280: 27.0.60; wdired-get-filename ignores first argument
Date: Sat, 25 Jan 2020 21:05:05 +0100 [thread overview]
Message-ID: <87k15fpaj2.fsf@calancha-pc.dy.bbexcite.jp> (raw)
emacs -Q /tmp
M-! touch foo RET
g
j foo RET
C-x C-q
M-: (wdired-get-filename 'local t) RET
=> "/tmp/foo"
;; Expected: "foo"
--8<-----------------------------cut here---------------start------------->8---
commit 5f7e8975e741298718a4e05aa674873207cb56a6
Author: Tino Calancha <tino.calancha@gmail.com>
Date: Sat Jan 25 21:03:53 2020 +0100
Fix bug in wdired-get-filename
* lisp/wdired.el (wdired-get-filename):
Acknowledge the first argument.
* test/lisp/wdired-tests.el (wdired-test-bug39280): Add test.
diff --git a/lisp/wdired.el b/lisp/wdired.el
index d470e0a21b..23dc4b9ef5 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -344,7 +344,7 @@ wdired-get-filename
;; Don't unquote the old name, it wasn't quoted in the first place
(and file (setq file (wdired-normalize-filename file (not old)))))
(if (or no-dir old)
- file
+ (if no-dir (file-relative-name file) file)
(and file (> (length file) 0)
(concat (dired-current-directory) file))))))
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el
index baa547758e..3d5f504205 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -176,6 +176,22 @@ wdired-test-bug34915
(server-force-delete)
(delete-directory test-dir t))))
+(ert-deftest wdired-test-bug39280 ()
+ "Test for https://debbugs.gnu.org/39280."
+ (let* ((test-dir (make-temp-file "test-dir" 'dir))
+ (fname "foo")
+ (full-fname (expand-file-name fname test-dir)))
+ (make-empty-file full-fname)
+ (let ((buf (find-file-noselect test-dir)))
+ (unwind-protect
+ (with-current-buffer buf
+ (dired-toggle-read-only)
+ (dolist (old '(t nil))
+ (should (equal fname (wdired-get-filename 'nodir old)))
+ (should (equal full-fname (wdired-get-filename nil old))))
+ (wdired-finish-edit))
+ (if buf (kill-buffer buf))
+ (delete-directory test-dir t)))))
(provide 'wdired-tests)
;;; wdired-tests.el ends here
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.60 (build 24, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
of 2020-01-25 built on calancha-pc.dy.bbexcite.jp
Repository revision: baca81e64141aed076fe088e7160f6e0d4a51c68
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
(Shell command succeeded with no output)
Press C-c C-c when finished or C-c ESC to abort changes
"/tmp/foo"
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD PDUMPER
LCMS2 GMP
next reply other threads:[~2020-01-25 20:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-25 20:05 Tino Calancha [this message]
2020-01-25 20:55 ` bug#39280: 27.0.60; wdired-get-filename ignores first argument Stephen Berman
2020-01-25 21:13 ` Tino Calancha
2020-01-26 10:47 ` Stephen Berman
2020-10-01 21:26 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k15fpaj2.fsf@calancha-pc.dy.bbexcite.jp \
--to=tino.calancha@gmail.com \
--cc=39280@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.