From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: kill-ring visualization Date: Tue, 30 Mar 2010 16:35:01 -0400 Message-ID: References: <87y6hib6vi.fsf@mail.jurta.org> <87aatwv12t.fsf@mail.jurta.org> <87aatvogu3.fsf@mail.jurta.org> <87hbo2jmux.fsf@mail.jurta.org> <878w9akv49.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269981318 27886 80.91.229.12 (30 Mar 2010 20:35:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 20:35:18 +0000 (UTC) Cc: Emacs development discussions To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 30 22:35:14 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwi9Y-0005Km-QW for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 22:35:13 +0200 Original-Received: from localhost ([127.0.0.1]:46855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwi9X-0000YU-RU for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 16:35:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nwi9T-0000YL-PE for emacs-devel@gnu.org; Tue, 30 Mar 2010 16:35:07 -0400 Original-Received: from [140.186.70.92] (port=42639 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwi9S-0000YC-77 for emacs-devel@gnu.org; Tue, 30 Mar 2010 16:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nwi9Q-0005DM-QS for emacs-devel@gnu.org; Tue, 30 Mar 2010 16:35:06 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:47395) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwi9P-0005D5-9l for emacs-devel@gnu.org; Tue, 30 Mar 2010 16:35:04 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o2UKZ16R006356; Tue, 30 Mar 2010 16:35:01 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 4C5683A0F4; Tue, 30 Mar 2010 16:35:01 -0400 (EDT) In-Reply-To: <878w9akv49.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 30 Mar 2010 19:07:59 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3502=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:122935 Archived-At: >>>>> + ((eq completions-format 'line) >>>>> + ;; One-line format >>>>> + (setq str (query-replace-descr str))) >>>> But this will not just change the string displayed, but also the string >>>> inserted by the yank. We need to distinguish the two. >>> Maybe to put the `display' property with the value "^J" on newlines? >> That would only work if this property is removed when the string in >> subsequently inserted. > In the patch I sent earlier, yank-pop doesn't insert the string selected > from the *Completions* buffer. It searches for selected completion string > in the kill-ring (using `member' that ignores the `display' property), > gets its position in the kill-ring, and calls `yank' with this position > as a numeric index. Yes, I noticed it, and the problem is that my yank happens to be advised and that breaks it (because the advice occasionally adds elements to the kill-ring). So, while I also started with such an approach, I ended up going the more straightforward route of inserting the actual selected text, since it's more reliable. Stefan