diff options
| author | Miles Bader | 2005-06-06 02:39:45 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-06-06 02:39:45 +0000 |
| commit | fdffd346262841cb194225ea0acd8059c57ec2d4 (patch) | |
| tree | d8b3699131f7d1b94bc46c7d8be62af6b8b5ebfe /src | |
| parent | a5c508fe3a3f456c987283156315d0384d38fe9e (diff) | |
| parent | a9b4333620eb259e974445066a8e64cee0c21d69 (diff) | |
| download | emacs-fdffd346262841cb194225ea0acd8059c57ec2d4.tar.gz emacs-fdffd346262841cb194225ea0acd8059c57ec2d4.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 324-352)
- Merge from gnus--rel--5.10
- Update from CVS
- etc/emacs-buffer.gdb: Remove RCS keywords
* gnus--rel--5.10 (patch 70-79)
- Update from CVS
- Merge from emacs--cvs-trunk--0
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 224 | ||||
| -rw-r--r-- | src/buffer.c | 39 | ||||
| -rw-r--r-- | src/bytecode.c | 3 | ||||
| -rw-r--r-- | src/callproc.c | 27 | ||||
| -rw-r--r-- | src/ccl.c | 72 | ||||
| -rw-r--r-- | src/ccl.h | 7 | ||||
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/eval.c | 15 | ||||
| -rw-r--r-- | src/fileio.c | 2 | ||||
| -rw-r--r-- | src/fns.c | 6 | ||||
| -rw-r--r-- | src/image.c | 22 | ||||
| -rw-r--r-- | src/keyboard.c | 6 | ||||
| -rw-r--r-- | src/macmenu.c | 16 | ||||
| -rw-r--r-- | src/macterm.c | 9 | ||||
| -rw-r--r-- | src/makefile.w32-in | 2 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 2 | ||||
| -rw-r--r-- | src/w32.c | 8 | ||||
| -rw-r--r-- | src/xdisp.c | 451 | ||||
| -rw-r--r-- | src/xfaces.c | 12 | ||||
| -rw-r--r-- | src/xmenu.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 13 |
21 files changed, 646 insertions, 295 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c2cd2dde5f7..6eeb4fc09f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,153 @@ | |||
| 1 | 2005-06-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the | ||
| 4 | call to pfn_setsockopt, cast optval to `const char *'. | ||
| 5 | |||
| 6 | 2005-06-04 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | * w32.c (gettimeofday): Use struct _timeb, not struct timeb. | ||
| 9 | (open_unc_volume): Cast return value of map_w32_filename, to avoid | ||
| 10 | compiler warnings. | ||
| 11 | |||
| 12 | * s/ms-w32.h (fileno): Don't define if already defined. | ||
| 13 | |||
| 14 | * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. | ||
| 15 | |||
| 16 | * makefile.w32-in (DOC): Define to point to the generated DOC-X. | ||
| 17 | |||
| 18 | 2005-06-04 Richard M. Stallman <rms@gnu.org> | ||
| 19 | |||
| 20 | * xmenu.c (popup_get_selection): Click not in menu deactivates menu. | ||
| 21 | |||
| 22 | 2005-06-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 23 | |||
| 24 | * macmenu.c (cleanup_popup_menu): New function. | ||
| 25 | (Fx_popup_menu): unwind protect cleanup_popup_menu in case | ||
| 26 | mac_menu_show Quit:s. | ||
| 27 | (mac_menu_show): Quit on cancel if not popped up on click (i.e. | ||
| 28 | a dialog). | ||
| 29 | |||
| 30 | 2005-06-04 Kim F. Storm <storm@cua.dk> | ||
| 31 | |||
| 32 | * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. | ||
| 33 | |||
| 34 | * callproc.c (Fcall_process): Don't use alloca to gradually | ||
| 35 | increase size of buf, as it effectively uses twice the necessary | ||
| 36 | space on the stack. Instead, pre-allocate buf of full size, and | ||
| 37 | gradually increase the read size. | ||
| 38 | |||
| 39 | * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input. | ||
| 40 | |||
| 41 | * eval.c (unbind_to): Preserve value of Vquit_flag. | ||
| 42 | |||
| 43 | * xterm.c (handle_one_xevent): Also ignore mouse motion just | ||
| 44 | before a button release event. | ||
| 45 | |||
| 46 | 2005-06-03 Juanma Barranquero <lekktu@gmail.com> | ||
| 47 | |||
| 48 | * xfaces.c (Finternal_lisp_face_equal_p): Really report | ||
| 49 | on faces in a frame, if the argument FRAME is non-nil. | ||
| 50 | Improve argument/docstring consistency. | ||
| 51 | |||
| 52 | 2005-06-02 Kim F. Storm <storm@cua.dk> | ||
| 53 | |||
| 54 | * xdisp.c (MODE_LINE_NOPROP_LEN): New macro. | ||
| 55 | (x_consider_frame_title, Fformat_mode_line): Save offset into | ||
| 56 | mode_line_noprop_buf rather than pointer, in case buffer is relocated. | ||
| 57 | |||
| 58 | 2005-06-01 Kim F. Storm <storm@cua.dk> | ||
| 59 | |||
| 60 | * fns.c (mapcar1): Maybe exit loop if original sequence was modified. | ||
| 61 | |||
| 62 | 2005-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 63 | |||
| 64 | * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD | ||
| 65 | resolution fields for scalable fonts to 0. | ||
| 66 | |||
| 67 | * xfaces.c (build_scalable_font_name): Round pixel size to the | ||
| 68 | nearest integer. | ||
| 69 | |||
| 70 | 2005-06-01 Kim F. Storm <storm@cua.dk> | ||
| 71 | |||
| 72 | * xdisp.c (display_mode_line): Support nested calls to redisplay | ||
| 73 | and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY. | ||
| 74 | |||
| 75 | 2005-05-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 76 | |||
| 77 | * fileio.c (Finsert_file_contents): | ||
| 78 | * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. | ||
| 79 | |||
| 80 | 2005-05-31 Kim F. Storm <storm@cua.dk> | ||
| 81 | |||
| 82 | * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end) | ||
| 83 | (mode_line_noprop_ptr): Rename from frame_title_*. | ||
| 84 | (store_mode_line_noprop_char): Rename from store_frame_title_char. | ||
| 85 | (store_mode_line_noprop): Rename from store_frame_title. | ||
| 86 | (mode_line_target): New enum to specify current output target | ||
| 87 | for mode line formatting. | ||
| 88 | (display_mode_element): Test it rather than frame_title_ptr and | ||
| 89 | mode_line_string_list to determine where output should go. | ||
| 90 | (mode_line_proptrans_alist, mode_line_string_alist): Make static. | ||
| 91 | (Vmode_line_unwind_vector): New variable. | ||
| 92 | (format_mode_line_unwind_data, unwind_format_mode_line): | ||
| 93 | New functions for unwind protection in mode line formatting. | ||
| 94 | (x_consider_frame_title): Use them and new local var 'title_start' | ||
| 95 | to support nested calls to format-mode-line and redisplay. Set | ||
| 96 | mode_line_target to MODE_LINE_TITLE. | ||
| 97 | (Fformat_mode_line): Use them and new local var 'string_start' to | ||
| 98 | support nested calls to format-mode-line and redisplay. Set | ||
| 99 | mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. | ||
| 100 | Don't trim trailing dashes. | ||
| 101 | (decode_mode_spec): Don't make infinite number of trailing dashes | ||
| 102 | for MODE_LINE_NOPROP and MODE_LINE_STRING targets. | ||
| 103 | (syms_of_xdisp): Initialize and staticpro mode_line_string_face, | ||
| 104 | mode_line_string_face_prop, and Vmode_line_unwind_vector. | ||
| 105 | (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf. | ||
| 106 | Initialize mode_line_target to MODE_LINE_DISPLAY. | ||
| 107 | |||
| 108 | 2005-05-29 Richard M. Stallman <rms@gnu.org> | ||
| 109 | |||
| 110 | * buffer.c (Fbuffer_local_value): Call indirect_variable. | ||
| 111 | |||
| 112 | 2005-05-28 Masatake YAMATO <jet@gyve.org> | ||
| 113 | |||
| 114 | * xdisp.c (note_mode_line_or_margin_highlight): Change the | ||
| 115 | pointer to a hand cursor when hoovering over a mouse-face. | ||
| 116 | |||
| 117 | 2005-05-27 Kenichi Handa <handa@m17n.org> | ||
| 118 | |||
| 119 | * xterm.c (x_encode_char): Call check_ccl_update in advance. | ||
| 120 | |||
| 121 | * ccl.c: Now an element of Vccl_program_table is a vector of | ||
| 122 | length 4, not 3. | ||
| 123 | (ccl_get_compiled_code): New arg idx. Caller changed. | ||
| 124 | Adjust for the change of Vccl_program_table. | ||
| 125 | (setup_ccl_program): Adjust for the change of Vccl_program_table. | ||
| 126 | (check_ccl_update): New function. | ||
| 127 | (Fregister_ccl_program): Use ASET to set an element of a vector. | ||
| 128 | Adjusted for the change of Vccl_program_table. | ||
| 129 | |||
| 130 | * ccl.h (struct ccl_program): New member idx. | ||
| 131 | (check_ccl_update): Extern it. | ||
| 132 | |||
| 133 | 2005-05-27 Juanma Barranquero <lekktu@gmail.com> | ||
| 134 | |||
| 135 | * image.c (Vimage_library_alist): Move from image.el. | ||
| 136 | (syms_of_image): Defvar it. | ||
| 137 | (lookup_image_type): Use it. | ||
| 138 | |||
| 139 | * buffer.c (Fbuffer_local_value): Make argument name match its use | ||
| 140 | in docstring. | ||
| 141 | |||
| 142 | 2005-05-26 Juanma Barranquero <lekktu@gmail.com> | ||
| 143 | |||
| 144 | * keyboard.c (Frecursive_edit): Fix typo in docstring. | ||
| 145 | (Fposn_at_x_y): Make argument name match its use in docstring. | ||
| 146 | |||
| 147 | 2005-05-26 Lute Kamstra <lute@gnu.org> | ||
| 148 | |||
| 149 | * eval.c (Frun_hooks): Mention run-mode-hooks in docstring. | ||
| 150 | |||
| 1 | 2005-05-24 Masatake YAMATO <jet@gyve.org> | 151 | 2005-05-24 Masatake YAMATO <jet@gyve.org> |
| 2 | 152 | ||
| 3 | * xdisp.c (note_mode_line_or_margin_highlight): Use b and e | 153 | * xdisp.c (note_mode_line_or_margin_highlight): Use b and e |
| @@ -26,9 +176,9 @@ | |||
| 26 | 176 | ||
| 27 | 2005-05-23 Masatake YAMATO <jet@gyve.org> | 177 | 2005-05-23 Masatake YAMATO <jet@gyve.org> |
| 28 | 178 | ||
| 29 | * xdisp.c (note_mode_line_or_margin_highlight): Added code | 179 | * xdisp.c (note_mode_line_or_margin_highlight): Add code |
| 30 | for mouse-face. Change the type of the first argument from `window' | 180 | for mouse-face. Change the type of the first argument from `window' |
| 31 | to `List_Object'. | 181 | to `Lisp_Object'. |
| 32 | (note_mouse_highlight): Call note_mode_line_or_margin_highlight with | 182 | (note_mouse_highlight): Call note_mode_line_or_margin_highlight with |
| 33 | window instead of w. | 183 | window instead of w. |
| 34 | 184 | ||
| @@ -79,8 +229,7 @@ | |||
| 79 | 229 | ||
| 80 | 2005-05-16 Andreas Schwab <schwab@suse.de> | 230 | 2005-05-16 Andreas Schwab <schwab@suse.de> |
| 81 | 231 | ||
| 82 | * unexmacosx.c (unexec_realloc): Move declarations before | 232 | * unexmacosx.c (unexec_realloc): Move declarations before statements. |
| 83 | statements. | ||
| 84 | 233 | ||
| 85 | 2005-05-14 Richard M. Stallman <rms@gnu.org> | 234 | 2005-05-14 Richard M. Stallman <rms@gnu.org> |
| 86 | 235 | ||
| @@ -108,8 +257,8 @@ | |||
| 108 | 257 | ||
| 109 | * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. | 258 | * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. |
| 110 | 259 | ||
| 111 | * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: Regard | 260 | * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: |
| 112 | toolkit scroll bar thumb drag events as squeezable and prevent | 261 | Regard toolkit scroll bar thumb drag events as squeezable and prevent |
| 113 | redisplay from being paused by them. | 262 | redisplay from being paused by them. |
| 114 | 263 | ||
| 115 | * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. | 264 | * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. |
| @@ -117,12 +266,11 @@ | |||
| 117 | [!MAC_OSX] (check_alarm, pause, index): Remove functions. | 266 | [!MAC_OSX] (check_alarm, pause, index): Remove functions. |
| 118 | [!MAC_OSX && __MRC__] (sys_strftime): Likewise. | 267 | [!MAC_OSX && __MRC__] (sys_strftime): Likewise. |
| 119 | [!MAC_OSX] (select): If fd 0 is not set in rfds and some input | 268 | [!MAC_OSX] (select): If fd 0 is not set in rfds and some input |
| 120 | event occurs before timeout, behave as if the function were | 269 | event occurs before timeout, behave as if the function were interrupted. |
| 121 | interrupted. | ||
| 122 | [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM | 270 | [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM |
| 123 | handling using Time Manager routines. | 271 | handling using Time Manager routines. |
| 124 | [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): New | 272 | [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): |
| 125 | variables. | 273 | New variables. |
| 126 | [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) | 274 | [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) |
| 127 | (setitimer): New functions. | 275 | (setitimer): New functions. |
| 128 | 276 | ||
| @@ -136,8 +284,8 @@ | |||
| 136 | (x_scroll_bar_handle_click): Change type of second argument from | 284 | (x_scroll_bar_handle_click): Change type of second argument from |
| 137 | int to ControlPartCode. | 285 | int to ControlPartCode. |
| 138 | (check_alarm): Remove declaration. | 286 | (check_alarm): Remove declaration. |
| 139 | (XTread_Socket) [!TARGET_API_MAC_CARBON]: Don't call it. | 287 | (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it. |
| 140 | (XTread_Socket): Use ControlPartCode instead of SInt16. | 288 | (XTread_socket): Use ControlPartCode instead of SInt16. |
| 141 | 289 | ||
| 142 | 2005-05-13 Nozomu Ando <nand@mac.com> | 290 | 2005-05-13 Nozomu Ando <nand@mac.com> |
| 143 | 291 | ||
| @@ -1941,7 +2089,7 @@ | |||
| 1941 | 2005-01-13 Kim F. Storm <storm@cua.dk> | 2089 | 2005-01-13 Kim F. Storm <storm@cua.dk> |
| 1942 | 2090 | ||
| 1943 | * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg | 2091 | * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg |
| 1944 | (specify 0 for FACE instead). Reorder arg list. Doc fix. | 2092 | (specify 0 for FACE instead). Reorder arg list. Doc fix. |
| 1945 | 2093 | ||
| 1946 | 2005-01-12 Richard M. Stallman <rms@gnu.org> | 2094 | 2005-01-12 Richard M. Stallman <rms@gnu.org> |
| 1947 | 2095 | ||
| @@ -2092,7 +2240,7 @@ | |||
| 2092 | fontp->space_width to FONT_WIDTH so they are valid. | 2240 | fontp->space_width to FONT_WIDTH so they are valid. |
| 2093 | 2241 | ||
| 2094 | * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not | 2242 | * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not |
| 2095 | average width. Set fontp->average_width and fontp->space_width to | 2243 | average width. Set fontp->average_width and fontp->space_width to |
| 2096 | their appropriate values. | 2244 | their appropriate values. |
| 2097 | 2245 | ||
| 2098 | * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to | 2246 | * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to |
| @@ -2119,7 +2267,7 @@ | |||
| 2119 | * xdisp.c (setup_for_ellipsis, get_next_display_element): | 2267 | * xdisp.c (setup_for_ellipsis, get_next_display_element): |
| 2120 | Set it->ellipsis_p to 1 or 0. | 2268 | Set it->ellipsis_p to 1 or 0. |
| 2121 | (display_line): Record whether row ends in mid-ellipsis. | 2269 | (display_line): Record whether row ends in mid-ellipsis. |
| 2122 | (set_cursor_from_row): If ends in ellipsis. find start of it. | 2270 | (set_cursor_from_row): If ends in ellipsis, find start of it. |
| 2123 | (cursor_row_p): If PT's at the end of the ellipsis the row | 2271 | (cursor_row_p): If PT's at the end of the ellipsis the row |
| 2124 | ends within, don't display cursor on this row. | 2272 | ends within, don't display cursor on this row. |
| 2125 | 2273 | ||
| @@ -2822,7 +2970,7 @@ | |||
| 2822 | * fringe.c (update_window_fringes): Prefer truncation bitmaps over | 2970 | * fringe.c (update_window_fringes): Prefer truncation bitmaps over |
| 2823 | angle bitmaps at top/bottom line. | 2971 | angle bitmaps at top/bottom line. |
| 2824 | 2972 | ||
| 2825 | * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, | 2973 | * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, |
| 2826 | set it when it->method is set to next_element_from_display_vector. | 2974 | set it when it->method is set to next_element_from_display_vector. |
| 2827 | (setup_for_ellipsis): Add LEN argument. Callers changed. | 2975 | (setup_for_ellipsis): Add LEN argument. Callers changed. |
| 2828 | Set it->saved_face_id. | 2976 | Set it->saved_face_id. |
| @@ -3018,7 +3166,7 @@ | |||
| 3018 | * xfns.c (Fx_file_dialog): Call popup_activated instead of | 3166 | * xfns.c (Fx_file_dialog): Call popup_activated instead of |
| 3019 | x_menu_in_use. Call x_menu_set_in_use in Motif version also. | 3167 | x_menu_in_use. Call x_menu_set_in_use in Motif version also. |
| 3020 | 3168 | ||
| 3021 | * xterm.h: (x_menu_in_use): Remove. | 3169 | * xterm.h (x_menu_in_use): Remove. |
| 3022 | 3170 | ||
| 3023 | 2004-11-16 Richard M. Stallman <rms@gnu.org> | 3171 | 2004-11-16 Richard M. Stallman <rms@gnu.org> |
| 3024 | 3172 | ||
| @@ -3152,7 +3300,7 @@ | |||
| 3152 | (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. | 3300 | (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. |
| 3153 | (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible | 3301 | (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible |
| 3154 | part of last line is only extra line spacing (so the text on the | 3302 | part of last line is only extra line spacing (so the text on the |
| 3155 | line is fully visible). Use helper macros. | 3303 | line is fully visible). Use helper macros. |
| 3156 | Add W arg (to use them). All callers changed. | 3304 | Add W arg (to use them). All callers changed. |
| 3157 | (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) | 3305 | (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) |
| 3158 | (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. | 3306 | (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. |
| @@ -3833,7 +3981,7 @@ | |||
| 3833 | 3981 | ||
| 3834 | * keyboard.c (timer_resume_idle): New function to resume idle | 3982 | * keyboard.c (timer_resume_idle): New function to resume idle |
| 3835 | timer without resetting timers on the idle list. | 3983 | timer without resetting timers on the idle list. |
| 3836 | (read_char): Use timer_resume_idle. Remove local var last_idle_start. | 3984 | (read_char): Use timer_resume_idle. Remove local var last_idle_start. |
| 3837 | (timer_start_idle, timer_stop_idle): Declare static. | 3985 | (timer_start_idle, timer_stop_idle): Declare static. |
| 3838 | (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. | 3986 | (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. |
| 3839 | 3987 | ||
| @@ -4976,7 +5124,7 @@ | |||
| 4976 | 5124 | ||
| 4977 | 2004-06-11 Kenichi Handa <handa@m17n.org> | 5125 | 2004-06-11 Kenichi Handa <handa@m17n.org> |
| 4978 | 5126 | ||
| 4979 | * coding.c (decode_coding_string): Check CODING_FINISH_INTERRUPT. | 5127 | * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT. |
| 4980 | 5128 | ||
| 4981 | 2004-06-11 Kim F. Storm <storm@cua.dk> | 5129 | 2004-06-11 Kim F. Storm <storm@cua.dk> |
| 4982 | 5130 | ||
| @@ -5907,7 +6055,7 @@ | |||
| 5907 | elt_prefix combined with Fsingle_key_description. | 6055 | elt_prefix combined with Fsingle_key_description. |
| 5908 | (describe_vector): Declare static. Replace arg `elt_prefix' with | 6056 | (describe_vector): Declare static. Replace arg `elt_prefix' with |
| 5909 | `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it | 6057 | `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it |
| 5910 | if !KEYMAP_P. Use Fkey_description with prefix instead of | 6058 | if !KEYMAP_P. Use Fkey_description with prefix instead of |
| 5911 | Fsingle_key_description. | 6059 | Fsingle_key_description. |
| 5912 | 6060 | ||
| 5913 | * keymap.h (Fkey_description): Fix prototype. | 6061 | * keymap.h (Fkey_description): Fix prototype. |
| @@ -6122,7 +6270,7 @@ | |||
| 6122 | (display_mode_line): Set mode_line_p before displaying line. | 6270 | (display_mode_line): Set mode_line_p before displaying line. |
| 6123 | (calc_pixel_width_or_height): Declare extern. Add separate :align-to | 6271 | (calc_pixel_width_or_height): Declare extern. Add separate :align-to |
| 6124 | handling. Remove complex cases for fringes and scroll-bars. | 6272 | handling. Remove complex cases for fringes and scroll-bars. |
| 6125 | Add left, right, and center alignment positions. Add text (area) | 6273 | Add left, right, and center alignment positions. Add text (area) |
| 6126 | width/height. Return width or height for image specs. | 6274 | width/height. Return width or height for image specs. |
| 6127 | (produce_stretch_glyph): Improve handling of :align-to. Is now | 6275 | (produce_stretch_glyph): Improve handling of :align-to. Is now |
| 6128 | relative to left of text area by default, but other base offsets | 6276 | relative to left of text area by default, but other base offsets |
| @@ -10430,7 +10578,7 @@ | |||
| 10430 | * intervals.h (CHECK_TOTAL_LENGTH): New macro. | 10578 | * intervals.h (CHECK_TOTAL_LENGTH): New macro. |
| 10431 | * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. | 10579 | * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. |
| 10432 | 10580 | ||
| 10433 | * alloc.c: (VALIDATE_LISP_STORAGE): Macro deleted. | 10581 | * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted. |
| 10434 | All calls deleted. | 10582 | All calls deleted. |
| 10435 | (lisp_malloc): Do the work here directly. | 10583 | (lisp_malloc): Do the work here directly. |
| 10436 | 10584 | ||
| @@ -10589,7 +10737,7 @@ | |||
| 10589 | (syms_of_w32fns): Don't intern/staticpro removed vars. | 10737 | (syms_of_w32fns): Don't intern/staticpro removed vars. |
| 10590 | 10738 | ||
| 10591 | * w32term.c: Remove unnecessary extern declarations. | 10739 | * w32term.c: Remove unnecessary extern declarations. |
| 10592 | (x_fullscreen_adjust): Remove. Use generic instead. | 10740 | (x_fullscreen_adjust): Remove. Use generic instead. |
| 10593 | (x_redisplay_interface): Add w32_frame_parm_handlers member. | 10741 | (x_redisplay_interface): Add w32_frame_parm_handlers member. |
| 10594 | 10742 | ||
| 10595 | * w32reg.c (x_get_string_resource): Use XrmDatabase. | 10743 | * w32reg.c (x_get_string_resource): Use XrmDatabase. |
| @@ -11815,9 +11963,9 @@ | |||
| 11815 | 2003-01-21 David Ponce <david@dponce.com> | 11963 | 2003-01-21 David Ponce <david@dponce.com> |
| 11816 | 11964 | ||
| 11817 | * w32term.c (w32_encode_char): For DIM=1 charset, set | 11965 | * w32term.c (w32_encode_char): For DIM=1 charset, set |
| 11818 | ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c | 11966 | ccl->reg[2] to -1 before calling ccl_driver. |
| 11819 | x_encode_char change by Kenichi Handa <handa@m17n.org> on | 11967 | (Sync. with xterm.c x_encode_char change by Kenichi Handa |
| 11820 | 2002-09-30.) | 11968 | <handa@m17n.org> on 2002-09-30.) |
| 11821 | (w32_draw_relief_rect): Declare all args. | 11969 | (w32_draw_relief_rect): Declare all args. |
| 11822 | (w32_define_cursor): New. | 11970 | (w32_define_cursor): New. |
| 11823 | 11971 | ||
| @@ -14500,7 +14648,7 @@ | |||
| 14500 | 14648 | ||
| 14501 | 2002-06-27 Kim F. Storm <storm@cua.dk> | 14649 | 2002-06-27 Kim F. Storm <storm@cua.dk> |
| 14502 | 14650 | ||
| 14503 | * xdisp.c: (mode_line_string_list, mode_line_string_face) | 14651 | * xdisp.c (mode_line_string_list, mode_line_string_face) |
| 14504 | (mode_line_string_face_prop): New variables. | 14652 | (mode_line_string_face_prop): New variables. |
| 14505 | (store_mode_line_string): New function. | 14653 | (store_mode_line_string): New function. |
| 14506 | (display_mode_element): Use store_mode_line_string to | 14654 | (display_mode_element): Use store_mode_line_string to |
| @@ -14543,7 +14691,7 @@ | |||
| 14543 | 14691 | ||
| 14544 | 2002-06-24 Juanma Barranquero <lektu@terra.es> | 14692 | 2002-06-24 Juanma Barranquero <lektu@terra.es> |
| 14545 | 14693 | ||
| 14546 | * w32select.c: Include composite.h | 14694 | * w32select.c: Include composite.h. |
| 14547 | 14695 | ||
| 14548 | * w16select.c: Likewise. | 14696 | * w16select.c: Likewise. |
| 14549 | 14697 | ||
| @@ -15534,7 +15682,7 @@ | |||
| 15534 | 15682 | ||
| 15535 | * config.in: Add HAVE_SHARED_GAME_DIR. | 15683 | * config.in: Add HAVE_SHARED_GAME_DIR. |
| 15536 | 15684 | ||
| 15537 | * callproc.c: (Vgame_score_directory): New variable. | 15685 | * callproc.c (Vgame_score_directory): New variable. |
| 15538 | (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. | 15686 | (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. |
| 15539 | 15687 | ||
| 15540 | 2002-04-10 Richard M. Stallman <rms@gnu.org> | 15688 | 2002-04-10 Richard M. Stallman <rms@gnu.org> |
| @@ -16082,7 +16230,7 @@ | |||
| 16082 | 16230 | ||
| 16083 | * xterm.h (x_session_check_input, x_session_initialize): Declare. | 16231 | * xterm.h (x_session_check_input, x_session_initialize): Declare. |
| 16084 | 16232 | ||
| 16085 | * xterm.c: (XTread_socket): Add call to x_session_check_input and | 16233 | * xterm.c (XTread_socket): Add call to x_session_check_input and |
| 16086 | x_session_have_connection. | 16234 | x_session_have_connection. |
| 16087 | (x_initialize): Add call to x_session_initialize. | 16235 | (x_initialize): Add call to x_session_initialize. |
| 16088 | 16236 | ||
| @@ -16499,10 +16647,10 @@ | |||
| 16499 | 16647 | ||
| 16500 | 2002-02-17 Kim F. Storm <storm@cua.dk> | 16648 | 2002-02-17 Kim F. Storm <storm@cua.dk> |
| 16501 | 16649 | ||
| 16502 | * frame.c: (Vmouse_highlight): New variable. | 16650 | * frame.c (Vmouse_highlight): New variable. |
| 16503 | (syms_of_frame): DEFVAR_LISP it. | 16651 | (syms_of_frame): DEFVAR_LISP it. |
| 16504 | 16652 | ||
| 16505 | * frame.h: (Vmouse_highlight): Declare extern. | 16653 | * frame.h (Vmouse_highlight): Declare extern. |
| 16506 | 16654 | ||
| 16507 | * xterm.h (struct x_display_info): Add mouse_face_hidden. | 16655 | * xterm.h (struct x_display_info): Add mouse_face_hidden. |
| 16508 | 16656 | ||
| @@ -18027,7 +18175,7 @@ | |||
| 18027 | 18175 | ||
| 18028 | 2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> | 18176 | 2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> |
| 18029 | 18177 | ||
| 18030 | * syswait.h: (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by | 18178 | * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by |
| 18031 | Andrew Wiseman <a.wiseman@btclick.com>. | 18179 | Andrew Wiseman <a.wiseman@btclick.com>. |
| 18032 | 18180 | ||
| 18033 | 2001-11-16 Kim F. Storm <storm@cua.dk> | 18181 | 2001-11-16 Kim F. Storm <storm@cua.dk> |
| @@ -18715,7 +18863,7 @@ | |||
| 18715 | 18863 | ||
| 18716 | * xterm.c: Fix typo in a comment. | 18864 | * xterm.c: Fix typo in a comment. |
| 18717 | 18865 | ||
| 18718 | * lisp.h: (gdb_lisp_params): Remove code in #if 0 which is now in | 18866 | * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in |
| 18719 | emacs.c. | 18867 | emacs.c. |
| 18720 | 18868 | ||
| 18721 | 2001-10-27 Gerd Moellmann <gerd@gnu.org> | 18869 | 2001-10-27 Gerd Moellmann <gerd@gnu.org> |
| @@ -18839,7 +18987,7 @@ | |||
| 18839 | 18987 | ||
| 18840 | 2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> | 18988 | 2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> |
| 18841 | 18989 | ||
| 18842 | * xterm.c: (x_insert_glyphs): Remove unused variables `real_end' | 18990 | * xterm.c (x_insert_glyphs): Remove unused variables `real_end' |
| 18843 | and `real_start'. | 18991 | and `real_start'. |
| 18844 | (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. | 18992 | (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. |
| 18845 | (glyph_rect): Remove unused variable `area'. | 18993 | (glyph_rect): Remove unused variable `area'. |
| @@ -18871,7 +19019,7 @@ | |||
| 18871 | (HAVE_BOXES): Fix typo in comment. | 19019 | (HAVE_BOXES): Fix typo in comment. |
| 18872 | (push_menu_pane): Fix typo in comment. | 19020 | (push_menu_pane): Fix typo in comment. |
| 18873 | 19021 | ||
| 18874 | * xdisp.c: (display_prop_string_p): Remove unused local declaration | 19022 | * xdisp.c (display_prop_string_p): Remove unused local declaration |
| 18875 | of `Qwhen'. | 19023 | of `Qwhen'. |
| 18876 | (single_display_prop_string_p): Remove unused local declarations | 19024 | (single_display_prop_string_p): Remove unused local declarations |
| 18877 | of `Qwhen' and `Qmargin'. | 19025 | of `Qwhen' and `Qmargin'. |
diff --git a/src/buffer.c b/src/buffer.c index d9769ce10ab..a8daebc3088 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -878,20 +878,23 @@ DEFUN ("buffer-local-value", Fbuffer_local_value, | |||
| 878 | Sbuffer_local_value, 2, 2, 0, | 878 | Sbuffer_local_value, 2, 2, 0, |
| 879 | doc: /* Return the value of VARIABLE in BUFFER. | 879 | doc: /* Return the value of VARIABLE in BUFFER. |
| 880 | If VARIABLE does not have a buffer-local binding in BUFFER, the value | 880 | If VARIABLE does not have a buffer-local binding in BUFFER, the value |
| 881 | is the default binding of variable. */) | 881 | is the default binding of the variable. */) |
| 882 | (symbol, buffer) | 882 | (variable, buffer) |
| 883 | register Lisp_Object symbol; | 883 | register Lisp_Object variable; |
| 884 | register Lisp_Object buffer; | 884 | register Lisp_Object buffer; |
| 885 | { | 885 | { |
| 886 | register struct buffer *buf; | 886 | register struct buffer *buf; |
| 887 | register Lisp_Object result; | 887 | register Lisp_Object result; |
| 888 | 888 | ||
| 889 | CHECK_SYMBOL (symbol); | 889 | CHECK_SYMBOL (variable); |
| 890 | CHECK_BUFFER (buffer); | 890 | CHECK_BUFFER (buffer); |
| 891 | buf = XBUFFER (buffer); | 891 | buf = XBUFFER (buffer); |
| 892 | 892 | ||
| 893 | if (SYMBOLP (variable)) | ||
| 894 | variable = indirect_variable (variable); | ||
| 895 | |||
| 893 | /* Look in local_var_list */ | 896 | /* Look in local_var_list */ |
| 894 | result = Fassoc (symbol, buf->local_var_alist); | 897 | result = Fassoc (variable, buf->local_var_alist); |
| 895 | if (NILP (result)) | 898 | if (NILP (result)) |
| 896 | { | 899 | { |
| 897 | int offset, idx; | 900 | int offset, idx; |
| @@ -906,7 +909,7 @@ is the default binding of variable. */) | |||
| 906 | idx = PER_BUFFER_IDX (offset); | 909 | idx = PER_BUFFER_IDX (offset); |
| 907 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 910 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) |
| 908 | && SYMBOLP (PER_BUFFER_SYMBOL (offset)) | 911 | && SYMBOLP (PER_BUFFER_SYMBOL (offset)) |
| 909 | && EQ (PER_BUFFER_SYMBOL (offset), symbol)) | 912 | && EQ (PER_BUFFER_SYMBOL (offset), variable)) |
| 910 | { | 913 | { |
| 911 | result = PER_BUFFER_VALUE (buf, offset); | 914 | result = PER_BUFFER_VALUE (buf, offset); |
| 912 | found = 1; | 915 | found = 1; |
| @@ -915,7 +918,7 @@ is the default binding of variable. */) | |||
| 915 | } | 918 | } |
| 916 | 919 | ||
| 917 | if (!found) | 920 | if (!found) |
| 918 | result = Fdefault_value (symbol); | 921 | result = Fdefault_value (variable); |
| 919 | } | 922 | } |
| 920 | else | 923 | else |
| 921 | { | 924 | { |
| @@ -923,7 +926,7 @@ is the default binding of variable. */) | |||
| 923 | Lisp_Object current_alist_element; | 926 | Lisp_Object current_alist_element; |
| 924 | 927 | ||
| 925 | /* What binding is loaded right now? */ | 928 | /* What binding is loaded right now? */ |
| 926 | valcontents = SYMBOL_VALUE (symbol); | 929 | valcontents = SYMBOL_VALUE (variable); |
| 927 | current_alist_element | 930 | current_alist_element |
| 928 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 931 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); |
| 929 | 932 | ||
| @@ -940,7 +943,7 @@ is the default binding of variable. */) | |||
| 940 | } | 943 | } |
| 941 | 944 | ||
| 942 | if (EQ (result, Qunbound)) | 945 | if (EQ (result, Qunbound)) |
| 943 | return Fsignal (Qvoid_variable, Fcons (symbol, Qnil)); | 946 | return Fsignal (Qvoid_variable, Fcons (variable, Qnil)); |
| 944 | 947 | ||
| 945 | return result; | 948 | return result; |
| 946 | } | 949 | } |
| @@ -5292,19 +5295,19 @@ This is the same as (default-value 'abbrev-mode). */); | |||
| 5292 | doc: /* Default value of `ctl-arrow' for buffers that do not override it. | 5295 | doc: /* Default value of `ctl-arrow' for buffers that do not override it. |
| 5293 | This is the same as (default-value 'ctl-arrow). */); | 5296 | This is the same as (default-value 'ctl-arrow). */); |
| 5294 | 5297 | ||
| 5295 | DEFVAR_LISP_NOPRO ("default-direction-reversed", | 5298 | DEFVAR_LISP_NOPRO ("default-direction-reversed", |
| 5296 | &buffer_defaults.direction_reversed, | 5299 | &buffer_defaults.direction_reversed, |
| 5297 | doc: /* Default value of `direction-reversed' for buffers that do not override it. | 5300 | doc: /* Default value of `direction-reversed' for buffers that do not override it. |
| 5298 | This is the same as (default-value 'direction-reversed). */); | 5301 | This is the same as (default-value 'direction-reversed). */); |
| 5299 | 5302 | ||
| 5300 | DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", | 5303 | DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", |
| 5301 | &buffer_defaults.enable_multibyte_characters, | 5304 | &buffer_defaults.enable_multibyte_characters, |
| 5302 | doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. | 5305 | doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. |
| 5303 | This is the same as (default-value 'enable-multibyte-characters). */); | 5306 | This is the same as (default-value 'enable-multibyte-characters). */); |
| 5304 | 5307 | ||
| 5305 | DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", | 5308 | DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", |
| 5306 | &buffer_defaults.buffer_file_coding_system, | 5309 | &buffer_defaults.buffer_file_coding_system, |
| 5307 | doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. | 5310 | doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. |
| 5308 | This is the same as (default-value 'buffer-file-coding-system). */); | 5311 | This is the same as (default-value 'buffer-file-coding-system). */); |
| 5309 | 5312 | ||
| 5310 | DEFVAR_LISP_NOPRO ("default-truncate-lines", | 5313 | DEFVAR_LISP_NOPRO ("default-truncate-lines", |
diff --git a/src/bytecode.c b/src/bytecode.c index d130b3b3d42..80fb5e2208e 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -384,8 +384,11 @@ unmark_byte_stack () | |||
| 384 | do { \ | 384 | do { \ |
| 385 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ | 385 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ |
| 386 | { \ | 386 | { \ |
| 387 | Lisp_Object flag = Vquit_flag; \ | ||
| 387 | Vquit_flag = Qnil; \ | 388 | Vquit_flag = Qnil; \ |
| 388 | BEFORE_POTENTIAL_GC (); \ | 389 | BEFORE_POTENTIAL_GC (); \ |
| 390 | if (EQ (Vthrow_on_input, flag)) \ | ||
| 391 | Fthrow (Vthrow_on_input, Qnil); \ | ||
| 389 | Fsignal (Qquit, Qnil); \ | 392 | Fsignal (Qquit, Qnil); \ |
| 390 | AFTER_POTENTIAL_GC (); \ | 393 | AFTER_POTENTIAL_GC (); \ |
| 391 | } \ | 394 | } \ |
diff --git a/src/callproc.c b/src/callproc.c index c410b5a121b..524f6a6a078 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -218,9 +218,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 218 | int fd[2]; | 218 | int fd[2]; |
| 219 | int filefd; | 219 | int filefd; |
| 220 | register int pid; | 220 | register int pid; |
| 221 | char buf[16384]; | 221 | #define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) |
| 222 | char *bufptr = buf; | 222 | #define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN) |
| 223 | int bufsize = sizeof buf; | 223 | char buf[CALLPROC_BUFFER_SIZE_MAX]; |
| 224 | int bufsize = CALLPROC_BUFFER_SIZE_MIN; | ||
| 224 | int count = SPECPDL_INDEX (); | 225 | int count = SPECPDL_INDEX (); |
| 225 | 226 | ||
| 226 | register const unsigned char **new_argv | 227 | register const unsigned char **new_argv |
| @@ -753,7 +754,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 753 | nread = carryover; | 754 | nread = carryover; |
| 754 | while (nread < bufsize - 1024) | 755 | while (nread < bufsize - 1024) |
| 755 | { | 756 | { |
| 756 | int this_read = emacs_read (fd[0], bufptr + nread, | 757 | int this_read = emacs_read (fd[0], buf + nread, |
| 757 | bufsize - nread); | 758 | bufsize - nread); |
| 758 | 759 | ||
| 759 | if (this_read < 0) | 760 | if (this_read < 0) |
| @@ -779,7 +780,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 779 | { | 780 | { |
| 780 | if (NILP (current_buffer->enable_multibyte_characters) | 781 | if (NILP (current_buffer->enable_multibyte_characters) |
| 781 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) | 782 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) |
| 782 | insert_1_both (bufptr, nread, nread, 0, 1, 0); | 783 | insert_1_both (buf, nread, nread, 0, 1, 0); |
| 783 | else | 784 | else |
| 784 | { /* We have to decode the input. */ | 785 | { /* We have to decode the input. */ |
| 785 | Lisp_Object buf; | 786 | Lisp_Object buf; |
| @@ -826,17 +827,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 826 | if (process_coding.mode & CODING_MODE_LAST_BLOCK) | 827 | if (process_coding.mode & CODING_MODE_LAST_BLOCK) |
| 827 | break; | 828 | break; |
| 828 | 829 | ||
| 830 | #if (CALLPROC_BUFFER_SIZE_MIN != CALLPROC_BUFFER_SIZE_MAX) | ||
| 829 | /* Make the buffer bigger as we continue to read more data, | 831 | /* Make the buffer bigger as we continue to read more data, |
| 830 | but not past 64k. */ | 832 | but not past CALLPROC_BUFFER_SIZE_MAX. */ |
| 831 | if (bufsize < 64 * 1024 && total_read > 32 * bufsize) | 833 | if (bufsize < CALLPROC_BUFFER_SIZE_MAX && total_read > 32 * bufsize) |
| 832 | { | 834 | if ((bufsize *= 2) > CALLPROC_BUFFER_SIZE_MAX) |
| 833 | char *tempptr; | 835 | bufsize = CALLPROC_BUFFER_SIZE_MAX; |
| 834 | bufsize *= 2; | 836 | #endif |
| 835 | |||
| 836 | tempptr = (char *) alloca (bufsize); | ||
| 837 | bcopy (bufptr, tempptr, bufsize / 2); | ||
| 838 | bufptr = tempptr; | ||
| 839 | } | ||
| 840 | 837 | ||
| 841 | if (display_p) | 838 | if (display_p) |
| 842 | { | 839 | { |
| @@ -55,10 +55,12 @@ Lisp_Object Qcode_conversion_map_id; | |||
| 55 | Lisp_Object Qccl_program_idx; | 55 | Lisp_Object Qccl_program_idx; |
| 56 | 56 | ||
| 57 | /* Table of registered CCL programs. Each element is a vector of | 57 | /* Table of registered CCL programs. Each element is a vector of |
| 58 | NAME, CCL_PROG, and RESOLVEDP where NAME (symbol) is the name of | 58 | NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the |
| 59 | the program, CCL_PROG (vector) is the compiled code of the program, | 59 | name of the program, CCL_PROG (vector) is the compiled code of the |
| 60 | RESOLVEDP (t or nil) is the flag to tell if symbols in CCL_PROG is | 60 | program, RESOLVEDP (t or nil) is the flag to tell if symbols in |
| 61 | already resolved to index numbers or not. */ | 61 | CCL_PROG is already resolved to index numbers or not, UPDATEDP (t |
| 62 | or nil) is the flat to tell if the CCL program is updated after it | ||
| 63 | was once used. */ | ||
| 62 | Lisp_Object Vccl_program_table; | 64 | Lisp_Object Vccl_program_table; |
| 63 | 65 | ||
| 64 | /* Vector of registered hash tables for translation. */ | 66 | /* Vector of registered hash tables for translation. */ |
| @@ -1850,14 +1852,16 @@ resolve_symbol_ccl_program (ccl) | |||
| 1850 | symbols, return Qnil. */ | 1852 | symbols, return Qnil. */ |
| 1851 | 1853 | ||
| 1852 | static Lisp_Object | 1854 | static Lisp_Object |
| 1853 | ccl_get_compiled_code (ccl_prog) | 1855 | ccl_get_compiled_code (ccl_prog, idx) |
| 1854 | Lisp_Object ccl_prog; | 1856 | Lisp_Object ccl_prog; |
| 1857 | int *idx; | ||
| 1855 | { | 1858 | { |
| 1856 | Lisp_Object val, slot; | 1859 | Lisp_Object val, slot; |
| 1857 | 1860 | ||
| 1858 | if (VECTORP (ccl_prog)) | 1861 | if (VECTORP (ccl_prog)) |
| 1859 | { | 1862 | { |
| 1860 | val = resolve_symbol_ccl_program (ccl_prog); | 1863 | val = resolve_symbol_ccl_program (ccl_prog); |
| 1864 | *idx = -1; | ||
| 1861 | return (VECTORP (val) ? val : Qnil); | 1865 | return (VECTORP (val) ? val : Qnil); |
| 1862 | } | 1866 | } |
| 1863 | if (!SYMBOLP (ccl_prog)) | 1867 | if (!SYMBOLP (ccl_prog)) |
| @@ -1869,9 +1873,10 @@ ccl_get_compiled_code (ccl_prog) | |||
| 1869 | return Qnil; | 1873 | return Qnil; |
| 1870 | slot = AREF (Vccl_program_table, XINT (val)); | 1874 | slot = AREF (Vccl_program_table, XINT (val)); |
| 1871 | if (! VECTORP (slot) | 1875 | if (! VECTORP (slot) |
| 1872 | || ASIZE (slot) != 3 | 1876 | || ASIZE (slot) != 4 |
| 1873 | || ! VECTORP (AREF (slot, 1))) | 1877 | || ! VECTORP (AREF (slot, 1))) |
| 1874 | return Qnil; | 1878 | return Qnil; |
| 1879 | *idx = XINT (val); | ||
| 1875 | if (NILP (AREF (slot, 2))) | 1880 | if (NILP (AREF (slot, 2))) |
| 1876 | { | 1881 | { |
| 1877 | val = resolve_symbol_ccl_program (AREF (slot, 1)); | 1882 | val = resolve_symbol_ccl_program (AREF (slot, 1)); |
| @@ -1900,7 +1905,7 @@ setup_ccl_program (ccl, ccl_prog) | |||
| 1900 | { | 1905 | { |
| 1901 | struct Lisp_Vector *vp; | 1906 | struct Lisp_Vector *vp; |
| 1902 | 1907 | ||
| 1903 | ccl_prog = ccl_get_compiled_code (ccl_prog); | 1908 | ccl_prog = ccl_get_compiled_code (ccl_prog, &ccl->idx); |
| 1904 | if (! VECTORP (ccl_prog)) | 1909 | if (! VECTORP (ccl_prog)) |
| 1905 | return -1; | 1910 | return -1; |
| 1906 | vp = XVECTOR (ccl_prog); | 1911 | vp = XVECTOR (ccl_prog); |
| @@ -1908,6 +1913,13 @@ setup_ccl_program (ccl, ccl_prog) | |||
| 1908 | ccl->prog = vp->contents; | 1913 | ccl->prog = vp->contents; |
| 1909 | ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]); | 1914 | ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]); |
| 1910 | ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]); | 1915 | ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]); |
| 1916 | if (ccl->idx >= 0) | ||
| 1917 | { | ||
| 1918 | Lisp_Object slot; | ||
| 1919 | |||
| 1920 | slot = AREF (Vccl_program_table, ccl->idx); | ||
| 1921 | ASET (slot, 3, Qnil); | ||
| 1922 | } | ||
| 1911 | } | 1923 | } |
| 1912 | ccl->ic = CCL_HEADER_MAIN; | 1924 | ccl->ic = CCL_HEADER_MAIN; |
| 1913 | for (i = 0; i < 8; i++) | 1925 | for (i = 0; i < 8; i++) |
| @@ -1921,6 +1933,33 @@ setup_ccl_program (ccl, ccl_prog) | |||
| 1921 | return 0; | 1933 | return 0; |
| 1922 | } | 1934 | } |
| 1923 | 1935 | ||
| 1936 | |||
| 1937 | /* Check if CCL is updated or not. If not, re-setup members of CCL. */ | ||
| 1938 | |||
| 1939 | int | ||
| 1940 | check_ccl_update (ccl) | ||
| 1941 | struct ccl_program *ccl; | ||
| 1942 | { | ||
| 1943 | struct Lisp_Vector *vp; | ||
| 1944 | Lisp_Object slot, ccl_prog; | ||
| 1945 | |||
| 1946 | if (ccl->idx < 0) | ||
| 1947 | return 0; | ||
| 1948 | slot = AREF (Vccl_program_table, ccl->idx); | ||
| 1949 | if (NILP (AREF (slot, 3))) | ||
| 1950 | return 0; | ||
| 1951 | ccl_prog = ccl_get_compiled_code (AREF (slot, 0), &ccl->idx); | ||
| 1952 | if (! VECTORP (ccl_prog)) | ||
| 1953 | return -1; | ||
| 1954 | ccl->size = ASIZE (ccl_prog); | ||
| 1955 | ccl->prog = XVECTOR (ccl_prog)->contents; | ||
| 1956 | ccl->eof_ic = XINT (AREF (ccl_prog, CCL_HEADER_EOF)); | ||
| 1957 | ccl->buf_magnification = XINT (AREF (ccl_prog, CCL_HEADER_BUF_MAG)); | ||
| 1958 | ASET (slot, 3, Qnil); | ||
| 1959 | return 0; | ||
| 1960 | } | ||
| 1961 | |||
| 1962 | |||
| 1924 | DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, | 1963 | DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, |
| 1925 | doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. | 1964 | doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. |
| 1926 | See the documentation of `define-ccl-program' for the detail of CCL program. */) | 1965 | See the documentation of `define-ccl-program' for the detail of CCL program. */) |
| @@ -2178,8 +2217,9 @@ Return index number of the registered CCL program. */) | |||
| 2178 | if (EQ (name, AREF (slot, 0))) | 2217 | if (EQ (name, AREF (slot, 0))) |
| 2179 | { | 2218 | { |
| 2180 | /* Update this slot. */ | 2219 | /* Update this slot. */ |
| 2181 | AREF (slot, 1) = ccl_prog; | 2220 | ASET (slot, 1, ccl_prog); |
| 2182 | AREF (slot, 2) = resolved; | 2221 | ASET (slot, 2, resolved); |
| 2222 | ASET (slot, 3, Qt); | ||
| 2183 | return make_number (idx); | 2223 | return make_number (idx); |
| 2184 | } | 2224 | } |
| 2185 | } | 2225 | } |
| @@ -2192,19 +2232,19 @@ Return index number of the registered CCL program. */) | |||
| 2192 | 2232 | ||
| 2193 | new_table = Fmake_vector (make_number (len * 2), Qnil); | 2233 | new_table = Fmake_vector (make_number (len * 2), Qnil); |
| 2194 | for (j = 0; j < len; j++) | 2234 | for (j = 0; j < len; j++) |
| 2195 | AREF (new_table, j) | 2235 | ASET (new_table, j, AREF (Vccl_program_table, j)); |
| 2196 | = AREF (Vccl_program_table, j); | ||
| 2197 | Vccl_program_table = new_table; | 2236 | Vccl_program_table = new_table; |
| 2198 | } | 2237 | } |
| 2199 | 2238 | ||
| 2200 | { | 2239 | { |
| 2201 | Lisp_Object elt; | 2240 | Lisp_Object elt; |
| 2202 | 2241 | ||
| 2203 | elt = Fmake_vector (make_number (3), Qnil); | 2242 | elt = Fmake_vector (make_number (4), Qnil); |
| 2204 | AREF (elt, 0) = name; | 2243 | ASET (elt, 0, name); |
| 2205 | AREF (elt, 1) = ccl_prog; | 2244 | ASET (elt, 1, ccl_prog); |
| 2206 | AREF (elt, 2) = resolved; | 2245 | ASET (elt, 2, resolved); |
| 2207 | AREF (Vccl_program_table, idx) = elt; | 2246 | ASET (elt, 3, Qt); |
| 2247 | ASET (Vccl_program_table, idx, elt); | ||
| 2208 | } | 2248 | } |
| 2209 | 2249 | ||
| 2210 | Fput (name, Qccl_program_idx, make_number (idx)); | 2250 | Fput (name, Qccl_program_idx, make_number (idx)); |
| @@ -36,6 +36,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 36 | /* Structure to hold information about running CCL code. Read | 36 | /* Structure to hold information about running CCL code. Read |
| 37 | comments in the file ccl.c for the detail of each field. */ | 37 | comments in the file ccl.c for the detail of each field. */ |
| 38 | struct ccl_program { | 38 | struct ccl_program { |
| 39 | int idx; /* Index number of the CCL program. | ||
| 40 | -1 means that the program was given | ||
| 41 | by a vector, not by a program | ||
| 42 | name. */ | ||
| 39 | int size; /* Size of the compiled code. */ | 43 | int size; /* Size of the compiled code. */ |
| 40 | Lisp_Object *prog; /* Pointer into the compiled code. */ | 44 | Lisp_Object *prog; /* Pointer into the compiled code. */ |
| 41 | int ic; /* Instruction Counter (index for PROG). */ | 45 | int ic; /* Instruction Counter (index for PROG). */ |
| @@ -91,6 +95,9 @@ extern Lisp_Object Vfont_ccl_encoder_alist; | |||
| 91 | execution of ccl program CCL_PROG (symbol or vector). */ | 95 | execution of ccl program CCL_PROG (symbol or vector). */ |
| 92 | extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object)); | 96 | extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object)); |
| 93 | 97 | ||
| 98 | /* Check if CCL is updated or not. If not, re-setup members of CCL. */ | ||
| 99 | extern int check_ccl_update P_ ((struct ccl_program *)); | ||
| 100 | |||
| 94 | extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int, | 101 | extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int, |
| 95 | Lisp_Object)); | 102 | Lisp_Object)); |
| 96 | 103 | ||
diff --git a/src/emacs.c b/src/emacs.c index 65a6d549845..013dd1c8918 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 44 | #include <fcntl.h> | 44 | #include <fcntl.h> |
| 45 | #include <windows.h> /* just for w32.h */ | 45 | #include <windows.h> /* just for w32.h */ |
| 46 | #include "w32.h" | 46 | #include "w32.h" |
| 47 | #include "w32heap.h" /* for prototype of sbrk */ | ||
| 47 | #endif | 48 | #endif |
| 48 | 49 | ||
| 49 | #include "lisp.h" | 50 | #include "lisp.h" |
diff --git a/src/eval.c b/src/eval.c index 7f043daa555..0eb1482ee0b 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2292,7 +2292,7 @@ static Lisp_Object run_hook_with_args P_ ((int, Lisp_Object *, | |||
| 2292 | enum run_hooks_condition)); | 2292 | enum run_hooks_condition)); |
| 2293 | 2293 | ||
| 2294 | DEFUN ("run-hooks", Frun_hooks, Srun_hooks, 0, MANY, 0, | 2294 | DEFUN ("run-hooks", Frun_hooks, Srun_hooks, 0, MANY, 0, |
| 2295 | doc: /* Run each hook in HOOKS. Major mode functions use this. | 2295 | doc: /* Run each hook in HOOKS. |
| 2296 | Each argument should be a symbol, a hook variable. | 2296 | Each argument should be a symbol, a hook variable. |
| 2297 | These symbols are processed in the order specified. | 2297 | These symbols are processed in the order specified. |
| 2298 | If a hook symbol has a non-nil value, that value may be a function | 2298 | If a hook symbol has a non-nil value, that value may be a function |
| @@ -2300,6 +2300,9 @@ or a list of functions to be called to run the hook. | |||
| 2300 | If the value is a function, it is called with no arguments. | 2300 | If the value is a function, it is called with no arguments. |
| 2301 | If it is a list, the elements are called, in order, with no arguments. | 2301 | If it is a list, the elements are called, in order, with no arguments. |
| 2302 | 2302 | ||
| 2303 | Major modes should not use this function directly to run their mode | ||
| 2304 | hook; they should use `run-mode-hooks' instead. | ||
| 2305 | |||
| 2303 | Do not use `make-local-variable' to make a hook variable buffer-local. | 2306 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 2304 | Instead, use `add-hook' and specify t for the LOCAL argument. | 2307 | Instead, use `add-hook' and specify t for the LOCAL argument. |
| 2305 | usage: (run-hooks &rest HOOKS) */) | 2308 | usage: (run-hooks &rest HOOKS) */) |
| @@ -3127,10 +3130,10 @@ unbind_to (count, value) | |||
| 3127 | int count; | 3130 | int count; |
| 3128 | Lisp_Object value; | 3131 | Lisp_Object value; |
| 3129 | { | 3132 | { |
| 3130 | int quitf = !NILP (Vquit_flag); | 3133 | Lisp_Object quitf = Vquit_flag; |
| 3131 | struct gcpro gcpro1; | 3134 | struct gcpro gcpro1, gcpro2; |
| 3132 | 3135 | ||
| 3133 | GCPRO1 (value); | 3136 | GCPRO2 (value, quitf); |
| 3134 | Vquit_flag = Qnil; | 3137 | Vquit_flag = Qnil; |
| 3135 | 3138 | ||
| 3136 | while (specpdl_ptr != specpdl + count) | 3139 | while (specpdl_ptr != specpdl + count) |
| @@ -3179,8 +3182,8 @@ unbind_to (count, value) | |||
| 3179 | } | 3182 | } |
| 3180 | } | 3183 | } |
| 3181 | 3184 | ||
| 3182 | if (NILP (Vquit_flag) && quitf) | 3185 | if (NILP (Vquit_flag) && !NILP (quitf)) |
| 3183 | Vquit_flag = Qt; | 3186 | Vquit_flag = quitf; |
| 3184 | 3187 | ||
| 3185 | UNGCPRO; | 3188 | UNGCPRO; |
| 3186 | return value; | 3189 | return value; |
diff --git a/src/fileio.c b/src/fileio.c index 4a22cc0a59e..813c3033d67 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3750,7 +3750,7 @@ actually used. */) | |||
| 3750 | int set_coding_system = 0; | 3750 | int set_coding_system = 0; |
| 3751 | Lisp_Object coding_system; | 3751 | Lisp_Object coding_system; |
| 3752 | int read_quit = 0; | 3752 | int read_quit = 0; |
| 3753 | int old_Vdeactivate_mark = Vdeactivate_mark; | 3753 | Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark; |
| 3754 | int we_locked_file = 0; | 3754 | int we_locked_file = 0; |
| 3755 | 3755 | ||
| 3756 | if (current_buffer->base_buffer && ! NILP (visit)) | 3756 | if (current_buffer->base_buffer && ! NILP (visit)) |
| @@ -2479,9 +2479,9 @@ mapcar1 (leni, vals, fn, seq) | |||
| 2479 | else /* Must be a list, since Flength did not get an error */ | 2479 | else /* Must be a list, since Flength did not get an error */ |
| 2480 | { | 2480 | { |
| 2481 | tail = seq; | 2481 | tail = seq; |
| 2482 | for (i = 0; i < leni; i++) | 2482 | for (i = 0; i < leni && CONSP (tail); i++) |
| 2483 | { | 2483 | { |
| 2484 | dummy = call1 (fn, Fcar (tail)); | 2484 | dummy = call1 (fn, XCAR (tail)); |
| 2485 | if (vals) | 2485 | if (vals) |
| 2486 | vals[i] = dummy; | 2486 | vals[i] = dummy; |
| 2487 | tail = XCDR (tail); | 2487 | tail = XCDR (tail); |
| @@ -2521,7 +2521,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | |||
| 2521 | mapcar1 (leni, args, function, sequence); | 2521 | mapcar1 (leni, args, function, sequence); |
| 2522 | UNGCPRO; | 2522 | UNGCPRO; |
| 2523 | 2523 | ||
| 2524 | for (i = leni - 1; i >= 0; i--) | 2524 | for (i = leni - 1; i > 0; i--) |
| 2525 | args[i + i] = args[i]; | 2525 | args[i + i] = args[i]; |
| 2526 | 2526 | ||
| 2527 | for (i = 1; i < nargs; i += 2) | 2527 | for (i = 1; i < nargs; i += 2) |
diff --git a/src/image.c b/src/image.c index b61b07876d3..15e835fef3b 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -616,6 +616,10 @@ static struct image_type *image_types; | |||
| 616 | 616 | ||
| 617 | Lisp_Object Vimage_types; | 617 | Lisp_Object Vimage_types; |
| 618 | 618 | ||
| 619 | /* An alist of image types and libraries that implement the type. */ | ||
| 620 | |||
| 621 | Lisp_Object Vimage_library_alist; | ||
| 622 | |||
| 619 | /* Cache for delayed-loading image types. */ | 623 | /* Cache for delayed-loading image types. */ |
| 620 | 624 | ||
| 621 | static Lisp_Object Vimage_type_cache; | 625 | static Lisp_Object Vimage_type_cache; |
| @@ -696,7 +700,7 @@ lookup_image_type (symbol) | |||
| 696 | struct image_type *type; | 700 | struct image_type *type; |
| 697 | 701 | ||
| 698 | /* We must initialize the image-type if it hasn't been already. */ | 702 | /* We must initialize the image-type if it hasn't been already. */ |
| 699 | if (NILP (Finit_image_library (symbol, Qnil))) | 703 | if (NILP (Finit_image_library (symbol, Vimage_library_alist))) |
| 700 | return 0; /* unimplemented */ | 704 | return 0; /* unimplemented */ |
| 701 | 705 | ||
| 702 | for (type = image_types; type; type = type->next) | 706 | for (type = image_types; type; type = type->next) |
| @@ -7985,6 +7989,8 @@ of `image-library-alist', which see). */) | |||
| 7985 | void | 7989 | void |
| 7986 | syms_of_image () | 7990 | syms_of_image () |
| 7987 | { | 7991 | { |
| 7992 | extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ | ||
| 7993 | |||
| 7988 | /* Must be defined now becase we're going to update it below, while | 7994 | /* Must be defined now becase we're going to update it below, while |
| 7989 | defining the supported image types. */ | 7995 | defining the supported image types. */ |
| 7990 | DEFVAR_LISP ("image-types", &Vimage_types, | 7996 | DEFVAR_LISP ("image-types", &Vimage_types, |
| @@ -7993,6 +7999,20 @@ Each element of the list is a symbol for a image type, like 'jpeg or 'png. | |||
| 7993 | To check whether it is really supported, use `image-type-available-p'. */); | 7999 | To check whether it is really supported, use `image-type-available-p'. */); |
| 7994 | Vimage_types = Qnil; | 8000 | Vimage_types = Qnil; |
| 7995 | 8001 | ||
| 8002 | DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, | ||
| 8003 | doc: /* Alist of image types vs external libraries needed to display them. | ||
| 8004 | |||
| 8005 | Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol | ||
| 8006 | representing a supported image type, and the rest are strings giving | ||
| 8007 | alternate filenames for the corresponding external libraries. | ||
| 8008 | |||
| 8009 | Emacs tries to load the libraries in the order they appear on the | ||
| 8010 | list; if none is loaded, the running session of Emacs won't | ||
| 8011 | support the image type. Types 'pbm and 'xbm don't need to be | ||
| 8012 | listed; they're always supported. */); | ||
| 8013 | Vimage_library_alist = Qnil; | ||
| 8014 | Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt); | ||
| 8015 | |||
| 7996 | Vimage_type_cache = Qnil; | 8016 | Vimage_type_cache = Qnil; |
| 7997 | staticpro (&Vimage_type_cache); | 8017 | staticpro (&Vimage_type_cache); |
| 7998 | 8018 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 0e7fb1c2719..31c0b5d709c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1020,7 +1020,7 @@ DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", | |||
| 1020 | doc: /* Invoke the editor command loop recursively. | 1020 | doc: /* Invoke the editor command loop recursively. |
| 1021 | To get out of the recursive edit, a command can do `(throw 'exit nil)'; | 1021 | To get out of the recursive edit, a command can do `(throw 'exit nil)'; |
| 1022 | that tells this function to return. | 1022 | that tells this function to return. |
| 1023 | Alternately, `(throw 'exit t)' makes this function signal an error. | 1023 | Alternatively, `(throw 'exit t)' makes this function signal an error. |
| 1024 | This function is called by the editor initialization to begin editing. */) | 1024 | This function is called by the editor initialization to begin editing. */) |
| 1025 | () | 1025 | () |
| 1026 | { | 1026 | { |
| @@ -10546,7 +10546,7 @@ The elements of this list correspond to the arguments of | |||
| 10546 | DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, | 10546 | DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, |
| 10547 | doc: /* Return position information for pixel coordinates X and Y. | 10547 | doc: /* Return position information for pixel coordinates X and Y. |
| 10548 | By default, X and Y are relative to text area of the selected window. | 10548 | By default, X and Y are relative to text area of the selected window. |
| 10549 | Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. | 10549 | Optional third arg FRAME-OR-WINDOW non-nil specifies frame or window. |
| 10550 | If optional fourth arg WHOLE is non-nil, X is relative to the left | 10550 | If optional fourth arg WHOLE is non-nil, X is relative to the left |
| 10551 | edge of the window. | 10551 | edge of the window. |
| 10552 | 10552 | ||
| @@ -10846,7 +10846,7 @@ syms_of_keyboard () | |||
| 10846 | staticpro (&Qdrag_n_drop); | 10846 | staticpro (&Qdrag_n_drop); |
| 10847 | 10847 | ||
| 10848 | Qsave_session = intern ("save-session"); | 10848 | Qsave_session = intern ("save-session"); |
| 10849 | staticpro(&Qsave_session); | 10849 | staticpro (&Qsave_session); |
| 10850 | 10850 | ||
| 10851 | Qusr1_signal = intern ("usr1-signal"); | 10851 | Qusr1_signal = intern ("usr1-signal"); |
| 10852 | staticpro (&Qusr1_signal); | 10852 | staticpro (&Qusr1_signal); |
diff --git a/src/macmenu.c b/src/macmenu.c index 54393bca594..e97a968d92d 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -602,6 +602,13 @@ list_of_items (pane) | |||
| 602 | } | 602 | } |
| 603 | } | 603 | } |
| 604 | 604 | ||
| 605 | static Lisp_Object | ||
| 606 | cleanup_popup_menu (arg) | ||
| 607 | Lisp_Object arg; | ||
| 608 | { | ||
| 609 | discard_menu_items (); | ||
| 610 | } | ||
| 611 | |||
| 605 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, | 612 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, |
| 606 | doc: /* Pop up a deck-of-cards menu and return user's selection. | 613 | doc: /* Pop up a deck-of-cards menu and return user's selection. |
| 607 | POSITION is a position specification. This is either a mouse button | 614 | POSITION is a position specification. This is either a mouse button |
| @@ -647,6 +654,8 @@ cached information about equivalent key sequences. */) | |||
| 647 | int keymaps = 0; | 654 | int keymaps = 0; |
| 648 | int for_click = 0; | 655 | int for_click = 0; |
| 649 | struct gcpro gcpro1; | 656 | struct gcpro gcpro1; |
| 657 | int specpdl_count = SPECPDL_INDEX (); | ||
| 658 | |||
| 650 | 659 | ||
| 651 | #ifdef HAVE_MENUS | 660 | #ifdef HAVE_MENUS |
| 652 | if (! NILP (position)) | 661 | if (! NILP (position)) |
| @@ -806,13 +815,13 @@ cached information about equivalent key sequences. */) | |||
| 806 | 815 | ||
| 807 | #ifdef HAVE_MENUS | 816 | #ifdef HAVE_MENUS |
| 808 | /* Display them in a menu. */ | 817 | /* Display them in a menu. */ |
| 818 | record_unwind_protect (cleanup_popup_menu, Qnil); | ||
| 809 | BLOCK_INPUT; | 819 | BLOCK_INPUT; |
| 810 | 820 | ||
| 811 | selection = mac_menu_show (f, xpos, ypos, for_click, | 821 | selection = mac_menu_show (f, xpos, ypos, for_click, |
| 812 | keymaps, title, &error_name); | 822 | keymaps, title, &error_name); |
| 813 | UNBLOCK_INPUT; | 823 | UNBLOCK_INPUT; |
| 814 | 824 | unbind_to (specpdl_count, Qnil); | |
| 815 | discard_menu_items (); | ||
| 816 | 825 | ||
| 817 | UNGCPRO; | 826 | UNGCPRO; |
| 818 | #endif /* HAVE_MENUS */ | 827 | #endif /* HAVE_MENUS */ |
| @@ -1931,6 +1940,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1931 | } | 1940 | } |
| 1932 | } | 1941 | } |
| 1933 | } | 1942 | } |
| 1943 | else if (!for_click) | ||
| 1944 | /* Make "Cancel" equivalent to C-g. */ | ||
| 1945 | Fsignal (Qquit, Qnil); | ||
| 1934 | 1946 | ||
| 1935 | return Qnil; | 1947 | return Qnil; |
| 1936 | } | 1948 | } |
diff --git a/src/macterm.c b/src/macterm.c index e79803f7c4d..13d8fb455d8 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -6277,9 +6277,10 @@ mac_to_x_fontname (name, size, style, charset) | |||
| 6277 | strcpy(family, name); | 6277 | strcpy(family, name); |
| 6278 | } | 6278 | } |
| 6279 | 6279 | ||
| 6280 | sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s", | 6280 | sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s", |
| 6281 | foundry, family, style & bold ? "bold" : "medium", | 6281 | foundry, family, style & bold ? "bold" : "medium", |
| 6282 | style & italic ? 'i' : 'r', size, size * 10, size * 10, charset); | 6282 | style & italic ? 'i' : 'r', size, size * 10, |
| 6283 | size ? 75 : 0, size ? 75 : 0, size * 10, charset); | ||
| 6283 | 6284 | ||
| 6284 | result = (char *) xmalloc (strlen (xf) + 1); | 6285 | result = (char *) xmalloc (strlen (xf) + 1); |
| 6285 | strcpy (result, xf); | 6286 | strcpy (result, xf); |
| @@ -6738,7 +6739,7 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6738 | break; | 6739 | break; |
| 6739 | } | 6740 | } |
| 6740 | else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 | 6741 | else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 |
| 6741 | && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-"))) | 6742 | && (ptr = strstr (font_name_table[i], "-0-0-0-0-m-0-"))) |
| 6742 | { | 6743 | { |
| 6743 | int former_len = ptr - font_name_table[i]; | 6744 | int former_len = ptr - font_name_table[i]; |
| 6744 | 6745 | ||
| @@ -6748,7 +6749,7 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6748 | scl_val[XLFD_SCL_PIXEL_SIZE], | 6749 | scl_val[XLFD_SCL_PIXEL_SIZE], |
| 6749 | scl_val[XLFD_SCL_POINT_SIZE], | 6750 | scl_val[XLFD_SCL_POINT_SIZE], |
| 6750 | scl_val[XLFD_SCL_AVGWIDTH], | 6751 | scl_val[XLFD_SCL_AVGWIDTH], |
| 6751 | ptr + sizeof ("-0-0-75-75-m-0-") - 1); | 6752 | ptr + sizeof ("-0-0-0-0-m-0-") - 1); |
| 6752 | fontname = mac_c_string_match (pattern_regex, scaled, | 6753 | fontname = mac_c_string_match (pattern_regex, scaled, |
| 6753 | nonspecial, exact); | 6754 | nonspecial, exact); |
| 6754 | if (!NILP (fontname)) | 6755 | if (!NILP (fontname)) |
diff --git a/src/makefile.w32-in b/src/makefile.w32-in index bd8b3ba1e36..553ebb72abb 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in | |||
| @@ -42,6 +42,8 @@ TOBJ = $(BLD)/firstfile.$(O) | |||
| 42 | TRES = $(BLD)/emacs.res | 42 | TRES = $(BLD)/emacs.res |
| 43 | TLASTLIB = $(BLD)/lastfile.$(A) | 43 | TLASTLIB = $(BLD)/lastfile.$(A) |
| 44 | 44 | ||
| 45 | DOC = $(OBJDIR)/etc/DOC-X | ||
| 46 | |||
| 45 | FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK) | 47 | FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK) |
| 46 | 48 | ||
| 47 | # | 49 | # |
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 709b32f1452..998c1f7cf05 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -354,7 +354,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 354 | #define fcloseall _fcloseall | 354 | #define fcloseall _fcloseall |
| 355 | #define fdopen _fdopen | 355 | #define fdopen _fdopen |
| 356 | #define fgetchar _fgetchar | 356 | #define fgetchar _fgetchar |
| 357 | #ifndef fileno | ||
| 357 | #define fileno _fileno | 358 | #define fileno _fileno |
| 359 | #endif | ||
| 358 | #define flushall _flushall | 360 | #define flushall _flushall |
| 359 | #define fputchar _fputchar | 361 | #define fputchar _fputchar |
| 360 | #define fsync _commit | 362 | #define fsync _commit |
| @@ -1273,7 +1273,7 @@ get_emacs_configuration_options (void) | |||
| 1273 | void | 1273 | void |
| 1274 | gettimeofday (struct timeval *tv, struct timezone *tz) | 1274 | gettimeofday (struct timeval *tv, struct timezone *tz) |
| 1275 | { | 1275 | { |
| 1276 | struct timeb tb; | 1276 | struct _timeb tb; |
| 1277 | _ftime (&tb); | 1277 | _ftime (&tb); |
| 1278 | 1278 | ||
| 1279 | tv->tv_sec = tb.time; | 1279 | tv->tv_sec = tb.time; |
| @@ -1777,7 +1777,7 @@ open_unc_volume (const char *path) | |||
| 1777 | nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; | 1777 | nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; |
| 1778 | nr.dwUsage = RESOURCEUSAGE_CONTAINER; | 1778 | nr.dwUsage = RESOURCEUSAGE_CONTAINER; |
| 1779 | nr.lpLocalName = NULL; | 1779 | nr.lpLocalName = NULL; |
| 1780 | nr.lpRemoteName = map_w32_filename (path, NULL); | 1780 | nr.lpRemoteName = (LPSTR)map_w32_filename (path, NULL); |
| 1781 | nr.lpComment = NULL; | 1781 | nr.lpComment = NULL; |
| 1782 | nr.lpProvider = NULL; | 1782 | nr.lpProvider = NULL; |
| 1783 | 1783 | ||
| @@ -3207,7 +3207,7 @@ sys_shutdown (int s, int how) | |||
| 3207 | } | 3207 | } |
| 3208 | 3208 | ||
| 3209 | int | 3209 | int |
| 3210 | sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) | 3210 | sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) |
| 3211 | { | 3211 | { |
| 3212 | if (winsock_lib == NULL) | 3212 | if (winsock_lib == NULL) |
| 3213 | { | 3213 | { |
| @@ -3219,7 +3219,7 @@ sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) | |||
| 3219 | if (fd_info[s].flags & FILE_SOCKET) | 3219 | if (fd_info[s].flags & FILE_SOCKET) |
| 3220 | { | 3220 | { |
| 3221 | int rc = pfn_setsockopt (SOCK_HANDLE (s), level, optname, | 3221 | int rc = pfn_setsockopt (SOCK_HANDLE (s), level, optname, |
| 3222 | optval, optlen); | 3222 | (const char *)optval, optlen); |
| 3223 | if (rc == SOCKET_ERROR) | 3223 | if (rc == SOCKET_ERROR) |
| 3224 | set_errno (); | 3224 | set_errno (); |
| 3225 | return rc; | 3225 | return rc; |
diff --git a/src/xdisp.c b/src/xdisp.c index 2781d4a1d2c..6ad0bb9166a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -846,8 +846,8 @@ static struct text_pos run_window_scroll_functions P_ ((Lisp_Object, | |||
| 846 | struct text_pos)); | 846 | struct text_pos)); |
| 847 | static void reconsider_clip_changes P_ ((struct window *, struct buffer *)); | 847 | static void reconsider_clip_changes P_ ((struct window *, struct buffer *)); |
| 848 | static int text_outside_line_unchanged_p P_ ((struct window *, int, int)); | 848 | static int text_outside_line_unchanged_p P_ ((struct window *, int, int)); |
| 849 | static void store_frame_title_char P_ ((char)); | 849 | static void store_mode_line_noprop_char P_ ((char)); |
| 850 | static int store_frame_title P_ ((const unsigned char *, int, int)); | 850 | static int store_mode_line_noprop P_ ((const unsigned char *, int, int)); |
| 851 | static void x_consider_frame_title P_ ((Lisp_Object)); | 851 | static void x_consider_frame_title P_ ((Lisp_Object)); |
| 852 | static void handle_stop P_ ((struct it *)); | 852 | static void handle_stop P_ ((struct it *)); |
| 853 | static int tool_bar_lines_needed P_ ((struct frame *)); | 853 | static int tool_bar_lines_needed P_ ((struct frame *)); |
| @@ -8271,52 +8271,126 @@ echo_area_display (update_frame_p) | |||
| 8271 | 8271 | ||
| 8272 | 8272 | ||
| 8273 | /*********************************************************************** | 8273 | /*********************************************************************** |
| 8274 | Frame Titles | 8274 | Mode Lines and Frame Titles |
| 8275 | ***********************************************************************/ | 8275 | ***********************************************************************/ |
| 8276 | 8276 | ||
| 8277 | /* A buffer for constructing non-propertized mode-line strings and | ||
| 8278 | frame titles in it; allocated from the heap in init_xdisp and | ||
| 8279 | resized as needed in store_mode_line_noprop_char. */ | ||
| 8277 | 8280 | ||
| 8278 | /* The frame title buffering code is also used by Fformat_mode_line. | 8281 | static char *mode_line_noprop_buf; |
| 8279 | So it is not conditioned by HAVE_WINDOW_SYSTEM. */ | ||
| 8280 | 8282 | ||
| 8281 | /* A buffer for constructing frame titles in it; allocated from the | 8283 | /* The buffer's end, and a current output position in it. */ |
| 8282 | heap in init_xdisp and resized as needed in store_frame_title_char. */ | ||
| 8283 | 8284 | ||
| 8284 | static char *frame_title_buf; | 8285 | static char *mode_line_noprop_buf_end; |
| 8286 | static char *mode_line_noprop_ptr; | ||
| 8285 | 8287 | ||
| 8286 | /* The buffer's end, and a current output position in it. */ | 8288 | #define MODE_LINE_NOPROP_LEN(start) \ |
| 8289 | ((mode_line_noprop_ptr - mode_line_noprop_buf) - start) | ||
| 8290 | |||
| 8291 | static enum { | ||
| 8292 | MODE_LINE_DISPLAY = 0, | ||
| 8293 | MODE_LINE_TITLE, | ||
| 8294 | MODE_LINE_NOPROP, | ||
| 8295 | MODE_LINE_STRING | ||
| 8296 | } mode_line_target; | ||
| 8297 | |||
| 8298 | /* Alist that caches the results of :propertize. | ||
| 8299 | Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */ | ||
| 8300 | static Lisp_Object mode_line_proptrans_alist; | ||
| 8301 | |||
| 8302 | /* List of strings making up the mode-line. */ | ||
| 8303 | static Lisp_Object mode_line_string_list; | ||
| 8287 | 8304 | ||
| 8288 | static char *frame_title_buf_end; | 8305 | /* Base face property when building propertized mode line string. */ |
| 8289 | static char *frame_title_ptr; | 8306 | static Lisp_Object mode_line_string_face; |
| 8307 | static Lisp_Object mode_line_string_face_prop; | ||
| 8308 | |||
| 8309 | |||
| 8310 | /* Unwind data for mode line strings */ | ||
| 8290 | 8311 | ||
| 8312 | static Lisp_Object Vmode_line_unwind_vector; | ||
| 8291 | 8313 | ||
| 8292 | /* Store a single character C for the frame title in frame_title_buf. | 8314 | static Lisp_Object |
| 8293 | Re-allocate frame_title_buf if necessary. */ | 8315 | format_mode_line_unwind_data (obuf) |
| 8316 | struct buffer *obuf; | ||
| 8317 | { | ||
| 8318 | int i = 0; | ||
| 8319 | Lisp_Object vector; | ||
| 8320 | |||
| 8321 | /* Reduce consing by keeping one vector in | ||
| 8322 | Vwith_echo_area_save_vector. */ | ||
| 8323 | vector = Vmode_line_unwind_vector; | ||
| 8324 | Vmode_line_unwind_vector = Qnil; | ||
| 8325 | |||
| 8326 | if (NILP (vector)) | ||
| 8327 | vector = Fmake_vector (make_number (7), Qnil); | ||
| 8328 | |||
| 8329 | AREF (vector, 0) = make_number (mode_line_target); | ||
| 8330 | AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0)); | ||
| 8331 | AREF (vector, 2) = mode_line_string_list; | ||
| 8332 | AREF (vector, 3) = mode_line_proptrans_alist; | ||
| 8333 | AREF (vector, 4) = mode_line_string_face; | ||
| 8334 | AREF (vector, 5) = mode_line_string_face_prop; | ||
| 8335 | |||
| 8336 | if (obuf) | ||
| 8337 | XSETBUFFER (AREF (vector, 6), obuf); | ||
| 8338 | else | ||
| 8339 | AREF (vector, 6) = Qnil; | ||
| 8340 | |||
| 8341 | return vector; | ||
| 8342 | } | ||
| 8343 | |||
| 8344 | static Lisp_Object | ||
| 8345 | unwind_format_mode_line (vector) | ||
| 8346 | Lisp_Object vector; | ||
| 8347 | { | ||
| 8348 | mode_line_target = XINT (AREF (vector, 0)); | ||
| 8349 | mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); | ||
| 8350 | mode_line_string_list = AREF (vector, 2); | ||
| 8351 | mode_line_proptrans_alist = AREF (vector, 3); | ||
| 8352 | mode_line_string_face = AREF (vector, 4); | ||
| 8353 | mode_line_string_face_prop = AREF (vector, 5); | ||
| 8354 | |||
| 8355 | if (!NILP (AREF (vector, 6))) | ||
| 8356 | { | ||
| 8357 | set_buffer_internal_1 (XBUFFER (AREF (vector, 6))); | ||
| 8358 | AREF (vector, 6) = Qnil; | ||
| 8359 | } | ||
| 8360 | |||
| 8361 | Vmode_line_unwind_vector = vector; | ||
| 8362 | return Qnil; | ||
| 8363 | } | ||
| 8364 | |||
| 8365 | |||
| 8366 | /* Store a single character C for the frame title in mode_line_noprop_buf. | ||
| 8367 | Re-allocate mode_line_noprop_buf if necessary. */ | ||
| 8294 | 8368 | ||
| 8295 | static void | 8369 | static void |
| 8296 | #ifdef PROTOTYPES | 8370 | #ifdef PROTOTYPES |
| 8297 | store_frame_title_char (char c) | 8371 | store_mode_line_noprop_char (char c) |
| 8298 | #else | 8372 | #else |
| 8299 | store_frame_title_char (c) | 8373 | store_mode_line_noprop_char (c) |
| 8300 | char c; | 8374 | char c; |
| 8301 | #endif | 8375 | #endif |
| 8302 | { | 8376 | { |
| 8303 | /* If output position has reached the end of the allocated buffer, | 8377 | /* If output position has reached the end of the allocated buffer, |
| 8304 | double the buffer's size. */ | 8378 | double the buffer's size. */ |
| 8305 | if (frame_title_ptr == frame_title_buf_end) | 8379 | if (mode_line_noprop_ptr == mode_line_noprop_buf_end) |
| 8306 | { | 8380 | { |
| 8307 | int len = frame_title_ptr - frame_title_buf; | 8381 | int len = MODE_LINE_NOPROP_LEN (0); |
| 8308 | int new_size = 2 * len * sizeof *frame_title_buf; | 8382 | int new_size = 2 * len * sizeof *mode_line_noprop_buf; |
| 8309 | frame_title_buf = (char *) xrealloc (frame_title_buf, new_size); | 8383 | mode_line_noprop_buf = (char *) xrealloc (mode_line_noprop_buf, new_size); |
| 8310 | frame_title_buf_end = frame_title_buf + new_size; | 8384 | mode_line_noprop_buf_end = mode_line_noprop_buf + new_size; |
| 8311 | frame_title_ptr = frame_title_buf + len; | 8385 | mode_line_noprop_ptr = mode_line_noprop_buf + len; |
| 8312 | } | 8386 | } |
| 8313 | 8387 | ||
| 8314 | *frame_title_ptr++ = c; | 8388 | *mode_line_noprop_ptr++ = c; |
| 8315 | } | 8389 | } |
| 8316 | 8390 | ||
| 8317 | 8391 | ||
| 8318 | /* Store part of a frame title in frame_title_buf, beginning at | 8392 | /* Store part of a frame title in mode_line_noprop_buf, beginning at |
| 8319 | frame_title_ptr. STR is the string to store. Do not copy | 8393 | mode_line_noprop_ptr. STR is the string to store. Do not copy |
| 8320 | characters that yield more columns than PRECISION; PRECISION <= 0 | 8394 | characters that yield more columns than PRECISION; PRECISION <= 0 |
| 8321 | means copy the whole string. Pad with spaces until FIELD_WIDTH | 8395 | means copy the whole string. Pad with spaces until FIELD_WIDTH |
| 8322 | number of characters have been copied; FIELD_WIDTH <= 0 means don't | 8396 | number of characters have been copied; FIELD_WIDTH <= 0 means don't |
| @@ -8324,7 +8398,7 @@ store_frame_title_char (c) | |||
| 8324 | frame title. */ | 8398 | frame title. */ |
| 8325 | 8399 | ||
| 8326 | static int | 8400 | static int |
| 8327 | store_frame_title (str, field_width, precision) | 8401 | store_mode_line_noprop (str, field_width, precision) |
| 8328 | const unsigned char *str; | 8402 | const unsigned char *str; |
| 8329 | int field_width, precision; | 8403 | int field_width, precision; |
| 8330 | { | 8404 | { |
| @@ -8335,19 +8409,23 @@ store_frame_title (str, field_width, precision) | |||
| 8335 | nbytes = strlen (str); | 8409 | nbytes = strlen (str); |
| 8336 | n += c_string_width (str, nbytes, precision, &dummy, &nbytes); | 8410 | n += c_string_width (str, nbytes, precision, &dummy, &nbytes); |
| 8337 | while (nbytes--) | 8411 | while (nbytes--) |
| 8338 | store_frame_title_char (*str++); | 8412 | store_mode_line_noprop_char (*str++); |
| 8339 | 8413 | ||
| 8340 | /* Fill up with spaces until FIELD_WIDTH reached. */ | 8414 | /* Fill up with spaces until FIELD_WIDTH reached. */ |
| 8341 | while (field_width > 0 | 8415 | while (field_width > 0 |
| 8342 | && n < field_width) | 8416 | && n < field_width) |
| 8343 | { | 8417 | { |
| 8344 | store_frame_title_char (' '); | 8418 | store_mode_line_noprop_char (' '); |
| 8345 | ++n; | 8419 | ++n; |
| 8346 | } | 8420 | } |
| 8347 | 8421 | ||
| 8348 | return n; | 8422 | return n; |
| 8349 | } | 8423 | } |
| 8350 | 8424 | ||
| 8425 | /*********************************************************************** | ||
| 8426 | Frame Titles | ||
| 8427 | ***********************************************************************/ | ||
| 8428 | |||
| 8351 | #ifdef HAVE_WINDOW_SYSTEM | 8429 | #ifdef HAVE_WINDOW_SYSTEM |
| 8352 | 8430 | ||
| 8353 | /* Set the title of FRAME, if it has changed. The title format is | 8431 | /* Set the title of FRAME, if it has changed. The title format is |
| @@ -8367,9 +8445,11 @@ x_consider_frame_title (frame) | |||
| 8367 | /* Do we have more than one visible frame on this X display? */ | 8445 | /* Do we have more than one visible frame on this X display? */ |
| 8368 | Lisp_Object tail; | 8446 | Lisp_Object tail; |
| 8369 | Lisp_Object fmt; | 8447 | Lisp_Object fmt; |
| 8370 | struct buffer *obuf; | 8448 | int title_start; |
| 8449 | char *title; | ||
| 8371 | int len; | 8450 | int len; |
| 8372 | struct it it; | 8451 | struct it it; |
| 8452 | int count = SPECPDL_INDEX (); | ||
| 8373 | 8453 | ||
| 8374 | for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) | 8454 | for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) |
| 8375 | { | 8455 | { |
| @@ -8388,18 +8468,22 @@ x_consider_frame_title (frame) | |||
| 8388 | multiple_frames = CONSP (tail); | 8468 | multiple_frames = CONSP (tail); |
| 8389 | 8469 | ||
| 8390 | /* Switch to the buffer of selected window of the frame. Set up | 8470 | /* Switch to the buffer of selected window of the frame. Set up |
| 8391 | frame_title_ptr so that display_mode_element will output into it; | 8471 | mode_line_target so that display_mode_element will output into |
| 8392 | then display the title. */ | 8472 | mode_line_noprop_buf; then display the title. */ |
| 8393 | obuf = current_buffer; | 8473 | record_unwind_protect (unwind_format_mode_line, |
| 8474 | format_mode_line_unwind_data (current_buffer)); | ||
| 8475 | |||
| 8394 | set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); | 8476 | set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); |
| 8395 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; | 8477 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; |
| 8396 | frame_title_ptr = frame_title_buf; | 8478 | |
| 8479 | mode_line_target = MODE_LINE_TITLE; | ||
| 8480 | title_start = MODE_LINE_NOPROP_LEN (0); | ||
| 8397 | init_iterator (&it, XWINDOW (f->selected_window), -1, -1, | 8481 | init_iterator (&it, XWINDOW (f->selected_window), -1, -1, |
| 8398 | NULL, DEFAULT_FACE_ID); | 8482 | NULL, DEFAULT_FACE_ID); |
| 8399 | display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); | 8483 | display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); |
| 8400 | len = frame_title_ptr - frame_title_buf; | 8484 | len = MODE_LINE_NOPROP_LEN (title_start); |
| 8401 | frame_title_ptr = NULL; | 8485 | title = mode_line_noprop_buf + title_start; |
| 8402 | set_buffer_internal_1 (obuf); | 8486 | unbind_to (count, Qnil); |
| 8403 | 8487 | ||
| 8404 | /* Set the title only if it's changed. This avoids consing in | 8488 | /* Set the title only if it's changed. This avoids consing in |
| 8405 | the common case where it hasn't. (If it turns out that we've | 8489 | the common case where it hasn't. (If it turns out that we've |
| @@ -8408,8 +8492,8 @@ x_consider_frame_title (frame) | |||
| 8408 | higher level than this.) */ | 8492 | higher level than this.) */ |
| 8409 | if (! STRINGP (f->name) | 8493 | if (! STRINGP (f->name) |
| 8410 | || SBYTES (f->name) != len | 8494 | || SBYTES (f->name) != len |
| 8411 | || bcmp (frame_title_buf, SDATA (f->name), len) != 0) | 8495 | || bcmp (title, SDATA (f->name), len) != 0) |
| 8412 | x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); | 8496 | x_implicitly_set_name (f, make_string (title, len), Qnil); |
| 8413 | } | 8497 | } |
| 8414 | } | 8498 | } |
| 8415 | 8499 | ||
| @@ -15693,6 +15777,7 @@ display_mode_line (w, face_id, format) | |||
| 15693 | { | 15777 | { |
| 15694 | struct it it; | 15778 | struct it it; |
| 15695 | struct face *face; | 15779 | struct face *face; |
| 15780 | int count = SPECPDL_INDEX (); | ||
| 15696 | 15781 | ||
| 15697 | init_iterator (&it, w, -1, -1, NULL, face_id); | 15782 | init_iterator (&it, w, -1, -1, NULL, face_id); |
| 15698 | prepare_desired_row (it.glyph_row); | 15783 | prepare_desired_row (it.glyph_row); |
| @@ -15703,6 +15788,11 @@ display_mode_line (w, face_id, format) | |||
| 15703 | /* Force the mode-line to be displayed in the default face. */ | 15788 | /* Force the mode-line to be displayed in the default face. */ |
| 15704 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; | 15789 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; |
| 15705 | 15790 | ||
| 15791 | record_unwind_protect (unwind_format_mode_line, | ||
| 15792 | format_mode_line_unwind_data (NULL)); | ||
| 15793 | |||
| 15794 | mode_line_target = MODE_LINE_DISPLAY; | ||
| 15795 | |||
| 15706 | /* Temporarily make frame's keyboard the current kboard so that | 15796 | /* Temporarily make frame's keyboard the current kboard so that |
| 15707 | kboard-local variables in the mode_line_format will get the right | 15797 | kboard-local variables in the mode_line_format will get the right |
| 15708 | values. */ | 15798 | values. */ |
| @@ -15710,6 +15800,8 @@ display_mode_line (w, face_id, format) | |||
| 15710 | display_mode_element (&it, 0, 0, 0, format, Qnil, 0); | 15800 | display_mode_element (&it, 0, 0, 0, format, Qnil, 0); |
| 15711 | pop_frame_kboard (); | 15801 | pop_frame_kboard (); |
| 15712 | 15802 | ||
| 15803 | unbind_to (count, Qnil); | ||
| 15804 | |||
| 15713 | /* Fill up with spaces. */ | 15805 | /* Fill up with spaces. */ |
| 15714 | display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); | 15806 | display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); |
| 15715 | 15807 | ||
| @@ -15732,18 +15824,6 @@ display_mode_line (w, face_id, format) | |||
| 15732 | return it.glyph_row->height; | 15824 | return it.glyph_row->height; |
| 15733 | } | 15825 | } |
| 15734 | 15826 | ||
| 15735 | /* Alist that caches the results of :propertize. | ||
| 15736 | Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */ | ||
| 15737 | Lisp_Object mode_line_proptrans_alist; | ||
| 15738 | |||
| 15739 | /* List of strings making up the mode-line. */ | ||
| 15740 | Lisp_Object mode_line_string_list; | ||
| 15741 | |||
| 15742 | /* Base face property when building propertized mode line string. */ | ||
| 15743 | static Lisp_Object mode_line_string_face; | ||
| 15744 | static Lisp_Object mode_line_string_face_prop; | ||
| 15745 | |||
| 15746 | |||
| 15747 | /* Contribute ELT to the mode line for window IT->w. How it | 15827 | /* Contribute ELT to the mode line for window IT->w. How it |
| 15748 | translates into text depends on its data type. | 15828 | translates into text depends on its data type. |
| 15749 | 15829 | ||
| @@ -15764,8 +15844,9 @@ static Lisp_Object mode_line_string_face_prop; | |||
| 15764 | If RISKY is nonzero, remove (disregard) any properties in any string | 15844 | If RISKY is nonzero, remove (disregard) any properties in any string |
| 15765 | we encounter, and ignore :eval and :propertize. | 15845 | we encounter, and ignore :eval and :propertize. |
| 15766 | 15846 | ||
| 15767 | If the global variable `frame_title_ptr' is non-NULL, then the output | 15847 | The global variable `mode_line_target' determines whether the |
| 15768 | is passed to `store_frame_title' instead of `display_string'. */ | 15848 | output is passed to `store_mode_line_noprop', |
| 15849 | `store_mode_line_string', or `display_string'. */ | ||
| 15769 | 15850 | ||
| 15770 | static int | 15851 | static int |
| 15771 | display_mode_element (it, depth, field_width, precision, elt, props, risky) | 15852 | display_mode_element (it, depth, field_width, precision, elt, props, risky) |
| @@ -15854,21 +15935,27 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 15854 | if (literal) | 15935 | if (literal) |
| 15855 | { | 15936 | { |
| 15856 | prec = precision - n; | 15937 | prec = precision - n; |
| 15857 | if (frame_title_ptr) | 15938 | switch (mode_line_target) |
| 15858 | n += store_frame_title (SDATA (elt), -1, prec); | 15939 | { |
| 15859 | else if (!NILP (mode_line_string_list)) | 15940 | case MODE_LINE_NOPROP: |
| 15860 | n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil); | 15941 | case MODE_LINE_TITLE: |
| 15861 | else | 15942 | n += store_mode_line_noprop (SDATA (elt), -1, prec); |
| 15862 | n += display_string (NULL, elt, Qnil, 0, 0, it, | 15943 | break; |
| 15863 | 0, prec, 0, STRING_MULTIBYTE (elt)); | 15944 | case MODE_LINE_STRING: |
| 15945 | n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil); | ||
| 15946 | break; | ||
| 15947 | case MODE_LINE_DISPLAY: | ||
| 15948 | n += display_string (NULL, elt, Qnil, 0, 0, it, | ||
| 15949 | 0, prec, 0, STRING_MULTIBYTE (elt)); | ||
| 15950 | break; | ||
| 15951 | } | ||
| 15864 | 15952 | ||
| 15865 | break; | 15953 | break; |
| 15866 | } | 15954 | } |
| 15867 | 15955 | ||
| 15868 | while ((precision <= 0 || n < precision) | 15956 | while ((precision <= 0 || n < precision) |
| 15869 | && *this | 15957 | && *this |
| 15870 | && (frame_title_ptr | 15958 | && (mode_line_target != MODE_LINE_DISPLAY |
| 15871 | || !NILP (mode_line_string_list) | ||
| 15872 | || it->current_x < it->last_visible_x)) | 15959 | || it->current_x < it->last_visible_x)) |
| 15873 | { | 15960 | { |
| 15874 | const unsigned char *last = this; | 15961 | const unsigned char *last = this; |
| @@ -15889,29 +15976,36 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 15889 | prec = c_string_width (last, this - last, precision - n, | 15976 | prec = c_string_width (last, this - last, precision - n, |
| 15890 | &nchars, &nbytes); | 15977 | &nchars, &nbytes); |
| 15891 | 15978 | ||
| 15892 | if (frame_title_ptr) | 15979 | switch (mode_line_target) |
| 15893 | n += store_frame_title (last, 0, prec); | ||
| 15894 | else if (!NILP (mode_line_string_list)) | ||
| 15895 | { | 15980 | { |
| 15896 | int bytepos = last - lisp_string; | 15981 | case MODE_LINE_NOPROP: |
| 15897 | int charpos = string_byte_to_char (elt, bytepos); | 15982 | case MODE_LINE_TITLE: |
| 15898 | int endpos = (precision <= 0 | 15983 | n += store_mode_line_noprop (last, 0, prec); |
| 15899 | ? string_byte_to_char (elt, | 15984 | break; |
| 15900 | this - lisp_string) | 15985 | case MODE_LINE_STRING: |
| 15901 | : charpos + nchars); | 15986 | { |
| 15902 | 15987 | int bytepos = last - lisp_string; | |
| 15903 | n += store_mode_line_string (NULL, | 15988 | int charpos = string_byte_to_char (elt, bytepos); |
| 15904 | Fsubstring (elt, make_number (charpos), | 15989 | int endpos = (precision <= 0 |
| 15905 | make_number (endpos)), | 15990 | ? string_byte_to_char (elt, |
| 15906 | 0, 0, 0, Qnil); | 15991 | this - lisp_string) |
| 15907 | } | 15992 | : charpos + nchars); |
| 15908 | else | 15993 | |
| 15909 | { | 15994 | n += store_mode_line_string (NULL, |
| 15910 | int bytepos = last - lisp_string; | 15995 | Fsubstring (elt, make_number (charpos), |
| 15911 | int charpos = string_byte_to_char (elt, bytepos); | 15996 | make_number (endpos)), |
| 15912 | n += display_string (NULL, elt, Qnil, 0, charpos, | 15997 | 0, 0, 0, Qnil); |
| 15913 | it, 0, prec, 0, | 15998 | } |
| 15914 | STRING_MULTIBYTE (elt)); | 15999 | break; |
| 16000 | case MODE_LINE_DISPLAY: | ||
| 16001 | { | ||
| 16002 | int bytepos = last - lisp_string; | ||
| 16003 | int charpos = string_byte_to_char (elt, bytepos); | ||
| 16004 | n += display_string (NULL, elt, Qnil, 0, charpos, | ||
| 16005 | it, 0, prec, 0, | ||
| 16006 | STRING_MULTIBYTE (elt)); | ||
| 16007 | } | ||
| 16008 | break; | ||
| 15915 | } | 16009 | } |
| 15916 | } | 16010 | } |
| 15917 | else /* c == '%' */ | 16011 | else /* c == '%' */ |
| @@ -15949,44 +16043,51 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 15949 | spec | 16043 | spec |
| 15950 | = decode_mode_spec (it->w, c, field, prec, &multibyte); | 16044 | = decode_mode_spec (it->w, c, field, prec, &multibyte); |
| 15951 | 16045 | ||
| 15952 | if (frame_title_ptr) | 16046 | switch (mode_line_target) |
| 15953 | n += store_frame_title (spec, field, prec); | ||
| 15954 | else if (!NILP (mode_line_string_list)) | ||
| 15955 | { | ||
| 15956 | int len = strlen (spec); | ||
| 15957 | Lisp_Object tem = make_string (spec, len); | ||
| 15958 | props = Ftext_properties_at (make_number (charpos), elt); | ||
| 15959 | /* Should only keep face property in props */ | ||
| 15960 | n += store_mode_line_string (NULL, tem, 0, field, prec, props); | ||
| 15961 | } | ||
| 15962 | else | ||
| 15963 | { | 16047 | { |
| 15964 | int nglyphs_before, nwritten; | 16048 | case MODE_LINE_NOPROP: |
| 15965 | 16049 | case MODE_LINE_TITLE: | |
| 15966 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; | 16050 | n += store_mode_line_noprop (spec, field, prec); |
| 15967 | nwritten = display_string (spec, Qnil, elt, | 16051 | break; |
| 15968 | charpos, 0, it, | 16052 | case MODE_LINE_STRING: |
| 15969 | field, prec, 0, | 16053 | { |
| 15970 | multibyte); | 16054 | int len = strlen (spec); |
| 15971 | 16055 | Lisp_Object tem = make_string (spec, len); | |
| 15972 | /* Assign to the glyphs written above the | 16056 | props = Ftext_properties_at (make_number (charpos), elt); |
| 15973 | string where the `%x' came from, position | 16057 | /* Should only keep face property in props */ |
| 15974 | of the `%'. */ | 16058 | n += store_mode_line_string (NULL, tem, 0, field, prec, props); |
| 15975 | if (nwritten > 0) | 16059 | } |
| 15976 | { | 16060 | break; |
| 15977 | struct glyph *glyph | 16061 | case MODE_LINE_DISPLAY: |
| 15978 | = (it->glyph_row->glyphs[TEXT_AREA] | 16062 | { |
| 15979 | + nglyphs_before); | 16063 | int nglyphs_before, nwritten; |
| 15980 | int i; | 16064 | |
| 15981 | 16065 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; | |
| 15982 | for (i = 0; i < nwritten; ++i) | 16066 | nwritten = display_string (spec, Qnil, elt, |
| 15983 | { | 16067 | charpos, 0, it, |
| 15984 | glyph[i].object = elt; | 16068 | field, prec, 0, |
| 15985 | glyph[i].charpos = charpos; | 16069 | multibyte); |
| 15986 | } | 16070 | |
| 15987 | 16071 | /* Assign to the glyphs written above the | |
| 15988 | n += nwritten; | 16072 | string where the `%x' came from, position |
| 15989 | } | 16073 | of the `%'. */ |
| 16074 | if (nwritten > 0) | ||
| 16075 | { | ||
| 16076 | struct glyph *glyph | ||
| 16077 | = (it->glyph_row->glyphs[TEXT_AREA] | ||
| 16078 | + nglyphs_before); | ||
| 16079 | int i; | ||
| 16080 | |||
| 16081 | for (i = 0; i < nwritten; ++i) | ||
| 16082 | { | ||
| 16083 | glyph[i].object = elt; | ||
| 16084 | glyph[i].charpos = charpos; | ||
| 16085 | } | ||
| 16086 | |||
| 16087 | n += nwritten; | ||
| 16088 | } | ||
| 16089 | } | ||
| 16090 | break; | ||
| 15990 | } | 16091 | } |
| 15991 | } | 16092 | } |
| 15992 | else /* c == 0 */ | 16093 | else /* c == 0 */ |
| @@ -16157,13 +16258,20 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16157 | /* Pad to FIELD_WIDTH. */ | 16258 | /* Pad to FIELD_WIDTH. */ |
| 16158 | if (field_width > 0 && n < field_width) | 16259 | if (field_width > 0 && n < field_width) |
| 16159 | { | 16260 | { |
| 16160 | if (frame_title_ptr) | 16261 | switch (mode_line_target) |
| 16161 | n += store_frame_title ("", field_width - n, 0); | 16262 | { |
| 16162 | else if (!NILP (mode_line_string_list)) | 16263 | case MODE_LINE_NOPROP: |
| 16163 | n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil); | 16264 | case MODE_LINE_TITLE: |
| 16164 | else | 16265 | n += store_mode_line_noprop ("", field_width - n, 0); |
| 16165 | n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, | 16266 | break; |
| 16166 | 0, 0, 0); | 16267 | case MODE_LINE_STRING: |
| 16268 | n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil); | ||
| 16269 | break; | ||
| 16270 | case MODE_LINE_DISPLAY: | ||
| 16271 | n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, | ||
| 16272 | 0, 0, 0); | ||
| 16273 | break; | ||
| 16274 | } | ||
| 16167 | } | 16275 | } |
| 16168 | 16276 | ||
| 16169 | return n; | 16277 | return n; |
| @@ -16295,6 +16403,9 @@ are the selected window and the window's buffer). */) | |||
| 16295 | struct buffer *old_buffer = NULL; | 16403 | struct buffer *old_buffer = NULL; |
| 16296 | int face_id = -1; | 16404 | int face_id = -1; |
| 16297 | int no_props = INTEGERP (face); | 16405 | int no_props = INTEGERP (face); |
| 16406 | int count = SPECPDL_INDEX (); | ||
| 16407 | Lisp_Object str; | ||
| 16408 | int string_start = 0; | ||
| 16298 | 16409 | ||
| 16299 | if (NILP (window)) | 16410 | if (NILP (window)) |
| 16300 | window = selected_window; | 16411 | window = selected_window; |
| @@ -16322,64 +16433,50 @@ are the selected window and the window's buffer). */) | |||
| 16322 | face_id = DEFAULT_FACE_ID; | 16433 | face_id = DEFAULT_FACE_ID; |
| 16323 | 16434 | ||
| 16324 | if (XBUFFER (buffer) != current_buffer) | 16435 | if (XBUFFER (buffer) != current_buffer) |
| 16325 | { | 16436 | old_buffer = current_buffer; |
| 16326 | old_buffer = current_buffer; | 16437 | |
| 16327 | set_buffer_internal_1 (XBUFFER (buffer)); | 16438 | record_unwind_protect (unwind_format_mode_line, |
| 16328 | } | 16439 | format_mode_line_unwind_data (old_buffer)); |
| 16440 | |||
| 16441 | if (old_buffer) | ||
| 16442 | set_buffer_internal_1 (XBUFFER (buffer)); | ||
| 16329 | 16443 | ||
| 16330 | init_iterator (&it, w, -1, -1, NULL, face_id); | 16444 | init_iterator (&it, w, -1, -1, NULL, face_id); |
| 16331 | 16445 | ||
| 16332 | if (!no_props) | 16446 | if (no_props) |
| 16333 | { | 16447 | { |
| 16334 | mode_line_string_face = face; | 16448 | mode_line_target = MODE_LINE_NOPROP; |
| 16335 | mode_line_string_face_prop | 16449 | mode_line_string_face_prop = Qnil; |
| 16336 | = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); | 16450 | mode_line_string_list = Qnil; |
| 16337 | 16451 | string_start = MODE_LINE_NOPROP_LEN (0); | |
| 16338 | /* We need a dummy last element in mode_line_string_list to | ||
| 16339 | indicate we are building the propertized mode-line string. | ||
| 16340 | Using mode_line_string_face_prop here GC protects it. */ | ||
| 16341 | mode_line_string_list | ||
| 16342 | = Fcons (mode_line_string_face_prop, Qnil); | ||
| 16343 | frame_title_ptr = NULL; | ||
| 16344 | } | 16452 | } |
| 16345 | else | 16453 | else |
| 16346 | { | 16454 | { |
| 16347 | mode_line_string_face_prop = Qnil; | 16455 | mode_line_target = MODE_LINE_STRING; |
| 16348 | mode_line_string_list = Qnil; | 16456 | mode_line_string_list = Qnil; |
| 16349 | frame_title_ptr = frame_title_buf; | 16457 | mode_line_string_face = face; |
| 16458 | mode_line_string_face_prop | ||
| 16459 | = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); | ||
| 16350 | } | 16460 | } |
| 16351 | 16461 | ||
| 16352 | push_frame_kboard (it.f); | 16462 | push_frame_kboard (it.f); |
| 16353 | display_mode_element (&it, 0, 0, 0, format, Qnil, 0); | 16463 | display_mode_element (&it, 0, 0, 0, format, Qnil, 0); |
| 16354 | pop_frame_kboard (); | 16464 | pop_frame_kboard (); |
| 16355 | 16465 | ||
| 16356 | if (old_buffer) | 16466 | if (no_props) |
| 16357 | set_buffer_internal_1 (old_buffer); | ||
| 16358 | |||
| 16359 | if (!no_props) | ||
| 16360 | { | 16467 | { |
| 16361 | Lisp_Object str; | 16468 | len = MODE_LINE_NOPROP_LEN (string_start); |
| 16362 | mode_line_string_list = Fnreverse (mode_line_string_list); | 16469 | str = make_string (mode_line_noprop_buf + string_start, len); |
| 16363 | str = Fmapconcat (intern ("identity"), XCDR (mode_line_string_list), | ||
| 16364 | make_string ("", 0)); | ||
| 16365 | mode_line_string_face_prop = Qnil; | ||
| 16366 | mode_line_string_list = Qnil; | ||
| 16367 | return str; | ||
| 16368 | } | 16470 | } |
| 16369 | 16471 | else | |
| 16370 | len = frame_title_ptr - frame_title_buf; | ||
| 16371 | if (len > 0 && frame_title_ptr[-1] == '-') | ||
| 16372 | { | 16472 | { |
| 16373 | /* Mode lines typically ends with numerous dashes; reduce to two dashes. */ | 16473 | mode_line_string_list = Fnreverse (mode_line_string_list); |
| 16374 | while (frame_title_ptr > frame_title_buf && *--frame_title_ptr == '-') | 16474 | str = Fmapconcat (intern ("identity"), mode_line_string_list, |
| 16375 | ; | 16475 | make_string ("", 0)); |
| 16376 | frame_title_ptr += 3; /* restore last non-dash + two dashes */ | ||
| 16377 | if (len > frame_title_ptr - frame_title_buf) | ||
| 16378 | len = frame_title_ptr - frame_title_buf; | ||
| 16379 | } | 16476 | } |
| 16380 | 16477 | ||
| 16381 | frame_title_ptr = NULL; | 16478 | unbind_to (count, Qnil); |
| 16382 | return make_string (frame_title_buf, len); | 16479 | return str; |
| 16383 | } | 16480 | } |
| 16384 | 16481 | ||
| 16385 | /* Write a null-terminated, right justified decimal representation of | 16482 | /* Write a null-terminated, right justified decimal representation of |
| @@ -16698,7 +16795,8 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 16698 | register int i; | 16795 | register int i; |
| 16699 | 16796 | ||
| 16700 | /* Let lots_of_dashes be a string of infinite length. */ | 16797 | /* Let lots_of_dashes be a string of infinite length. */ |
| 16701 | if (!NILP (mode_line_string_list)) | 16798 | if (mode_line_target == MODE_LINE_NOPROP || |
| 16799 | mode_line_target == MODE_LINE_STRING) | ||
| 16702 | return "--"; | 16800 | return "--"; |
| 16703 | if (field_width <= 0 | 16801 | if (field_width <= 0 |
| 16704 | || field_width > sizeof (lots_of_dashes)) | 16802 | || field_width > sizeof (lots_of_dashes)) |
| @@ -21547,7 +21645,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) | |||
| 21547 | tmp_glyph->charpos >= XINT (b); | 21645 | tmp_glyph->charpos >= XINT (b); |
| 21548 | tmp_glyph--, gpos++) | 21646 | tmp_glyph--, gpos++) |
| 21549 | { | 21647 | { |
| 21550 | if (tmp_glyph->object != glyph->object) | 21648 | if (!EQ (tmp_glyph->object, glyph->object)) |
| 21551 | break; | 21649 | break; |
| 21552 | } | 21650 | } |
| 21553 | 21651 | ||
| @@ -21560,7 +21658,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) | |||
| 21560 | tmp_glyph->charpos < XINT (e); | 21658 | tmp_glyph->charpos < XINT (e); |
| 21561 | tmp_glyph++, gseq_length++) | 21659 | tmp_glyph++, gseq_length++) |
| 21562 | { | 21660 | { |
| 21563 | if (tmp_glyph->object != glyph->object) | 21661 | if (!EQ (tmp_glyph->object, glyph->object)) |
| 21564 | break; | 21662 | break; |
| 21565 | } | 21663 | } |
| 21566 | 21664 | ||
| @@ -21590,6 +21688,9 @@ note_mode_line_or_margin_highlight (window, x, y, area) | |||
| 21590 | 0, 0, 0, &ignore, | 21688 | 0, 0, 0, &ignore, |
| 21591 | glyph->face_id, 1); | 21689 | glyph->face_id, 1); |
| 21592 | show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); | 21690 | show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); |
| 21691 | |||
| 21692 | if (NILP (pointer)) | ||
| 21693 | pointer = Qhand; | ||
| 21593 | } | 21694 | } |
| 21594 | } | 21695 | } |
| 21595 | 21696 | ||
| @@ -22833,9 +22934,14 @@ syms_of_xdisp () | |||
| 22833 | 22934 | ||
| 22834 | mode_line_proptrans_alist = Qnil; | 22935 | mode_line_proptrans_alist = Qnil; |
| 22835 | staticpro (&mode_line_proptrans_alist); | 22936 | staticpro (&mode_line_proptrans_alist); |
| 22836 | |||
| 22837 | mode_line_string_list = Qnil; | 22937 | mode_line_string_list = Qnil; |
| 22838 | staticpro (&mode_line_string_list); | 22938 | staticpro (&mode_line_string_list); |
| 22939 | mode_line_string_face = Qnil; | ||
| 22940 | staticpro (&mode_line_string_face); | ||
| 22941 | mode_line_string_face_prop = Qnil; | ||
| 22942 | staticpro (&mode_line_string_face_prop); | ||
| 22943 | Vmode_line_unwind_vector = Qnil; | ||
| 22944 | staticpro (&Vmode_line_unwind_vector); | ||
| 22839 | 22945 | ||
| 22840 | help_echo_string = Qnil; | 22946 | help_echo_string = Qnil; |
| 22841 | staticpro (&help_echo_string); | 22947 | staticpro (&help_echo_string); |
| @@ -23185,9 +23291,10 @@ init_xdisp () | |||
| 23185 | /* Allocate the buffer for frame titles. | 23291 | /* Allocate the buffer for frame titles. |
| 23186 | Also used for `format-mode-line'. */ | 23292 | Also used for `format-mode-line'. */ |
| 23187 | int size = 100; | 23293 | int size = 100; |
| 23188 | frame_title_buf = (char *) xmalloc (size); | 23294 | mode_line_noprop_buf = (char *) xmalloc (size); |
| 23189 | frame_title_buf_end = frame_title_buf + size; | 23295 | mode_line_noprop_buf_end = mode_line_noprop_buf + size; |
| 23190 | frame_title_ptr = NULL; | 23296 | mode_line_noprop_ptr = mode_line_noprop_buf; |
| 23297 | mode_line_target = MODE_LINE_DISPLAY; | ||
| 23191 | } | 23298 | } |
| 23192 | 23299 | ||
| 23193 | help_echo_showing_p = 0; | 23300 | help_echo_showing_p = 0; |
diff --git a/src/xfaces.c b/src/xfaces.c index edff936b08d..97bdd380dee 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -5128,8 +5128,8 @@ lface_equal_p (v1, v2) | |||
| 5128 | DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p, | 5128 | DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p, |
| 5129 | Sinternal_lisp_face_equal_p, 2, 3, 0, | 5129 | Sinternal_lisp_face_equal_p, 2, 3, 0, |
| 5130 | doc: /* True if FACE1 and FACE2 are equal. | 5130 | doc: /* True if FACE1 and FACE2 are equal. |
| 5131 | If the optional argument FRAME is given, report on face FACE in that frame. | 5131 | If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame. |
| 5132 | If FRAME is t, report on the defaults for face FACE (for new frames). | 5132 | If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames). |
| 5133 | If FRAME is omitted or nil, use the selected frame. */) | 5133 | If FRAME is omitted or nil, use the selected frame. */) |
| 5134 | (face1, face2, frame) | 5134 | (face1, face2, frame) |
| 5135 | Lisp_Object face1, face2, frame; | 5135 | Lisp_Object face1, face2, frame; |
| @@ -5137,8 +5137,8 @@ If FRAME is omitted or nil, use the selected frame. */) | |||
| 5137 | int equal_p; | 5137 | int equal_p; |
| 5138 | Lisp_Object lface1, lface2; | 5138 | Lisp_Object lface1, lface2; |
| 5139 | 5139 | ||
| 5140 | lface1 = lface_from_face_name (NULL, face1, 1); | 5140 | lface1 = lface_from_face_name (f, face1, 1); |
| 5141 | lface2 = lface_from_face_name (NULL, face2, 1); | 5141 | lface2 = lface_from_face_name (f, face2, 1); |
| 5142 | equal_p = lface_equal_p (XVECTOR (lface1)->contents, | 5142 | equal_p = lface_equal_p (XVECTOR (lface1)->contents, |
| 5143 | XVECTOR (lface2)->contents); | 5143 | XVECTOR (lface2)->contents); |
| 5144 | return equal_p ? Qt : Qnil; | 5144 | return equal_p ? Qt : Qnil; |
| @@ -6580,12 +6580,12 @@ build_scalable_font_name (f, font, specified_pt) | |||
| 6580 | if (font->numeric[XLFD_RESY] != 0) | 6580 | if (font->numeric[XLFD_RESY] != 0) |
| 6581 | { | 6581 | { |
| 6582 | pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5; | 6582 | pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5; |
| 6583 | pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt; | 6583 | pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt + 0.5; |
| 6584 | } | 6584 | } |
| 6585 | else | 6585 | else |
| 6586 | { | 6586 | { |
| 6587 | pt = specified_pt; | 6587 | pt = specified_pt; |
| 6588 | pixel_value = resy / (PT_PER_INCH * 10.0) * pt; | 6588 | pixel_value = resy / (PT_PER_INCH * 10.0) * pt + 0.5; |
| 6589 | } | 6589 | } |
| 6590 | /* We may need a font of the different size. */ | 6590 | /* We may need a font of the different size. */ |
| 6591 | pixel_value *= font->rescale_ratio; | 6591 | pixel_value *= font->rescale_ratio; |
diff --git a/src/xmenu.c b/src/xmenu.c index 9103d32e1c9..826c9330c46 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1235,6 +1235,10 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers) | |||
| 1235 | if (event.type == ButtonRelease | 1235 | if (event.type == ButtonRelease |
| 1236 | && dpyinfo->display == event.xbutton.display) | 1236 | && dpyinfo->display == event.xbutton.display) |
| 1237 | { | 1237 | { |
| 1238 | /* If the click is not on the menu, deactivate the menu. */ | ||
| 1239 | if (x_any_window_to_frame (dpyinfo, event.xexpose.window)) | ||
| 1240 | popup_activated_flag = 0; | ||
| 1241 | |||
| 1238 | dpyinfo->grabbed &= ~(1 << event.xbutton.button); | 1242 | dpyinfo->grabbed &= ~(1 << event.xbutton.button); |
| 1239 | #ifdef USE_MOTIF /* Pretending that the event came from a | 1243 | #ifdef USE_MOTIF /* Pretending that the event came from a |
| 1240 | Btn1Down seems the only way to convince Motif to | 1244 | Btn1Down seems the only way to convince Motif to |
diff --git a/src/xterm.c b/src/xterm.c index 01612d0d0ae..be61c15afdd 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -906,6 +906,7 @@ x_encode_char (c, char2b, font_info, charset, two_byte_p) | |||
| 906 | /* It's a program. */ | 906 | /* It's a program. */ |
| 907 | struct ccl_program *ccl = font_info->font_encoder; | 907 | struct ccl_program *ccl = font_info->font_encoder; |
| 908 | 908 | ||
| 909 | check_ccl_update (ccl); | ||
| 909 | if (CHARSET_DIMENSION (charset) == 1) | 910 | if (CHARSET_DIMENSION (charset) == 1) |
| 910 | { | 911 | { |
| 911 | ccl->reg[0] = CHARSET_ID (charset); | 912 | ccl->reg[0] = CHARSET_ID (charset); |
| @@ -6782,12 +6783,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6782 | { | 6783 | { |
| 6783 | dpyinfo->grabbed |= (1 << event.xbutton.button); | 6784 | dpyinfo->grabbed |= (1 << event.xbutton.button); |
| 6784 | last_mouse_frame = f; | 6785 | last_mouse_frame = f; |
| 6785 | /* Ignore any mouse motion that happened | ||
| 6786 | before this event; any subsequent mouse-movement | ||
| 6787 | Emacs events should reflect only motion after | ||
| 6788 | the ButtonPress. */ | ||
| 6789 | if (f != 0) | ||
| 6790 | f->mouse_moved = 0; | ||
| 6791 | 6786 | ||
| 6792 | if (!tool_bar_p) | 6787 | if (!tool_bar_p) |
| 6793 | last_tool_bar_item = -1; | 6788 | last_tool_bar_item = -1; |
| @@ -6795,6 +6790,12 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6795 | else | 6790 | else |
| 6796 | dpyinfo->grabbed &= ~(1 << event.xbutton.button); | 6791 | dpyinfo->grabbed &= ~(1 << event.xbutton.button); |
| 6797 | 6792 | ||
| 6793 | /* Ignore any mouse motion that happened before this event; | ||
| 6794 | any subsequent mouse-movement Emacs events should reflect | ||
| 6795 | only motion after the ButtonPress/Release. */ | ||
| 6796 | if (f != 0) | ||
| 6797 | f->mouse_moved = 0; | ||
| 6798 | |||
| 6798 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6799 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 6799 | f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); | 6800 | f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); |
| 6800 | /* For a down-event in the menu bar, | 6801 | /* For a down-event in the menu bar, |