diff lisp/simple.el @ 5684:0eb4e96fd261

#'delete-trailing-whitespace needs to work when the region is inactive, too lisp/ChangeLog addition: Update its interactive spec to work correctly in XEmacs.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 08 Sep 2012 16:33:48 +0100
parents 98f762d06c5f
children 94a6b8fbd56e
line wrap: on
line diff
--- a/lisp/simple.el	Sat Sep 08 13:34:20 2012 +0100
+++ b/lisp/simple.el	Sat Sep 08 16:33:48 2012 +0100
@@ -391,8 +391,13 @@
 interactively with the mark inactive, or called from Lisp with
 END nil), it also deletes all trailing lines at the end of the
 buffer if the variable `delete-trailing-lines' is non-nil."
-  ;; XEmacs; "*r" instead of re-implementing it.
-  (interactive "*r")
+  (interactive (progn
+                 (barf-if-buffer-read-only)
+                 (if (if zmacs-regions
+                         zmacs-region-active-p
+                       (eq (marker-buffer (mark-marker t)) (current-buffer)))
+                     (list (region-beginning) (region-end))
+                   (list nil nil))))
   (save-match-data
     (save-excursion
       (let ((end-marker (copy-marker (or end (point-max))))