changeset 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 aa5f38ecb804
files lisp/ChangeLog lisp/simple.el
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 08 13:34:20 2012 +0100
+++ b/lisp/ChangeLog	Sat Sep 08 16:33:48 2012 +0100
@@ -5,6 +5,7 @@
 	* simple.el (delete-trailing-whitespace): New.
 	Import this function and an associated variable from GNU, thank
 	you GNU.
+	Update its interactive spec to work correctly in XEmacs.
 
 2012-09-07  Aidan Kehoe  <kehoea@parhasard.net>
 
--- 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))))