diff options
| author | Paul Eggert | 2016-12-07 12:40:43 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-12-07 12:40:43 -0800 |
| commit | c5532f5a5c304134ecb0367997402c2935d6030c (patch) | |
| tree | cff0c6b05099fcaa51dae8e1c042528cdb318925 | |
| parent | 32b46fc82f1275d8e0c86340546db366dea48c8c (diff) | |
| parent | 39809036d39711fb5d01105739dd301ac046b151 (diff) | |
| download | emacs-c5532f5a5c304134ecb0367997402c2935d6030c.tar.gz emacs-c5532f5a5c304134ecb0367997402c2935d6030c.zip | |
Merge from origin/emacs-25
3980903 ; Update ChangeLog.2, etc/AUTHORS and ldef-boot.el for Emacs ...
5878abf Fix 'expand-file-name' during startup on MS-Windows
| -rw-r--r-- | ChangeLog.2 | 168 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 1 | ||||
| -rw-r--r-- | lisp/files.el | 39 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 12 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/fileio.c | 8 | ||||
| -rw-r--r-- | src/w32.c | 18 | ||||
| -rw-r--r-- | src/w32.h | 1 | ||||
| -rw-r--r-- | src/w32term.c | 5 |
9 files changed, 232 insertions, 23 deletions
diff --git a/ChangeLog.2 b/ChangeLog.2 index 3879cab744b..87a78fb33e5 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 | |||
| @@ -1,5 +1,172 @@ | |||
| 1 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | 1 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | Fix 'expand-file-name' during startup on MS-Windows | ||
| 4 | |||
| 5 | * src/w32.c (w32_init_file_name_codepage): New function, resets | ||
| 6 | file_name_codepage and w32_ansi_code_page to undo the values | ||
| 7 | recorded during dumping. | ||
| 8 | (codepage_for_filenames): Fix an embarrassing typo. Ignore the | ||
| 9 | cached value of file-name encoding if it is nil, i.e. not | ||
| 10 | initialized yet. Actually cache the last used file-name encoding | ||
| 11 | to avoid calling APIs when not necessary. | ||
| 12 | |||
| 13 | * src/w32.h (w32_init_file_name_codepage): Add prototype. | ||
| 14 | |||
| 15 | * src/w32term.c (syms_of_w32term): Set the value of | ||
| 16 | w32_unicode_filenames according to the OS version. This avoids | ||
| 17 | resetting it during startup, which then causes temacs to run with | ||
| 18 | the incorrect value. | ||
| 19 | |||
| 20 | * src/emacs.c (main): Call w32_init_file_name_codepage early | ||
| 21 | during the startup. | ||
| 22 | |||
| 23 | * src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Update 'newdir' | ||
| 24 | after converting $HOME to a UTF-8 string, so that 'newdirlim' is | ||
| 25 | consistent with it. (Bug#25038) | ||
| 26 | |||
| 27 | * lisp/international/mule-cmds.el (set-locale-environment): Set | ||
| 28 | 'default-file-name-coding-system' to the ANSI codepage even in | ||
| 29 | non-interactive sessions. | ||
| 30 | |||
| 31 | * lisp/files.el (directory-abbrev-alist, abbreviated-home-dir): | ||
| 32 | Doc fix. | ||
| 33 | (abbreviate-file-name): Decode 'abbreviated-home-dir' if it is a | ||
| 34 | unibyte string. | ||
| 35 | |||
| 36 | * doc/lispref/files.texi (Directory Names): Index | ||
| 37 | 'directory-abbrev-alist'. | ||
| 38 | |||
| 39 | 2016-12-07 Nicolas Petton <nicolas@petton.fr> | ||
| 40 | |||
| 41 | * admin/authors.el (authors-renamed-files-alist): Addition. | ||
| 42 | |||
| 43 | 2016-12-07 Glenn Morris <rgm@gnu.org> | ||
| 44 | |||
| 45 | Tweak refcard note about documentation location | ||
| 46 | |||
| 47 | * etc/refcards/calccard.tex, etc/refcards/cs-dired-ref.tex: | ||
| 48 | * etc/refcards/cs-refcard.tex, etc/refcards/cs-survival.tex: | ||
| 49 | * etc/refcards/de-refcard.tex, etc/refcards/dired-ref.tex: | ||
| 50 | * etc/refcards/fr-dired-ref.tex, etc/refcards/fr-refcard.tex: | ||
| 51 | * etc/refcards/fr-survival.tex, etc/refcards/gnus-refcard.tex: | ||
| 52 | * etc/refcards/orgcard.tex, etc/refcards/pl-refcard.tex: | ||
| 53 | * etc/refcards/pt-br-refcard.tex, etc/refcards/refcard.tex: | ||
| 54 | * etc/refcards/ru-refcard.tex, etc/refcards/sk-dired-ref.tex: | ||
| 55 | * etc/refcards/sk-refcard.tex, etc/refcards/sk-survival.tex: | ||
| 56 | * etc/refcards/survival.tex, etc/refcards/vipcard.tex: | ||
| 57 | * etc/refcards/viperCard.tex: Tweak documentation url. | ||
| 58 | |||
| 59 | 2016-12-07 Glenn Morris <rgm@gnu.org> | ||
| 60 | |||
| 61 | Improve treatment of Fortran's "class is" | ||
| 62 | |||
| 63 | * lisp/progmodes/f90.el (f90-start-block-re, f90-no-block-limit): | ||
| 64 | Handle "class is". (Bug#25039) | ||
| 65 | * test/automated/f90.el (f90-test-bug25039): New test. | ||
| 66 | |||
| 67 | 2016-12-07 Nicolas Petton <nicolas@petton.fr> | ||
| 68 | |||
| 69 | Bump Emacs version to 25.1.90 | ||
| 70 | |||
| 71 | * README: | ||
| 72 | * configure.ac: | ||
| 73 | * msdos/sed2v2.inp: | ||
| 74 | * nt/README.W32: Bump Emacs version to 25.1.90 | ||
| 75 | |||
| 76 | 2016-12-07 Nicolas Petton <nicolas@petton.fr> | ||
| 77 | |||
| 78 | Bump Emacs version | ||
| 79 | |||
| 80 | * README: | ||
| 81 | * configure.ac: | ||
| 82 | * etc/NEWS: | ||
| 83 | * msdos/sed2v2.inp: | ||
| 84 | * nt/README.W32: Bump Emacs version to 25.2.90 | ||
| 85 | |||
| 86 | 2016-12-07 Karl Fogel <kfogel@red-bean.com> | ||
| 87 | |||
| 88 | Handle TeX comments when making new paragraph | ||
| 89 | |||
| 90 | * lisp/textmodes/tex-mode.el (tex-handle-newline): New function. | ||
| 91 | Handle comment case directly, and dispatch to `tex-terminate-paragraph' | ||
| 92 | for original behavior in non-comment case. | ||
| 93 | (tex-mode-map): Bind above to C-j, replacing `tex-terminate-paragraph'. | ||
| 94 | |||
| 95 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 96 | |||
| 97 | Restore keystroke echo in 'C-q' | ||
| 98 | |||
| 99 | * lisp/simple.el (read-quoted-char): Use 'read-event' instead of | ||
| 100 | 'read-key', to avoid losing the keystroke echo in 'C-q'. (Bug#24635) | ||
| 101 | |||
| 102 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 103 | |||
| 104 | Improve documentation of 'current-word' | ||
| 105 | |||
| 106 | * lisp/simple.el (current-word): Clarify and improve the doc | ||
| 107 | string. (Bug#24979) | ||
| 108 | |||
| 109 | 2016-12-07 Chunyang Xu <mail@xuchunyang.me> | ||
| 110 | |||
| 111 | Fix a typo in an Eshell defcustom | ||
| 112 | |||
| 113 | * lisp/eshell/esh-mode.el (eshell-scroll-to-bottom-on-output): Fix | ||
| 114 | a typo in the 'others' standard value. (Bug#24983) | ||
| 115 | |||
| 116 | 2016-12-07 Hong Xu <hong@topbug.net> (tiny change) | ||
| 117 | |||
| 118 | Minor copyedits of electric-pair-mode | ||
| 119 | |||
| 120 | * doc/emacs/programs.texi (Matching): Add index entries. Fix | ||
| 121 | typos. (Bug#25012) | ||
| 122 | |||
| 123 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 124 | |||
| 125 | Fix documentation of 'invocation-directory' | ||
| 126 | |||
| 127 | * doc/lispref/os.texi (System Environment): Fix wording of the | ||
| 128 | description of 'invocation-directory'. (Bug#24999) | ||
| 129 | |||
| 130 | 2016-12-07 Glenn Morris <rgm@gnu.org> | ||
| 131 | |||
| 132 | * admin/authors.el (authors-aliases): Add an entry. | ||
| 133 | |||
| 134 | 2016-12-07 Philipp Stephani <phst@google.com> | ||
| 135 | |||
| 136 | Guard terminal parameter in XTerm mouse mode | ||
| 137 | |||
| 138 | It has been observed (in the HTerm terminal emulator) that the | ||
| 139 | event stored in the 'xterm-mouse-last-down' terminal parameter gets | ||
| 140 | overwritten during a mouse drag operation, causing Emacs to attempt to | ||
| 141 | synthesize the non-existing <drag-mouse-0> event. Copy the event into | ||
| 142 | the terminal parameter to protect against such modifications. | ||
| 143 | |||
| 144 | * lisp/xt-mouse.el (xterm-mouse-translate-1): Guard against modification | ||
| 145 | of input event list. | ||
| 146 | |||
| 147 | 2016-12-07 Nicolas Petton <nicolas@petton.fr> | ||
| 148 | |||
| 149 | * etc/AUTHORS: Regenerate the AUTHORS file | ||
| 150 | |||
| 151 | 2016-12-07 Nicolas Petton <nicolas@petton.fr> | ||
| 152 | |||
| 153 | Update ChangeLog files and authors.el | ||
| 154 | |||
| 155 | * admin/authors.el (authors-renamed-files-alist): Add entries for | ||
| 156 | obsolete files. | ||
| 157 | * ChangeLog.2: Update. | ||
| 158 | |||
| 159 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 160 | |||
| 161 | Fix menu bindings of Dired 'A' and 'Q' commands | ||
| 162 | |||
| 163 | * lisp/dired.el (dired-mode-map): Rebind "Search Files" and "Query | ||
| 164 | Replace in Files" menu items to 'dired-do-find-regexp' and | ||
| 165 | 'dired-do-find-regexp-and-replace', respectively. (Bug#24977) | ||
| 166 | |||
| 167 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 168 | 2016-12-07 Eli Zaretskii <eliz@gnu.org> | ||
| 169 | |||
| 3 | Avoid errors in shr-pixel-column due to dedicated windows | 170 | Avoid errors in shr-pixel-column due to dedicated windows |
| 4 | 171 | ||
| 5 | * lisp/net/shr.el (shr-pixel-column): If we are switching to | 172 | * lisp/net/shr.el (shr-pixel-column): If we are switching to |
| @@ -39110,6 +39277,7 @@ | |||
| 39110 | 39277 | ||
| 39111 | This file records repository revisions from | 39278 | This file records repository revisions from |
| 39112 | commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to | 39279 | commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to |
| 39280 | 2016-12-07abf87b6b3ead1367cbae5cc6b0743349f611 (inclusive). | ||
| 39113 | 2016-12-07db8824bb97d07e3897e800eee946757a3 (inclusive). | 39281 | 2016-12-07db8824bb97d07e3897e800eee946757a3 (inclusive). |
| 39114 | 2016-09-26c9cef49b0fceb3c5e904837ea5675fe4306ac (inclusive). | 39282 | 2016-09-26c9cef49b0fceb3c5e904837ea5675fe4306ac (inclusive). |
| 39115 | 2016-08-22bb813cfea53e4162409f2adc0a793ab301894 (inclusive). | 39283 | 2016-08-22bb813cfea53e4162409f2adc0a793ab301894 (inclusive). |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index b13df9f2963..26db93cd8fd 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2217,6 +2217,7 @@ function: | |||
| 2217 | 2217 | ||
| 2218 | @cindex file name abbreviations | 2218 | @cindex file name abbreviations |
| 2219 | @cindex abbreviated file names | 2219 | @cindex abbreviated file names |
| 2220 | @vindex directory-abbrev-alist | ||
| 2220 | @defun abbreviate-file-name filename | 2221 | @defun abbreviate-file-name filename |
| 2221 | @anchor{abbreviate-file-name} | 2222 | @anchor{abbreviate-file-name} |
| 2222 | This function returns an abbreviated form of @var{filename}. It | 2223 | This function returns an abbreviated form of @var{filename}. It |
diff --git a/lisp/files.el b/lisp/files.el index 84f8dc7db94..54e8495abc7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -51,20 +51,21 @@ when it has unsaved changes." | |||
| 51 | nil | 51 | nil |
| 52 | "Alist of abbreviations for file directories. | 52 | "Alist of abbreviations for file directories. |
| 53 | A list of elements of the form (FROM . TO), each meaning to replace | 53 | A list of elements of the form (FROM . TO), each meaning to replace |
| 54 | FROM with TO when it appears in a directory name. This replacement is | 54 | a match for FROM with TO when a directory name matches FROM. This |
| 55 | done when setting up the default directory of a newly visited file. | 55 | replacement is done when setting up the default directory of a |
| 56 | newly visited file buffer. | ||
| 56 | 57 | ||
| 57 | FROM is matched against directory names anchored at the first | 58 | FROM is a regexp that is matched against directory names anchored at |
| 58 | character, so it should start with a \"\\\\\\=`\", or, if directory | 59 | the first character, so it should start with a \"\\\\\\=`\", or, if |
| 59 | names cannot have embedded newlines, with a \"^\". | 60 | directory names cannot have embedded newlines, with a \"^\". |
| 60 | 61 | ||
| 61 | FROM and TO should be equivalent names, which refer to the | 62 | FROM and TO should be equivalent names, which refer to the |
| 62 | same directory. Do not use `~' in the TO strings; | 63 | same directory. TO should be an absolute directory name. |
| 63 | they should be ordinary absolute directory names. | 64 | Do not use `~' in the TO strings. |
| 64 | 65 | ||
| 65 | Use this feature when you have directories which you normally refer to | 66 | Use this feature when you have directories which you normally refer to |
| 66 | via absolute symbolic links. Make TO the name of the link, and FROM | 67 | via absolute symbolic links. Make TO the name of the link, and FROM |
| 67 | the name it is linked to." | 68 | a regexp matching the name it is linked to." |
| 68 | :type '(repeat (cons :format "%v" | 69 | :type '(repeat (cons :format "%v" |
| 69 | :value ("\\`" . "") | 70 | :value ("\\`" . "") |
| 70 | (regexp :tag "From") | 71 | (regexp :tag "From") |
| @@ -1784,7 +1785,8 @@ Choose the buffer's name using `generate-new-buffer-name'." | |||
| 1784 | (make-obsolete-variable 'automount-dir-prefix 'directory-abbrev-alist "24.3") | 1785 | (make-obsolete-variable 'automount-dir-prefix 'directory-abbrev-alist "24.3") |
| 1785 | 1786 | ||
| 1786 | (defvar abbreviated-home-dir nil | 1787 | (defvar abbreviated-home-dir nil |
| 1787 | "The user's homedir abbreviated according to `directory-abbrev-alist'.") | 1788 | "Regexp matching the user's homedir at the beginning of file name. |
| 1789 | The value includes abbreviation according to `directory-abbrev-alist'.") | ||
| 1788 | 1790 | ||
| 1789 | (defun abbreviate-file-name (filename) | 1791 | (defun abbreviate-file-name (filename) |
| 1790 | "Return a version of FILENAME shortened using `directory-abbrev-alist'. | 1792 | "Return a version of FILENAME shortened using `directory-abbrev-alist'. |
| @@ -1815,8 +1817,23 @@ home directory is a root directory) and removes automounter prefixes | |||
| 1815 | (or abbreviated-home-dir | 1817 | (or abbreviated-home-dir |
| 1816 | (setq abbreviated-home-dir | 1818 | (setq abbreviated-home-dir |
| 1817 | (let ((abbreviated-home-dir "$foo")) | 1819 | (let ((abbreviated-home-dir "$foo")) |
| 1818 | (concat "\\`" (abbreviate-file-name (expand-file-name "~")) | 1820 | (setq abbreviated-home-dir |
| 1819 | "\\(/\\|\\'\\)")))) | 1821 | (concat "\\`" |
| 1822 | (abbreviate-file-name (expand-file-name "~")) | ||
| 1823 | "\\(/\\|\\'\\)")) | ||
| 1824 | ;; Depending on whether default-directory does or | ||
| 1825 | ;; doesn't include non-ASCII characters, the value | ||
| 1826 | ;; of abbreviated-home-dir could be multibyte or | ||
| 1827 | ;; unibyte. In the latter case, we need to decode | ||
| 1828 | ;; it. Note that this function is called for the | ||
| 1829 | ;; first time (from startup.el) when | ||
| 1830 | ;; locale-coding-system is already set up. | ||
| 1831 | (if (multibyte-string-p abbreviated-home-dir) | ||
| 1832 | abbreviated-home-dir | ||
| 1833 | (decode-coding-string abbreviated-home-dir | ||
| 1834 | (if (eq system-type 'windows-nt) | ||
| 1835 | 'utf-8 | ||
| 1836 | locale-coding-system)))))) | ||
| 1820 | 1837 | ||
| 1821 | ;; If FILENAME starts with the abbreviated homedir, | 1838 | ;; If FILENAME starts with the abbreviated homedir, |
| 1822 | ;; make it start with `~' instead. | 1839 | ;; make it start with `~' instead. |
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 7543d0d734a..7672edc0443 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2704,10 +2704,12 @@ See also `locale-charset-language-names', `locale-language-names', | |||
| 2704 | ;; terminal-coding-system with the ANSI or console codepage. | 2704 | ;; terminal-coding-system with the ANSI or console codepage. |
| 2705 | (when (and (eq system-type 'windows-nt) | 2705 | (when (and (eq system-type 'windows-nt) |
| 2706 | (boundp 'w32-ansi-code-page)) | 2706 | (boundp 'w32-ansi-code-page)) |
| 2707 | (let* ((code-page-coding | 2707 | (let* ((ansi-code-page-coding |
| 2708 | (intern (format "cp%d" (if noninteractive | 2708 | (intern (format "cp%d" w32-ansi-code-page))) |
| 2709 | (w32-get-console-codepage) | 2709 | (code-page-coding |
| 2710 | w32-ansi-code-page)))) | 2710 | (if noninteractive |
| 2711 | (intern (format "cp%d" (w32-get-console-codepage))) | ||
| 2712 | ansi-code-page-coding)) | ||
| 2711 | (output-coding | 2713 | (output-coding |
| 2712 | (if noninteractive | 2714 | (if noninteractive |
| 2713 | (intern (format "cp%d" (w32-get-console-output-codepage))) | 2715 | (intern (format "cp%d" (w32-get-console-output-codepage))) |
| @@ -2717,7 +2719,7 @@ See also `locale-charset-language-names', `locale-language-names', | |||
| 2717 | (unless frame (setq locale-coding-system code-page-coding)) | 2719 | (unless frame (setq locale-coding-system code-page-coding)) |
| 2718 | (set-keyboard-coding-system code-page-coding frame) | 2720 | (set-keyboard-coding-system code-page-coding frame) |
| 2719 | (set-terminal-coding-system output-coding frame) | 2721 | (set-terminal-coding-system output-coding frame) |
| 2720 | (setq default-file-name-coding-system code-page-coding)))) | 2722 | (setq default-file-name-coding-system ansi-code-page-coding)))) |
| 2721 | 2723 | ||
| 2722 | (when (eq system-type 'darwin) | 2724 | (when (eq system-type 'darwin) |
| 2723 | ;; On Darwin, file names are always encoded in utf-8, no matter | 2725 | ;; On Darwin, file names are always encoded in utf-8, no matter |
diff --git a/src/emacs.c b/src/emacs.c index f633f09098d..75b2d6ed607 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -734,6 +734,9 @@ main (int argc, char **argv) | |||
| 734 | to have non-stub implementations of APIs we need to convert file | 734 | to have non-stub implementations of APIs we need to convert file |
| 735 | names between UTF-8 and the system's ANSI codepage. */ | 735 | names between UTF-8 and the system's ANSI codepage. */ |
| 736 | maybe_load_unicows_dll (); | 736 | maybe_load_unicows_dll (); |
| 737 | /* Initialize the codepage for file names, needed to decode | ||
| 738 | non-ASCII file names during startup. */ | ||
| 739 | w32_init_file_name_codepage (); | ||
| 737 | #endif | 740 | #endif |
| 738 | /* This has to be done before module_init is called below, so that | 741 | /* This has to be done before module_init is called below, so that |
| 739 | the latter could use the thread ID of the main thread. */ | 742 | the latter could use the thread ID of the main thread. */ |
diff --git a/src/fileio.c b/src/fileio.c index 7aa58177d49..3ba85b2b903 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1074,8 +1074,6 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1074 | if (!(newdir = egetenv ("HOME"))) | 1074 | if (!(newdir = egetenv ("HOME"))) |
| 1075 | newdir = newdirlim = ""; | 1075 | newdir = newdirlim = ""; |
| 1076 | nm++; | 1076 | nm++; |
| 1077 | /* `egetenv' may return a unibyte string, which will bite us since | ||
| 1078 | we expect the directory to be multibyte. */ | ||
| 1079 | #ifdef WINDOWSNT | 1077 | #ifdef WINDOWSNT |
| 1080 | if (newdir[0]) | 1078 | if (newdir[0]) |
| 1081 | { | 1079 | { |
| @@ -1083,11 +1081,14 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1083 | 1081 | ||
| 1084 | filename_from_ansi (newdir, newdir_utf8); | 1082 | filename_from_ansi (newdir, newdir_utf8); |
| 1085 | tem = make_unibyte_string (newdir_utf8, strlen (newdir_utf8)); | 1083 | tem = make_unibyte_string (newdir_utf8, strlen (newdir_utf8)); |
| 1084 | newdir = SSDATA (tem); | ||
| 1086 | } | 1085 | } |
| 1087 | else | 1086 | else |
| 1088 | #endif | 1087 | #endif |
| 1089 | tem = build_string (newdir); | 1088 | tem = build_string (newdir); |
| 1090 | newdirlim = newdir + SBYTES (tem); | 1089 | newdirlim = newdir + SBYTES (tem); |
| 1090 | /* `egetenv' may return a unibyte string, which will bite us | ||
| 1091 | if we expect the directory to be multibyte. */ | ||
| 1091 | if (multibyte && !STRING_MULTIBYTE (tem)) | 1092 | if (multibyte && !STRING_MULTIBYTE (tem)) |
| 1092 | { | 1093 | { |
| 1093 | hdir = DECODE_FILE (tem); | 1094 | hdir = DECODE_FILE (tem); |
| @@ -1116,8 +1117,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1116 | 1117 | ||
| 1117 | newdir = pw->pw_dir; | 1118 | newdir = pw->pw_dir; |
| 1118 | /* `getpwnam' may return a unibyte string, which will | 1119 | /* `getpwnam' may return a unibyte string, which will |
| 1119 | bite us since we expect the directory to be | 1120 | bite us when we expect the directory to be multibyte. */ |
| 1120 | multibyte. */ | ||
| 1121 | tem = make_unibyte_string (newdir, strlen (newdir)); | 1121 | tem = make_unibyte_string (newdir, strlen (newdir)); |
| 1122 | newdirlim = newdir + SBYTES (tem); | 1122 | newdirlim = newdir + SBYTES (tem); |
| 1123 | if (multibyte && !STRING_MULTIBYTE (tem)) | 1123 | if (multibyte && !STRING_MULTIBYTE (tem)) |
| @@ -1509,6 +1509,16 @@ w32_valid_pointer_p (void *p, int size) | |||
| 1509 | /* Current codepage for encoding file names. */ | 1509 | /* Current codepage for encoding file names. */ |
| 1510 | static int file_name_codepage; | 1510 | static int file_name_codepage; |
| 1511 | 1511 | ||
| 1512 | /* Initialize the codepage used for decoding file names. This is | ||
| 1513 | needed to undo the value recorded during dumping, which might not | ||
| 1514 | be correct when we run the dumped Emacs. */ | ||
| 1515 | void | ||
| 1516 | w32_init_file_name_codepage (void) | ||
| 1517 | { | ||
| 1518 | file_name_codepage = CP_ACP; | ||
| 1519 | w32_ansi_code_page = CP_ACP; | ||
| 1520 | } | ||
| 1521 | |||
| 1512 | /* Produce a Windows ANSI codepage suitable for encoding file names. | 1522 | /* Produce a Windows ANSI codepage suitable for encoding file names. |
| 1513 | Return the information about that codepage in CP_INFO. */ | 1523 | Return the information about that codepage in CP_INFO. */ |
| 1514 | int | 1524 | int |
| @@ -1525,12 +1535,13 @@ codepage_for_filenames (CPINFO *cp_info) | |||
| 1525 | if (NILP (current_encoding)) | 1535 | if (NILP (current_encoding)) |
| 1526 | current_encoding = Vdefault_file_name_coding_system; | 1536 | current_encoding = Vdefault_file_name_coding_system; |
| 1527 | 1537 | ||
| 1528 | if (!EQ (last_file_name_encoding, current_encoding)) | 1538 | if (!EQ (last_file_name_encoding, current_encoding) |
| 1539 | || NILP (last_file_name_encoding)) | ||
| 1529 | { | 1540 | { |
| 1530 | /* Default to the current ANSI codepage. */ | 1541 | /* Default to the current ANSI codepage. */ |
| 1531 | file_name_codepage = w32_ansi_code_page; | 1542 | file_name_codepage = w32_ansi_code_page; |
| 1532 | 1543 | ||
| 1533 | if (NILP (current_encoding)) | 1544 | if (!NILP (current_encoding)) |
| 1534 | { | 1545 | { |
| 1535 | char *cpname = SSDATA (SYMBOL_NAME (current_encoding)); | 1546 | char *cpname = SSDATA (SYMBOL_NAME (current_encoding)); |
| 1536 | char *cp = NULL, *end; | 1547 | char *cp = NULL, *end; |
| @@ -1559,6 +1570,9 @@ codepage_for_filenames (CPINFO *cp_info) | |||
| 1559 | if (!GetCPInfo (file_name_codepage, &cp)) | 1570 | if (!GetCPInfo (file_name_codepage, &cp)) |
| 1560 | emacs_abort (); | 1571 | emacs_abort (); |
| 1561 | } | 1572 | } |
| 1573 | |||
| 1574 | /* Cache the new value. */ | ||
| 1575 | last_file_name_encoding = current_encoding; | ||
| 1562 | } | 1576 | } |
| 1563 | if (cp_info) | 1577 | if (cp_info) |
| 1564 | *cp_info = cp; | 1578 | *cp_info = cp; |
| @@ -195,6 +195,7 @@ extern int filename_from_ansi (const char *, char *); | |||
| 195 | extern int filename_to_ansi (const char *, char *); | 195 | extern int filename_to_ansi (const char *, char *); |
| 196 | extern int filename_from_utf16 (const wchar_t *, char *); | 196 | extern int filename_from_utf16 (const wchar_t *, char *); |
| 197 | extern int filename_to_utf16 (const char *, wchar_t *); | 197 | extern int filename_to_utf16 (const char *, wchar_t *); |
| 198 | extern void w32_init_file_name_codepage (void); | ||
| 198 | extern int codepage_for_filenames (CPINFO *); | 199 | extern int codepage_for_filenames (CPINFO *); |
| 199 | extern Lisp_Object ansi_encode_filename (Lisp_Object); | 200 | extern Lisp_Object ansi_encode_filename (Lisp_Object); |
| 200 | extern int w32_copy_file (const char *, const char *, int, int, int); | 201 | extern int w32_copy_file (const char *, const char *, int, int, int); |
diff --git a/src/w32term.c b/src/w32term.c index ae0f741f24c..23475445e07 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -7188,7 +7188,10 @@ specified by `file-name-coding-system'. | |||
| 7188 | This variable is set to non-nil by default when Emacs runs on Windows | 7188 | This variable is set to non-nil by default when Emacs runs on Windows |
| 7189 | systems of the NT family, including W2K, XP, Vista, Windows 7 and | 7189 | systems of the NT family, including W2K, XP, Vista, Windows 7 and |
| 7190 | Windows 8. It is set to nil on Windows 9X. */); | 7190 | Windows 8. It is set to nil on Windows 9X. */); |
| 7191 | w32_unicode_filenames = 0; | 7191 | if (os_subtype == OS_9X) |
| 7192 | w32_unicode_filenames = 0; | ||
| 7193 | else | ||
| 7194 | w32_unicode_filenames = 1; | ||
| 7192 | 7195 | ||
| 7193 | 7196 | ||
| 7194 | /* FIXME: The following variable will be (hopefully) removed | 7197 | /* FIXME: The following variable will be (hopefully) removed |