summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/wdired.el')
-rw-r--r--lisp/wdired.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 5a925e5d031..2c43b6f1552 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -576,8 +576,11 @@ If OLD, return the old target. If MOVE, move point before it."
(funcall command 1)
(setq arg (1- arg)))
(error
- (if (not (forward-word 1))
- (setq arg 0)))))))
+ (if (forward-word)
+ ;; Skip any non-word characters to avoid triggering a read-only
+ ;; error which would cause skipping the next word characters too.
+ (skip-syntax-forward "^w")
+ (setq arg 0)))))))
(defun wdired-downcase-word (arg)
"WDired version of `downcase-word'.