Re: Fedora Core 3: File mode specification error

David Kastrup <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
Brett Presnell <[email protected]> writes:

> David Kastrup <[email protected]> writes:
>
>> [email protected] writes:
>>
>> Can you check your definition of regexp-opt-group?  And maybe do a
>> edebug-defun on its definition, and then see what happens when calling
>> (regexp-opt nil)
>> ?
>
> Ok, I did all this, hopefully correctly.
>
> Here's the definition I get for regexp-opt-group:
>
> (defun regexp-opt-group (strings &optional paren lax)
>   ;;
>   ;; Return a regexp to match a string in STRINGS.
>   ;; If PAREN non-nil, output regexp parentheses around returned regexp.
>   ;; If LAX non-nil, don't output parentheses if it doesn't require them.
>   ;; Merges keywords to avoid backtracking in Emacs' regexp matcher.
>   ;;
>   ;; The basic idea is to find the shortest common prefix, remove it and
>   ;; recurse.  If there is no prefix, we divide the list into two so that (at
>   ;; least) one half will have at least a one-character common prefix.
>   ;;
>   ;; Also we delay the addition of grouping parenthesis as long as possible
>   ;; until we're sure we need them, and try to remove one-character sequences
>   ;; so we can use character sets rather than grouping parenthesis.
>   ;;
>   (let* ((open-group (if paren "\\(" ""))
> 	 (close-group (if paren "\\)" ""))
> 	 (open-charset (if lax "" open-group))
> 	 (close-charset (if lax "" close-group)))
>     (cond
>      ;;
>      ;; If there is only one string, just return it.
>      ((= (length strings) 1)
>       (if (= (length (car strings)) 1)
> 	  (concat open-charset (regexp-quote (car strings)) close-charset)
> 	(concat open-group (regexp-quote (car strings)) close-group)))
>      ;;

Something's very fishy here.  _My_ Emacs from Fedora core is
emacs-21.3-19 and most definitely has

         (close-group (if paren "\\)" ""))
         (open-charset (if lax "" open-group))
         (close-charset (if lax "" close-group)))
    (cond
     ;;
     ;; If there are no strings, just return the empty string.
     ((= (length strings) 0)
      "")
     ;;

at the same location.

And judging from the CVS changelog, this must have been the case for
eternities.

In particular, the version in Emacs-21.3 is _definitely_ already
fixed.  So you are having some terribly outdated version of
regexp-opt.el somewhere in your search path.

And even my XEmacs from the current Fedora archive has this fixed
already.

The header of the file you posted would be what?  Maybe this tells us
how you got a severly outdated copy of the file.

I am pretty sure that your installation is broken.

What does
M-x locate-library RET regexp-opt RET

return for you?

What does

rpm -q emacs

return?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.