From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#8897: `completion--insert-strings' clobbers user-added text properties Date: Mon, 20 Jun 2011 10:07:41 +0200 Message-ID: <87y60x9b8y.fsf@gmail.com> References: <8739j5bs01.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1308557589 18729 80.91.229.12 (20 Jun 2011 08:13:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2011 08:13:09 +0000 (UTC) Cc: 8897@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 20 10:13:04 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QYZbT-0006We-Ew for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jun 2011 10:13:03 +0200 Original-Received: from localhost ([::1]:52681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZbS-0008AF-8m for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jun 2011 04:13:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZaX-000827-5j for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2011 04:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYZaV-00068H-7d for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2011 04:12:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYZaU-000689-W4 for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2011 04:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QYZaU-0005yS-8W; Mon, 20 Jun 2011 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jun 2011 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8897 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8897-submit@debbugs.gnu.org id=B8897.130855751722953 (code B ref 8897); Mon, 20 Jun 2011 08:12:02 +0000 Original-Received: (at 8897) by debbugs.gnu.org; 20 Jun 2011 08:11:57 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QYZaO-0005yA-PP for submit@debbugs.gnu.org; Mon, 20 Jun 2011 04:11:57 -0400 Original-Received: from mail-fx0-f44.google.com ([209.85.161.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QYZaN-0005xw-Bc for 8897@debbugs.gnu.org; Mon, 20 Jun 2011 04:11:56 -0400 Original-Received: by fxm15 with SMTP id 15so1001913fxm.3 for <8897@debbugs.gnu.org>; Mon, 20 Jun 2011 01:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type :content-transfer-encoding; bh=PX8+uNJWTlNW8mFP7iKmem2oj3iwc7uEeyV5nZQig/s=; b=etAwLlBphN3YCIS5dyQcuLefQWY0jHkIqn2umVwQjWlWnTRgz+MF4Oa/D0EGXzzeim s1QYK3aPX+U90iLJqut2bT8pyNXXqKSYuY5iDxq7AXts8BjeYWtI95AU3xUWj1jXMjhu AGfE5/OxfIBcjkYyGYELxKtTkRLVGlpQR4IJQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; b=rbeWV1akSIYPVdRNzVSOHjuM/DdN4j1R3AK0k7gncURaa4Eu4Vlro3Gun3oSw7INjC 7i83FC7Y1qg71tgPMLUBad/xU9jiZ7hb6q0znMVn3HI530uoysIJeq+ZUZ9vjL78I6Sj TCzXOpoGlqgeVFBqpyFCCDRVsHEMHM+G90XrM= Original-Received: by 10.223.16.136 with SMTP id o8mr4780247faa.21.1308557509286; Mon, 20 Jun 2011 01:11:49 -0700 (PDT) Original-Received: from localhost (176.119.broadband10.iol.cz [90.177.119.176]) by mx.google.com with ESMTPS id m5sm2045399fai.25.2011.06.20.01.11.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2011 01:11:47 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 19 Jun 2011 23:08:55 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 20 Jun 2011 04:12:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47342 Archived-At: Stefan Monnier writes: >> In my particular case I define annotations as buttons (which display >> even more detail about a completion value upon activation), so a visual >> indication of clickability is very important for me. > > Currently, the completion-list-mode uses the `mouse-face' text-property > to determine what is a completion item and what i something else (blank > space, annotation, you name it). So as it stands, any mouse-face you'd > add to an annotation would confuse completion-list-mode into thinking it > is a completion item. > > Maybe you could try to use the `category' text-property instead. Well I do use the `category' property, but the button functions seem to set up the button face automatically, which is then clobbered by `completion--insert-strings' (which is the problem). Here's how I set up an annotation, `n' being the number of a pull request as a string (i.e., the completion value itself): #+begin_src elisp (let ((req (assoc-default n minibuffer-completion-table))) (concat " " (propertize (plist-get req :title) 'fontified t 'button '(t) 'category 'default-button 'help-echo "RET or mouse-2 for details" 'pr-data req 'action (lambda (b) (magithub-pull-request-details (button-get b 'pr-data)))))) #+end_src With my patch I haven't noticed any problems you mention -- clicking or RET on the completion itself selects it, clicking or RET on the annotation displays further details, the button face is preserved. =C5=A0t=C4=9Bp=C3=A1n