Commits

Aidan Kehoe committed 0eb4e96

#'delete-trailing-whitespace needs to work when the region is inactive, too

lisp/ChangeLog addition:

Update its interactive spec to work correctly in XEmacs.

Comments (0)

Files changed (2)

 	* 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>
 
 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))))