Hi,
I'm using the latest emacs and slime (git master) and M-. does not work:
"slime-edit-definition-cont: No known definition for: write-table (in COMMON-LISP-USER)"
("write-table" is a function in my lisp-file)
What could I do please to solve this problem?
TIA for any help,
On Tue, Aug 18 2015, Peter Münster wrote:
What could I do please to solve this problem?
This is the typical way it works:
1. start the Lisp process with M-x slime. 2. load the source file into the Lisp process with slime-load-file or a similar command. 3. now the Lisp process should know where the definitions are located (SBCL and the "better" implementations at least do) 4. M-. also needs to know the package where to search for the symbol; by default that's derived from the nearest in-package form, but if there isn't any in-package in the current buffer then COMMON-LISP-USER will be used. It's also possibly to explicitly specify the package e.g. with C-u M-. "my-package:write-table" RET
If you still have problems, tell us how your setup looks like: which Lisp implementation you use, how you load the code, the output in the *inferior-lisp* buffer etc. so that we can reproduce the problem.
Helmut
On Tue, Aug 18 2015, Helmut Eller wrote:
On Tue, Aug 18 2015, Peter Münster wrote:
- start the Lisp process with M-x slime.
Done.
- load the source file into the Lisp process with slime-load-file or a similar command.
I open the file with C-x C-f (buffer is in slime-mode then). With slime-load-file, the file would be executed and that should be avoided.
Is it possible, that slime-load-file wasn't needed about one year ago?
Nevertheless, thanks for you answer. I'll use this workaround now:
1.) open the lisp-file 2.) remove first line (#!/usr/bin/sbcl --script) 3.) remove last lines (execution of functions) 4.) slime-load-file the lisp-file 5.) undo 2.) and 3.)
But whenever I add functions to the script, I have to repeat 2.) to 5.), that's not very comfortable. Or perhaps I should switch to gtags...
Thanks for your efforts,
On Tue, Aug 18 2015, Peter Münster wrote:
On Tue, Aug 18 2015, Helmut Eller wrote:
- load the source file into the Lisp process with slime-load-file or a similar command.
I open the file with C-x C-f (buffer is in slime-mode then). With slime-load-file, the file would be executed and that should be avoided.
Is it possible, that slime-load-file wasn't needed about one year ago?
That's almost impossible. The Lisp process wouldn't have known about your code; perhaps you had something in the core file.
Nevertheless, thanks for you answer. I'll use this workaround now:
1.) open the lisp-file 2.) remove first line (#!/usr/bin/sbcl --script) 3.) remove last lines (execution of functions) 4.) slime-load-file the lisp-file 5.) undo 2.) and 3.)
But whenever I add functions to the script, I have to repeat 2.) to 5.), that's not very comfortable. Or perhaps I should switch to gtags...
Instead of #! you could try the ":"; trick:
":"; exec sbcl --load "$0" --eval '(main)' "$@" (print "hello") (defun main () (format t "args: ~s" sb-ext:*posix-argv*) (sb-ext:exit :code 123))
For Bash ":"; is essentially a no-op, and for Lisp everything after the ; is a comment.
Helmut
On Wed, Aug 19 2015, Helmut Eller wrote:
Is it possible, that slime-load-file wasn't needed about one year ago?
That's almost impossible. The Lisp process wouldn't have known about your code; perhaps you had something in the core file.
Ok, that means that I've never used M-. before with Common Lisp (strange but possible).
Instead of #! you could try the ":"; trick:
":"; exec sbcl --load "$0" --eval '(main)' "$@"
Great, many thanks!
There is just one tiny issue: I get a lot of warnings from the flexi-stream package.
With #!/usr/bin/sbcl --script (load "~/.sbclrc")
there is no warning.
I've tried ":"; exec sbcl --noinform --disable-ldb --lose-on-corruption --end-runtime-options --no-userinit --disable-debugger --load "$0" --eval '(main)' --end-toplevel-options "$@" (load "~/.sbclrc")
but the warnings remain...
I'm going to read "4.1.1 Controlling Verbosity" of the SBCL manual now, there is certainly a solution.