Re: jde-import commands and GNU Emacs-22/23

Adrian Robert <[email protected]>
Newsgroups gmane.emacs.jdee
Message-ID <[email protected]>
> On 10/4/05, Adrian Robert <[email protected]> wrote: Small  
> update:
>
> First problem (jde-import-kill-extra-imports) goes away on emacs-21.3
> text terminal version bundled on MacOSX.  So maybe something has
> affected the lisp code in either cedit, ellib, or jde in emacs
> 22/23.

Update: I solved this, which related to a change in the count-matches  
function between GNU Emacs 21 and (not yet released) 22.  I'm  
attaching a patch against JDE-2.3.5, which will only be of use to  
users of GNU Emacs 22 (to be released RSN) or Unicode Emacs  
(unicode-2 branch, tentatively slated for Emacs 23).



> On Oct 4, 2005, at 1:53 PM, Adrian Robert wrote:
>
> > Hi,
> >
> > Problem: if I try jde's 'import' commands they don't work.
> >
> >
> > jde-import-kill-extra-imports gives:
> >
> > Wrong type argument: arrayp, 5
> >
> > Stack trace:
> >
> > Debugger entered--Lisp error: (wrong-type-argument arrayp 5)
> >   substring(5 0 2)
> >   (let* ((import ...) (name ...) (classname ...) (case-fold-search
> > nil) (number-of-matches ...)) (if (or ... ... ...) (setq extra-
> > imports ...) (setq required-imports ...)))
> >   (while imports (let* (... ... ... ... ...) (if ... ... ...))
> > (setq imports (cdr imports)))
> >   (save-excursion (goto-char 0) (while imports (let* ... ...) (setq
> > imports ...)) (if (not extra-imports) (message "No extra imports
> > found") (let ... ... ... ...)))
> >   (let* ((packages ...) (package-imports ...) (first-import ...)
> > extra-imports required-imports) (save-excursion (goto-char 0)
> > (while imports ... ...) (if ... ... ...)))
> >   (if (not imports) (message "No import found") (let* (... ... ...
> > extra-imports required-imports) (save-excursion ... ... ...)))
> >   (let* ((tags ...) (imports ...)) (if (not imports) (message "No
> > import found") (let* ... ...)))
> >   jde-import-kill-extra-imports(nil)
> >
> >
jdeImport.patch (application/octet-stream, 1.1 KB)
--- jde-2.3.5-orig/lisp/jde-import.el	2005-10-05 09:15:21.000000000 -0400
+++ jde-2.3.5/lisp/jde-import.el	2006-05-31 12:59:33.000000000 -0400
@@ -495,15 +495,15 @@
                    (classname (jde-import-get-classname name))
                    (case-fold-search nil)
                    (number-of-matches 
-                    (substring (count-matches 
-                                (concat "\\b" classname "\\b")) 0 2)))
+                    (count-matches 
+                                (concat "\\b" classname "\\b"))))
               (if (or 
                    ;; If name is already listed in the set
                    ;; of required imports...
                    (member name required-imports)
                    ;;or the class is not reference in the file
                    ;;and is not an import of the whole package i.e. .*
-                   (and (< (string-to-number number-of-matches) 2)
+                   (and (< number-of-matches 2)
                         (not (string= classname "*")))
                    ;; or imports a class in the current package...
                    (and
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.