[Did this post not make it to the list yesterday?]
heller@common-lisp.net (Helmut Eller) writes:
Modified Files: slime.texi Log Message: Mention Unicode support and some multi-threading issues.
Cool. I added some notes about the new inspector. I wonder if we're actually using the INSPECTOR argument to INSPECT-IN-EMACS anywhere? Can we remove it, or?
I also documented slime-selector. I'm reproducing that section here since it's so bad that most people probably don't know about it:
6.1 `slime-selector' ====================
The `slime-selector' command is for quickly switching to important buffers: the REPL, SLDB, the Lisp source you were just hacking, etc. Once invoked the command prompts for a single letter to specify which buffer it should display. Here are some of the options:
`?' A help buffer listing all `slime-selectors''s available buffers.
`r' The REPL buffer for the current SLIME connection.
`d' The most recently activated SLDB buffer for the current connection.
`l' The most recently visited `lisp-mode' source buffer.
`s' The `*slime-scratch*' buffer. *Note slime-scratch::.
`slime-selector' doesn't have a key binding by default but we suggest that you assign it a global one. You can bind `C-c s' like this:
(global-set-key "\C-cs" 'slime-selector)
And then you can switch to the REPL from anywhere with `C-c s r'.
The macro `def-slime-selector-method' can be used to define new buffers for `slime-selector' to find.
Luke Gorrie luke@synap.se writes:
[Did this post not make it to the list yesterday?]
I didn't see it before.
heller@common-lisp.net (Helmut Eller) writes:
Modified Files: slime.texi Log Message: Mention Unicode support and some multi-threading issues.
Cool. I added some notes about the new inspector. I wonder if we're actually using the INSPECTOR argument to INSPECT-IN-EMACS anywhere? Can we remove it, or?
I think it's used to dispatch to backend specific methods while still having a fallback method in the front end, e.g., we have methods for:
inspect-for-emacs (object function) (inspector t) ; in swank.lisp inspect-for-emacs (object function) (inspector lispworks-inspector)
The inspector argument is only used to select the method. If we remove the inspector argument, then one method overwrites the other.
The other idea was that the extra argument could be used to implement different "modes", e.g., switching between the generic and the backend specific view for an object. But that's not used.
Those (ignore inspector) declarations are certainly ugly. Maybe there's a better way to do all this.
BTW, I'd like to remove cl-indent.el from SLIME, because nobody worked on it. Any objections?
I also documented slime-selector. I'm reproducing that section here since it's so bad that most people probably don't know about it:
How true.
Helmut.
Helmut Eller heller@common-lisp.net writes:
Luke Gorrie luke@synap.se writes:
Cool. I added some notes about the new inspector. I wonder if we're actually using the INSPECTOR argument to INSPECT-IN-EMACS anywhere? Can we remove it, or?
I think it's used to dispatch to backend specific methods while still having a fallback method in the front end, e.g., we have methods for:
inspect-for-emacs (object function) (inspector t) ; in swank.lisp inspect-for-emacs (object function) (inspector lispworks-inspector)
The inspector argument is only used to select the method. If we remove the inspector argument, then one method overwrites the other.
Even with the inspector argument, doesn't the backend-specific method completely shadow the generic one? Maybe the idea is to fall back if you decide to remove the backend-specific method?
BTW, I'd like to remove cl-indent.el from SLIME, because nobody worked on it. Any objections?
Not from me.
I was going to suggest that we remove metering.lisp but instead I made a sweep through and tried to remove all the reader-conditional cruft for Lisps other than CLISP and OpenMCL. There was a heck of a lot of it so I might have made some mistakes.
Too bad I didn't think to do something like
(setf *features* (list* :openmcl :clisp (remove :cmucl *features*)))
and then let the syntax highlighting show me which code was needed!
Luke Gorrie luke@synap.se writes:
The inspector argument is only used to select the method. If we remove the inspector argument, then one method overwrites the other.
Even with the inspector argument, doesn't the backend-specific method completely shadow the generic one?
Yes, as long as you a pass a backend-specific inspector argument. That's currently always the case. In principle you could also pass something else (something that doesn't match the backend-specific specifier, e.g. nil) and the generic method would be called. But this option is currently not used.
Maybe the idea is to fall back if you decide to remove the backend-specific method?
swank.lisp is loaded after swank-lispworks, and it was a bit difficult to check if there was already a backend-specific version.
Helmut.
Helmut Eller wrote:
Luke Gorrie luke@synap.se writes:
[Did this post not make it to the list yesterday?]
I didn't see it before.
heller@common-lisp.net (Helmut Eller) writes:
Modified Files: slime.texi Log Message: Mention Unicode support and some multi-threading issues.
Cool. I added some notes about the new inspector. I wonder if we're actually using the INSPECTOR argument to INSPECT-IN-EMACS anywhere? Can we remove it, or?
I think it's used to dispatch to backend specific methods while still having a fallback method in the front end, e.g., we have methods for:
inspect-for-emacs (object function) (inspector t) ; in swank.lisp inspect-for-emacs (object function) (inspector lispworks-inspector)
The inspector argument is only used to select the method. If we remove the inspector argument, then one method overwrites the other.
The other idea was that the extra argument could be used to implement different "modes", e.g., switching between the generic and the backend specific view for an object. But that's not used.
Those (ignore inspector) declarations are certainly ugly. Maybe there's a better way to do all this.
BTW, I'd like to remove cl-indent.el from SLIME, because nobody worked on it. Any objections?
Well, I have some changes to support more control of loop indentation that I've been meaning to submit. Are you interested? Some folks here have been using them for about a month and seem happy.
I also documented slime-selector. I'm reproducing that section here since it's so bad that most people probably don't know about it:
How true.
Helmut.
On Mon, 04 Apr 2005 09:37:11 -0400, Dan Pierson dlp@itasoftware.com wrote:
Well, I have some changes to support more control of loop indentation that I've been meaning to submit. Are you interested?
Well, I certainly am interested... :)
Edi Weitz edi@agharta.de writes:
On Mon, 04 Apr 2005 09:37:11 -0400, Dan Pierson dlp@itasoftware.com wrote:
Well, I have some changes to support more control of loop indentation that I've been meaning to submit. Are you interested?
Well, I certainly am interested... :)
This is one of those "me too" moments...
Paolo
Dan Pierson dlp@itasoftware.com writes:
Well, I have some changes to support more control of loop indentation that I've been meaning to submit. Are you interested? Some folks here have been using them for about a month and seem happy.
I already removed the file from CVS, so it will not be in the next release.
Maybe you can post your changes here or send them to the Emacs developers. If the Emacs guys are too slow for our taste, we can re-add the file to SLIME.
Helmut.
On Thu, 07 Apr 2005 09:04:22 +0200, Helmut Eller heller@common-lisp.net wrote:
If the Emacs guys are too slow for our taste
Are you kidding?
Edi Weitz edi@agharta.de writes:
If the Emacs guys are too slow for our taste
Are you kidding?
Well, I don't know how long it takes to get a small change (less than 20 lines) into CVS Emacs. It definitely takes ages until you can convince them to change some C code. It took two months before my server socket changes showed up in CVS. I also had to sign papers. Small changes don't need papers and can probably integrated a lot faster.
But I think it would be better to keep the indentation code in Emacs than to make a fork.
Helmut.
On Thu, 07 Apr 2005 10:40:14 +0200, Helmut Eller heller@common-lisp.net wrote:
Well, I don't know how long it takes to get a small change (less than 20 lines) into CVS Emacs. It definitely takes ages until you can convince them to change some C code. It took two months before my server socket changes showed up in CVS. I also had to sign papers. Small changes don't need papers and can probably integrated a lot faster.
But I think it would be better to keep the indentation code in Emacs than to make a fork.
Yes, it's one thing to get code into Emacs. The other problem is to actually see a new release which incorporates this code. E.g., there are a couple of bugs in the font-locking code for Lisp which IIRC have been fixed in CVS long ago. However, the last substantial release is now more than two years ago (21.4. was just a security fix) so the bugs are still in there.
One could, in theory, build Emacs from CVS from time to time, but a) I'm reluctant to depend on supposedly "unstable" software the whole day and b) I'm too dumb to build Emacs on Wintendo.
I'd prefer if a current, working version of the indentation code at least would be part of SLIME.
Just my EUR 0.02.
Cheers, Edi.
On Thu, 07 Apr 2005 11:15:24 +0200, edi@agharta.de wrote:
there are a couple of bugs in the font-locking code for Lisp which IIRC have been fixed in CVS long ago. However, the last substantial release is now more than two years ago
Is there a patch someplace with those font-lock fixes against 21.4?
On Thu, 7 Apr 2005 05:02:57 -0700, GP lisper spambait@CloudDancer.com wrote:
Is there a patch someplace with those font-lock fixes against 21.4?
You can grab the latest and greatet ELisp files from savannah.gnu.org. The stuff related to font-locking and indenting CL files should work with 21.3 I think.
Cheers, Edi.
On Thu, 07 Apr 2005 15:30:13 +0200, edi@agharta.de wrote:
On Thu, 7 Apr 2005 05:02:57 -0700, GP lisper spambait@CloudDancer.com wrote:
Is there a patch someplace with those font-lock fixes against 21.4?
You can grab the latest and greatet ELisp files from savannah.gnu.org. The stuff related to font-locking and indenting CL files should work with 21.3 I think.
I don't find anything on savannah.gnu.org. Searching that website for "elisp" gives a link to the nongnu side:
http://savannah.nongnu.org/projects/elisp-code/
but in CVS, there is nothing for font-lock. Can you supply a link please?
On Thu, 7 Apr 2005 17:28:34 -0700, GP lisper spambait@CloudDancer.com wrote:
I don't find anything on savannah.gnu.org. Searching that website for "elisp"
You have to search for "Emacs" of course. "Elisp" is just the usual abbreviation for "Emacs Lisp."
But I think it would be better to keep the indentation code in Emacs than to make a fork.
I don't use Emacs but XEmacs so I'm in favor of keeping the indentation code in the Slime CVS and to make it the "official" one (or at least the cutting edge one ;-) so that people can contribute to it.
BTW the latest modification for find-coding-system does not work on XEmacs 21.5.18 Win32 (I had to force it to binary).
Marc
"Marc Battyani" marc.battyani@fractalconcept.com writes:
But I think it would be better to keep the indentation code in Emacs than to make a fork.
I don't use Emacs but XEmacs so I'm in favor of keeping the indentation code in the Slime CVS and to make it the "official" one (or at least the cutting edge one ;-) so that people can contribute to it.
So far, nobody made a contribution. So I think it's ok not to include it in this release. We will see if there's a need for our own indentation code after the release. Most people seem to whine about loop; maybe we should create a loop-indent.el instead of a file for all of CL.
BTW the latest modification for find-coding-system does not work on XEmacs 21.5.18 Win32 (I had to force it to binary).
Uh.. tested with non-mule XEmacs but not with the other. This time it should work for both (and even for Emacs).
Helmut.
Helmut Eller wrote:
Maybe you can post your changes here or send them to the Emacs developers. If the Emacs guys are too slow for our taste, we can re-add the file to SLIME.
Here's a patch against the removed file (which may also match the one in the Emacs sources). The default settings of the new configuration variables match the old behavior, here are the settings we're using internally:
;; Indentation control (setq lisp-indent-function 'common-lisp-indent-function) (setq lisp-loop-keyword-indentation 6);align keywords just after "loop " (setq lisp-loop-forms-indentation 6) (setq lisp-loop-simple-tail-indentation 2) (setq lisp-loop-collector-added-indentation 2) (setq lisp-simple-loop-indentation 2) ;; The following really needs to be put in a hook because it keeps ;; getting overwritten. (put 'if 'common-lisp-indent-function '(2 2 2)) (setq slime-conservative-indentation nil)
Index: cl-indent.el =================================================================== RCS file: /project/slime/cvsroot/slime/Attic/cl-indent.el,v retrieving revision 1.2 diff -u -r1.2 cl-indent.el --- cl-indent.el 26 Oct 2004 00:43:42 -0000 1.2 +++ cl-indent.el 4 Apr 2005 14:43:12 -0000 @@ -101,6 +101,18 @@ :group 'lisp-indent)
+(defcustom lisp-loop-simple-tail-indentation 3 + "*Indentation of forms in loops of the form (LOOP ... DOING <forms>)." + :type 'integer + :group 'lisp-indent) + + +(defcustom lisp-loop-collector-added-indentation 0 + "*Additional indentation for collect and similar keywords in loop bodies." + :type 'integer + :group 'lisp-indent) + + (defcustom lisp-simple-loop-indentation 3 "*Indentation of forms in simple loop forms." :type 'integer @@ -122,6 +134,63 @@ (looking-at "\sw")) (error t)))
+(defun extended-loop-with-simple-tail-p (loop-start) + (interactive "d") + (condition-case () + (save-excursion + (goto-char loop-start) + (forward-char 1) + (forward-sexp 2) + (backward-sexp 1) + ;; Accumulate the pattern of keywords and lists in the body + (let ((pat ())) + (condition-case () + (while (not (and (eobp) (looking-at "\s-)"))) + (if (looking-at "\sw") + (save-excursion + (let ((word (downcase (thing-at-point 'word)))) + (if (or (string= word "do") + (string= word "doing")) + (push 'do pat) + (push 'keyword pat)))) + (push 'list pat)) + (forward-sexp 2) + (backward-sexp 1)) + (error t)) + (setq pat (nreverse pat)) + (let ((after-first-do (memq 'do pat))) + (if (and after-first-do + (not (or (memq 'do (cdr after-first-do)) + (memq 'keyword (cdr after-first-do))))) + t + nil)))) + (error t))) + +(defvar common-lisp-loop-collect-keyword-alist + ;;This is an alist solely so that we can use assoc-ignore-case. + '(("append" t) + ("appending" t) + ("collect" t) + ("collecting" t) + ("count" t) + ("counting" t) + ("maximize" t) + ("maximizing" t) + ("minimize" t) + ("minimizing" t) + ("nconc" t) + ("nconcing" t) + ("sum" t) + ("summing" t)) + "Alist of all of the value accumulation keywords in loop.") + +(defvar common-lisp-loop-conditional-keyword-alist + ;;This is an alist solely so that we can use assoc-ignore-case. + '(("else" t) + ("if" t) + ("when" t) + ("unless" t)) + "Alist of all of the conditional execution keywords in loop.")
(defun common-lisp-loop-part-indentation (indent-point state) "Compute the indentation of loop form constituents." @@ -132,8 +201,33 @@ (beginning-of-line) (cond ((not (extended-loop-p (elt state 1))) (+ loop-indentation lisp-simple-loop-indentation)) - ((looking-at "^\s-*\(:?\sw+\|;\)") - (+ loop-indentation lisp-loop-keyword-indentation)) + ((looking-at "^\s-*\(:?\sw+\)") + (if (zerop lisp-loop-collector-added-indentation) + (+ loop-indentation lisp-loop-keyword-indentation) + ;; Some people like to specially indent a collection keyword + ;; which follows a conditional keyword. + (if (and (assoc-ignore-case (downcase (save-excursion + (skip-chars-forward "^a-zA-Z") + (thing-at-point 'word))) + common-lisp-loop-collect-keyword-alist) + (save-excursion + (backward-sexp 2) + (and (looking-at "\sw") + (assoc-ignore-case (downcase (thing-at-point 'word)) + common-lisp-loop-conditional-keyword-alist)))) + (+ loop-indentation lisp-loop-keyword-indentation + lisp-loop-collector-added-indentation) + (+ loop-indentation lisp-loop-keyword-indentation)))) + ;; Change from previous behavior -- indent comments as forms, not keywords. + ;; Since the default indentation values are the same, this will only affect + ;; people with customized indentation. IMHO, this version works much better with + ;; lisp-loop-simple-tail-indentation. + ((looking-at "^\s-*;") + (if (extended-loop-with-simple-tail-p (elt state 1)) + (+ loop-indentation lisp-loop-simple-tail-indentation) + (+ loop-indentation lisp-loop-forms-indentation))) + ((extended-loop-with-simple-tail-p (elt state 1)) + (+ loop-indentation lisp-loop-simple-tail-indentation)) (t (+ loop-indentation lisp-loop-forms-indentation)))))