diff options
| author | Stefan Monnier | 2009-03-10 14:08:52 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-03-10 14:08:52 +0000 |
| commit | ba528748a14a34d2c3f619615c4cdaf4bbd89cc0 (patch) | |
| tree | 16c988a41705f78fff35c619216e2f4d73af838d | |
| parent | bba79a9ce446856701d58cdeb26488b6a0b87864 (diff) | |
| download | emacs-ba528748a14a34d2c3f619615c4cdaf4bbd89cc0.tar.gz emacs-ba528748a14a34d2c3f619615c4cdaf4bbd89cc0.zip | |
* server.el (server-process-filter): Use expand-file-name rather than
command-line-normalize-file-name so as to use the `dir' when provided.
* emacsclient.c (main): Always pass cwd via "-dir". Pass the file
names without prepending cwd to them, so Emacs uses its customary
rules to determine how to interpret the file name.
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 40 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/server.el | 2 |
4 files changed, 14 insertions, 37 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 02f9918ebd8..0609f1e1e10 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-03-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacsclient.c (main): Always pass cwd via "-dir". Pass the file | ||
| 4 | names without prepending cwd to them, so Emacs uses its customary | ||
| 5 | rules to determine how to interpret the file name. | ||
| 6 | |||
| 1 | 2009-03-04 Glenn Morris <rgm@gnu.org> | 7 | 2009-03-04 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * movemail.c (main) [MAIL_USE_POP]: Add -r to usage message. | 9 | * movemail.c (main) [MAIL_USE_POP]: Add -r to usage message. |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 559664f0d45..3197b2a7276 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -1566,11 +1566,11 @@ main (argc, argv) | |||
| 1566 | quote_argument (emacs_socket, environ[i]); | 1566 | quote_argument (emacs_socket, environ[i]); |
| 1567 | send_to_emacs (emacs_socket, " "); | 1567 | send_to_emacs (emacs_socket, " "); |
| 1568 | } | 1568 | } |
| 1569 | send_to_emacs (emacs_socket, "-dir "); | ||
| 1570 | quote_argument (emacs_socket, cwd); | ||
| 1571 | send_to_emacs (emacs_socket, "/"); | ||
| 1572 | send_to_emacs (emacs_socket, " "); | ||
| 1573 | } | 1569 | } |
| 1570 | send_to_emacs (emacs_socket, "-dir "); | ||
| 1571 | quote_argument (emacs_socket, cwd); | ||
| 1572 | send_to_emacs (emacs_socket, "/"); | ||
| 1573 | send_to_emacs (emacs_socket, " "); | ||
| 1574 | 1574 | ||
| 1575 | retry: | 1575 | retry: |
| 1576 | if (nowait) | 1576 | if (nowait) |
| @@ -1613,7 +1613,6 @@ main (argc, argv) | |||
| 1613 | { | 1613 | { |
| 1614 | for (i = optind; i < argc; i++) | 1614 | for (i = optind; i < argc; i++) |
| 1615 | { | 1615 | { |
| 1616 | int relative = 0; | ||
| 1617 | 1616 | ||
| 1618 | if (eval) | 1617 | if (eval) |
| 1619 | { | 1618 | { |
| @@ -1635,40 +1634,9 @@ main (argc, argv) | |||
| 1635 | send_to_emacs (emacs_socket, " "); | 1634 | send_to_emacs (emacs_socket, " "); |
| 1636 | continue; | 1635 | continue; |
| 1637 | } | 1636 | } |
| 1638 | else | ||
| 1639 | relative = 1; | ||
| 1640 | } | 1637 | } |
| 1641 | else if (! file_name_absolute_p (argv[i])) | ||
| 1642 | #ifndef WINDOWSNT | ||
| 1643 | relative = 1; | ||
| 1644 | #else | ||
| 1645 | /* Call GetFullPathName so filenames of the form X:Y, where X is | ||
| 1646 | a valid drive designator, are interpreted as drive:path, not | ||
| 1647 | file:stream, and treated as absolute. | ||
| 1648 | The user can still pass a file:stream if desired (for example, | ||
| 1649 | .\X:Y), but it is not very useful, as Emacs currently does a | ||
| 1650 | very bad job of dealing with NTFS streams. */ | ||
| 1651 | { | ||
| 1652 | char *filename = (char *) xmalloc (MAX_PATH); | ||
| 1653 | DWORD size; | ||
| 1654 | |||
| 1655 | size = GetFullPathName (argv[i], MAX_PATH, filename, NULL); | ||
| 1656 | if (size > 0 && size < MAX_PATH) | ||
| 1657 | argv[i] = filename; | ||
| 1658 | else | ||
| 1659 | { | ||
| 1660 | relative = 1; | ||
| 1661 | free (filename); | ||
| 1662 | } | ||
| 1663 | } | ||
| 1664 | #endif | ||
| 1665 | 1638 | ||
| 1666 | send_to_emacs (emacs_socket, "-file "); | 1639 | send_to_emacs (emacs_socket, "-file "); |
| 1667 | if (relative) | ||
| 1668 | { | ||
| 1669 | quote_argument (emacs_socket, cwd); | ||
| 1670 | send_to_emacs (emacs_socket, "/"); | ||
| 1671 | } | ||
| 1672 | quote_argument (emacs_socket, argv[i]); | 1640 | quote_argument (emacs_socket, argv[i]); |
| 1673 | send_to_emacs (emacs_socket, " "); | 1641 | send_to_emacs (emacs_socket, " "); |
| 1674 | } | 1642 | } |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee521252b96..21706156689 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-03-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-03-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * server.el (server-process-filter): Use expand-file-name rather than | ||
| 4 | command-line-normalize-file-name so as to use the `dir' when provided. | ||
| 5 | |||
| 3 | * doc-view.el (doc-view-convert-current-doc): Fix last change. | 6 | * doc-view.el (doc-view-convert-current-doc): Fix last change. |
| 4 | 7 | ||
| 5 | 2009-03-10 Glenn Morris <rgm@gnu.org> | 8 | 2009-03-10 Glenn Morris <rgm@gnu.org> |
diff --git a/lisp/server.el b/lisp/server.el index 5e4e6e1548e..10b08ad4a3b 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -962,7 +962,7 @@ The following commands are accepted by the client: | |||
| 962 | (let ((file (pop command-line-args-left))) | 962 | (let ((file (pop command-line-args-left))) |
| 963 | (if coding-system | 963 | (if coding-system |
| 964 | (setq file (decode-coding-string file coding-system))) | 964 | (setq file (decode-coding-string file coding-system))) |
| 965 | (setq file (command-line-normalize-file-name file)) | 965 | (setq file (expand-file-name file dir)) |
| 966 | (push (cons file filepos) files) | 966 | (push (cons file filepos) files) |
| 967 | (server-log (format "New file: %s %s" | 967 | (server-log (format "New file: %s %s" |
| 968 | file (or filepos "")) proc)) | 968 | file (or filepos "")) proc)) |