unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: Jens.Schmidt27@epost.de, emacs-devel@gnu.org
Subject: Re: Strange `file-name-sans-extension' behavior
Date: Fri, 09 Aug 2002 03:38:45 -0400	[thread overview]
Message-ID: <200208090738.g797clg11797@rum.cs.yale.edu> (raw)
In-Reply-To: 200207271853.g6RIrf310840@aztec.santafe.edu

> Does this fix it?
> 
> *** files.el.~1.598.~	Fri Jul 26 11:47:31 2002
> --- files.el	Sat Jul 27 14:16:42 2002
> ***************
> *** 2468,2475 ****
>         (if (and (string-match "\\.[^.]*\\'" file)
>   	       (not (eq 0 (match-beginning 0))))
>   	  (if (setq directory (file-name-directory filename))
> ! 	      (expand-file-name (substring file 0 (match-beginning 0))
> ! 				directory)
>   	    (substring file 0 (match-beginning 0)))
>   	filename))))
>   
> --- 2468,2476 ----
>         (if (and (string-match "\\.[^.]*\\'" file)
>   	       (not (eq 0 (match-beginning 0))))
>   	  (if (setq directory (file-name-directory filename))
> ! 	      ;; Don't use expand-file-name here; if DIRECTORY is relative,
> ! 	      ;; we don't want to expand it.
> ! 	      (concat directory (substring file 0 (match-beginning 0)))
>   	    (substring file 0 (match-beginning 0)))
>   	filename))))

Could we introduce a new function for that or some way to tell
`expand-file-name' not to do the expansion if the dir is relative ?
The current elisp primitives make it very difficult to reconstruct
a file name that was just taken apart.  The missing piece is
indeed this "concat a (potentially relative) directory name
and a file name but without making it absolute and without
adding "./" in front".


	Stefan

  reply	other threads:[~2002-08-09  7:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <uptxa211i.fsf@oracle.com>
2002-07-27 18:53 ` Strange `file-name-sans-extension' behavior Richard Stallman
2002-08-09  7:38   ` Stefan Monnier [this message]
2002-08-10 17:16     ` Richard Stallman
2002-08-12 15:58       ` Stefan Monnier
2002-08-12 17:28         ` Eli Zaretskii
2002-08-12 18:21           ` Andreas Schwab
2002-08-13 22:47           ` Richard Stallman
2002-08-14 11:03             ` Eli Zaretskii
2002-08-14 23:14               ` Richard Stallman
2002-08-15 16:51                 ` Eli Zaretskii
2002-08-16  2:31                   ` Richard Stallman
2002-08-16 17:17                     ` `concat' a dir and a file (was: Strange `file-name-sans-extension' behavior ) Stefan Monnier
2002-08-17  4:51                       ` Richard Stallman
2002-08-18 19:25                         ` Eli Zaretskii
2002-08-19 15:32                           ` Stefan Monnier
2002-08-19 18:39                           ` Richard Stallman
2002-08-20 11:33                             ` Eli Zaretskii
2002-08-13  1:48         ` Strange `file-name-sans-extension' behavior Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200208090738.g797clg11797@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=Jens.Schmidt27@epost.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).