From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12861: wrong default value when completing in woman-file-name Date: Sun, 11 Nov 2012 10:54:53 -0500 Message-ID: References: <87d2zkfc0n.fsf@bernoul.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352649353 12701 80.91.229.3 (11 Nov 2012 15:55:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2012 15:55:53 +0000 (UTC) Cc: 12861@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 11 16:56:03 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXZtB-0003wp-Lw for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Nov 2012 16:56:01 +0100 Original-Received: from localhost ([::1]:50287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXZt2-0007X9-9a for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Nov 2012 10:55:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXZsx-0007WF-3e for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 10:55:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXZst-0005qY-Qf for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 10:55:47 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXZst-0005qL-MY for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 10:55:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXZtC-0003Gl-A2 for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 10:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Nov 2012 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12861 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12861-submit@debbugs.gnu.org id=B12861.135264931412514 (code B ref 12861); Sun, 11 Nov 2012 15:56:02 +0000 Original-Received: (at 12861) by debbugs.gnu.org; 11 Nov 2012 15:55:14 +0000 Original-Received: from localhost ([127.0.0.1]:33319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXZsQ-0003Fn-DE for submit@debbugs.gnu.org; Sun, 11 Nov 2012 10:55:14 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:23450) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXZsP-0003Fh-7R for 12861@debbugs.gnu.org; Sun, 11 Nov 2012 10:55:13 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09sr+ZY/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA4hCmnGBWIMH X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="206927770" Original-Received: from 108-175-230-88.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.175.230.88]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Nov 2012 10:54:53 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 44556AE224; Sun, 11 Nov 2012 10:54:53 -0500 (EST) In-Reply-To: <87d2zkfc0n.fsf@bernoul.li> (Jonas Bernoulli's message of "Sun, 11 Nov 2012 15:30:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 0.8 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:66761 Archived-At: > Could you please change this so that the key sequence actually used to > invoke `minibuffer-complete' is unread instead of TAB (or just call > `minibuffer-complete' explicitly?). Unreading events is nasty business. Sometimes it's hard to avoid, but I don't think it's justified here, indeed. The patch below should fix your problem, but could you confirm it provides the intended completion behavior? Stefan === modified file 'lisp/woman.el' --- lisp/woman.el 2012-10-29 10:30:11 +0000 +++ lisp/woman.el 2012-11-11 15:54:23 +0000 @@ -1303,12 +1303,11 @@ ((null (cdr files)) (car (car files))) ; only 1 file for topic. (t ;; Multiple files for topic, so must select 1. - ;; Unread the command event (TAB = ?\t = 9) that runs the command - ;; `minibuffer-complete' in order to automatically complete the - ;; minibuffer contents as far as possible. - (setq unread-command-events '(9)) ; and delete any type-ahead! + ;; Run the command `minibuffer-complete' in order to automatically + ;; complete the minibuffer contents as far as possible. + (minibuffer-with-setup-hook #'minibuffer-complete (completing-read "Manual file: " files nil 1 - (try-completion "" files) 'woman-file-history)))))) + (try-completion "" files) 'woman-file-history))))))) (defun woman-select (predicate list) "Select unique elements for which PREDICATE is true in LIST.