[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-orgmode] Re: Attention XEmacs users

From: Michael Olson
Subject: [Emacs-orgmode] Re: Attention XEmacs users
Date: Tue, 20 Jun 2006 20:15:22 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Carsten Dominik <address@hidden> writes:

> I just found file-remote-p, which may be the right solution.

XEmacs and Emacs22 both have this function, but in case you need
backwards compatibility with Emacs21, feel free to use something like
the following.  This handles both Tramp and ange-ftp file specifiers.

(defun org-file-remote-p (file)
  "Test whether FILE specifies a location on a remote system.
Return non-nil if the location is indeed remote.

For example, the filename \"/address@hidden:/foo\" specifies a location
on the system \"/address@hidden:\"."
  (cond ((fboundp 'file-remote-p)
         (file-remote-p file))
        ((fboundp 'tramp-handle-file-remote-p)
         (tramp-handle-file-remote-p file))
        ((and (boundp 'ange-ftp-name-format)
              (string-match ange-ftp-name-format file))
        (t nil)))

Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: Emacs Lisp, text markup, protocols -- Jabber: mwolson_at_hcoop.net
  /` |\ | | | IRC: mwolson on freenode.net: #hcoop, #muse, #PurdueLUG
 |_] | \| |_| Project involvement: Emacs, Muse, Planner, ERC, EMMS

Attachment: pgpVpQsr3kiXl.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]