diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 80 | ||||
| -rw-r--r-- | src/alloc.c | 50 | ||||
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/frame.h | 74 | ||||
| -rw-r--r-- | src/keyboard.c | 124 | ||||
| -rw-r--r-- | src/lisp.h | 20 | ||||
| -rw-r--r-- | src/minibuf.c | 4 | ||||
| -rw-r--r-- | src/process.c | 13 | ||||
| -rw-r--r-- | src/w32.h | 1 | ||||
| -rw-r--r-- | src/w32font.c | 149 | ||||
| -rw-r--r-- | src/window.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 13 |
13 files changed, 417 insertions, 141 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index b908ef005d6..80415abe40d 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -1245,20 +1245,36 @@ document xbacktrace | |||
| 1245 | an error was signaled. | 1245 | an error was signaled. |
| 1246 | end | 1246 | end |
| 1247 | 1247 | ||
| 1248 | define which | 1248 | define xprintbytestr |
| 1249 | set debug_print (which_symbols ($arg0)) | 1249 | set $data = (char *) $arg0->data |
| 1250 | printf "Bytecode: " | ||
| 1251 | output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) | ||
| 1252 | end | ||
| 1253 | document xprintbytestr | ||
| 1254 | Print a string of byte code. | ||
| 1255 | end | ||
| 1256 | |||
| 1257 | define xwhichsymbols | ||
| 1258 | set $output_debug = print_output_debug_flag | ||
| 1259 | set print_output_debug_flag = 0 | ||
| 1260 | set safe_debug_print (which_symbols ($arg0, $arg1)) | ||
| 1261 | set print_output_debug_flag = $output_debug | ||
| 1250 | end | 1262 | end |
| 1251 | document which | 1263 | document xwhichsymbols |
| 1252 | Print symbols which references a given lisp object | 1264 | Print symbols which references a given lisp object |
| 1253 | either as its symbol value or symbol function. | 1265 | either as its symbol value or symbol function. |
| 1266 | Call with two arguments: the lisp object and the | ||
| 1267 | maximum number of symbols referencing it to produce. | ||
| 1254 | end | 1268 | end |
| 1255 | 1269 | ||
| 1256 | define xbytecode | 1270 | define xbytecode |
| 1257 | set $bt = byte_stack_list | 1271 | set $bt = byte_stack_list |
| 1258 | while $bt | 1272 | while $bt |
| 1259 | xgettype ($bt->byte_string) | 1273 | xgetptr $bt->byte_string |
| 1260 | printf "0x%x => ", $bt->byte_string | 1274 | set $ptr = (struct Lisp_String *) $ptr |
| 1261 | which $bt->byte_string | 1275 | xprintbytestr $ptr |
| 1276 | printf "\n0x%x => ", $bt->byte_string | ||
| 1277 | xwhichsymbols $bt->byte_string 5 | ||
| 1262 | set $bt = $bt->next | 1278 | set $bt = $bt->next |
| 1263 | end | 1279 | end |
| 1264 | end | 1280 | end |
diff --git a/src/ChangeLog b/src/ChangeLog index a13039896dd..272354c48d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2011-10-27 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix integer width and related bugs (Bug#9874). | 3 | Fix integer width and related bugs (Bug#9874). |
| 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): | 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): |
| @@ -786,6 +786,80 @@ | |||
| 786 | rather than rolling our own approximation. | 786 | rather than rolling our own approximation. |
| 787 | (SCROLL_BAR_VEC_SIZE): Remove; not used. | 787 | (SCROLL_BAR_VEC_SIZE): Remove; not used. |
| 788 | 788 | ||
| 789 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 790 | |||
| 791 | * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE, | ||
| 792 | so that this new function doesn't get optimized away by a | ||
| 793 | whole-program optimizer. Make the 2nd arg EMACS_INT, not int. | ||
| 794 | |||
| 795 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 796 | |||
| 797 | * frame.h (MOUSE_HL_INFO): Remove excess parens. | ||
| 798 | |||
| 799 | 2011-10-29 Eli Zaretskii <eliz@gnu.org> | ||
| 800 | |||
| 801 | Fix the `xbytecode' command. | ||
| 802 | * .gdbinit (xprintbytestr): New command. | ||
| 803 | (xwhichsymbols): Renamed from `which'; all callers changed. | ||
| 804 | (xbytecode): Print the byte-code string as well. | ||
| 805 | |||
| 806 | 2011-10-29 Kim Storm <storm@cua.dk> | ||
| 807 | |||
| 808 | * alloc.c (which_symbols): New function. | ||
| 809 | |||
| 810 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 811 | |||
| 812 | * minibuf.c (read_minibuf_noninteractive): Allow reading empty | ||
| 813 | line. (Bug#9903) | ||
| 814 | |||
| 815 | 2011-10-29 Glenn Morris <rgm@gnu.org> | ||
| 816 | |||
| 817 | * process.c (wait_reading_process_output): Revert 2009-08-30 change. | ||
| 818 | Not clear what it was for, and it causes various bugs. (Bug#9839) | ||
| 819 | |||
| 820 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 821 | |||
| 822 | * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a | ||
| 823 | possible random value that matches one of those tested as | ||
| 824 | condition to clear the mouse face. | ||
| 825 | |||
| 826 | 2011-10-28 Chong Yidong <cyd@gnu.org> | ||
| 827 | |||
| 828 | * xdisp.c (note_mouse_highlight): Fix use of uninitialized var. | ||
| 829 | |||
| 830 | 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 831 | |||
| 832 | * window.c (make_window): Initialize phys_cursor_on_p. | ||
| 833 | |||
| 834 | 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 835 | |||
| 836 | * lisp.h (struct Lisp_Symbol): Update comments. | ||
| 837 | |||
| 838 | 2011-10-28 Juanma Barranquero <lekktu@gmail.com> | ||
| 839 | |||
| 840 | * w32font.c (w32_load_unicows_or_gdi32): Add missing return. | ||
| 841 | |||
| 842 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 843 | |||
| 844 | Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem | ||
| 845 | <oslsachem@gmail.com> for helping to debug this. | ||
| 846 | |||
| 847 | * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w) | ||
| 848 | (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w) | ||
| 849 | (g_b_init_get_glyph_outline_w): New static variables. | ||
| 850 | (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc) | ||
| 851 | (GetGlyphOutlineW_Proc): New typedefs. | ||
| 852 | (w32_load_unicows_or_gdi32, get_outline_metrics_w) | ||
| 853 | (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font): | ||
| 854 | New functions. | ||
| 855 | (w32font_open_internal, compute_metrics): | ||
| 856 | Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w | ||
| 857 | instead of calling the "wide" APIs directly. | ||
| 858 | |||
| 859 | * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font. | ||
| 860 | |||
| 861 | * w32.h (syms_of_w32font): Add prototype. | ||
| 862 | |||
| 789 | 2011-10-27 Juanma Barranquero <lekktu@gmail.com> | 863 | 2011-10-27 Juanma Barranquero <lekktu@gmail.com> |
| 790 | 864 | ||
| 791 | * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end) | 865 | * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end) |
| @@ -806,8 +880,8 @@ | |||
| 806 | 880 | ||
| 807 | 2011-10-27 Chong Yidong <cyd@gnu.org> | 881 | 2011-10-27 Chong Yidong <cyd@gnu.org> |
| 808 | 882 | ||
| 809 | * gnutls.c (emacs_gnutls_deinit): New function. Deallocate | 883 | * gnutls.c (emacs_gnutls_deinit): New function. |
| 810 | credentials structures as well as calling gnutls_deinit. | 884 | Deallocate credentials structures as well as calling gnutls_deinit. |
| 811 | (Fgnutls_deinit, Fgnutls_boot): Use it. | 885 | (Fgnutls_deinit, Fgnutls_boot): Use it. |
| 812 | 886 | ||
| 813 | * process.c (make_process): Initialize GnuTLS credentials to NULL. | 887 | * process.c (make_process): Initialize GnuTLS credentials to NULL. |
diff --git a/src/alloc.c b/src/alloc.c index ee49a2dfb2e..86127dd5197 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -279,6 +279,7 @@ static void compact_small_strings (void); | |||
| 279 | static void free_large_strings (void); | 279 | static void free_large_strings (void); |
| 280 | static void sweep_strings (void); | 280 | static void sweep_strings (void); |
| 281 | static void free_misc (Lisp_Object); | 281 | static void free_misc (Lisp_Object); |
| 282 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; | ||
| 282 | 283 | ||
| 283 | /* When scanning the C stack for live Lisp objects, Emacs keeps track | 284 | /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 284 | of what memory allocated via lisp_malloc is intended for what | 285 | of what memory allocated via lisp_malloc is intended for what |
| @@ -6251,6 +6252,55 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6251 | return Flist (8, consed); | 6252 | return Flist (8, consed); |
| 6252 | } | 6253 | } |
| 6253 | 6254 | ||
| 6255 | /* Find at most FIND_MAX symbols which have OBJ as their value or | ||
| 6256 | function. This is used in gdbinit's `xwhichsymbols' command. */ | ||
| 6257 | |||
| 6258 | Lisp_Object | ||
| 6259 | which_symbols (Lisp_Object obj, EMACS_INT find_max) | ||
| 6260 | { | ||
| 6261 | struct symbol_block *sblk; | ||
| 6262 | ptrdiff_t gc_count = inhibit_garbage_collection (); | ||
| 6263 | Lisp_Object found = Qnil; | ||
| 6264 | |||
| 6265 | if (!EQ (obj, Vdead)) | ||
| 6266 | { | ||
| 6267 | for (sblk = symbol_block; sblk; sblk = sblk->next) | ||
| 6268 | { | ||
| 6269 | struct Lisp_Symbol *sym = sblk->symbols; | ||
| 6270 | int bn; | ||
| 6271 | |||
| 6272 | for (bn = 0; bn < SYMBOL_BLOCK_SIZE; bn++, sym++) | ||
| 6273 | { | ||
| 6274 | Lisp_Object val; | ||
| 6275 | Lisp_Object tem; | ||
| 6276 | |||
| 6277 | if (sblk == symbol_block && bn >= symbol_block_index) | ||
| 6278 | break; | ||
| 6279 | |||
| 6280 | XSETSYMBOL (tem, sym); | ||
| 6281 | val = find_symbol_value (tem); | ||
| 6282 | if (EQ (val, obj) | ||
| 6283 | || EQ (sym->function, obj) | ||
| 6284 | || (!NILP (sym->function) | ||
| 6285 | && COMPILEDP (sym->function) | ||
| 6286 | && EQ (AREF (sym->function, COMPILED_BYTECODE), obj)) | ||
| 6287 | || (!NILP (val) | ||
| 6288 | && COMPILEDP (val) | ||
| 6289 | && EQ (AREF (val, COMPILED_BYTECODE), obj))) | ||
| 6290 | { | ||
| 6291 | found = Fcons (tem, found); | ||
| 6292 | if (--find_max == 0) | ||
| 6293 | goto out; | ||
| 6294 | } | ||
| 6295 | } | ||
| 6296 | } | ||
| 6297 | } | ||
| 6298 | |||
| 6299 | out: | ||
| 6300 | unbind_to (gc_count, Qnil); | ||
| 6301 | return found; | ||
| 6302 | } | ||
| 6303 | |||
| 6254 | #ifdef ENABLE_CHECKING | 6304 | #ifdef ENABLE_CHECKING |
| 6255 | int suppress_checking; | 6305 | int suppress_checking; |
| 6256 | 6306 | ||
diff --git a/src/emacs.c b/src/emacs.c index 0f7aa94c24f..5f3d126e13e 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1591,6 +1591,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1591 | /* Initialization that must be done even if the global variable | 1591 | /* Initialization that must be done even if the global variable |
| 1592 | initialized is non zero. */ | 1592 | initialized is non zero. */ |
| 1593 | #ifdef HAVE_NTGUI | 1593 | #ifdef HAVE_NTGUI |
| 1594 | globals_of_w32font (); | ||
| 1594 | globals_of_w32fns (); | 1595 | globals_of_w32fns (); |
| 1595 | globals_of_w32menu (); | 1596 | globals_of_w32menu (); |
| 1596 | globals_of_w32select (); | 1597 | globals_of_w32select (); |
diff --git a/src/frame.h b/src/frame.h index 3d2b8208ddd..574da5c3b52 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -538,12 +538,12 @@ typedef struct frame *FRAME_PTR; | |||
| 538 | does not have FRAME_X_DISPLAY_INFO. */ | 538 | does not have FRAME_X_DISPLAY_INFO. */ |
| 539 | #ifdef HAVE_WINDOW_SYSTEM | 539 | #ifdef HAVE_WINDOW_SYSTEM |
| 540 | # define MOUSE_HL_INFO(F) \ | 540 | # define MOUSE_HL_INFO(F) \ |
| 541 | (FRAME_WINDOW_P(F) \ | 541 | (FRAME_WINDOW_P(F) \ |
| 542 | ? &(FRAME_X_DISPLAY_INFO(F)->mouse_highlight) \ | 542 | ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight \ |
| 543 | : &(((F)->output_data.tty->display_info)->mouse_highlight)) | 543 | : &(F)->output_data.tty->display_info->mouse_highlight) |
| 544 | #else | 544 | #else |
| 545 | # define MOUSE_HL_INFO(F) \ | 545 | # define MOUSE_HL_INFO(F) \ |
| 546 | (&(((F)->output_data.tty->display_info)->mouse_highlight)) | 546 | (&(F)->output_data.tty->display_info->mouse_highlight) |
| 547 | #endif | 547 | #endif |
| 548 | 548 | ||
| 549 | /* Nonzero if frame F is still alive (not deleted). */ | 549 | /* Nonzero if frame F is still alive (not deleted). */ |
| @@ -594,7 +594,7 @@ typedef struct frame *FRAME_PTR; | |||
| 594 | /* Lines above the top-most window in frame F. */ | 594 | /* Lines above the top-most window in frame F. */ |
| 595 | 595 | ||
| 596 | #define FRAME_TOP_MARGIN(F) \ | 596 | #define FRAME_TOP_MARGIN(F) \ |
| 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) | 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) |
| 598 | 598 | ||
| 599 | /* Pixel height of the top margin above. */ | 599 | /* Pixel height of the top margin above. */ |
| 600 | 600 | ||
| @@ -659,11 +659,11 @@ typedef struct frame *FRAME_PTR; | |||
| 659 | and which side they are on. */ | 659 | and which side they are on. */ |
| 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) | 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) |
| 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ | 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ |
| 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) | 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) |
| 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ | 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ |
| 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) | 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) |
| 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ | 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ |
| 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) | 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) |
| 667 | 667 | ||
| 668 | /* Width that a scroll bar in frame F should have, if there is one. | 668 | /* Width that a scroll bar in frame F should have, if there is one. |
| 669 | Measured in pixels. | 669 | Measured in pixels. |
| @@ -680,13 +680,13 @@ typedef struct frame *FRAME_PTR; | |||
| 680 | the right in this frame, or there are no scroll bars, value is 0. */ | 680 | the right in this frame, or there are no scroll bars, value is 0. */ |
| 681 | 681 | ||
| 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ | 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ |
| 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 685 | : 0) | 685 | : 0) |
| 686 | 686 | ||
| 687 | /* Width of a left scroll bar in frame F, measured in pixels */ | 687 | /* Width of a left scroll bar in frame F, measured in pixels */ |
| 688 | 688 | ||
| 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ | 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 692 | : 0) | 692 | : 0) |
| @@ -696,13 +696,13 @@ typedef struct frame *FRAME_PTR; | |||
| 696 | the left in this frame, or there are no scroll bars, value is 0. */ | 696 | the left in this frame, or there are no scroll bars, value is 0. */ |
| 697 | 697 | ||
| 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ | 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ |
| 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 701 | : 0) | 701 | : 0) |
| 702 | 702 | ||
| 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ | 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ |
| 704 | 704 | ||
| 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ | 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 708 | : 0) | 708 | : 0) |
| @@ -710,9 +710,9 @@ typedef struct frame *FRAME_PTR; | |||
| 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ | 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ |
| 711 | 711 | ||
| 712 | #define FRAME_SCROLL_BAR_COLS(f) \ | 712 | #define FRAME_SCROLL_BAR_COLS(f) \ |
| 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ | 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ |
| 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 715 | : 0) | 715 | : 0) |
| 716 | 716 | ||
| 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ | 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ |
| 718 | 718 | ||
| @@ -731,21 +731,21 @@ typedef struct frame *FRAME_PTR; | |||
| 731 | not including scroll bars and fringes. */ | 731 | not including scroll bars and fringes. */ |
| 732 | 732 | ||
| 733 | #define SET_FRAME_COLS(f, val) \ | 733 | #define SET_FRAME_COLS(f, val) \ |
| 734 | (FRAME_COLS (f) = (val), \ | 734 | (FRAME_COLS (f) = (val), \ |
| 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) | 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) |
| 736 | 736 | ||
| 737 | /* Given a value WIDTH for frame F's nominal width, | 737 | /* Given a value WIDTH for frame F's nominal width, |
| 738 | return the value that FRAME_TOTAL_COLS should have. */ | 738 | return the value that FRAME_TOTAL_COLS should have. */ |
| 739 | 739 | ||
| 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ | 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ |
| 741 | ((width) \ | 741 | ((width) \ |
| 742 | + FRAME_SCROLL_BAR_COLS (f) \ | 742 | + FRAME_SCROLL_BAR_COLS (f) \ |
| 743 | + FRAME_FRINGE_COLS (f)) | 743 | + FRAME_FRINGE_COLS (f)) |
| 744 | 744 | ||
| 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ | 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ |
| 746 | 746 | ||
| 747 | #define FRAME_CURSOR_X_LIMIT(f) \ | 747 | #define FRAME_CURSOR_X_LIMIT(f) \ |
| 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) | 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) |
| 749 | 749 | ||
| 750 | /* Nonzero if frame F has scroll bars. */ | 750 | /* Nonzero if frame F has scroll bars. */ |
| 751 | 751 | ||
| @@ -938,18 +938,18 @@ extern Lisp_Object selected_frame; | |||
| 938 | float. Value is a C integer. */ | 938 | float. Value is a C integer. */ |
| 939 | 939 | ||
| 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ | 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ |
| 941 | (INTEGERP (X) \ | 941 | (INTEGERP (X) \ |
| 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ | 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ |
| 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) | 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) |
| 944 | 944 | ||
| 945 | /* Convert canonical value Y to pixels. F is the frame whose | 945 | /* Convert canonical value Y to pixels. F is the frame whose |
| 946 | canonical character height is to be used. X must be a Lisp integer | 946 | canonical character height is to be used. X must be a Lisp integer |
| 947 | or float. Value is a C integer. */ | 947 | or float. Value is a C integer. */ |
| 948 | 948 | ||
| 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ | 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ |
| 950 | (INTEGERP (Y) \ | 950 | (INTEGERP (Y) \ |
| 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ | 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ |
| 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) | 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) |
| 953 | 953 | ||
| 954 | /* Convert pixel-value X to canonical units. F is the frame whose | 954 | /* Convert pixel-value X to canonical units. F is the frame whose |
| 955 | canonical character width is to be used. X is a C integer. Result | 955 | canonical character width is to be used. X is a C integer. Result |
| @@ -957,9 +957,9 @@ extern Lisp_Object selected_frame; | |||
| 957 | otherwise it's a Lisp integer. */ | 957 | otherwise it's a Lisp integer. */ |
| 958 | 958 | ||
| 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ | 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ |
| 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ | 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ |
| 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ | 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ |
| 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) | 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) |
| 963 | 963 | ||
| 964 | /* Convert pixel-value Y to canonical units. F is the frame whose | 964 | /* Convert pixel-value Y to canonical units. F is the frame whose |
| 965 | canonical character height is to be used. Y is a C integer. | 965 | canonical character height is to be used. Y is a C integer. |
| @@ -967,9 +967,9 @@ extern Lisp_Object selected_frame; | |||
| 967 | otherwise it's a Lisp integer. */ | 967 | otherwise it's a Lisp integer. */ |
| 968 | 968 | ||
| 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ | 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ |
| 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ | 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ |
| 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ | 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ |
| 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) | 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) |
| 973 | 973 | ||
| 974 | 974 | ||
| 975 | 975 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index f5a3ef07829..239028c8bad 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -73,7 +73,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 73 | #include "nsterm.h" | 73 | #include "nsterm.h" |
| 74 | #endif | 74 | #endif |
| 75 | 75 | ||
| 76 | /* Variables for blockinput.h: */ | 76 | /* Variables for blockinput.h: */ |
| 77 | 77 | ||
| 78 | /* Non-zero if interrupt input is blocked right now. */ | 78 | /* Non-zero if interrupt input is blocked right now. */ |
| 79 | volatile int interrupt_input_blocked; | 79 | volatile int interrupt_input_blocked; |
| @@ -338,7 +338,7 @@ static Lisp_Object Qconfig_changed_event; | |||
| 338 | Lisp_Object Qevent_kind; | 338 | Lisp_Object Qevent_kind; |
| 339 | static Lisp_Object Qevent_symbol_elements; | 339 | static Lisp_Object Qevent_symbol_elements; |
| 340 | 340 | ||
| 341 | /* menu and tool bar item parts */ | 341 | /* Menu and tool bar item parts. */ |
| 342 | static Lisp_Object Qmenu_enable; | 342 | static Lisp_Object Qmenu_enable; |
| 343 | static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; | 343 | static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; |
| 344 | Lisp_Object QCfilter; | 344 | Lisp_Object QCfilter; |
| @@ -833,7 +833,7 @@ recursive_edit_unwind (Lisp_Object buffer) | |||
| 833 | 833 | ||
| 834 | 834 | ||
| 835 | #if 0 /* These two functions are now replaced with | 835 | #if 0 /* These two functions are now replaced with |
| 836 | temporarily_switch_to_single_kboard. */ | 836 | temporarily_switch_to_single_kboard. */ |
| 837 | static void | 837 | static void |
| 838 | any_kboard_state () | 838 | any_kboard_state () |
| 839 | { | 839 | { |
| @@ -1036,7 +1036,7 @@ cmd_error (Lisp_Object data) | |||
| 1036 | Vquit_flag = Qnil; | 1036 | Vquit_flag = Qnil; |
| 1037 | 1037 | ||
| 1038 | Vinhibit_quit = Qnil; | 1038 | Vinhibit_quit = Qnil; |
| 1039 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 1039 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 1040 | if (command_loop_level == 0 && minibuf_level == 0) | 1040 | if (command_loop_level == 0 && minibuf_level == 0) |
| 1041 | any_kboard_state (); | 1041 | any_kboard_state (); |
| 1042 | #endif | 1042 | #endif |
| @@ -1129,7 +1129,7 @@ command_loop (void) | |||
| 1129 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 1129 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 1130 | /* Reset single_kboard in case top-level set it while | 1130 | /* Reset single_kboard in case top-level set it while |
| 1131 | evaluating an -f option, or we are stuck there for some | 1131 | evaluating an -f option, or we are stuck there for some |
| 1132 | other reason. */ | 1132 | other reason. */ |
| 1133 | any_kboard_state (); | 1133 | any_kboard_state (); |
| 1134 | #endif | 1134 | #endif |
| 1135 | internal_catch (Qtop_level, command_loop_2, Qnil); | 1135 | internal_catch (Qtop_level, command_loop_2, Qnil); |
| @@ -1490,8 +1490,8 @@ command_loop_1 (void) | |||
| 1490 | if (!NILP (Vquit_flag)) | 1490 | if (!NILP (Vquit_flag)) |
| 1491 | { | 1491 | { |
| 1492 | Vexecuting_kbd_macro = Qt; | 1492 | Vexecuting_kbd_macro = Qt; |
| 1493 | QUIT; /* Make some noise. */ | 1493 | QUIT; /* Make some noise. */ |
| 1494 | /* Will return since macro now empty. */ | 1494 | /* Will return since macro now empty. */ |
| 1495 | } | 1495 | } |
| 1496 | } | 1496 | } |
| 1497 | 1497 | ||
| @@ -1510,7 +1510,7 @@ command_loop_1 (void) | |||
| 1510 | Vdisable_point_adjustment = Qnil; | 1510 | Vdisable_point_adjustment = Qnil; |
| 1511 | 1511 | ||
| 1512 | /* Process filters and timers may have messed with deactivate-mark. | 1512 | /* Process filters and timers may have messed with deactivate-mark. |
| 1513 | reset it before we execute the command. */ | 1513 | reset it before we execute the command. */ |
| 1514 | Vdeactivate_mark = Qnil; | 1514 | Vdeactivate_mark = Qnil; |
| 1515 | 1515 | ||
| 1516 | /* Remap command through active keymaps. */ | 1516 | /* Remap command through active keymaps. */ |
| @@ -1550,7 +1550,7 @@ command_loop_1 (void) | |||
| 1550 | } | 1550 | } |
| 1551 | else | 1551 | else |
| 1552 | { | 1552 | { |
| 1553 | /* Here for a command that isn't executed directly */ | 1553 | /* Here for a command that isn't executed directly. */ |
| 1554 | 1554 | ||
| 1555 | #ifdef HAVE_WINDOW_SYSTEM | 1555 | #ifdef HAVE_WINDOW_SYSTEM |
| 1556 | ptrdiff_t scount = SPECPDL_INDEX (); | 1556 | ptrdiff_t scount = SPECPDL_INDEX (); |
| @@ -1958,7 +1958,7 @@ void | |||
| 1958 | poll_for_input_1 (void) | 1958 | poll_for_input_1 (void) |
| 1959 | { | 1959 | { |
| 1960 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid | 1960 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid |
| 1961 | doing anything dangerous. */ | 1961 | doing anything dangerous. */ |
| 1962 | #ifdef HAVE_NS | 1962 | #ifdef HAVE_NS |
| 1963 | ++handling_signal; | 1963 | ++handling_signal; |
| 1964 | #endif | 1964 | #endif |
| @@ -1998,7 +1998,7 @@ start_polling (void) | |||
| 1998 | #ifdef POLL_FOR_INPUT | 1998 | #ifdef POLL_FOR_INPUT |
| 1999 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 1999 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2000 | but read_socket_hook is not global anymore. Let's pretend that | 2000 | but read_socket_hook is not global anymore. Let's pretend that |
| 2001 | it's always set. */ | 2001 | it's always set. */ |
| 2002 | if (!interrupt_input) | 2002 | if (!interrupt_input) |
| 2003 | { | 2003 | { |
| 2004 | /* Turn alarm handling on unconditionally. It might have | 2004 | /* Turn alarm handling on unconditionally. It might have |
| @@ -2035,7 +2035,7 @@ input_polling_used (void) | |||
| 2035 | #ifdef POLL_FOR_INPUT | 2035 | #ifdef POLL_FOR_INPUT |
| 2036 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 2036 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2037 | but read_socket_hook is not global anymore. Let's pretend that | 2037 | but read_socket_hook is not global anymore. Let's pretend that |
| 2038 | it's always set. */ | 2038 | it's always set. */ |
| 2039 | return !interrupt_input; | 2039 | return !interrupt_input; |
| 2040 | #else | 2040 | #else |
| 2041 | return 0; | 2041 | return 0; |
| @@ -2050,7 +2050,7 @@ stop_polling (void) | |||
| 2050 | #ifdef POLL_FOR_INPUT | 2050 | #ifdef POLL_FOR_INPUT |
| 2051 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 2051 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2052 | but read_socket_hook is not global anymore. Let's pretend that | 2052 | but read_socket_hook is not global anymore. Let's pretend that |
| 2053 | it's always set. */ | 2053 | it's always set. */ |
| 2054 | if (!interrupt_input) | 2054 | if (!interrupt_input) |
| 2055 | ++poll_suppress_count; | 2055 | ++poll_suppress_count; |
| 2056 | #endif | 2056 | #endif |
| @@ -2388,7 +2388,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2388 | real event came from. Normally, a switch-frame event selects | 2388 | real event came from. Normally, a switch-frame event selects |
| 2389 | internal_last_event_frame after each command is read, but | 2389 | internal_last_event_frame after each command is read, but |
| 2390 | events read from a macro should never cause a new frame to be | 2390 | events read from a macro should never cause a new frame to be |
| 2391 | selected. */ | 2391 | selected. */ |
| 2392 | Vlast_event_frame = internal_last_event_frame = Qmacro; | 2392 | Vlast_event_frame = internal_last_event_frame = Qmacro; |
| 2393 | 2393 | ||
| 2394 | /* Exit the macro if we are at the end. | 2394 | /* Exit the macro if we are at the end. |
| @@ -2498,7 +2498,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2498 | Try this before the sit-for, because the sit-for | 2498 | Try this before the sit-for, because the sit-for |
| 2499 | would do the wrong thing if we are supposed to do | 2499 | would do the wrong thing if we are supposed to do |
| 2500 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading | 2500 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading |
| 2501 | after a mouse event so don't try a minibuf menu. */ | 2501 | after a mouse event so don't try a minibuf menu. */ |
| 2502 | c = Qnil; | 2502 | c = Qnil; |
| 2503 | if (nmaps > 0 && INTERACTIVE | 2503 | if (nmaps > 0 && INTERACTIVE |
| 2504 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) | 2504 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) |
| @@ -4980,8 +4980,8 @@ static const char *const lispy_function_keys[] = | |||
| 4980 | "break", /* 0xff6b */ | 4980 | "break", /* 0xff6b */ |
| 4981 | 4981 | ||
| 4982 | 0, 0, 0, 0, | 4982 | 0, 0, 0, 0, |
| 4983 | 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */ | 4983 | 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */ |
| 4984 | 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */ | 4984 | 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */ |
| 4985 | "kp-space", /* 0xff80 */ /* IsKeypadKey */ | 4985 | "kp-space", /* 0xff80 */ /* IsKeypadKey */ |
| 4986 | 0, 0, 0, 0, 0, 0, 0, 0, | 4986 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 4987 | "kp-tab", /* 0xff89 */ | 4987 | "kp-tab", /* 0xff89 */ |
| @@ -5093,14 +5093,14 @@ static Lisp_Object *const scroll_bar_parts[] = { | |||
| 5093 | static Lisp_Object button_down_location; | 5093 | static Lisp_Object button_down_location; |
| 5094 | 5094 | ||
| 5095 | /* Information about the most recent up-going button event: Which | 5095 | /* Information about the most recent up-going button event: Which |
| 5096 | button, what location, and what time. */ | 5096 | button, what location, and what time. */ |
| 5097 | 5097 | ||
| 5098 | static int last_mouse_button; | 5098 | static int last_mouse_button; |
| 5099 | static int last_mouse_x; | 5099 | static int last_mouse_x; |
| 5100 | static int last_mouse_y; | 5100 | static int last_mouse_y; |
| 5101 | static Time button_down_time; | 5101 | static Time button_down_time; |
| 5102 | 5102 | ||
| 5103 | /* The number of clicks in this multiple-click. */ | 5103 | /* The number of clicks in this multiple-click. */ |
| 5104 | 5104 | ||
| 5105 | static int double_click_count; | 5105 | static int double_click_count; |
| 5106 | 5106 | ||
| @@ -5344,7 +5344,7 @@ make_lispy_event (struct input_event *event) | |||
| 5344 | 5344 | ||
| 5345 | #ifdef HAVE_NS | 5345 | #ifdef HAVE_NS |
| 5346 | /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs, | 5346 | /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs, |
| 5347 | except that they are non-key events (last-nonmenu-event is nil). */ | 5347 | except that they are non-key events (last-nonmenu-event is nil). */ |
| 5348 | case NS_NONKEY_EVENT: | 5348 | case NS_NONKEY_EVENT: |
| 5349 | #endif | 5349 | #endif |
| 5350 | 5350 | ||
| @@ -5831,7 +5831,7 @@ make_lispy_event (struct input_event *event) | |||
| 5831 | Fcons (make_number (event->timestamp), | 5831 | Fcons (make_number (event->timestamp), |
| 5832 | Fcons (part, Qnil))))); | 5832 | Fcons (part, Qnil))))); |
| 5833 | 5833 | ||
| 5834 | /* Always treat scroll bar events as clicks. */ | 5834 | /* Always treat scroll bar events as clicks. */ |
| 5835 | event->modifiers |= click_modifier; | 5835 | event->modifiers |= click_modifier; |
| 5836 | event->modifiers &= ~up_modifier; | 5836 | event->modifiers &= ~up_modifier; |
| 5837 | 5837 | ||
| @@ -6698,7 +6698,7 @@ lucid_event_type_list_p (Lisp_Object object) | |||
| 6698 | If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal | 6698 | If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal |
| 6699 | events (FOCUS_IN_EVENT). | 6699 | events (FOCUS_IN_EVENT). |
| 6700 | If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse | 6700 | If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse |
| 6701 | movements and toolkit scroll bar thumb drags. */ | 6701 | movements and toolkit scroll bar thumb drags. */ |
| 6702 | 6702 | ||
| 6703 | static void | 6703 | static void |
| 6704 | get_input_pending (int *addr, int flags) | 6704 | get_input_pending (int *addr, int flags) |
| @@ -6732,7 +6732,7 @@ gobble_input (int expected) | |||
| 6732 | #ifdef POLL_FOR_INPUT | 6732 | #ifdef POLL_FOR_INPUT |
| 6733 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 6733 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 6734 | but read_socket_hook is not global anymore. Let's pretend that | 6734 | but read_socket_hook is not global anymore. Let's pretend that |
| 6735 | it's always set. */ | 6735 | it's always set. */ |
| 6736 | if (!interrupt_input && poll_suppress_count == 0) | 6736 | if (!interrupt_input && poll_suppress_count == 0) |
| 6737 | { | 6737 | { |
| 6738 | SIGMASKTYPE mask; | 6738 | SIGMASKTYPE mask; |
| @@ -6807,7 +6807,7 @@ read_avail_input (int expected) | |||
| 6807 | if (store_user_signal_events ()) | 6807 | if (store_user_signal_events ()) |
| 6808 | expected = 0; | 6808 | expected = 0; |
| 6809 | 6809 | ||
| 6810 | /* Loop through the available terminals, and call their input hooks. */ | 6810 | /* Loop through the available terminals, and call their input hooks. */ |
| 6811 | t = terminal_list; | 6811 | t = terminal_list; |
| 6812 | while (t) | 6812 | while (t) |
| 6813 | { | 6813 | { |
| @@ -6828,15 +6828,15 @@ read_avail_input (int expected) | |||
| 6828 | expected = 0; | 6828 | expected = 0; |
| 6829 | } | 6829 | } |
| 6830 | 6830 | ||
| 6831 | if (nr == -1) /* Not OK to read input now. */ | 6831 | if (nr == -1) /* Not OK to read input now. */ |
| 6832 | { | 6832 | { |
| 6833 | err = 1; | 6833 | err = 1; |
| 6834 | } | 6834 | } |
| 6835 | else if (nr == -2) /* Non-transient error. */ | 6835 | else if (nr == -2) /* Non-transient error. */ |
| 6836 | { | 6836 | { |
| 6837 | /* The terminal device terminated; it should be closed. */ | 6837 | /* The terminal device terminated; it should be closed. */ |
| 6838 | 6838 | ||
| 6839 | /* Kill Emacs if this was our last terminal. */ | 6839 | /* Kill Emacs if this was our last terminal. */ |
| 6840 | if (!terminal_list->next_terminal) | 6840 | if (!terminal_list->next_terminal) |
| 6841 | /* Formerly simply reported no input, but that | 6841 | /* Formerly simply reported no input, but that |
| 6842 | sometimes led to a failure of Emacs to terminate. | 6842 | sometimes led to a failure of Emacs to terminate. |
| @@ -6848,7 +6848,7 @@ read_avail_input (int expected) | |||
| 6848 | alone in its group. */ | 6848 | alone in its group. */ |
| 6849 | kill (getpid (), SIGHUP); | 6849 | kill (getpid (), SIGHUP); |
| 6850 | 6850 | ||
| 6851 | /* XXX Is calling delete_terminal safe here? It calls delete_frame. */ | 6851 | /* XXX Is calling delete_terminal safe here? It calls delete_frame. */ |
| 6852 | { | 6852 | { |
| 6853 | Lisp_Object tmp; | 6853 | Lisp_Object tmp; |
| 6854 | XSETTERMINAL (tmp, t); | 6854 | XSETTERMINAL (tmp, t); |
| @@ -6938,7 +6938,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6938 | return 0; | 6938 | return 0; |
| 6939 | #endif /* subprocesses */ | 6939 | #endif /* subprocesses */ |
| 6940 | 6940 | ||
| 6941 | if (!terminal->name) /* Don't read from a dead terminal. */ | 6941 | if (!terminal->name) /* Don't read from a dead terminal. */ |
| 6942 | return 0; | 6942 | return 0; |
| 6943 | 6943 | ||
| 6944 | if (terminal->type != output_termcap | 6944 | if (terminal->type != output_termcap |
| @@ -6946,15 +6946,15 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6946 | abort (); | 6946 | abort (); |
| 6947 | 6947 | ||
| 6948 | /* XXX I think the following code should be moved to separate hook | 6948 | /* XXX I think the following code should be moved to separate hook |
| 6949 | functions in system-dependent files. */ | 6949 | functions in system-dependent files. */ |
| 6950 | #ifdef WINDOWSNT | 6950 | #ifdef WINDOWSNT |
| 6951 | return 0; | 6951 | return 0; |
| 6952 | #else /* not WINDOWSNT */ | 6952 | #else /* not WINDOWSNT */ |
| 6953 | if (! tty->term_initted) /* In case we get called during bootstrap. */ | 6953 | if (! tty->term_initted) /* In case we get called during bootstrap. */ |
| 6954 | return 0; | 6954 | return 0; |
| 6955 | 6955 | ||
| 6956 | if (! tty->input) | 6956 | if (! tty->input) |
| 6957 | return 0; /* The terminal is suspended. */ | 6957 | return 0; /* The terminal is suspended. */ |
| 6958 | 6958 | ||
| 6959 | #ifdef MSDOS | 6959 | #ifdef MSDOS |
| 6960 | n_to_read = dos_keysns (); | 6960 | n_to_read = dos_keysns (); |
| @@ -6980,7 +6980,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6980 | Gpm_GetEvent closes gpm_fd and clears it to -1, which is why | 6980 | Gpm_GetEvent closes gpm_fd and clears it to -1, which is why |
| 6981 | we save it in `fd' so close_gpm can remove it from the | 6981 | we save it in `fd' so close_gpm can remove it from the |
| 6982 | select masks. | 6982 | select masks. |
| 6983 | gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ | 6983 | gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ |
| 6984 | while (gpm = Gpm_GetEvent (&event), gpm == 1) { | 6984 | while (gpm = Gpm_GetEvent (&event), gpm == 1) { |
| 6985 | nread += handle_one_term_event (tty, &event, &gpm_hold_quit); | 6985 | nread += handle_one_term_event (tty, &event, &gpm_hold_quit); |
| 6986 | } | 6986 | } |
| @@ -7000,7 +7000,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7000 | if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) | 7000 | if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) |
| 7001 | { | 7001 | { |
| 7002 | if (! noninteractive) | 7002 | if (! noninteractive) |
| 7003 | return -2; /* Close this terminal. */ | 7003 | return -2; /* Close this terminal. */ |
| 7004 | else | 7004 | else |
| 7005 | n_to_read = 0; | 7005 | n_to_read = 0; |
| 7006 | } | 7006 | } |
| @@ -7033,16 +7033,16 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7033 | process group won't get SIGHUP's at logout time. BSDI adheres to | 7033 | process group won't get SIGHUP's at logout time. BSDI adheres to |
| 7034 | this part standard and returns -1 from read (0) with errno==EIO | 7034 | this part standard and returns -1 from read (0) with errno==EIO |
| 7035 | when the control tty is taken away. | 7035 | when the control tty is taken away. |
| 7036 | Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ | 7036 | Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ |
| 7037 | if (nread == -1 && errno == EIO) | 7037 | if (nread == -1 && errno == EIO) |
| 7038 | return -2; /* Close this terminal. */ | 7038 | return -2; /* Close this terminal. */ |
| 7039 | #if defined (AIX) && defined (_BSD) | 7039 | #if defined (AIX) && defined (_BSD) |
| 7040 | /* The kernel sometimes fails to deliver SIGHUP for ptys. | 7040 | /* The kernel sometimes fails to deliver SIGHUP for ptys. |
| 7041 | This looks incorrect, but it isn't, because _BSD causes | 7041 | This looks incorrect, but it isn't, because _BSD causes |
| 7042 | O_NDELAY to be defined in fcntl.h as O_NONBLOCK, | 7042 | O_NDELAY to be defined in fcntl.h as O_NONBLOCK, |
| 7043 | and that causes a value other than 0 when there is no input. */ | 7043 | and that causes a value other than 0 when there is no input. */ |
| 7044 | if (nread == 0) | 7044 | if (nread == 0) |
| 7045 | return -2; /* Close this terminal. */ | 7045 | return -2; /* Close this terminal. */ |
| 7046 | #endif | 7046 | #endif |
| 7047 | } | 7047 | } |
| 7048 | while ( | 7048 | while ( |
| @@ -7120,7 +7120,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7120 | buf.code = cbuf[i]; | 7120 | buf.code = cbuf[i]; |
| 7121 | /* Set the frame corresponding to the active tty. Note that the | 7121 | /* Set the frame corresponding to the active tty. Note that the |
| 7122 | value of selected_frame is not reliable here, redisplay tends | 7122 | value of selected_frame is not reliable here, redisplay tends |
| 7123 | to temporarily change it. */ | 7123 | to temporarily change it. */ |
| 7124 | buf.frame_or_window = tty->top_frame; | 7124 | buf.frame_or_window = tty->top_frame; |
| 7125 | buf.arg = Qnil; | 7125 | buf.arg = Qnil; |
| 7126 | 7126 | ||
| @@ -7143,7 +7143,7 @@ handle_async_input (void) | |||
| 7143 | pending_signals = pending_atimers; | 7143 | pending_signals = pending_atimers; |
| 7144 | #endif | 7144 | #endif |
| 7145 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid | 7145 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid |
| 7146 | doing anything dangerous. */ | 7146 | doing anything dangerous. */ |
| 7147 | #ifdef HAVE_NS | 7147 | #ifdef HAVE_NS |
| 7148 | ++handling_signal; | 7148 | ++handling_signal; |
| 7149 | #endif | 7149 | #endif |
| @@ -7201,7 +7201,7 @@ input_available_signal (int signo) | |||
| 7201 | This function exists so that the UNBLOCK_INPUT macro in | 7201 | This function exists so that the UNBLOCK_INPUT macro in |
| 7202 | blockinput.h can have some way to take care of input we put off | 7202 | blockinput.h can have some way to take care of input we put off |
| 7203 | dealing with, without assuming that every file which uses | 7203 | dealing with, without assuming that every file which uses |
| 7204 | UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ | 7204 | UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ |
| 7205 | void | 7205 | void |
| 7206 | reinvoke_input_signal (void) | 7206 | reinvoke_input_signal (void) |
| 7207 | { | 7207 | { |
| @@ -7228,7 +7228,7 @@ struct user_signal_info | |||
| 7228 | struct user_signal_info *next; | 7228 | struct user_signal_info *next; |
| 7229 | }; | 7229 | }; |
| 7230 | 7230 | ||
| 7231 | /* List of user signals. */ | 7231 | /* List of user signals. */ |
| 7232 | static struct user_signal_info *user_signals = NULL; | 7232 | static struct user_signal_info *user_signals = NULL; |
| 7233 | 7233 | ||
| 7234 | void | 7234 | void |
| @@ -7765,7 +7765,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7765 | { | 7765 | { |
| 7766 | tem = XCAR (item); | 7766 | tem = XCAR (item); |
| 7767 | if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) | 7767 | if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) |
| 7768 | /* Be GC protected. Set keyhint to item instead of tem. */ | 7768 | /* Be GC protected. Set keyhint to item instead of tem. */ |
| 7769 | keyhint = item; | 7769 | keyhint = item; |
| 7770 | } | 7770 | } |
| 7771 | else if (EQ (tem, QCkeys)) | 7771 | else if (EQ (tem, QCkeys)) |
| @@ -7848,7 +7848,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7848 | if (inmenubar > 0) | 7848 | if (inmenubar > 0) |
| 7849 | return 1; | 7849 | return 1; |
| 7850 | 7850 | ||
| 7851 | { /* This is a command. See if there is an equivalent key binding. */ | 7851 | { /* This is a command. See if there is an equivalent key binding. */ |
| 7852 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); | 7852 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); |
| 7853 | 7853 | ||
| 7854 | /* The previous code preferred :key-sequence to :keys, so we | 7854 | /* The previous code preferred :key-sequence to :keys, so we |
| @@ -8405,7 +8405,7 @@ append_tool_bar_item (void) | |||
| 8405 | These are done in different ways, depending on how the input will be read. | 8405 | These are done in different ways, depending on how the input will be read. |
| 8406 | Menus using X are done after auto-saving in read-char, getting the input | 8406 | Menus using X are done after auto-saving in read-char, getting the input |
| 8407 | event from Fx_popup_menu; menus using the minibuf use read_char recursively | 8407 | event from Fx_popup_menu; menus using the minibuf use read_char recursively |
| 8408 | and do auto-saving in the inner call of read_char. */ | 8408 | and do auto-saving in the inner call of read_char. */ |
| 8409 | 8409 | ||
| 8410 | static Lisp_Object | 8410 | static Lisp_Object |
| 8411 | read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, | 8411 | read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, |
| @@ -8625,14 +8625,14 @@ read_char_minibuf_menu_prompt (int commandflag, | |||
| 8625 | tem | 8625 | tem |
| 8626 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ]; | 8626 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ]; |
| 8627 | if (!NILP (tem)) | 8627 | if (!NILP (tem)) |
| 8628 | /* Insert equivalent keybinding. */ | 8628 | /* Insert equivalent keybinding. */ |
| 8629 | s = concat2 (s, tem); | 8629 | s = concat2 (s, tem); |
| 8630 | #endif | 8630 | #endif |
| 8631 | tem | 8631 | tem |
| 8632 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; | 8632 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; |
| 8633 | if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) | 8633 | if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) |
| 8634 | { | 8634 | { |
| 8635 | /* Insert button prefix. */ | 8635 | /* Insert button prefix. */ |
| 8636 | Lisp_Object selected | 8636 | Lisp_Object selected |
| 8637 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; | 8637 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; |
| 8638 | if (EQ (tem, QCradio)) | 8638 | if (EQ (tem, QCradio)) |
| @@ -8866,7 +8866,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey, | |||
| 8866 | 8866 | ||
| 8867 | /* If keybuf[fkey->start..fkey->end] is bound in the | 8867 | /* If keybuf[fkey->start..fkey->end] is bound in the |
| 8868 | map and we're in a position to do the key remapping, replace it with | 8868 | map and we're in a position to do the key remapping, replace it with |
| 8869 | the binding and restart with fkey->start at the end. */ | 8869 | the binding and restart with fkey->start at the end. */ |
| 8870 | if ((VECTORP (next) || STRINGP (next)) && doit) | 8870 | if ((VECTORP (next) || STRINGP (next)) && doit) |
| 8871 | { | 8871 | { |
| 8872 | int len = XFASTINT (Flength (next)); | 8872 | int len = XFASTINT (Flength (next)); |
| @@ -9030,7 +9030,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9030 | 9030 | ||
| 9031 | /* Non-zero if we are trying to map a key by changing an upper-case | 9031 | /* Non-zero if we are trying to map a key by changing an upper-case |
| 9032 | letter to lower case, or a shifted function key to an unshifted | 9032 | letter to lower case, or a shifted function key to an unshifted |
| 9033 | one. */ | 9033 | one. */ |
| 9034 | int shift_translated = 0; | 9034 | int shift_translated = 0; |
| 9035 | 9035 | ||
| 9036 | /* If we receive a `switch-frame' or `select-window' event in the middle of | 9036 | /* If we receive a `switch-frame' or `select-window' event in the middle of |
| @@ -9038,7 +9038,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9038 | While we're reading, we keep the event here. */ | 9038 | While we're reading, we keep the event here. */ |
| 9039 | Lisp_Object delayed_switch_frame; | 9039 | Lisp_Object delayed_switch_frame; |
| 9040 | 9040 | ||
| 9041 | /* See the comment below... */ | 9041 | /* See the comment below... */ |
| 9042 | #if defined (GOBBLE_FIRST_EVENT) | 9042 | #if defined (GOBBLE_FIRST_EVENT) |
| 9043 | Lisp_Object first_event; | 9043 | Lisp_Object first_event; |
| 9044 | #endif | 9044 | #endif |
| @@ -9313,7 +9313,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9313 | if (!found) | 9313 | if (!found) |
| 9314 | { | 9314 | { |
| 9315 | /* Don't touch interrupted_kboard when it's been | 9315 | /* Don't touch interrupted_kboard when it's been |
| 9316 | deleted. */ | 9316 | deleted. */ |
| 9317 | delayed_switch_frame = Qnil; | 9317 | delayed_switch_frame = Qnil; |
| 9318 | goto replay_entire_sequence; | 9318 | goto replay_entire_sequence; |
| 9319 | } | 9319 | } |
| @@ -9421,7 +9421,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9421 | { | 9421 | { |
| 9422 | /* If we're at the beginning of a key sequence, and the caller | 9422 | /* If we're at the beginning of a key sequence, and the caller |
| 9423 | says it's okay, go ahead and return this event. If we're | 9423 | says it's okay, go ahead and return this event. If we're |
| 9424 | in the midst of a key sequence, delay it until the end. */ | 9424 | in the midst of a key sequence, delay it until the end. */ |
| 9425 | if (t > 0 || !can_return_switch_frame) | 9425 | if (t > 0 || !can_return_switch_frame) |
| 9426 | { | 9426 | { |
| 9427 | delayed_switch_frame = key; | 9427 | delayed_switch_frame = key; |
| @@ -9718,7 +9718,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9718 | Down-clicks are eliminated. | 9718 | Down-clicks are eliminated. |
| 9719 | Double-downs reduce to downs, then are eliminated. | 9719 | Double-downs reduce to downs, then are eliminated. |
| 9720 | Triple-downs reduce to double-downs, then to downs, | 9720 | Triple-downs reduce to double-downs, then to downs, |
| 9721 | then are eliminated. */ | 9721 | then are eliminated. */ |
| 9722 | if (modifiers & (down_modifier | drag_modifier | 9722 | if (modifiers & (down_modifier | drag_modifier |
| 9723 | | double_modifier | triple_modifier)) | 9723 | | double_modifier | triple_modifier)) |
| 9724 | { | 9724 | { |
| @@ -10827,7 +10827,7 @@ set_waiting_for_input (struct timeval *time_to_clear) | |||
| 10827 | waiting_for_input = 1; | 10827 | waiting_for_input = 1; |
| 10828 | 10828 | ||
| 10829 | /* If handle_interrupt was called before and buffered a C-g, | 10829 | /* If handle_interrupt was called before and buffered a C-g, |
| 10830 | make it run again now, to avoid timing error. */ | 10830 | make it run again now, to avoid timing error. */ |
| 10831 | if (!NILP (Vquit_flag)) | 10831 | if (!NILP (Vquit_flag)) |
| 10832 | quit_throw_to_read_char (); | 10832 | quit_throw_to_read_char (); |
| 10833 | } | 10833 | } |
| @@ -10848,7 +10848,7 @@ clear_waiting_for_input (void) | |||
| 10848 | 10848 | ||
| 10849 | static void | 10849 | static void |
| 10850 | interrupt_signal (int signalnum) /* If we don't have an argument, some */ | 10850 | interrupt_signal (int signalnum) /* If we don't have an argument, some */ |
| 10851 | /* compilers complain in signal calls. */ | 10851 | /* compilers complain in signal calls. */ |
| 10852 | { | 10852 | { |
| 10853 | /* Must preserve main program's value of errno. */ | 10853 | /* Must preserve main program's value of errno. */ |
| 10854 | int old_errno = errno; | 10854 | int old_errno = errno; |
| @@ -10856,12 +10856,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ | |||
| 10856 | 10856 | ||
| 10857 | SIGNAL_THREAD_CHECK (signalnum); | 10857 | SIGNAL_THREAD_CHECK (signalnum); |
| 10858 | 10858 | ||
| 10859 | /* See if we have an active terminal on our controlling tty. */ | 10859 | /* See if we have an active terminal on our controlling tty. */ |
| 10860 | terminal = get_named_tty ("/dev/tty"); | 10860 | terminal = get_named_tty ("/dev/tty"); |
| 10861 | if (!terminal) | 10861 | if (!terminal) |
| 10862 | { | 10862 | { |
| 10863 | /* If there are no frames there, let's pretend that we are a | 10863 | /* If there are no frames there, let's pretend that we are a |
| 10864 | well-behaving UN*X program and quit. */ | 10864 | well-behaving UN*X program and quit. */ |
| 10865 | Fkill_emacs (Qnil); | 10865 | Fkill_emacs (Qnil); |
| 10866 | } | 10866 | } |
| 10867 | else | 10867 | else |
| @@ -10889,7 +10889,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ | |||
| 10889 | 10889 | ||
| 10890 | Otherwise it sets the Lisp variable quit-flag not-nil. This causes | 10890 | Otherwise it sets the Lisp variable quit-flag not-nil. This causes |
| 10891 | eval to throw, when it gets a chance. If quit-flag is already | 10891 | eval to throw, when it gets a chance. If quit-flag is already |
| 10892 | non-nil, it stops the job right away. */ | 10892 | non-nil, it stops the job right away. */ |
| 10893 | 10893 | ||
| 10894 | static void | 10894 | static void |
| 10895 | handle_interrupt (void) | 10895 | handle_interrupt (void) |
| @@ -10898,7 +10898,7 @@ handle_interrupt (void) | |||
| 10898 | 10898 | ||
| 10899 | cancel_echoing (); | 10899 | cancel_echoing (); |
| 10900 | 10900 | ||
| 10901 | /* XXX This code needs to be revised for multi-tty support. */ | 10901 | /* XXX This code needs to be revised for multi-tty support. */ |
| 10902 | if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) | 10902 | if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) |
| 10903 | { | 10903 | { |
| 10904 | /* If SIGINT isn't blocked, don't let us be interrupted by | 10904 | /* If SIGINT isn't blocked, don't let us be interrupted by |
| @@ -11008,7 +11008,7 @@ handle_interrupt (void) | |||
| 11008 | wait_reading_process_output() under HAVE_NS because of the call | 11008 | wait_reading_process_output() under HAVE_NS because of the call |
| 11009 | to ns_select there (needed because otherwise events aren't picked up | 11009 | to ns_select there (needed because otherwise events aren't picked up |
| 11010 | outside of polling since we don't get SIGIO like X and we don't have a | 11010 | outside of polling since we don't get SIGIO like X and we don't have a |
| 11011 | separate event loop thread like W32. */ | 11011 | separate event loop thread like W32. */ |
| 11012 | #ifndef HAVE_NS | 11012 | #ifndef HAVE_NS |
| 11013 | if (waiting_for_input && !echoing) | 11013 | if (waiting_for_input && !echoing) |
| 11014 | quit_throw_to_read_char (); | 11014 | quit_throw_to_read_char (); |
| @@ -11457,7 +11457,7 @@ init_keyboard (void) | |||
| 11457 | session may have multiple display types, so we always handle | 11457 | session may have multiple display types, so we always handle |
| 11458 | SIGINT. There is special code in interrupt_signal to exit | 11458 | SIGINT. There is special code in interrupt_signal to exit |
| 11459 | Emacs on SIGINT when there are no termcap frames on the | 11459 | Emacs on SIGINT when there are no termcap frames on the |
| 11460 | controlling terminal. */ | 11460 | controlling terminal. */ |
| 11461 | signal (SIGINT, interrupt_signal); | 11461 | signal (SIGINT, interrupt_signal); |
| 11462 | #ifndef DOS_NT | 11462 | #ifndef DOS_NT |
| 11463 | /* For systems with SysV TERMIO, C-g is set up for both SIGINT and | 11463 | /* For systems with SysV TERMIO, C-g is set up for both SIGINT and |
| @@ -12254,7 +12254,7 @@ Currently, the only supported values for this | |||
| 12254 | variable are `sigusr1' and `sigusr2'. */); | 12254 | variable are `sigusr1' and `sigusr2'. */); |
| 12255 | Vdebug_on_event = intern_c_string ("sigusr2"); | 12255 | Vdebug_on_event = intern_c_string ("sigusr2"); |
| 12256 | 12256 | ||
| 12257 | /* Create the initial keyboard. */ | 12257 | /* Create the initial keyboard. */ |
| 12258 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | 12258 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
| 12259 | init_kboard (initial_kboard); | 12259 | init_kboard (initial_kboard); |
| 12260 | /* Vwindow_system is left at t for now. */ | 12260 | /* Vwindow_system is left at t for now. */ |
diff --git a/src/lisp.h b/src/lisp.h index 17f1705675e..7b1be98bd22 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -162,7 +162,7 @@ extern int suppress_checking EXTERNALLY_VISIBLE; | |||
| 162 | 162 | ||
| 163 | /* First, try and define DECL_ALIGN(type,var) which declares a static | 163 | /* First, try and define DECL_ALIGN(type,var) which declares a static |
| 164 | variable VAR of type TYPE with the added requirement that it be | 164 | variable VAR of type TYPE with the added requirement that it be |
| 165 | TYPEBITS-aligned. */ | 165 | TYPEBITS-aligned. */ |
| 166 | #ifndef NO_DECL_ALIGN | 166 | #ifndef NO_DECL_ALIGN |
| 167 | # ifndef DECL_ALIGN | 167 | # ifndef DECL_ALIGN |
| 168 | # if HAVE_ATTRIBUTE_ALIGNED | 168 | # if HAVE_ATTRIBUTE_ALIGNED |
| @@ -1089,11 +1089,9 @@ enum symbol_redirect | |||
| 1089 | SYMBOL_PLAINVAL = 4, | 1089 | SYMBOL_PLAINVAL = 4, |
| 1090 | SYMBOL_VARALIAS = 1, | 1090 | SYMBOL_VARALIAS = 1, |
| 1091 | SYMBOL_LOCALIZED = 2, | 1091 | SYMBOL_LOCALIZED = 2, |
| 1092 | SYMBOL_FORWARDED = 3 | 1092 | SYMBOL_FORWARDED = 3 |
| 1093 | }; | 1093 | }; |
| 1094 | 1094 | ||
| 1095 | /* In a symbol, the markbit of the plist is used as the gc mark bit */ | ||
| 1096 | |||
| 1097 | struct Lisp_Symbol | 1095 | struct Lisp_Symbol |
| 1098 | { | 1096 | { |
| 1099 | unsigned gcmarkbit : 1; | 1097 | unsigned gcmarkbit : 1; |
| @@ -1102,8 +1100,7 @@ struct Lisp_Symbol | |||
| 1102 | 0 : it's a plain var, the value is in the `value' field. | 1100 | 0 : it's a plain var, the value is in the `value' field. |
| 1103 | 1 : it's a varalias, the value is really in the `alias' symbol. | 1101 | 1 : it's a varalias, the value is really in the `alias' symbol. |
| 1104 | 2 : it's a localized var, the value is in the `blv' object. | 1102 | 2 : it's a localized var, the value is in the `blv' object. |
| 1105 | 3 : it's a forwarding variable, the value is in `forward'. | 1103 | 3 : it's a forwarding variable, the value is in `forward'. */ |
| 1106 | */ | ||
| 1107 | enum symbol_redirect redirect : 3; | 1104 | enum symbol_redirect redirect : 3; |
| 1108 | 1105 | ||
| 1109 | /* Non-zero means symbol is constant, i.e. changing its value | 1106 | /* Non-zero means symbol is constant, i.e. changing its value |
| @@ -1120,15 +1117,12 @@ struct Lisp_Symbol | |||
| 1120 | unsigned declared_special : 1; | 1117 | unsigned declared_special : 1; |
| 1121 | 1118 | ||
| 1122 | /* The symbol's name, as a Lisp string. | 1119 | /* The symbol's name, as a Lisp string. |
| 1123 | |||
| 1124 | The name "xname" is used to intentionally break code referring to | 1120 | The name "xname" is used to intentionally break code referring to |
| 1125 | the old field "name" of type pointer to struct Lisp_String. */ | 1121 | the old field "name" of type pointer to struct Lisp_String. */ |
| 1126 | Lisp_Object xname; | 1122 | Lisp_Object xname; |
| 1127 | 1123 | ||
| 1128 | /* Value of the symbol or Qunbound if unbound. If this symbol is a | 1124 | /* Value of the symbol or Qunbound if unbound. Which alternative of the |
| 1129 | defvaralias, `alias' contains the symbol for which it is an | 1125 | union is used depends on the `redirect' field above. */ |
| 1130 | alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get | ||
| 1131 | and set a symbol's value, to take defvaralias into account. */ | ||
| 1132 | union { | 1126 | union { |
| 1133 | Lisp_Object value; | 1127 | Lisp_Object value; |
| 1134 | struct Lisp_Symbol *alias; | 1128 | struct Lisp_Symbol *alias; |
| @@ -1323,7 +1317,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */ | |||
| 1323 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ | 1317 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ |
| 1324 | unsigned gcmarkbit : 1; | 1318 | unsigned gcmarkbit : 1; |
| 1325 | int spacer : 15; | 1319 | int spacer : 15; |
| 1326 | /* Make it as long as "Lisp_Free without padding". */ | 1320 | /* Make it as long as "Lisp_Free without padding". */ |
| 1327 | void *fill; | 1321 | void *fill; |
| 1328 | }; | 1322 | }; |
| 1329 | 1323 | ||
| @@ -3635,7 +3629,7 @@ extern void init_system_name (void); | |||
| 3635 | 3629 | ||
| 3636 | #define SWITCH_ENUM_CAST(x) (x) | 3630 | #define SWITCH_ENUM_CAST(x) (x) |
| 3637 | 3631 | ||
| 3638 | /* Use this to suppress gcc's warnings. */ | 3632 | /* Use this to suppress gcc's warnings. */ |
| 3639 | #ifdef lint | 3633 | #ifdef lint |
| 3640 | 3634 | ||
| 3641 | /* Use CODE only if lint checking is in effect. */ | 3635 | /* Use CODE only if lint checking is in effect. */ |
diff --git a/src/minibuf.c b/src/minibuf.c index 0d2bc7234eb..7dd189c325b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 251 | 251 | ||
| 252 | while ((c = getchar ()) != '\n') | 252 | while ((c = getchar ()) != '\n') |
| 253 | { | 253 | { |
| 254 | if (c < 0) | 254 | if (c == EOF) |
| 255 | { | 255 | { |
| 256 | if (errno != EINTR) | 256 | if (errno != EINTR) |
| 257 | break; | 257 | break; |
| @@ -269,7 +269,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 269 | } | 269 | } |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | if (len) | 272 | if (len || c == '\n') |
| 273 | { | 273 | { |
| 274 | val = make_string (line, len); | 274 | val = make_string (line, len); |
| 275 | xfree (line); | 275 | xfree (line); |
diff --git a/src/process.c b/src/process.c index 716e74758c4..de2edad07bd 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4842,16 +4842,11 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4842 | It can't hurt. */ | 4842 | It can't hurt. */ |
| 4843 | else if (nread == -1 && errno == EIO) | 4843 | else if (nread == -1 && errno == EIO) |
| 4844 | { | 4844 | { |
| 4845 | /* Clear the descriptor now, so we only raise the | 4845 | /* Clear the descriptor now, so we only raise the signal once. */ |
| 4846 | signal once. Don't do this if `process' is only | 4846 | FD_CLR (channel, &input_wait_mask); |
| 4847 | a pty. */ | 4847 | FD_CLR (channel, &non_keyboard_wait_mask); |
| 4848 | if (XPROCESS (proc)->pid != -2) | ||
| 4849 | { | ||
| 4850 | FD_CLR (channel, &input_wait_mask); | ||
| 4851 | FD_CLR (channel, &non_keyboard_wait_mask); | ||
| 4852 | 4848 | ||
| 4853 | kill (getpid (), SIGCHLD); | 4849 | kill (getpid (), SIGCHLD); |
| 4854 | } | ||
| 4855 | } | 4850 | } |
| 4856 | #endif /* HAVE_PTYS */ | 4851 | #endif /* HAVE_PTYS */ |
| 4857 | /* If we can detect process termination, don't consider the process | 4852 | /* If we can detect process termination, don't consider the process |
| @@ -139,6 +139,7 @@ extern void term_w32select (void); | |||
| 139 | extern void syms_of_w32menu (void); | 139 | extern void syms_of_w32menu (void); |
| 140 | extern void globals_of_w32menu (void); | 140 | extern void globals_of_w32menu (void); |
| 141 | extern void syms_of_fontset (void); | 141 | extern void syms_of_fontset (void); |
| 142 | extern void syms_of_w32font (void); | ||
| 142 | 143 | ||
| 143 | extern int _sys_read_ahead (int fd); | 144 | extern int _sys_read_ahead (int fd); |
| 144 | extern int _sys_wait_accept (int fd); | 145 | extern int _sys_wait_accept (int fd); |
diff --git a/src/w32font.c b/src/w32font.c index f47b7a46b1e..6c1b4d0bc20 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -145,6 +145,138 @@ struct font_callback_data | |||
| 145 | style variations if the font name is not specified. */ | 145 | style variations if the font name is not specified. */ |
| 146 | static void list_all_matching_fonts (struct font_callback_data *); | 146 | static void list_all_matching_fonts (struct font_callback_data *); |
| 147 | 147 | ||
| 148 | static BOOL g_b_init_is_w9x; | ||
| 149 | static BOOL g_b_init_get_outline_metrics_w; | ||
| 150 | static BOOL g_b_init_get_text_metrics_w; | ||
| 151 | static BOOL g_b_init_get_glyph_outline_w; | ||
| 152 | static BOOL g_b_init_get_glyph_outline_w; | ||
| 153 | |||
| 154 | typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) ( | ||
| 155 | HDC hdc, | ||
| 156 | UINT cbData, | ||
| 157 | LPOUTLINETEXTMETRICW lpotmw); | ||
| 158 | typedef BOOL (WINAPI * GetTextMetricsW_Proc) ( | ||
| 159 | HDC hdc, | ||
| 160 | LPTEXTMETRICW lptmw); | ||
| 161 | typedef DWORD (WINAPI * GetGlyphOutlineW_Proc) ( | ||
| 162 | HDC hdc, | ||
| 163 | UINT uChar, | ||
| 164 | UINT uFormat, | ||
| 165 | LPGLYPHMETRICS lpgm, | ||
| 166 | DWORD cbBuffer, | ||
| 167 | LPVOID lpvBuffer, | ||
| 168 | const MAT2 *lpmat2); | ||
| 169 | |||
| 170 | /* Several "wide" functions we use to support the font backends are | ||
| 171 | unavailable on Windows 9X, unless UNICOWS.DLL is installed (their | ||
| 172 | versions in the default libraries are non-functional stubs). On NT | ||
| 173 | and later systems, these functions are in GDI32.DLL. The following | ||
| 174 | helper function attempts to load UNICOWS.DLL on Windows 9X, and | ||
| 175 | refuses to let Emacs start up if that library is not found. On NT | ||
| 176 | and later versions, it simply loads GDI32.DLL, which should always | ||
| 177 | be available. */ | ||
| 178 | static HMODULE | ||
| 179 | w32_load_unicows_or_gdi32 (void) | ||
| 180 | { | ||
| 181 | static BOOL is_9x = 0; | ||
| 182 | OSVERSIONINFO os_ver; | ||
| 183 | HMODULE ret; | ||
| 184 | if (g_b_init_is_w9x == 0) | ||
| 185 | { | ||
| 186 | g_b_init_is_w9x = 1; | ||
| 187 | ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); | ||
| 188 | os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); | ||
| 189 | if (GetVersionEx (&os_ver)) | ||
| 190 | is_9x = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); | ||
| 191 | } | ||
| 192 | if (is_9x) | ||
| 193 | { | ||
| 194 | ret = LoadLibrary ("Unicows.dll"); | ||
| 195 | if (!ret) | ||
| 196 | { | ||
| 197 | int button; | ||
| 198 | |||
| 199 | button = MessageBox (NULL, | ||
| 200 | "Emacs cannot load the UNICOWS.DLL library.\n" | ||
| 201 | "This library is essential for using Emacs\n" | ||
| 202 | "on this system. You need to install it.\n\n" | ||
| 203 | "However, you can still use Emacs by invoking\n" | ||
| 204 | "it with the '-nw' command-line option.\n\n" | ||
| 205 | "Emacs will exit when you click OK.", | ||
| 206 | "Emacs cannot load UNICOWS.DLL", | ||
| 207 | MB_ICONERROR | MB_TASKMODAL | ||
| 208 | | MB_SETFOREGROUND | MB_OK); | ||
| 209 | switch (button) | ||
| 210 | { | ||
| 211 | case IDOK: | ||
| 212 | default: | ||
| 213 | exit (1); | ||
| 214 | } | ||
| 215 | } | ||
| 216 | } | ||
| 217 | else | ||
| 218 | ret = LoadLibrary ("Gdi32.dll"); | ||
| 219 | return ret; | ||
| 220 | } | ||
| 221 | |||
| 222 | /* The following 3 functions call the problematic "wide" APIs via | ||
| 223 | function pointers, to avoid linking against the non-standard | ||
| 224 | libunicows on W9X. */ | ||
| 225 | static UINT WINAPI | ||
| 226 | get_outline_metrics_w(HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpotmw) | ||
| 227 | { | ||
| 228 | static GetOutlineTextMetricsW_Proc s_pfn_Get_Outline_Text_MetricsW = NULL; | ||
| 229 | HMODULE hm_unicows = NULL; | ||
| 230 | if (g_b_init_get_outline_metrics_w == 0) | ||
| 231 | { | ||
| 232 | g_b_init_get_outline_metrics_w = 1; | ||
| 233 | hm_unicows = w32_load_unicows_or_gdi32 (); | ||
| 234 | if (hm_unicows) | ||
| 235 | s_pfn_Get_Outline_Text_MetricsW = (GetOutlineTextMetricsW_Proc) | ||
| 236 | GetProcAddress (hm_unicows, "GetOutlineTextMetricsW"); | ||
| 237 | } | ||
| 238 | if (s_pfn_Get_Outline_Text_MetricsW == NULL) | ||
| 239 | abort (); /* cannot happen */ | ||
| 240 | return s_pfn_Get_Outline_Text_MetricsW (hdc, cbData, lpotmw); | ||
| 241 | } | ||
| 242 | |||
| 243 | static BOOL WINAPI | ||
| 244 | get_text_metrics_w(HDC hdc, LPTEXTMETRICW lptmw) | ||
| 245 | { | ||
| 246 | static GetTextMetricsW_Proc s_pfn_Get_Text_MetricsW = NULL; | ||
| 247 | HMODULE hm_unicows = NULL; | ||
| 248 | if (g_b_init_get_text_metrics_w == 0) | ||
| 249 | { | ||
| 250 | g_b_init_get_text_metrics_w = 1; | ||
| 251 | hm_unicows = w32_load_unicows_or_gdi32 (); | ||
| 252 | if (hm_unicows) | ||
| 253 | s_pfn_Get_Text_MetricsW = (GetTextMetricsW_Proc) | ||
| 254 | GetProcAddress (hm_unicows, "GetTextMetricsW"); | ||
| 255 | } | ||
| 256 | if (s_pfn_Get_Text_MetricsW == NULL) | ||
| 257 | abort (); /* cannot happen */ | ||
| 258 | return s_pfn_Get_Text_MetricsW (hdc, lptmw); | ||
| 259 | } | ||
| 260 | |||
| 261 | static DWORD WINAPI | ||
| 262 | get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm, | ||
| 263 | DWORD cbBuffer, LPVOID lpvBuffer, const MAT2 *lpmat2) | ||
| 264 | { | ||
| 265 | static GetGlyphOutlineW_Proc s_pfn_Get_Glyph_OutlineW = NULL; | ||
| 266 | HMODULE hm_unicows = NULL; | ||
| 267 | if (g_b_init_get_glyph_outline_w == 0) | ||
| 268 | { | ||
| 269 | g_b_init_get_glyph_outline_w = 1; | ||
| 270 | hm_unicows = w32_load_unicows_or_gdi32 (); | ||
| 271 | if (hm_unicows) | ||
| 272 | s_pfn_Get_Glyph_OutlineW = (GetGlyphOutlineW_Proc) | ||
| 273 | GetProcAddress (hm_unicows, "GetGlyphOutlineW"); | ||
| 274 | } | ||
| 275 | if (s_pfn_Get_Glyph_OutlineW == NULL) | ||
| 276 | abort (); /* cannot happen */ | ||
| 277 | return s_pfn_Get_Glyph_OutlineW (hdc, uChar, uFormat, lpgm, cbBuffer, | ||
| 278 | lpvBuffer, lpmat2); | ||
| 279 | } | ||
| 148 | 280 | ||
| 149 | static int | 281 | static int |
| 150 | memq_no_quit (Lisp_Object elt, Lisp_Object list) | 282 | memq_no_quit (Lisp_Object elt, Lisp_Object list) |
| @@ -816,11 +948,11 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, | |||
| 816 | old_font = SelectObject (dc, hfont); | 948 | old_font = SelectObject (dc, hfont); |
| 817 | 949 | ||
| 818 | /* Try getting the outline metrics (only works for truetype fonts). */ | 950 | /* Try getting the outline metrics (only works for truetype fonts). */ |
| 819 | len = GetOutlineTextMetricsW (dc, 0, NULL); | 951 | len = get_outline_metrics_w (dc, 0, NULL); |
| 820 | if (len) | 952 | if (len) |
| 821 | { | 953 | { |
| 822 | metrics = (OUTLINETEXTMETRICW *) alloca (len); | 954 | metrics = (OUTLINETEXTMETRICW *) alloca (len); |
| 823 | if (GetOutlineTextMetricsW (dc, len, metrics)) | 955 | if (get_outline_metrics_w (dc, len, metrics)) |
| 824 | memcpy (&w32_font->metrics, &metrics->otmTextMetrics, | 956 | memcpy (&w32_font->metrics, &metrics->otmTextMetrics, |
| 825 | sizeof (TEXTMETRICW)); | 957 | sizeof (TEXTMETRICW)); |
| 826 | else | 958 | else |
| @@ -828,7 +960,7 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, | |||
| 828 | } | 960 | } |
| 829 | 961 | ||
| 830 | if (!metrics) | 962 | if (!metrics) |
| 831 | GetTextMetricsW (dc, &w32_font->metrics); | 963 | get_text_metrics_w (dc, &w32_font->metrics); |
| 832 | 964 | ||
| 833 | w32_font->cached_metrics = NULL; | 965 | w32_font->cached_metrics = NULL; |
| 834 | w32_font->n_cache_blocks = 0; | 966 | w32_font->n_cache_blocks = 0; |
| @@ -2306,7 +2438,7 @@ compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code, | |||
| 2306 | transform.eM11.value = 1; | 2438 | transform.eM11.value = 1; |
| 2307 | transform.eM22.value = 1; | 2439 | transform.eM22.value = 1; |
| 2308 | 2440 | ||
| 2309 | if (GetGlyphOutlineW (dc, code, options, &gm, 0, NULL, &transform) | 2441 | if (get_glyph_outline_w (dc, code, options, &gm, 0, NULL, &transform) |
| 2310 | != GDI_ERROR) | 2442 | != GDI_ERROR) |
| 2311 | { | 2443 | { |
| 2312 | metrics->lbearing = gm.gmptGlyphOrigin.x; | 2444 | metrics->lbearing = gm.gmptGlyphOrigin.x; |
| @@ -2581,3 +2713,12 @@ versions of Windows) characters. */); | |||
| 2581 | w32font_driver.type = Qgdi; | 2713 | w32font_driver.type = Qgdi; |
| 2582 | register_font_driver (&w32font_driver, NULL); | 2714 | register_font_driver (&w32font_driver, NULL); |
| 2583 | } | 2715 | } |
| 2716 | |||
| 2717 | void | ||
| 2718 | globals_of_w32font (void) | ||
| 2719 | { | ||
| 2720 | g_b_init_is_w9x = 0; | ||
| 2721 | g_b_init_get_outline_metrics_w = 0; | ||
| 2722 | g_b_init_get_text_metrics_w = 0; | ||
| 2723 | g_b_init_get_glyph_outline_w = 0; | ||
| 2724 | } | ||
diff --git a/src/window.c b/src/window.c index dfaef1854a4..d9ef9d090ae 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3321,6 +3321,7 @@ make_window (void) | |||
| 3321 | memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); | 3321 | memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); |
| 3322 | w->phys_cursor_type = -1; | 3322 | w->phys_cursor_type = -1; |
| 3323 | w->phys_cursor_width = -1; | 3323 | w->phys_cursor_width = -1; |
| 3324 | w->phys_cursor_on_p = 0; | ||
| 3324 | w->last_cursor_off_p = w->cursor_off_p = 0; | 3325 | w->last_cursor_off_p = w->cursor_off_p = 0; |
| 3325 | w->must_be_updated_p = 0; | 3326 | w->must_be_updated_p = 0; |
| 3326 | w->pseudo_window_p = 0; | 3327 | w->pseudo_window_p = 0; |
diff --git a/src/xdisp.c b/src/xdisp.c index cb68969ae2d..53e56e0bd7c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -26808,7 +26808,7 @@ void | |||
| 26808 | note_mouse_highlight (struct frame *f, int x, int y) | 26808 | note_mouse_highlight (struct frame *f, int x, int y) |
| 26809 | { | 26809 | { |
| 26810 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 26810 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 26811 | enum window_part part; | 26811 | enum window_part part = ON_NOTHING; |
| 26812 | Lisp_Object window; | 26812 | Lisp_Object window; |
| 26813 | struct window *w; | 26813 | struct window *w; |
| 26814 | Cursor cursor = No_Cursor; | 26814 | Cursor cursor = No_Cursor; |
| @@ -26842,11 +26842,14 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 26842 | /* Which window is that in? */ | 26842 | /* Which window is that in? */ |
| 26843 | window = window_from_coordinates (f, x, y, &part, 1); | 26843 | window = window_from_coordinates (f, x, y, &part, 1); |
| 26844 | 26844 | ||
| 26845 | /* If we were displaying active text in another window, clear that. | 26845 | /* If displaying active text in another window, clear that. */ |
| 26846 | Also clear if we move out of text area in same window. */ | ||
| 26847 | if (! EQ (window, hlinfo->mouse_face_window) | 26846 | if (! EQ (window, hlinfo->mouse_face_window) |
| 26848 | || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE | 26847 | /* Also clear if we move out of text area in same window. */ |
| 26849 | && !NILP (hlinfo->mouse_face_window))) | 26848 | || (!NILP (hlinfo->mouse_face_window) |
| 26849 | && !NILP (window) | ||
| 26850 | && part != ON_TEXT | ||
| 26851 | && part != ON_MODE_LINE | ||
| 26852 | && part != ON_HEADER_LINE)) | ||
| 26850 | clear_mouse_face (hlinfo); | 26853 | clear_mouse_face (hlinfo); |
| 26851 | 26854 | ||
| 26852 | /* Not on a window -> return. */ | 26855 | /* Not on a window -> return. */ |