unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: emacs-devel@gnu.org
Subject: Re: Initialisation of dired-x for install-info guessing‏
Date: Wed, 13 May 2009 07:15:37 +0200	[thread overview]
Message-ID: <87r5yttwg6.fsf@gmail.com> (raw)

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.





             reply	other threads:[~2009-05-13  5:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  5:15 Vincent Belaïche [this message]
2009-05-13 17:55 ` Initialisation of dired-x for install-info guessing‏ Eli Zaretskii
2009-05-13 21:09   ` Vincent Belaïche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5yttwg6.fsf@gmail.com \
    --to=vincent.b.1@hotmail.fr \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).