Mercurial > emacs
changeset 53186:d6dc58f9beaa
(make-mms-derivative-root-dir): Update.
(make-mms-derivative): Avoid unixisms for tree membership
validation and buffer naming: use `file-relative-name'.
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Fri, 28 Nov 2003 08:59:09 +0000 |
parents | 85f57f9a360f |
children | 7ba9466a0ed8 |
files | vms/make-mms-derivative.el |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/vms/make-mms-derivative.el Thu Nov 27 23:05:42 2003 +0000 +++ b/vms/make-mms-derivative.el Fri Nov 28 08:59:09 2003 +0000 @@ -55,7 +55,7 @@ ;;; Code: -(defvar make-mms-derivative-root-dir "~/build/GNU/emacs" +(defvar make-mms-derivative-root-dir "AXPA:[TTN.EMACS.EMACS212_3]" "Source tree root directory.") (defvar make-mms-derivative-data nil @@ -111,14 +111,14 @@ (interactive "fSource File: ") (let ((root (expand-file-name make-mms-derivative-root-dir)) (file (expand-file-name file))) - (unless (string-match (concat "^" root) file) + (when (file-name-absolute-p (file-relative-name file root)) (error "Not under root (%s)" root)) (let ((edits-filename (concat file "-2mms"))) (unless (file-exists-p edits-filename) (error "Could not find %s" edits-filename)) - (let* ((pre (+ (length root) (if (string= "/" (substring root -1)) 0 1))) - (buf (get-buffer-create (format "*mms-derivative: %s" - (substring file pre))))) + (let ((buf (get-buffer-create + (format "*mms-derivative: %s" + (file-relative-name file root))))) (message "Munging ...") (switch-to-buffer buf) (erase-buffer)