emacs-devel
[Top][All Lists]
Advanced

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

Patch to file-relative-name


From: Lars Hansen
Subject: Patch to file-relative-name
Date: Mon, 31 Mar 2003 00:12:08 +0200
User-agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3) Gecko/20030312

After the separate-trees parameter has been removed from my version of
file-relative-name, there is a superfluous "and". This is removed in the
patch below. Furthermore, the docstring is made a little more precise.

D:\cvs\emacs\lisp>diff -c files.el new-files.el
diff -c files.el new-files.el
*** files.el    Sun Mar 30 23:58:18 2003
--- new-files.el    Mon Mar 31 00:00:56 2003
***************
*** 2826,2832 ****
 This function returns a relative file name which is equivalent to FILENAME
 when used with that default directory as the default.
 If FILENAME and DIRECTORY lie on different machines or on different drives
! \(DOS/Windows), it returns FILENAME in expanded form."
   (save-match-data
     (setq directory
       (file-name-as-directory (expand-file-name (or directory
--- 2826,2832 ----
 This function returns a relative file name which is equivalent to FILENAME
 when used with that default directory as the default.
 If FILENAME and DIRECTORY lie on different machines or on different drives
! on a DOS/Windows machine, it returns FILENAME on expanded form."
   (save-match-data
     (setq directory
       (file-name-as-directory (expand-file-name (or directory
***************
*** 2836,2843 ****
           (hd (find-file-name-handler directory 'file-local-copy)))
       (when (and hf (not (get hf 'file-remote-p))) (setq hf nil))
       (when (and hd (not (get hd 'file-remote-p))) (setq hd nil))
!       (if (and
!        ;; Conditions for separate trees
        (or
             ;; Test for different drives on DOS/Windows
             (and
--- 2836,2842 ----
           (hd (find-file-name-handler directory 'file-local-copy)))
       (when (and hf (not (get hf 'file-remote-p))) (setq hf nil))
       (when (and hd (not (get hd 'file-remote-p))) (setq hd nil))
!       (if  ;; Conditions for separate trees
        (or
             ;; Test for different drives on DOS/Windows
             (and
***************
*** 2857,2863 ****
           (substring filename 0 (match-end 0)))
          (and
           (string-match re directory)
!           (substring directory 0 (match-end 0)))))))))
       filename
         (unless (eq (aref filename 0) ?/)
       (setq filename (concat "/" filename)))
--- 2856,2862 ----
           (substring filename 0 (match-end 0)))
          (and
           (string-match re directory)
!           (substring directory 0 (match-end 0))))))))
       filename
         (unless (eq (aref filename 0) ?/)
       (setq filename (concat "/" filename)))






reply via email to

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