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#9160: 24.0.50; Emacs freezes in *shell* buffer. Date: Mon, 19 Sep 2011 21:10:58 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316481129 4210 80.91.229.12 (20 Sep 2011 01:12:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Sep 2011 01:12:09 +0000 (UTC) Cc: 9160@debbugs.gnu.org To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 20 03:12:05 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 1R5osV-0000dz-Mt for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Sep 2011 03:12:04 +0200 Original-Received: from localhost ([::1]:51150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5osU-0002jN-VZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Sep 2011 21:12:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5osR-0002iL-LK for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 21:12:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5osQ-0004g8-Fc for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 21:11:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5osQ-0004g4-E4 for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 21:11:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R5oxK-00011U-6V for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2011 21:17:02 -0400 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: Tue, 20 Sep 2011 01:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9160-submit@debbugs.gnu.org id=B9160.13164813673862 (code B ref 9160); Tue, 20 Sep 2011 01:17:02 +0000 Original-Received: (at 9160) by debbugs.gnu.org; 20 Sep 2011 01:16:07 +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 1R5owQ-00010E-TV for submit@debbugs.gnu.org; Mon, 19 Sep 2011 21:16:07 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5owN-000106-Pi for 9160@debbugs.gnu.org; Mon, 19 Sep 2011 21:16:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8FAOLnd05FpZ7x/2dsb2JhbABCpV6BY3iBUwEBBAFWIwULCzQSFBgNJC6HXLYqhngEoE6ERA X-IronPort-AV: E=Sophos;i="4.68,408,1312171200"; d="scan'208";a="137197415" Original-Received: from 69-165-158-241.dsl.teksavvy.com (HELO pastel.home) ([69.165.158.241]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 19 Sep 2011 21:10:58 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8E5A059218; Mon, 19 Sep 2011 21:10:58 -0400 (EDT) In-Reply-To: (Kenichi Handa's message of "Tue, 06 Sep 2011 15:19:44 +0900") 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, 19 Sep 2011 21:17:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:51511 Archived-At: > I confirmed that that above test case is fixed now. But, I > found several other bugs related completions. All the > following testcases are with the latest trunk Emacs with -Q > argument, and they don't happen with Emacs 23.3. > (1) SPC not escaped in *Completions* buffer > % mkdir tmp > % cd tmp > % touch '0 a' '0-a' > % rm 0 > Now the the *Completions* buffer is: > <...> > Possible completions are: > 0 a > 0-a > Note that SPC is not escapsed in '0 a'. So, when I click Yes, that by design. > it, *shell* buffer becomes this: > % rm 0 a That's a known (to me) bug. Making escaping (aka quoting) interact correctly with completion styles like partial-completion and substring is actually a nasty problem. The old code used to escape the strings returned by all-completions (so the *Completions* buffer would show the escaped names), which solves some of the problematic cases, but has the following downsides: - it's aesthetically unpleasant (the *Completions* buffer does not need that kind of escaping). - it's inefficient (requires escaping all elements of all-completions). - more problematic: it doesn't actually solve the problem in all cases, because the user may have typed "a\bc" but the escaping code cannot know that the user decided to (unnecessarily) escape "b" so it won't escape "b" and we're back at the problem that the completion will fail because the output from all-completions doesn't actually match the user's input, even tho it should. We have related problems with $ escaping in find-file (they manifest in different ways because we half-solved the issues differently). I'm still not quite sure yet how to best solve those problems, but it seems that a real solution will have to handle a more general problem, e.g. cases such as "/u-$b-c" in find-file, where "$b" is an env var that expands to (say) "c/d". > (2) The second arg to rm command is not completed. > % mkdir tmp > % cd tmp > % touch abc def > % rm a > % rm abc d > Now just "No match" is shown instead of "d" completed to > "def". This DOES NOT happen with 'ls' command. I think I just fixed it with the patch below. > (3) Error in post-command-hook for *.tar.gz file. > % mkdir tmp > % cd tmp > % echo abc > abc > % echo def > def > % tar cfz temp.tar.gz abc def > % tar tfz temp > Now the command line is correctly completed to: > % tar tfz temp.tar.gz > But, this error is signaled: > Error in post-command-hook (completion-in-region--postch): > (wrong-type-argument listp [tar-header # temp.tar.gz*> abc 436 8308 8308 4 (20069 47563) 4380 nil ustar handa handa > 0 0 nil]) I cannot reproduce this error. Has it been fixed in the mean time? Stefan --- lisp/minibuffer.el 2011-09-02 00:36:58 +0000 +++ lisp/minibuffer.el 2011-09-20 01:00:12 +0000 @@ -322,14 +322,15 @@ (test-completion string table pred2)) (t (or (complete-with-action action table string - (if (null pred2) pred1 + (if (not (and pred1 pred2)) + (or pred1 pred2) (lambda (x) ;; Call `pred1' first, so that `pred2' ;; really can't tell that `x' is in table. - (if (funcall pred1 x) (funcall pred2 x))))) + (and (funcall pred1 x) (funcall pred2 x))))) ;; If completion failed and we're not applying pred1 strictly, try ;; again without pred1. - (and (not strict) + (and (not strict) pred1 pred2 (complete-with-action action table string pred2)))))) (defun completion-table-in-turn (&rest tables) @@ -1774,7 +1775,7 @@ (defun completion-file-name-table (string pred action) "Completion table for file names." - (ignore-errors + (with-demoted-errors (cond ((eq action 'metadata) '(metadata (category . file))) ((eq (car-safe action) 'boundaries)