There is one problem in using pcomplete with partial-completion-mode
enabled.  partial-completion-mode forces pcomplete to move point to the
end of the original buffer (non-minibuffer).

Test case:

M-x partial-completion-mode RET

;;; Fill buffer with some text and set point to the beginning.
M-: (progn (insert "abc\ndef\n") (goto-char (point-min)))

M-x pcomplete RET

;;; Select a file name completion from the *Completions* buffer.
C-x o C-n C-n C-n C-n C-n ... RET

;;; Observe how a selected file name is inserted to the end of the
;;; original buffer, not to the beginning where point initially was.

A small patch below fixes this bug.  I could install it, if it is right
also for other cases where the affected code was intended for.  (IIUC from
the comment above this code in complete.el, it was intended for the
minibuffer usage).

Index: lisp/complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.53
diff -c -r1.53 complete.el
*** lisp/complete.el    22 May 2006 18:09:40 -0000      1.53
--- lisp/complete.el    13 Jun 2006 12:27:35 -0000
***************
*** 234,240 ****
    (funcall
     (if partial-completion-mode 'add-hook 'remove-hook)
     'choose-completion-string-functions
!    (lambda (&rest x) (goto-char (point-max)) nil))
    ;; Build the env-completion and mapping table.
    (when (and partial-completion-mode (null PC-env-vars-alist))
      (setq PC-env-vars-alist
--- 234,242 ----
    (funcall
     (if partial-completion-mode 'add-hook 'remove-hook)
     'choose-completion-string-functions
!    (lambda (choice buffer mini-p base-size)
!      (if mini-p (goto-char (point-max)))
!      nil))
    ;; Build the env-completion and mapping table.
    (when (and partial-completion-mode (null PC-env-vars-alist))
      (setq PC-env-vars-alist

-- 
Juri Linkov
http://www.jurta.org/emacs/



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to