From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [michael.cadilhac@lrde.org: PC-completion and trailing dashes.] Date: Sat, 15 Apr 2006 13:32:30 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1145122479 12471 80.91.229.2 (15 Apr 2006 17:34:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Apr 2006 17:34:39 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 15 19:34:34 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FUofJ-0008I8-5f for ged-emacs-devel@m.gmane.org; Sat, 15 Apr 2006 19:34:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUofH-0004eB-Ua for ged-emacs-devel@m.gmane.org; Sat, 15 Apr 2006 13:34:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FUodO-0002oa-25 for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:32:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FUodL-0002mY-PX for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:32:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUodL-0002mB-7a for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:32:31 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FUoda-00041c-GO for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:32:46 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1FUodK-0001p6-89; Sat, 15 Apr 2006 13:32:30 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52898 Archived-At: Would someone else who knows and uses partial-completion-mode please take a look and see if this is a good fix? ------- Start of forwarded message ------- From: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) To: emacs-devel@gnu.org Organization: Epita/LRDE Date: Fri, 14 Apr 2006 18:30:49 +0200 MIME-Version: 1.0 Subject: PC-completion and trailing dashes. Content-Type: multipart/mixed; boundary="===============0652986555==" X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 - --===============0652986555== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" - --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" - --=-=-= Here's the problem: emacs -Q M-x partial-completion-mode RET M-x set- RET then click a choice, you'll have the error message `Symbol function definition is void: set-yourchoice-' M-x set-s- RET then select one and your choice will be suffixed with `-s-'. The smallest change I can propose is the following: - --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=complete.patch Content-Transfer-Encoding: quoted-printable Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.9401 diff -b -c -w -r1.9401 ChangeLog *** ChangeLog 14 Apr 2006 11:30:20 -0000 1.9401 =2D-- ChangeLog 14 Apr 2006 16:22:47 -0000 *************** *** 1,3 **** =2D-- 1,11 ---- + 2006-04-14 Micha=EBl Cadilhac (tiny change) +=20 + * complete.el (PC-goto-eob-and-ret-nil): Function to go to the + end of buffer and that returns `nil'. + (partial-completion-mode): Use it as a function of + `choose-completion-string-functions' to be sure that the whole + buffer will be erased before choice insertion. +=20 2006-04-14 Stefan Monnier =20=20 * progmodes/cc-langs.el (c-mode-menu): Index: complete.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/complete.el,v retrieving revision 1.45 diff -b -c -w -r1.45 complete.el *** complete.el 6 Aug 2005 22:13:42 -0000 1.45 =2D-- complete.el 14 Apr 2006 16:22:47 -0000 *************** *** 1,7 **** ;;; complete.el --- partial completion mechanism plus other goodies =20=20 ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004, ! ;; 2005 Free Software Foundation, Inc. =20=20 ;; Author: Dave Gillespie ;; Keywords: abbrev convenience =2D-- 1,7 ---- ;;; complete.el --- partial completion mechanism plus other goodies =20=20 ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004, ! ;; 2005, 2006 Free Software Foundation, Inc. =20=20 ;; Author: Dave Gillespie ;; Keywords: abbrev convenience *************** *** 221,226 **** =2D-- 221,230 ---- (symbol-function 'read-file-name-internal)) (fset 'read-file-name-internal 'PC-read-include-file-name-internal))) + ;; Fix for completion-list selections. + (if partial-completion-mode + (add-hook 'choose-completion-string-functions 'PC-goto-eob-and-ret-= nil) + (remove-hook 'choose-completion-string-functions 'PC-goto-eob-and-ret= - -nil)) (when (and partial-completion-mode (null PC-env-vars-alist)) (setq PC-env-vars-alist (mapcar (lambda (string) *************** *** 941,946 **** =2D-- 945,958 ---- (funcall PC-old-read-file-name-internal string dir action))) =20=20 + ;; Hack to be sure that on validation in the completion list, everything + ;; will be erased before the choice is inserted. + (defun PC-goto-eob-and-ret-nil (&rest args) + (goto-char (point-max)) + nil) +=20 + +=20 (provide 'complete) =20=20 ;; arch-tag: fc7e2768-ff44-4e22-b579-4d825b968458 - --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable The aim is that `choose-completion-string' will `delete-region' everything from (+ base-size (point-min)) to (point-max). The added function could also directly erase the region, I don't know what's the best here. I don't even know if this way is ok ;-) Thanks in advance, however. =2D-=20 | Micha=EBl `Micha' Cadilhac | Un certain Blaise Pascal = | | Epita/LRDE Promo 2007 | etc... etc... = | | http://www.lrde.org/~cadilh_m | -- Pr=E9vert (Les paris stupides) = | `-- - JID: micha@amessage.be --' - -= - -' - --=-=-=-- - --==-=-= Content-Type: application/pgp-signature - -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEP848ZYNf4qobZ7kRApI1AJ4letQEzZcuQM8/SxK74BM3ozL2vACcDMdl MtyCqsftA3bRl5YL7NgM9nQ= =wUgR - -----END PGP SIGNATURE----- - --==-=-=-- - --===============0652986555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel - --===============0652986555==-- ------- End of forwarded message -------