unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25374: 25.1.91; bug
@ 2011-08-27 16:51 John Wiegley
  2017-01-06  8:02 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: John Wiegley @ 2011-08-27 16:51 UTC (permalink / raw)
  To: 25374

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#25374: 25.1.91; bug
  2011-08-27 16:51 bug#25374: 25.1.91; bug John Wiegley
@ 2017-01-06  8:02 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2017-01-06  8:02 UTC (permalink / raw)
  To: John Wiegley, Le Wang; +Cc: 25374

> From: John Wiegley <jwiegley@gmail.com>
> Date: Sun, 28 Aug 2011 00:51:56 +0800 (5 years, 18 weeks, 6 days ago)
> 
> 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?

Sorry, I don't think I understand this part.  Please elaborate what is
broken in the interactive "r" form.

> -  (interactive "r")
> +  (interactive (if (use-region-p)
> +                   (list (region-beginning) (region-end))
> +                 (list nil nil)))

This is not an equivalent change: the previous code would use the
region even if it was not active (i.e. transient-mark-mode is off),
the new code will think there's no region in that case.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-06  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-27 16:51 bug#25374: 25.1.91; bug John Wiegley
2017-01-06  8:02 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).