GNU bug report logs - #33541
26; Doc string of `align-regexp'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 28 Nov 2018 17:27:01 UTC

Severity: wishlist

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 33541 <at> debbugs.gnu.org
Subject: Re: bug#33541: 26; Doc string of `align-regexp'
Date: Thu, 29 Nov 2018 12:22:18 +1300
I think the docstring is clear, provided that you read all of it; but
it could undoubtedly be improved, especially as this is a slightly
fiddly command to get to grips with.

Perhaps your concern could be addressed by tweaking the paragraph
starting "REGEXP must contain at least one parenthesized subexpression"
so that it says:

"Non-interactively, REGEXP must contain at least one parenthesized...."

(which strictly speaking is perhaps less correct than what it says now,
yet I think in practice would make things slightly clearer.)

I would also change "automatically added" to "automatically prefixed".


-Phil



On 2018-11-29 06:26, Drew Adams wrote:
> These two paragraphs seem to contradict each other:
> 
>  There is no predefined rule to handle this, but you could easily do it
>  using a REGEXP like "(".  Interactively, all you would have to do is
>  to mark the region, call 'align-regexp' and enter that regular 
> expression.
> 
>  REGEXP must contain at least one parenthesized subexpression, 
> typically
>  whitespace of the form "\\(\\s-*\\)".  In normal interactive use,
>  this is automatically added to the start of your regular expression 
> after
>  you enter it.  You only need to supply the characters to be lined up, 
> and
>  any preceding whitespace is replaced.
> 
> It cannot be the case that both (1) all you have to input as regexp is
> "(" and (2) the input regexp must contain a group subexpression.
> 
> It's also unclear to say that REGEXP must contain... and also say that
> something gets added automatically to it.
> 
> Yes, it's correct, provided a user interprets "REGEXP" only as the Lisp
> argument and not directly as the regexp she enters.  Clearer wording
> would be welcome, distinguishing (1) what you have to input (do you 
> need
> to include a group subexpression?  even if it is the whitespace prefix
> "\\(\\s-*\\)"?) from what is required as the REGEXP argument to the
> function.
> 
> In particular (minimum fix), it is incorrect to say 'you could easily 
> do
> it using a REGEXP like "("'.  There, REGEXP clearly must be the Lisp
> argument, not what you type interactively.  REGEXP presumably always
> requires a group subexpression.






This bug report was last modified 3 years and 245 days ago.

Previous Next


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