From e31720013490deeb31fb429e5beb18ce63147a1f Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 26 Jan 2008 17:23:56 +0000 Subject: [PATCH] (wdired-get-filename): Change `(1+ beg)' to `beg' so that the filename end is found even when the filename is empty. Fixes error and spurious newlines when marking files for deletion. --- lisp/ChangeLog | 6 ++++++ lisp/wdired.el | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b0a7dca4de..1e67505cb70 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-01-26 Phil Sung (tiny change) + + * wdired.el (wdired-get-filename): Change `(1+ beg)' to `beg' so + that the filename end is found even when the filename is empty. + Fixes error and spurious newlines when marking files for deletion. + 2008-01-26 Martin Rudalics * subr.el (find-tag-default): Simplify using exclusively diff --git a/lisp/wdired.el b/lisp/wdired.el index 287e2119c8d..36725db5db5 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -323,7 +323,11 @@ non-nil means return old filename." (unless (eq beg end) (if old (setq file (get-text-property beg 'old-name)) - (setq end (next-single-property-change (1+ beg) 'end-name)) + ;; In the following form changed `(1+ beg)' to `beg' so that + ;; the filename end is found even when the filename is empty. + ;; Fixes error and spurious newlines when marking files for + ;; deletion. + (setq end (next-single-property-change beg 'end-name)) (setq file (buffer-substring-no-properties (1+ beg) end))) (and file (setq file (wdired-normalize-filename file)))) (if (or no-dir old) -- 2.39.2