Re: slime-complete-symbol* : I noticed that slime-c-p-c does not work correctly but can mangle text after a completion is chosen , [I'm appending a test case to the end of this message.]
I'm afraid I'm to blame for this, I think: the patch I submitted claiming to fix XEmacs behaviour (on 2007-08-04) and which was committed on 2007-09-04 is incorrect [ 1. the analysis is not restricted to XEmacs, and 2. Emacs choose-completion does not work right unless the text in the buffer is a proper prefix of the completions displayed. I cannot see any lowest-common-denominator solution for this.]
I would suggest reverting the patch. The downside is that you get back the original behaviour, which mangles the text BEFORE the completion is chosen: If you type "m-v" and hit TAB the function will delete your text and leave you with "m" -- because "m" is emacs' completed-prefix matching both "machine-version" and "multiple-value*"s. [This may or may not be acceptable, indeed whether it is what you want would depend on which buffer you are in, and what symbol you are trying to complete]
Apologies for the incomplete patch and the earlier noise over the [unrelated yet related] unambiguous-prefix issue (from 06)..
-- Madhu
;;; PS: Here is a test case transcript, and also what to expect on the ;;; suggest fix :
;;; ;;; 1. First we recreate the situation in acl, where there are multiple ;;; completions for "l-p-t". ;;;
CL-USER> '(locale-print-time logical-pathname-translations logical-pathname-translations-database-pathnames)
(LOCALE-PRINT-TIME LOGICAL-PATHNAME-TRANSLATIONS LOGICAL-PATHNAME-TRANSLATIONS-DATABASE-PATHNAMES)
;;; ;;; 2. slime-c-p-c-unambiguous-prefix-p is set to nil ;;; BEFORE:
CL-USER> l-p-t ;;; ^^^ hit TAB, then choose the logical-pathname-translations ;;; completion in the *Completions* buffer
;;; AFTER: The completed form looks like:
CL-USER> (l-plogical-pathname-translations
;;; ;;; 3. Next try after setting slime-c-p-c-unambiguous-prefix-p nil ;;; BEFORE:
CL-USER> l-p-t ;;; ^^^ hit TAB, then choose the logical-pathname-translations ;;; completion in the *Completions* buffer
;;; AFTER:
CL-USER> (logical-pathname-translationsp-t
;;; ;;; 4.WITH 2007-09-04 PATCH REVERTED: ;;; BEFORE:
CL-USER> l-p-t ;;; ^^^ hit TAB, then choose the logical-pathname-translations ;;; completion in the *Completions* buffer
;;; AFTER:
CL-USER> (lo ^^^ note that the text you input is gone.
;;; but at least choosing a completion won't mangle the text in your ;;; buffer
* Madhu m33aow3hj9.fsf@meer.net Wrote on Mon, 05 May 2008 20:49:22 +0530:
| Re: slime-complete-symbol* : I noticed that slime-c-p-c does not work | correctly but can mangle text after a completion is chosen , [I'm | appending a test case to the end of this message.] | | I'm afraid I'm to blame for this, I think: the patch I submitted | claiming to fix XEmacs behaviour (on 2007-08-04) and which was committed | on 2007-09-04 is incorrect [ 1. the analysis is not restricted to | XEmacs, and 2. Emacs choose-completion does not work right unless the | text in the buffer is a proper prefix of the completions displayed. I | cannot see any lowest-common-denominator solution for this.]
Both points 1. and 2. and the rest of the message applied to Emacs CVS 23.0.60, which recently changed the behaviour of `choose-completion-string'
,---- from emacs/lisp/ChangeLog | * 2008-04-29 Stefan Monnier monnier@iro.umontreal.ca +---- from emacs/lisp/simple.el | 'choose-completion-string-functions | choice buffer mini-p base-size) | ;; Insert the completion into the buffer where it was requested. |+ ;; FIXME: |+ ;; - There may not be a field at point, or there may be a field but |+ ;; it's not a "completion field", in which case we have to |+ ;; call choose-completion-delete-max-match even if base-size is set. |+ ;; - we may need to delete further than (point) to (field-end), |+ ;; depending on the completion-style, and for that we need to |+ ;; extra data `completion-extra-size'. | (if base-size |- (delete-region (+ base-size (if mini-p |- (minibuffer-prompt-end) |- (point-min))) |- (point)) |+ (delete-region (+ base-size (field-beginning)) (point)) | (choose-completion-delete-max-match choice)) | (insert choice) | (remove-text-properties (- (point) (length choice)) (point) `----
I consider this a bug in GNU Emacs which should be fixed in emacs, and not SLIME's c-p-c. Other completion packages are broken too. [I was an unnecessarily overweening :)] -- Madhu