all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-pretest-bug@gnu.org, 1797@emacsbugs.donarmstrong.com
Subject: bug#1797: 23.0.60; completing-read breaks backwards compatibility
Date: Tue, 6 Jan 2009 10:34:52 +0100	[thread overview]
Message-ID: <18787.9660.526503.139106@a1ihome1.kph.uni-mainz.de> (raw)
In-Reply-To: <jwvfxjxgjm0.fsf-monnier+emacsbugreports@gnu.org>

>>>>> On Mon, 05 Jan 2009, Stefan Monnier wrote:

> Thanks.  I installed a change which I believe should fix this bug.

I confirm that today's CVS trunk is working as expected.

> Note that your completion function is a prime example of a completion
> table that needs completion-boundaries in order to work right.

>                     ((eq (car-safe mode) 'boundaries)
>                      (lexical-let* ((suffix (cdr mode))
>                                     (start (or (match-end 1) 0))
>                                     (end (string-match "\\s-" suffix)))
>                        (lambda (s table pred)
>                          `(boundaries ,start . ,end))))

Hey, I had already come to a very similar solution: ;-)

 (defun my-complete (s pred mode)
   (string-match "^\\(.*\\s-\\)?\\(.*\\)$" s)
+  (if (eq (car-safe mode) 'boundaries) ; GNU Emacs 23
+      (cons 'boundaries
+            (cons (match-beginning 2)
+                  (string-match "\\s-" (cdr mode))))
   (let* ((s1 (match-string 1 s))
          (s2 (match-string 2 s))

It cost me quite some time to get this right, because of the missing
documentation.

Ulrich






      reply	other threads:[~2009-01-06  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 23:53 bug#1797: 23.0.60; completing-read breaks backwards compatibility Ulrich Mueller
2009-01-06  4:24 ` Stefan Monnier
2009-01-06  9:34   ` Ulrich Mueller [this message]

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=18787.9660.526503.139106@a1ihome1.kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=1797@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.