Re: Little patch for lisp-find-hash-form (please try)
Martin Atzmueller <[email protected]>
| Newsgroups | gmane.lisp.ilisp.devel |
|---|---|
| Message-ID | <[email protected]> |
Matthias Koeppe wrote:
>
> Current ILISP does not find the buffer package of a file starting with
> the following lines:
>
> ------------------------------
> (eval-when (compile load eval)
> #+clocc-lpn
> (require :port-ext (translate-logical-pathname "clocc:src;port;ext"))
> ;; `default-directory'
> #+clocc-lpn
> (require :port-path (translate-logical-pathname "port:path"))
> #+(and allegro mswindows)
> (require :ole))
>
> (in-package :port)
> ------------------------------
I can't reproduce this. If package :port is defined ILISP finds the
buffer package correctly.
> I believe to have found a fix for this. There was strange code in
> LISP-FIND-HASH-FORM, which set the variable IN-PACKAGE-FOUND-P of its
> caller LISP-BUFFER-PACKAGE-INTERNAL to true, no matter if an
> IN-PACKAGE form was found or not. Since IN-PACKAGE-FOUND-P is
> properly set in L-B-P-I, I have simply removed the strange code.
I suspect that the variable IN-PACKAGE-FOUND-P was there only for
diagnostic purposes anyway, since it isn't really being used in the
code. So, this variable can go away as well.
I would propose the following patch:
--- ../ILISP/ilisp-snd.el Thu Nov 7 10:03:14 2002
+++ ilisp-snd.el Sun Nov 10 16:30:23 2002
@@ -97,9 +97,7 @@
(point))
(match-end 0))))
- (cond ((or (prog1
- (string-match in-package-regexp found)
- (setq in-package-found-p t))
+ (cond ((or (string-match in-package-regexp found)
(string-match defpackage-regexp found))
(backward-char)
(buffer-substring-no-properties (point) (progn (forward-sexp) (point))))
@@ -142,7 +140,6 @@
(defpackage-regexp (ilisp-value 'ilisp-defpackage-command-string t))
(hash-in-package-forms-list nil)
(hash-defpackage-forms-list nil)
- (in-package-found-p nil)
(package nil)
(should-not-cache-p nil))
(if (not hash-form-regexp)
@@ -163,7 +160,6 @@
nil)
(t
(when (and sub-expr (string-match in-package-regexp
sub-expr))
- (setq in-package-found-p t)
(push hash-expr hash-in-package-forms-list))
(when (and sub-expr (string-match defpackage-regexp
sub-expr))
(push hash-expr hash-defpackage-forms-list))
----
Since I have at least one more patch to commit anyway,
I can commit this change, too, if you want.
--
Martin Atzmueller <[email protected]>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf