diff options
| author | Yuuki Harano | 2021-01-10 18:49:51 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-01-10 18:49:51 +0900 |
| commit | aac33a8074c41354ffdb1236a342da16dca4a1bc (patch) | |
| tree | 3a99478549f66d3f93a282e29d2c302995a86a49 /src | |
| parent | 78fd106653a9e4fa7c9c3c9788540e2e15552254 (diff) | |
| parent | 690cf6b8d8b8827f046bc1e24b2e556afeff976c (diff) | |
| download | emacs-aac33a8074c41354ffdb1236a342da16dca4a1bc.tar.gz emacs-aac33a8074c41354ffdb1236a342da16dca4a1bc.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 12 | ||||
| -rw-r--r-- | src/callproc.c | 31 | ||||
| -rw-r--r-- | src/casefiddle.c | 13 | ||||
| -rw-r--r-- | src/cmds.c | 21 | ||||
| -rw-r--r-- | src/commands.h | 8 | ||||
| -rw-r--r-- | src/emacs.c | 5 | ||||
| -rw-r--r-- | src/keyboard.c | 8 | ||||
| -rw-r--r-- | src/keyboard.h | 2 | ||||
| -rw-r--r-- | src/keymap.c | 93 | ||||
| -rw-r--r-- | src/keymap.h | 2 | ||||
| -rw-r--r-- | src/lisp.h | 11 | ||||
| -rw-r--r-- | src/minibuf.c | 3 | ||||
| -rw-r--r-- | src/nsfns.m | 14 | ||||
| -rw-r--r-- | src/nsmenu.m | 21 | ||||
| -rw-r--r-- | src/nsterm.h | 1 | ||||
| -rw-r--r-- | src/nsterm.m | 106 | ||||
| -rw-r--r-- | src/pdumper.c | 2 | ||||
| -rw-r--r-- | src/print.c | 3 | ||||
| -rw-r--r-- | src/process.c | 13 | ||||
| -rw-r--r-- | src/terminfo.c | 6 | ||||
| -rw-r--r-- | src/window.c | 24 | ||||
| -rw-r--r-- | src/window.h | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 16 | ||||
| -rw-r--r-- | src/xterm.c | 8 |
24 files changed, 217 insertions, 207 deletions
diff --git a/src/buffer.c b/src/buffer.c index 81f7d922fdb..71ad5edd527 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2602,8 +2602,6 @@ current buffer is cleared. */) | |||
| 2602 | p += bytes, pos += bytes; | 2602 | p += bytes, pos += bytes; |
| 2603 | } | 2603 | } |
| 2604 | } | 2604 | } |
| 2605 | if (narrowed) | ||
| 2606 | Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv)); | ||
| 2607 | } | 2605 | } |
| 2608 | else | 2606 | else |
| 2609 | { | 2607 | { |
| @@ -2682,9 +2680,6 @@ current buffer is cleared. */) | |||
| 2682 | if (pt != PT) | 2680 | if (pt != PT) |
| 2683 | TEMP_SET_PT (pt); | 2681 | TEMP_SET_PT (pt); |
| 2684 | 2682 | ||
| 2685 | if (narrowed) | ||
| 2686 | Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv)); | ||
| 2687 | |||
| 2688 | /* Do this first, so that chars_in_text asks the right question. | 2683 | /* Do this first, so that chars_in_text asks the right question. |
| 2689 | set_intervals_multibyte needs it too. */ | 2684 | set_intervals_multibyte needs it too. */ |
| 2690 | bset_enable_multibyte_characters (current_buffer, Qt); | 2685 | bset_enable_multibyte_characters (current_buffer, Qt); |
| @@ -6385,10 +6380,3 @@ nil NORECORD argument since it may lead to infinite recursion. */); | |||
| 6385 | 6380 | ||
| 6386 | Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt); | 6381 | Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt); |
| 6387 | } | 6382 | } |
| 6388 | |||
| 6389 | void | ||
| 6390 | keys_of_buffer (void) | ||
| 6391 | { | ||
| 6392 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); | ||
| 6393 | initial_define_key (control_x_map, 'k', "kill-buffer"); | ||
| 6394 | } | ||
diff --git a/src/callproc.c b/src/callproc.c index 8d2a5619eb8..1da315bef18 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -314,6 +314,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 314 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ | 314 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ |
| 315 | char *tempfile = NULL; | 315 | char *tempfile = NULL; |
| 316 | #else | 316 | #else |
| 317 | sigset_t oldset; | ||
| 317 | pid_t pid = -1; | 318 | pid_t pid = -1; |
| 318 | #endif | 319 | #endif |
| 319 | int child_errno; | 320 | int child_errno; |
| @@ -601,9 +602,12 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 601 | 602 | ||
| 602 | #ifndef MSDOS | 603 | #ifndef MSDOS |
| 603 | 604 | ||
| 605 | block_input (); | ||
| 606 | block_child_signal (&oldset); | ||
| 607 | |||
| 604 | child_errno | 608 | child_errno |
| 605 | = emacs_spawn (&pid, filefd, fd_output, fd_error, new_argv, env, | 609 | = emacs_spawn (&pid, filefd, fd_output, fd_error, new_argv, env, |
| 606 | SSDATA (current_dir), NULL); | 610 | SSDATA (current_dir), NULL, &oldset); |
| 607 | eassert ((child_errno == 0) == (0 < pid)); | 611 | eassert ((child_errno == 0) == (0 < pid)); |
| 608 | 612 | ||
| 609 | if (pid > 0) | 613 | if (pid > 0) |
| @@ -624,6 +628,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 624 | } | 628 | } |
| 625 | } | 629 | } |
| 626 | 630 | ||
| 631 | unblock_child_signal (&oldset); | ||
| 632 | unblock_input (); | ||
| 633 | |||
| 627 | if (pid < 0) | 634 | if (pid < 0) |
| 628 | report_file_errno (CHILD_SETUP_ERROR_DESC, Qnil, child_errno); | 635 | report_file_errno (CHILD_SETUP_ERROR_DESC, Qnil, child_errno); |
| 629 | 636 | ||
| @@ -1227,17 +1234,21 @@ child_setup (int in, int out, int err, char **new_argv, char **env, | |||
| 1227 | process image file ARGV[0]. Use ENVP for the environment block for | 1234 | process image file ARGV[0]. Use ENVP for the environment block for |
| 1228 | the new process. Use CWD as working directory for the new process. | 1235 | the new process. Use CWD as working directory for the new process. |
| 1229 | If PTY is not NULL, it must be a pseudoterminal device. If PTY is | 1236 | If PTY is not NULL, it must be a pseudoterminal device. If PTY is |
| 1230 | NULL, don't perform any terminal setup. */ | 1237 | NULL, don't perform any terminal setup. OLDSET must be a pointer |
| 1238 | to a signal set initialized by `block_child_signal'. Before | ||
| 1239 | calling this function, call `block_input' and `block_child_signal'; | ||
| 1240 | afterwards, call `unblock_input' and `unblock_child_signal'. Be | ||
| 1241 | sure to call `unblock_child_signal' only after registering NEWPID | ||
| 1242 | in a list where `handle_child_signal' can find it! */ | ||
| 1231 | 1243 | ||
| 1232 | int | 1244 | int |
| 1233 | emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, | 1245 | emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, |
| 1234 | char **argv, char **envp, const char *cwd, const char *pty) | 1246 | char **argv, char **envp, const char *cwd, |
| 1247 | const char *pty, const sigset_t *oldset) | ||
| 1235 | { | 1248 | { |
| 1236 | sigset_t oldset; | ||
| 1237 | int pid; | 1249 | int pid; |
| 1238 | 1250 | ||
| 1239 | block_input (); | 1251 | eassert (input_blocked_p ()); |
| 1240 | block_child_signal (&oldset); | ||
| 1241 | 1252 | ||
| 1242 | #ifndef WINDOWSNT | 1253 | #ifndef WINDOWSNT |
| 1243 | /* vfork, and prevent local vars from being clobbered by the vfork. */ | 1254 | /* vfork, and prevent local vars from being clobbered by the vfork. */ |
| @@ -1249,6 +1260,7 @@ emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, | |||
| 1249 | int volatile stdout_volatile = std_out; | 1260 | int volatile stdout_volatile = std_out; |
| 1250 | int volatile stderr_volatile = std_err; | 1261 | int volatile stderr_volatile = std_err; |
| 1251 | char **volatile envp_volatile = envp; | 1262 | char **volatile envp_volatile = envp; |
| 1263 | const sigset_t *volatile oldset_volatile = oldset; | ||
| 1252 | 1264 | ||
| 1253 | #ifdef DARWIN_OS | 1265 | #ifdef DARWIN_OS |
| 1254 | /* Darwin doesn't let us run setsid after a vfork, so use fork when | 1266 | /* Darwin doesn't let us run setsid after a vfork, so use fork when |
| @@ -1270,6 +1282,7 @@ emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, | |||
| 1270 | std_out = stdout_volatile; | 1282 | std_out = stdout_volatile; |
| 1271 | std_err = stderr_volatile; | 1283 | std_err = stderr_volatile; |
| 1272 | envp = envp_volatile; | 1284 | envp = envp_volatile; |
| 1285 | oldset = oldset_volatile; | ||
| 1273 | 1286 | ||
| 1274 | if (pid == 0) | 1287 | if (pid == 0) |
| 1275 | #endif /* not WINDOWSNT */ | 1288 | #endif /* not WINDOWSNT */ |
| @@ -1364,7 +1377,7 @@ emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, | |||
| 1364 | #endif | 1377 | #endif |
| 1365 | 1378 | ||
| 1366 | /* Stop blocking SIGCHLD in the child. */ | 1379 | /* Stop blocking SIGCHLD in the child. */ |
| 1367 | unblock_child_signal (&oldset); | 1380 | unblock_child_signal (oldset); |
| 1368 | 1381 | ||
| 1369 | if (pty_flag) | 1382 | if (pty_flag) |
| 1370 | child_setup_tty (std_out); | 1383 | child_setup_tty (std_out); |
| @@ -1382,10 +1395,6 @@ emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, | |||
| 1382 | 1395 | ||
| 1383 | int vfork_error = pid < 0 ? errno : 0; | 1396 | int vfork_error = pid < 0 ? errno : 0; |
| 1384 | 1397 | ||
| 1385 | /* Stop blocking in the parent. */ | ||
| 1386 | unblock_child_signal (&oldset); | ||
| 1387 | unblock_input (); | ||
| 1388 | |||
| 1389 | if (pid < 0) | 1398 | if (pid < 0) |
| 1390 | { | 1399 | { |
| 1391 | eassert (0 < vfork_error); | 1400 | eassert (0 < vfork_error); |
diff --git a/src/casefiddle.c b/src/casefiddle.c index a948bb3bc88..a7a25414909 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -682,16 +682,3 @@ Called with one argument METHOD which can be: | |||
| 682 | defsubr (&Sdowncase_word); | 682 | defsubr (&Sdowncase_word); |
| 683 | defsubr (&Scapitalize_word); | 683 | defsubr (&Scapitalize_word); |
| 684 | } | 684 | } |
| 685 | |||
| 686 | void | ||
| 687 | keys_of_casefiddle (void) | ||
| 688 | { | ||
| 689 | initial_define_key (control_x_map, Ctl ('U'), "upcase-region"); | ||
| 690 | Fput (intern ("upcase-region"), Qdisabled, Qt); | ||
| 691 | initial_define_key (control_x_map, Ctl ('L'), "downcase-region"); | ||
| 692 | Fput (intern ("downcase-region"), Qdisabled, Qt); | ||
| 693 | |||
| 694 | initial_define_key (meta_map, 'u', "upcase-word"); | ||
| 695 | initial_define_key (meta_map, 'l', "downcase-word"); | ||
| 696 | initial_define_key (meta_map, 'c', "capitalize-word"); | ||
| 697 | } | ||
diff --git a/src/cmds.c b/src/cmds.c index 798fd68a920..1547db80e88 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -529,24 +529,3 @@ This is run after inserting the character. */); | |||
| 529 | defsubr (&Sdelete_char); | 529 | defsubr (&Sdelete_char); |
| 530 | defsubr (&Sself_insert_command); | 530 | defsubr (&Sself_insert_command); |
| 531 | } | 531 | } |
| 532 | |||
| 533 | void | ||
| 534 | keys_of_cmds (void) | ||
| 535 | { | ||
| 536 | int n; | ||
| 537 | |||
| 538 | initial_define_key (global_map, Ctl ('I'), "self-insert-command"); | ||
| 539 | for (n = 040; n < 0177; n++) | ||
| 540 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 541 | #ifdef MSDOS | ||
| 542 | for (n = 0200; n < 0240; n++) | ||
| 543 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 544 | #endif | ||
| 545 | for (n = 0240; n < 0400; n++) | ||
| 546 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 547 | |||
| 548 | initial_define_key (global_map, Ctl ('A'), "beginning-of-line"); | ||
| 549 | initial_define_key (global_map, Ctl ('B'), "backward-char"); | ||
| 550 | initial_define_key (global_map, Ctl ('E'), "end-of-line"); | ||
| 551 | initial_define_key (global_map, Ctl ('F'), "forward-char"); | ||
| 552 | } | ||
diff --git a/src/commands.h b/src/commands.h index a09858d050d..2205ebf7d39 100644 --- a/src/commands.h +++ b/src/commands.h | |||
| @@ -23,14 +23,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 23 | 23 | ||
| 24 | #define Ctl(c) ((c)&037) | 24 | #define Ctl(c) ((c)&037) |
| 25 | 25 | ||
| 26 | /* Define the names of keymaps, just so people can refer to them in | ||
| 27 | calls to initial_define_key. These should *not* be used after | ||
| 28 | initialization; use-global-map doesn't affect these; it sets | ||
| 29 | current_global_map instead. */ | ||
| 30 | extern Lisp_Object global_map; | ||
| 31 | extern Lisp_Object meta_map; | ||
| 32 | extern Lisp_Object control_x_map; | ||
| 33 | |||
| 34 | /* If not Qnil, this is a switch-frame event which we decided to put | 26 | /* If not Qnil, this is a switch-frame event which we decided to put |
| 35 | off until the end of a key sequence. This should be read as the | 27 | off until the end of a key sequence. This should be read as the |
| 36 | next command input, after any Vunread_command_events. | 28 | next command input, after any Vunread_command_events. |
diff --git a/src/emacs.c b/src/emacs.c index 61d2023b4da..461d1b72e4c 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1969,12 +1969,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1969 | syms_of_json (); | 1969 | syms_of_json (); |
| 1970 | #endif | 1970 | #endif |
| 1971 | 1971 | ||
| 1972 | keys_of_casefiddle (); | ||
| 1973 | keys_of_cmds (); | ||
| 1974 | keys_of_buffer (); | ||
| 1975 | keys_of_keyboard (); | 1972 | keys_of_keyboard (); |
| 1976 | keys_of_keymap (); | ||
| 1977 | keys_of_window (); | ||
| 1978 | } | 1973 | } |
| 1979 | else | 1974 | else |
| 1980 | { | 1975 | { |
diff --git a/src/keyboard.c b/src/keyboard.c index 2446f078fde..4540b3179b5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -285,7 +285,7 @@ bool input_pending; | |||
| 285 | with the input rate, but if it can keep up just enough that there's no | 285 | with the input rate, but if it can keep up just enough that there's no |
| 286 | input_pending when we begin the command, then redisplay is not skipped | 286 | input_pending when we begin the command, then redisplay is not skipped |
| 287 | which results in better feedback to the user. */ | 287 | which results in better feedback to the user. */ |
| 288 | static bool input_was_pending; | 288 | bool input_was_pending; |
| 289 | 289 | ||
| 290 | /* Circular buffer for pre-read keyboard input. */ | 290 | /* Circular buffer for pre-read keyboard input. */ |
| 291 | 291 | ||
| @@ -12396,12 +12396,6 @@ syms_of_keyboard_for_pdumper (void) | |||
| 12396 | void | 12396 | void |
| 12397 | keys_of_keyboard (void) | 12397 | keys_of_keyboard (void) |
| 12398 | { | 12398 | { |
| 12399 | initial_define_key (global_map, Ctl ('Z'), "suspend-emacs"); | ||
| 12400 | initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs"); | ||
| 12401 | initial_define_key (meta_map, Ctl ('C'), "exit-recursive-edit"); | ||
| 12402 | initial_define_key (global_map, Ctl (']'), "abort-recursive-edit"); | ||
| 12403 | initial_define_key (meta_map, 'x', "execute-extended-command"); | ||
| 12404 | |||
| 12405 | initial_define_lispy_key (Vspecial_event_map, "delete-frame", | 12399 | initial_define_lispy_key (Vspecial_event_map, "delete-frame", |
| 12406 | "handle-delete-frame"); | 12400 | "handle-delete-frame"); |
| 12407 | #ifdef HAVE_NTGUI | 12401 | #ifdef HAVE_NTGUI |
diff --git a/src/keyboard.h b/src/keyboard.h index 91c6f4604f9..8bdffaa2bff 100644 --- a/src/keyboard.h +++ b/src/keyboard.h | |||
| @@ -432,7 +432,7 @@ extern int parse_solitary_modifier (Lisp_Object symbol); | |||
| 432 | extern Lisp_Object real_this_command; | 432 | extern Lisp_Object real_this_command; |
| 433 | 433 | ||
| 434 | extern int quit_char; | 434 | extern int quit_char; |
| 435 | 435 | extern bool input_was_pending; | |
| 436 | extern unsigned int timers_run; | 436 | extern unsigned int timers_run; |
| 437 | 437 | ||
| 438 | extern bool menu_separator_name_p (const char *); | 438 | extern bool menu_separator_name_p (const char *); |
diff --git a/src/keymap.c b/src/keymap.c index 1eeea81f627..1197f6fd4a5 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -59,22 +59,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 59 | 59 | ||
| 60 | Lisp_Object current_global_map; /* Current global keymap. */ | 60 | Lisp_Object current_global_map; /* Current global keymap. */ |
| 61 | 61 | ||
| 62 | Lisp_Object global_map; /* Default global key bindings. */ | ||
| 63 | |||
| 64 | Lisp_Object meta_map; /* The keymap used for globally bound | ||
| 65 | ESC-prefixed default commands. */ | ||
| 66 | |||
| 67 | Lisp_Object control_x_map; /* The keymap used for globally bound | ||
| 68 | C-x-prefixed default commands. */ | ||
| 69 | |||
| 70 | /* The keymap used by the minibuf for local | ||
| 71 | bindings when spaces are allowed in the | ||
| 72 | minibuf. */ | ||
| 73 | |||
| 74 | /* The keymap used by the minibuf for local | ||
| 75 | bindings when spaces are not encouraged | ||
| 76 | in the minibuf. */ | ||
| 77 | |||
| 78 | /* Alist of elements like (DEL . "\d"). */ | 62 | /* Alist of elements like (DEL . "\d"). */ |
| 79 | static Lisp_Object exclude_keys; | 63 | static Lisp_Object exclude_keys; |
| 80 | 64 | ||
| @@ -140,19 +124,6 @@ in case you use it as a menu with `x-popup-menu'. */) | |||
| 140 | return list1 (Qkeymap); | 124 | return list1 (Qkeymap); |
| 141 | } | 125 | } |
| 142 | 126 | ||
| 143 | /* This function is used for installing the standard key bindings | ||
| 144 | at initialization time. | ||
| 145 | |||
| 146 | For example: | ||
| 147 | |||
| 148 | initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */ | ||
| 149 | |||
| 150 | void | ||
| 151 | initial_define_key (Lisp_Object keymap, int key, const char *defname) | ||
| 152 | { | ||
| 153 | store_in_keymap (keymap, make_fixnum (key), intern_c_string (defname)); | ||
| 154 | } | ||
| 155 | |||
| 156 | void | 127 | void |
| 157 | initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname) | 128 | initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname) |
| 158 | { | 129 | { |
| @@ -1741,28 +1712,6 @@ bindings; see the description of `lookup-key' for more details about this. */) | |||
| 1741 | return Flist (j, maps); | 1712 | return Flist (j, maps); |
| 1742 | } | 1713 | } |
| 1743 | 1714 | ||
| 1744 | DEFUN ("define-prefix-command", Fdefine_prefix_command, Sdefine_prefix_command, 1, 3, 0, | ||
| 1745 | doc: /* Define COMMAND as a prefix command. COMMAND should be a symbol. | ||
| 1746 | A new sparse keymap is stored as COMMAND's function definition and its | ||
| 1747 | value. | ||
| 1748 | This prepares COMMAND for use as a prefix key's binding. | ||
| 1749 | If a second optional argument MAPVAR is given, it should be a symbol. | ||
| 1750 | The map is then stored as MAPVAR's value instead of as COMMAND's | ||
| 1751 | value; but COMMAND is still defined as a function. | ||
| 1752 | The third optional argument NAME, if given, supplies a menu name | ||
| 1753 | string for the map. This is required to use the keymap as a menu. | ||
| 1754 | This function returns COMMAND. */) | ||
| 1755 | (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name) | ||
| 1756 | { | ||
| 1757 | Lisp_Object map = Fmake_sparse_keymap (name); | ||
| 1758 | Ffset (command, map); | ||
| 1759 | if (!NILP (mapvar)) | ||
| 1760 | Fset (mapvar, map); | ||
| 1761 | else | ||
| 1762 | Fset (command, map); | ||
| 1763 | return command; | ||
| 1764 | } | ||
| 1765 | |||
| 1766 | DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0, | 1715 | DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0, |
| 1767 | doc: /* Select KEYMAP as the global keymap. */) | 1716 | doc: /* Select KEYMAP as the global keymap. */) |
| 1768 | (Lisp_Object keymap) | 1717 | (Lisp_Object keymap) |
| @@ -2217,11 +2166,21 @@ See `text-char-description' for describing character codes. */) | |||
| 2217 | { | 2166 | { |
| 2218 | if (NILP (no_angles)) | 2167 | if (NILP (no_angles)) |
| 2219 | { | 2168 | { |
| 2220 | Lisp_Object result; | 2169 | Lisp_Object namestr = SYMBOL_NAME (key); |
| 2221 | char *buffer = SAFE_ALLOCA (sizeof "<>" | 2170 | const char *sym = SSDATA (namestr); |
| 2222 | + SBYTES (SYMBOL_NAME (key))); | 2171 | ptrdiff_t len = SBYTES (namestr); |
| 2223 | esprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key))); | 2172 | /* Find the extent of the modifier prefix, like "C-M-". */ |
| 2224 | result = build_string (buffer); | 2173 | int i = 0; |
| 2174 | while (i < len - 3 && sym[i + 1] == '-' && strchr ("CMSsHA", sym[i])) | ||
| 2175 | i += 2; | ||
| 2176 | /* First I bytes of SYM are modifiers; put <> around the rest. */ | ||
| 2177 | char *buffer = SAFE_ALLOCA (len + 3); | ||
| 2178 | memcpy (buffer, sym, i); | ||
| 2179 | buffer[i] = '<'; | ||
| 2180 | memcpy (buffer + i + 1, sym + i, len - i); | ||
| 2181 | buffer [len + 1] = '>'; | ||
| 2182 | buffer [len + 2] = '\0'; | ||
| 2183 | Lisp_Object result = build_string (buffer); | ||
| 2225 | SAFE_FREE (); | 2184 | SAFE_FREE (); |
| 2226 | return result; | 2185 | return result; |
| 2227 | } | 2186 | } |
| @@ -3195,21 +3154,9 @@ syms_of_keymap (void) | |||
| 3195 | Each one is the value of a Lisp variable, and is also | 3154 | Each one is the value of a Lisp variable, and is also |
| 3196 | pointed to by a C variable */ | 3155 | pointed to by a C variable */ |
| 3197 | 3156 | ||
| 3198 | global_map = Fmake_keymap (Qnil); | 3157 | current_global_map = Qnil; |
| 3199 | Fset (intern_c_string ("global-map"), global_map); | ||
| 3200 | |||
| 3201 | current_global_map = global_map; | ||
| 3202 | staticpro (&global_map); | ||
| 3203 | staticpro (¤t_global_map); | 3158 | staticpro (¤t_global_map); |
| 3204 | 3159 | ||
| 3205 | meta_map = Fmake_keymap (Qnil); | ||
| 3206 | Fset (intern_c_string ("esc-map"), meta_map); | ||
| 3207 | Ffset (intern_c_string ("ESC-prefix"), meta_map); | ||
| 3208 | |||
| 3209 | control_x_map = Fmake_keymap (Qnil); | ||
| 3210 | Fset (intern_c_string ("ctl-x-map"), control_x_map); | ||
| 3211 | Ffset (intern_c_string ("Control-X-prefix"), control_x_map); | ||
| 3212 | |||
| 3213 | exclude_keys = pure_list | 3160 | exclude_keys = pure_list |
| 3214 | (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), | 3161 | (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), |
| 3215 | pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), | 3162 | pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), |
| @@ -3311,7 +3258,6 @@ be preferred. */); | |||
| 3311 | defsubr (&Sminor_mode_key_binding); | 3258 | defsubr (&Sminor_mode_key_binding); |
| 3312 | defsubr (&Sdefine_key); | 3259 | defsubr (&Sdefine_key); |
| 3313 | defsubr (&Slookup_key); | 3260 | defsubr (&Slookup_key); |
| 3314 | defsubr (&Sdefine_prefix_command); | ||
| 3315 | defsubr (&Suse_global_map); | 3261 | defsubr (&Suse_global_map); |
| 3316 | defsubr (&Suse_local_map); | 3262 | defsubr (&Suse_local_map); |
| 3317 | defsubr (&Scurrent_local_map); | 3263 | defsubr (&Scurrent_local_map); |
| @@ -3328,10 +3274,3 @@ be preferred. */); | |||
| 3328 | defsubr (&Swhere_is_internal); | 3274 | defsubr (&Swhere_is_internal); |
| 3329 | defsubr (&Sdescribe_buffer_bindings); | 3275 | defsubr (&Sdescribe_buffer_bindings); |
| 3330 | } | 3276 | } |
| 3331 | |||
| 3332 | void | ||
| 3333 | keys_of_keymap (void) | ||
| 3334 | { | ||
| 3335 | initial_define_key (global_map, 033, "ESC-prefix"); | ||
| 3336 | initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); | ||
| 3337 | } | ||
diff --git a/src/keymap.h b/src/keymap.h index 072c09348e2..f417301c8f2 100644 --- a/src/keymap.h +++ b/src/keymap.h | |||
| @@ -37,10 +37,8 @@ extern char *push_key_description (EMACS_INT, char *); | |||
| 37 | extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, bool, bool, bool); | 37 | extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, bool, bool, bool); |
| 38 | extern Lisp_Object get_keymap (Lisp_Object, bool, bool); | 38 | extern Lisp_Object get_keymap (Lisp_Object, bool, bool); |
| 39 | extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); | 39 | extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); |
| 40 | extern void initial_define_key (Lisp_Object, int, const char *); | ||
| 41 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); | 40 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); |
| 42 | extern void syms_of_keymap (void); | 41 | extern void syms_of_keymap (void); |
| 43 | extern void keys_of_keymap (void); | ||
| 44 | 42 | ||
| 45 | typedef void (*map_keymap_function_t) | 43 | typedef void (*map_keymap_function_t) |
| 46 | (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data); | 44 | (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data); |
diff --git a/src/lisp.h b/src/lisp.h index 0ad788cff84..d139df93424 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1478,8 +1478,8 @@ struct Lisp_String | |||
| 1478 | { | 1478 | { |
| 1479 | struct | 1479 | struct |
| 1480 | { | 1480 | { |
| 1481 | ptrdiff_t size; | 1481 | ptrdiff_t size; /* MSB is used as the markbit. */ |
| 1482 | ptrdiff_t size_byte; | 1482 | ptrdiff_t size_byte; /* Set to -1 for unibyte strings. */ |
| 1483 | INTERVAL intervals; /* Text properties in this string. */ | 1483 | INTERVAL intervals; /* Text properties in this string. */ |
| 1484 | unsigned char *data; | 1484 | unsigned char *data; |
| 1485 | } s; | 1485 | } s; |
| @@ -3561,7 +3561,6 @@ extern void swap_in_global_binding (struct Lisp_Symbol *); | |||
| 3561 | 3561 | ||
| 3562 | /* Defined in cmds.c */ | 3562 | /* Defined in cmds.c */ |
| 3563 | extern void syms_of_cmds (void); | 3563 | extern void syms_of_cmds (void); |
| 3564 | extern void keys_of_cmds (void); | ||
| 3565 | 3564 | ||
| 3566 | /* Defined in coding.c. */ | 3565 | /* Defined in coding.c. */ |
| 3567 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, | 3566 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, |
| @@ -4262,7 +4261,6 @@ extern Lisp_Object get_truename_buffer (Lisp_Object); | |||
| 4262 | extern void init_buffer_once (void); | 4261 | extern void init_buffer_once (void); |
| 4263 | extern void init_buffer (void); | 4262 | extern void init_buffer (void); |
| 4264 | extern void syms_of_buffer (void); | 4263 | extern void syms_of_buffer (void); |
| 4265 | extern void keys_of_buffer (void); | ||
| 4266 | 4264 | ||
| 4267 | /* Defined in marker.c. */ | 4265 | /* Defined in marker.c. */ |
| 4268 | 4266 | ||
| @@ -4359,7 +4357,6 @@ extern void syms_of_callint (void); | |||
| 4359 | /* Defined in casefiddle.c. */ | 4357 | /* Defined in casefiddle.c. */ |
| 4360 | 4358 | ||
| 4361 | extern void syms_of_casefiddle (void); | 4359 | extern void syms_of_casefiddle (void); |
| 4362 | extern void keys_of_casefiddle (void); | ||
| 4363 | 4360 | ||
| 4364 | /* Defined in casetab.c. */ | 4361 | /* Defined in casetab.c. */ |
| 4365 | 4362 | ||
| @@ -4498,8 +4495,8 @@ extern void setup_process_coding_systems (Lisp_Object); | |||
| 4498 | # define CHILD_SETUP_ERROR_DESC "Doing vfork" | 4495 | # define CHILD_SETUP_ERROR_DESC "Doing vfork" |
| 4499 | #endif | 4496 | #endif |
| 4500 | 4497 | ||
| 4501 | extern int emacs_spawn (pid_t *, int, int, int, char **, char **, const char *, | 4498 | extern int emacs_spawn (pid_t *, int, int, int, char **, char **, |
| 4502 | const char *); | 4499 | const char *, const char *, const sigset_t *); |
| 4503 | extern char **make_environment_block (Lisp_Object); | 4500 | extern char **make_environment_block (Lisp_Object); |
| 4504 | extern void init_callproc_1 (void); | 4501 | extern void init_callproc_1 (void); |
| 4505 | extern void init_callproc (void); | 4502 | extern void init_callproc (void); |
diff --git a/src/minibuf.c b/src/minibuf.c index 8b235690199..5ee440f6622 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -2013,9 +2013,6 @@ syms_of_minibuf (void) | |||
| 2013 | DEFSYM (Qminibuffer_setup_hook, "minibuffer-setup-hook"); | 2013 | DEFSYM (Qminibuffer_setup_hook, "minibuffer-setup-hook"); |
| 2014 | DEFSYM (Qminibuffer_exit_hook, "minibuffer-exit-hook"); | 2014 | DEFSYM (Qminibuffer_exit_hook, "minibuffer-exit-hook"); |
| 2015 | 2015 | ||
| 2016 | /* The maximum length of a minibuffer history. */ | ||
| 2017 | DEFSYM (Qhistory_length, "history-length"); | ||
| 2018 | |||
| 2019 | DEFSYM (Qcurrent_input_method, "current-input-method"); | 2016 | DEFSYM (Qcurrent_input_method, "current-input-method"); |
| 2020 | DEFSYM (Qactivate_input_method, "activate-input-method"); | 2017 | DEFSYM (Qactivate_input_method, "activate-input-method"); |
| 2021 | DEFSYM (Qcase_fold_search, "case-fold-search"); | 2018 | DEFSYM (Qcase_fold_search, "case-fold-search"); |
diff --git a/src/nsfns.m b/src/nsfns.m index ee2daea0723..ae114f83e4d 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1485,14 +1485,14 @@ Some window managers may refuse to restack windows. */) | |||
| 1485 | 1485 | ||
| 1486 | if (FRAME_NS_VIEW (f1) && FRAME_NS_VIEW (f2)) | 1486 | if (FRAME_NS_VIEW (f1) && FRAME_NS_VIEW (f2)) |
| 1487 | { | 1487 | { |
| 1488 | NSWindow *window = [FRAME_NS_VIEW (f1) window]; | 1488 | EmacsWindow *window = (EmacsWindow *)[FRAME_NS_VIEW (f1) window]; |
| 1489 | NSInteger window2 = [[FRAME_NS_VIEW (f2) window] windowNumber]; | 1489 | NSWindow *window2 = [FRAME_NS_VIEW (f2) window]; |
| 1490 | NSWindowOrderingMode flag = NILP (above) ? NSWindowBelow : NSWindowAbove; | 1490 | BOOL flag = !NILP (above); |
| 1491 | 1491 | ||
| 1492 | [window orderWindow: flag | 1492 | if ([window restackWindow:window2 above:!NILP (above)]) |
| 1493 | relativeTo: window2]; | 1493 | return Qt; |
| 1494 | 1494 | else | |
| 1495 | return Qt; | 1495 | return Qnil; |
| 1496 | } | 1496 | } |
| 1497 | else | 1497 | else |
| 1498 | { | 1498 | { |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 9b56958100a..8086f56854e 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -145,6 +145,10 @@ ns_update_menubar (struct frame *f, bool deep_p) | |||
| 145 | t = -(1000*tb.time+tb.millitm); | 145 | t = -(1000*tb.time+tb.millitm); |
| 146 | #endif | 146 | #endif |
| 147 | 147 | ||
| 148 | #ifdef NS_IMPL_GNUSTEP | ||
| 149 | deep_p = 1; /* See comment in menuNeedsUpdate. */ | ||
| 150 | #endif | ||
| 151 | |||
| 148 | if (deep_p) | 152 | if (deep_p) |
| 149 | { | 153 | { |
| 150 | /* Make a widget-value tree representing the entire menu trees. */ | 154 | /* Make a widget-value tree representing the entire menu trees. */ |
| @@ -433,21 +437,22 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 433 | } | 437 | } |
| 434 | 438 | ||
| 435 | 439 | ||
| 436 | /* Delegate method called when a submenu is being opened: run a 'deep' call | 440 | /* Delegate method called when a submenu is being opened: run a 'deep' |
| 437 | to set_frame_menubar. */ | 441 | call to ns_update_menubar. */ |
| 438 | |||
| 439 | /* TODO: GNUstep calls this method when the menu is still being built | ||
| 440 | which throws it into an infinite loop. One possible solution is to | ||
| 441 | use menuWillOpen instead, but the Apple docs explicitly warn | ||
| 442 | against changing the contents of the menu in it. I don't know what | ||
| 443 | the right thing to do for GNUstep is. */ | ||
| 444 | - (void)menuNeedsUpdate: (NSMenu *)menu | 442 | - (void)menuNeedsUpdate: (NSMenu *)menu |
| 445 | { | 443 | { |
| 446 | if (!FRAME_LIVE_P (SELECTED_FRAME ())) | 444 | if (!FRAME_LIVE_P (SELECTED_FRAME ())) |
| 447 | return; | 445 | return; |
| 448 | 446 | ||
| 447 | #ifdef NS_IMPL_COCOA | ||
| 448 | /* TODO: GNUstep calls this method when the menu is still being built | ||
| 449 | which results in a recursive stack overflow. One possible solution | ||
| 450 | is to use menuWillOpen instead, but the Apple docs explicitly warn | ||
| 451 | against changing the contents of the menu in it. I don't know what | ||
| 452 | the right thing to do for GNUstep is. */ | ||
| 449 | if (needsUpdate) | 453 | if (needsUpdate) |
| 450 | ns_update_menubar (SELECTED_FRAME (), true); | 454 | ns_update_menubar (SELECTED_FRAME (), true); |
| 455 | #endif | ||
| 451 | } | 456 | } |
| 452 | 457 | ||
| 453 | 458 | ||
diff --git a/src/nsterm.h b/src/nsterm.h index 3fb64494f76..2c9d8e85ba9 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -498,6 +498,7 @@ typedef id instancetype; | |||
| 498 | NSPoint grabOffset; | 498 | NSPoint grabOffset; |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | - (BOOL)restackWindow:(NSWindow *)win above:(BOOL)above; | ||
| 501 | - (void)setAppearance; | 502 | - (void)setAppearance; |
| 502 | @end | 503 | @end |
| 503 | 504 | ||
diff --git a/src/nsterm.m b/src/nsterm.m index 27310639508..2defb9e2eec 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -8693,6 +8693,112 @@ not_in_argv (NSString *arg) | |||
| 8693 | 8693 | ||
| 8694 | @implementation EmacsWindow | 8694 | @implementation EmacsWindow |
| 8695 | 8695 | ||
| 8696 | /* It seems the only way to reorder child frames is by removing them | ||
| 8697 | from the parent and then reattaching them in the correct order. */ | ||
| 8698 | |||
| 8699 | - (void)orderFront:(id)sender | ||
| 8700 | { | ||
| 8701 | NSTRACE ("[EmacsWindow orderFront:]"); | ||
| 8702 | |||
| 8703 | NSWindow *parent = [self parentWindow]; | ||
| 8704 | if (parent) | ||
| 8705 | { | ||
| 8706 | [parent removeChildWindow:self]; | ||
| 8707 | [parent addChildWindow:self ordered:NSWindowAbove]; | ||
| 8708 | } | ||
| 8709 | else | ||
| 8710 | [super orderFront:sender]; | ||
| 8711 | } | ||
| 8712 | |||
| 8713 | - (void)makeKeyAndOrderFront:(id)sender | ||
| 8714 | { | ||
| 8715 | NSTRACE ("[EmacsWindow makeKeyAndOrderFront:]"); | ||
| 8716 | |||
| 8717 | if ([self parentWindow]) | ||
| 8718 | { | ||
| 8719 | [self orderFront:sender]; | ||
| 8720 | [self makeKeyWindow]; | ||
| 8721 | } | ||
| 8722 | else | ||
| 8723 | [super makeKeyAndOrderFront:sender]; | ||
| 8724 | } | ||
| 8725 | |||
| 8726 | |||
| 8727 | /* The array returned by [NSWindow parentWindow] may already be | ||
| 8728 | sorted, but the documentation doesn't tell us whether or not it is, | ||
| 8729 | so to be safe we'll sort it. */ | ||
| 8730 | NSInteger nswindow_orderedIndex_sort (id w1, id w2, void *c) | ||
| 8731 | { | ||
| 8732 | NSInteger i1 = [w1 orderedIndex]; | ||
| 8733 | NSInteger i2 = [w2 orderedIndex]; | ||
| 8734 | |||
| 8735 | if (i1 > i2) | ||
| 8736 | return NSOrderedAscending; | ||
| 8737 | if (i1 < i2) | ||
| 8738 | return NSOrderedDescending; | ||
| 8739 | |||
| 8740 | return NSOrderedSame; | ||
| 8741 | } | ||
| 8742 | |||
| 8743 | - (void)orderBack:(id)sender | ||
| 8744 | { | ||
| 8745 | NSTRACE ("[EmacsWindow orderBack:]"); | ||
| 8746 | |||
| 8747 | NSWindow *parent = [self parentWindow]; | ||
| 8748 | if (parent) | ||
| 8749 | { | ||
| 8750 | NSArray *children = [[parent childWindows] | ||
| 8751 | sortedArrayUsingFunction:nswindow_orderedIndex_sort | ||
| 8752 | context:nil]; | ||
| 8753 | [parent removeChildWindow:self]; | ||
| 8754 | [parent addChildWindow:self ordered:NSWindowAbove]; | ||
| 8755 | |||
| 8756 | for (NSWindow *win in children) | ||
| 8757 | { | ||
| 8758 | if (win != self) | ||
| 8759 | { | ||
| 8760 | [parent removeChildWindow:win]; | ||
| 8761 | [parent addChildWindow:win ordered:NSWindowAbove]; | ||
| 8762 | } | ||
| 8763 | } | ||
| 8764 | } | ||
| 8765 | else | ||
| 8766 | [super orderBack:sender]; | ||
| 8767 | } | ||
| 8768 | |||
| 8769 | - (BOOL)restackWindow:(NSWindow *)win above:(BOOL)above | ||
| 8770 | { | ||
| 8771 | NSTRACE ("[EmacsWindow restackWindow:above:]"); | ||
| 8772 | |||
| 8773 | /* If parent windows don't match we can't restack these frames | ||
| 8774 | without changing the parents. */ | ||
| 8775 | if ([self parentWindow] != [win parentWindow]) | ||
| 8776 | return NO; | ||
| 8777 | else if (![self parentWindow]) | ||
| 8778 | [self orderWindow:(above ? NSWindowAbove : NSWindowBelow) | ||
| 8779 | relativeTo:[win windowNumber]]; | ||
| 8780 | else | ||
| 8781 | { | ||
| 8782 | NSInteger index; | ||
| 8783 | NSWindow *parent = [self parentWindow]; | ||
| 8784 | NSMutableArray *children = [[[parent childWindows] | ||
| 8785 | sortedArrayUsingFunction:nswindow_orderedIndex_sort | ||
| 8786 | context:nil] | ||
| 8787 | mutableCopy]; | ||
| 8788 | [children removeObject:self]; | ||
| 8789 | index = [children indexOfObject:win]; | ||
| 8790 | [children insertObject:self atIndex:(above ? index+1 : index)]; | ||
| 8791 | |||
| 8792 | for (NSWindow *w in children) | ||
| 8793 | { | ||
| 8794 | [parent removeChildWindow:w]; | ||
| 8795 | [parent addChildWindow:w ordered:NSWindowAbove]; | ||
| 8796 | } | ||
| 8797 | } | ||
| 8798 | |||
| 8799 | return YES; | ||
| 8800 | } | ||
| 8801 | |||
| 8696 | #ifdef NS_IMPL_COCOA | 8802 | #ifdef NS_IMPL_COCOA |
| 8697 | - (id)accessibilityAttributeValue:(NSString *)attribute | 8803 | - (id)accessibilityAttributeValue:(NSString *)attribute |
| 8698 | { | 8804 | { |
diff --git a/src/pdumper.c b/src/pdumper.c index 6956ee36829..116cc28dbba 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -2058,7 +2058,7 @@ dump_interval_tree (struct dump_context *ctx, | |||
| 2058 | static dump_off | 2058 | static dump_off |
| 2059 | dump_string (struct dump_context *ctx, const struct Lisp_String *string) | 2059 | dump_string (struct dump_context *ctx, const struct Lisp_String *string) |
| 2060 | { | 2060 | { |
| 2061 | #if CHECK_STRUCTS && !defined (HASH_Lisp_String_86FEA6EC7C) | 2061 | #if CHECK_STRUCTS && !defined (HASH_Lisp_String_348C2B2FDB) |
| 2062 | # error "Lisp_String changed. See CHECK_STRUCTS comment in config.h." | 2062 | # error "Lisp_String changed. See CHECK_STRUCTS comment in config.h." |
| 2063 | #endif | 2063 | #endif |
| 2064 | /* If we have text properties, write them _after_ the string so that | 2064 | /* If we have text properties, write them _after_ the string so that |
diff --git a/src/print.c b/src/print.c index 94a8bcbf882..14af9195475 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1557,7 +1557,8 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, | |||
| 1557 | /* Implement a readable output, e.g.: | 1557 | /* Implement a readable output, e.g.: |
| 1558 | #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ | 1558 | #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ |
| 1559 | /* Always print the size. */ | 1559 | /* Always print the size. */ |
| 1560 | int len = sprintf (buf, "#s(hash-table size %"pD"d", ASIZE (h->next)); | 1560 | int len = sprintf (buf, "#s(hash-table size %"pD"d", |
| 1561 | HASH_TABLE_SIZE (h)); | ||
| 1561 | strout (buf, len, len, printcharfun); | 1562 | strout (buf, len, len, printcharfun); |
| 1562 | 1563 | ||
| 1563 | if (!NILP (h->test.name)) | 1564 | if (!NILP (h->test.name)) |
diff --git a/src/process.c b/src/process.c index 3550f623c6a..25883f911f1 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -692,8 +692,7 @@ status_convert (int w) | |||
| 692 | if (WIFSTOPPED (w)) | 692 | if (WIFSTOPPED (w)) |
| 693 | return Fcons (Qstop, Fcons (make_fixnum (WSTOPSIG (w)), Qnil)); | 693 | return Fcons (Qstop, Fcons (make_fixnum (WSTOPSIG (w)), Qnil)); |
| 694 | else if (WIFEXITED (w)) | 694 | else if (WIFEXITED (w)) |
| 695 | return Fcons (Qexit, Fcons (make_fixnum (WEXITSTATUS (w)), | 695 | return Fcons (Qexit, Fcons (make_fixnum (WEXITSTATUS (w)), Qnil)); |
| 696 | WCOREDUMP (w) ? Qt : Qnil)); | ||
| 697 | else if (WIFSIGNALED (w)) | 696 | else if (WIFSIGNALED (w)) |
| 698 | return Fcons (Qsignal, Fcons (make_fixnum (WTERMSIG (w)), | 697 | return Fcons (Qsignal, Fcons (make_fixnum (WTERMSIG (w)), |
| 699 | WCOREDUMP (w) ? Qt : Qnil)); | 698 | WCOREDUMP (w) ? Qt : Qnil)); |
| @@ -2059,6 +2058,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 2059 | bool pty_flag = 0; | 2058 | bool pty_flag = 0; |
| 2060 | char pty_name[PTY_NAME_SIZE]; | 2059 | char pty_name[PTY_NAME_SIZE]; |
| 2061 | Lisp_Object lisp_pty_name = Qnil; | 2060 | Lisp_Object lisp_pty_name = Qnil; |
| 2061 | sigset_t oldset; | ||
| 2062 | 2062 | ||
| 2063 | inchannel = outchannel = -1; | 2063 | inchannel = outchannel = -1; |
| 2064 | 2064 | ||
| @@ -2139,13 +2139,16 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 2139 | setup_process_coding_systems (process); | 2139 | setup_process_coding_systems (process); |
| 2140 | char **env = make_environment_block (current_dir); | 2140 | char **env = make_environment_block (current_dir); |
| 2141 | 2141 | ||
| 2142 | block_input (); | ||
| 2143 | block_child_signal (&oldset); | ||
| 2144 | |||
| 2142 | pty_flag = p->pty_flag; | 2145 | pty_flag = p->pty_flag; |
| 2143 | eassert (pty_flag == ! NILP (lisp_pty_name)); | 2146 | eassert (pty_flag == ! NILP (lisp_pty_name)); |
| 2144 | 2147 | ||
| 2145 | vfork_errno | 2148 | vfork_errno |
| 2146 | = emacs_spawn (&pid, forkin, forkout, forkerr, new_argv, env, | 2149 | = emacs_spawn (&pid, forkin, forkout, forkerr, new_argv, env, |
| 2147 | SSDATA (current_dir), | 2150 | SSDATA (current_dir), |
| 2148 | pty_flag ? SSDATA (lisp_pty_name) : NULL); | 2151 | pty_flag ? SSDATA (lisp_pty_name) : NULL, &oldset); |
| 2149 | 2152 | ||
| 2150 | eassert ((vfork_errno == 0) == (0 < pid)); | 2153 | eassert ((vfork_errno == 0) == (0 < pid)); |
| 2151 | 2154 | ||
| @@ -2153,6 +2156,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 2153 | if (pid >= 0) | 2156 | if (pid >= 0) |
| 2154 | p->alive = 1; | 2157 | p->alive = 1; |
| 2155 | 2158 | ||
| 2159 | /* Stop blocking in the parent. */ | ||
| 2160 | unblock_child_signal (&oldset); | ||
| 2161 | unblock_input (); | ||
| 2162 | |||
| 2156 | /* Environment block no longer needed. */ | 2163 | /* Environment block no longer needed. */ |
| 2157 | unbind_to (count, Qnil); | 2164 | unbind_to (count, Qnil); |
| 2158 | 2165 | ||
diff --git a/src/terminfo.c b/src/terminfo.c index 15aff317f15..a9c9572bbb2 100644 --- a/src/terminfo.c +++ b/src/terminfo.c | |||
| @@ -23,10 +23,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 23 | 23 | ||
| 24 | /* Define these variables that serve as global parameters to termcap, | 24 | /* Define these variables that serve as global parameters to termcap, |
| 25 | so that we do not need to conditionalize the places in Emacs | 25 | so that we do not need to conditionalize the places in Emacs |
| 26 | that set them. But don't do that for terminfo, as that could | 26 | that set them. But don't do that if terminfo defines them, as that |
| 27 | cause link errors when using -fno-common. */ | 27 | could cause link errors when using -fno-common. */ |
| 28 | 28 | ||
| 29 | #if !TERMINFO | 29 | #ifndef TERMINFO_DEFINES_BC |
| 30 | char *UP, *BC, PC; | 30 | char *UP, *BC, PC; |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
diff --git a/src/window.c b/src/window.c index ba8682eed7c..5e78aa400b5 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -8100,6 +8100,18 @@ and scrolling positions. */) | |||
| 8100 | return Qt; | 8100 | return Qt; |
| 8101 | return Qnil; | 8101 | return Qnil; |
| 8102 | } | 8102 | } |
| 8103 | |||
| 8104 | DEFUN ("window-bump-use-time", Fwindow_bump_use_time, | ||
| 8105 | Swindow_bump_use_time, 1, 1, 0, | ||
| 8106 | doc: /* Mark WINDOW as having been recently used. */) | ||
| 8107 | (Lisp_Object window) | ||
| 8108 | { | ||
| 8109 | struct window *w = decode_valid_window (window); | ||
| 8110 | |||
| 8111 | w->use_time = ++window_select_count; | ||
| 8112 | return Qnil; | ||
| 8113 | } | ||
| 8114 | |||
| 8103 | 8115 | ||
| 8104 | 8116 | ||
| 8105 | static void init_window_once_for_pdumper (void); | 8117 | static void init_window_once_for_pdumper (void); |
| @@ -8573,6 +8585,7 @@ displayed after a scrolling operation to be somewhat inaccurate. */); | |||
| 8573 | defsubr (&Swindow_vscroll); | 8585 | defsubr (&Swindow_vscroll); |
| 8574 | defsubr (&Sset_window_vscroll); | 8586 | defsubr (&Sset_window_vscroll); |
| 8575 | defsubr (&Scompare_window_configurations); | 8587 | defsubr (&Scompare_window_configurations); |
| 8588 | defsubr (&Swindow_bump_use_time); | ||
| 8576 | defsubr (&Swindow_list); | 8589 | defsubr (&Swindow_list); |
| 8577 | defsubr (&Swindow_list_1); | 8590 | defsubr (&Swindow_list_1); |
| 8578 | defsubr (&Swindow_prev_buffers); | 8591 | defsubr (&Swindow_prev_buffers); |
| @@ -8583,14 +8596,3 @@ displayed after a scrolling operation to be somewhat inaccurate. */); | |||
| 8583 | defsubr (&Swindow_parameter); | 8596 | defsubr (&Swindow_parameter); |
| 8584 | defsubr (&Sset_window_parameter); | 8597 | defsubr (&Sset_window_parameter); |
| 8585 | } | 8598 | } |
| 8586 | |||
| 8587 | void | ||
| 8588 | keys_of_window (void) | ||
| 8589 | { | ||
| 8590 | initial_define_key (control_x_map, '<', "scroll-left"); | ||
| 8591 | initial_define_key (control_x_map, '>', "scroll-right"); | ||
| 8592 | |||
| 8593 | initial_define_key (global_map, Ctl ('V'), "scroll-up-command"); | ||
| 8594 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); | ||
| 8595 | initial_define_key (meta_map, 'v', "scroll-down-command"); | ||
| 8596 | } | ||
diff --git a/src/window.h b/src/window.h index fba98f438c4..fbdec0df997 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -1202,7 +1202,6 @@ extern bool window_outdated (struct window *); | |||
| 1202 | extern void init_window_once (void); | 1202 | extern void init_window_once (void); |
| 1203 | extern void init_window (void); | 1203 | extern void init_window (void); |
| 1204 | extern void syms_of_window (void); | 1204 | extern void syms_of_window (void); |
| 1205 | extern void keys_of_window (void); | ||
| 1206 | /* Move cursor to row/column position VPOS/HPOS, pixel coordinates | 1205 | /* Move cursor to row/column position VPOS/HPOS, pixel coordinates |
| 1207 | Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y | 1206 | Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y |
| 1208 | are window-relative pixel positions. This is always done during | 1207 | are window-relative pixel positions. This is always done during |
diff --git a/src/xdisp.c b/src/xdisp.c index b0f218dcb35..d070c5ae5cd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4262,6 +4262,7 @@ handle_fontified_prop (struct it *it) | |||
| 4262 | if (!STRINGP (it->string) | 4262 | if (!STRINGP (it->string) |
| 4263 | && it->s == NULL | 4263 | && it->s == NULL |
| 4264 | && !NILP (Vfontification_functions) | 4264 | && !NILP (Vfontification_functions) |
| 4265 | && !(input_was_pending && redisplay_skip_fontification_on_input) | ||
| 4265 | && !NILP (Vrun_hooks) | 4266 | && !NILP (Vrun_hooks) |
| 4266 | && (pos = make_fixnum (IT_CHARPOS (*it)), | 4267 | && (pos = make_fixnum (IT_CHARPOS (*it)), |
| 4267 | prop = Fget_char_property (pos, Qfontified, Qnil), | 4268 | prop = Fget_char_property (pos, Qfontified, Qnil), |
| @@ -25508,7 +25509,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) | |||
| 25508 | if (start < i) | 25509 | if (start < i) |
| 25509 | display_string (NULL, | 25510 | display_string (NULL, |
| 25510 | Fsubstring (mode_string, make_fixnum (start), | 25511 | Fsubstring (mode_string, make_fixnum (start), |
| 25511 | make_fixnum (i - 1)), | 25512 | make_fixnum (i)), |
| 25512 | Qnil, 0, 0, &it, 0, 0, 0, | 25513 | Qnil, 0, 0, &it, 0, 0, 0, |
| 25513 | STRING_MULTIBYTE (mode_string)); | 25514 | STRING_MULTIBYTE (mode_string)); |
| 25514 | } | 25515 | } |
| @@ -35613,6 +35614,19 @@ best except in special circumstances such as running redisplay tests | |||
| 35613 | in batch mode. */); | 35614 | in batch mode. */); |
| 35614 | redisplay_skip_initial_frame = true; | 35615 | redisplay_skip_initial_frame = true; |
| 35615 | 35616 | ||
| 35617 | DEFVAR_BOOL ("redisplay-skip-fontification-on-input", | ||
| 35618 | redisplay_skip_fontification_on_input, | ||
| 35619 | doc: /* Skip `fontification_functions` when there is input pending. | ||
| 35620 | If non-nil and there was input pending at the beginning of the command, | ||
| 35621 | the `fontification_functions` hook is not run. This usually does not | ||
| 35622 | affect the display because redisplay is completely skipped anyway if input | ||
| 35623 | was pending, but it can make scrolling smoother by avoiding | ||
| 35624 | unnecessary fontification. | ||
| 35625 | It is similar to `fast-but-imprecise-scrolling' with similar tradeoffs, | ||
| 35626 | but with the advantage that it should only affect the behavior when Emacs | ||
| 35627 | has trouble keeping up with the incoming input rate. */); | ||
| 35628 | redisplay_skip_fontification_on_input = false; | ||
| 35629 | |||
| 35616 | DEFVAR_BOOL ("redisplay-adhoc-scroll-in-resize-mini-windows", | 35630 | DEFVAR_BOOL ("redisplay-adhoc-scroll-in-resize-mini-windows", |
| 35617 | redisplay_adhoc_scroll_in_resize_mini_windows, | 35631 | redisplay_adhoc_scroll_in_resize_mini_windows, |
| 35618 | doc: /* If nil always use normal scrolling in minibuffer windows. | 35632 | doc: /* If nil always use normal scrolling in minibuffer windows. |
diff --git a/src/xterm.c b/src/xterm.c index 0a86738cc20..b8374fed8b1 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -13035,13 +13035,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 13035 | or larger than other for other applications, even if it is the same | 13035 | or larger than other for other applications, even if it is the same |
| 13036 | font name (monospace-10 for example). */ | 13036 | font name (monospace-10 for example). */ |
| 13037 | 13037 | ||
| 13038 | # ifdef HAVE_XRENDER | ||
| 13038 | int event_base, error_base; | 13039 | int event_base, error_base; |
| 13039 | char *v; | ||
| 13040 | double d; | ||
| 13041 | |||
| 13042 | XRenderQueryExtension (dpyinfo->display, &event_base, &error_base); | 13040 | XRenderQueryExtension (dpyinfo->display, &event_base, &error_base); |
| 13041 | # endif | ||
| 13043 | 13042 | ||
| 13044 | v = XGetDefault (dpyinfo->display, "Xft", "dpi"); | 13043 | char *v = XGetDefault (dpyinfo->display, "Xft", "dpi"); |
| 13044 | double d; | ||
| 13045 | if (v != NULL && sscanf (v, "%lf", &d) == 1) | 13045 | if (v != NULL && sscanf (v, "%lf", &d) == 1) |
| 13046 | dpyinfo->resy = dpyinfo->resx = d; | 13046 | dpyinfo->resy = dpyinfo->resx = d; |
| 13047 | } | 13047 | } |