all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* PC-completion and trailing dashes.
@ 2006-04-14 16:30 Michaël Cadilhac
  2006-05-05 23:02 ` Michaël Cadilhac
  0 siblings, 1 reply; 2+ messages in thread
From: Michaël Cadilhac @ 2006-04-14 16:30 UTC (permalink / raw)



[-- Attachment #1.1.1: Type: text/plain, Size: 328 bytes --]


  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:


[-- Attachment #1.1.2: complete.patch --]
[-- Type: text/x-patch, Size: 2715 bytes --]

Index: ChangeLog
===================================================================
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
--- ChangeLog	14 Apr 2006 16:22:47 -0000
***************
*** 1,3 ****
--- 1,11 ----
+ 2006-04-14  Michaël Cadilhac  <michael.cadilhac@lrde.org>  (tiny change)
+ 
+ 	* 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.
+ 
  2006-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
  
  	* progmodes/cc-langs.el (c-mode-menu):
Index: complete.el
===================================================================
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
--- complete.el	14 Apr 2006 16:22:47 -0000
***************
*** 1,7 ****
  ;;; complete.el --- partial completion mechanism plus other goodies
  
  ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004,
! ;;   2005 Free Software Foundation, Inc.
  
  ;; Author: Dave Gillespie <daveg@synaptics.com>
  ;; Keywords: abbrev convenience
--- 1,7 ----
  ;;; complete.el --- partial completion mechanism plus other goodies
  
  ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004,
! ;;   2005, 2006 Free Software Foundation, Inc.
  
  ;; Author: Dave Gillespie <daveg@synaptics.com>
  ;; Keywords: abbrev convenience
***************
*** 221,226 ****
--- 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 ****
--- 945,958 ----
      (funcall PC-old-read-file-name-internal string dir action)))
  \f
  
+ ;; 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)
+ 
+ \f
+ 
  (provide 'complete)
  
  ;; arch-tag: fc7e2768-ff44-4e22-b579-4d825b968458

[-- Attachment #1.1.3: Type: text/plain, Size: 635 bytes --]


  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.

-- 
 |      Michaël `Micha' Cadilhac   |   Un certain Blaise Pascal             |
 |         Epita/LRDE Promo 2007   |     etc... etc...                      |
 | http://www.lrde.org/~cadilh_m   |   -- Prévert (Les paris stupides)      |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PC-completion and trailing dashes.
  2006-04-14 16:30 PC-completion and trailing dashes Michaël Cadilhac
@ 2006-05-05 23:02 ` Michaël Cadilhac
  0 siblings, 0 replies; 2+ messages in thread
From: Michaël Cadilhac @ 2006-05-05 23:02 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]

michael.cadilhac@lrde.org (Michaël Cadilhac) writes:

>   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 same bug occurs without partial-completion and with the following:

    M-x emacs- C-b <TAB> <TAB> and click on, for example,
    emacs-lisp-mode.

    Sorry, I've no time to make a patch, but it think the previous one
    and this one should be factorized.

    Regards.

-- 
 |      Michaël `Micha' Cadilhac   |   All your base are belong to us.      |
 |         Epita/LRDE Promo 2007   |     You have no change to survive      |
 | http://www.lrde.org/~cadilh_m   |        make your time.                 |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-05 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-14 16:30 PC-completion and trailing dashes Michaël Cadilhac
2006-05-05 23:02 ` Michaël Cadilhac

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.