From trittweiler at common-lisp.net Mon Jun 4 16:17:18 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Mon, 4 Jun 2007 12:17:18 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070604161718.6EA463701B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31910 Modified Files: swank.lisp Log Message: Revised docstring in SWANK::SYMBOL-STATUS; added comment to SWANK::UPDATE-INDENTATION/DELTA-FOR-EMACS. --- /project/slime/cvsroot/slime/swank.lisp 2007/05/24 19:23:36 1.489 +++ /project/slime/cvsroot/slime/swank.lisp 2007/06/04 16:17:17 1.490 @@ -2320,7 +2320,7 @@ :remove-args nil))) (unless (eql form-completion :not-available) (return-from format-arglist-for-echo-area - (decoded-arglist-to-string + (decoded-arglist-to-string form-completion *package* :operator operator-name @@ -3362,7 +3362,9 @@ Or more simply, if S is not _inherited_. - You can check that with: (NOT (EQ (SYMBOL-STATUS S P) :INHERITED)) + You can check that with: (LET ((STATUS (SYMBOL-STATUS S P))) + (AND STATUS + (NOT (EQ STATUS :INHERITED)))) _external_ if S is going to be inherited into any package that @@ -3377,15 +3379,22 @@ _internal_ if S is _accessible_ but not _external_. + + You can check that with: (LET ((STATUS (SYMBOL-STATUS S P))) + (AND STATUS + (NOT (EQ STATUS :EXTERNAL)))) -Notice that the definition of _internal_ is the definition of the -respective glossary entry in the spec; *However*, most times, -when you speak about \"internal symbols\", you're not talking -about the symbols inherited from other packages, but only about -the symbols specific to the package in question. -Thus SYMBOL-STATUS splits this up into two explicit pieces: -:INTERNAL, and :INHERITED. Just as CL:FIND-SYMBOL does. + Notice that this is *different* to + (EQ (SYMBOL-STATUS S P) :INTERNAL) + because what the spec considers _internal_ is split up into two + explicit pieces: :INTERNAL, and :INHERITED; just as, for instance, + CL:FIND-SYMBOL does. + + The rationale is that most times when you speak about \"internal\" + symbols, you're actually not including the symbols inherited + from other packages, but only about the symbols directly specific + to the package in question. " (when package ; may be NIL when symbol is completely uninterned. (check-type symbol symbol) (check-type package package) @@ -5643,6 +5652,8 @@ (do-all-symbols (symbol) (consider symbol)) (do-symbols (symbol *buffer-package*) + ;; We're really just interested in the symbols of *BUFFER-PACKAGE*, + ;; and *not* all symbols that are _present_ (cf. SYMBOL-STATUS.) (when (eq (symbol-package symbol) *buffer-package*) (consider symbol))))) alist)) From trittweiler at common-lisp.net Sat Jun 16 11:36:35 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 16 Jun 2007 07:36:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070616113635.6A1AE66001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22415 Modified Files: slime.el Log Message: * slime.el: Pressing `C-M-a' (beginning-of-defun) in midst of the last REPL prompt directs the cursor to the beginning of the prompt. Pressing it again, would do nothing; now it moves the cursor to the start of the previous prompt (as it's consistent with the behaviour when the cursor was placed midst one of the old prompts.) Likewise for `C-M-e' (end-of-defun) Additionally fixing `C-c C-s' (slime-complete-form) at the REPL. (slime-keys): New bindings for `C-M-a' and `C-M-e' to SLIME-BEGINNING-OF-DEFUN and SLIME-END-OF-DEFUN respectively. (slime-keys): Making `C-c C-q' (slime-close-parens-at-point) obsolete, as it didn't work correctly on the REPL. (slime-repl-mode-map): Removed bindings for `C-M-a' and `C-M-e', as they're now inherited from SLIME-KEYS. (slime-repl-beginning-of-defun, slime-repl-end-of-defun): Jump to the previous (next) prompt if called twice in a row. (slime-close-parens-at-point): Commented out. (slime-close-all-sexp): Renamed to SLIME-CLOSE-ALL-PARENS-IN-SEXP. (slime-close-all-parens-in-sexp): Modified to take SLIME-CLOSE-PARENS-LIMIT into account. (slime-complete-form): Use SLIME-CLOSE-ALL-PARENS-IN-SEXP. --- /project/slime/cvsroot/slime/slime.el 2007/05/23 14:26:15 1.790 +++ /project/slime/cvsroot/slime/slime.el 2007/06/16 11:36:35 1.791 @@ -677,6 +677,8 @@ ("\C-c" slime-compile-defun :prefixed t) ("\C-l" slime-load-file :prefixed t) ;; Editing/navigating + ("\M-\C-a" slime-beginning-of-defun :inferior t) + ("\M-\C-e" slime-end-of-defun :inferior t) ("\M-\C-i" slime-complete-symbol :inferior t) ("\C-i" slime-complete-symbol :prefixed t :inferior t) ("\M-i" slime-fuzzy-complete-symbol :prefixed t :inferior t) @@ -684,7 +686,8 @@ ("\C-x4." slime-edit-definition-other-window :inferior t :sldb t) ("\C-x5." slime-edit-definition-other-frame :inferior t :sldb t) ("\M-," slime-pop-find-definition-stack :inferior t :sldb t) - ("\C-q" slime-close-parens-at-point :prefixed t :inferior t) + ; Obsolete; see comment at SLIME-CLOSE-PARENS-AT-POINT. + ;("\C-q" slime-close-parens-at-point :prefixed t :inferior t) ("\C-c\M-q" slime-reindent-defun :inferior t) ;; Evaluating ("\C-x\C-e" slime-eval-last-expression :inferior t) @@ -721,7 +724,7 @@ (">" slime-list-callees :prefixed t :inferior t :sldb t) ;; "Other" ("\I" slime-inspect :prefixed t :inferior t :sldb t) - ("\C-]" slime-close-all-sexp :prefixed t :inferior t :sldb t) + ("\C-]" slime-close-all-parens-in-sexp :prefixed t :inferior t :sldb t) ("\C-xt" slime-list-threads :prefixed t :inferior t :sldb t) ("\C-xc" slime-list-connections :prefixed t :inferior t :sldb t) ;; Shadow unwanted bindings from inf-lisp @@ -3195,8 +3198,6 @@ ("\C-c\C-u" 'slime-repl-kill-input) ("\C-c\C-n" 'slime-repl-next-prompt) ("\C-c\C-p" 'slime-repl-previous-prompt) - ("\M-\C-a" 'slime-repl-beginning-of-defun) - ("\M-\C-e" 'slime-repl-end-of-defun) ("\C-c\C-l" 'slime-load-file) ("\C-c\C-k" 'slime-compile-and-load-file) ("\C-c\C-z" 'slime-nop)) @@ -3225,7 +3226,9 @@ (when slime-repl-enable-presentations ;; Respect the syntax text properties of presentations. (set (make-local-variable 'parse-sexp-lookup-properties) t)) - ;; We only want REPL prompts as start of the "defun". + ;; At the REPL, we define beginning-of-defun and end-of-defun to be + ;; the start of the previous prompt or next prompt respectively. + ;; Notice the interplay with SLIME-REPL-BEGINNING-OF-DEFUN. (set (make-local-variable 'beginning-of-defun-function) 'slime-repl-mode-beginning-of-defun) (set (make-local-variable 'end-of-defun-function) @@ -3739,16 +3742,25 @@ (defun slime-repl-beginning-of-defun () "Move to beginning of defun." (interactive) - (if (slime-repl-in-input-area-p) + ;; We call BEGINNING-OF-DEFUN if we're at the start of a prompt + ;; already, to trigger SLIME-REPL-MODE-BEGINNING-OF-DEFUN by means + ;; of the locally bound BEGINNING-OF-DEFUN-FUNCTION, in order to + ;; jump to the start of the previous prompt. + (if (and (not (= (point) slime-repl-input-start-mark)) + (slime-repl-in-input-area-p)) (goto-char slime-repl-input-start-mark) - (beginning-of-defun))) + (beginning-of-defun)) + t) (defun slime-repl-end-of-defun () "Move to next of defun." (interactive) - (if (slime-repl-in-input-area-p) + ;; C.f. SLIME-REPL-BEGINNING-OF-DEFUN. + (if (and (not (= (point) slime-repl-input-end-mark)) + (slime-repl-in-input-area-p)) (goto-char slime-repl-input-end-mark) - (end-of-defun))) + (end-of-defun)) + t) (defun slime-repl-at-prompt-end-p () (and (get-char-property (max 1 (1- (point))) 'slime-repl-prompt) @@ -5666,7 +5678,7 @@ ;; really necessary (thinking especially of paredit.el.) (insert (substring result 0 -1)) (let ((slime-close-parens-limit 1)) - (slime-close-parens-at-point))) + (slime-close-all-parens-in-sexp))) (save-excursion (backward-up-list 1) (indent-sexp))))))) @@ -9781,6 +9793,21 @@ ;;;; Editing commands +(defun slime-beginning-of-defun () + (interactive) + (if (and (boundp 'slime-repl-input-start-mark) + slime-repl-input-start-mark) + (slime-repl-beginning-of-defun) + (beginning-of-defun))) + +(defun slime-end-of-defun () + (interactive) + (if (and (boundp 'slime-repl-input-end-mark) + slime-repl-input-end-mark) + (slime-repl-end-of-defun) + (end-of-defun))) + + (defvar slime-comment-start-regexp "\\(\\(^\\|[^\n\\\\]\\)\\([\\\\][\\\\]\\)*\\);+[ \t]*" "Regexp to match the start of a comment.") @@ -9796,7 +9823,7 @@ (t (goto-char boundary) nil)))) -(defun slime-close-all-sexp (&optional region) +(defun slime-close-all-parens-in-sexp (&optional region) "Balance parentheses of open s-expressions at point. Insert enough right parentheses to balance unmatched left parentheses. Delete extra left parentheses. Reformat trailing parentheses @@ -9830,7 +9857,20 @@ (setq point (point)) (skip-chars-forward " \t\n)") (skip-chars-backward " \t\n") - (delete-region point (point))))) + (delete-region point (point)) + ;; We always insert as many parentheses as necessary, and only + ;; afterwards delete the superfluously-added parens because of + ;; "extra right parens" above (which is done this way, since the + ;; code works with regexps and it's hard to keep track of those + ;; extra right parentheses this way.) + (when slime-close-parens-limit + (dotimes (i (max 0 (- sexp-level slime-close-parens-limit))) + (delete-char -1)))))) + +(defvar slime-close-parens-limit nil + "Maxmimum parens for `slime-close-all-sexp' to insert. NIL +means to insert as many parentheses as necessary to correctly +close the form.") (defun slime-insert-balanced-comments (arg) "Insert a set of balanced comments around the s-expression @@ -9866,20 +9906,29 @@ (forward-sexp)) (replace-match "")))) -(defvar slime-close-parens-limit 16 - "Maxmimum parens for `slime-close-parens-at-point' to insert.") -(defun slime-close-parens-at-point () - "Close parenthesis at point to complete the top-level-form. Simply -inserts ')' characters at point until `beginning-of-defun' and -`end-of-defun' execute without errors, or `slime-close-parens-limit' -is exceeded." - (interactive) - (loop for i from 1 to slime-close-parens-limit - until (save-excursion - (beginning-of-defun) - (ignore-errors (end-of-defun) t)) - do (insert ")"))) +;; SLIME-CLOSE-PARENS-AT-POINT is obsolete: + +;; It doesn't work correctly on the REPL, because there +;; BEGINNING-OF-DEFUN-FUNCTION and END-OF-DEFUN-FUNCTION is bound to +;; SLIME-REPL-MODE-BEGINNING-OF-DEFUN (and +;; SLIME-REPL-MODE-END-OF-DEFUN respectively) which compromises the +;; way how they're expect to work (i.e. END-OF-DEFUN does not signal +;; an UNBOUND-PARENTHESES error.) + +;; Use SLIME-CLOSE-ALL-PARENS-IN-SEXP instead. + +;; (defun slime-close-parens-at-point () +;; "Close parenthesis at point to complete the top-level-form. Simply +;; inserts ')' characters at point until `beginning-of-defun' and +;; `end-of-defun' execute without errors, or `slime-close-parens-limit' +;; is exceeded." +;; (interactive) +;; (loop for i from 1 to slime-close-parens-limit +;; until (save-excursion +;; (slime-beginning-of-defun) +;; (ignore-errors (slime-end-of-defun) t)) +;; do (insert ")"))) ;;;; Font Lock From trittweiler at common-lisp.net Sat Jun 16 11:37:37 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 16 Jun 2007 07:37:37 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070616113737.0F15716011@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22582 Modified Files: ChangeLog Log Message: * slime.el: Pressing `C-M-a' (beginning-of-defun) in midst of the last REPL prompt directs the cursor to the beginning of the prompt. Pressing it again, would do nothing; now it moves the cursor to the start of the previous prompt (as it's consistent with the behaviour when the cursor was placed midst one of the old prompts.) Likewise for `C-M-e' (end-of-defun) Additionally fixing `C-c C-s' (slime-complete-form) at the REPL. (slime-keys): New bindings for `C-M-a' and `C-M-e' to SLIME-BEGINNING-OF-DEFUN and SLIME-END-OF-DEFUN respectively. (slime-keys): Making `C-c C-q' (slime-close-parens-at-point) obsolete, as it didn't work correctly on the REPL. (slime-repl-mode-map): Removed bindings for `C-M-a' and `C-M-e', as they're now inherited from SLIME-KEYS. (slime-repl-beginning-of-defun, slime-repl-end-of-defun): Jump to the previous (next) prompt if called twice in a row. (slime-close-parens-at-point): Commented out. (slime-close-all-sexp): Renamed to SLIME-CLOSE-ALL-PARENS-IN-SEXP. (slime-close-all-parens-in-sexp): Modified to take SLIME-CLOSE-PARENS-LIMIT into account. (slime-complete-form): Use SLIME-CLOSE-ALL-PARENS-IN-SEXP. --- /project/slime/cvsroot/slime/ChangeLog 2007/05/24 19:23:24 1.1136 +++ /project/slime/cvsroot/slime/ChangeLog 2007/06/16 11:37:36 1.1137 @@ -1,3 +1,32 @@ +2007-06-16 Tobias C. Rittweiler + + * slime.el: Pressing `C-M-a' (beginning-of-defun) in midst of the + last REPL prompt directs the cursor to the beginning of the + prompt. Pressing it again, would do nothing; now it moves the + cursor to the start of the previous prompt (as it's consistent + with the behaviour when the cursor was placed midst one of the old + prompts.) + + Likewise for `C-M-e' (end-of-defun) + + Additionally fixing `C-c C-s' (slime-complete-form) at the REPL. + + (slime-keys): New bindings for `C-M-a' and `C-M-e' to + SLIME-BEGINNING-OF-DEFUN and SLIME-END-OF-DEFUN respectively. + (slime-keys): Making `C-c C-q' (slime-close-parens-at-point) + obsolete, as it didn't work correctly on the REPL. + (slime-repl-mode-map): Removed bindings for `C-M-a' and `C-M-e', + as they're now inherited from SLIME-KEYS. + (slime-repl-beginning-of-defun, slime-repl-end-of-defun): Jump to + the previous (next) prompt if called twice in a row. + + (slime-close-parens-at-point): Commented out. + (slime-close-all-sexp): Renamed to SLIME-CLOSE-ALL-PARENS-IN-SEXP. + (slime-close-all-parens-in-sexp): Modified to take + SLIME-CLOSE-PARENS-LIMIT into account. + (slime-complete-form): Use SLIME-CLOSE-ALL-PARENS-IN-SEXP. + + 2007-05-24 Tobias C. Rittweiler * swank.lisp: Fixed regression in completion: "swank[TAB]" would From trittweiler at common-lisp.net Wed Jun 27 15:52:57 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 27 Jun 2007 11:52:57 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070627155257.D03A35411F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21404 Modified Files: slime.el Log Message: Fixing `C-c M-q' at the REPL. Thanks to Andr?? Thieme for pointing out that it has been broken since several months. * slime.el (slime-reindent-defun): Use functions `slime-beginning-of-defun' and `slime-end-of-defun' that were introduced in the last changeset. --- /project/slime/cvsroot/slime/slime.el 2007/06/16 11:36:35 1.791 +++ /project/slime/cvsroot/slime/slime.el 2007/06/27 15:52:57 1.792 @@ -10039,16 +10039,13 @@ (fill-paragraph nil) (let ((start (progn (unless (and (zerop (current-column)) (eq ?\( (char-after))) - (if (and (boundp 'slime-repl-input-start-mark) - slime-repl-input-start-mark) - (slime-repl-beginning-of-defun) - (beginning-of-defun))) + (slime-beginning-of-defun)) (point))) - (end (ignore-errors (end-of-defun) (point)))) + (end (ignore-errors (slime-end-of-defun) (point)))) (unless end (forward-paragraph) (slime-close-all-sexp) - (end-of-defun) + (slime-end-of-defun) (setf end (point))) (indent-region start end nil))))) From trittweiler at common-lisp.net Wed Jun 27 15:53:44 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 27 Jun 2007 11:53:44 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070627155344.D40D95E006@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21541 Modified Files: ChangeLog Log Message: Fixing `C-c M-q' at the REPL. Thanks to Andr?? Thieme for pointing out that it has been broken since several months. * slime.el (slime-reindent-defun): Use functions `slime-beginning-of-defun' and `slime-end-of-defun' that were introduced in the last changeset. --- /project/slime/cvsroot/slime/ChangeLog 2007/06/16 11:37:36 1.1137 +++ /project/slime/cvsroot/slime/ChangeLog 2007/06/27 15:53:44 1.1138 @@ -1,3 +1,12 @@ +2007-06-27 Tobias C. Rittweiler + + Fixing `C-c M-q' at the REPL. Thanks to Andr? Thieme for pointing + out that it has been broken since several months. + + * slime.el (slime-reindent-defun): Use functions + `slime-beginning-of-defun' and `slime-end-of-defun' that were + introduced in the last changeset. + 2007-06-16 Tobias C. Rittweiler * slime.el: Pressing `C-M-a' (beginning-of-defun) in midst of the From trittweiler at common-lisp.net Wed Jun 27 16:46:00 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 27 Jun 2007 12:46:00 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070627164600.6067B5411F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv5154 Modified Files: slime.el Log Message: Fixing `C-c M-q' at the REPL. Thanks to Andr?? Thieme for pointing out that it has been broken since several months. * slime.el (slime-reindent-defun): Use functions `slime-beginning-of-defun' and `slime-end-of-defun' that were introduced in the last changeset. --- /project/slime/cvsroot/slime/slime.el 2007/06/27 15:52:57 1.792 +++ /project/slime/cvsroot/slime/slime.el 2007/06/27 16:46:00 1.793 @@ -3738,7 +3738,11 @@ (defun slime-repl-in-input-area-p () (and (<= slime-repl-input-start-mark (point)) (<= (point) slime-repl-input-end-mark))) - + +(defun slime-repl-at-prompt-start-p () + ;; This will not work on non-current prompts. + (= (point) slime-repl-input-start-mark)) + (defun slime-repl-beginning-of-defun () "Move to beginning of defun." (interactive) @@ -3746,7 +3750,7 @@ ;; already, to trigger SLIME-REPL-MODE-BEGINNING-OF-DEFUN by means ;; of the locally bound BEGINNING-OF-DEFUN-FUNCTION, in order to ;; jump to the start of the previous prompt. - (if (and (not (= (point) slime-repl-input-start-mark)) + (if (and (not (slime-repl-at-prompt-start-p)) (slime-repl-in-input-area-p)) (goto-char slime-repl-input-start-mark) (beginning-of-defun)) @@ -3762,6 +3766,7 @@ (end-of-defun)) t) +;; FIXME: Shouldn't this be (= (point) slime-repl-input-end-mark)? (defun slime-repl-at-prompt-end-p () (and (get-char-property (max 1 (1- (point))) 'slime-repl-prompt) (not (get-char-property (point) 'slime-repl-prompt)))) @@ -10037,8 +10042,9 @@ (save-excursion (if (or force-text-fill (slime-beginning-of-comment)) (fill-paragraph nil) - (let ((start (progn (unless (and (zerop (current-column)) - (eq ?\( (char-after))) + (let ((start (progn (unless (or (and (zerop (current-column)) + (eq ?\( (char-after))) + (slime-repl-at-prompt-start-p)) (slime-beginning-of-defun)) (point))) (end (ignore-errors (slime-end-of-defun) (point)))) From heller at common-lisp.net Thu Jun 28 12:27:51 2007 From: heller at common-lisp.net (heller) Date: Thu, 28 Jun 2007 08:27:51 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070628122751.046552E1CF@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27862 Modified Files: slime.el ChangeLog Log Message: Undo some of Marco's changes from 2007-05-23. * slime.el (def-slime-selector-method): BODY can return a buffer name, like "*slime-events*". Handle that and never ignore invalid return values. Force BODY to abort if there's no suitable buffer. Why would you want to switch buffers if the desired buffer doesn't exist? --- /project/slime/cvsroot/slime/slime.el 2007/06/27 16:46:00 1.793 +++ /project/slime/cvsroot/slime/slime.el 2007/06/28 12:27:51 1.794 @@ -9716,14 +9716,17 @@ selects a buffer. BODY is a series of forms which are evaluated when the selector -is chosen. If they return a buffer that buffer is selected with +is chosen. The returned buffer is selected with switch-to-buffer." `(setq slime-selector-methods (sort* (cons (list ,key ,description (lambda () - (let ((new-buffer (progn , at body))) - (when (bufferp new-buffer) - (switch-to-buffer new-buffer))))) + (let ((buffer (progn , at body))) + (cond ((get-buffer buffer) + (switch-to-buffer buffer)) + (t + (message "No such buffer: %S" buffer) + (ding)))))) (remove* ,key slime-selector-methods :key #'car)) #'< :key #'car))) @@ -9769,7 +9772,7 @@ (def-slime-selector-method ?d "*sldb* buffer for the current connection." (or (sldb-get-default-buffer) - (message "No debugger buffer"))) + (error "No debugger buffer"))) (def-slime-selector-method ?e "most recently visited emacs-lisp-mode buffer." --- /project/slime/cvsroot/slime/ChangeLog 2007/06/27 15:53:44 1.1138 +++ /project/slime/cvsroot/slime/ChangeLog 2007/06/28 12:27:51 1.1139 @@ -1,3 +1,11 @@ +2007-06-28 Helmut Eller + + * slime.el (def-slime-selector-method): Revert Marco's change from + 2007-05-23. BODY can return a buffer name, like "*slime-events*". + Handle that and never ignore invalid return values. Force BODY to + abort if there's no suitable buffer. Why would you want to switch + buffers if the desired buffer doesn't exist? + 2007-06-27 Tobias C. Rittweiler Fixing `C-c M-q' at the REPL. Thanks to Andr? Thieme for pointing