all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [bojohan+mail@dd.chalmers.se: Partial completion]
Date: Sat, 24 Feb 2007 20:52:59 +0100	[thread overview]
Message-ID: <45E0979B.2020006@gmx.at> (raw)
In-Reply-To: <17888.10288.446902.230637@kahikatea.snap.net.nz>

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Please try the attached patch instead.  It's simpler and should take
care of the remaining problems.

[-- Attachment #2: complete.diff --]
[-- Type: text/plain, Size: 3285 bytes --]

*** complete.el	Tue Jan 23 07:40:00 2007
--- complete.el	Sat Feb 24 20:46:14 2007
***************
*** 383,388 ****
--- 383,393 ----
      (let ((completion-ignore-case nil))
        (test-completion str table pred))))

+ (defun try-completion-old (string alist &optional predicate)
+   "Like `try-completion' but return empty string instead of t."
+   (let ((result (try-completion string alist predicate)))
+     (if (eq result t) "" result)))
+ 
  (defun PC-do-completion (&optional mode beg end)
    (or beg (setq beg (minibuffer-prompt-end)))
    (or end (setq end (point-max)))
***************
*** 390,396 ****
  	 (pred minibuffer-completion-predicate)
  	 (filename (funcall PC-completion-as-file-name-predicate))
  	 (dirname nil)		; non-nil only if a filename is being completed
! 	 (dirlength 0)
  	 (str (buffer-substring beg end))
  	 (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str)))
  	 (ambig nil)
--- 395,401 ----
  	 (pred minibuffer-completion-predicate)
  	 (filename (funcall PC-completion-as-file-name-predicate))
  	 (dirname nil)		; non-nil only if a filename is being completed
! 	 dirlength
  	 (str (buffer-substring beg end))
  	 (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str)))
  	 (ambig nil)
***************
*** 623,630 ****

  	    ;; Check if next few letters are the same in all cases
  	    (if (and (not (eq mode 'help))
! 		     (setq prefix (try-completion (PC-chunk-after basestr skip)
!                                                   poss)))
  		(let ((first t) i)
  		  ;; Retain capitalization of user input even if
  		  ;; completion-ignore-case is set.
--- 628,635 ----

  	    ;; Check if next few letters are the same in all cases
  	    (if (and (not (eq mode 'help))
! 		     (setq prefix (try-completion-old
! 				   (PC-chunk-after basestr skip) poss)))
  		(let ((first t) i)
  		  ;; Retain capitalization of user input even if
  		  ;; completion-ignore-case is set.
***************
*** 662,668 ****
  			      (setq skip (concat skip
  						 (regexp-quote prefix)
  						 PC-ndelims-regex)
! 				    prefix (try-completion
  					    (PC-chunk-after
  					     ;; not basestr, because that does
  					     ;; not reflect insertions
--- 667,673 ----
  			      (setq skip (concat skip
  						 (regexp-quote prefix)
  						 PC-ndelims-regex)
! 				    prefix (try-completion-old
  					    (PC-chunk-after
  					     ;; not basestr, because that does
  					     ;; not reflect insertions
***************
*** 996,1002 ****
                (cond
                 ((not completion-table) nil)
                 ((eq action 'lambda) (test-completion str2 completion-table nil))
!                ((eq action nil) (try-completion str2 completion-table nil))
                 ((eq action t) (all-completions str2 completion-table nil)))))
      ad-do-it))
  \f
--- 1001,1007 ----
                (cond
                 ((not completion-table) nil)
                 ((eq action 'lambda) (test-completion str2 completion-table nil))
!                ((eq action nil) (try-completion-old str2 completion-table nil))
                 ((eq action t) (all-completions str2 completion-table nil)))))
      ad-do-it))
  \f

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

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

  parent reply	other threads:[~2007-02-24 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-24  8:28 [bojohan+mail@dd.chalmers.se: Partial completion] Richard Stallman
2007-02-24 11:57 ` Nick Roberts
2007-02-24 13:46   ` martin rudalics
2007-02-24 19:52   ` martin rudalics [this message]
2007-02-25  4:24     ` Nick Roberts
2007-02-25  9:31       ` martin rudalics
2007-02-25 19:30       ` Richard Stallman
2007-02-26 20:28         ` Nick Roberts
2007-03-02  1:24     ` Johan Bockgård
2007-03-08 20:44     ` Chong Yidong
2007-03-08 22:34       ` martin rudalics
2007-03-08 23:01         ` Chong Yidong
2007-03-09 16:20       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45E0979B.2020006@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=nickrob@snap.net.nz \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.