GNU bug report logs - #25374
align command can't use align-region-separate interactively

Previous Next

Package: emacs;

Reported by: John Wiegley <jwiegley <at> gmail.com>

Date: Fri, 6 Jan 2017 07:25:02 UTC

Severity: minor

Tags: moreinfo, wontfix

Found in version 25.1.91

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.91; bug
Date: Sun, 28 Aug 2011 00:51:56 +0800 (5 years, 18 weeks, 6 days ago)
From: Le Wang <l26wang <at> 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




This bug report was last modified 6 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.