From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Vincent_Bela=EFche?= Newsgroups: gmane.emacs.devel Subject: Re: Initialisation of dired-x for install-info =?utf-8?q?guessing?= =?utf-8?b?4oCP?= Date: Wed, 13 May 2009 07:15:37 +0200 Message-ID: <87r5yttwg6.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242191612 17900 80.91.229.12 (13 May 2009 05:13:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 May 2009 05:13:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 13 07:13:23 2009 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.50) id 1M46mO-00064p-9C for ged-emacs-devel@m.gmane.org; Wed, 13 May 2009 07:13:20 +0200 Original-Received: from localhost ([127.0.0.1]:57173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M46mN-00076m-7T for ged-emacs-devel@m.gmane.org; Wed, 13 May 2009 01:13:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M46mC-00076M-0r for emacs-devel@gnu.org; Wed, 13 May 2009 01:13:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M46m7-000758-8l for emacs-devel@gnu.org; Wed, 13 May 2009 01:13:07 -0400 Original-Received: from [199.232.76.173] (port=35143 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M46m6-000753-TD for emacs-devel@gnu.org; Wed, 13 May 2009 01:13:03 -0400 Original-Received: from smtp19.orange.fr ([80.12.242.17]:13747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M46m6-0005ii-EZ for emacs-devel@gnu.org; Wed, 13 May 2009 01:13:02 -0400 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1912.orange.fr (SMTP Server) with ESMTP id A574D20000A3 for ; Wed, 13 May 2009 07:13:00 +0200 (CEST) Original-Received: from COCOTTE (ARennes-256-1-70-113.w90-32.abo.wanadoo.fr [90.32.149.113]) by mwinf1912.orange.fr (SMTP Server) with ESMTP id 5CA9F20000A0 for ; Wed, 13 May 2009 07:13:00 +0200 (CEST) X-ME-UUID: 20090513051300379.5CA9F20000A0@mwinf1912.orange.fr X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:110845 Archived-At: Hello, I have found a way to get rid of the `for', and also to be less bash specific. This way the guess will work even for old Windows versions. I just wrote it as follows: (list "\\.info$" '(concat "install-info \"" file "\" \"" (file-name-directory file) "dir\" " (cond ((eq system-type 'windows-nt) "&& Rem ") (t "; # ")))) The trick is: 1) I get the directory in Lisp (note that I need no convert filename and directory to system dependent syntax because install-info accepts `/' as a file separator) 2) I append a tailing "&& Rem " so that the argument, say foo.info, that is appended after the command name is ignored. The full command line is then install-info some/directory/foo.info some/directory/dir && Rem some/directory/foo.info This "&& Rem " is replaced by "; # " if the system is not window. So that the fill command line will be install-info some/directory/foo.info some/directory/dir ; # some/directory/foo.info Just a remark: if the dired mode could interprete some list (where CMD is a string): (litterally CMD) As a command CMD to which the file name does not have to be appended, then there would not be any need to cheat the OS with the tailing comment (Rem or #). The guess displayed to the user would also be nicer. Vincent.