diff options
| author | Eli Zaretskii | 2013-03-28 20:13:59 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-03-28 20:13:59 +0200 |
| commit | d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e (patch) | |
| tree | 04fa8bc7bd2058a316a7ee30f8741d25bfd0b060 /src/msdos.c | |
| parent | 2ef26ceb192c7683754cf0b4aa3087f501254332 (diff) | |
| parent | e74aeda863cd6896e06e92586f87b45d63d67d15 (diff) | |
| download | emacs-d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e.tar.gz emacs-d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e.zip | |
Merge from trunk and resolve conflicts.
Diffstat (limited to 'src/msdos.c')
| -rw-r--r-- | src/msdos.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/msdos.c b/src/msdos.c index 433bf1074d8..695cca60728 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* MS-DOS specific C utilities. -*- coding: raw-text -*- | 1 | /* MS-DOS specific C utilities. -*- coding: cp850 -*- |
| 2 | 2 | ||
| 3 | Copyright (C) 1993-1997, 1999-2012 Free Software Foundation, Inc. | 3 | Copyright (C) 1993-1997, 1999-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -20,6 +20,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 20 | /* Contributed by Morten Welinder */ | 20 | /* Contributed by Morten Welinder */ |
| 21 | /* New display, keyboard, and mouse control by Kim F. Storm */ | 21 | /* New display, keyboard, and mouse control by Kim F. Storm */ |
| 22 | 22 | ||
| 23 | /* Note: This file MUST use a unibyte encoding, to both display the | ||
| 24 | keys on the non-US keyboard layout as their respective labels, and | ||
| 25 | provide the correct byte values for the keyboard input to inject | ||
| 26 | into Emacs. See 'struct dos_keyboard_map' below. As long as there | ||
| 27 | are only European keyboard layouts here, we are OK with DOS | ||
| 28 | codepage 850 encoding. */ | ||
| 29 | |||
| 23 | /* Note: some of the stuff here was taken from end of sysdep.c in demacs. */ | 30 | /* Note: some of the stuff here was taken from end of sysdep.c in demacs. */ |
| 24 | 31 | ||
| 25 | #include <config.h> | 32 | #include <config.h> |
| @@ -1254,7 +1261,7 @@ IT_update_begin (struct frame *f) | |||
| 1254 | /* If the mouse highlight is in the window that was deleted | 1261 | /* If the mouse highlight is in the window that was deleted |
| 1255 | (e.g., if it was popped by completion), clear highlight | 1262 | (e.g., if it was popped by completion), clear highlight |
| 1256 | unconditionally. */ | 1263 | unconditionally. */ |
| 1257 | if (NILP (w->buffer)) | 1264 | if (NILP (w->contents)) |
| 1258 | hlinfo->mouse_face_window = Qnil; | 1265 | hlinfo->mouse_face_window = Qnil; |
| 1259 | else | 1266 | else |
| 1260 | { | 1267 | { |
| @@ -1264,7 +1271,7 @@ IT_update_begin (struct frame *f) | |||
| 1264 | break; | 1271 | break; |
| 1265 | } | 1272 | } |
| 1266 | 1273 | ||
| 1267 | if (NILP (w->buffer) || i < w->desired_matrix->nrows) | 1274 | if (NILP (w->contents) || i < w->desired_matrix->nrows) |
| 1268 | clear_mouse_face (hlinfo); | 1275 | clear_mouse_face (hlinfo); |
| 1269 | } | 1276 | } |
| 1270 | } | 1277 | } |
| @@ -1314,7 +1321,7 @@ IT_frame_up_to_date (struct frame *f) | |||
| 1314 | new_cursor = frame_desired_cursor; | 1321 | new_cursor = frame_desired_cursor; |
| 1315 | else | 1322 | else |
| 1316 | { | 1323 | { |
| 1317 | struct buffer *b = XBUFFER (sw->buffer); | 1324 | struct buffer *b = XBUFFER (sw->contents); |
| 1318 | 1325 | ||
| 1319 | if (EQ (BVAR (b,cursor_type), Qt)) | 1326 | if (EQ (BVAR (b,cursor_type), Qt)) |
| 1320 | new_cursor = frame_desired_cursor; | 1327 | new_cursor = frame_desired_cursor; |
| @@ -1965,10 +1972,10 @@ struct dos_keyboard_map | |||
| 1965 | 1972 | ||
| 1966 | static struct dos_keyboard_map us_keyboard = { | 1973 | static struct dos_keyboard_map us_keyboard = { |
| 1967 | /* 0 1 2 3 4 5 */ | 1974 | /* 0 1 2 3 4 5 */ |
| 1968 | /* 01234567890123456789012345678901234567890 12345678901234 */ | 1975 | /* 01234567890123456789012345678901234567890 123 45678901234 */ |
| 1969 | "`1234567890-= qwertyuiop[] asdfghjkl;'\\ zxcvbnm,./ ", | 1976 | "`1234567890-= qwertyuiop[] asdfghjkl;'\\ \\zxcvbnm,./ ", |
| 1970 | /* 0123456789012345678901234567890123456789 012345678901234 */ | 1977 | /* 0123456789012345678901234567890123456789 012345678901234 */ |
| 1971 | "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| ZXCVBNM<>? ", | 1978 | "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| |ZXCVBNM<>? ", |
| 1972 | 0, /* no Alt-Gr key */ | 1979 | 0, /* no Alt-Gr key */ |
| 1973 | 0 /* no translate table */ | 1980 | 0 /* no translate table */ |
| 1974 | }; | 1981 | }; |
| @@ -1976,9 +1983,9 @@ static struct dos_keyboard_map us_keyboard = { | |||
| 1976 | static struct dos_keyboard_map fr_keyboard = { | 1983 | static struct dos_keyboard_map fr_keyboard = { |
| 1977 | /* 0 1 2 3 4 5 */ | 1984 | /* 0 1 2 3 4 5 */ |
| 1978 | /* 012 3456789012345678901234567890123456789012345678901234 */ | 1985 | /* 012 3456789012345678901234567890123456789012345678901234 */ |
| 1979 | "&\",(-_)= azertyuiop^$ qsdfghjklm* wxcvbnm;:! ", | 1986 | "&\"'(-_)= azertyuiop^$ qsdfghjklm* <wxcvbn,;:! ", |
| 1980 | /* 0123456789012345678901234567890123456789012345678901234 */ | 1987 | /* 0123456789012345678901234567890123456789012345678901234 */ |
| 1981 | " 1234567890+ AZERTYUIOP QSDFGHJKLM% WXCVBN?./ ", | 1988 | " 1234567890+ AZERTYUIOP QSDFGHJKLM% >WXCVBN?./ ", |
| 1982 | /* 01234567 89012345678901234567890123456789012345678901234 */ | 1989 | /* 01234567 89012345678901234567890123456789012345678901234 */ |
| 1983 | " ~#{[|`\\^@]} ", | 1990 | " ~#{[|`\\^@]} ", |
| 1984 | 0 /* no translate table */ | 1991 | 0 /* no translate table */ |
| @@ -2000,9 +2007,9 @@ static struct kbd_translate it_kbd_translate_table[] = { | |||
| 2000 | static struct dos_keyboard_map it_keyboard = { | 2007 | static struct dos_keyboard_map it_keyboard = { |
| 2001 | /* 0 1 2 3 4 5 */ | 2008 | /* 0 1 2 3 4 5 */ |
| 2002 | /* 0 123456789012345678901234567890123456789012345678901234 */ | 2009 | /* 0 123456789012345678901234567890123456789012345678901234 */ |
| 2003 | "\\1234567890'< qwertyuiop+> asdfghjkl zxcvbnm,.- ", | 2010 | "\\1234567890'< qwertyuiop+> asdfghjkl <zxcvbnm,.- ", |
| 2004 | /* 01 23456789012345678901234567890123456789012345678901234 */ | 2011 | /* 01 23456789012345678901234567890123456789012345678901234 */ |
| 2005 | "|!\"$%&/()=?^> QWERTYUIOP* ASDFGHJKL ZXCVBNM;:_ ", | 2012 | "|!\"$%&/()=?^> QWERTYUIOP* ASDFGHJKL >ZXCVBNM;:_ ", |
| 2006 | /* 0123456789012345678901234567890123456789012345678901234 */ | 2013 | /* 0123456789012345678901234567890123456789012345678901234 */ |
| 2007 | " {}~` [] @# ", | 2014 | " {}~` [] @# ", |
| 2008 | it_kbd_translate_table | 2015 | it_kbd_translate_table |
| @@ -2011,9 +2018,9 @@ static struct dos_keyboard_map it_keyboard = { | |||
| 2011 | static struct dos_keyboard_map dk_keyboard = { | 2018 | static struct dos_keyboard_map dk_keyboard = { |
| 2012 | /* 0 1 2 3 4 5 */ | 2019 | /* 0 1 2 3 4 5 */ |
| 2013 | /* 0123456789012345678901234567890123456789012345678901234 */ | 2020 | /* 0123456789012345678901234567890123456789012345678901234 */ |
| 2014 | "1234567890+| qwertyuiop~ asdfghjkl' zxcvbnm,.- ", | 2021 | "1234567890+| qwertyuiop~ asdfghjkl' <zxcvbnm,.- ", |
| 2015 | /* 01 23456789012345678901234567890123456789012345678901234 */ | 2022 | /* 01 23456789012345678901234567890123456789012345678901234 */ |
| 2016 | "!\"#$%&/()=?` QWERTYUIOP^ ASDFGHJKL* ZXCVBNM;:_ ", | 2023 | "!\"#$%&/()=?` QWERTYUIOP^ ASDFGHJKL* >ZXCVBNM;:_ ", |
| 2017 | /* 0123456789012345678901234567890123456789012345678901234 */ | 2024 | /* 0123456789012345678901234567890123456789012345678901234 */ |
| 2018 | " @$ {[]} | ", | 2025 | " @$ {[]} | ", |
| 2019 | 0 /* no translate table */ | 2026 | 0 /* no translate table */ |
| @@ -3281,10 +3288,10 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx, | |||
| 3281 | erasing it works correctly... */ | 3288 | erasing it works correctly... */ |
| 3282 | if (! NILP (saved_echo_area_message)) | 3289 | if (! NILP (saved_echo_area_message)) |
| 3283 | message_with_string ("%s", saved_echo_area_message, 0); | 3290 | message_with_string ("%s", saved_echo_area_message, 0); |
| 3284 | message (0); | 3291 | message1 (0); |
| 3285 | while (statecount--) | 3292 | while (statecount--) |
| 3286 | xfree (state[statecount].screen_behind); | 3293 | xfree (state[statecount].screen_behind); |
| 3287 | IT_display_cursor (1); /* turn cursor back on */ | 3294 | IT_display_cursor (1); /* Turn cursor back on. */ |
| 3288 | /* Clean up any mouse events that are waiting inside Emacs event queue. | 3295 | /* Clean up any mouse events that are waiting inside Emacs event queue. |
| 3289 | These events are likely to be generated before the menu was even | 3296 | These events are likely to be generated before the menu was even |
| 3290 | displayed, probably because the user pressed and released the button | 3297 | displayed, probably because the user pressed and released the button |
| @@ -3339,7 +3346,7 @@ void msdos_downcase_filename (unsigned char *); | |||
| 3339 | /* Destructively turn backslashes into slashes. */ | 3346 | /* Destructively turn backslashes into slashes. */ |
| 3340 | 3347 | ||
| 3341 | void | 3348 | void |
| 3342 | dostounix_filename (char *p) | 3349 | dostounix_filename (char *p, int ignore) |
| 3343 | { | 3350 | { |
| 3344 | msdos_downcase_filename (p); | 3351 | msdos_downcase_filename (p); |
| 3345 | 3352 | ||
| @@ -3603,7 +3610,7 @@ init_environment (int argc, char **argv, int skip_args) | |||
| 3603 | if (!s) s = "c:/command.com"; | 3610 | if (!s) s = "c:/command.com"; |
| 3604 | t = alloca (strlen (s) + 1); | 3611 | t = alloca (strlen (s) + 1); |
| 3605 | strcpy (t, s); | 3612 | strcpy (t, s); |
| 3606 | dostounix_filename (t); | 3613 | dostounix_filename (t, 0); |
| 3607 | setenv ("SHELL", t, 0); | 3614 | setenv ("SHELL", t, 0); |
| 3608 | 3615 | ||
| 3609 | /* PATH is also downcased and backslashes mirrored. */ | 3616 | /* PATH is also downcased and backslashes mirrored. */ |
| @@ -3613,7 +3620,7 @@ init_environment (int argc, char **argv, int skip_args) | |||
| 3613 | /* Current directory is always considered part of MsDos's path but it is | 3620 | /* Current directory is always considered part of MsDos's path but it is |
| 3614 | not normally mentioned. Now it is. */ | 3621 | not normally mentioned. Now it is. */ |
| 3615 | strcat (strcpy (t, ".;"), s); | 3622 | strcat (strcpy (t, ".;"), s); |
| 3616 | dostounix_filename (t); /* Not a single file name, but this should work. */ | 3623 | dostounix_filename (t, 0); /* Not a single file name, but this should work. */ |
| 3617 | setenv ("PATH", t, 1); | 3624 | setenv ("PATH", t, 1); |
| 3618 | 3625 | ||
| 3619 | /* In some sense all dos users have root privileges, so... */ | 3626 | /* In some sense all dos users have root privileges, so... */ |
| @@ -3957,14 +3964,6 @@ careadlinkat (int fd, char const *filename, | |||
| 3957 | return buffer; | 3964 | return buffer; |
| 3958 | } | 3965 | } |
| 3959 | 3966 | ||
| 3960 | ssize_t | ||
| 3961 | careadlinkatcwd (int fd, char const *filename, char *buffer, | ||
| 3962 | size_t buffer_size) | ||
| 3963 | { | ||
| 3964 | (void) fd; | ||
| 3965 | return readlink (filename, buffer, buffer_size); | ||
| 3966 | } | ||
| 3967 | |||
| 3968 | 3967 | ||
| 3969 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 | 3968 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 |
| 3970 | 3969 | ||