comparison lisp/files.el @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 501cfd01ee6d
children 697ef44129c6
comparison
equal deleted inserted replaced
409:301b9ebbdf3b 410:de805c49cfc1
1204 ;; Windows syntax. 1204 ;; Windows syntax.
1205 ("[/\\][._].*emacs\\'" . emacs-lisp-mode) 1205 ("[/\\][._].*emacs\\'" . emacs-lisp-mode)
1206 ("\\.m4\\'" . autoconf-mode) 1206 ("\\.m4\\'" . autoconf-mode)
1207 ("configure\\.in\\'" . autoconf-mode) 1207 ("configure\\.in\\'" . autoconf-mode)
1208 ("\\.ml\\'" . lisp-mode) 1208 ("\\.ml\\'" . lisp-mode)
1209 ("\\.ma?k\\'" . makefile-mode) 1209 ("\\.ma?ke?\\'" . makefile-mode)
1210 ("[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode) 1210 ("[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode)
1211 ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode) 1211 ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode)
1212 ;; #### The following three are Unix-specific (but do we care?) 1212 ;; #### The following three are Unix-specific (but do we care?)
1213 ("/app-defaults/" . xrdb-mode) 1213 ("/app-defaults/" . xrdb-mode)
1214 ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode) 1214 ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode)
2081 2081
2082 (defun file-relative-name (filename &optional directory) 2082 (defun file-relative-name (filename &optional directory)
2083 "Convert FILENAME to be relative to DIRECTORY (default: default-directory). 2083 "Convert FILENAME to be relative to DIRECTORY (default: default-directory).
2084 This function returns a relative file name which is equivalent to FILENAME 2084 This function returns a relative file name which is equivalent to FILENAME
2085 when used with that default directory as the default. 2085 when used with that default directory as the default.
2086 If this is impossible (which can happen on MSDOS and Windows 2086 If this is impossible (which can happen on MS Windows when the file name
2087 when the file name and directory use different drive names) 2087 and directory use different drive names) then it returns FILENAME."
2088 then it returns FILENAME."
2089 (save-match-data 2088 (save-match-data
2090 (let ((fname (expand-file-name filename))) 2089 (let ((fname (expand-file-name filename)))
2091 (setq directory (file-name-as-directory 2090 (setq directory (file-name-as-directory
2092 (expand-file-name (or directory default-directory)))) 2091 (expand-file-name (or directory default-directory))))
2093 ;; On Microsoft OSes, if FILENAME and DIRECTORY have different 2092 ;; On Microsoft OSes, if FILENAME and DIRECTORY have different