From: morioka Date: Sun, 14 Feb 1999 15:00:22 +0000 (+0000) Subject: (file-name-sans-extension): New function . X-Git-Tag: apel-9_13~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=58967d4ba4497a5c2656c01ee4b5b3088cb628d2;p=elisp%2Fapel.git (file-name-sans-extension): New function . --- diff --git a/poe.el b/poe.el index 0e77846..5fdbdcc 100644 --- a/poe.el +++ b/poe.el @@ -220,6 +220,19 @@ The value is actually the element of LIST whose cdr equals KEY." (setq list (cdr list))) )) +(defun-maybe file-name-sans-extension (filename) + "Return FILENAME sans final \"extension\". +The extension, in a file name, is the part that follows the last `.'." + (save-match-data + (let ((file (file-name-sans-versions (file-name-nondirectory filename))) + directory) + (if (string-match "\\.[^.]*\\'" file) + (if (setq directory (file-name-directory filename)) + (expand-file-name (substring file 0 (match-beginning 0)) + directory) + (substring file 0 (match-beginning 0))) + filename)))) + (defmacro-maybe make-local-hook (hook)) ;; They are not Emacs features