all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* test for shy-group "feature"?
@ 2005-12-10  1:00 Drew Adams
  2005-12-10  1:19 ` Lennart Borgman
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2005-12-10  1:00 UTC (permalink / raw)


Emacs 22 has shy groups for regexps; previous versions did not.

When writing conditional code that tries to work with multiple Emacs
versions, it is usually better to test fboundp, boundp, or featurep, than it
is to test the major version. I couldn't find any function, variable, or
feature associated with this new "feature", shy groups. Is there one that I
might have missed? Thanks.

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

* Re: test for shy-group "feature"?
  2005-12-10  1:00 Drew Adams
@ 2005-12-10  1:19 ` Lennart Borgman
  2005-12-10  1:42   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Borgman @ 2005-12-10  1:19 UTC (permalink / raw)
  Cc: Help-Gnu-Emacs

Drew Adams wrote:

>Emacs 22 has shy groups for regexps; previous versions did not.
>
>When writing conditional code that tries to work with multiple Emacs
>versions, it is usually better to test fboundp, boundp, or featurep, than it
>is to test the major version. I couldn't find any function, variable, or
>feature associated with this new "feature", shy groups. Is there one that I
>might have missed? Thanks.
>  
>
My guess is that you will find no updates on the elisp level that are 
tied to shy regexp groups. But I am not sure.

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

* RE: test for shy-group "feature"?
  2005-12-10  1:19 ` Lennart Borgman
@ 2005-12-10  1:42   ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2005-12-10  1:42 UTC (permalink / raw)


    >Emacs 22 has shy groups for regexps; previous versions did not.
    >
    >When writing conditional code that tries to work with multiple Emacs
    >versions, it is usually better to test fboundp, boundp, or
    >featurep, than it
    >is to test the major version. I couldn't find any function,
    >variable, or
    >feature associated with this new "feature", shy groups. Is
    >there one that I
    >might have missed? Thanks.

    My guess is that you will find no updates on the elisp level that are
    tied to shy regexp groups. But I am not sure.

There are elisp updates (e.g. in regexpt-opt), but I couldn't find any new
function, variable, or feature definitions.

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

* Re: test for shy-group "feature"?
       [not found] <mailman.18647.1134176454.20277.help-gnu-emacs@gnu.org>
@ 2005-12-10  1:45 ` David Kastrup
  2005-12-10  3:42   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2005-12-10  1:45 UTC (permalink / raw)


"Drew Adams" <drew.adams@oracle.com> writes:

> Emacs 22 has shy groups for regexps; previous versions did not.

Wrong.

* Lisp changes in Emacs 21.1 (see following page for display-related features)

[...]

** Regular expressions now support intervals \{n,m\} as well as
Perl's shy-groups \(?:...\) and non-greedy *? +? and ?? operators.
Also back-references like \2 are now considered as an error if the
corresponding subgroup does not exist (or is not closed yet).
Previously it would have been silently turned into `2' (ignoring the `\').

> When writing conditional code that tries to work with multiple Emacs
> versions, it is usually better to test fboundp, boundp, or featurep, than it
> is to test the major version. I couldn't find any function, variable, or
> feature associated with this new "feature", shy groups. Is there one that I
> might have missed? Thanks.

(if (string-match "\\(?:\\)" "")
   ...
 ...)

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* RE: test for shy-group "feature"?
  2005-12-10  1:45 ` test for shy-group "feature"? David Kastrup
@ 2005-12-10  3:42   ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2005-12-10  3:42 UTC (permalink / raw)


    > Emacs 22 has shy groups for regexps; previous versions did not.

    Wrong.

    ** Regular expressions now support intervals \{n,m\} as well as
    Perl's shy-groups \(?:...\) and non-greedy *? +? and ?? operators.
    Also back-references like \2 are now considered as an error if the
    corresponding subgroup does not exist (or is not closed yet).
    Previously it would have been silently turned into `2'
    (ignoring the `\').

I didn't find any reference to "shy" by grepping the source code. Thanks for
looking in News.

    > When writing conditional code that tries to work with multiple Emacs
    > versions, it is usually better to test fboundp, boundp, or
    > featurep, than it
    > is to test the major version. I couldn't find any function,
    > variable, or
    > feature associated with this new "feature", shy groups. Is
    > there one that I
    > might have missed? Thanks.

    (if (string-match "\\(?:\\)" "")
       ...
     ...)

Very good (elegant - it even acts as an explanatory comment).

Thanks.

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

end of thread, other threads:[~2005-12-10  3:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.18647.1134176454.20277.help-gnu-emacs@gnu.org>
2005-12-10  1:45 ` test for shy-group "feature"? David Kastrup
2005-12-10  3:42   ` Drew Adams
2005-12-10  1:00 Drew Adams
2005-12-10  1:19 ` Lennart Borgman
2005-12-10  1:42   ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.