bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25374: 25.1.91; bug


From: John Wiegley
Subject: bug#25374: 25.1.91; bug
Date: Fri, 06 Jan 2017 07:25:08 -0000
User-agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/25.1.91 (darwin)

From: Le Wang <l26wang@gmail.com>

It doesn't look right to me that auto region selection is not
accessible interactively.  The interactive "r" form is quite broken,
so you may want to fix it in other interactive forms as well.  Unless
there is a good reason you left it this way?

diff -u -b -B c\:/emacs/emacs-23.3/lisp/align.el
c\:/Users/Le/cygwin_home/tmp/align_region_patch.el
--- c:/emacs/emacs-23.3/lisp/align.el   2011-01-08 12:45:14.000000000 +0800
+++ c:/Users/Le/cygwin_home/tmp/align_region_patch.el   2011-08-28
00:39:51.336490900 +0800
@@ -857,11 +857,11 @@
 ;;;###autoload
 (defun align (beg end &optional separate rules exclude-rules)
   "Attempt to align a region based on a set of alignment rules.
-BEG and END mark the region.  If BEG and END are specifically set to
-nil (this can only be done programmatically), the beginning and end of
-the current alignment section will be calculated based on the location
-of point, and the value of `align-region-separate' (or possibly each
-rule's `separate' attribute).
+BEG and END mark the region.  If no region is active, the
+beginning and end of the current alignment section will be
+calculated based on the location of point, and the value of
+`align-region-separate' (or possibly each rule's `separate'
+attribute).

 If SEPARATE is non-nil, it overrides the value of
 `align-region-separate' for all rules, except those that have their
@@ -871,7 +871,9 @@
 default rule lists defined in `align-rules-list' and
 `align-exclude-rules-list'.  See `align-rules-list' for more details
 on the format of these lists."
-  (interactive "r")
+  (interactive (if (use-region-p)
+                   (list (region-beginning) (region-end))
+                 (list nil nil)))
   (let ((separator
         (or separate
             (if (and (symbolp align-region-separate)
-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]