From: Peter Seibel
Subject: Some simple Franz/emacs questions
Date: 
Message-ID: <m3wunqdjfq.fsf@localhost.localdomain>
I'm using Allegro CL on Linux in XEmacs using Franz's eli package.
I've got a a question about how to use it effectively that I'm hoping
someone here will be able to answer.

Say I've got two .lisp files "foo.lisp" and "test-foo.lisp". In
"foo.lisp" I've got the production code for my foo app. In
"test-foo.lisp" I've got the unit tests for foo. Each file has it's
own 'defpackage' (defining "FOO" and "TEST-FOO" respectively) and
'in-package'. But it seems that when I use C-c C-s
('fi:lisp-eval-or-compile-last-sexp') or C-c C-x
('fi:lisp-eval-or-compile-defun') the evaluation is done in whatever
package happens to be current in my top-level. Because I'm switching
back and forth between the two files, it would be a pain--it seems--to
keep switching the top-level's package.

If I use C-c C-b ('fi:lisp-eval-or-compile-current-buffer') it does
the right thing, packagewise, but then I get warnings about my
'defconstants' being redefined. (Plus it seems silly to recompile the
whole buffer--currently it's basically instantaneous but hopefully
I'll eventually have written enough code that it won't be.)

I assume I must be missing some usage pattern that will make this all
appropriately convenient. Any advice?

-Peter

-- 
Peter Seibel
·····@javamonkey.com

From: Kenny Tilton
Subject: Re: Some simple Franz/emacs questions
Date: 
Message-ID: <3DCA7F45.9000004@nyc.rr.com>
Peter Seibel wrote:
> I'm using Allegro CL on Linux in XEmacs using Franz's eli package.
> I've got a a question about how to use it effectively that I'm hoping
> someone here will be able to answer.
> 
> Say I've got two .lisp files "foo.lisp" and "test-foo.lisp". In
> "foo.lisp" I've got the production code for my foo app. In
> "test-foo.lisp" I've got the unit tests for foo. Each file has it's
> own 'defpackage' (defining "FOO" and "TEST-FOO" respectively) and
> 'in-package'. But it seems that when I use C-c C-s
> ('fi:lisp-eval-or-compile-last-sexp') or C-c C-x
> ('fi:lisp-eval-or-compile-defun') the evaluation is done in whatever
> package happens to be current in my top-level. Because I'm switching
> back and forth between the two files, it would be a pain--it seems--to
> keep switching the top-level's package.
> 

test-foo.lisp to my mind belongs in the foo package (even if i wasn't 
being bothered by package-switching). that said...

under mcl there was a "mode line" which got picked up by some mechanism 
I never grokked, so bouncing from source file to source file the Right 
Thing happened in re packages. and with acl on win32, it does not even 
need a mode line (and i still cannot tell you how it works). so that is 
nice, and maybe others know of some way to achieve the same with your 
particular set-up.

-- 

  kenny tilton
  clinisys, inc
  ---------------------------------------------------------------
""Well, I've wrestled with reality for thirty-five years, Doctor,
   and I'm happy to state I finally won out over it.""
                                                   Elwood P. Dowd
From: Peter Seibel
Subject: Re: Some simple Franz/emacs questions
Date: 
Message-ID: <m3smycegdi.fsf@localhost.localdomain>
Peter Seibel <·····@javamonkey.com> writes:

> I'm using Allegro CL on Linux in XEmacs using Franz's eli package.
> I've got a a question about how to use it effectively that I'm
> hoping someone here will be able to answer.

[snip question about eli detecting what package I'm in for purposes of
evals]

Ah, I figured out my problem. Because I had created these files in
this emacs session, they hadn't been loaded since I typed in the
'(in-package ...)' expression. Reloading the file (in emacs) caused it
to recognize the right package. I suppose I could get emacs to be
smart about recognizing that I just typed an in-package expression. Or
I can just C-x C-v my file after I've put it in a package.

-Peter

-- 
Peter Seibel
·····@javamonkey.com
From: Erik Naggum
Subject: Re: Some simple Franz/emacs questions
Date: 
Message-ID: <3245725152850990@naggum.no>
* Peter Seibel
| Or I can just C-x C-v my file after I've put it in a package.

  You actually want M-x normal-mode RET.

-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.
From: Peter Seibel
Subject: Re: Some simple Franz/emacs questions
Date: 
Message-ID: <m3of90eg5m.fsf@localhost.localdomain>
Erik Naggum <····@naggum.no> writes:

> * Peter Seibel
> | Or I can just C-x C-v my file after I've put it in a package.
> 
>   You actually want M-x normal-mode RET.

Cool. Didn't know about that one. Thanks.

-Peter
From: Frode Vatvedt Fjeld
Subject: Re: Some simple Franz/emacs questions
Date: 
Message-ID: <2hu1ise709.fsf@vserver.cs.uit.no>
Peter Seibel <·····@javamonkey.com> writes:

> Cool. Didn't know about that one. Thanks.

While normal-mode is ususally the Right Thing, there is also
fi:parse-mode-line-and-package:

  Determine the current package in which the buffer is defined.  The
  buffer's IN-PACKAGE form and the -*- mode line are parsed for this
  information.  This function is automatically called when a Common
  Lisp source file is visited, but may be executed explicitly to
  re-parse the package.

-- 
Frode Vatvedt Fjeld