unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Strange `file-name-sans-extension' behavior
@ 2002-07-26 11:15 Jens Schmidt
  0 siblings, 0 replies; only message in thread
From: Jens Schmidt @ 2002-07-26 11:15 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.1.1 (i386-msvc-nt4.0.1381)
 of 2001-10-22 on buffy

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

(file-name-sans-extension "sys/types.h")

-> "c:/home/jschmidt/sys/types"

I would have expected the result "sys/types".

What about the following version of `file-name-sans-extension':

(defun file-name-sans-extension (filename)
  "Return FILENAME sans final \"extension\".
The extension, in a file name, is the part that follows the last `.'."
  (let ((file (file-name-sans-versions (file-name-nondirectory filename)))
	  directory)
      (if (string-match "\\.[^.]*\\'" file)
	  (if (setq directory (file-name-directory filename))
	      (concat (file-name-as-directory directory)
                      (substring file 0 (match-beginning 0)))
	    (substring file 0 (match-beginning 0)))
	filename)))

Regards

Jens

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

only message in thread, other threads:[~2002-07-26 11:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-26 11:15 Strange `file-name-sans-extension' behavior Jens Schmidt

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