unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: lekktu@gmail.com, Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: emacsclient: support `/' directory separator on w32
Date: Wed, 29 Nov 2006 17:08:34 +0100	[thread overview]
Message-ID: <456DB082.4090008@student.lu.se> (raw)
In-Reply-To: <85mz6ah8y6.fsf@lola.goethe.zz>

David Kastrup wrote:
> Lennart Borgman <lennart.borgman.073@student.lu.se> writes:
> 
>> Eli Zaretskii wrote:
>>>> Date: Wed, 29 Nov 2006 01:51:51 +0100
>>>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>>> Cc: emacs-devel@gnu.org
>>>>
>>>> I am not quite sure, but I believe I have seen that the
>>>> recommendation from MS for a file argument is to use
>>>> GetFullPathName.
>>> But Emacs does not do it, see expand-file-name.  So your proposed
>>> changes make emacsclient behave differently than Emacs.
>>
>> What is the reason that Emacs does not do it?
> 
> Emacs stores its idea of "relativeness" in `default-directory', a
> buffer-local variable.
> 
> It is not clear how one would attempt to model drive-relativeness on
> different drives than the one the buffer is in.  It is possible to
> make `default-directory' point to a different drive from that of
> `buffer-file-name'.  Maintaining the old drive-relative position at
> the same time does not seem possible to do in a reasonably predictable
> way.


I also thought so at first. At a second thought it seems simple. Just 
set emacs working directory (on w32) at the same time as setting 
default-directory. Then GetFullPathName will always return a result that 
is consistent with default-directory.

However the glory details of coding this in emacs is not something I 
precisely know immediately how to do ;-)

And setting the working directory makes me a bit scared too. But is the 
working directory ever used in emacs? (I found one call to 
get_current_directory_name in smc_save_yourself.)


Some more trouble: You can ask emacs to edit a file with a name like 
d:/somepath/c:hello.txt. The characters

    \/:*?"<>|

are not allowed in the last part of a file or directory name on w32. 
(Actually using a file name with ":" in the name is possible, but it 
does not do what an innocent user expect. It creates a file with a 
hidden what-did-they-call-it? part.)

Unfortunately GetLongPathName() does not care about these characters. I 
therefore tried with GetLongPathName(), but I could not link with MingGW:

   oo-spd/i386/emacsclient.o(.text+0x283b):emacsclient.c:
      undefined reference to `GetLongPathName'

Maybe there is a better API for checking file names?

  reply	other threads:[~2006-11-29 16:08 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24  5:45 emacsclient: support `/' directory separator on w32 Michael Mauger
2006-11-24 20:59 ` Eli Zaretskii
2006-11-25  0:15 ` Jason Rumney
2006-11-25  0:21   ` Juanma Barranquero
2006-11-25 10:35   ` Eli Zaretskii
2006-11-25 10:56     ` Andreas Schwab
2006-11-25 11:03       ` Eli Zaretskii
2006-11-25 14:26         ` Andreas Schwab
2006-11-25 14:40           ` Eli Zaretskii
2006-11-25 14:51             ` Andreas Schwab
2006-11-25 15:12               ` Eli Zaretskii
2006-11-25 11:15     ` Jason Rumney
2006-11-25 13:19       ` Eli Zaretskii
2006-11-25 13:33       ` Juanma Barranquero
2006-11-26 12:19         ` Richard Stallman
2006-11-25  1:25 ` Lennart Borgman
2006-11-25  1:54   ` Jason Rumney
2006-11-27 19:16   ` Stuart D. Herring
2006-11-27 20:17     ` Juanma Barranquero
2006-11-28  4:31       ` Eli Zaretskii
2006-11-28  8:26         ` David Kastrup
2006-11-28 11:59           ` Juanma Barranquero
2006-11-28 12:36             ` David Kastrup
2006-11-28 12:59               ` Juanma Barranquero
2006-11-28 13:05                 ` David Kastrup
2006-11-28 13:37                   ` Juanma Barranquero
2006-11-28 13:54                     ` Juanma Barranquero
2006-11-28 14:12                       ` Lennart Borgman
2006-11-28 14:18                         ` Juanma Barranquero
2006-11-28 14:20                           ` Lennart Borgman
2006-11-28 14:31                             ` Juanma Barranquero
2006-11-28 14:41                               ` Lennart Borgman
2006-11-28 14:52                                 ` Juanma Barranquero
2006-11-28 15:39                                 ` David Kastrup
2006-11-28 15:43                                   ` Lennart Borgman
2006-11-28 20:15                                     ` Eli Zaretskii
2006-11-28 23:12                                       ` Lennart Borgman
2006-11-29  4:26                                         ` Eli Zaretskii
2006-11-29  8:32                                           ` Lennart Borgman
2006-11-29 18:20                                             ` Eli Zaretskii
2006-11-29 22:30                                               ` Lennart Borgman
2006-11-29 23:30                                                 ` Lennart Borgman
2006-11-30  4:20                                                 ` Eli Zaretskii
2006-11-28 14:49                               ` David Kastrup
2006-11-28 14:52                                 ` Lennart Borgman
2006-11-28 14:56                                   ` David Kastrup
2006-11-28 14:24                           ` David Kastrup
2006-11-28 14:33                             ` Juanma Barranquero
2006-11-28 14:35                             ` Lennart Borgman
2006-11-28 14:37                               ` Juanma Barranquero
2006-11-28 14:42                                 ` Lennart Borgman
2006-11-28 14:51                                   ` Juanma Barranquero
2006-11-28 14:55                                     ` Lennart Borgman
2006-11-28 19:58                         ` Eli Zaretskii
2006-11-28 14:20                       ` David Kastrup
2006-11-28 14:28                         ` Juanma Barranquero
2006-11-28 14:36                         ` Lennart Borgman
2006-11-28 20:03                         ` Eli Zaretskii
2006-11-28 22:11                           ` David Kastrup
2006-11-28 23:13                             ` Lennart Borgman
2006-11-28 23:25                               ` David Kastrup
2006-11-29  0:53                                 ` Lennart Borgman
2006-11-29  1:38                                   ` David Kastrup
2006-11-28 23:28                               ` Juanma Barranquero
2006-11-29  0:51                                 ` Lennart Borgman
2006-11-29  1:11                                   ` Juanma Barranquero
2006-11-29  4:28                                   ` Eli Zaretskii
2006-11-29  8:29                                     ` Lennart Borgman
2006-11-29  9:57                                       ` David Kastrup
2006-11-29 16:08                                         ` Lennart Borgman [this message]
2006-11-29 16:24                                           ` Juanma Barranquero
2006-11-29 16:37                                             ` Lennart Borgman
2006-11-29 18:55                                               ` Eli Zaretskii
2006-11-29 18:54                                             ` Eli Zaretskii
2006-11-29 19:59                                               ` Juanma Barranquero
2006-11-29 18:46                                           ` Eli Zaretskii
2006-11-29 19:02                                             ` Lennart Borgman
2006-11-29 19:31                                               ` David Kastrup
2006-11-29 19:48                                                 ` Lennart Borgman
2006-11-30 19:48                                                 ` Richard Stallman
2006-11-29 18:28                                         ` Eli Zaretskii
2006-11-29 19:01                                           ` David Kastrup
2006-11-29 19:14                                             ` Lennart Borgman
2006-11-29 19:24                                               ` Eli Zaretskii
2006-11-29 19:33                                                 ` Lennart Borgman
2006-11-30  4:11                                                   ` Eli Zaretskii
2006-11-30  7:12                                                     ` David Kastrup
2006-11-30  8:15                                                     ` Lennart Borgman
2006-11-29 19:29                                               ` David Kastrup
2006-11-29 19:43                                                 ` Lennart Borgman
2006-11-29 19:19                                             ` Eli Zaretskii
2006-11-29 19:39                                               ` David Kastrup
2006-11-30  4:12                                                 ` Eli Zaretskii
2006-11-30  7:18                                                   ` David Kastrup
2006-11-30 19:50                                                     ` Eli Zaretskii
2006-11-30  8:14                                                   ` Lennart Borgman
2006-11-30  8:25                                                     ` David Kastrup
2006-11-30 12:56                                                       ` Lennart Borgman
2006-11-29 18:17                                       ` Eli Zaretskii
2006-11-29  4:27                                 ` Eli Zaretskii
2006-11-29  9:17                                   ` Juanma Barranquero
2006-11-29 18:25                                     ` Eli Zaretskii
2006-11-29 19:41                                       ` Juanma Barranquero
2006-11-30  4:14                                         ` Eli Zaretskii
2006-11-30  9:48                                           ` Juanma Barranquero
2006-11-28 19:55                     ` Eli Zaretskii
2006-11-28 13:23                 ` Lennart Borgman
2006-11-28 19:51               ` Eli Zaretskii
2006-11-28 19:49             ` Eli Zaretskii
2006-11-28 20:28               ` Juanma Barranquero
2006-11-28 20:50                 ` Eli Zaretskii
2006-11-28 21:41                   ` Juanma Barranquero
2006-11-28 19:35           ` Eli Zaretskii

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=456DB082.4090008@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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).