all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uday S Reddy <uDOTsDOTreddy@cs.bham.ac.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: viewing MS powerpoint files from dired
Date: Thu, 15 Jul 2010 09:00:22 +0100	[thread overview]
Message-ID: <i1mf68$97u$1@north.jnrs.ja.net> (raw)
In-Reply-To: <b51cb54f-abc6-4870-8d81-1b6bff01e8ba@u26g2000yqu.googlegroups.com>

On 7/13/2010 5:50 PM, Mirko wrote:

> How can I teach dired to launch powerpoint on files with extension ppt
> (that is on MS Windows)?
>
> (Writing some elisp is OK).

Here are some functions I use for Windows support in dired.  They work using 
the "object-oriented" Windows operations, the same way as the 
right-mouse-button context menu.  Windows takes care of figuring out the 
application for opening the file.  So, powerpoint or not, it makes no difference.

The open function almost always works.  The others often don't.

Perhaps I should put these in Emacswiki too.  Enjoy!

Cheers,
Uday

(defun dired-w32-shell-open ()
   "Open file in Win32."
   (interactive)
   (let ((file (w32-convert-filename (dired-get-filename))))
     (w32-shell-execute "open" file)
     ))

(defun w32-convert-filename (filename)
   "Convert FILENAME to Win32 format."
   (while (string-match "/" filename)
     (setq filename (replace-match "\\" nil t filename)))
   filename)

(defun dired-w32-shell-print ()
   "Print file in Win32."
   (interactive)
   (let ((file (w32-convert-filename (dired-get-filename))))
     (w32-shell-execute "print" file)
     ))

(defun dired-w32-shell-properties ()
   "Show properties of the file."
   (interactive)
   (let ((file (w32-convert-filename (dired-get-filename))))
     (w32-shell-execute "properties" file)
     ))

(defun dired-w32-shell-execute (operation)
   "Execute the given operation in Win32."
   (interactive "M")
   (let ((file (w32-convert-filename (dired-get-filename))))
     (w32-shell-execute operation file)
     ))


  parent reply	other threads:[~2010-07-15  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 16:50 viewing MS powerpoint files from dired Mirko
2010-07-14  8:36 ` Jean Magnan de Bornier
2010-07-14 14:08   ` Mirko
2010-07-15  8:00 ` Uday S Reddy [this message]
2010-07-18  8:29   ` Tim X

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

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

  git send-email \
    --in-reply-to='i1mf68$97u$1@north.jnrs.ja.net' \
    --to=udotsdotreddy@cs.bham.ac.uk \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.