Robert P. Goldman wrote:
> 2.  When I try to find definitions, ILISP yields errors for ill-formed 
> regular expressions.  This has something to do with the regexp that 
> ILISP uses to try to find class accessors:

Although it may be bad form to follow up to my own posts, I did find a 
solution to this problem.  I found that there was a bona fide bug in the 
regexp in my distribution of ILISP. There were two modifiers in a row on 
a single regexp.

Here's a  patch that seems to fix the problem:


(defun lisp-locate-clisp (symbol type first back)
   "Try to find SYMBOL's TYPE definition in the current buffer.
Return T if sucessful.  FIRST is T if this is the first time in a
file.  BACK is T to go backwards."

   (let* ((name (regexp-quote (lisp-symbol-name symbol)))
         (prefix
          ;; Automatically generated defstruct accessors
          (if (string-match "-" name)
              (let ((struct (substring name 0 (1- (match-end 0)))))
                (format
                 "^\\(.\\)?[ \t\n]*(def[^ \t\n]*\\([ \t\n]+\\(.\\)?\\|\\|[ 
\t\n]*.[ \t\n]+\\)(?%s[ \t\n)]\\|:conc-name\\([ \t\n]+\\(.\\)?[ \t\n]*\\|[ 
\t\n]*.[ \t\n]+\\)%s-"
                 struct struct))))
         ;; Defclass accessors
         (class
          (concat
           ;; keywords
           "\\(:accessor\\|:writer\\|:reader\\)"
           ;; frightening whitespace regexp!
           ;; originally, this had a ? followed by a +,
           ;; \\(.\\)?+
           ;; which seems like two consecutive modifiers and caused
           ;; my Xemacs to crash.  Unfortunately, I'm not sure
           ;; what the purpose of the ^F's are, so I don't know
           ;; exactly what's right here.  Taking a guess, I removed
           ;; the '+' [2002/08/14:rpg]
           "\\([ \t\n]+\\(.\\)?[ \t\n]*\\|[ \t\n]*.[ \t\n]+\\)"
           ;; the name we're looking for
           "%s"
           ;; make sure we don't find something for which the name
           ;; is just a prefix.
           "[ \t\n)]"
           )
           ))
     (or
      (if (equal type "any")
         (lisp-re
          back
          (concat
           "^\\(.\\)?[ \t\n]*(def[^ \t\n]*\\([ \t\n]+\\(.\\)?[ \t\n]*\\|[ \t\n]*.[ 
\t\n]+\\)\\((setf\\([ \t\n]+\\(.\\)?[ \t\n]*\\|[ \t\n]*.[ \t\n]+\\)\\|(?[ 
\t\n]*\\(.\\)?[ 
\t\n]*\\)%s[ \t\n)]"
           (if prefix (concat "\\|" prefix))
           "\\|"
           class)
          name name))

      ;; (qualifiers* (type1 type2 ...))
      (ilisp-locate-clos-method name type back)

      (ilisp-locate-clisp-defn name type back)

      ;; Standard def form
      (when first (lisp-locate-ilisp symbol type first back))
      ;; Automatically generated defstruct accessors
      (when (and first prefix) (lisp-re back prefix))
      ;; Defclass accessors
      (lisp-re back class name)
      ;; Give up!
      )))




Reply via email to