unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch to file-relative-name
@ 2003-03-30 22:12 Lars Hansen
  0 siblings, 0 replies; only message in thread
From: Lars Hansen @ 2003-03-30 22:12 UTC (permalink / raw)


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)))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-30 22:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-30 22:12 Patch to file-relative-name Lars Hansen

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).