From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.bugs Subject: Strange `file-name-sans-extension' behavior Date: 26 Jul 2002 11:15:05 +0000 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027674960 23306 127.0.0.1 (26 Jul 2002 09:16:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 26 Jul 2002 09:16:00 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Y1CY-00063n-00 for ; Fri, 26 Jul 2002 11:15:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Y1Cs-0006Be-00; Fri, 26 Jul 2002 05:16:18 -0400 Original-Received: from inet-mail3.oracle.com ([148.87.2.203]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Y1Bt-0005s0-00 for ; Fri, 26 Jul 2002 05:15:17 -0400 Original-Received: from inet-mail3.oracle.com (localhost [127.0.0.1]) by inet-mail3.oracle.com (Switch-2.2.3/Switch-2.2.3) with ESMTP id g6Q9CxS00111 for ; Fri, 26 Jul 2002 02:12:59 -0700 (PDT) Original-Received: from rgmgw4.us.oracle.com (rgmgw4.us.oracle.com [138.1.191.13]) by inet-mail3.oracle.com (Switch-2.2.3/Switch-2.2.3) with ESMTP id g6Q9Ct200046 for ; Fri, 26 Jul 2002 02:12:58 -0700 (PDT) Original-Received: from SAPPC7.de.oracle.com (sappc7.de.oracle.com [140.84.81.137]) by rgmgw4.us.oracle.com (Switch-2.1.3/Switch-2.1.0) with ESMTP id g6Q9F6w28737 for ; Fri, 26 Jul 2002 03:15:09 -0600 (MDT) Original-To: bug-gnu-emacs@gnu.org Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2914 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2914 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