From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: find certain files Date: Tue, 12 Jun 2007 15:51:15 -0700 Message-ID: References: <136u2klbdc2ssd0@corp.supernews.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1181688770 1059 80.91.229.12 (12 Jun 2007 22:52:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2007 22:52:50 +0000 (UTC) To: "Mark Elston" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 13 00:52:47 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HyFEE-00039S-2y for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jun 2007 00:52:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyFED-0004Wv-Og for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jun 2007 18:52:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyFDv-0004Sq-QM for help-gnu-emacs@gnu.org; Tue, 12 Jun 2007 18:52:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyFDt-0004Ly-Em for help-gnu-emacs@gnu.org; Tue, 12 Jun 2007 18:52:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyFDt-0004Lf-Bw for help-gnu-emacs@gnu.org; Tue, 12 Jun 2007 18:52:25 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HyFDs-0004d9-Lw for help-gnu-emacs@gnu.org; Tue, 12 Jun 2007 18:52:25 -0400 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l5CMq76T012897; Tue, 12 Jun 2007 16:52:08 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l5CG3Fi2002569; Tue, 12 Jun 2007 16:52:07 -0600 Original-Received: from dhcp-amer-rmdc-csvpn-gw4-141-144-96-53.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 2891778791181688680; Tue, 12 Jun 2007 15:51:20 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <136u2klbdc2ssd0@corp.supernews.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-MIME-Autoconverted: from 8bit to quoted-printable by rgminet01.oracle.com id l5CMq76T012897 X-detected-kernel: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44984 Archived-At: > > Use Icicles apropos completion: > > > > C-x C-f \.sas$ S-TAB, if the current directory is /projects/a, or > > C-x C-f /projects/a/.*\.sas$ S-TAB, otherwise. > > I tried this (I have icicles installed) and got the following traceback= : > > Debugger entered--Lisp error: (error "Bad format environment-variable > substitution") > read-file-name-internal(".*\\.el$" "~/site-lisp-22/" t) > all-completions(".*\\.el$" read-file-name-internal > "~/site-lisp-22/" nil) > icicle-unsorted-file-name-prefix-candidates(".*\\.el$") > icicle-file-name-prefix-candidates("~/site-lisp-22/.*\\.el$") > icicle-prefix-complete-1() > icicle-prefix-complete() > icicle-call-then-update-Completions(self-insert-command 1) > icicle-self-insert(1) > call-interactively(icicle-self-insert) > old-read-file-name(#("+ File or directory: " 0 1 nil 1 2 (face > icicle-completing-prompt-prefix) 2 3 nil 3 22 (face minibuffer-prompt)) > nil "~/" nil nil nil) > byte-code(<...> [icicle-prompt dir default-filename require-match > initial-input predicate old-read-file-name] 7)] 2) > read-file-name("File or directory: " nil "~/" nil nil nil) > byte-code(<...> [emacs-major-version major-mode default-directory > icicle-find-file-w-wildcards 21 read-file-name "File or directory: " ni= l > dired-mode fboundp diredp-find-a-file (byte-code <...> > [abbreviate-file-name dired-get-file-for-visit] 2) ((error > default-directory))] 8) > icicle-find-file() > call-interactively(icicle-find-file) > > This was while trying to open a number of files in a subdirectory. > I did C-x C-f /site-lisp-22/.*\.el$ > and, before I got the chance to try the S-tab I got the above traceback. > > It seems to work OK with files in the current directory, though. > > This is NT Emacs 22.0.50.1 with icicles Version 22. Hi Mark, The backtrace suggests that you did something like this: C-x C-f /site-lisp-22/.*\.el$ TAB 1 Try that, and you will get exactly the same error message. The backtrace suggests that you hit TAB, which is for prefix completion, = not apropos (aka regexp) completion, and then you hit `1' as a response to th= e file-name prompt. I can tell this from the call to `icicle-prefix-complet= e', not `icicle-apropos-complete', and the call to `icicle-self-insert' for t= he character `1' as your response to the prompt from `read-file-name'. It is not Icicles command `icicle-find-file' (`C-x C-f') that is complain= ing here; it is vanilla Emacs `find-file' (called `old-find-file' in the trac= e). It complains because it was passed the raw input pattern that you typed, = and it tries to interpret the `$' in that input as part of an environment variable name (as in, e.g., `$HOME'). TAB in Icicles is the same as it is in vanilla Emacs: it performs only prefix completion, not regexp completion. It simply passes your input to vanilla Emacs `find-file'. For Icicles to interpret your input as a regul= ar expression to match a file name, you must use S-TAB, not TAB. If you feel I'm wrong that you used TAB here, then let's take this off li= st to discuss the problem in more detail. You might also want to take a look at this page, which explains the interaction between file-name globbing and Icicles regexp matching: http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Special_Characters_in_Inp= ut_ Patterns. The main lesson on that page is that file-name globbing (*, ?, $, ., ..) = and completion are independent. This is true in both vanilla Emacs and in Icicles. For example, in vanilla Emacs, if you use `ici*=92 or `ici*.el=92= as input to =91find-file=92 and hit =91TAB=92, there is no completion availa= ble. In Icicles you can use regexp matching for completion, and you can use file-name globbing for the final input you choose. Even though they are completely different syntaxes that interpret some of the same special characters differently, you can combine the two in Icicl= es, within some limits. For example, `$' is not a problem, because Icicles figures out what you want. But if you want to use `*' for file-name globbing, then you need to forego regexp matching, and vice versa. So, for example, `C-x C-f *.el RET' and `C-x C-f .*\.el$ S-TAB' both work= , but they do entirely different things. The former opens all Emacs-Lisp files; the latter proposes those files as completion candidates. And in Icicles, as in vanilla Emacs, `C-x C-f *.el TAB' will not work - you get = the message "No prefix completion", because completion does not do file-name globbing. Let me know if I'm mistaken about the problem you reported. Thanks for trying Icicles and for providing this feedback - I'm sure it will help others too. - Drew