diff options
| author | Karoly Lorentey | 2004-12-08 22:20:27 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-12-08 22:20:27 +0000 |
| commit | fad2f6858075f49c4c8fd16f0535c287e3f14ac3 (patch) | |
| tree | 843a2ffe6caea6201877e3d2f1b6b954f47344b5 /src | |
| parent | 856dd47583918edd7987c13334703d3e7492d8f4 (diff) | |
| parent | b11e88237593ff7556d8535305e8f342e6b61d66 (diff) | |
| download | emacs-fad2f6858075f49c4c8fd16f0535c287e3f14ac3.tar.gz emacs-fad2f6858075f49c4c8fd16f0535c287e3f14ac3.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-714
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-271
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 457 | ||||
| -rw-r--r-- | src/Makefile.in | 4 | ||||
| -rw-r--r-- | src/alloc.c | 293 | ||||
| -rw-r--r-- | src/buffer.c | 17 | ||||
| -rw-r--r-- | src/buildobj.lst | 1 | ||||
| -rw-r--r-- | src/coding.c | 108 | ||||
| -rw-r--r-- | src/coding.h | 17 | ||||
| -rw-r--r-- | src/config.in | 6 | ||||
| -rw-r--r-- | src/data.c | 7 | ||||
| -rw-r--r-- | src/dispextern.h | 6 | ||||
| -rw-r--r-- | src/emacs.c | 14 | ||||
| -rw-r--r-- | src/eval.c | 23 | ||||
| -rw-r--r-- | src/filelock.c | 6 | ||||
| -rw-r--r-- | src/fns.c | 6 | ||||
| -rw-r--r-- | src/fringe.c | 45 | ||||
| -rw-r--r-- | src/gtkutil.c | 38 | ||||
| -rw-r--r-- | src/image.c | 3 | ||||
| -rw-r--r-- | src/indent.c | 7 | ||||
| -rw-r--r-- | src/insdel.c | 8 | ||||
| -rw-r--r-- | src/keyboard.c | 44 | ||||
| -rw-r--r-- | src/keymap.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 30 | ||||
| -rw-r--r-- | src/lread.c | 7 | ||||
| -rw-r--r-- | src/mac.c | 16 | ||||
| -rw-r--r-- | src/macfns.c | 35 | ||||
| -rw-r--r-- | src/macmenu.c | 3 | ||||
| -rw-r--r-- | src/macterm.c | 218 | ||||
| -rw-r--r-- | src/macterm.h | 4 | ||||
| -rw-r--r-- | src/minibuf.c | 2 | ||||
| -rw-r--r-- | src/regex.c | 53 | ||||
| -rw-r--r-- | src/s/darwin.h | 11 | ||||
| -rw-r--r-- | src/s/gnu-linux.h | 14 | ||||
| -rw-r--r-- | src/search.c | 10 | ||||
| -rw-r--r-- | src/sysdep.c | 26 | ||||
| -rw-r--r-- | src/term.c | 253 | ||||
| -rw-r--r-- | src/w32console.c | 104 | ||||
| -rw-r--r-- | src/window.c | 21 | ||||
| -rw-r--r-- | src/xdisp.c | 124 | ||||
| -rw-r--r-- | src/xfaces.c | 13 | ||||
| -rw-r--r-- | src/xfns.c | 20 | ||||
| -rw-r--r-- | src/xmenu.c | 48 |
41 files changed, 1469 insertions, 655 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0d74afca197..3064999717f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,315 @@ | |||
| 1 | 2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xmenu.c (Fx_popup_menu): Correct documentation about position. | ||
| 4 | (xmenu_show): Do not call XTranslateCoordinates. Adjust position | ||
| 5 | if not given by a mouse click to correspond with x-popup-menu | ||
| 6 | documentation. | ||
| 7 | |||
| 8 | * config.in: Regenerate. | ||
| 9 | |||
| 10 | * gtkutil.c: Include signal.h and syssignal.h. | ||
| 11 | (xg_get_file_name): Block and unblock __SIGRTMIN if defined. | ||
| 12 | |||
| 13 | * alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h, | ||
| 14 | new variables main_thread and alloc_mutex, | ||
| 15 | define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect | ||
| 16 | emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread. | ||
| 17 | If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same as | ||
| 18 | (UN)BLOCK_INPUT. | ||
| 19 | (emacs_blocked_free, emacs_blocked_malloc) | ||
| 20 | (emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC. | ||
| 21 | (uninterrupt_malloc): Initialize main_thread and alloc_mutex. | ||
| 22 | (reset_malloc_hooks): New function. | ||
| 23 | |||
| 24 | * lisp.h: Declare reset_malloc_hooks. | ||
| 25 | |||
| 26 | * emacs.c (Fdump_emacs): Call reset_malloc_hooks. | ||
| 27 | |||
| 28 | * keyboard.c: Conditionally include pthread.h | ||
| 29 | (handle_async_inpu, input_available_signalt): If not in the main | ||
| 30 | thread, block signal, send signal to main thread and return. | ||
| 31 | |||
| 32 | * gtkutil.c (xg_get_file_with_chooser): Handle local files only. | ||
| 33 | Set current folder in file chooser if default_filename is a | ||
| 34 | directory. | ||
| 35 | |||
| 36 | 2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 37 | |||
| 38 | * regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end. | ||
| 39 | Remove redundant correctness checks. | ||
| 40 | (regex_compile): Fix up error codes for \{..\} expressions. | ||
| 41 | |||
| 42 | 2004-12-05 Richard M. Stallman <rms@gnu.org> | ||
| 43 | |||
| 44 | * regex.c (regex_compile): Fix end-of-pattern case for space. | ||
| 45 | |||
| 46 | 2004-12-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 47 | |||
| 48 | * macterm.h (cfstring_create_with_utf8_cstring): Add prototype. | ||
| 49 | * mac.c (cfstring_create_with_utf8_cstring): Add to prevent | ||
| 50 | crashes with invalid characters. | ||
| 51 | * macmenu.c (add_menu_item): Use it. | ||
| 52 | * image.c (image_load_quartz2d): Likewise. | ||
| 53 | * macfns.c (x_set_name, x_set_title): Likewise. | ||
| 54 | (Fx_file_dialog): Likewise. Use constant CFRefs instead of | ||
| 55 | creating them each time for labels. | ||
| 56 | |||
| 57 | 2004-12-02 Richard M. Stallman <rms@gnu.org> | ||
| 58 | |||
| 59 | * config.in (RE_TRANSLATE_P): If make_number is not a macro, | ||
| 60 | don't use it here. | ||
| 61 | |||
| 62 | * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE. | ||
| 63 | (interactive_p): Skip Scalled_interactively_p frames | ||
| 64 | like Sinteractive_p frames. | ||
| 65 | |||
| 66 | * data.c (Fmake_variable_buffer_local): Doc fix. | ||
| 67 | (Fmake_local_variable): Doc fix. | ||
| 68 | |||
| 69 | * insdel.c (insert_from_string_before_markers) | ||
| 70 | (insert_from_string): Don't modify buffer on empty insertion. | ||
| 71 | |||
| 72 | * window.c (Fget_lru_window, Fget_largest_window): Doc fixes. | ||
| 73 | |||
| 74 | 2004-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 75 | |||
| 76 | * macmenu.c (add_menu_item): Fallback on MacRoman if encoding | ||
| 77 | menu text as UTF8 fails. | ||
| 78 | |||
| 79 | 2004-12-01 Kim F. Storm <storm@cua.dk> | ||
| 80 | |||
| 81 | * alloc.c: Add commentary for last change. | ||
| 82 | (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle | ||
| 83 | sizeof(size_t) != 4. | ||
| 84 | (overrun_check_malloc, overrun_check_realloc, overrun_check_free): | ||
| 85 | Use them. Also clear header and trailer of freed memory. | ||
| 86 | (GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA. | ||
| 87 | (string_overrun_cookie): Rename from string_overrun_pattern. | ||
| 88 | (GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE. | ||
| 89 | |||
| 90 | 2004-12-01 Andreas Schwab <schwab@suse.de> | ||
| 91 | |||
| 92 | * lisp.h: Declare string_to_multibyte. | ||
| 93 | |||
| 94 | 2004-12-01 Kenichi Handa <handa@m17n.org> | ||
| 95 | |||
| 96 | * w32console.c (w32con_write_glyphs): Decide coding here. | ||
| 97 | Adjusted for the change of encode_terminal_code. | ||
| 98 | |||
| 99 | * term.c (encode_terminal_code): Don't make it "static". | ||
| 100 | |||
| 101 | 2004-11-30 Kenichi Handa <handa@m17n.org> | ||
| 102 | |||
| 103 | * term.c (encode_terminal_buf, encode_terminal_bufsize): New | ||
| 104 | variables. | ||
| 105 | (encode_terminal_code): Argument changed. Encode all | ||
| 106 | characters at once, and return a pointer to the result of | ||
| 107 | encoding. | ||
| 108 | (write_glyphs): Decide coding here. Adjusted for the above | ||
| 109 | change. | ||
| 110 | (insert_glyphs): Likewise. | ||
| 111 | (term_init): Initialize encode_terminal_bufsize to 0. | ||
| 112 | |||
| 113 | * coding.c (Vcode_conversion_workbuf_name): New variable. | ||
| 114 | (syms_of_coding): Initialize and staticpro it. | ||
| 115 | (set_conversion_work_buffer): New function. | ||
| 116 | (run_pre_post_conversion_on_str): Use it. | ||
| 117 | (run_pre_write_conversin_on_c_str): New function. | ||
| 118 | |||
| 119 | * coding.h (run_pre_write_conversin_on_c_str): Extern it. | ||
| 120 | |||
| 121 | 2004-11-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 122 | |||
| 123 | * keyboard.c: Don't undef SIGIO | ||
| 124 | * s/darwin.h (NO_SOCK_SIGIO): Define NO_SOCK_SIGIO on carbon | ||
| 125 | * Makefile.in (mac.o): Depend on blockinput.h and atimer.h. | ||
| 126 | (macfns.o): Don't depend on ccl.h. | ||
| 127 | * macfns.c (mac_frame_parm_handlers): Set handlers for | ||
| 128 | Qleft_fringe and Qright_fringe. | ||
| 129 | * macterm.c (mac_fill_rectangle_to_pixmap) | ||
| 130 | (mac_draw_rectangle_to_pixmap, mac_copy_area_to_pixmap) | ||
| 131 | (mac_copy_area_with_mask_to_pixmap, x_draw_image_foreground_1): | ||
| 132 | Put in #if 0. | ||
| 133 | (mac_scroll_area) [TARGET_API_MAC_CARBON]: Use ScrollWindowRect. | ||
| 134 | (x_flush) [TARGET_API_MAC_CARBON]: Don't traverse frames. | ||
| 135 | (XFlush) [TARGET_API_MAC_CARBON]: Define to an empty replacement. | ||
| 136 | (x_draw_glyph_string_background, x_draw_glyph_string_foreground) | ||
| 137 | [!MAC_OS8]: Added ifdef'd out code for os8. Don't use | ||
| 138 | XDrawImageString. Always draw background and foreground separately. | ||
| 139 | (x_draw_image_foreground): Use clipping instead of computing the | ||
| 140 | intersection rectangle. | ||
| 141 | (x_draw_image_glyph_string): Don't draw an image with mask to a | ||
| 142 | pixmap. | ||
| 143 | (x_redisplay_interface): Set flush_display_optional member to 0. | ||
| 144 | (XTread_socket): Correctly reset the TEConverter | ||
| 145 | object. | ||
| 146 | |||
| 147 | 2004-11-30 Kim F. Storm <storm@cua.dk> | ||
| 148 | |||
| 149 | * lisp.h: New defines to enable buffer overrun checking. | ||
| 150 | (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST) | ||
| 151 | (XMALLOC_OVERRUN_CHECK, GC_CHECK_CONS_LIST): Add. | ||
| 152 | |||
| 153 | * alloc.c: Add more checks for buffer overruns. | ||
| 154 | (XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header) | ||
| 155 | xmalloc_overrun_check_trailer, overrun_check_malloc) | ||
| 156 | overrun_check_realloc, overrun_check_free): Add. | ||
| 157 | (GC_STRING_EXTRA, string_overrun_pattern): Add. | ||
| 158 | (check_sblock, allocate_string_data, compact_small_strings): | ||
| 159 | Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN. | ||
| 160 | (check_cons_list): Condition on GC_CHECK_CONS_LIST. | ||
| 161 | (check_string_free_list): Add. | ||
| 162 | (allocate_string, sweep_strings): Call check_string_free_list. | ||
| 163 | |||
| 164 | * emacs.c (malloc_initialize_hook): Don't free malloc_state_ptr if | ||
| 165 | XMALLOC_OVERRUN_CHECK to avoid crash during load. | ||
| 166 | |||
| 167 | 2004-11-29 Kim F. Storm <storm@cua.dk> | ||
| 168 | |||
| 169 | * fns.c (concat): Use SAFE_ALLOCA. | ||
| 170 | |||
| 171 | 2004-11-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 172 | |||
| 173 | * sysdep.c (emacs_write): Don't use QUIT. | ||
| 174 | |||
| 175 | 2004-11-29 Kenichi Handa <handa@m17n.org> | ||
| 176 | |||
| 177 | * buffer.c (init_buffer): Set current_buffer->directory to a | ||
| 178 | multibyte string made by string_to_multibyte. | ||
| 179 | |||
| 180 | * emacs.c (init_cmdargs): Set unibyte strings in Vcommand_line_args. | ||
| 181 | |||
| 182 | 2004-11-27 Andreas Schwab <schwab@suse.de> | ||
| 183 | |||
| 184 | * alloc.c (mark_stack): Call GC_MARK_SECONDARY_STACK if defined. | ||
| 185 | |||
| 186 | * s/gnu-linux.h: Enable no-op gcpros on ia64. | ||
| 187 | (GC_MARK_SECONDARY_STACK) [__ia64__]: Define. | ||
| 188 | |||
| 189 | * filelock.c (lock_file_1): Call get_boot_time early. | ||
| 190 | Increase buffer size. | ||
| 191 | |||
| 192 | 2004-11-27 Eli Zaretskii <eliz@gnu.org> | ||
| 193 | |||
| 194 | * lisp.h (DECL_ALIGN): Define non-trivially only if NO_DECL_ALIGN | ||
| 195 | is not defined. | ||
| 196 | |||
| 197 | 2004-11-27 Kim F. Storm <storm@cua.dk> | ||
| 198 | |||
| 199 | * search.c (syms_of_search) <search-spaces-regexp>: Move 'doc:' | ||
| 200 | marker out of doc string. | ||
| 201 | |||
| 202 | 2004-11-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 203 | |||
| 204 | * s/darwin.h (POSIX_SIGNALS): Undo the removal of 2002-08-25, | ||
| 205 | which was not mentioned in the log. | ||
| 206 | |||
| 207 | 2004-11-26 Kim F. Storm <storm@cua.dk> | ||
| 208 | |||
| 209 | * fringe.c (update_window_fringes): Prefer truncation bitmaps over | ||
| 210 | angle bitmaps at top/bottom line. | ||
| 211 | |||
| 212 | * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, | ||
| 213 | set it when it->method is set to next_element_from_display_vector. | ||
| 214 | (setup_for_ellipsis): Add LEN argument. Callers changed. | ||
| 215 | Set it->saved_face_id. | ||
| 216 | (get_next_display_element): Use loop instead of recursion. | ||
| 217 | Set it->saved_face_id. Combine duplicate code for ctr chars. | ||
| 218 | (next_element_from_display_vector): Do not set it->saved_face_id. | ||
| 219 | (next_element_from_ellipsis): Use setup_for_ellipsis. | ||
| 220 | |||
| 221 | 2004-11-26 Eli Zaretskii <eliz@gnu.org> | ||
| 222 | |||
| 223 | * eval.c (Fdefvar): Declare pdl from last change as `volatile' to | ||
| 224 | prevent compiler warnings. | ||
| 225 | |||
| 226 | 2004-11-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 227 | |||
| 228 | * keyboard.c (command_loop_1): Print a message describing the key | ||
| 229 | the user just pressed when this key has no binding. | ||
| 230 | |||
| 231 | * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set. | ||
| 232 | (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted. | ||
| 233 | |||
| 234 | * lread.c (readchar): Check QUIT when `getc' is interrupted. | ||
| 235 | |||
| 236 | 2004-11-24 Richard M. Stallman <rms@gnu.org> | ||
| 237 | |||
| 238 | * coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only. | ||
| 239 | |||
| 240 | * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: Doc fix. | ||
| 241 | |||
| 242 | 2004-11-24 Kim F. Storm <storm@cua.dk> | ||
| 243 | |||
| 244 | * xdisp.c (move_it_in_display_line_to, display_line): | ||
| 245 | Restore saved_face_id also when truncate-lines or hscrolled. | ||
| 246 | |||
| 247 | 2004-11-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 248 | |||
| 249 | * gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to | ||
| 250 | x-use-old-gtk-file-dialog. | ||
| 251 | |||
| 252 | * xfns.c: Define x_use_old_gtk_file_dialog. | ||
| 253 | (syms_of_xfns): Rename use-old-gtk-file-dialog to x-... Move it | ||
| 254 | outside ifdef USE_GTK. | ||
| 255 | |||
| 256 | 2004-11-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 257 | |||
| 258 | * coding.h (ENCODE_FILE, DECODE_FILE, ENCODE_SYSTEM, DECODE_SYSTEM): | ||
| 259 | Don't use XFASTINT blindly. | ||
| 260 | |||
| 261 | * config.in (RE_TRANSLATE_P): Don't use XFASTINT blindly. | ||
| 262 | |||
| 263 | * indent.c (skip_invisible): Avoid non-idempotent side-effects | ||
| 264 | in macro arguments. | ||
| 265 | |||
| 266 | * keymap.c (Flookup_key): Check INTEGERP before XINT. | ||
| 267 | |||
| 268 | * lread.c (oblookup): Don't use XFASTINT blindly. | ||
| 269 | |||
| 270 | * window.c (Fset_window_scroll_bars): Don't use XINT if it isn't int. | ||
| 271 | (decode_next_window_args, window_loop): Don't use XFASTINT blindly. | ||
| 272 | |||
| 273 | 2004-11-23 Kim F. Storm <storm@cua.dk> | ||
| 274 | |||
| 275 | * dispextern.h (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P) | ||
| 276 | (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P): Not if dpvec_index is zero. | ||
| 277 | |||
| 278 | * xfaces.c (lookup_named_face): Add signal_p arg. Return -1 if | ||
| 279 | signal_p is zero and face name is unknown. | ||
| 280 | (Fx_list_fonts): Don't signal error in lookup_named_face. | ||
| 281 | (Fface_font): Signal error in lookup_named_face. | ||
| 282 | (ascii_face_of_lisp_face): Likewise. | ||
| 283 | |||
| 284 | * dispextern.h (lookup_named_face): Fix prototype. | ||
| 285 | |||
| 286 | * xdisp.c (handle_single_display_prop): Don't signal error in | ||
| 287 | lookup_named_face for unknown fringe face name. | ||
| 288 | (highlight_trailing_whitespace): Don't signal error in | ||
| 289 | lookup_named_face if trailing-whitespace face unknown. | ||
| 290 | (calc_line_height_property): Don't signal error in | ||
| 291 | lookup_named_face if specified face name is unknown. | ||
| 292 | |||
| 293 | * fringe.c (update_window_fringes): Show top row indicator if | ||
| 294 | window has header-line. Don't show arrow at bob and eob | ||
| 295 | if the boundary indicators are not used. | ||
| 296 | (Fset_fringe_bitmap_face): Signal error in lookup_named_face. | ||
| 297 | |||
| 298 | * window.c (set_window_buffer): Clear display_error_modiff. | ||
| 299 | |||
| 300 | 2004-11-22 Kim F. Storm <storm@cua.dk> | ||
| 301 | |||
| 302 | * fringe.c (update_window_fringes): Provide sensible fall-back | ||
| 303 | value for non-nil indicate-buffer-boundaries setting. | ||
| 304 | |||
| 305 | 2004-11-22 Markus Rost <rost@ias.edu> | ||
| 306 | |||
| 307 | * minibuf.c (Fminibuffer_complete_and_exit): Fix previous change. | ||
| 308 | |||
| 309 | 2004-11-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 310 | |||
| 311 | * eval.c (Fdefvar): Warn when var is let-bound but globally void. | ||
| 312 | |||
| 1 | 2004-11-21 Kim F. Storm <storm@cua.dk> | 313 | 2004-11-21 Kim F. Storm <storm@cua.dk> |
| 2 | 314 | ||
| 3 | * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA. | 315 | * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA. |
| @@ -11,9 +323,9 @@ | |||
| 11 | * macterm.c (x_clip_to_row): Add area arg. Callers changed. | 323 | * macterm.c (x_clip_to_row): Add area arg. Callers changed. |
| 12 | (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. | 324 | (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA. |
| 13 | 325 | ||
| 14 | * xdisp.c (move_it_in_display_line_to, display_line): Restore | 326 | * xdisp.c (move_it_in_display_line_to, display_line): |
| 15 | saved_face_id if overflow-newline-into-fringe is enabled and line | 327 | Restore saved_face_id if overflow-newline-into-fringe is enabled and |
| 16 | is continued before or in middle of element from display vector. | 328 | line is continued before or in middle of element from display vector. |
| 17 | 329 | ||
| 18 | * indent.c (Fvertical_motion): Fix last change. Use another | 330 | * indent.c (Fvertical_motion): Fix last change. Use another |
| 19 | method to detect if iterator moved too far ahead after reseat. | 331 | method to detect if iterator moved too far ahead after reseat. |
| @@ -27,8 +339,7 @@ | |||
| 27 | 339 | ||
| 28 | 2004-11-20 Luc Teirlinck <teirllm@auburn.edu> | 340 | 2004-11-20 Luc Teirlinck <teirllm@auburn.edu> |
| 29 | 341 | ||
| 30 | * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra | 342 | * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra argument. |
| 31 | argument. | ||
| 32 | * callint.c (Fcall_interactively): Ditto. | 343 | * callint.c (Fcall_interactively): Ditto. |
| 33 | 344 | ||
| 34 | 2004-11-20 Stefan Monnier <monnier@iro.umontreal.ca> | 345 | 2004-11-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| @@ -44,7 +355,7 @@ | |||
| 44 | (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed. | 355 | (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed. |
| 45 | 356 | ||
| 46 | * search.c (Vsearch_spaces_regexp): | 357 | * search.c (Vsearch_spaces_regexp): |
| 47 | Renamed from Vsearch_whitespace_regexp. All uses changed. | 358 | Rename from Vsearch_whitespace_regexp. All uses changed. |
| 48 | 359 | ||
| 49 | 2004-11-20 Thien-Thi Nguyen <ttn@gnu.org> | 360 | 2004-11-20 Thien-Thi Nguyen <ttn@gnu.org> |
| 50 | 361 | ||
| @@ -86,8 +397,7 @@ | |||
| 86 | 397 | ||
| 87 | 2004-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 398 | 2004-11-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 88 | 399 | ||
| 89 | * gtkutil.c (xg_get_file_name): Fix typo in | 400 | * gtkutil.c (xg_get_file_name): Typo in HAVE_GTK_FILE_SELECTION_NEW. |
| 90 | HAVE_GTK_FILE_SELECTION_NEW. | ||
| 91 | 401 | ||
| 92 | * xmenu.c (x_menu_in_use): Remove. | 402 | * xmenu.c (x_menu_in_use): Remove. |
| 93 | (x_menu_set_in_use): Also set popup_activated_flag. | 403 | (x_menu_set_in_use): Also set popup_activated_flag. |
| @@ -6340,7 +6650,7 @@ | |||
| 6340 | 6650 | ||
| 6341 | 2003-06-01 David Ponce <david@dponce.com> | 6651 | 2003-06-01 David Ponce <david@dponce.com> |
| 6342 | 6652 | ||
| 6343 | * termhooks.h (enum event_kind): Added new WHEEL_EVENT event. | 6653 | * termhooks.h (enum event_kind): Add new WHEEL_EVENT event. |
| 6344 | Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined. | 6654 | Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined. |
| 6345 | 6655 | ||
| 6346 | * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined. | 6656 | * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined. |
| @@ -6348,8 +6658,7 @@ | |||
| 6348 | (discard_mouse_events): Discard WHEEL_EVENT events too. | 6658 | (discard_mouse_events): Discard WHEEL_EVENT events too. |
| 6349 | (lispy_wheel_names, wheel_syms): New. | 6659 | (lispy_wheel_names, wheel_syms): New. |
| 6350 | (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and | 6660 | (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and |
| 6351 | staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX | 6661 | staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX defined. |
| 6352 | defined. | ||
| 6353 | (make_lispy_event): Add WHEEL_EVENT handler. | 6662 | (make_lispy_event): Add WHEEL_EVENT handler. |
| 6354 | 6663 | ||
| 6355 | * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT. | 6664 | * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT. |
| @@ -6391,8 +6700,7 @@ | |||
| 6391 | 6700 | ||
| 6392 | * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed. | 6701 | * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed. |
| 6393 | 6702 | ||
| 6394 | * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is | 6703 | * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is nonzero. |
| 6395 | nonzero. | ||
| 6396 | (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control. | 6704 | (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control. |
| 6397 | (setup_ccl_program): Initialize ccl->eight_bit_control to zero. | 6705 | (setup_ccl_program): Initialize ccl->eight_bit_control to zero. |
| 6398 | 6706 | ||
| @@ -6408,19 +6716,18 @@ | |||
| 6408 | 6716 | ||
| 6409 | 2003-05-28 Kenichi Handa <handa@m17n.org> | 6717 | 2003-05-28 Kenichi Handa <handa@m17n.org> |
| 6410 | 6718 | ||
| 6411 | * coding.c (ENCODE_UNSAFE_CHARACTER): Adjusted for the name change | 6719 | * coding.c (ENCODE_UNSAFE_CHARACTER): Adjust for the name change |
| 6412 | of CODING_REPLACEMENT_CHARACTER. | 6720 | of CODING_REPLACEMENT_CHARACTER. |
| 6413 | (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set | 6721 | (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set |
| 6414 | CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and | 6722 | CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and |
| 6415 | check this flag on encoding. | 6723 | check this flag on encoding. |
| 6416 | (encode_coding_sjis_big5): Check | 6724 | (encode_coding_sjis_big5): |
| 6417 | CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode. | 6725 | Check CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode. |
| 6418 | (Fset_terminal_coding_system_internal): Set | 6726 | (Fset_terminal_coding_system_internal): |
| 6419 | CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode | 6727 | Set CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode |
| 6420 | instead of setting CODING_FLAG_ISO_SAFE flag in | 6728 | instead of setting CODING_FLAG_ISO_SAFE flag in terminal_coding.flags. |
| 6421 | terminal_coding.flags. | 6729 | |
| 6422 | 6730 | * coding.h (CODING_REPLACEMENT_CHARACTER): Rename from | |
| 6423 | * coding.h (CODING_REPLACEMENT_CHARACTER): Renamed from | ||
| 6424 | CODING_INHIBIT_CHARACTER_SUBSTITUTION. | 6731 | CODING_INHIBIT_CHARACTER_SUBSTITUTION. |
| 6425 | (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro. | 6732 | (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro. |
| 6426 | 6733 | ||
| @@ -6562,65 +6869,65 @@ | |||
| 6562 | (struct frame): New member scroll_bar_actual_width which | 6869 | (struct frame): New member scroll_bar_actual_width which |
| 6563 | consolidates and renames the vertical_scroll_bar_extra member of | 6870 | consolidates and renames the vertical_scroll_bar_extra member of |
| 6564 | x_output, w32_output, and mac_output structures. All uses changed. | 6871 | x_output, w32_output, and mac_output structures. All uses changed. |
| 6565 | (FRAME_PIXEL_HEIGHT): Renamed from PIXEL_HEIGHT and moved | 6872 | (FRAME_PIXEL_HEIGHT): Rename from PIXEL_HEIGHT and moved |
| 6566 | from x/w32/macterm.h files. All uses changed. Also change code | 6873 | from x/w32/macterm.h files. All uses changed. Also change code |
| 6567 | which referred to f->output_data...->pixel_height. | 6874 | which referred to f->output_data...->pixel_height. |
| 6568 | (FRAME_PIXEL_WIDTH): Renamed from PIXEL_WIDTH and moved | 6875 | (FRAME_PIXEL_WIDTH): Rename from PIXEL_WIDTH and moved |
| 6569 | from x/w32/macterm.h files. All uses changed. Also change code | 6876 | from x/w32/macterm.h files. All uses changed. Also change code |
| 6570 | which referred to f->output_data...->pixel_width. | 6877 | which referred to f->output_data...->pixel_width. |
| 6571 | (FRAME_LINES): Renamed from FRAME_HEIGHT. All uses changed. | 6878 | (FRAME_LINES): Rename from FRAME_HEIGHT. All uses changed. |
| 6572 | Also change code which referred to f->height. | 6879 | Also change code which referred to f->height. |
| 6573 | (FRAME_COLS): Renamed from FRAME_WIDTH. All uses changed. | 6880 | (FRAME_COLS): Rename from FRAME_WIDTH. All uses changed. |
| 6574 | Also change code which referred to f->width. | 6881 | Also change code which referred to f->width. |
| 6575 | (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses | 6882 | (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses |
| 6576 | to update new_text_lines and new_text_cols members directly. | 6883 | to update new_text_lines and new_text_cols members directly. |
| 6577 | (FRAME_CONFIG_SCROLL_BAR_WIDTH): Renamed from | 6884 | (FRAME_CONFIG_SCROLL_BAR_WIDTH): Rename from |
| 6578 | FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed. | 6885 | FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed. |
| 6579 | (FRAME_CONFIG_SCROLL_BAR_COLS): Renamed from | 6886 | (FRAME_CONFIG_SCROLL_BAR_COLS): Rename from |
| 6580 | FRAME_SCROLL_BAR_COLS. All uses changed. | 6887 | FRAME_SCROLL_BAR_COLS. All uses changed. |
| 6581 | (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS): | 6888 | (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS): |
| 6582 | Renamed from FRAME_LEFT_SCROLL_BAR_WIDTH and | 6889 | Rename from FRAME_LEFT_SCROLL_BAR_WIDTH and |
| 6583 | FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed. | 6890 | FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed. |
| 6584 | (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) | 6891 | (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) |
| 6585 | (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros. | 6892 | (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros. |
| 6586 | (FRAME_TOTAL_COLS): Renamed from FRAME_WINDOW_WIDTH. | 6893 | (FRAME_TOTAL_COLS): Rename from FRAME_WINDOW_WIDTH. |
| 6587 | (SET_FRAME_COLS): Renamed from SET_FRAME_WIDTH. | 6894 | (SET_FRAME_COLS): Rename from SET_FRAME_WIDTH. |
| 6588 | (FRAME_TOTAL_COLS_ARG): Renamed from FRAME_WINDOW_WIDTH_ARG. | 6895 | (FRAME_TOTAL_COLS_ARG): Rename from FRAME_WINDOW_WIDTH_ARG. |
| 6589 | (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro. | 6896 | (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro. |
| 6590 | (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro. | 6897 | (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro. |
| 6591 | (FRAME_LINE_HEIGHT): Renamed from CANON_Y_UNIT. Unconditionally | 6898 | (FRAME_LINE_HEIGHT): Rename from CANON_Y_UNIT. |
| 6592 | return line_height member (it now has proper value also for | 6899 | Unconditionally return line_height member (it now has proper value |
| 6593 | non-window frames). | 6900 | also for non-window frames). |
| 6594 | (FRAME_COLUMN_WIDTH): Renamed from CANON_X_UNIT. Unconditionally | 6901 | (FRAME_COLUMN_WIDTH): Rename from CANON_X_UNIT. Unconditionally |
| 6595 | return new column_width member (rather than the default font width). | 6902 | return new column_width member (rather than the default font width). |
| 6596 | (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH) | 6903 | (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH) |
| 6597 | (FRAME_RIGHT_FRINGE_WIDTH): Renamed from FRAME_X_... and moved | 6904 | (FRAME_RIGHT_FRINGE_WIDTH): Rename from FRAME_X_... and moved |
| 6598 | from x/w32/macterm.h files. Unconditionally return corresponding | 6905 | from x/w32/macterm.h files. Unconditionally return corresponding |
| 6599 | member of frame structure (they now have proper values also for | 6906 | member of frame structure (they now have proper values also for |
| 6600 | non-window frames). | 6907 | non-window frames). |
| 6601 | (FRAME_TOTAL_FRINGE_WIDTH): Renamed from FRAME_FRINGE_WIDTH. | 6908 | (FRAME_TOTAL_FRINGE_WIDTH): Rename from FRAME_FRINGE_WIDTH. |
| 6602 | Calculate return value from left and right widths. | 6909 | Calculate return value from left and right widths. |
| 6603 | (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return | 6910 | (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return |
| 6604 | internal_border_width member (has proper value for non-window frame). | 6911 | internal_border_width member (has proper value for non-window frame). |
| 6605 | (FRAME_PIXEL_X_FROM_CANON_X): Renamed from PIXEL_X_FROM_CANON_X. | 6912 | (FRAME_PIXEL_X_FROM_CANON_X): Rename from PIXEL_X_FROM_CANON_X. |
| 6606 | (FRAME_PIXEL_Y_FROM_CANON_Y): Renamed from PIXEL_Y_FROM_CANON_Y. | 6913 | (FRAME_PIXEL_Y_FROM_CANON_Y): Rename from PIXEL_Y_FROM_CANON_Y. |
| 6607 | (FRAME_CANON_X_FROM_PIXEL_X): Renamed from CANON_X_FROM_PIXEL_X. | 6914 | (FRAME_CANON_X_FROM_PIXEL_X): Rename from CANON_X_FROM_PIXEL_X. |
| 6608 | (FRAME_CANON_Y_FROM_PIXEL_Y): Renamed from CANON_Y_FROM_PIXEL_Y. | 6915 | (FRAME_CANON_Y_FROM_PIXEL_Y): Rename from CANON_Y_FROM_PIXEL_Y. |
| 6609 | (FRAME_LINE_TO_PIXEL_Y): Renamed from CHAR_TO_PIXEL_ROW, | 6916 | (FRAME_LINE_TO_PIXEL_Y): Rename from CHAR_TO_PIXEL_ROW, |
| 6610 | consolidated from xterm.h, macterm.h, and w32term.h. | 6917 | consolidated from xterm.h, macterm.h, and w32term.h. |
| 6611 | (FRAME_COL_TO_PIXEL_X): Renamed from CHAR_TO_PIXEL_COL, | 6918 | (FRAME_COL_TO_PIXEL_X): Rename from CHAR_TO_PIXEL_COL, |
| 6612 | consolidated from xterm.h, macterm.h, and w32term.h. | 6919 | consolidated from xterm.h, macterm.h, and w32term.h. |
| 6613 | (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Renamed from | 6920 | (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rename from |
| 6614 | CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h. | 6921 | CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h. |
| 6615 | (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Renamed from | 6922 | (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Rename from |
| 6616 | CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h. | 6923 | CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h. |
| 6617 | (FRAME_PIXEL_Y_TO_LINE): Renamed from PIXEL_TO_CHAR_ROW | 6924 | (FRAME_PIXEL_Y_TO_LINE): Rename from PIXEL_TO_CHAR_ROW |
| 6618 | consolidated from x/mac/w32term.h. | 6925 | consolidated from x/mac/w32term.h. |
| 6619 | (FRAME_PIXEL_X_TO_COL): Renamed from PIXEL_TO_CHAR_COL | 6926 | (FRAME_PIXEL_X_TO_COL): Rename from PIXEL_TO_CHAR_COL |
| 6620 | consolidated from x/mac/w32term.h. | 6927 | consolidated from x/mac/w32term.h. |
| 6621 | (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Renamed from | 6928 | (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Rename from |
| 6622 | PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h. | 6929 | PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h. |
| 6623 | (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Renamed from | 6930 | (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Rename from |
| 6624 | PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h. | 6931 | PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h. |
| 6625 | 6932 | ||
| 6626 | * window.h (struct window): Rename members left to left_col, | 6933 | * window.h (struct window): Rename members left to left_col, |
| @@ -6642,7 +6949,7 @@ | |||
| 6642 | referred to XINT (w->height) * canon_y_unit. | 6949 | referred to XINT (w->height) * canon_y_unit. |
| 6643 | (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that | 6950 | (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that |
| 6644 | referred to XINT (w->left). | 6951 | referred to XINT (w->left). |
| 6645 | (WINDOW_RIGHT_EDGE_COL): Renamed from WINDOW_RIGHT_EDGE. Change | 6952 | (WINDOW_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_EDGE. Change |
| 6646 | all uses and code that referred to XINT (w->left) + XINT (w->width). | 6953 | all uses and code that referred to XINT (w->left) + XINT (w->width). |
| 6647 | (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that | 6954 | (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that |
| 6648 | referred to XINT (w->top). | 6955 | referred to XINT (w->top). |
| @@ -6657,14 +6964,14 @@ | |||
| 6657 | (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that | 6964 | (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that |
| 6658 | referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit. | 6965 | referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit. |
| 6659 | (WINDOW_LEFTMOST_P): New macro. | 6966 | (WINDOW_LEFTMOST_P): New macro. |
| 6660 | (WINDOW_BOX_LEFT_EDGE_COL): Renamed from WINDOW_LEFT_MARGIN. | 6967 | (WINDOW_BOX_LEFT_EDGE_COL): Rename from WINDOW_LEFT_MARGIN. |
| 6661 | All uses changed. | 6968 | All uses changed. |
| 6662 | (WINDOW_BOX_RIGHT_EDGE_COL): Renamed from WINDOW_RIGHT_MARGIN. | 6969 | (WINDOW_BOX_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_MARGIN. |
| 6663 | All uses changed. | 6970 | All uses changed. |
| 6664 | (WINDOW_BOX_LEFT_EDGE_X): Renamed from | 6971 | (WINDOW_BOX_LEFT_EDGE_X): Rename from |
| 6665 | WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h. | 6972 | WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h. |
| 6666 | Do not exclude left fringe width. | 6973 | Do not exclude left fringe width. |
| 6667 | (WINDOW_BOX_RIGHT_EDGE_X): Renamed from | 6974 | (WINDOW_BOX_RIGHT_EDGE_X): Rename from |
| 6668 | WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h. | 6975 | WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h. |
| 6669 | Do not exclude fringe widths. | 6976 | Do not exclude fringe widths. |
| 6670 | (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH) | 6977 | (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH) |
| @@ -6691,18 +6998,18 @@ | |||
| 6691 | FRAME_SCROLL_BAR_WIDTH. | 6998 | FRAME_SCROLL_BAR_WIDTH. |
| 6692 | (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH) | 6999 | (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH) |
| 6693 | (WINDOW_SCROLL_BAR_AREA_X): New macros. | 7000 | (WINDOW_SCROLL_BAR_AREA_X): New macros. |
| 6694 | (WINDOW_HEADER_LINE_HEIGHT): Renamed from | 7001 | (WINDOW_HEADER_LINE_HEIGHT): Rename from |
| 6695 | WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h. | 7002 | WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h. |
| 6696 | (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Renamed from | 7003 | (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Rename from |
| 6697 | WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h. | 7004 | WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h. |
| 6698 | (WINDOW_BOX_TEXT_HEIGHT): Renamed from | 7005 | (WINDOW_BOX_TEXT_HEIGHT): Rename from |
| 6699 | WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h. | 7006 | WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h. |
| 6700 | (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) | 7007 | (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y) |
| 6701 | (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) | 7008 | (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y) |
| 6702 | (WINDOW_TEXT_TO_FRAME_PIXEL_X): Moved here from dispextern.h. | 7009 | (WINDOW_TEXT_TO_FRAME_PIXEL_X): Move here from dispextern.h. |
| 6703 | (WINDOW_LEFT_MARGIN_WIDTH): Renamed from | 7010 | (WINDOW_LEFT_MARGIN_WIDTH): Rename from |
| 6704 | WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h. | 7011 | WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h. |
| 6705 | (WINDOW_RIGHT_MARGIN_WIDTH): Renamed from | 7012 | (WINDOW_RIGHT_MARGIN_WIDTH): Rename from |
| 6706 | WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h. | 7013 | WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h. |
| 6707 | (window_from_coordinates): Update prototype. | 7014 | (window_from_coordinates): Update prototype. |
| 6708 | (Fset_window_buffer): Update EXFUN. | 7015 | (Fset_window_buffer): Update EXFUN. |
| @@ -6796,7 +7103,7 @@ | |||
| 6796 | left_margin_cols, right_margin_cols, left_fringe_width, | 7103 | left_margin_cols, right_margin_cols, left_fringe_width, |
| 6797 | right_fringe_width, fringes_outside_margins, scroll_bar_width, | 7104 | right_fringe_width, fringes_outside_margins, scroll_bar_width, |
| 6798 | and vertical_scroll_bar_type. | 7105 | and vertical_scroll_bar_type. |
| 6799 | (coordinates_in_window): Adapted to new fringe/margin positions | 7106 | (coordinates_in_window): Adapt to new fringe/margin positions |
| 6800 | and per-window fringes and scroll-bars. | 7107 | and per-window fringes and scroll-bars. |
| 6801 | Fix bug related to incorrectly adjusting coordinates by | 7108 | Fix bug related to incorrectly adjusting coordinates by |
| 6802 | frame's internal_border_width (the effect normally negible since | 7109 | frame's internal_border_width (the effect normally negible since |
| @@ -6831,7 +7138,7 @@ | |||
| 6831 | narrow. This fixes a bug which could cause Emacs to trap if the | 7138 | narrow. This fixes a bug which could cause Emacs to trap if the |
| 6832 | width of the split window was less than the width of the display | 7139 | width of the split window was less than the width of the display |
| 6833 | margins. | 7140 | margins. |
| 6834 | (window_box_text_cols): Renamed from window_internal_width. | 7141 | (window_box_text_cols): Rename from window_internal_width. |
| 6835 | All uses changed. Adapt to per-window fringes and scroll bars. | 7142 | All uses changed. Adapt to per-window fringes and scroll bars. |
| 6836 | Fix bug that caused vertical separator to be subtracted also on | 7143 | Fix bug that caused vertical separator to be subtracted also on |
| 6837 | window frames. Fix another bug that did not reduce the returned | 7144 | window frames. Fix another bug that did not reduce the returned |
| @@ -6863,8 +7170,7 @@ | |||
| 6863 | the width of the window. | 7170 | the width of the window. |
| 6864 | (Fset_window_fringes): New defun to allow user to specifically set | 7171 | (Fset_window_fringes): New defun to allow user to specifically set |
| 6865 | this window's fringe widths and position vs. display margins. | 7172 | this window's fringe widths and position vs. display margins. |
| 6866 | (Fwindow_fringes): New defun to return window's actual fringe | 7173 | (Fwindow_fringes): New defun to return window's actual fringe settings. |
| 6867 | settings. | ||
| 6868 | (Fset_window_scroll_bars): New defun to allow user to specifically | 7174 | (Fset_window_scroll_bars): New defun to allow user to specifically |
| 6869 | set this window's scroll bar width and position. | 7175 | set this window's scroll bar width and position. |
| 6870 | (Fwindow_scroll_bars): New defun to return window's actual scroll | 7176 | (Fwindow_scroll_bars): New defun to return window's actual scroll |
| @@ -6931,17 +7237,16 @@ | |||
| 6931 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. | 7237 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. |
| 6932 | (PIXEL_WIDTH, PIXEL_HEIGHT) | 7238 | (PIXEL_WIDTH, PIXEL_HEIGHT) |
| 6933 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) | 7239 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) |
| 6934 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Moved to | 7240 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to |
| 6935 | frame.h and renamed [see frame.h changes]. | 7241 | frame.h and renamed [see frame.h changes]. |
| 6936 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) | 7242 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) |
| 6937 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) | 7243 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) |
| 6938 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Moved to frame.h | 7244 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h |
| 6939 | and renamed [see frame.h changes]. | 7245 | and renamed [see frame.h changes]. |
| 6940 | 7246 | ||
| 6941 | * xterm.c: Make (several) trivial substitutions for renamed and | 7247 | * xterm.c: Make (several) trivial substitutions for renamed and |
| 6942 | new macros in dispextern.h, frame.h and window.h. | 7248 | new macros in dispextern.h, frame.h and window.h. |
| 6943 | (x_draw_glyph_string_box): Adapt to per-window fringes and | 7249 | (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. |
| 6944 | scroll-bars. | ||
| 6945 | (scroll_run): Adapt to new fringe position. | 7250 | (scroll_run): Adapt to new fringe position. |
| 6946 | (glyph_rect): Use window coordinates returned from | 7251 | (glyph_rect): Use window coordinates returned from |
| 6947 | window_from_coordinates rather than frame_to_window_pixel_xy. | 7252 | window_from_coordinates rather than frame_to_window_pixel_xy. |
| @@ -6965,17 +7270,16 @@ | |||
| 6965 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. | 7270 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. |
| 6966 | (PIXEL_WIDTH, PIXEL_HEIGHT) | 7271 | (PIXEL_WIDTH, PIXEL_HEIGHT) |
| 6967 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) | 7272 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) |
| 6968 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Moved to | 7273 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to |
| 6969 | frame.h and renamed [see frame.h changes]. | 7274 | frame.h and renamed [see frame.h changes]. |
| 6970 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) | 7275 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) |
| 6971 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) | 7276 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) |
| 6972 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Moved to frame.h | 7277 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h |
| 6973 | and renamed [see frame.h changes]. | 7278 | and renamed [see frame.h changes]. |
| 6974 | 7279 | ||
| 6975 | * w32term.c: Make (several) trivial substitutions for renamed and | 7280 | * w32term.c: Make (several) trivial substitutions for renamed and |
| 6976 | new macros in dispextern.h, frame.h and window.h. | 7281 | new macros in dispextern.h, frame.h and window.h. |
| 6977 | (x_draw_glyph_string_box): Adapt to per-window fringes and | 7282 | (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. |
| 6978 | scroll-bars. | ||
| 6979 | (glyph_rect): Use window coordinates returned from | 7283 | (glyph_rect): Use window coordinates returned from |
| 6980 | window_from_coordinates rather than frame_to_window_pixel_xy. | 7284 | window_from_coordinates rather than frame_to_window_pixel_xy. |
| 6981 | (XTset_vertical_scroll_bar): Adapt to per-window fringes and | 7285 | (XTset_vertical_scroll_bar): Adapt to per-window fringes and |
| @@ -7006,17 +7310,16 @@ | |||
| 7006 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. | 7310 | (FRAME_DEFAULT_FONT_WIDTH): Remove macro. |
| 7007 | (PIXEL_WIDTH, PIXEL_HEIGHT) | 7311 | (PIXEL_WIDTH, PIXEL_HEIGHT) |
| 7008 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) | 7312 | (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH) |
| 7009 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Moved to | 7313 | (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to |
| 7010 | frame.h and renamed [see frame.h changes]. | 7314 | frame.h and renamed [see frame.h changes]. |
| 7011 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) | 7315 | (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH) |
| 7012 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) | 7316 | (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL) |
| 7013 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Moved to frame.h | 7317 | (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h |
| 7014 | and renamed [see frame.h changes]. | 7318 | and renamed [see frame.h changes]. |
| 7015 | 7319 | ||
| 7016 | * macterm.c: Make (several) trivial substitutions for renamed and | 7320 | * macterm.c: Make (several) trivial substitutions for renamed and |
| 7017 | new macros in dispextern.h, frame.h and window.h. | 7321 | new macros in dispextern.h, frame.h and window.h. |
| 7018 | (x_draw_glyph_string_box): Adapt to per-window fringes and | 7322 | (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars. |
| 7019 | scroll-bars. | ||
| 7020 | (glyph_rect): Use window coordinates returned from | 7323 | (glyph_rect): Use window coordinates returned from |
| 7021 | window_from_coordinates rather than frame_to_window_pixel_xy. | 7324 | window_from_coordinates rather than frame_to_window_pixel_xy. |
| 7022 | (XTset_vertical_scroll_bar): Adapt to per-window fringes and | 7325 | (XTset_vertical_scroll_bar): Adapt to per-window fringes and |
diff --git a/src/Makefile.in b/src/Makefile.in index 820ade11d39..53725361a80 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -1233,10 +1233,10 @@ abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \ | |||
| 1233 | fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \ | 1233 | fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \ |
| 1234 | scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ | 1234 | scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ |
| 1235 | xterm.o xselect.o sound.o: macgui.h | 1235 | xterm.o xselect.o sound.o: macgui.h |
| 1236 | mac.o: mac.c process.h sysselect.h systime.h $(config_h) | 1236 | mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h $(config_h) |
| 1237 | macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \ | 1237 | macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \ |
| 1238 | dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \ | 1238 | dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \ |
| 1239 | atimer.h systime.h epaths.h termhooks.h coding.h ccl.h systime.h $(config_h) | 1239 | atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h) |
| 1240 | macmenu.o: macmenu.c termhooks.h frame.h window.h dispextern.h macgui.h \ | 1240 | macmenu.o: macmenu.c termhooks.h frame.h window.h dispextern.h macgui.h \ |
| 1241 | keyboard.h blockinput.h atimer.h systime.h buffer.h macterm.h $(config_h) | 1241 | keyboard.h blockinput.h atimer.h systime.h buffer.h macterm.h $(config_h) |
| 1242 | macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \ | 1242 | macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \ |
diff --git a/src/alloc.c b/src/alloc.c index ea1d542bc7c..56f8be25f61 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -31,6 +31,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 31 | 31 | ||
| 32 | #include <signal.h> | 32 | #include <signal.h> |
| 33 | 33 | ||
| 34 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 35 | #include <pthread.h> | ||
| 36 | #endif | ||
| 37 | |||
| 34 | /* This file is part of the core Lisp implementation, and thus must | 38 | /* This file is part of the core Lisp implementation, and thus must |
| 35 | deal with the real data structures. If the Lisp implementation is | 39 | deal with the real data structures. If the Lisp implementation is |
| 36 | replaced, this file likely will not be used. */ | 40 | replaced, this file likely will not be used. */ |
| @@ -85,6 +89,35 @@ extern __malloc_size_t __malloc_extra_blocks; | |||
| 85 | 89 | ||
| 86 | #endif /* not DOUG_LEA_MALLOC */ | 90 | #endif /* not DOUG_LEA_MALLOC */ |
| 87 | 91 | ||
| 92 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 93 | |||
| 94 | static pthread_mutex_t alloc_mutex; | ||
| 95 | pthread_t main_thread; | ||
| 96 | |||
| 97 | #define BLOCK_INPUT_ALLOC \ | ||
| 98 | do \ | ||
| 99 | { \ | ||
| 100 | pthread_mutex_lock (&alloc_mutex); \ | ||
| 101 | if (pthread_self () == main_thread) \ | ||
| 102 | BLOCK_INPUT; \ | ||
| 103 | } \ | ||
| 104 | while (0) | ||
| 105 | #define UNBLOCK_INPUT_ALLOC \ | ||
| 106 | do \ | ||
| 107 | { \ | ||
| 108 | if (pthread_self () == main_thread) \ | ||
| 109 | UNBLOCK_INPUT; \ | ||
| 110 | pthread_mutex_unlock (&alloc_mutex); \ | ||
| 111 | } \ | ||
| 112 | while (0) | ||
| 113 | |||
| 114 | #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | ||
| 115 | |||
| 116 | #define BLOCK_INPUT_ALLOC BLOCK_INPUT | ||
| 117 | #define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT | ||
| 118 | |||
| 119 | #endif /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | ||
| 120 | |||
| 88 | /* Value of _bytes_used, when spare_memory was freed. */ | 121 | /* Value of _bytes_used, when spare_memory was freed. */ |
| 89 | 122 | ||
| 90 | static __malloc_size_t bytes_used_when_full; | 123 | static __malloc_size_t bytes_used_when_full; |
| @@ -517,6 +550,140 @@ buffer_memory_full () | |||
| 517 | } | 550 | } |
| 518 | 551 | ||
| 519 | 552 | ||
| 553 | #ifdef XMALLOC_OVERRUN_CHECK | ||
| 554 | |||
| 555 | /* Check for overrun in malloc'ed buffers by wrapping a 16 byte header | ||
| 556 | and a 16 byte trailer around each block. | ||
| 557 | |||
| 558 | The header consists of 12 fixed bytes + a 4 byte integer contaning the | ||
| 559 | original block size, while the trailer consists of 16 fixed bytes. | ||
| 560 | |||
| 561 | The header is used to detect whether this block has been allocated | ||
| 562 | through these functions -- as it seems that some low-level libc | ||
| 563 | functions may bypass the malloc hooks. | ||
| 564 | */ | ||
| 565 | |||
| 566 | |||
| 567 | #define XMALLOC_OVERRUN_CHECK_SIZE 16 | ||
| 568 | |||
| 569 | static char xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE-4] = | ||
| 570 | { 0x9a, 0x9b, 0xae, 0xaf, | ||
| 571 | 0xbf, 0xbe, 0xce, 0xcf, | ||
| 572 | 0xea, 0xeb, 0xec, 0xed }; | ||
| 573 | |||
| 574 | static char xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] = | ||
| 575 | { 0xaa, 0xab, 0xac, 0xad, | ||
| 576 | 0xba, 0xbb, 0xbc, 0xbd, | ||
| 577 | 0xca, 0xcb, 0xcc, 0xcd, | ||
| 578 | 0xda, 0xdb, 0xdc, 0xdd }; | ||
| 579 | |||
| 580 | /* Macros to insert and extract the block size in the header. */ | ||
| 581 | |||
| 582 | #define XMALLOC_PUT_SIZE(ptr, size) \ | ||
| 583 | (ptr[-1] = (size & 0xff), \ | ||
| 584 | ptr[-2] = ((size >> 8) & 0xff), \ | ||
| 585 | ptr[-3] = ((size >> 16) & 0xff), \ | ||
| 586 | ptr[-4] = ((size >> 24) & 0xff)) | ||
| 587 | |||
| 588 | #define XMALLOC_GET_SIZE(ptr) \ | ||
| 589 | (size_t)((unsigned)(ptr[-1]) | \ | ||
| 590 | ((unsigned)(ptr[-2]) << 8) | \ | ||
| 591 | ((unsigned)(ptr[-3]) << 16) | \ | ||
| 592 | ((unsigned)(ptr[-4]) << 24)) | ||
| 593 | |||
| 594 | |||
| 595 | /* Like malloc, but wraps allocated block with header and trailer. */ | ||
| 596 | |||
| 597 | POINTER_TYPE * | ||
| 598 | overrun_check_malloc (size) | ||
| 599 | size_t size; | ||
| 600 | { | ||
| 601 | register unsigned char *val; | ||
| 602 | |||
| 603 | val = (unsigned char *) malloc (size + XMALLOC_OVERRUN_CHECK_SIZE*2); | ||
| 604 | if (val) | ||
| 605 | { | ||
| 606 | bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4); | ||
| 607 | val += XMALLOC_OVERRUN_CHECK_SIZE; | ||
| 608 | XMALLOC_PUT_SIZE(val, size); | ||
| 609 | bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 610 | } | ||
| 611 | return (POINTER_TYPE *)val; | ||
| 612 | } | ||
| 613 | |||
| 614 | |||
| 615 | /* Like realloc, but checks old block for overrun, and wraps new block | ||
| 616 | with header and trailer. */ | ||
| 617 | |||
| 618 | POINTER_TYPE * | ||
| 619 | overrun_check_realloc (block, size) | ||
| 620 | POINTER_TYPE *block; | ||
| 621 | size_t size; | ||
| 622 | { | ||
| 623 | register unsigned char *val = (unsigned char *)block; | ||
| 624 | |||
| 625 | if (val | ||
| 626 | && bcmp (xmalloc_overrun_check_header, | ||
| 627 | val - XMALLOC_OVERRUN_CHECK_SIZE, | ||
| 628 | XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) | ||
| 629 | { | ||
| 630 | size_t osize = XMALLOC_GET_SIZE (val); | ||
| 631 | if (bcmp (xmalloc_overrun_check_trailer, | ||
| 632 | val + osize, | ||
| 633 | XMALLOC_OVERRUN_CHECK_SIZE)) | ||
| 634 | abort (); | ||
| 635 | bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 636 | val -= XMALLOC_OVERRUN_CHECK_SIZE; | ||
| 637 | bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 638 | } | ||
| 639 | |||
| 640 | val = (unsigned char *) realloc ((POINTER_TYPE *)val, size + XMALLOC_OVERRUN_CHECK_SIZE*2); | ||
| 641 | |||
| 642 | if (val) | ||
| 643 | { | ||
| 644 | bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4); | ||
| 645 | val += XMALLOC_OVERRUN_CHECK_SIZE; | ||
| 646 | XMALLOC_PUT_SIZE(val, size); | ||
| 647 | bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 648 | } | ||
| 649 | return (POINTER_TYPE *)val; | ||
| 650 | } | ||
| 651 | |||
| 652 | /* Like free, but checks block for overrun. */ | ||
| 653 | |||
| 654 | void | ||
| 655 | overrun_check_free (block) | ||
| 656 | POINTER_TYPE *block; | ||
| 657 | { | ||
| 658 | unsigned char *val = (unsigned char *)block; | ||
| 659 | |||
| 660 | if (val | ||
| 661 | && bcmp (xmalloc_overrun_check_header, | ||
| 662 | val - XMALLOC_OVERRUN_CHECK_SIZE, | ||
| 663 | XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) | ||
| 664 | { | ||
| 665 | size_t osize = XMALLOC_GET_SIZE (val); | ||
| 666 | if (bcmp (xmalloc_overrun_check_trailer, | ||
| 667 | val + osize, | ||
| 668 | XMALLOC_OVERRUN_CHECK_SIZE)) | ||
| 669 | abort (); | ||
| 670 | bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 671 | val -= XMALLOC_OVERRUN_CHECK_SIZE; | ||
| 672 | bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); | ||
| 673 | } | ||
| 674 | |||
| 675 | free (val); | ||
| 676 | } | ||
| 677 | |||
| 678 | #undef malloc | ||
| 679 | #undef realloc | ||
| 680 | #undef free | ||
| 681 | #define malloc overrun_check_malloc | ||
| 682 | #define realloc overrun_check_realloc | ||
| 683 | #define free overrun_check_free | ||
| 684 | #endif | ||
| 685 | |||
| 686 | |||
| 520 | /* Like malloc but check for no memory and block interrupt input.. */ | 687 | /* Like malloc but check for no memory and block interrupt input.. */ |
| 521 | 688 | ||
| 522 | POINTER_TYPE * | 689 | POINTER_TYPE * |
| @@ -603,7 +770,9 @@ safe_alloca_unwind (arg) | |||
| 603 | number of bytes to allocate, TYPE describes the intended use of the | 770 | number of bytes to allocate, TYPE describes the intended use of the |
| 604 | allcated memory block (for strings, for conses, ...). */ | 771 | allcated memory block (for strings, for conses, ...). */ |
| 605 | 772 | ||
| 773 | #ifndef USE_LSB_TAG | ||
| 606 | static void *lisp_malloc_loser; | 774 | static void *lisp_malloc_loser; |
| 775 | #endif | ||
| 607 | 776 | ||
| 608 | static POINTER_TYPE * | 777 | static POINTER_TYPE * |
| 609 | lisp_malloc (nbytes, type) | 778 | lisp_malloc (nbytes, type) |
| @@ -933,7 +1102,7 @@ static void | |||
| 933 | emacs_blocked_free (ptr) | 1102 | emacs_blocked_free (ptr) |
| 934 | void *ptr; | 1103 | void *ptr; |
| 935 | { | 1104 | { |
| 936 | BLOCK_INPUT; | 1105 | BLOCK_INPUT_ALLOC; |
| 937 | 1106 | ||
| 938 | #ifdef GC_MALLOC_CHECK | 1107 | #ifdef GC_MALLOC_CHECK |
| 939 | if (ptr) | 1108 | if (ptr) |
| @@ -971,7 +1140,7 @@ emacs_blocked_free (ptr) | |||
| 971 | spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); | 1140 | spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); |
| 972 | 1141 | ||
| 973 | __free_hook = emacs_blocked_free; | 1142 | __free_hook = emacs_blocked_free; |
| 974 | UNBLOCK_INPUT; | 1143 | UNBLOCK_INPUT_ALLOC; |
| 975 | } | 1144 | } |
| 976 | 1145 | ||
| 977 | 1146 | ||
| @@ -997,7 +1166,7 @@ emacs_blocked_malloc (size) | |||
| 997 | { | 1166 | { |
| 998 | void *value; | 1167 | void *value; |
| 999 | 1168 | ||
| 1000 | BLOCK_INPUT; | 1169 | BLOCK_INPUT_ALLOC; |
| 1001 | __malloc_hook = old_malloc_hook; | 1170 | __malloc_hook = old_malloc_hook; |
| 1002 | #ifdef DOUG_LEA_MALLOC | 1171 | #ifdef DOUG_LEA_MALLOC |
| 1003 | mallopt (M_TOP_PAD, malloc_hysteresis * 4096); | 1172 | mallopt (M_TOP_PAD, malloc_hysteresis * 4096); |
| @@ -1029,7 +1198,7 @@ emacs_blocked_malloc (size) | |||
| 1029 | #endif /* GC_MALLOC_CHECK */ | 1198 | #endif /* GC_MALLOC_CHECK */ |
| 1030 | 1199 | ||
| 1031 | __malloc_hook = emacs_blocked_malloc; | 1200 | __malloc_hook = emacs_blocked_malloc; |
| 1032 | UNBLOCK_INPUT; | 1201 | UNBLOCK_INPUT_ALLOC; |
| 1033 | 1202 | ||
| 1034 | /* fprintf (stderr, "%p malloc\n", value); */ | 1203 | /* fprintf (stderr, "%p malloc\n", value); */ |
| 1035 | return value; | 1204 | return value; |
| @@ -1045,7 +1214,7 @@ emacs_blocked_realloc (ptr, size) | |||
| 1045 | { | 1214 | { |
| 1046 | void *value; | 1215 | void *value; |
| 1047 | 1216 | ||
| 1048 | BLOCK_INPUT; | 1217 | BLOCK_INPUT_ALLOC; |
| 1049 | __realloc_hook = old_realloc_hook; | 1218 | __realloc_hook = old_realloc_hook; |
| 1050 | 1219 | ||
| 1051 | #ifdef GC_MALLOC_CHECK | 1220 | #ifdef GC_MALLOC_CHECK |
| @@ -1090,17 +1259,45 @@ emacs_blocked_realloc (ptr, size) | |||
| 1090 | #endif /* GC_MALLOC_CHECK */ | 1259 | #endif /* GC_MALLOC_CHECK */ |
| 1091 | 1260 | ||
| 1092 | __realloc_hook = emacs_blocked_realloc; | 1261 | __realloc_hook = emacs_blocked_realloc; |
| 1093 | UNBLOCK_INPUT; | 1262 | UNBLOCK_INPUT_ALLOC; |
| 1094 | 1263 | ||
| 1095 | return value; | 1264 | return value; |
| 1096 | } | 1265 | } |
| 1097 | 1266 | ||
| 1098 | 1267 | ||
| 1268 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 1269 | /* Called from Fdump_emacs so that when the dumped Emacs starts, it has a | ||
| 1270 | normal malloc. Some thread implementations need this as they call | ||
| 1271 | malloc before main. The pthread_self call in BLOCK_INPUT_ALLOC then | ||
| 1272 | calls malloc because it is the first call, and we have an endless loop. */ | ||
| 1273 | |||
| 1274 | void | ||
| 1275 | reset_malloc_hooks () | ||
| 1276 | { | ||
| 1277 | __free_hook = 0; | ||
| 1278 | __malloc_hook = 0; | ||
| 1279 | __realloc_hook = 0; | ||
| 1280 | } | ||
| 1281 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 1282 | |||
| 1283 | |||
| 1099 | /* Called from main to set up malloc to use our hooks. */ | 1284 | /* Called from main to set up malloc to use our hooks. */ |
| 1100 | 1285 | ||
| 1101 | void | 1286 | void |
| 1102 | uninterrupt_malloc () | 1287 | uninterrupt_malloc () |
| 1103 | { | 1288 | { |
| 1289 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 1290 | pthread_mutexattr_t attr; | ||
| 1291 | |||
| 1292 | /* GLIBC has a faster way to do this, but lets keep it portable. | ||
| 1293 | This is according to the Single UNIX Specification. */ | ||
| 1294 | pthread_mutexattr_init (&attr); | ||
| 1295 | pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); | ||
| 1296 | pthread_mutex_init (&alloc_mutex, &attr); | ||
| 1297 | |||
| 1298 | main_thread = pthread_self (); | ||
| 1299 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 1300 | |||
| 1104 | if (__free_hook != emacs_blocked_free) | 1301 | if (__free_hook != emacs_blocked_free) |
| 1105 | old_free_hook = __free_hook; | 1302 | old_free_hook = __free_hook; |
| 1106 | __free_hook = emacs_blocked_free; | 1303 | __free_hook = emacs_blocked_free; |
| @@ -1429,6 +1626,21 @@ static int total_string_size; | |||
| 1429 | 1626 | ||
| 1430 | #endif /* not GC_CHECK_STRING_BYTES */ | 1627 | #endif /* not GC_CHECK_STRING_BYTES */ |
| 1431 | 1628 | ||
| 1629 | |||
| 1630 | #ifdef GC_CHECK_STRING_OVERRUN | ||
| 1631 | |||
| 1632 | /* We check for overrun in string data blocks by appending a small | ||
| 1633 | "cookie" after each allocated string data block, and check for the | ||
| 1634 | presense of this cookie during GC. */ | ||
| 1635 | |||
| 1636 | #define GC_STRING_OVERRUN_COOKIE_SIZE 4 | ||
| 1637 | static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = | ||
| 1638 | { 0xde, 0xad, 0xbe, 0xef }; | ||
| 1639 | |||
| 1640 | #else | ||
| 1641 | #define GC_STRING_OVERRUN_COOKIE_SIZE 0 | ||
| 1642 | #endif | ||
| 1643 | |||
| 1432 | /* Value is the size of an sdata structure large enough to hold NBYTES | 1644 | /* Value is the size of an sdata structure large enough to hold NBYTES |
| 1433 | bytes of string data. The value returned includes a terminating | 1645 | bytes of string data. The value returned includes a terminating |
| 1434 | NUL byte, the size of the sdata structure, and padding. */ | 1646 | NUL byte, the size of the sdata structure, and padding. */ |
| @@ -1452,6 +1664,10 @@ static int total_string_size; | |||
| 1452 | 1664 | ||
| 1453 | #endif /* not GC_CHECK_STRING_BYTES */ | 1665 | #endif /* not GC_CHECK_STRING_BYTES */ |
| 1454 | 1666 | ||
| 1667 | /* Extra bytes to allocate for each string. */ | ||
| 1668 | |||
| 1669 | #define GC_STRING_EXTRA (GC_STRING_OVERRUN_COOKIE_SIZE) | ||
| 1670 | |||
| 1455 | /* Initialize string allocation. Called from init_alloc_once. */ | 1671 | /* Initialize string allocation. Called from init_alloc_once. */ |
| 1456 | 1672 | ||
| 1457 | void | 1673 | void |
| @@ -1516,7 +1732,7 @@ check_sblock (b) | |||
| 1516 | nbytes = SDATA_NBYTES (from); | 1732 | nbytes = SDATA_NBYTES (from); |
| 1517 | 1733 | ||
| 1518 | nbytes = SDATA_SIZE (nbytes); | 1734 | nbytes = SDATA_SIZE (nbytes); |
| 1519 | from_end = (struct sdata *) ((char *) from + nbytes); | 1735 | from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA); |
| 1520 | } | 1736 | } |
| 1521 | } | 1737 | } |
| 1522 | 1738 | ||
| @@ -1549,6 +1765,28 @@ check_string_bytes (all_p) | |||
| 1549 | 1765 | ||
| 1550 | #endif /* GC_CHECK_STRING_BYTES */ | 1766 | #endif /* GC_CHECK_STRING_BYTES */ |
| 1551 | 1767 | ||
| 1768 | #ifdef GC_CHECK_STRING_FREE_LIST | ||
| 1769 | |||
| 1770 | /* Walk through the string free list looking for bogus next pointers. | ||
| 1771 | This may catch buffer overrun from a previous string. */ | ||
| 1772 | |||
| 1773 | static void | ||
| 1774 | check_string_free_list () | ||
| 1775 | { | ||
| 1776 | struct Lisp_String *s; | ||
| 1777 | |||
| 1778 | /* Pop a Lisp_String off the free-list. */ | ||
| 1779 | s = string_free_list; | ||
| 1780 | while (s != NULL) | ||
| 1781 | { | ||
| 1782 | if ((unsigned)s < 1024) | ||
| 1783 | abort(); | ||
| 1784 | s = NEXT_FREE_LISP_STRING (s); | ||
| 1785 | } | ||
| 1786 | } | ||
| 1787 | #else | ||
| 1788 | #define check_string_free_list() | ||
| 1789 | #endif | ||
| 1552 | 1790 | ||
| 1553 | /* Return a new Lisp_String. */ | 1791 | /* Return a new Lisp_String. */ |
| 1554 | 1792 | ||
| @@ -1580,6 +1818,8 @@ allocate_string () | |||
| 1580 | total_free_strings += STRING_BLOCK_SIZE; | 1818 | total_free_strings += STRING_BLOCK_SIZE; |
| 1581 | } | 1819 | } |
| 1582 | 1820 | ||
| 1821 | check_string_free_list (); | ||
| 1822 | |||
| 1583 | /* Pop a Lisp_String off the free-list. */ | 1823 | /* Pop a Lisp_String off the free-list. */ |
| 1584 | s = string_free_list; | 1824 | s = string_free_list; |
| 1585 | string_free_list = NEXT_FREE_LISP_STRING (s); | 1825 | string_free_list = NEXT_FREE_LISP_STRING (s); |
| @@ -1649,7 +1889,7 @@ allocate_string_data (s, nchars, nbytes) | |||
| 1649 | mallopt (M_MMAP_MAX, 0); | 1889 | mallopt (M_MMAP_MAX, 0); |
| 1650 | #endif | 1890 | #endif |
| 1651 | 1891 | ||
| 1652 | b = (struct sblock *) lisp_malloc (size, MEM_TYPE_NON_LISP); | 1892 | b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP); |
| 1653 | 1893 | ||
| 1654 | #ifdef DOUG_LEA_MALLOC | 1894 | #ifdef DOUG_LEA_MALLOC |
| 1655 | /* Back to a reasonable maximum of mmap'ed areas. */ | 1895 | /* Back to a reasonable maximum of mmap'ed areas. */ |
| @@ -1664,7 +1904,7 @@ allocate_string_data (s, nchars, nbytes) | |||
| 1664 | else if (current_sblock == NULL | 1904 | else if (current_sblock == NULL |
| 1665 | || (((char *) current_sblock + SBLOCK_SIZE | 1905 | || (((char *) current_sblock + SBLOCK_SIZE |
| 1666 | - (char *) current_sblock->next_free) | 1906 | - (char *) current_sblock->next_free) |
| 1667 | < needed)) | 1907 | < (needed + GC_STRING_EXTRA))) |
| 1668 | { | 1908 | { |
| 1669 | /* Not enough room in the current sblock. */ | 1909 | /* Not enough room in the current sblock. */ |
| 1670 | b = (struct sblock *) lisp_malloc (SBLOCK_SIZE, MEM_TYPE_NON_LISP); | 1910 | b = (struct sblock *) lisp_malloc (SBLOCK_SIZE, MEM_TYPE_NON_LISP); |
| @@ -1693,7 +1933,11 @@ allocate_string_data (s, nchars, nbytes) | |||
| 1693 | s->size = nchars; | 1933 | s->size = nchars; |
| 1694 | s->size_byte = nbytes; | 1934 | s->size_byte = nbytes; |
| 1695 | s->data[nbytes] = '\0'; | 1935 | s->data[nbytes] = '\0'; |
| 1696 | b->next_free = (struct sdata *) ((char *) data + needed); | 1936 | #ifdef GC_CHECK_STRING_OVERRUN |
| 1937 | bcopy (string_overrun_cookie, (char *) data + needed, | ||
| 1938 | GC_STRING_OVERRUN_COOKIE_SIZE); | ||
| 1939 | #endif | ||
| 1940 | b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA); | ||
| 1697 | 1941 | ||
| 1698 | /* If S had already data assigned, mark that as free by setting its | 1942 | /* If S had already data assigned, mark that as free by setting its |
| 1699 | string back-pointer to null, and recording the size of the data | 1943 | string back-pointer to null, and recording the size of the data |
| @@ -1798,9 +2042,13 @@ sweep_strings () | |||
| 1798 | } | 2042 | } |
| 1799 | } | 2043 | } |
| 1800 | 2044 | ||
| 2045 | check_string_free_list (); | ||
| 2046 | |||
| 1801 | string_blocks = live_blocks; | 2047 | string_blocks = live_blocks; |
| 1802 | free_large_strings (); | 2048 | free_large_strings (); |
| 1803 | compact_small_strings (); | 2049 | compact_small_strings (); |
| 2050 | |||
| 2051 | check_string_free_list (); | ||
| 1804 | } | 2052 | } |
| 1805 | 2053 | ||
| 1806 | 2054 | ||
| @@ -1872,28 +2120,38 @@ compact_small_strings () | |||
| 1872 | else | 2120 | else |
| 1873 | nbytes = SDATA_NBYTES (from); | 2121 | nbytes = SDATA_NBYTES (from); |
| 1874 | 2122 | ||
| 2123 | if (nbytes > LARGE_STRING_BYTES) | ||
| 2124 | abort (); | ||
| 2125 | |||
| 1875 | nbytes = SDATA_SIZE (nbytes); | 2126 | nbytes = SDATA_SIZE (nbytes); |
| 1876 | from_end = (struct sdata *) ((char *) from + nbytes); | 2127 | from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA); |
| 2128 | |||
| 2129 | #ifdef GC_CHECK_STRING_OVERRUN | ||
| 2130 | if (bcmp (string_overrun_cookie, | ||
| 2131 | ((char *) from_end) - GC_STRING_OVERRUN_COOKIE_SIZE, | ||
| 2132 | GC_STRING_OVERRUN_COOKIE_SIZE)) | ||
| 2133 | abort (); | ||
| 2134 | #endif | ||
| 1877 | 2135 | ||
| 1878 | /* FROM->string non-null means it's alive. Copy its data. */ | 2136 | /* FROM->string non-null means it's alive. Copy its data. */ |
| 1879 | if (from->string) | 2137 | if (from->string) |
| 1880 | { | 2138 | { |
| 1881 | /* If TB is full, proceed with the next sblock. */ | 2139 | /* If TB is full, proceed with the next sblock. */ |
| 1882 | to_end = (struct sdata *) ((char *) to + nbytes); | 2140 | to_end = (struct sdata *) ((char *) to + nbytes + GC_STRING_EXTRA); |
| 1883 | if (to_end > tb_end) | 2141 | if (to_end > tb_end) |
| 1884 | { | 2142 | { |
| 1885 | tb->next_free = to; | 2143 | tb->next_free = to; |
| 1886 | tb = tb->next; | 2144 | tb = tb->next; |
| 1887 | tb_end = (struct sdata *) ((char *) tb + SBLOCK_SIZE); | 2145 | tb_end = (struct sdata *) ((char *) tb + SBLOCK_SIZE); |
| 1888 | to = &tb->first_data; | 2146 | to = &tb->first_data; |
| 1889 | to_end = (struct sdata *) ((char *) to + nbytes); | 2147 | to_end = (struct sdata *) ((char *) to + nbytes + GC_STRING_EXTRA); |
| 1890 | } | 2148 | } |
| 1891 | 2149 | ||
| 1892 | /* Copy, and update the string's `data' pointer. */ | 2150 | /* Copy, and update the string's `data' pointer. */ |
| 1893 | if (from != to) | 2151 | if (from != to) |
| 1894 | { | 2152 | { |
| 1895 | xassert (tb != b || to <= from); | 2153 | xassert (tb != b || to <= from); |
| 1896 | safe_bcopy ((char *) from, (char *) to, nbytes); | 2154 | safe_bcopy ((char *) from, (char *) to, nbytes + GC_STRING_EXTRA); |
| 1897 | to->string->data = SDATA_DATA (to); | 2155 | to->string->data = SDATA_DATA (to); |
| 1898 | } | 2156 | } |
| 1899 | 2157 | ||
| @@ -2403,9 +2661,9 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, | |||
| 2403 | void | 2661 | void |
| 2404 | check_cons_list () | 2662 | check_cons_list () |
| 2405 | { | 2663 | { |
| 2664 | #ifdef GC_CHECK_CONS_LIST | ||
| 2406 | struct Lisp_Cons *tail = cons_free_list; | 2665 | struct Lisp_Cons *tail = cons_free_list; |
| 2407 | 2666 | ||
| 2408 | #if 0 | ||
| 2409 | while (tail) | 2667 | while (tail) |
| 2410 | tail = *(struct Lisp_Cons **)&tail->cdr; | 2668 | tail = *(struct Lisp_Cons **)&tail->cdr; |
| 2411 | #endif | 2669 | #endif |
| @@ -4100,6 +4358,11 @@ mark_stack () | |||
| 4100 | #endif | 4358 | #endif |
| 4101 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) | 4359 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) |
| 4102 | mark_memory ((char *) stack_base + i, end); | 4360 | mark_memory ((char *) stack_base + i, end); |
| 4361 | /* Allow for marking a secondary stack, like the register stack on the | ||
| 4362 | ia64. */ | ||
| 4363 | #ifdef GC_MARK_SECONDARY_STACK | ||
| 4364 | GC_MARK_SECONDARY_STACK (); | ||
| 4365 | #endif | ||
| 4103 | 4366 | ||
| 4104 | #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS | 4367 | #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS |
| 4105 | check_gcpros (); | 4368 | check_gcpros (); |
diff --git a/src/buffer.c b/src/buffer.c index b0c8c370931..2d931272467 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5162,7 +5162,13 @@ init_buffer () | |||
| 5162 | } | 5162 | } |
| 5163 | #endif /* not VMS */ | 5163 | #endif /* not VMS */ |
| 5164 | 5164 | ||
| 5165 | current_buffer->directory = build_string (buf); | 5165 | current_buffer->directory = make_unibyte_string (buf, strlen (buf)); |
| 5166 | if (! NILP (buffer_defaults.enable_multibyte_characters)) | ||
| 5167 | /* At this momemnt, we still don't know how to decode the | ||
| 5168 | direcotry name. So, we keep the bytes in multibyte form so | ||
| 5169 | that ENCODE_FILE correctly gets the original bytes. */ | ||
| 5170 | current_buffer->directory | ||
| 5171 | = string_to_multibyte (current_buffer->directory); | ||
| 5166 | 5172 | ||
| 5167 | /* Add /: to the front of the name | 5173 | /* Add /: to the front of the name |
| 5168 | if it would otherwise be treated as magic. */ | 5174 | if it would otherwise be treated as magic. */ |
| @@ -5684,10 +5690,13 @@ scrolled, the top and bottom line of the window are marked with up and down | |||
| 5684 | arrow bitmaps. | 5690 | arrow bitmaps. |
| 5685 | 5691 | ||
| 5686 | If value is a symbol `left' or `right', both angle and arrow bitmaps | 5692 | If value is a symbol `left' or `right', both angle and arrow bitmaps |
| 5687 | are displayed in the left or right fringe, resp. | 5693 | are displayed in the left or right fringe, resp. Any other value |
| 5694 | that doesn't look like an alist means displat the angle bitmaps in | ||
| 5695 | the left fringe but no arrows. | ||
| 5688 | 5696 | ||
| 5689 | If value is an alist, each element (INDICATOR . POSITION) specifies | 5697 | You can exercise more precise control by using an alist as the |
| 5690 | the position of one of the indicators. INDICATOR is one of `top', | 5698 | value. Each alist element (INDICATOR . POSITION) specifies |
| 5699 | where to show one of the indicators. INDICATOR is one of `top', | ||
| 5691 | `bottom', `up', `down', or t, which specifies the default position, | 5700 | `bottom', `up', `down', or t, which specifies the default position, |
| 5692 | and POSITION is one of `left', `right', or nil, meaning do not show | 5701 | and POSITION is one of `left', `right', or nil, meaning do not show |
| 5693 | this indicator. | 5702 | this indicator. |
diff --git a/src/buildobj.lst b/src/buildobj.lst new file mode 100644 index 00000000000..084b936db31 --- /dev/null +++ b/src/buildobj.lst | |||
| @@ -0,0 +1 @@ | |||
| dispnew.o frame.o scroll.o xdisp.o xmenu.o window.o charset.o coding.o category.o ccl.o cm.o term.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o print.o lread.o abbrev.o syntax.o unexelf.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o terminfo.o lastfile.o vm-limit.o widget.o mktime.o | |||
diff --git a/src/coding.c b/src/coding.c index 58fc587570a..3ddd7ea957d 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -6004,6 +6004,37 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace) | |||
| 6004 | return 0; | 6004 | return 0; |
| 6005 | } | 6005 | } |
| 6006 | 6006 | ||
| 6007 | /* Name (or base name) of work buffer for code conversion. */ | ||
| 6008 | static Lisp_Object Vcode_conversion_workbuf_name; | ||
| 6009 | |||
| 6010 | /* Set the current buffer to the working buffer prepared for | ||
| 6011 | code-conversion. MULTIBYTE specifies the multibyteness of the | ||
| 6012 | buffer. */ | ||
| 6013 | |||
| 6014 | static struct buffer * | ||
| 6015 | set_conversion_work_buffer (multibyte) | ||
| 6016 | int multibyte; | ||
| 6017 | { | ||
| 6018 | Lisp_Object buffer; | ||
| 6019 | struct buffer *buf; | ||
| 6020 | |||
| 6021 | buffer = Fget_buffer_create (Vcode_conversion_workbuf_name); | ||
| 6022 | buf = XBUFFER (buffer); | ||
| 6023 | delete_all_overlays (buf); | ||
| 6024 | buf->directory = current_buffer->directory; | ||
| 6025 | buf->read_only = Qnil; | ||
| 6026 | buf->filename = Qnil; | ||
| 6027 | buf->undo_list = Qt; | ||
| 6028 | eassert (buf->overlays_before == NULL); | ||
| 6029 | eassert (buf->overlays_after == NULL); | ||
| 6030 | set_buffer_internal (buf); | ||
| 6031 | if (BEG != BEGV || Z != ZV) | ||
| 6032 | Fwiden (); | ||
| 6033 | del_range_2 (BEG, BEG_BYTE, Z, Z_BYTE, 0); | ||
| 6034 | buf->enable_multibyte_characters = multibyte ? Qt : Qnil; | ||
| 6035 | return buf; | ||
| 6036 | } | ||
| 6037 | |||
| 6007 | Lisp_Object | 6038 | Lisp_Object |
| 6008 | run_pre_post_conversion_on_str (str, coding, encodep) | 6039 | run_pre_post_conversion_on_str (str, coding, encodep) |
| 6009 | Lisp_Object str; | 6040 | Lisp_Object str; |
| @@ -6013,7 +6044,6 @@ run_pre_post_conversion_on_str (str, coding, encodep) | |||
| 6013 | int count = SPECPDL_INDEX (); | 6044 | int count = SPECPDL_INDEX (); |
| 6014 | struct gcpro gcpro1, gcpro2; | 6045 | struct gcpro gcpro1, gcpro2; |
| 6015 | int multibyte = STRING_MULTIBYTE (str); | 6046 | int multibyte = STRING_MULTIBYTE (str); |
| 6016 | Lisp_Object buffer; | ||
| 6017 | struct buffer *buf; | 6047 | struct buffer *buf; |
| 6018 | Lisp_Object old_deactivate_mark; | 6048 | Lisp_Object old_deactivate_mark; |
| 6019 | 6049 | ||
| @@ -6024,23 +6054,10 @@ run_pre_post_conversion_on_str (str, coding, encodep) | |||
| 6024 | old_deactivate_mark = Vdeactivate_mark; | 6054 | old_deactivate_mark = Vdeactivate_mark; |
| 6025 | GCPRO2 (str, old_deactivate_mark); | 6055 | GCPRO2 (str, old_deactivate_mark); |
| 6026 | 6056 | ||
| 6027 | buffer = Fget_buffer_create (build_string (" *code-converting-work*")); | ||
| 6028 | buf = XBUFFER (buffer); | ||
| 6029 | |||
| 6030 | delete_all_overlays (buf); | ||
| 6031 | buf->directory = current_buffer->directory; | ||
| 6032 | buf->read_only = Qnil; | ||
| 6033 | buf->filename = Qnil; | ||
| 6034 | buf->undo_list = Qt; | ||
| 6035 | eassert (buf->overlays_before == NULL); | ||
| 6036 | eassert (buf->overlays_after == NULL); | ||
| 6037 | |||
| 6038 | set_buffer_internal (buf); | ||
| 6039 | /* We must insert the contents of STR as is without | 6057 | /* We must insert the contents of STR as is without |
| 6040 | unibyte<->multibyte conversion. For that, we adjust the | 6058 | unibyte<->multibyte conversion. For that, we adjust the |
| 6041 | multibyteness of the working buffer to that of STR. */ | 6059 | multibyteness of the working buffer to that of STR. */ |
| 6042 | Ferase_buffer (); | 6060 | set_conversion_work_buffer (multibyte); |
| 6043 | buf->enable_multibyte_characters = multibyte ? Qt : Qnil; | ||
| 6044 | 6061 | ||
| 6045 | insert_from_string (str, 0, 0, | 6062 | insert_from_string (str, 0, 0, |
| 6046 | SCHARS (str), SBYTES (str), 0); | 6063 | SCHARS (str), SBYTES (str), 0); |
| @@ -6061,6 +6078,64 @@ run_pre_post_conversion_on_str (str, coding, encodep) | |||
| 6061 | return unbind_to (count, str); | 6078 | return unbind_to (count, str); |
| 6062 | } | 6079 | } |
| 6063 | 6080 | ||
| 6081 | |||
| 6082 | /* Run pre-write-conversion function of CODING on NCHARS/NBYTES | ||
| 6083 | text in *STR. *SIZE is the allocated bytes for STR. As it | ||
| 6084 | is intended that this function is called from encode_terminal_code, | ||
| 6085 | the pre-write-conversion function is run by safe_call and thus | ||
| 6086 | "Error during redisplay: ..." is logged when an error occurs. | ||
| 6087 | |||
| 6088 | Store the resulting text in *STR and set CODING->produced_char and | ||
| 6089 | CODING->produced to the number of characters and bytes | ||
| 6090 | respectively. If the size of *STR is too small, enlarge it by | ||
| 6091 | xrealloc and update *STR and *SIZE. */ | ||
| 6092 | |||
| 6093 | void | ||
| 6094 | run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding) | ||
| 6095 | unsigned char **str; | ||
| 6096 | int *size, nchars, nbytes; | ||
| 6097 | struct coding_system *coding; | ||
| 6098 | { | ||
| 6099 | struct gcpro gcpro1, gcpro2; | ||
| 6100 | struct buffer *cur = current_buffer; | ||
| 6101 | Lisp_Object old_deactivate_mark, old_last_coding_system_used; | ||
| 6102 | Lisp_Object args[3]; | ||
| 6103 | |||
| 6104 | /* It is not crucial to specbind this. */ | ||
| 6105 | old_deactivate_mark = Vdeactivate_mark; | ||
| 6106 | old_last_coding_system_used = Vlast_coding_system_used; | ||
| 6107 | GCPRO2 (old_deactivate_mark, old_last_coding_system_used); | ||
| 6108 | |||
| 6109 | /* We must insert the contents of STR as is without | ||
| 6110 | unibyte<->multibyte conversion. For that, we adjust the | ||
| 6111 | multibyteness of the working buffer to that of STR. */ | ||
| 6112 | set_conversion_work_buffer (coding->src_multibyte); | ||
| 6113 | insert_1_both (*str, nchars, nbytes, 0, 0, 0); | ||
| 6114 | UNGCPRO; | ||
| 6115 | inhibit_pre_post_conversion = 1; | ||
| 6116 | args[0] = coding->pre_write_conversion; | ||
| 6117 | args[1] = make_number (BEG); | ||
| 6118 | args[2] = make_number (Z); | ||
| 6119 | safe_call (3, args); | ||
| 6120 | inhibit_pre_post_conversion = 0; | ||
| 6121 | Vdeactivate_mark = old_deactivate_mark; | ||
| 6122 | Vlast_coding_system_used = old_last_coding_system_used; | ||
| 6123 | coding->produced_char = Z - BEG; | ||
| 6124 | coding->produced = Z_BYTE - BEG_BYTE; | ||
| 6125 | if (coding->produced > *size) | ||
| 6126 | { | ||
| 6127 | *size = coding->produced; | ||
| 6128 | *str = xrealloc (*str, *size); | ||
| 6129 | } | ||
| 6130 | if (BEG < GPT && GPT < Z) | ||
| 6131 | move_gap (BEG); | ||
| 6132 | bcopy (BEG_ADDR, *str, coding->produced); | ||
| 6133 | coding->src_multibyte | ||
| 6134 | = ! NILP (current_buffer->enable_multibyte_characters); | ||
| 6135 | set_buffer_internal (cur); | ||
| 6136 | } | ||
| 6137 | |||
| 6138 | |||
| 6064 | Lisp_Object | 6139 | Lisp_Object |
| 6065 | decode_coding_string (str, coding, nocopy) | 6140 | decode_coding_string (str, coding, nocopy) |
| 6066 | Lisp_Object str; | 6141 | Lisp_Object str; |
| @@ -7539,6 +7614,9 @@ init_coding_once () | |||
| 7539 | void | 7614 | void |
| 7540 | syms_of_coding () | 7615 | syms_of_coding () |
| 7541 | { | 7616 | { |
| 7617 | staticpro (&Vcode_conversion_workbuf_name); | ||
| 7618 | Vcode_conversion_workbuf_name = build_string (" *code-conversion-work*"); | ||
| 7619 | |||
| 7542 | Qtarget_idx = intern ("target-idx"); | 7620 | Qtarget_idx = intern ("target-idx"); |
| 7543 | staticpro (&Qtarget_idx); | 7621 | staticpro (&Qtarget_idx); |
| 7544 | 7622 | ||
diff --git a/src/coding.h b/src/coding.h index 8eddf9d6855..ed31a7d7c94 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | /* Header for coding system handler. | 1 | /* Header for coding system handler. |
| 2 | Copyright (C) 2004 Free Software Foundation, Inc. | ||
| 2 | Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. | 3 | Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. |
| 3 | Licensed to the Free Software Foundation. | 4 | Licensed to the Free Software Foundation. |
| 4 | 5 | ||
| @@ -572,10 +573,10 @@ struct coding_system | |||
| 572 | for file names, if any. */ | 573 | for file names, if any. */ |
| 573 | #define ENCODE_FILE(name) \ | 574 | #define ENCODE_FILE(name) \ |
| 574 | (! NILP (Vfile_name_coding_system) \ | 575 | (! NILP (Vfile_name_coding_system) \ |
| 575 | && XFASTINT (Vfile_name_coding_system) != 0 \ | 576 | && !EQ (Vfile_name_coding_system, make_number (0)) \ |
| 576 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ | 577 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ |
| 577 | : (! NILP (Vdefault_file_name_coding_system) \ | 578 | : (! NILP (Vdefault_file_name_coding_system) \ |
| 578 | && XFASTINT (Vdefault_file_name_coding_system) != 0 \ | 579 | && !EQ (Vdefault_file_name_coding_system, make_number (0)) \ |
| 579 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ | 580 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ |
| 580 | : name)) | 581 | : name)) |
| 581 | 582 | ||
| @@ -583,10 +584,10 @@ struct coding_system | |||
| 583 | for file names, if any. */ | 584 | for file names, if any. */ |
| 584 | #define DECODE_FILE(name) \ | 585 | #define DECODE_FILE(name) \ |
| 585 | (! NILP (Vfile_name_coding_system) \ | 586 | (! NILP (Vfile_name_coding_system) \ |
| 586 | && XFASTINT (Vfile_name_coding_system) != 0 \ | 587 | && !EQ (Vfile_name_coding_system, make_number (0)) \ |
| 587 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ | 588 | ? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ |
| 588 | : (! NILP (Vdefault_file_name_coding_system) \ | 589 | : (! NILP (Vdefault_file_name_coding_system) \ |
| 589 | && XFASTINT (Vdefault_file_name_coding_system) != 0 \ | 590 | && !EQ (Vdefault_file_name_coding_system, make_number (0)) \ |
| 590 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ | 591 | ? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ |
| 591 | : name)) | 592 | : name)) |
| 592 | 593 | ||
| @@ -595,7 +596,7 @@ struct coding_system | |||
| 595 | for w32 system functions, if any. */ | 596 | for w32 system functions, if any. */ |
| 596 | #define ENCODE_SYSTEM(str) \ | 597 | #define ENCODE_SYSTEM(str) \ |
| 597 | (! NILP (Vlocale_coding_system) \ | 598 | (! NILP (Vlocale_coding_system) \ |
| 598 | && XFASTINT (Vlocale_coding_system) != 0 \ | 599 | && !EQ (Vlocale_coding_system, make_number (0)) \ |
| 599 | ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ | 600 | ? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ |
| 600 | : str) | 601 | : str) |
| 601 | 602 | ||
| @@ -603,7 +604,7 @@ struct coding_system | |||
| 603 | for w32 system functions, if any. */ | 604 | for w32 system functions, if any. */ |
| 604 | #define DECODE_SYSTEM(name) \ | 605 | #define DECODE_SYSTEM(name) \ |
| 605 | (! NILP (Vlocale_coding_system) \ | 606 | (! NILP (Vlocale_coding_system) \ |
| 606 | && XFASTINT (Vlocale_coding_system) != 0 \ | 607 | && !EQ (Vlocale_coding_system, make_number (0)) \ |
| 607 | ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ | 608 | ? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ |
| 608 | : str) | 609 | : str) |
| 609 | 610 | ||
| @@ -635,6 +636,10 @@ extern int code_convert_region P_ ((int, int, int, int, struct coding_system *, | |||
| 635 | extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object, | 636 | extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object, |
| 636 | struct coding_system *, | 637 | struct coding_system *, |
| 637 | int)); | 638 | int)); |
| 639 | extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *, | ||
| 640 | int, int, | ||
| 641 | struct coding_system *)); | ||
| 642 | |||
| 638 | extern int decoding_buffer_size P_ ((struct coding_system *, int)); | 643 | extern int decoding_buffer_size P_ ((struct coding_system *, int)); |
| 639 | extern int encoding_buffer_size P_ ((struct coding_system *, int)); | 644 | extern int encoding_buffer_size P_ ((struct coding_system *, int)); |
| 640 | extern void detect_coding P_ ((struct coding_system *, const unsigned char *, | 645 | extern void detect_coding P_ ((struct coding_system *, const unsigned char *, |
diff --git a/src/config.in b/src/config.in index c253f0c411b..65a320bca42 100644 --- a/src/config.in +++ b/src/config.in | |||
| @@ -220,6 +220,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 220 | /* Define to 1 if using GTK. */ | 220 | /* Define to 1 if using GTK. */ |
| 221 | #undef HAVE_GTK | 221 | #undef HAVE_GTK |
| 222 | 222 | ||
| 223 | /* Define to 1 if you have GTK and pthread (-lpthread). */ | ||
| 224 | #undef HAVE_GTK_AND_PTHREAD | ||
| 225 | |||
| 223 | /* Define to 1 if GTK has both file selection and chooser dialog. */ | 226 | /* Define to 1 if GTK has both file selection and chooser dialog. */ |
| 224 | #undef HAVE_GTK_FILE_BOTH | 227 | #undef HAVE_GTK_FILE_BOTH |
| 225 | 228 | ||
| @@ -441,6 +444,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 441 | /* Define to 1 if you have the `pstat_getdynamic' function. */ | 444 | /* Define to 1 if you have the `pstat_getdynamic' function. */ |
| 442 | #undef HAVE_PSTAT_GETDYNAMIC | 445 | #undef HAVE_PSTAT_GETDYNAMIC |
| 443 | 446 | ||
| 447 | /* Define to 1 if you have the <pthread.h> header file. */ | ||
| 448 | #undef HAVE_PTHREAD_H | ||
| 449 | |||
| 444 | /* Define to 1 if you have the <pty.h> header file. */ | 450 | /* Define to 1 if you have the <pty.h> header file. */ |
| 445 | #undef HAVE_PTY_H | 451 | #undef HAVE_PTY_H |
| 446 | 452 | ||
diff --git a/src/data.c b/src/data.c index 2e3378cf319..afbca80181d 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1509,6 +1509,9 @@ Note that binding the variable with `let', or setting it while | |||
| 1509 | a `let'-style binding made in this buffer is in effect, | 1509 | a `let'-style binding made in this buffer is in effect, |
| 1510 | does not make the variable buffer-local. Return VARIABLE. | 1510 | does not make the variable buffer-local. Return VARIABLE. |
| 1511 | 1511 | ||
| 1512 | In most cases it is better to use `make-local-variable', | ||
| 1513 | which makes a variable local in just one buffer. | ||
| 1514 | |||
| 1512 | The function `default-value' gets the default value and `set-default' sets it. */) | 1515 | The function `default-value' gets the default value and `set-default' sets it. */) |
| 1513 | (variable) | 1516 | (variable) |
| 1514 | register Lisp_Object variable; | 1517 | register Lisp_Object variable; |
| @@ -1552,7 +1555,7 @@ DEFUN ("make-local-variable", Fmake_local_variable, Smake_local_variable, | |||
| 1552 | Other buffers will continue to share a common default value. | 1555 | Other buffers will continue to share a common default value. |
| 1553 | \(The buffer-local value of VARIABLE starts out as the same value | 1556 | \(The buffer-local value of VARIABLE starts out as the same value |
| 1554 | VARIABLE previously had. If VARIABLE was void, it remains void.\) | 1557 | VARIABLE previously had. If VARIABLE was void, it remains void.\) |
| 1555 | See also `make-variable-buffer-local'. Return VARIABLE. | 1558 | Return VARIABLE. |
| 1556 | 1559 | ||
| 1557 | If the variable is already arranged to become local when set, | 1560 | If the variable is already arranged to become local when set, |
| 1558 | this function causes a local value to exist for this buffer, | 1561 | this function causes a local value to exist for this buffer, |
| @@ -1562,6 +1565,8 @@ This function returns VARIABLE, and therefore | |||
| 1562 | (set (make-local-variable 'VARIABLE) VALUE-EXP) | 1565 | (set (make-local-variable 'VARIABLE) VALUE-EXP) |
| 1563 | works. | 1566 | works. |
| 1564 | 1567 | ||
| 1568 | See also `make-variable-buffer-local'. | ||
| 1569 | |||
| 1565 | Do not use `make-local-variable' to make a hook variable buffer-local. | 1570 | Do not use `make-local-variable' to make a hook variable buffer-local. |
| 1566 | Instead, use `add-hook' and specify t for the LOCAL argument. */) | 1571 | Instead, use `add-hook' and specify t for the LOCAL argument. */) |
| 1567 | (variable) | 1572 | (variable) |
diff --git a/src/dispextern.h b/src/dispextern.h index 99cf38249ac..d3d70b28cf8 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -974,7 +974,7 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); | |||
| 974 | or a control char, or an overlay string. */ | 974 | or a control char, or an overlay string. */ |
| 975 | 975 | ||
| 976 | #define MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P(ROW) \ | 976 | #define MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P(ROW) \ |
| 977 | ((ROW)->end.dpvec_index >= 0 \ | 977 | ((ROW)->end.dpvec_index > 0 \ |
| 978 | || (ROW)->end.overlay_string_index >= 0 \ | 978 | || (ROW)->end.overlay_string_index >= 0 \ |
| 979 | || (ROW)->ends_in_middle_of_char_p) | 979 | || (ROW)->ends_in_middle_of_char_p) |
| 980 | 980 | ||
| @@ -986,7 +986,7 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); | |||
| 986 | /* Non-zero if ROW starts in the middle of a character. See above. */ | 986 | /* Non-zero if ROW starts in the middle of a character. See above. */ |
| 987 | 987 | ||
| 988 | #define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW) \ | 988 | #define MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P(ROW) \ |
| 989 | ((ROW)->start.dpvec_index >= 0 \ | 989 | ((ROW)->start.dpvec_index > 0 \ |
| 990 | || (ROW)->starts_in_middle_of_char_p \ | 990 | || (ROW)->starts_in_middle_of_char_p \ |
| 991 | || ((ROW)->start.overlay_string_index >= 0 \ | 991 | || ((ROW)->start.overlay_string_index >= 0 \ |
| 992 | && (ROW)->start.string_pos.charpos > 0)) | 992 | && (ROW)->start.string_pos.charpos > 0)) |
| @@ -2730,7 +2730,7 @@ int ascii_face_of_lisp_face P_ ((struct frame *, int)); | |||
| 2730 | void prepare_face_for_display P_ ((struct frame *, struct face *)); | 2730 | void prepare_face_for_display P_ ((struct frame *, struct face *)); |
| 2731 | int xstricmp P_ ((const unsigned char *, const unsigned char *)); | 2731 | int xstricmp P_ ((const unsigned char *, const unsigned char *)); |
| 2732 | int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *)); | 2732 | int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *)); |
| 2733 | int lookup_named_face P_ ((struct frame *, Lisp_Object, int)); | 2733 | int lookup_named_face P_ ((struct frame *, Lisp_Object, int, int)); |
| 2734 | int smaller_face P_ ((struct frame *, int, int)); | 2734 | int smaller_face P_ ((struct frame *, int, int)); |
| 2735 | int face_with_height P_ ((struct frame *, int, int)); | 2735 | int face_with_height P_ ((struct frame *, int, int)); |
| 2736 | int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int)); | 2736 | int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int)); |
diff --git a/src/emacs.c b/src/emacs.c index 356f74204bf..cbd592f9103 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -581,8 +581,12 @@ init_cmdargs (argc, argv, skip_args) | |||
| 581 | for (i = argc - 1; i >= 0; i--) | 581 | for (i = argc - 1; i >= 0; i--) |
| 582 | { | 582 | { |
| 583 | if (i == 0 || i > skip_args) | 583 | if (i == 0 || i > skip_args) |
| 584 | /* For the moment, we keep arguments as is in unibyte strings. | ||
| 585 | They are decoded in the function command-line after we know | ||
| 586 | locale-coding-system. */ | ||
| 584 | Vcommand_line_args | 587 | Vcommand_line_args |
| 585 | = Fcons (build_string (argv[i]), Vcommand_line_args); | 588 | = Fcons (make_unibyte_string (argv[i], strlen (argv[i])), |
| 589 | Vcommand_line_args); | ||
| 586 | } | 590 | } |
| 587 | 591 | ||
| 588 | unbind_to (count, Qnil); | 592 | unbind_to (count, Qnil); |
| @@ -745,7 +749,9 @@ malloc_initialize_hook () | |||
| 745 | } | 749 | } |
| 746 | 750 | ||
| 747 | malloc_set_state (malloc_state_ptr); | 751 | malloc_set_state (malloc_state_ptr); |
| 752 | #ifndef XMALLOC_OVERRUN_CHECK | ||
| 748 | free (malloc_state_ptr); | 753 | free (malloc_state_ptr); |
| 754 | #endif | ||
| 749 | } | 755 | } |
| 750 | else | 756 | else |
| 751 | { | 757 | { |
| @@ -2231,6 +2237,12 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2231 | memory_warnings (my_edata, malloc_warning); | 2237 | memory_warnings (my_edata, malloc_warning); |
| 2232 | #endif /* not WINDOWSNT */ | 2238 | #endif /* not WINDOWSNT */ |
| 2233 | #endif | 2239 | #endif |
| 2240 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 2241 | /* Pthread may call malloc before main, and then we will get an endless | ||
| 2242 | loop, because pthread_self (see alloc.c) calls malloc the first time | ||
| 2243 | it is called on some systems. */ | ||
| 2244 | reset_malloc_hooks (); | ||
| 2245 | #endif | ||
| 2234 | #ifdef DOUG_LEA_MALLOC | 2246 | #ifdef DOUG_LEA_MALLOC |
| 2235 | malloc_state_ptr = malloc_get_state (); | 2247 | malloc_state_ptr = malloc_get_state (); |
| 2236 | #endif | 2248 | #endif |
diff --git a/src/eval.c b/src/eval.c index adff3e8670c..4a63b022fd6 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -573,7 +573,7 @@ optional argument, and making the `interactive' spec specify non-nil | |||
| 573 | unconditionally for that argument. (`p' is a good way to do this.) */) | 573 | unconditionally for that argument. (`p' is a good way to do this.) */) |
| 574 | () | 574 | () |
| 575 | { | 575 | { |
| 576 | return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil; | 576 | return interactive_p (1) ? Qt : Qnil; |
| 577 | } | 577 | } |
| 578 | 578 | ||
| 579 | 579 | ||
| @@ -595,7 +595,8 @@ interactive_p (exclude_subrs_p) | |||
| 595 | /* If this isn't a byte-compiled function, there may be a frame at | 595 | /* If this isn't a byte-compiled function, there may be a frame at |
| 596 | the top for Finteractive_p. If so, skip it. */ | 596 | the top for Finteractive_p. If so, skip it. */ |
| 597 | fun = Findirect_function (*btp->function); | 597 | fun = Findirect_function (*btp->function); |
| 598 | if (SUBRP (fun) && XSUBR (fun) == &Sinteractive_p) | 598 | if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p |
| 599 | || XSUBR (fun) == &Scalled_interactively_p)) | ||
| 599 | btp = btp->next; | 600 | btp = btp->next; |
| 600 | 601 | ||
| 601 | /* If we're running an Emacs 18-style byte-compiled function, there | 602 | /* If we're running an Emacs 18-style byte-compiled function, there |
| @@ -786,6 +787,21 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 786 | { | 787 | { |
| 787 | if (NILP (tem)) | 788 | if (NILP (tem)) |
| 788 | Fset_default (sym, Feval (Fcar (tail))); | 789 | Fset_default (sym, Feval (Fcar (tail))); |
| 790 | else | ||
| 791 | { /* Check if there is really a global binding rather than just a let | ||
| 792 | binding that shadows the global unboundness of the var. */ | ||
| 793 | volatile struct specbinding *pdl = specpdl_ptr; | ||
| 794 | while (--pdl >= specpdl) | ||
| 795 | { | ||
| 796 | if (EQ (pdl->symbol, sym) && !pdl->func | ||
| 797 | && EQ (pdl->old_value, Qunbound)) | ||
| 798 | { | ||
| 799 | message_with_string ("Warning: defvar ignored because %s is let-bound", | ||
| 800 | SYMBOL_NAME (sym), 1); | ||
| 801 | break; | ||
| 802 | } | ||
| 803 | } | ||
| 804 | } | ||
| 789 | tail = Fcdr (tail); | 805 | tail = Fcdr (tail); |
| 790 | tem = Fcar (tail); | 806 | tem = Fcar (tail); |
| 791 | if (!NILP (tem)) | 807 | if (!NILP (tem)) |
| @@ -1158,9 +1174,10 @@ unwind_to_catch (catch, value) | |||
| 1158 | /* Save the value in the tag. */ | 1174 | /* Save the value in the tag. */ |
| 1159 | catch->val = value; | 1175 | catch->val = value; |
| 1160 | 1176 | ||
| 1161 | /* Restore the polling-suppression count. */ | 1177 | /* Restore certain special C variables. */ |
| 1162 | set_poll_suppress_count (catch->poll_suppress_count); | 1178 | set_poll_suppress_count (catch->poll_suppress_count); |
| 1163 | interrupt_input_blocked = catch->interrupt_input_blocked; | 1179 | interrupt_input_blocked = catch->interrupt_input_blocked; |
| 1180 | handling_signal = 0; | ||
| 1164 | 1181 | ||
| 1165 | do | 1182 | do |
| 1166 | { | 1183 | { |
diff --git a/src/filelock.c b/src/filelock.c index cbf3f860a92..84540f79330 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -377,6 +377,9 @@ lock_file_1 (lfname, force) | |||
| 377 | char *host_name; | 377 | char *host_name; |
| 378 | char *lock_info_str; | 378 | char *lock_info_str; |
| 379 | 379 | ||
| 380 | /* Call this first because it can GC. */ | ||
| 381 | boot_time = get_boot_time (); | ||
| 382 | |||
| 380 | if (STRINGP (Fuser_login_name (Qnil))) | 383 | if (STRINGP (Fuser_login_name (Qnil))) |
| 381 | user_name = (char *)SDATA (Fuser_login_name (Qnil)); | 384 | user_name = (char *)SDATA (Fuser_login_name (Qnil)); |
| 382 | else | 385 | else |
| @@ -386,9 +389,8 @@ lock_file_1 (lfname, force) | |||
| 386 | else | 389 | else |
| 387 | host_name = ""; | 390 | host_name = ""; |
| 388 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) | 391 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) |
| 389 | + LOCK_PID_MAX + 5); | 392 | + LOCK_PID_MAX + 30); |
| 390 | 393 | ||
| 391 | boot_time = get_boot_time (); | ||
| 392 | if (boot_time) | 394 | if (boot_time) |
| 393 | sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, | 395 | sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, |
| 394 | (unsigned long) getpid (), (unsigned long) boot_time); | 396 | (unsigned long) getpid (), (unsigned long) boot_time); |
| @@ -562,6 +562,7 @@ concat (nargs, args, target_type, last_special) | |||
| 562 | struct textprop_rec *textprops = NULL; | 562 | struct textprop_rec *textprops = NULL; |
| 563 | /* Number of elments in textprops. */ | 563 | /* Number of elments in textprops. */ |
| 564 | int num_textprops = 0; | 564 | int num_textprops = 0; |
| 565 | USE_SAFE_ALLOCA; | ||
| 565 | 566 | ||
| 566 | tail = Qnil; | 567 | tail = Qnil; |
| 567 | 568 | ||
| @@ -670,8 +671,7 @@ concat (nargs, args, target_type, last_special) | |||
| 670 | 671 | ||
| 671 | prev = Qnil; | 672 | prev = Qnil; |
| 672 | if (STRINGP (val)) | 673 | if (STRINGP (val)) |
| 673 | textprops | 674 | SAFE_ALLOCA (textprops, struct textprop_rec *, sizeof (struct textprop_rec) * nargs); |
| 674 | = (struct textprop_rec *) alloca (sizeof (struct textprop_rec) * nargs); | ||
| 675 | 675 | ||
| 676 | for (argnum = 0; argnum < nargs; argnum++) | 676 | for (argnum = 0; argnum < nargs; argnum++) |
| 677 | { | 677 | { |
| @@ -827,6 +827,8 @@ concat (nargs, args, target_type, last_special) | |||
| 827 | last_to_end = textprops[argnum].to + SCHARS (this); | 827 | last_to_end = textprops[argnum].to + SCHARS (this); |
| 828 | } | 828 | } |
| 829 | } | 829 | } |
| 830 | |||
| 831 | SAFE_FREE (); | ||
| 830 | return val; | 832 | return val; |
| 831 | } | 833 | } |
| 832 | 834 | ||
diff --git a/src/fringe.c b/src/fringe.c index 661af1fb0eb..d08f0ea4535 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -810,12 +810,13 @@ update_window_fringes (w, force_p) | |||
| 810 | arrow_bot = XCDR (pos); | 810 | arrow_bot = XCDR (pos); |
| 811 | } | 811 | } |
| 812 | else | 812 | else |
| 813 | ind = Qnil; | 813 | /* Anything else means boundary on left and no arrows. */ |
| 814 | boundary_top = boundary_bot = Qleft; | ||
| 814 | } | 815 | } |
| 815 | 816 | ||
| 816 | if (!NILP (ind)) | 817 | if (!NILP (ind)) |
| 817 | { | 818 | { |
| 818 | int do_eob = 1, do_bob = 1; | 819 | int done_top = 0, done_bot = 0; |
| 819 | 820 | ||
| 820 | for (y = 0, rn = 0; | 821 | for (y = 0, rn = 0; |
| 821 | y < yb && rn < nrows; | 822 | y < yb && rn < nrows; |
| @@ -836,19 +837,25 @@ update_window_fringes (w, force_p) | |||
| 836 | row->indicate_bob_p = row->indicate_top_line_p = 0; | 837 | row->indicate_bob_p = row->indicate_top_line_p = 0; |
| 837 | row->indicate_eob_p = row->indicate_bottom_line_p = 0; | 838 | row->indicate_eob_p = row->indicate_bottom_line_p = 0; |
| 838 | 839 | ||
| 839 | if (!NILP (boundary_top) | 840 | if (!row->mode_line_p) |
| 840 | && MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) | 841 | { |
| 841 | row->indicate_bob_p = do_bob, do_bob = 0; | 842 | if (!done_top) |
| 842 | else if (!NILP (arrow_top) | 843 | { |
| 843 | && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn) | 844 | if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) |
| 844 | row->indicate_top_line_p = 1; | 845 | row->indicate_bob_p = !NILP (boundary_top); |
| 846 | else | ||
| 847 | row->indicate_top_line_p = !NILP (arrow_top); | ||
| 848 | done_top = 1; | ||
| 849 | } | ||
| 845 | 850 | ||
| 846 | if (!NILP (boundary_bot) | 851 | if (!done_bot) |
| 847 | && MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) | 852 | { |
| 848 | row->indicate_eob_p = do_eob, do_eob = 0; | 853 | if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) |
| 849 | else if (!NILP (arrow_bot) | 854 | row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; |
| 850 | && y + row->height >= yb) | 855 | else if (y + row->height >= yb) |
| 851 | row->indicate_bottom_line_p = 1; | 856 | row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; |
| 857 | } | ||
| 858 | } | ||
| 852 | 859 | ||
| 853 | if (indicate_bob_p != row->indicate_bob_p | 860 | if (indicate_bob_p != row->indicate_bob_p |
| 854 | || indicate_top_line_p != row->indicate_top_line_p | 861 | || indicate_top_line_p != row->indicate_top_line_p |
| @@ -884,13 +891,13 @@ update_window_fringes (w, force_p) | |||
| 884 | left = row->left_user_fringe_bitmap; | 891 | left = row->left_user_fringe_bitmap; |
| 885 | left_face_id = row->left_user_fringe_face_id; | 892 | left_face_id = row->left_user_fringe_face_id; |
| 886 | } | 893 | } |
| 894 | else if (row->truncated_on_left_p) | ||
| 895 | left = LEFT_TRUNCATION_BITMAP; | ||
| 887 | else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) | 896 | else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) |
| 888 | left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 897 | left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
| 889 | ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP); | 898 | ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP); |
| 890 | else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) | 899 | else if (row->indicate_eob_p && EQ (boundary_bot, Qleft)) |
| 891 | left = BOTTOM_LEFT_ANGLE_BITMAP; | 900 | left = BOTTOM_LEFT_ANGLE_BITMAP; |
| 892 | else if (row->truncated_on_left_p) | ||
| 893 | left = LEFT_TRUNCATION_BITMAP; | ||
| 894 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) | 901 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
| 895 | left = CONTINUATION_LINE_BITMAP; | 902 | left = CONTINUATION_LINE_BITMAP; |
| 896 | else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) | 903 | else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft)) |
| @@ -910,13 +917,13 @@ update_window_fringes (w, force_p) | |||
| 910 | right = row->right_user_fringe_bitmap; | 917 | right = row->right_user_fringe_bitmap; |
| 911 | right_face_id = row->right_user_fringe_face_id; | 918 | right_face_id = row->right_user_fringe_face_id; |
| 912 | } | 919 | } |
| 920 | else if (row->truncated_on_right_p) | ||
| 921 | right = RIGHT_TRUNCATION_BITMAP; | ||
| 913 | else if (row->indicate_bob_p && EQ (boundary_top, Qright)) | 922 | else if (row->indicate_bob_p && EQ (boundary_top, Qright)) |
| 914 | right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) | 923 | right = ((row->indicate_eob_p && EQ (boundary_bot, Qright)) |
| 915 | ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP); | 924 | ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP); |
| 916 | else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) | 925 | else if (row->indicate_eob_p && EQ (boundary_bot, Qright)) |
| 917 | right = BOTTOM_RIGHT_ANGLE_BITMAP; | 926 | right = BOTTOM_RIGHT_ANGLE_BITMAP; |
| 918 | else if (row->truncated_on_right_p) | ||
| 919 | right = RIGHT_TRUNCATION_BITMAP; | ||
| 920 | else if (row->continued_p) | 927 | else if (row->continued_p) |
| 921 | right = CONTINUED_LINE_BITMAP; | 928 | right = CONTINUED_LINE_BITMAP; |
| 922 | else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) | 929 | else if (row->indicate_top_line_p && EQ (arrow_top, Qright)) |
| @@ -1352,7 +1359,7 @@ If FACE is nil, reset face to default fringe face. */) | |||
| 1352 | 1359 | ||
| 1353 | if (!NILP (face)) | 1360 | if (!NILP (face)) |
| 1354 | { | 1361 | { |
| 1355 | face_id = lookup_named_face (SELECTED_FRAME (), face, 'A'); | 1362 | face_id = lookup_named_face (SELECTED_FRAME (), face, 'A', 1); |
| 1356 | if (face_id < 0) | 1363 | if (face_id < 0) |
| 1357 | error ("No such face"); | 1364 | error ("No such face"); |
| 1358 | } | 1365 | } |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 25dd88d544e..317f7824267 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -23,10 +23,12 @@ Boston, MA 02111-1307, USA. */ | |||
| 23 | 23 | ||
| 24 | #ifdef USE_GTK | 24 | #ifdef USE_GTK |
| 25 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include <signal.h> | ||
| 26 | #include <stdio.h> | 27 | #include <stdio.h> |
| 27 | #include "lisp.h" | 28 | #include "lisp.h" |
| 28 | #include "xterm.h" | 29 | #include "xterm.h" |
| 29 | #include "blockinput.h" | 30 | #include "blockinput.h" |
| 31 | #include "syssignal.h" | ||
| 30 | #include "window.h" | 32 | #include "window.h" |
| 31 | #include "atimer.h" | 33 | #include "atimer.h" |
| 32 | #include "gtkutil.h" | 34 | #include "gtkutil.h" |
| @@ -1122,10 +1124,6 @@ create_dialog (wv, select_cb, deactivate_cb) | |||
| 1122 | /*********************************************************************** | 1124 | /*********************************************************************** |
| 1123 | File dialog functions | 1125 | File dialog functions |
| 1124 | ***********************************************************************/ | 1126 | ***********************************************************************/ |
| 1125 | #ifdef HAVE_GTK_FILE_BOTH | ||
| 1126 | int use_old_gtk_file_dialog; | ||
| 1127 | #endif | ||
| 1128 | |||
| 1129 | /* Function that is called when the file dialog pops down. | 1127 | /* Function that is called when the file dialog pops down. |
| 1130 | W is the dialog widget, RESPONSE is the response code. | 1128 | W is the dialog widget, RESPONSE is the response code. |
| 1131 | USER_DATA is what we passed in to g_signal_connect (pointer to int). */ | 1129 | USER_DATA is what we passed in to g_signal_connect (pointer to int). */ |
| @@ -1204,6 +1202,7 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1204 | GTK_STOCK_OPEN : GTK_STOCK_OK), | 1202 | GTK_STOCK_OPEN : GTK_STOCK_OK), |
| 1205 | GTK_RESPONSE_OK, | 1203 | GTK_RESPONSE_OK, |
| 1206 | NULL); | 1204 | NULL); |
| 1205 | gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filewin), TRUE); | ||
| 1207 | 1206 | ||
| 1208 | if (default_filename) | 1207 | if (default_filename) |
| 1209 | { | 1208 | { |
| @@ -1211,16 +1210,20 @@ xg_get_file_with_chooser (f, prompt, default_filename, | |||
| 1211 | struct gcpro gcpro1; | 1210 | struct gcpro gcpro1; |
| 1212 | GCPRO1 (file); | 1211 | GCPRO1 (file); |
| 1213 | 1212 | ||
| 1213 | file = build_string (default_filename); | ||
| 1214 | |||
| 1214 | /* File chooser does not understand ~/... in the file name. It must be | 1215 | /* File chooser does not understand ~/... in the file name. It must be |
| 1215 | an absolute name starting with /. */ | 1216 | an absolute name starting with /. */ |
| 1216 | if (default_filename[0] != '/') | 1217 | if (default_filename[0] != '/') |
| 1217 | { | 1218 | file = Fexpand_file_name (file, Qnil); |
| 1218 | file = Fexpand_file_name (build_string (default_filename), Qnil); | ||
| 1219 | default_filename = SDATA (file); | ||
| 1220 | } | ||
| 1221 | 1219 | ||
| 1222 | gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), | 1220 | default_filename = SDATA (file); |
| 1223 | default_filename); | 1221 | if (Ffile_directory_p (file)) |
| 1222 | gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin), | ||
| 1223 | default_filename); | ||
| 1224 | else | ||
| 1225 | gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin), | ||
| 1226 | default_filename); | ||
| 1224 | 1227 | ||
| 1225 | UNGCPRO; | 1228 | UNGCPRO; |
| 1226 | } | 1229 | } |
| @@ -1310,8 +1313,17 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | |||
| 1310 | int filesel_done = 0; | 1313 | int filesel_done = 0; |
| 1311 | xg_get_file_func func; | 1314 | xg_get_file_func func; |
| 1312 | 1315 | ||
| 1316 | #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) | ||
| 1317 | /* I really don't know why this is needed, but without this the GLIBC add on | ||
| 1318 | library linuxthreads hangs when the Gnome file chooser backend creates | ||
| 1319 | threads. */ | ||
| 1320 | sigblock (sigmask (__SIGRTMIN)); | ||
| 1321 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 1322 | |||
| 1313 | #ifdef HAVE_GTK_FILE_BOTH | 1323 | #ifdef HAVE_GTK_FILE_BOTH |
| 1314 | if (use_old_gtk_file_dialog) | 1324 | extern int x_use_old_gtk_file_dialog; |
| 1325 | |||
| 1326 | if (x_use_old_gtk_file_dialog) | ||
| 1315 | w = xg_get_file_with_selection (f, prompt, default_filename, | 1327 | w = xg_get_file_with_selection (f, prompt, default_filename, |
| 1316 | mustmatch_p, only_dir_p, &func); | 1328 | mustmatch_p, only_dir_p, &func); |
| 1317 | else | 1329 | else |
| @@ -1355,6 +1367,10 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | |||
| 1355 | gtk_main_iteration (); | 1367 | gtk_main_iteration (); |
| 1356 | } | 1368 | } |
| 1357 | 1369 | ||
| 1370 | #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) | ||
| 1371 | sigunblock (sigmask (__SIGRTMIN)); | ||
| 1372 | #endif | ||
| 1373 | |||
| 1358 | if (filesel_done == GTK_RESPONSE_OK) | 1374 | if (filesel_done == GTK_RESPONSE_OK) |
| 1359 | fn = (*func) (w); | 1375 | fn = (*func) (w); |
| 1360 | 1376 | ||
diff --git a/src/image.c b/src/image.c index 4ab672ca58e..d1925cf36e4 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2416,8 +2416,7 @@ image_load_quartz2d (f, img, png_p) | |||
| 2416 | UNGCPRO; | 2416 | UNGCPRO; |
| 2417 | return 0; | 2417 | return 0; |
| 2418 | } | 2418 | } |
| 2419 | path = CFStringCreateWithCString (NULL, SDATA (file), | 2419 | path = cfstring_create_with_utf8_cstring (SDATA (file)); |
| 2420 | kCFStringEncodingUTF8); | ||
| 2421 | url = CFURLCreateWithFileSystemPath (NULL, path, | 2420 | url = CFURLCreateWithFileSystemPath (NULL, path, |
| 2422 | kCFURLPOSIXPathStyle, 0); | 2421 | kCFURLPOSIXPathStyle, 0); |
| 2423 | CFRelease (path); | 2422 | CFRelease (path); |
diff --git a/src/indent.c b/src/indent.c index d2e8a83c11c..4efb5445f7e 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -222,7 +222,7 @@ skip_invisible (pos, next_boundary_p, to, window) | |||
| 222 | Lisp_Object window; | 222 | Lisp_Object window; |
| 223 | { | 223 | { |
| 224 | Lisp_Object prop, position, overlay_limit, proplimit; | 224 | Lisp_Object prop, position, overlay_limit, proplimit; |
| 225 | Lisp_Object buffer; | 225 | Lisp_Object buffer, tmp; |
| 226 | int end, inv_p; | 226 | int end, inv_p; |
| 227 | 227 | ||
| 228 | XSETFASTINT (position, pos); | 228 | XSETFASTINT (position, pos); |
| @@ -253,8 +253,9 @@ skip_invisible (pos, next_boundary_p, to, window) | |||
| 253 | /* No matter what. don't go past next overlay change. */ | 253 | /* No matter what. don't go past next overlay change. */ |
| 254 | if (XFASTINT (overlay_limit) < XFASTINT (proplimit)) | 254 | if (XFASTINT (overlay_limit) < XFASTINT (proplimit)) |
| 255 | proplimit = overlay_limit; | 255 | proplimit = overlay_limit; |
| 256 | end = XFASTINT (Fnext_single_property_change (position, Qinvisible, | 256 | tmp = Fnext_single_property_change (position, Qinvisible, |
| 257 | buffer, proplimit)); | 257 | buffer, proplimit); |
| 258 | end = XFASTINT (tmp); | ||
| 258 | #if 0 | 259 | #if 0 |
| 259 | /* Don't put the boundary in the middle of multibyte form if | 260 | /* Don't put the boundary in the middle of multibyte form if |
| 260 | there is no actual property change. */ | 261 | there is no actual property change. */ |
diff --git a/src/insdel.c b/src/insdel.c index f5f56f0371f..7f10c2f523d 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1057,6 +1057,10 @@ insert_from_string (string, pos, pos_byte, length, length_byte, inherit) | |||
| 1057 | int inherit; | 1057 | int inherit; |
| 1058 | { | 1058 | { |
| 1059 | int opoint = PT; | 1059 | int opoint = PT; |
| 1060 | |||
| 1061 | if (SCHARS (string) == 0) | ||
| 1062 | return; | ||
| 1063 | |||
| 1060 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, | 1064 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, |
| 1061 | inherit, 0); | 1065 | inherit, 0); |
| 1062 | signal_after_change (opoint, 0, PT - opoint); | 1066 | signal_after_change (opoint, 0, PT - opoint); |
| @@ -1074,6 +1078,10 @@ insert_from_string_before_markers (string, pos, pos_byte, | |||
| 1074 | int inherit; | 1078 | int inherit; |
| 1075 | { | 1079 | { |
| 1076 | int opoint = PT; | 1080 | int opoint = PT; |
| 1081 | |||
| 1082 | if (SCHARS (string) == 0) | ||
| 1083 | return; | ||
| 1084 | |||
| 1077 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, | 1085 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, |
| 1078 | inherit, 1); | 1086 | inherit, 1); |
| 1079 | signal_after_change (opoint, 0, PT - opoint); | 1087 | signal_after_change (opoint, 0, PT - opoint); |
diff --git a/src/keyboard.c b/src/keyboard.c index 7a655bf50ac..9b42bd06b50 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -45,6 +45,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 45 | #include <setjmp.h> | 45 | #include <setjmp.h> |
| 46 | #include <errno.h> | 46 | #include <errno.h> |
| 47 | 47 | ||
| 48 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 49 | #include <pthread.h> | ||
| 50 | #endif | ||
| 48 | #ifdef MSDOS | 51 | #ifdef MSDOS |
| 49 | #include "msdos.h" | 52 | #include "msdos.h" |
| 50 | #include <time.h> | 53 | #include <time.h> |
| @@ -595,7 +598,7 @@ int interrupts_deferred; | |||
| 595 | 598 | ||
| 596 | /* We are unable to use interrupts if FIONREAD is not available, | 599 | /* We are unable to use interrupts if FIONREAD is not available, |
| 597 | so flush SIGIO so we won't try. */ | 600 | so flush SIGIO so we won't try. */ |
| 598 | #if !defined (FIONREAD) || defined(HAVE_CARBON) | 601 | #if !defined (FIONREAD) |
| 599 | #ifdef SIGIO | 602 | #ifdef SIGIO |
| 600 | #undef SIGIO | 603 | #undef SIGIO |
| 601 | #endif | 604 | #endif |
| @@ -1603,7 +1606,10 @@ command_loop_1 () | |||
| 1603 | if (NILP (Vthis_command)) | 1606 | if (NILP (Vthis_command)) |
| 1604 | { | 1607 | { |
| 1605 | /* nil means key is undefined. */ | 1608 | /* nil means key is undefined. */ |
| 1609 | Lisp_Object keys = Fvector (i, keybuf); | ||
| 1610 | keys = Fkey_description (keys, Qnil); | ||
| 1606 | bitch_at_user (); | 1611 | bitch_at_user (); |
| 1612 | message_with_string ("%s is undefined", keys, 0); | ||
| 1607 | current_kboard->defining_kbd_macro = Qnil; | 1613 | current_kboard->defining_kbd_macro = Qnil; |
| 1608 | update_mode_lines = 1; | 1614 | update_mode_lines = 1; |
| 1609 | current_kboard->Vprefix_arg = Qnil; | 1615 | current_kboard->Vprefix_arg = Qnil; |
| @@ -6843,6 +6849,25 @@ handle_async_input () | |||
| 6843 | #ifdef BSD4_1 | 6849 | #ifdef BSD4_1 |
| 6844 | extern int select_alarmed; | 6850 | extern int select_alarmed; |
| 6845 | #endif | 6851 | #endif |
| 6852 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 6853 | extern pthread_t main_thread; | ||
| 6854 | if (pthread_self () != main_thread) | ||
| 6855 | { | ||
| 6856 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6857 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6858 | the signal to the correct thread and block it from this thread. */ | ||
| 6859 | #ifdef SIGIO | ||
| 6860 | sigset_t new_mask; | ||
| 6861 | |||
| 6862 | sigemptyset (&new_mask); | ||
| 6863 | sigaddset (&new_mask, SIGIO); | ||
| 6864 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6865 | pthread_kill (main_thread, SIGIO); | ||
| 6866 | #endif | ||
| 6867 | return; | ||
| 6868 | } | ||
| 6869 | #endif | ||
| 6870 | |||
| 6846 | interrupt_input_pending = 0; | 6871 | interrupt_input_pending = 0; |
| 6847 | 6872 | ||
| 6848 | while (1) | 6873 | while (1) |
| @@ -6870,7 +6895,22 @@ input_available_signal (signo) | |||
| 6870 | { | 6895 | { |
| 6871 | /* Must preserve main program's value of errno. */ | 6896 | /* Must preserve main program's value of errno. */ |
| 6872 | int old_errno = errno; | 6897 | int old_errno = errno; |
| 6873 | 6898 | #ifdef HAVE_GTK_AND_PTHREAD | |
| 6899 | extern pthread_t main_thread; | ||
| 6900 | if (pthread_self () != main_thread) | ||
| 6901 | { | ||
| 6902 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6903 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6904 | the signal to the correct thread and block it from this thread. */ | ||
| 6905 | sigset_t new_mask; | ||
| 6906 | |||
| 6907 | sigemptyset (&new_mask); | ||
| 6908 | sigaddset (&new_mask, SIGIO); | ||
| 6909 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6910 | pthread_kill (main_thread, SIGIO); | ||
| 6911 | return; | ||
| 6912 | } | ||
| 6913 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 6874 | #if defined (USG) && !defined (POSIX_SIGNALS) | 6914 | #if defined (USG) && !defined (POSIX_SIGNALS) |
| 6875 | /* USG systems forget handlers when they are used; | 6915 | /* USG systems forget handlers when they are used; |
| 6876 | must reestablish each time */ | 6916 | must reestablish each time */ |
diff --git a/src/keymap.c b/src/keymap.c index a5e5fbd3f93..4375b2e3a51 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1241,7 +1241,7 @@ recognize the default bindings, just as `read-key-sequence' does. */) | |||
| 1241 | c = Fevent_convert_list (c); | 1241 | c = Fevent_convert_list (c); |
| 1242 | 1242 | ||
| 1243 | /* Turn the 8th bit of string chars into a meta modifier. */ | 1243 | /* Turn the 8th bit of string chars into a meta modifier. */ |
| 1244 | if (XINT (c) & 0x80 && STRINGP (key)) | 1244 | if (INTEGERP (c) && XINT (c) & 0x80 && STRINGP (key)) |
| 1245 | XSETINT (c, (XINT (c) | meta_modifier) & ~0x80); | 1245 | XSETINT (c, (XINT (c) | meta_modifier) & ~0x80); |
| 1246 | 1246 | ||
| 1247 | /* Allow string since binding for `menu-bar-select-buffer' | 1247 | /* Allow string since binding for `menu-bar-select-buffer' |
diff --git a/src/lisp.h b/src/lisp.h index e54c8571fd5..8be6b910a5e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -35,6 +35,22 @@ Boston, MA 02111-1307, USA. */ | |||
| 35 | be compared to the sizes recorded in Lisp strings. */ | 35 | be compared to the sizes recorded in Lisp strings. */ |
| 36 | 36 | ||
| 37 | #define GC_CHECK_STRING_BYTES 1 | 37 | #define GC_CHECK_STRING_BYTES 1 |
| 38 | |||
| 39 | /* Define this to check for short string overrun. */ | ||
| 40 | |||
| 41 | #define GC_CHECK_STRING_OVERRUN 1 | ||
| 42 | |||
| 43 | /* Define this to check the string free list. */ | ||
| 44 | |||
| 45 | #define GC_CHECK_STRING_FREE_LIST 1 | ||
| 46 | |||
| 47 | /* Define this to check for malloc buffer overrun. */ | ||
| 48 | |||
| 49 | #define XMALLOC_OVERRUN_CHECK 1 | ||
| 50 | |||
| 51 | /* Define this to check for errors in cons list. */ | ||
| 52 | /* #define GC_CHECK_CONS_LIST 1 */ | ||
| 53 | |||
| 38 | #endif /* 0 */ | 54 | #endif /* 0 */ |
| 39 | 55 | ||
| 40 | 56 | ||
| @@ -304,11 +320,13 @@ enum pvec_type | |||
| 304 | /* First, try and define DECL_ALIGN(type,var) which declares a static | 320 | /* First, try and define DECL_ALIGN(type,var) which declares a static |
| 305 | variable VAR of type TYPE with the added requirement that it be | 321 | variable VAR of type TYPE with the added requirement that it be |
| 306 | TYPEBITS-aligned. */ | 322 | TYPEBITS-aligned. */ |
| 307 | #ifndef DECL_ALIGN | 323 | #ifndef NO_DECL_ALIGN |
| 324 | # ifndef DECL_ALIGN | ||
| 308 | /* What compiler directive should we use for non-gcc compilers? -stef */ | 325 | /* What compiler directive should we use for non-gcc compilers? -stef */ |
| 309 | # if defined (__GNUC__) | 326 | # if defined (__GNUC__) |
| 310 | # define DECL_ALIGN(type, var) \ | 327 | # define DECL_ALIGN(type, var) \ |
| 311 | type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var | 328 | type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var |
| 329 | # endif | ||
| 312 | # endif | 330 | # endif |
| 313 | #endif | 331 | #endif |
| 314 | 332 | ||
| @@ -323,7 +341,7 @@ enum pvec_type | |||
| 323 | # endif | 341 | # endif |
| 324 | #endif | 342 | #endif |
| 325 | 343 | ||
| 326 | /* Just remove the alignment annotation if we don't use it. */ | 344 | /* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */ |
| 327 | #ifndef DECL_ALIGN | 345 | #ifndef DECL_ALIGN |
| 328 | # ifdef USE_LSB_TAG | 346 | # ifdef USE_LSB_TAG |
| 329 | # error "USE_LSB_TAG used without defining DECL_ALIGN" | 347 | # error "USE_LSB_TAG used without defining DECL_ALIGN" |
| @@ -2301,6 +2319,7 @@ extern void clear_string_char_byte_cache P_ ((void)); | |||
| 2301 | extern int string_char_to_byte P_ ((Lisp_Object, int)); | 2319 | extern int string_char_to_byte P_ ((Lisp_Object, int)); |
| 2302 | extern int string_byte_to_char P_ ((Lisp_Object, int)); | 2320 | extern int string_byte_to_char P_ ((Lisp_Object, int)); |
| 2303 | extern Lisp_Object string_make_multibyte P_ ((Lisp_Object)); | 2321 | extern Lisp_Object string_make_multibyte P_ ((Lisp_Object)); |
| 2322 | extern Lisp_Object string_to_multibyte P_ ((Lisp_Object)); | ||
| 2304 | extern Lisp_Object string_make_unibyte P_ ((Lisp_Object)); | 2323 | extern Lisp_Object string_make_unibyte P_ ((Lisp_Object)); |
| 2305 | EXFUN (Fcopy_alist, 1); | 2324 | EXFUN (Fcopy_alist, 1); |
| 2306 | EXFUN (Fplist_get, 2); | 2325 | EXFUN (Fplist_get, 2); |
| @@ -2438,6 +2457,7 @@ extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ())); | |||
| 2438 | /* Defined in alloc.c */ | 2457 | /* Defined in alloc.c */ |
| 2439 | extern void check_pure_size P_ ((void)); | 2458 | extern void check_pure_size P_ ((void)); |
| 2440 | extern void allocate_string_data P_ ((struct Lisp_String *, int, int)); | 2459 | extern void allocate_string_data P_ ((struct Lisp_String *, int, int)); |
| 2460 | extern void reset_malloc_hooks P_ ((void)); | ||
| 2441 | extern void uninterrupt_malloc P_ ((void)); | 2461 | extern void uninterrupt_malloc P_ ((void)); |
| 2442 | extern void malloc_warning P_ ((char *)); | 2462 | extern void malloc_warning P_ ((char *)); |
| 2443 | extern void memory_full P_ ((void)); | 2463 | extern void memory_full P_ ((void)); |
diff --git a/src/lread.c b/src/lread.c index 77750eea4fa..895c063d04a 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Lisp parsing and input streams. | 1 | /* Lisp parsing and input streams. |
| 2 | Copyright (C) 1985,86,87,88,89,93,94,95,97,98,99,2000,01,03,2004 | 2 | Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, 1998, |
| 3 | Free Software Foundation, Inc. | 3 | 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -323,6 +323,7 @@ readchar (readcharfun) | |||
| 323 | /* Interrupted reads have been observed while reading over the network */ | 323 | /* Interrupted reads have been observed while reading over the network */ |
| 324 | while (c == EOF && ferror (instream) && errno == EINTR) | 324 | while (c == EOF && ferror (instream) && errno == EINTR) |
| 325 | { | 325 | { |
| 326 | QUIT; | ||
| 326 | clearerr (instream); | 327 | clearerr (instream); |
| 327 | c = getc (instream); | 328 | c = getc (instream); |
| 328 | } | 329 | } |
| @@ -3277,7 +3278,7 @@ oblookup (obarray, ptr, size, size_byte) | |||
| 3277 | hash %= obsize; | 3278 | hash %= obsize; |
| 3278 | bucket = XVECTOR (obarray)->contents[hash]; | 3279 | bucket = XVECTOR (obarray)->contents[hash]; |
| 3279 | oblookup_last_bucket_number = hash; | 3280 | oblookup_last_bucket_number = hash; |
| 3280 | if (XFASTINT (bucket) == 0) | 3281 | if (EQ (bucket, make_number (0))) |
| 3281 | ; | 3282 | ; |
| 3282 | else if (!SYMBOLP (bucket)) | 3283 | else if (!SYMBOLP (bucket)) |
| 3283 | error ("Bad data in guts of obarray"); /* Like CADR error message */ | 3284 | error ("Bad data in guts of obarray"); /* Like CADR error message */ |
| @@ -262,6 +262,22 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen) | |||
| 262 | return 1; | 262 | return 1; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | #if TARGET_API_MAC_CARBON | ||
| 266 | CFStringRef | ||
| 267 | cfstring_create_with_utf8_cstring (c_str) | ||
| 268 | const char *c_str; | ||
| 269 | { | ||
| 270 | CFStringRef str; | ||
| 271 | |||
| 272 | str = CFStringCreateWithCString (NULL, c_str, kCFStringEncodingUTF8); | ||
| 273 | if (str == NULL) | ||
| 274 | /* Failed to interpret as UTF 8. Fall back on Mac Roman. */ | ||
| 275 | str = CFStringCreateWithCString (NULL, c_str, kCFStringEncodingMacRoman); | ||
| 276 | |||
| 277 | return str; | ||
| 278 | } | ||
| 279 | #endif | ||
| 280 | |||
| 265 | #ifndef MAC_OSX | 281 | #ifndef MAC_OSX |
| 266 | 282 | ||
| 267 | /* The following functions with "sys_" prefix are stubs to Unix | 283 | /* The following functions with "sys_" prefix are stubs to Unix |
diff --git a/src/macfns.c b/src/macfns.c index 401c7011fea..fdfe7a52416 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -1932,8 +1932,7 @@ x_set_name (f, name, explicit) | |||
| 1932 | { | 1932 | { |
| 1933 | #if TARGET_API_MAC_CARBON | 1933 | #if TARGET_API_MAC_CARBON |
| 1934 | CFStringRef windowTitle = | 1934 | CFStringRef windowTitle = |
| 1935 | CFStringCreateWithCString (NULL, SDATA (name), | 1935 | cfstring_create_with_utf8_cstring (SDATA (name)); |
| 1936 | kCFStringEncodingUTF8); | ||
| 1937 | 1936 | ||
| 1938 | SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); | 1937 | SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); |
| 1939 | CFRelease (windowTitle); | 1938 | CFRelease (windowTitle); |
| @@ -2015,8 +2014,7 @@ x_set_title (f, name, old_name) | |||
| 2015 | { | 2014 | { |
| 2016 | #if TARGET_API_MAC_CARBON | 2015 | #if TARGET_API_MAC_CARBON |
| 2017 | CFStringRef windowTitle = | 2016 | CFStringRef windowTitle = |
| 2018 | CFStringCreateWithCString (NULL, SDATA (name), | 2017 | cfstring_create_with_utf8_cstring (SDATA (name)); |
| 2019 | kCFStringEncodingUTF8); | ||
| 2020 | 2018 | ||
| 2021 | SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); | 2019 | SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); |
| 2022 | CFRelease (windowTitle); | 2020 | CFRelease (windowTitle); |
| @@ -4246,8 +4244,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4246 | NavDialogRef dialogRef; | 4244 | NavDialogRef dialogRef; |
| 4247 | NavTypeListHandle fileTypes = NULL; | 4245 | NavTypeListHandle fileTypes = NULL; |
| 4248 | NavUserAction userAction; | 4246 | NavUserAction userAction; |
| 4249 | CFStringRef message=NULL, client=NULL, saveName = NULL, ok = NULL; | 4247 | CFStringRef message=NULL, saveName = NULL; |
| 4250 | CFStringRef title = NULL; | ||
| 4251 | 4248 | ||
| 4252 | BLOCK_INPUT; | 4249 | BLOCK_INPUT; |
| 4253 | /* No need for a callback function because we are modal */ | 4250 | /* No need for a callback function because we are modal */ |
| @@ -4259,15 +4256,11 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4259 | options.optionFlags |= kNavSelectAllReadableItem; | 4256 | options.optionFlags |= kNavSelectAllReadableItem; |
| 4260 | if (!NILP(prompt)) | 4257 | if (!NILP(prompt)) |
| 4261 | { | 4258 | { |
| 4262 | message = CFStringCreateWithCStringNoCopy(NULL, SDATA(prompt), | 4259 | message = cfstring_create_with_utf8_cstring (SDATA (prompt)); |
| 4263 | kCFStringEncodingUTF8, | ||
| 4264 | kCFAllocatorNull); | ||
| 4265 | options.message = message; | 4260 | options.message = message; |
| 4266 | } | 4261 | } |
| 4267 | /* Don't set the application, let it use default. | 4262 | /* Don't set the application, let it use default. |
| 4268 | client = CFStringCreateWithCStringNoCopy(NULL, "Emacs", | 4263 | options.clientName = CFSTR ("Emacs"); |
| 4269 | kCFStringEncodingMacRoman, NULL); | ||
| 4270 | options.clientName = client; | ||
| 4271 | */ | 4264 | */ |
| 4272 | 4265 | ||
| 4273 | if (!NILP (only_dir_p)) | 4266 | if (!NILP (only_dir_p)) |
| @@ -4276,17 +4269,14 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4276 | else if (NILP (mustmatch)) | 4269 | else if (NILP (mustmatch)) |
| 4277 | { | 4270 | { |
| 4278 | /* This is a save dialog */ | 4271 | /* This is a save dialog */ |
| 4279 | ok = CFStringCreateWithCString (NULL, "Ok", kCFStringEncodingUTF8); | ||
| 4280 | title = CFStringCreateWithCString (NULL, "Enter name", | ||
| 4281 | kCFStringEncodingUTF8); | ||
| 4282 | options.optionFlags |= kNavDontConfirmReplacement; | 4272 | options.optionFlags |= kNavDontConfirmReplacement; |
| 4283 | options.actionButtonLabel = ok; | 4273 | options.actionButtonLabel = CFSTR ("Ok"); |
| 4284 | options.windowTitle = title; | 4274 | options.windowTitle = CFSTR ("Enter name"); |
| 4285 | 4275 | ||
| 4286 | if (!NILP(default_filename)) | 4276 | if (!NILP(default_filename)) |
| 4287 | { | 4277 | { |
| 4288 | saveName = CFStringCreateWithCString(NULL, SDATA(default_filename), | 4278 | saveName = |
| 4289 | kCFStringEncodingUTF8); | 4279 | cfstring_create_with_utf8_cstring (SDATA (default_filename)); |
| 4290 | options.saveFileName = saveName; | 4280 | options.saveFileName = saveName; |
| 4291 | options.optionFlags |= kNavSelectDefaultLocation; | 4281 | options.optionFlags |= kNavSelectDefaultLocation; |
| 4292 | } | 4282 | } |
| @@ -4320,10 +4310,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 4320 | } | 4310 | } |
| 4321 | 4311 | ||
| 4322 | if (saveName) CFRelease(saveName); | 4312 | if (saveName) CFRelease(saveName); |
| 4323 | if (client) CFRelease(client); | ||
| 4324 | if (message) CFRelease(message); | 4313 | if (message) CFRelease(message); |
| 4325 | if (ok) CFRelease(ok); | ||
| 4326 | if (title) CFRelease(title); | ||
| 4327 | 4314 | ||
| 4328 | if (status == noErr) { | 4315 | if (status == noErr) { |
| 4329 | userAction = NavDialogGetUserAction(dialogRef); | 4316 | userAction = NavDialogGetUserAction(dialogRef); |
| @@ -4415,8 +4402,8 @@ frame_parm_handler mac_frame_parm_handlers[] = | |||
| 4415 | 0, /* MAC_TODO: x_set_scroll_bar_background, */ | 4402 | 0, /* MAC_TODO: x_set_scroll_bar_background, */ |
| 4416 | x_set_screen_gamma, | 4403 | x_set_screen_gamma, |
| 4417 | x_set_line_spacing, | 4404 | x_set_line_spacing, |
| 4418 | 0, /* MAC_TODO: x_set_fringe_width, */ | 4405 | x_set_fringe_width, |
| 4419 | 0, /* MAC_TODO: x_set_fringe_width, */ | 4406 | x_set_fringe_width, |
| 4420 | 0, /* x_set_wait_for_wm, */ | 4407 | 0, /* x_set_wait_for_wm, */ |
| 4421 | 0, /* MAC_TODO: x_set_fullscreen, */ | 4408 | 0, /* MAC_TODO: x_set_fullscreen, */ |
| 4422 | }; | 4409 | }; |
diff --git a/src/macmenu.c b/src/macmenu.c index 007fab15eab..f0696a49774 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -2264,8 +2264,7 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, | |||
| 2264 | item_name[255] = 0; | 2264 | item_name[255] = 0; |
| 2265 | #if TARGET_API_MAC_CARBON | 2265 | #if TARGET_API_MAC_CARBON |
| 2266 | { | 2266 | { |
| 2267 | CFStringRef string = | 2267 | CFStringRef string = cfstring_create_with_utf8_cstring (item_name); |
| 2268 | CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); | ||
| 2269 | 2268 | ||
| 2270 | SetMenuItemTextWithCFString (menu, pos, string); | 2269 | SetMenuItemTextWithCFString (menu, pos, string); |
| 2271 | CFRelease (string); | 2270 | CFRelease (string); |
diff --git a/src/macterm.c b/src/macterm.c index 8e3f67116f5..b0a7edeb516 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -567,7 +567,7 @@ XCreatePixmap (display, w, width, height, depth) | |||
| 567 | Display *display; /* not used */ | 567 | Display *display; /* not used */ |
| 568 | WindowPtr w; | 568 | WindowPtr w; |
| 569 | unsigned int width, height; | 569 | unsigned int width, height; |
| 570 | unsigned int depth; /* not used */ | 570 | unsigned int depth; |
| 571 | { | 571 | { |
| 572 | Pixmap pixmap; | 572 | Pixmap pixmap; |
| 573 | Rect r; | 573 | Rect r; |
| @@ -643,6 +643,7 @@ XFillRectangle (display, w, gc, x, y, width, height) | |||
| 643 | } | 643 | } |
| 644 | 644 | ||
| 645 | 645 | ||
| 646 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 646 | static void | 647 | static void |
| 647 | mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) | 648 | mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) |
| 648 | Display *display; | 649 | Display *display; |
| @@ -666,6 +667,7 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) | |||
| 666 | 667 | ||
| 667 | SetGWorld (old_port, old_gdh); | 668 | SetGWorld (old_port, old_gdh); |
| 668 | } | 669 | } |
| 670 | #endif | ||
| 669 | 671 | ||
| 670 | 672 | ||
| 671 | /* Mac replacement for XDrawRectangle: dest is a window. */ | 673 | /* Mac replacement for XDrawRectangle: dest is a window. */ |
| @@ -689,6 +691,7 @@ mac_draw_rectangle (display, w, gc, x, y, width, height) | |||
| 689 | } | 691 | } |
| 690 | 692 | ||
| 691 | 693 | ||
| 694 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 692 | /* Mac replacement for XDrawRectangle: dest is a Pixmap. */ | 695 | /* Mac replacement for XDrawRectangle: dest is a Pixmap. */ |
| 693 | 696 | ||
| 694 | static void | 697 | static void |
| @@ -714,6 +717,7 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height) | |||
| 714 | 717 | ||
| 715 | SetGWorld (old_port, old_gdh); | 718 | SetGWorld (old_port, old_gdh); |
| 716 | } | 719 | } |
| 720 | #endif | ||
| 717 | 721 | ||
| 718 | 722 | ||
| 719 | static void | 723 | static void |
| @@ -908,24 +912,13 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) | |||
| 908 | int dest_x, dest_y; | 912 | int dest_x, dest_y; |
| 909 | { | 913 | { |
| 910 | #if TARGET_API_MAC_CARBON | 914 | #if TARGET_API_MAC_CARBON |
| 911 | Rect gw_r, src_r, dest_r; | 915 | Rect src_r; |
| 916 | RgnHandle dummy = NewRgn (); /* For avoiding update events. */ | ||
| 912 | 917 | ||
| 913 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); | 918 | SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
| 914 | SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); | 919 | ScrollWindowRect (w, &src_r, dest_x - src_x, dest_y - src_y, |
| 915 | 920 | kScrollWindowNoOptions, dummy); | |
| 916 | SetPortWindowPort (w); | 921 | DisposeRgn (dummy); |
| 917 | |||
| 918 | ForeColor (blackColor); | ||
| 919 | BackColor (whiteColor); | ||
| 920 | |||
| 921 | LockPortBits (GetWindowPort (w)); | ||
| 922 | { | ||
| 923 | const BitMap *bitmap = GetPortBitMapForCopyBits (GetWindowPort (w)); | ||
| 924 | CopyBits (bitmap, bitmap, &src_r, &dest_r, srcCopy, 0); | ||
| 925 | } | ||
| 926 | UnlockPortBits (GetWindowPort (w)); | ||
| 927 | |||
| 928 | mac_set_colors (gc); | ||
| 929 | #else /* not TARGET_API_MAC_CARBON */ | 922 | #else /* not TARGET_API_MAC_CARBON */ |
| 930 | Rect src_r, dest_r; | 923 | Rect src_r, dest_r; |
| 931 | 924 | ||
| @@ -959,6 +952,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) | |||
| 959 | } | 952 | } |
| 960 | 953 | ||
| 961 | 954 | ||
| 955 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 962 | /* Mac replacement for XCopyArea: dest must be Pixmap. */ | 956 | /* Mac replacement for XCopyArea: dest must be Pixmap. */ |
| 963 | 957 | ||
| 964 | static void | 958 | static void |
| @@ -1037,6 +1031,7 @@ mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y, | |||
| 1037 | 1031 | ||
| 1038 | SetGWorld (old_port, old_gdh); | 1032 | SetGWorld (old_port, old_gdh); |
| 1039 | } | 1033 | } |
| 1034 | #endif | ||
| 1040 | 1035 | ||
| 1041 | 1036 | ||
| 1042 | /* Mac replacement for XChangeGC. */ | 1037 | /* Mac replacement for XChangeGC. */ |
| @@ -1131,40 +1126,32 @@ x_sync (f) | |||
| 1131 | } | 1126 | } |
| 1132 | 1127 | ||
| 1133 | 1128 | ||
| 1134 | /* Remove calls to XFlush by defining XFlush to an empty replacement. | ||
| 1135 | Calls to XFlush should be unnecessary because the X output buffer | ||
| 1136 | is flushed automatically as needed by calls to XPending, | ||
| 1137 | XNextEvent, or XWindowEvent according to the XFlush man page. | ||
| 1138 | XTread_socket calls XPending. Removing XFlush improves | ||
| 1139 | performance. */ | ||
| 1140 | |||
| 1141 | #if TARGET_API_MAC_CARBON | ||
| 1142 | #define XFlush(DISPLAY) QDFlushPortBuffer (GetQDGlobalsThePort (), NULL) | ||
| 1143 | #else | ||
| 1144 | #define XFlush(DISPLAY) (void) 0 | ||
| 1145 | #endif | ||
| 1146 | |||
| 1147 | /* Flush display of frame F, or of all frames if F is null. */ | 1129 | /* Flush display of frame F, or of all frames if F is null. */ |
| 1148 | 1130 | ||
| 1149 | void | 1131 | static void |
| 1150 | x_flush (f) | 1132 | x_flush (f) |
| 1151 | struct frame *f; | 1133 | struct frame *f; |
| 1152 | { | 1134 | { |
| 1153 | #if TARGET_API_MAC_CARBON | 1135 | #if TARGET_API_MAC_CARBON |
| 1154 | BLOCK_INPUT; | 1136 | BLOCK_INPUT; |
| 1155 | if (f == NULL) | 1137 | if (f) |
| 1156 | { | 1138 | QDFlushPortBuffer (GetWindowPort (FRAME_MAC_WINDOW (f)), NULL); |
| 1157 | Lisp_Object rest, frame; | 1139 | else |
| 1158 | FOR_EACH_FRAME (rest, frame) | 1140 | QDFlushPortBuffer (GetQDGlobalsThePort (), NULL); |
| 1159 | x_flush (XFRAME (frame)); | ||
| 1160 | } | ||
| 1161 | else if (FRAME_MAC_P (f)) | ||
| 1162 | XFlush (FRAME_MAC_DISPLAY (f)); | ||
| 1163 | UNBLOCK_INPUT; | 1141 | UNBLOCK_INPUT; |
| 1164 | #endif /* TARGET_API_MAC_CARBON */ | 1142 | #endif |
| 1165 | } | 1143 | } |
| 1166 | 1144 | ||
| 1167 | 1145 | ||
| 1146 | /* Remove calls to XFlush by defining XFlush to an empty replacement. | ||
| 1147 | Calls to XFlush should be unnecessary because the X output buffer | ||
| 1148 | is flushed automatically as needed by calls to XPending, | ||
| 1149 | XNextEvent, or XWindowEvent according to the XFlush man page. | ||
| 1150 | XTread_socket calls XPending. Removing XFlush improves | ||
| 1151 | performance. */ | ||
| 1152 | |||
| 1153 | #define XFlush(DISPLAY) (void) 0 | ||
| 1154 | |||
| 1168 | 1155 | ||
| 1169 | /* Return the struct mac_display_info corresponding to DPY. There's | 1156 | /* Return the struct mac_display_info corresponding to DPY. There's |
| 1170 | only one. */ | 1157 | only one. */ |
| @@ -1957,6 +1944,14 @@ x_clear_glyph_string_rect (s, x, y, w, h) | |||
| 1957 | } | 1944 | } |
| 1958 | 1945 | ||
| 1959 | 1946 | ||
| 1947 | /* We prefer not to use XDrawImageString (srcCopy text transfer mode) | ||
| 1948 | on Mac OS X because: | ||
| 1949 | - Screen is double-buffered. (In srcCopy mode, a text is drawn | ||
| 1950 | into an offscreen graphics world first. So performance gain | ||
| 1951 | cannot be expected.) | ||
| 1952 | - It lowers rendering quality. | ||
| 1953 | - Some fonts leave garbage on cursor movement. */ | ||
| 1954 | |||
| 1960 | /* Draw the background of glyph_string S. If S->background_filled_p | 1955 | /* Draw the background of glyph_string S. If S->background_filled_p |
| 1961 | is non-zero don't draw it. FORCE_P non-zero means draw the | 1956 | is non-zero don't draw it. FORCE_P non-zero means draw the |
| 1962 | background even if it wouldn't be drawn normally. This is used | 1957 | background even if it wouldn't be drawn normally. This is used |
| @@ -1988,10 +1983,12 @@ x_draw_glyph_string_background (s, force_p) | |||
| 1988 | } | 1983 | } |
| 1989 | else | 1984 | else |
| 1990 | #endif | 1985 | #endif |
| 1986 | #if 0 /* defined(MAC_OS8)*/ | ||
| 1991 | if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width | 1987 | if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width |
| 1992 | || s->font_not_found_p | 1988 | || s->font_not_found_p |
| 1993 | || s->extends_to_end_of_line_p | 1989 | || s->extends_to_end_of_line_p |
| 1994 | || force_p) | 1990 | || force_p) |
| 1991 | #endif | ||
| 1995 | { | 1992 | { |
| 1996 | x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, | 1993 | x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, |
| 1997 | s->background_width, | 1994 | s->background_width, |
| @@ -2044,6 +2041,7 @@ x_draw_glyph_string_foreground (s) | |||
| 2044 | for (i = 0; i < s->nchars; ++i) | 2041 | for (i = 0; i < s->nchars; ++i) |
| 2045 | char1b[i] = s->char2b[i].byte2; | 2042 | char1b[i] = s->char2b[i].byte2; |
| 2046 | 2043 | ||
| 2044 | #if 0 /* defined(MAC_OS8) */ | ||
| 2047 | /* Draw text with XDrawString if background has already been | 2045 | /* Draw text with XDrawString if background has already been |
| 2048 | filled. Otherwise, use XDrawImageString. (Note that | 2046 | filled. Otherwise, use XDrawImageString. (Note that |
| 2049 | XDrawImageString is usually faster than XDrawString.) Always | 2047 | XDrawImageString is usually faster than XDrawString.) Always |
| @@ -2051,6 +2049,7 @@ x_draw_glyph_string_foreground (s) | |||
| 2051 | no chance that characters under a box cursor are invisible. */ | 2049 | no chance that characters under a box cursor are invisible. */ |
| 2052 | if (s->for_overlaps_p | 2050 | if (s->for_overlaps_p |
| 2053 | || (s->background_filled_p && s->hl != DRAW_CURSOR)) | 2051 | || (s->background_filled_p && s->hl != DRAW_CURSOR)) |
| 2052 | #endif | ||
| 2054 | { | 2053 | { |
| 2055 | /* Draw characters with 16-bit or 8-bit functions. */ | 2054 | /* Draw characters with 16-bit or 8-bit functions. */ |
| 2056 | if (s->two_byte_p) | 2055 | if (s->two_byte_p) |
| @@ -2060,6 +2059,7 @@ x_draw_glyph_string_foreground (s) | |||
| 2060 | XDrawString (s->display, s->window, s->gc, x, | 2059 | XDrawString (s->display, s->window, s->gc, x, |
| 2061 | s->ybase - boff, char1b, s->nchars); | 2060 | s->ybase - boff, char1b, s->nchars); |
| 2062 | } | 2061 | } |
| 2062 | #if 0 /* defined(MAC_OS8)*/ | ||
| 2063 | else | 2063 | else |
| 2064 | { | 2064 | { |
| 2065 | if (s->two_byte_p) | 2065 | if (s->two_byte_p) |
| @@ -2069,6 +2069,7 @@ x_draw_glyph_string_foreground (s) | |||
| 2069 | XDrawImageString (s->display, s->window, s->gc, x, | 2069 | XDrawImageString (s->display, s->window, s->gc, x, |
| 2070 | s->ybase - boff, char1b, s->nchars); | 2070 | s->ybase - boff, char1b, s->nchars); |
| 2071 | } | 2071 | } |
| 2072 | #endif | ||
| 2072 | } | 2073 | } |
| 2073 | } | 2074 | } |
| 2074 | 2075 | ||
| @@ -2635,38 +2636,17 @@ x_draw_image_foreground (s) | |||
| 2635 | 2636 | ||
| 2636 | if (s->img->pixmap) | 2637 | if (s->img->pixmap) |
| 2637 | { | 2638 | { |
| 2639 | x_set_glyph_string_clipping (s); | ||
| 2640 | |||
| 2638 | if (s->img->mask) | 2641 | if (s->img->mask) |
| 2639 | { | 2642 | mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, |
| 2640 | Rect nr; | 2643 | s->window, s->gc, s->slice.x, s->slice.y, |
| 2641 | XRectangle clip_rect, image_rect, r; | 2644 | s->slice.width, s->slice.height, x, y); |
| 2642 | |||
| 2643 | get_glyph_string_clip_rect (s, &nr); | ||
| 2644 | CONVERT_TO_XRECT (clip_rect, nr); | ||
| 2645 | image_rect.x = x; | ||
| 2646 | image_rect.y = y; | ||
| 2647 | image_rect.width = s->slice.width; | ||
| 2648 | image_rect.height = s->slice.height; | ||
| 2649 | if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) | ||
| 2650 | mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, | ||
| 2651 | s->window, s->gc, | ||
| 2652 | s->slice.x + r.x - x, s->slice.y + r.y - y, | ||
| 2653 | r.width, r.height, r.x, r.y); | ||
| 2654 | } | ||
| 2655 | else | 2645 | else |
| 2656 | { | 2646 | { |
| 2657 | Rect nr; | 2647 | mac_copy_area (s->display, s->img->pixmap, |
| 2658 | XRectangle clip_rect, image_rect, r; | 2648 | s->window, s->gc, s->slice.x, s->slice.y, |
| 2659 | 2649 | s->slice.width, s->slice.height, x, y); | |
| 2660 | get_glyph_string_clip_rect (s, &nr); | ||
| 2661 | CONVERT_TO_XRECT (clip_rect, nr); | ||
| 2662 | image_rect.x = x; | ||
| 2663 | image_rect.y = y; | ||
| 2664 | image_rect.width = s->slice.width; | ||
| 2665 | image_rect.height = s->slice.height; | ||
| 2666 | if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) | ||
| 2667 | mac_copy_area (s->display, s->img->pixmap, s->window, s->gc, | ||
| 2668 | s->slice.x + r.x - x, s->slice.y + r.y - y, | ||
| 2669 | r.width, r.height, r.x, r.y); | ||
| 2670 | 2650 | ||
| 2671 | /* When the image has a mask, we can expect that at | 2651 | /* When the image has a mask, we can expect that at |
| 2672 | least part of a mouse highlight or a block cursor will | 2652 | least part of a mouse highlight or a block cursor will |
| @@ -2745,6 +2725,7 @@ x_draw_image_relief (s) | |||
| 2745 | } | 2725 | } |
| 2746 | 2726 | ||
| 2747 | 2727 | ||
| 2728 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 2748 | /* Draw the foreground of image glyph string S to PIXMAP. */ | 2729 | /* Draw the foreground of image glyph string S to PIXMAP. */ |
| 2749 | 2730 | ||
| 2750 | static void | 2731 | static void |
| @@ -2805,6 +2786,7 @@ x_draw_image_foreground_1 (s, pixmap) | |||
| 2805 | mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, | 2786 | mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, |
| 2806 | s->slice.width - 1, s->slice.height - 1); | 2787 | s->slice.width - 1, s->slice.height - 1); |
| 2807 | } | 2788 | } |
| 2789 | #endif | ||
| 2808 | 2790 | ||
| 2809 | 2791 | ||
| 2810 | /* Draw part of the background of glyph string S. X, Y, W, and H | 2792 | /* Draw part of the background of glyph string S. X, Y, W, and H |
| @@ -2876,6 +2858,7 @@ x_draw_image_glyph_string (s) | |||
| 2876 | if (s->slice.y == 0) | 2858 | if (s->slice.y == 0) |
| 2877 | y += box_line_vwidth; | 2859 | y += box_line_vwidth; |
| 2878 | 2860 | ||
| 2861 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 2879 | if (s->img->mask) | 2862 | if (s->img->mask) |
| 2880 | { | 2863 | { |
| 2881 | /* Create a pixmap as large as the glyph string. Fill it | 2864 | /* Create a pixmap as large as the glyph string. Fill it |
| @@ -2912,12 +2895,14 @@ x_draw_image_glyph_string (s) | |||
| 2912 | } | 2895 | } |
| 2913 | } | 2896 | } |
| 2914 | else | 2897 | else |
| 2898 | #endif | ||
| 2915 | x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); | 2899 | x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); |
| 2916 | 2900 | ||
| 2917 | s->background_filled_p = 1; | 2901 | s->background_filled_p = 1; |
| 2918 | } | 2902 | } |
| 2919 | 2903 | ||
| 2920 | /* Draw the foreground. */ | 2904 | /* Draw the foreground. */ |
| 2905 | #if 0 /* TODO: figure out if we need to do this on Mac. */ | ||
| 2921 | if (pixmap != 0) | 2906 | if (pixmap != 0) |
| 2922 | { | 2907 | { |
| 2923 | x_draw_image_foreground_1 (s, pixmap); | 2908 | x_draw_image_foreground_1 (s, pixmap); |
| @@ -2928,6 +2913,7 @@ x_draw_image_glyph_string (s) | |||
| 2928 | XFreePixmap (s->display, pixmap); | 2913 | XFreePixmap (s->display, pixmap); |
| 2929 | } | 2914 | } |
| 2930 | else | 2915 | else |
| 2916 | #endif | ||
| 2931 | x_draw_image_foreground (s); | 2917 | x_draw_image_foreground (s); |
| 2932 | 2918 | ||
| 2933 | /* If we must draw a relief around the image, do it. */ | 2919 | /* If we must draw a relief around the image, do it. */ |
| @@ -5899,7 +5885,14 @@ mac_font_match (char *mf, char *xf) | |||
| 5899 | static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr; | 5885 | static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr; |
| 5900 | 5886 | ||
| 5901 | static void | 5887 | static void |
| 5902 | decode_mac_font_name (char *name, int size, short scriptcode) | 5888 | decode_mac_font_name (name, size, scriptcode) |
| 5889 | char *name; | ||
| 5890 | int size; | ||
| 5891 | #if TARGET_API_MAC_CARBON | ||
| 5892 | int scriptcode; | ||
| 5893 | #else | ||
| 5894 | short scriptcode; | ||
| 5895 | #endif | ||
| 5903 | { | 5896 | { |
| 5904 | Lisp_Object coding_system; | 5897 | Lisp_Object coding_system; |
| 5905 | struct coding_system coding; | 5898 | struct coding_system coding; |
| @@ -5937,7 +5930,15 @@ decode_mac_font_name (char *name, int size, short scriptcode) | |||
| 5937 | 5930 | ||
| 5938 | 5931 | ||
| 5939 | static char * | 5932 | static char * |
| 5940 | mac_to_x_fontname (char *name, int size, Style style, short scriptcode) | 5933 | mac_to_x_fontname (name, size, style, scriptcode, encoding_base) |
| 5934 | char *name; | ||
| 5935 | int size; | ||
| 5936 | Style style; | ||
| 5937 | #if TARGET_API_MAC_CARBON | ||
| 5938 | int scriptcode; | ||
| 5939 | #else | ||
| 5940 | short scriptcode; | ||
| 5941 | #endif | ||
| 5941 | { | 5942 | { |
| 5942 | char foundry[32], family[32], cs[32]; | 5943 | char foundry[32], family[32], cs[32]; |
| 5943 | char xf[256], *result, *p; | 5944 | char xf[256], *result, *p; |
| @@ -5949,13 +5950,13 @@ mac_to_x_fontname (char *name, int size, Style style, short scriptcode) | |||
| 5949 | 5950 | ||
| 5950 | switch (scriptcode) | 5951 | switch (scriptcode) |
| 5951 | { | 5952 | { |
| 5952 | case smTradChinese: | 5953 | case smTradChinese: /* == kTextEncodingMacChineseTrad */ |
| 5953 | strcpy(cs, "big5-0"); | 5954 | strcpy(cs, "big5-0"); |
| 5954 | break; | 5955 | break; |
| 5955 | case smSimpChinese: | 5956 | case smSimpChinese: /* == kTextEncodingMacChineseSimp */ |
| 5956 | strcpy(cs, "gb2312.1980-0"); | 5957 | strcpy(cs, "gb2312.1980-0"); |
| 5957 | break; | 5958 | break; |
| 5958 | case smJapanese: | 5959 | case smJapanese: /* == kTextEncodingMacJapanese */ |
| 5959 | strcpy(cs, "jisx0208.1983-sjis"); | 5960 | strcpy(cs, "jisx0208.1983-sjis"); |
| 5960 | break; | 5961 | break; |
| 5961 | case -smJapanese: | 5962 | case -smJapanese: |
| @@ -5967,12 +5968,24 @@ mac_to_x_fontname (char *name, int size, Style style, short scriptcode) | |||
| 5967 | font is being built. */ | 5968 | font is being built. */ |
| 5968 | strcpy(cs, "jisx0201.1976-0"); | 5969 | strcpy(cs, "jisx0201.1976-0"); |
| 5969 | break; | 5970 | break; |
| 5970 | case smKorean: | 5971 | case smKorean: /* == kTextEncodingMacKorean */ |
| 5971 | strcpy(cs, "ksc5601.1989-0"); | 5972 | strcpy(cs, "ksc5601.1989-0"); |
| 5972 | break; | 5973 | break; |
| 5974 | #if TARGET_API_MAC_CARBON | ||
| 5975 | case kTextEncodingMacCyrillic: | ||
| 5976 | strcpy(cs, "mac-cyrillic"); | ||
| 5977 | break; | ||
| 5978 | case kTextEncodingMacCentralEurRoman: | ||
| 5979 | strcpy(cs, "mac-centraleuropean"); | ||
| 5980 | break; | ||
| 5981 | case kTextEncodingMacSymbol: | ||
| 5982 | case kTextEncodingMacDingbats: | ||
| 5983 | strcpy(cs, "adobe-fontspecific"); | ||
| 5984 | break; | ||
| 5985 | #endif | ||
| 5973 | default: | 5986 | default: |
| 5974 | strcpy(cs, "mac-roman"); | 5987 | strcpy(cs, "mac-roman"); |
| 5975 | break; | 5988 | break; |
| 5976 | } | 5989 | } |
| 5977 | } | 5990 | } |
| 5978 | 5991 | ||
| @@ -6019,7 +6032,10 @@ x_font_name_to_mac_font_name (char *xf, char *mf) | |||
| 6019 | coding_system = Qsjis; | 6032 | coding_system = Qsjis; |
| 6020 | else if (strcmp (cs, "ksc5601.1989-0") == 0) | 6033 | else if (strcmp (cs, "ksc5601.1989-0") == 0) |
| 6021 | coding_system = Qeuc_kr; | 6034 | coding_system = Qeuc_kr; |
| 6022 | else if (strcmp (cs, "mac-roman") == 0) | 6035 | else if (strcmp (cs, "mac-roman") == 0 |
| 6036 | || strcmp (cs, "mac-cyrillic") == 0 | ||
| 6037 | || strcmp (cs, "mac-centraleuropean") == 0 | ||
| 6038 | || strcmp (cs, "adobe-fontspecific") == 0) | ||
| 6023 | strcpy (mf, family); | 6039 | strcpy (mf, family); |
| 6024 | else | 6040 | else |
| 6025 | sprintf (mf, "%s-%s-%s", foundry, family, cs); | 6041 | sprintf (mf, "%s-%s-%s", foundry, family, cs); |
| @@ -6091,7 +6107,8 @@ init_font_name_table () | |||
| 6091 | FMFont font; | 6107 | FMFont font; |
| 6092 | FMFontStyle style; | 6108 | FMFontStyle style; |
| 6093 | FMFontSize size; | 6109 | FMFontSize size; |
| 6094 | SInt16 sc; | 6110 | TextEncoding encoding; |
| 6111 | TextEncodingBase sc; | ||
| 6095 | 6112 | ||
| 6096 | if (FMGetFontFamilyName (ff, name) != noErr) | 6113 | if (FMGetFontFamilyName (ff, name) != noErr) |
| 6097 | break; | 6114 | break; |
| @@ -6099,9 +6116,11 @@ init_font_name_table () | |||
| 6099 | if (*name == '.') | 6116 | if (*name == '.') |
| 6100 | continue; | 6117 | continue; |
| 6101 | 6118 | ||
| 6102 | sc = FontToScript (ff); | 6119 | if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) |
| 6120 | break; | ||
| 6121 | sc = GetTextEncodingBase (encoding); | ||
| 6103 | decode_mac_font_name (name, sizeof (name), sc); | 6122 | decode_mac_font_name (name, sizeof (name), sc); |
| 6104 | 6123 | ||
| 6105 | /* Point the instance iterator at the current font family. */ | 6124 | /* Point the instance iterator at the current font family. */ |
| 6106 | if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) | 6125 | if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) |
| 6107 | break; | 6126 | break; |
| @@ -8619,17 +8638,30 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8619 | { | 8638 | { |
| 8620 | unsigned char ch = inev.code; | 8639 | unsigned char ch = inev.code; |
| 8621 | ByteCount actual_input_length, actual_output_length; | 8640 | ByteCount actual_input_length, actual_output_length; |
| 8622 | unsigned char outch; | 8641 | unsigned char outbuf[32]; |
| 8623 | 8642 | ||
| 8624 | convert_status = TECConvertText (converter, &ch, 1, | 8643 | convert_status = TECConvertText (converter, &ch, 1, |
| 8625 | &actual_input_length, | 8644 | &actual_input_length, |
| 8626 | &outch, 1, | 8645 | outbuf, 1, |
| 8627 | &actual_output_length); | 8646 | &actual_output_length); |
| 8628 | if (convert_status == noErr | 8647 | if (convert_status == noErr |
| 8629 | && actual_input_length == 1 | 8648 | && actual_input_length == 1 |
| 8630 | && actual_output_length == 1) | 8649 | && actual_output_length == 1) |
| 8631 | inev.code = outch; | 8650 | inev.code = *outbuf; |
| 8632 | } | 8651 | |
| 8652 | /* Reset internal states of the converter object. | ||
| 8653 | If it fails, create another one. */ | ||
| 8654 | convert_status = TECFlushText (converter, outbuf, | ||
| 8655 | sizeof (outbuf), | ||
| 8656 | &actual_output_length); | ||
| 8657 | if (convert_status != noErr) | ||
| 8658 | { | ||
| 8659 | TECDisposeConverter (converter); | ||
| 8660 | TECCreateConverter (&converter, | ||
| 8661 | kTextEncodingMacRoman, | ||
| 8662 | mac_keyboard_text_encoding); | ||
| 8663 | } | ||
| 8664 | } | ||
| 8633 | } | 8665 | } |
| 8634 | 8666 | ||
| 8635 | #if USE_CARBON_EVENTS | 8667 | #if USE_CARBON_EVENTS |
| @@ -9148,7 +9180,7 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 9148 | x_update_window_end, | 9180 | x_update_window_end, |
| 9149 | x_cursor_to, | 9181 | x_cursor_to, |
| 9150 | x_flush, | 9182 | x_flush, |
| 9151 | x_flush, | 9183 | 0, /* flush_display_optional */ |
| 9152 | x_clear_window_mouse_face, | 9184 | x_clear_window_mouse_face, |
| 9153 | x_get_glyph_overhangs, | 9185 | x_get_glyph_overhangs, |
| 9154 | x_fix_overlapping_area, | 9186 | x_fix_overlapping_area, |
diff --git a/src/macterm.h b/src/macterm.h index 6ce034e9534..308a9200395 100644 --- a/src/macterm.h +++ b/src/macterm.h | |||
| @@ -597,5 +597,9 @@ extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int, | |||
| 597 | #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 | 597 | #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 |
| 598 | #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 | 598 | #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 |
| 599 | 599 | ||
| 600 | #if TARGET_API_MAC_CARBON | ||
| 601 | extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); | ||
| 602 | #endif | ||
| 603 | |||
| 600 | /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79 | 604 | /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79 |
| 601 | (do not change this comment) */ | 605 | (do not change this comment) */ |
diff --git a/src/minibuf.c b/src/minibuf.c index 2ebb736ca00..375fa3622b3 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -2110,8 +2110,6 @@ a repetition of this command will exit. */) | |||
| 2110 | goto exit; | 2110 | goto exit; |
| 2111 | } | 2111 | } |
| 2112 | 2112 | ||
| 2113 | goto exit; | ||
| 2114 | |||
| 2115 | /* Call do_completion, but ignore errors. */ | 2113 | /* Call do_completion, but ignore errors. */ |
| 2116 | SET_PT (ZV); | 2114 | SET_PT (ZV); |
| 2117 | val = internal_condition_case (complete_and_exit_1, Qerror, | 2115 | val = internal_condition_case (complete_and_exit_1, Qerror, |
diff --git a/src/regex.c b/src/regex.c index a53eac29216..1009c837dcf 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -1950,28 +1950,27 @@ struct range_table_work_area | |||
| 1950 | 1950 | ||
| 1951 | /* Get the next unsigned number in the uncompiled pattern. */ | 1951 | /* Get the next unsigned number in the uncompiled pattern. */ |
| 1952 | #define GET_UNSIGNED_NUMBER(num) \ | 1952 | #define GET_UNSIGNED_NUMBER(num) \ |
| 1953 | do { if (p != pend) \ | 1953 | do { \ |
| 1954 | { \ | 1954 | if (p == pend) \ |
| 1955 | PATFETCH (c); \ | 1955 | FREE_STACK_RETURN (REG_EBRACE); \ |
| 1956 | if (c == ' ') \ | 1956 | else \ |
| 1957 | FREE_STACK_RETURN (REG_BADBR); \ | 1957 | { \ |
| 1958 | while ('0' <= c && c <= '9') \ | 1958 | PATFETCH (c); \ |
| 1959 | { \ | 1959 | while ('0' <= c && c <= '9') \ |
| 1960 | int prev; \ | 1960 | { \ |
| 1961 | if (num < 0) \ | 1961 | int prev; \ |
| 1962 | num = 0; \ | 1962 | if (num < 0) \ |
| 1963 | prev = num; \ | 1963 | num = 0; \ |
| 1964 | num = num * 10 + c - '0'; \ | 1964 | prev = num; \ |
| 1965 | if (num / 10 != prev) \ | 1965 | num = num * 10 + c - '0'; \ |
| 1966 | FREE_STACK_RETURN (REG_BADBR); \ | 1966 | if (num / 10 != prev) \ |
| 1967 | if (p == pend) \ | 1967 | FREE_STACK_RETURN (REG_BADBR); \ |
| 1968 | break; \ | 1968 | if (p == pend) \ |
| 1969 | PATFETCH (c); \ | 1969 | FREE_STACK_RETURN (REG_EBRACE); \ |
| 1970 | } \ | 1970 | PATFETCH (c); \ |
| 1971 | if (c == ' ') \ | 1971 | } \ |
| 1972 | FREE_STACK_RETURN (REG_BADBR); \ | 1972 | } \ |
| 1973 | } \ | 1973 | } while (0) |
| 1974 | } while (0) | ||
| 1975 | 1974 | ||
| 1976 | #if ! WIDE_CHAR_SUPPORT | 1975 | #if ! WIDE_CHAR_SUPPORT |
| 1977 | 1976 | ||
| @@ -2558,8 +2557,8 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 2558 | } | 2557 | } |
| 2559 | /* If the spaces are followed by a repetition op, | 2558 | /* If the spaces are followed by a repetition op, |
| 2560 | treat them normally. */ | 2559 | treat them normally. */ |
| 2561 | if (p1 == pend | 2560 | if (p1 != pend |
| 2562 | || (*p1 == '*' || *p1 == '+' || *p1 == '?' | 2561 | && (*p1 == '*' || *p1 == '+' || *p1 == '?' |
| 2563 | || (*p1 == '\\' && p1 + 1 != pend && p1[1] == '{'))) | 2562 | || (*p1 == '\\' && p1 + 1 != pend && p1[1] == '{'))) |
| 2564 | goto normal_char; | 2563 | goto normal_char; |
| 2565 | 2564 | ||
| @@ -3234,9 +3233,6 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 3234 | 3233 | ||
| 3235 | beg_interval = p; | 3234 | beg_interval = p; |
| 3236 | 3235 | ||
| 3237 | if (p == pend) | ||
| 3238 | FREE_STACK_RETURN (REG_EBRACE); | ||
| 3239 | |||
| 3240 | GET_UNSIGNED_NUMBER (lower_bound); | 3236 | GET_UNSIGNED_NUMBER (lower_bound); |
| 3241 | 3237 | ||
| 3242 | if (c == ',') | 3238 | if (c == ',') |
| @@ -3253,7 +3249,8 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 3253 | { | 3249 | { |
| 3254 | if (c != '\\') | 3250 | if (c != '\\') |
| 3255 | FREE_STACK_RETURN (REG_BADBR); | 3251 | FREE_STACK_RETURN (REG_BADBR); |
| 3256 | 3252 | if (p == pend) | |
| 3253 | FREE_STACK_RETURN (REG_EESCAPE); | ||
| 3257 | PATFETCH (c); | 3254 | PATFETCH (c); |
| 3258 | } | 3255 | } |
| 3259 | 3256 | ||
diff --git a/src/s/darwin.h b/src/s/darwin.h index f854ed9380b..9f78405a43c 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h | |||
| @@ -217,6 +217,13 @@ Boston, MA 02111-1307, USA. */ | |||
| 217 | /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ | 217 | /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ |
| 218 | #define HAVE_SOCKETS | 218 | #define HAVE_SOCKETS |
| 219 | 219 | ||
| 220 | /* In Carbon, asynchronous I/O (using SIGIO) can't be used for window | ||
| 221 | events because they don't come from sockets, even though it works | ||
| 222 | fine on tty's. */ | ||
| 223 | #ifdef HAVE_CARBON | ||
| 224 | #define NO_SOCK_SIGIO | ||
| 225 | #endif | ||
| 226 | |||
| 220 | /* Extra initialization calls in main for Mac OS X system type. */ | 227 | /* Extra initialization calls in main for Mac OS X system type. */ |
| 221 | #ifdef HAVE_CARBON | 228 | #ifdef HAVE_CARBON |
| 222 | #define SYMS_SYSTEM syms_of_mac() | 229 | #define SYMS_SYSTEM syms_of_mac() |
| @@ -314,6 +321,10 @@ struct kboard; | |||
| 314 | #define free unexec_free | 321 | #define free unexec_free |
| 315 | #endif | 322 | #endif |
| 316 | 323 | ||
| 324 | /* This makes create_process in process.c save and restore signal | ||
| 325 | handlers correctly. Suggested by Nozomu Ando.*/ | ||
| 326 | #define POSIX_SIGNALS | ||
| 327 | |||
| 317 | /* Reroute calls to SELECT to the version defined in mac.c to fix the | 328 | /* Reroute calls to SELECT to the version defined in mac.c to fix the |
| 318 | problem of Emacs requiring an extra return to be typed to start | 329 | problem of Emacs requiring an extra return to be typed to start |
| 319 | working when started from the command line. */ | 330 | working when started from the command line. */ |
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 033ce49293a..3cf21756d7d 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* This file is the configuration file for Linux-based GNU systems | 1 | /* This file is the configuration file for Linux-based GNU systems |
| 2 | Copyright (C) 1985, 86, 92, 94, 96, 1999, 2002 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 86, 92, 94, 96, 1999, 2002, 2004 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -355,12 +355,22 @@ Boston, MA 02111-1307, USA. */ | |||
| 355 | 355 | ||
| 356 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ | 356 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ |
| 357 | || defined __alpha__ || defined __mips__ || defined __s390__ \ | 357 | || defined __alpha__ || defined __mips__ || defined __s390__ \ |
| 358 | || defined __arm__ || defined __powerpc__ || defined __amd64__ | 358 | || defined __arm__ || defined __powerpc__ || defined __amd64__ \ |
| 359 | || defined __ia64__ | ||
| 359 | #define GC_SETJMP_WORKS 1 | 360 | #define GC_SETJMP_WORKS 1 |
| 360 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS | 361 | #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS |
| 361 | #ifdef __mc68000__ | 362 | #ifdef __mc68000__ |
| 362 | #define GC_LISP_OBJECT_ALIGNMENT 2 | 363 | #define GC_LISP_OBJECT_ALIGNMENT 2 |
| 363 | #endif | 364 | #endif |
| 365 | #ifdef __ia64__ | ||
| 366 | #define GC_MARK_SECONDARY_STACK() \ | ||
| 367 | do { \ | ||
| 368 | extern void *__libc_ia64_register_backing_store_base; \ | ||
| 369 | __builtin_ia64_flushrs (); \ | ||
| 370 | mark_memory (__libc_ia64_register_backing_store_base, \ | ||
| 371 | __builtin_ia64_bsp ()); \ | ||
| 372 | } while (0) | ||
| 373 | #endif | ||
| 364 | #endif | 374 | #endif |
| 365 | 375 | ||
| 366 | /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9 | 376 | /* arch-tag: 6244ea2a-abd0-44ec-abec-ff3dcc9afea9 |
diff --git a/src/search.c b/src/search.c index 56611ca7af8..7e990f2bfd7 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2860,7 +2860,7 @@ LIST should have been created by calling `match-data' previously. */) | |||
| 2860 | else | 2860 | else |
| 2861 | { | 2861 | { |
| 2862 | int from; | 2862 | int from; |
| 2863 | 2863 | ||
| 2864 | if (MARKERP (marker)) | 2864 | if (MARKERP (marker)) |
| 2865 | { | 2865 | { |
| 2866 | if (XMARKER (marker)->buffer == 0) | 2866 | if (XMARKER (marker)->buffer == 0) |
| @@ -2868,15 +2868,15 @@ LIST should have been created by calling `match-data' previously. */) | |||
| 2868 | else | 2868 | else |
| 2869 | XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer); | 2869 | XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer); |
| 2870 | } | 2870 | } |
| 2871 | 2871 | ||
| 2872 | CHECK_NUMBER_COERCE_MARKER (marker); | 2872 | CHECK_NUMBER_COERCE_MARKER (marker); |
| 2873 | from = XINT (marker); | 2873 | from = XINT (marker); |
| 2874 | list = Fcdr (list); | 2874 | list = Fcdr (list); |
| 2875 | 2875 | ||
| 2876 | marker = Fcar (list); | 2876 | marker = Fcar (list); |
| 2877 | if (MARKERP (marker) && XMARKER (marker)->buffer == 0) | 2877 | if (MARKERP (marker) && XMARKER (marker)->buffer == 0) |
| 2878 | XSETFASTINT (marker, 0); | 2878 | XSETFASTINT (marker, 0); |
| 2879 | 2879 | ||
| 2880 | CHECK_NUMBER_COERCE_MARKER (marker); | 2880 | CHECK_NUMBER_COERCE_MARKER (marker); |
| 2881 | search_regs.start[i] = from; | 2881 | search_regs.start[i] = from; |
| 2882 | search_regs.end[i] = XINT (marker); | 2882 | search_regs.end[i] = XINT (marker); |
| @@ -3013,7 +3013,7 @@ syms_of_search () | |||
| 3013 | staticpro (&saved_last_thing_searched); | 3013 | staticpro (&saved_last_thing_searched); |
| 3014 | 3014 | ||
| 3015 | DEFVAR_LISP ("search-spaces-regexp", &Vsearch_spaces_regexp, | 3015 | DEFVAR_LISP ("search-spaces-regexp", &Vsearch_spaces_regexp, |
| 3016 | /* doc: Regexp to substitute for bunches of spaces in regexp search. | 3016 | doc: /* Regexp to substitute for bunches of spaces in regexp search. |
| 3017 | Some commands use this for user-specified regexps. | 3017 | Some commands use this for user-specified regexps. |
| 3018 | Spaces that occur inside character classes or repetition operators | 3018 | Spaces that occur inside character classes or repetition operators |
| 3019 | or other such regexp constructs are not replaced with this. | 3019 | or other such regexp constructs are not replaced with this. |
diff --git a/src/sysdep.c b/src/sysdep.c index a887b8c2d96..fb7b9275fc7 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Interfaces to system-dependent kernel and library entries. | 1 | /* Interfaces to system-dependent kernel and library entries. |
| 2 | Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003 | 2 | Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, |
| 3 | Free Software Foundation, Inc. | 3 | 2003, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -2872,12 +2872,16 @@ sys_signal (int signal_number, signal_handler_t action) | |||
| 2872 | struct sigaction new_action, old_action; | 2872 | struct sigaction new_action, old_action; |
| 2873 | sigemptyset (&new_action.sa_mask); | 2873 | sigemptyset (&new_action.sa_mask); |
| 2874 | new_action.sa_handler = action; | 2874 | new_action.sa_handler = action; |
| 2875 | #if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) | 2875 | #if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && !defined(SYNC_INPUT) |
| 2876 | /* Emacs mostly works better with restartable system services. If this | 2876 | /* Emacs mostly works better with restartable system services. If this |
| 2877 | flag exists, we probably want to turn it on here. | 2877 | flag exists, we probably want to turn it on here. |
| 2878 | However, on some systems this resets the timeout of `select' | 2878 | However, on some systems this resets the timeout of `select' |
| 2879 | which means that `select' never finishes if it keeps getting signals. | 2879 | which means that `select' never finishes if it keeps getting signals. |
| 2880 | BROKEN_SA_RESTART is defined on those systems. */ | 2880 | BROKEN_SA_RESTART is defined on those systems. */ |
| 2881 | /* It's not clear why the comment above says "mostly works better". --Stef | ||
| 2882 | When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll | ||
| 2883 | for pending input so we need long-running syscalls to be interrupted | ||
| 2884 | after a signal that sets the interrupt_input_pending flag. */ | ||
| 2881 | new_action.sa_flags = SA_RESTART; | 2885 | new_action.sa_flags = SA_RESTART; |
| 2882 | #else | 2886 | #else |
| 2883 | new_action.sa_flags = 0; | 2887 | new_action.sa_flags = 0; |
| @@ -3329,7 +3333,8 @@ emacs_open (path, oflag, mode) | |||
| 3329 | #endif | 3333 | #endif |
| 3330 | 3334 | ||
| 3331 | while ((rtnval = open (path, oflag, mode)) == -1 | 3335 | while ((rtnval = open (path, oflag, mode)) == -1 |
| 3332 | && (errno == EINTR)); | 3336 | && (errno == EINTR)) |
| 3337 | QUIT; | ||
| 3333 | return (rtnval); | 3338 | return (rtnval); |
| 3334 | } | 3339 | } |
| 3335 | 3340 | ||
| @@ -3362,7 +3367,8 @@ emacs_read (fildes, buf, nbyte) | |||
| 3362 | register int rtnval; | 3367 | register int rtnval; |
| 3363 | 3368 | ||
| 3364 | while ((rtnval = read (fildes, buf, nbyte)) == -1 | 3369 | while ((rtnval = read (fildes, buf, nbyte)) == -1 |
| 3365 | && (errno == EINTR)); | 3370 | && (errno == EINTR)) |
| 3371 | QUIT; | ||
| 3366 | return (rtnval); | 3372 | return (rtnval); |
| 3367 | } | 3373 | } |
| 3368 | 3374 | ||
| @@ -3383,7 +3389,15 @@ emacs_write (fildes, buf, nbyte) | |||
| 3383 | if (rtnval == -1) | 3389 | if (rtnval == -1) |
| 3384 | { | 3390 | { |
| 3385 | if (errno == EINTR) | 3391 | if (errno == EINTR) |
| 3386 | continue; | 3392 | { |
| 3393 | #ifdef SYNC_INPUT | ||
| 3394 | /* I originally used `QUIT' but that might causes files to | ||
| 3395 | be truncated if you hit C-g in the middle of it. --Stef */ | ||
| 3396 | if (interrupt_input_pending) | ||
| 3397 | handle_async_input (); | ||
| 3398 | #endif | ||
| 3399 | continue; | ||
| 3400 | } | ||
| 3387 | else | 3401 | else |
| 3388 | return (bytes_written ? bytes_written : -1); | 3402 | return (bytes_written ? bytes_written : -1); |
| 3389 | } | 3403 | } |
diff --git a/src/term.c b/src/term.c index 899829ebadb..cf79ea43531 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -612,39 +612,43 @@ tty_clear_end_of_line (struct frame *f, int first_unused_hpos) | |||
| 612 | } | 612 | } |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | /* Encode SRC_LEN glyphs starting at SRC to terminal output codes and | 615 | /* Buffer to store the source and result of code conversion for terminal. */ |
| 616 | store them at DST. Do not write more than DST_LEN bytes. That may | 616 | static unsigned char *encode_terminal_buf; |
| 617 | require stopping before all SRC_LEN input glyphs have been | 617 | /* Allocated size of the above buffer. */ |
| 618 | converted. | 618 | static int encode_terminal_bufsize; |
| 619 | 619 | ||
| 620 | We store the number of glyphs actually converted in *CONSUMED. The | 620 | /* Encode SRC_LEN glyphs starting at SRC to terminal output codes. |
| 621 | return value is the number of bytes store in DST. */ | 621 | Set CODING->produced to the byte-length of the resulting byte |
| 622 | sequence, and return a pointer to that byte sequence. */ | ||
| 622 | 623 | ||
| 623 | int | 624 | unsigned char * |
| 624 | encode_terminal_code (struct coding_system *coding, | 625 | encode_terminal_code (src, src_len, coding) |
| 625 | struct glyph *src, | 626 | struct glyph *src; |
| 626 | unsigned char *dst, | 627 | int src_len; |
| 627 | int src_len, | 628 | struct coding_system *coding; |
| 628 | int dst_len, | ||
| 629 | int *consumed) | ||
| 630 | { | 629 | { |
| 631 | struct glyph *src_start = src, *src_end = src + src_len; | 630 | struct glyph *src_start = src, *src_end = src + src_len; |
| 632 | unsigned char *dst_start = dst, *dst_end = dst + dst_len; | ||
| 633 | register GLYPH g; | 631 | register GLYPH g; |
| 634 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH]; | 632 | unsigned char *buf; |
| 635 | const unsigned char *buf; | 633 | int nchars, nbytes, required; |
| 636 | int len; | ||
| 637 | register int tlen = GLYPH_TABLE_LENGTH; | 634 | register int tlen = GLYPH_TABLE_LENGTH; |
| 638 | register Lisp_Object *tbase = GLYPH_TABLE_BASE; | 635 | register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
| 639 | int result; | ||
| 640 | 636 | ||
| 641 | /* If the specified coding does any conversion, use it, otherwise use | 637 | /* Allocate sufficient size of buffer to store all characters in |
| 642 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here | 638 | multibyte-form. But, it may be enlarged on demand if |
| 643 | because it always returns 1 if the member src_multibyte is 1. */ | 639 | Vglyph_table contains a string. */ |
| 644 | coding = (coding->common_flags & CODING_REQUIRE_ENCODING_MASK | 640 | required = MAX_MULTIBYTE_LENGTH * src_len; |
| 645 | ? coding | 641 | if (encode_terminal_bufsize < required) |
| 646 | : &safe_terminal_coding); | 642 | { |
| 643 | encode_terminal_bufsize = required; | ||
| 644 | if (encode_terminal_bufsize == 0) | ||
| 645 | encode_terminal_buf = xmalloc (required); | ||
| 646 | else | ||
| 647 | encode_terminal_buf = xrealloc (encode_terminal_buf, required); | ||
| 648 | } | ||
| 647 | 649 | ||
| 650 | buf = encode_terminal_buf; | ||
| 651 | nchars = 0; | ||
| 648 | while (src < src_end) | 652 | while (src < src_end) |
| 649 | { | 653 | { |
| 650 | /* We must skip glyphs to be padded for a wide character. */ | 654 | /* We must skip glyphs to be padded for a wide character. */ |
| @@ -655,18 +659,11 @@ encode_terminal_code (struct coding_system *coding, | |||
| 655 | if (g < 0 || g >= tlen) | 659 | if (g < 0 || g >= tlen) |
| 656 | { | 660 | { |
| 657 | /* This glyph doesn't has an entry in Vglyph_table. */ | 661 | /* This glyph doesn't has an entry in Vglyph_table. */ |
| 658 | if (! CHAR_VALID_P (src->u.ch, 0)) | 662 | if (CHAR_VALID_P (src->u.ch, 0)) |
| 659 | { | 663 | buf += CHAR_STRING (src->u.ch, buf); |
| 660 | len = 1; | ||
| 661 | buf = " "; | ||
| 662 | coding->src_multibyte = 0; | ||
| 663 | } | ||
| 664 | else | 664 | else |
| 665 | { | 665 | *buf++ = SPACEGLYPH; |
| 666 | len = CHAR_STRING (src->u.ch, workbuf); | 666 | nchars++; |
| 667 | buf = workbuf; | ||
| 668 | coding->src_multibyte = 1; | ||
| 669 | } | ||
| 670 | } | 667 | } |
| 671 | else | 668 | else |
| 672 | { | 669 | { |
| @@ -676,48 +673,61 @@ encode_terminal_code (struct coding_system *coding, | |||
| 676 | 673 | ||
| 677 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) | 674 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) |
| 678 | { | 675 | { |
| 679 | /* We set the multi-byte form of a character in G | 676 | int c = FAST_GLYPH_CHAR (g); |
| 680 | (that should be an ASCII character) at | 677 | |
| 681 | WORKBUF. */ | 678 | if (CHAR_VALID_P (c, 0)) |
| 682 | workbuf[0] = FAST_GLYPH_CHAR (g); | 679 | buf += CHAR_STRING (c, buf); |
| 683 | len = 1; | 680 | else |
| 684 | buf = workbuf; | 681 | *buf++ = SPACEGLYPH; |
| 685 | coding->src_multibyte = 0; | 682 | nchars++; |
| 686 | } | 683 | } |
| 687 | else | 684 | else |
| 688 | { | 685 | { |
| 689 | /* We have a string in Vglyph_table. */ | 686 | /* We have a string in Vglyph_table. */ |
| 690 | len = GLYPH_LENGTH (tbase, g); | 687 | Lisp_Object string; |
| 691 | buf = GLYPH_STRING (tbase, g); | 688 | |
| 692 | coding->src_multibyte = STRING_MULTIBYTE (tbase[g]); | 689 | string = tbase[g]; |
| 690 | if (! STRING_MULTIBYTE (string)) | ||
| 691 | string = string_to_multibyte (string); | ||
| 692 | nbytes = buf - encode_terminal_buf; | ||
| 693 | if (nbytes + SBYTES (string) < encode_terminal_bufsize) | ||
| 694 | { | ||
| 695 | encode_terminal_bufsize = nbytes + SBYTES (string); | ||
| 696 | encode_terminal_buf = xrealloc (encode_terminal_buf, | ||
| 697 | encode_terminal_bufsize); | ||
| 698 | buf = encode_terminal_buf + nbytes; | ||
| 699 | } | ||
| 700 | bcopy (SDATA (string), buf, SBYTES (string)); | ||
| 701 | buf += SBYTES (string); | ||
| 702 | nchars += SCHARS (string); | ||
| 693 | } | 703 | } |
| 694 | } | 704 | } |
| 695 | |||
| 696 | result = encode_coding (coding, buf, dst, len, dst_end - dst); | ||
| 697 | len -= coding->consumed; | ||
| 698 | dst += coding->produced; | ||
| 699 | if (result == CODING_FINISH_INSUFFICIENT_DST | ||
| 700 | || (result == CODING_FINISH_INSUFFICIENT_SRC | ||
| 701 | && len > dst_end - dst)) | ||
| 702 | /* The remaining output buffer is too short. We must | ||
| 703 | break the loop here without increasing SRC so that the | ||
| 704 | next call of this function starts from the same glyph. */ | ||
| 705 | break; | ||
| 706 | |||
| 707 | if (len > 0) | ||
| 708 | { | ||
| 709 | /* This is the case that a code of the range 0200..0237 | ||
| 710 | exists in buf. We must just write out such a code. */ | ||
| 711 | buf += coding->consumed; | ||
| 712 | while (len--) | ||
| 713 | *dst++ = *buf++; | ||
| 714 | } | ||
| 715 | } | 705 | } |
| 716 | src++; | 706 | src++; |
| 717 | } | 707 | } |
| 718 | 708 | ||
| 719 | *consumed = src - src_start; | 709 | nbytes = buf - encode_terminal_buf; |
| 720 | return (dst - dst_start); | 710 | coding->src_multibyte = 1; |
| 711 | coding->dst_multibyte = 0; | ||
| 712 | if (SYMBOLP (coding->pre_write_conversion) | ||
| 713 | && ! NILP (Ffboundp (coding->pre_write_conversion))) | ||
| 714 | { | ||
| 715 | run_pre_write_conversin_on_c_str (&encode_terminal_buf, | ||
| 716 | &encode_terminal_bufsize, | ||
| 717 | nchars, nbytes, coding); | ||
| 718 | nchars = coding->produced_char; | ||
| 719 | nbytes = coding->produced; | ||
| 720 | } | ||
| 721 | required = nbytes + encoding_buffer_size (coding, nbytes); | ||
| 722 | if (encode_terminal_bufsize < required) | ||
| 723 | { | ||
| 724 | encode_terminal_bufsize = required; | ||
| 725 | encode_terminal_buf = xrealloc (encode_terminal_buf, required); | ||
| 726 | } | ||
| 727 | |||
| 728 | encode_coding (coding, encode_terminal_buf, encode_terminal_buf + nbytes, | ||
| 729 | nbytes, encode_terminal_bufsize - nbytes); | ||
| 730 | return encode_terminal_buf + nbytes; | ||
| 721 | } | 731 | } |
| 722 | 732 | ||
| 723 | 733 | ||
| @@ -736,9 +746,8 @@ write_glyphs (struct frame *f, struct glyph *string, int len) | |||
| 736 | void | 746 | void |
| 737 | tty_write_glyphs (struct frame *f, struct glyph *string, int len) | 747 | tty_write_glyphs (struct frame *f, struct glyph *string, int len) |
| 738 | { | 748 | { |
| 739 | int produced, consumed; | 749 | unsigned char *conversion_buffer; |
| 740 | unsigned char conversion_buffer[1024]; | 750 | struct coding_system *coding; |
| 741 | int conversion_buffer_size = sizeof conversion_buffer; | ||
| 742 | 751 | ||
| 743 | struct tty_display_info *tty = FRAME_TTY (f); | 752 | struct tty_display_info *tty = FRAME_TTY (f); |
| 744 | 753 | ||
| @@ -757,9 +766,14 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len) | |||
| 757 | 766 | ||
| 758 | cmplus (tty, len); | 767 | cmplus (tty, len); |
| 759 | 768 | ||
| 769 | /* If terminal_coding does any conversion, use it, otherwise use | ||
| 770 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here | ||
| 771 | because it always return 1 if the member src_multibyte is 1. */ | ||
| 772 | coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK | ||
| 773 | ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); | ||
| 760 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at | 774 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
| 761 | the tail. */ | 775 | the tail. */ |
| 762 | FRAME_TERMINAL_CODING (f)->mode &= ~CODING_MODE_LAST_BLOCK; | 776 | coding->mode &= ~CODING_MODE_LAST_BLOCK; |
| 763 | 777 | ||
| 764 | while (len > 0) | 778 | while (len > 0) |
| 765 | { | 779 | { |
| @@ -775,55 +789,26 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len) | |||
| 775 | highlight_if_desired (tty); | 789 | highlight_if_desired (tty); |
| 776 | turn_on_face (f, face_id); | 790 | turn_on_face (f, face_id); |
| 777 | 791 | ||
| 778 | while (n > 0) | 792 | if (n == len) |
| 793 | /* This is the last run. */ | ||
| 794 | coding->mode |= CODING_MODE_LAST_BLOCK; | ||
| 795 | conversion_buffer = encode_terminal_code (string, n, coding); | ||
| 796 | if (coding->produced > 0) | ||
| 779 | { | 797 | { |
| 780 | /* We use a fixed size (1024 bytes) of conversion buffer. | 798 | fwrite (conversion_buffer, 1, coding->produced, tty->output); |
| 781 | Usually it is sufficient, but if not, we just repeat the | 799 | if (ferror (tty->output)) |
| 782 | loop. */ | 800 | clearerr (tty->output); |
| 783 | produced = encode_terminal_code (FRAME_TERMINAL_CODING (f), | 801 | if (tty->termscript) |
| 784 | string, conversion_buffer, | 802 | fwrite (conversion_buffer, 1, coding->produced, tty->termscript); |
| 785 | n, conversion_buffer_size, | ||
| 786 | &consumed); | ||
| 787 | if (produced > 0) | ||
| 788 | { | ||
| 789 | fwrite (conversion_buffer, 1, produced, | ||
| 790 | tty->output); | ||
| 791 | if (ferror (tty->output)) | ||
| 792 | clearerr (tty->output); | ||
| 793 | if (tty->termscript) | ||
| 794 | fwrite (conversion_buffer, 1, produced, | ||
| 795 | tty->termscript); | ||
| 796 | } | ||
| 797 | len -= consumed; | ||
| 798 | n -= consumed; | ||
| 799 | string += consumed; | ||
| 800 | } | 803 | } |
| 804 | len -= n; | ||
| 805 | string += n; | ||
| 801 | 806 | ||
| 802 | /* Turn appearance modes off. */ | 807 | /* Turn appearance modes off. */ |
| 803 | turn_off_face (f, face_id); | 808 | turn_off_face (f, face_id); |
| 804 | turn_off_highlight (tty); | 809 | turn_off_highlight (tty); |
| 805 | } | 810 | } |
| 806 | 811 | ||
| 807 | /* We may have to output some codes to terminate the writing. */ | ||
| 808 | if (CODING_REQUIRE_FLUSHING (FRAME_TERMINAL_CODING (f))) | ||
| 809 | { | ||
| 810 | FRAME_TERMINAL_CODING (f)->mode |= CODING_MODE_LAST_BLOCK; | ||
| 811 | encode_coding (FRAME_TERMINAL_CODING (f), "", | ||
| 812 | conversion_buffer, 0, conversion_buffer_size); | ||
| 813 | if (FRAME_TERMINAL_CODING (f)->produced > 0) | ||
| 814 | { | ||
| 815 | fwrite (conversion_buffer, 1, | ||
| 816 | FRAME_TERMINAL_CODING (f)->produced, | ||
| 817 | tty->output); | ||
| 818 | if (ferror (tty->output)) | ||
| 819 | clearerr (tty->output); | ||
| 820 | if (tty->termscript) | ||
| 821 | fwrite (conversion_buffer, 1, | ||
| 822 | FRAME_TERMINAL_CODING (f)->produced, | ||
| 823 | tty->termscript); | ||
| 824 | } | ||
| 825 | } | ||
| 826 | |||
| 827 | cmcheckmagic (tty); | 812 | cmcheckmagic (tty); |
| 828 | } | 813 | } |
| 829 | 814 | ||
| @@ -848,6 +833,9 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len) | |||
| 848 | { | 833 | { |
| 849 | char *buf; | 834 | char *buf; |
| 850 | struct glyph *glyph = NULL; | 835 | struct glyph *glyph = NULL; |
| 836 | unsigned char *conversion_buffer; | ||
| 837 | unsigned char space[1]; | ||
| 838 | struct coding_system *coding; | ||
| 851 | 839 | ||
| 852 | struct tty_display_info *tty = FRAME_TTY (f); | 840 | struct tty_display_info *tty = FRAME_TTY (f); |
| 853 | 841 | ||
| @@ -863,19 +851,26 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len) | |||
| 863 | 851 | ||
| 864 | turn_on_insert (tty); | 852 | turn_on_insert (tty); |
| 865 | cmplus (tty, len); | 853 | cmplus (tty, len); |
| 866 | /* The bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */ | 854 | |
| 867 | FRAME_TERMINAL_CODING (f)->mode &= ~CODING_MODE_LAST_BLOCK; | 855 | if (! start) |
| 856 | space[0] = SPACEGLYPH; | ||
| 857 | |||
| 858 | /* If terminal_coding does any conversion, use it, otherwise use | ||
| 859 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here | ||
| 860 | because it always return 1 if the member src_multibyte is 1. */ | ||
| 861 | coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK | ||
| 862 | ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); | ||
| 863 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at | ||
| 864 | the tail. */ | ||
| 865 | coding->mode &= ~CODING_MODE_LAST_BLOCK; | ||
| 866 | |||
| 868 | while (len-- > 0) | 867 | while (len-- > 0) |
| 869 | { | 868 | { |
| 870 | int produced, consumed; | ||
| 871 | unsigned char conversion_buffer[1024]; | ||
| 872 | int conversion_buffer_size = sizeof conversion_buffer; | ||
| 873 | |||
| 874 | OUTPUT1_IF (tty, tty->TS_ins_char); | 869 | OUTPUT1_IF (tty, tty->TS_ins_char); |
| 875 | if (!start) | 870 | if (!start) |
| 876 | { | 871 | { |
| 877 | conversion_buffer[0] = SPACEGLYPH; | 872 | conversion_buffer = space; |
| 878 | produced = 1; | 873 | coding->produced = 1; |
| 879 | } | 874 | } |
| 880 | else | 875 | else |
| 881 | { | 876 | { |
| @@ -893,24 +888,18 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len) | |||
| 893 | 888 | ||
| 894 | if (len <= 0) | 889 | if (len <= 0) |
| 895 | /* This is the last glyph. */ | 890 | /* This is the last glyph. */ |
| 896 | FRAME_TERMINAL_CODING (f)->mode |= CODING_MODE_LAST_BLOCK; | 891 | coding->mode |= CODING_MODE_LAST_BLOCK; |
| 897 | 892 | ||
| 898 | /* The size of conversion buffer (1024 bytes) is surely | 893 | conversion_buffer = encode_terminal_code (glyph, 1, coding); |
| 899 | sufficient for just one glyph. */ | ||
| 900 | produced = encode_terminal_code (FRAME_TERMINAL_CODING (f), | ||
| 901 | glyph, conversion_buffer, 1, | ||
| 902 | conversion_buffer_size, &consumed); | ||
| 903 | } | 894 | } |
| 904 | 895 | ||
| 905 | if (produced > 0) | 896 | if (coding->produced > 0) |
| 906 | { | 897 | { |
| 907 | fwrite (conversion_buffer, 1, produced, | 898 | fwrite (conversion_buffer, 1, coding->produced, tty->output); |
| 908 | tty->output); | ||
| 909 | if (ferror (tty->output)) | 899 | if (ferror (tty->output)) |
| 910 | clearerr (tty->output); | 900 | clearerr (tty->output); |
| 911 | if (tty->termscript) | 901 | if (tty->termscript) |
| 912 | fwrite (conversion_buffer, 1, produced, | 902 | fwrite (conversion_buffer, 1, coding->produced, tty->termscript); |
| 913 | tty->termscript); | ||
| 914 | } | 903 | } |
| 915 | 904 | ||
| 916 | OUTPUT1_IF (tty, tty->TS_pad_inserted_char); | 905 | OUTPUT1_IF (tty, tty->TS_pad_inserted_char); |
| @@ -2445,6 +2434,8 @@ term_init (char *name, char *terminal_type, int must_succeed) | |||
| 2445 | 2434 | ||
| 2446 | add_keyboard_wait_descriptor (fileno (tty->input)); | 2435 | add_keyboard_wait_descriptor (fileno (tty->input)); |
| 2447 | 2436 | ||
| 2437 | encode_terminal_bufsize = 0; | ||
| 2438 | |||
| 2448 | #ifdef WINDOWSNT | 2439 | #ifdef WINDOWSNT |
| 2449 | initialize_w32_display (); | 2440 | initialize_w32_display (); |
| 2450 | 2441 | ||
diff --git a/src/w32console.c b/src/w32console.c index 74a8fd6338e..a77dc792306 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -294,6 +294,9 @@ w32con_insert_glyphs (register struct glyph *start, register int len) | |||
| 294 | } | 294 | } |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | extern unsigned char *encode_terminal_code P_ ((struct glyph *, int, | ||
| 298 | struct coding_system *)); | ||
| 299 | |||
| 297 | static void | 300 | static void |
| 298 | w32con_write_glyphs (register struct glyph *string, register int len) | 301 | w32con_write_glyphs (register struct glyph *string, register int len) |
| 299 | { | 302 | { |
| @@ -301,12 +304,17 @@ w32con_write_glyphs (register struct glyph *string, register int len) | |||
| 301 | DWORD r; | 304 | DWORD r; |
| 302 | struct frame * f = PICK_FRAME (); | 305 | struct frame * f = PICK_FRAME (); |
| 303 | WORD char_attr; | 306 | WORD char_attr; |
| 304 | unsigned char conversion_buffer[1024]; | 307 | unsigned char *conversion_buffer; |
| 305 | int conversion_buffer_size = sizeof conversion_buffer; | 308 | struct coding_system *coding; |
| 306 | 309 | ||
| 307 | if (len <= 0) | 310 | if (len <= 0) |
| 308 | return; | 311 | return; |
| 309 | 312 | ||
| 313 | /* If terminal_coding does any conversion, use it, otherwise use | ||
| 314 | safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here | ||
| 315 | because it always return 1 if the member src_multibyte is 1. */ | ||
| 316 | coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK | ||
| 317 | ? &terminal_coding : &safe_terminal_coding); | ||
| 310 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at | 318 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
| 311 | the tail. */ | 319 | the tail. */ |
| 312 | terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK; | 320 | terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK; |
| @@ -324,69 +332,37 @@ w32con_write_glyphs (register struct glyph *string, register int len) | |||
| 324 | /* Turn appearance modes of the face of the run on. */ | 332 | /* Turn appearance modes of the face of the run on. */ |
| 325 | char_attr = w32_face_attributes (f, face_id); | 333 | char_attr = w32_face_attributes (f, face_id); |
| 326 | 334 | ||
| 327 | while (n > 0) | 335 | if (n == len) |
| 328 | { | 336 | /* This is the last run. */ |
| 329 | /* We use a fixed size (1024 bytes) of conversion buffer. | 337 | coding->mode |= CODING_MODE_LAST_BLOCK; |
| 330 | Usually it is sufficient, but if not, we just repeat the | 338 | conversion_buffer = encode_terminal_code (string, n, coding); |
| 331 | loop. */ | 339 | if (coding->produced > 0) |
| 332 | produced = encode_terminal_code (string, conversion_buffer, | 340 | { |
| 333 | n, conversion_buffer_size, | 341 | /* Set the attribute for these characters. */ |
| 334 | &consumed); | 342 | if (!FillConsoleOutputAttribute (cur_screen, char_attr, |
| 335 | if (produced > 0) | 343 | coding->produced, cursor_coords, |
| 344 | &r)) | ||
| 336 | { | 345 | { |
| 337 | /* Set the attribute for these characters. */ | 346 | printf ("Failed writing console attributes: %d\n", |
| 338 | if (!FillConsoleOutputAttribute (cur_screen, char_attr, | 347 | GetLastError ()); |
| 339 | produced, cursor_coords, &r)) | 348 | fflush (stdout); |
| 340 | { | 349 | } |
| 341 | printf ("Failed writing console attributes: %d\n", | 350 | |
| 342 | GetLastError ()); | 351 | /* Write the characters. */ |
| 343 | fflush (stdout); | 352 | if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer, |
| 344 | } | 353 | coding->produced, cursor_coords, |
| 345 | 354 | &r)) | |
| 346 | /* Write the characters. */ | 355 | { |
| 347 | if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer, | 356 | printf ("Failed writing console characters: %d\n", |
| 348 | produced, cursor_coords, &r)) | 357 | GetLastError ()); |
| 349 | { | 358 | fflush (stdout); |
| 350 | printf ("Failed writing console characters: %d\n", | 359 | } |
| 351 | GetLastError ()); | 360 | |
| 352 | fflush (stdout); | 361 | cursor_coords.X += coding->produced; |
| 353 | } | 362 | w32con_move_cursor (cursor_coords.Y, cursor_coords.X); |
| 354 | 363 | } | |
| 355 | cursor_coords.X += produced; | 364 | len -= n; |
| 356 | w32con_move_cursor (cursor_coords.Y, cursor_coords.X); | 365 | string += n; |
| 357 | } | ||
| 358 | len -= consumed; | ||
| 359 | n -= consumed; | ||
| 360 | string += consumed; | ||
| 361 | } | ||
| 362 | } | ||
| 363 | |||
| 364 | /* We may have to output some codes to terminate the writing. */ | ||
| 365 | if (CODING_REQUIRE_FLUSHING (&terminal_coding)) | ||
| 366 | { | ||
| 367 | terminal_coding.mode |= CODING_MODE_LAST_BLOCK; | ||
| 368 | encode_coding (&terminal_coding, "", conversion_buffer, | ||
| 369 | 0, conversion_buffer_size); | ||
| 370 | if (terminal_coding.produced > 0) | ||
| 371 | { | ||
| 372 | if (!FillConsoleOutputAttribute (cur_screen, char_attr_normal, | ||
| 373 | terminal_coding.produced, | ||
| 374 | cursor_coords, &r)) | ||
| 375 | { | ||
| 376 | printf ("Failed writing console attributes: %d\n", | ||
| 377 | GetLastError ()); | ||
| 378 | fflush (stdout); | ||
| 379 | } | ||
| 380 | |||
| 381 | /* Write the characters. */ | ||
| 382 | if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer, | ||
| 383 | produced, cursor_coords, &r)) | ||
| 384 | { | ||
| 385 | printf ("Failed writing console characters: %d\n", | ||
| 386 | GetLastError ()); | ||
| 387 | fflush (stdout); | ||
| 388 | } | ||
| 389 | } | ||
| 390 | } | 366 | } |
| 391 | } | 367 | } |
| 392 | 368 | ||
diff --git a/src/window.c b/src/window.c index b202031878b..e3beb4b10a5 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1613,7 +1613,7 @@ decode_next_window_args (window, minibuf, all_frames) | |||
| 1613 | : Qnil); | 1613 | : Qnil); |
| 1614 | else if (EQ (*all_frames, Qvisible)) | 1614 | else if (EQ (*all_frames, Qvisible)) |
| 1615 | ; | 1615 | ; |
| 1616 | else if (XFASTINT (*all_frames) == 0) | 1616 | else if (EQ (*all_frames, make_number (0))) |
| 1617 | ; | 1617 | ; |
| 1618 | else if (FRAMEP (*all_frames)) | 1618 | else if (FRAMEP (*all_frames)) |
| 1619 | ; | 1619 | ; |
| @@ -1887,7 +1887,7 @@ window_loop (type, obj, mini, frames) | |||
| 1887 | 1887 | ||
| 1888 | if (f) | 1888 | if (f) |
| 1889 | frame_arg = Qlambda; | 1889 | frame_arg = Qlambda; |
| 1890 | else if (XFASTINT (frames) == 0) | 1890 | else if (EQ (frames, make_number (0))) |
| 1891 | frame_arg = frames; | 1891 | frame_arg = frames; |
| 1892 | else if (EQ (frames, Qvisible)) | 1892 | else if (EQ (frames, Qvisible)) |
| 1893 | frame_arg = frames; | 1893 | frame_arg = frames; |
| @@ -2099,6 +2099,8 @@ DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, | |||
| 2099 | doc: /* Return the window least recently selected or used for display. | 2099 | doc: /* Return the window least recently selected or used for display. |
| 2100 | Return a full-width window if possible. | 2100 | Return a full-width window if possible. |
| 2101 | A minibuffer window is never a candidate. | 2101 | A minibuffer window is never a candidate. |
| 2102 | A dedicated window is never a candidate, so if all windows are dedicated, | ||
| 2103 | the value is nil. | ||
| 2102 | If optional argument FRAME is `visible', search all visible frames. | 2104 | If optional argument FRAME is `visible', search all visible frames. |
| 2103 | If FRAME is 0, search all visible and iconified frames. | 2105 | If FRAME is 0, search all visible and iconified frames. |
| 2104 | If FRAME is t, search all frames. | 2106 | If FRAME is t, search all frames. |
| @@ -2119,6 +2121,8 @@ If FRAME is a frame, search only that frame. */) | |||
| 2119 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, | 2121 | DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, |
| 2120 | doc: /* Return the largest window in area. | 2122 | doc: /* Return the largest window in area. |
| 2121 | A minibuffer window is never a candidate. | 2123 | A minibuffer window is never a candidate. |
| 2124 | A dedicated window is never a candidate, so if all windows are dedicated, | ||
| 2125 | the value is nil. | ||
| 2122 | If optional argument FRAME is `visible', search all visible frames. | 2126 | If optional argument FRAME is `visible', search all visible frames. |
| 2123 | If FRAME is 0, search all visible and iconified frames. | 2127 | If FRAME is 0, search all visible and iconified frames. |
| 2124 | If FRAME is t, search all frames. | 2128 | If FRAME is t, search all frames. |
| @@ -2696,7 +2700,7 @@ shrink_windows (total, size, nchildren, shrinkable, | |||
| 2696 | ++nonzero_sizes; | 2700 | ++nonzero_sizes; |
| 2697 | nonzero_idx = i; | 2701 | nonzero_idx = i; |
| 2698 | } | 2702 | } |
| 2699 | 2703 | ||
| 2700 | for (i = 0; i < nchildren; ++i) | 2704 | for (i = 0; i < nchildren; ++i) |
| 2701 | if (new_sizes[i] > min_size) | 2705 | if (new_sizes[i] > min_size) |
| 2702 | { | 2706 | { |
| @@ -3014,6 +3018,9 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) | |||
| 3014 | if (EQ (window, selected_window)) | 3018 | if (EQ (window, selected_window)) |
| 3015 | b->last_selected_window = window; | 3019 | b->last_selected_window = window; |
| 3016 | 3020 | ||
| 3021 | /* Let redisplay errors through. */ | ||
| 3022 | b->display_error_modiff = 0; | ||
| 3023 | |||
| 3017 | /* Update time stamps of buffer display. */ | 3024 | /* Update time stamps of buffer display. */ |
| 3018 | if (INTEGERP (b->display_count)) | 3025 | if (INTEGERP (b->display_count)) |
| 3019 | XSETINT (b->display_count, XINT (b->display_count) + 1); | 3026 | XSETINT (b->display_count, XINT (b->display_count) + 1); |
| @@ -6180,10 +6187,12 @@ If TYPE is t, use the frame's scroll-bar type. */) | |||
| 6180 | struct window *w = decode_window (window); | 6187 | struct window *w = decode_window (window); |
| 6181 | 6188 | ||
| 6182 | if (!NILP (width)) | 6189 | if (!NILP (width)) |
| 6183 | CHECK_NATNUM (width); | 6190 | { |
| 6191 | CHECK_NATNUM (width); | ||
| 6184 | 6192 | ||
| 6185 | if (XINT (width) == 0) | 6193 | if (XINT (width) == 0) |
| 6186 | vertical_type = Qnil; | 6194 | vertical_type = Qnil; |
| 6195 | } | ||
| 6187 | 6196 | ||
| 6188 | if (!(EQ (vertical_type, Qnil) | 6197 | if (!(EQ (vertical_type, Qnil) |
| 6189 | || EQ (vertical_type, Qleft) | 6198 | || EQ (vertical_type, Qleft) |
diff --git a/src/xdisp.c b/src/xdisp.c index a872366f31b..eef40a1b5e4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -803,7 +803,7 @@ static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; | |||
| 803 | 803 | ||
| 804 | /* Function prototypes. */ | 804 | /* Function prototypes. */ |
| 805 | 805 | ||
| 806 | static void setup_for_ellipsis P_ ((struct it *)); | 806 | static void setup_for_ellipsis P_ ((struct it *, int)); |
| 807 | static void mark_window_display_accurate_1 P_ ((struct window *, int)); | 807 | static void mark_window_display_accurate_1 P_ ((struct window *, int)); |
| 808 | static int single_display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); | 808 | static int single_display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); |
| 809 | static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); | 809 | static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object)); |
| @@ -3223,7 +3223,7 @@ handle_invisible_prop (it) | |||
| 3223 | it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p; | 3223 | it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p; |
| 3224 | } | 3224 | } |
| 3225 | else if (display_ellipsis_p) | 3225 | else if (display_ellipsis_p) |
| 3226 | setup_for_ellipsis (it); | 3226 | setup_for_ellipsis (it, 0); |
| 3227 | } | 3227 | } |
| 3228 | } | 3228 | } |
| 3229 | 3229 | ||
| @@ -3231,14 +3231,17 @@ handle_invisible_prop (it) | |||
| 3231 | } | 3231 | } |
| 3232 | 3232 | ||
| 3233 | 3233 | ||
| 3234 | /* Make iterator IT return `...' next. */ | 3234 | /* Make iterator IT return `...' next. |
| 3235 | Replaces LEN characters from buffer. */ | ||
| 3235 | 3236 | ||
| 3236 | static void | 3237 | static void |
| 3237 | setup_for_ellipsis (it) | 3238 | setup_for_ellipsis (it, len) |
| 3238 | struct it *it; | 3239 | struct it *it; |
| 3240 | int len; | ||
| 3239 | { | 3241 | { |
| 3240 | if (it->dp | 3242 | /* Use the display table definition for `...'. Invalid glyphs |
| 3241 | && VECTORP (DISP_INVIS_VECTOR (it->dp))) | 3243 | will be handled by the method returning elements from dpvec. */ |
| 3244 | if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp))) | ||
| 3242 | { | 3245 | { |
| 3243 | struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); | 3246 | struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); |
| 3244 | it->dpvec = v->contents; | 3247 | it->dpvec = v->contents; |
| @@ -3251,12 +3254,12 @@ setup_for_ellipsis (it) | |||
| 3251 | it->dpend = default_invis_vector + 3; | 3254 | it->dpend = default_invis_vector + 3; |
| 3252 | } | 3255 | } |
| 3253 | 3256 | ||
| 3254 | /* The ellipsis display does not replace the display of the | 3257 | it->dpvec_char_len = len; |
| 3255 | character at the new position. Indicate this by setting | ||
| 3256 | IT->dpvec_char_len to zero. */ | ||
| 3257 | it->dpvec_char_len = 0; | ||
| 3258 | |||
| 3259 | it->current.dpvec_index = 0; | 3258 | it->current.dpvec_index = 0; |
| 3259 | |||
| 3260 | /* Remember the current face id in case glyphs specify faces. | ||
| 3261 | IT's face is restored in set_iterator_to_next. */ | ||
| 3262 | it->saved_face_id = it->face_id; | ||
| 3260 | it->method = next_element_from_display_vector; | 3263 | it->method = next_element_from_display_vector; |
| 3261 | } | 3264 | } |
| 3262 | 3265 | ||
| @@ -3571,7 +3574,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3571 | || EQ (XCAR (prop), Qright_fringe)) | 3574 | || EQ (XCAR (prop), Qright_fringe)) |
| 3572 | && CONSP (XCDR (prop))) | 3575 | && CONSP (XCDR (prop))) |
| 3573 | { | 3576 | { |
| 3574 | unsigned face_id = DEFAULT_FACE_ID; | 3577 | int face_id = DEFAULT_FACE_ID; |
| 3575 | int fringe_bitmap; | 3578 | int fringe_bitmap; |
| 3576 | 3579 | ||
| 3577 | /* Save current settings of IT so that we can restore them | 3580 | /* Save current settings of IT so that we can restore them |
| @@ -3590,10 +3593,9 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3590 | if (CONSP (XCDR (XCDR (prop)))) | 3593 | if (CONSP (XCDR (XCDR (prop)))) |
| 3591 | { | 3594 | { |
| 3592 | Lisp_Object face_name = XCAR (XCDR (XCDR (prop))); | 3595 | Lisp_Object face_name = XCAR (XCDR (XCDR (prop))); |
| 3593 | 3596 | int face_id2 = lookup_named_face (it->f, face_name, 'A', 0); | |
| 3594 | face_id = lookup_named_face (it->f, face_name, 'A'); | 3597 | if (face_id2 >= 0) |
| 3595 | if (face_id < 0) | 3598 | face_id = face_id2; |
| 3596 | return 0; | ||
| 3597 | } | 3599 | } |
| 3598 | 3600 | ||
| 3599 | push_it (it); | 3601 | push_it (it); |
| @@ -4048,7 +4050,7 @@ next_overlay_string (it) | |||
| 4048 | /* If we have to display `...' for invisible text, set | 4050 | /* If we have to display `...' for invisible text, set |
| 4049 | the iterator up for that. */ | 4051 | the iterator up for that. */ |
| 4050 | if (display_ellipsis_p) | 4052 | if (display_ellipsis_p) |
| 4051 | setup_for_ellipsis (it); | 4053 | setup_for_ellipsis (it, 0); |
| 4052 | } | 4054 | } |
| 4053 | else | 4055 | else |
| 4054 | { | 4056 | { |
| @@ -4840,7 +4842,10 @@ get_next_display_element (it) | |||
| 4840 | we hit the end of what we iterate over. Performance note: the | 4842 | we hit the end of what we iterate over. Performance note: the |
| 4841 | function pointer `method' used here turns out to be faster than | 4843 | function pointer `method' used here turns out to be faster than |
| 4842 | using a sequence of if-statements. */ | 4844 | using a sequence of if-statements. */ |
| 4843 | int success_p = (*it->method) (it); | 4845 | int success_p; |
| 4846 | |||
| 4847 | get_next: | ||
| 4848 | success_p = (*it->method) (it); | ||
| 4844 | 4849 | ||
| 4845 | if (it->what == IT_CHARACTER) | 4850 | if (it->what == IT_CHARACTER) |
| 4846 | { | 4851 | { |
| @@ -4872,14 +4877,14 @@ get_next_display_element (it) | |||
| 4872 | it->dpvec = v->contents; | 4877 | it->dpvec = v->contents; |
| 4873 | it->dpend = v->contents + v->size; | 4878 | it->dpend = v->contents + v->size; |
| 4874 | it->current.dpvec_index = 0; | 4879 | it->current.dpvec_index = 0; |
| 4880 | it->saved_face_id = it->face_id; | ||
| 4875 | it->method = next_element_from_display_vector; | 4881 | it->method = next_element_from_display_vector; |
| 4876 | success_p = get_next_display_element (it); | ||
| 4877 | } | 4882 | } |
| 4878 | else | 4883 | else |
| 4879 | { | 4884 | { |
| 4880 | set_iterator_to_next (it, 0); | 4885 | set_iterator_to_next (it, 0); |
| 4881 | success_p = get_next_display_element (it); | ||
| 4882 | } | 4886 | } |
| 4887 | goto get_next; | ||
| 4883 | } | 4888 | } |
| 4884 | 4889 | ||
| 4885 | /* Translate control characters into `\003' or `^C' form. | 4890 | /* Translate control characters into `\003' or `^C' form. |
| @@ -4915,6 +4920,7 @@ get_next_display_element (it) | |||
| 4915 | IT->ctl_chars with glyphs for what we have to | 4920 | IT->ctl_chars with glyphs for what we have to |
| 4916 | display. Then, set IT->dpvec to these glyphs. */ | 4921 | display. Then, set IT->dpvec to these glyphs. */ |
| 4917 | GLYPH g; | 4922 | GLYPH g; |
| 4923 | int ctl_len; | ||
| 4918 | 4924 | ||
| 4919 | if (it->c < 128 && it->ctl_arrow_p) | 4925 | if (it->c < 128 && it->ctl_arrow_p) |
| 4920 | { | 4926 | { |
| @@ -4929,14 +4935,7 @@ get_next_display_element (it) | |||
| 4929 | 4935 | ||
| 4930 | g = FAST_MAKE_GLYPH (it->c ^ 0100, 0); | 4936 | g = FAST_MAKE_GLYPH (it->c ^ 0100, 0); |
| 4931 | XSETINT (it->ctl_chars[1], g); | 4937 | XSETINT (it->ctl_chars[1], g); |
| 4932 | 4938 | ctl_len = 2; | |
| 4933 | /* Set up IT->dpvec and return first character from it. */ | ||
| 4934 | it->dpvec_char_len = it->len; | ||
| 4935 | it->dpvec = it->ctl_chars; | ||
| 4936 | it->dpend = it->dpvec + 2; | ||
| 4937 | it->current.dpvec_index = 0; | ||
| 4938 | it->method = next_element_from_display_vector; | ||
| 4939 | get_next_display_element (it); | ||
| 4940 | } | 4939 | } |
| 4941 | else | 4940 | else |
| 4942 | { | 4941 | { |
| @@ -4985,16 +4984,17 @@ get_next_display_element (it) | |||
| 4985 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0); | 4984 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0); |
| 4986 | XSETINT (it->ctl_chars[i * 4 + 3], g); | 4985 | XSETINT (it->ctl_chars[i * 4 + 3], g); |
| 4987 | } | 4986 | } |
| 4988 | 4987 | ctl_len = len * 4; | |
| 4989 | /* Set up IT->dpvec and return the first character | ||
| 4990 | from it. */ | ||
| 4991 | it->dpvec_char_len = it->len; | ||
| 4992 | it->dpvec = it->ctl_chars; | ||
| 4993 | it->dpend = it->dpvec + len * 4; | ||
| 4994 | it->current.dpvec_index = 0; | ||
| 4995 | it->method = next_element_from_display_vector; | ||
| 4996 | get_next_display_element (it); | ||
| 4997 | } | 4988 | } |
| 4989 | |||
| 4990 | /* Set up IT->dpvec and return first character from it. */ | ||
| 4991 | it->dpvec_char_len = it->len; | ||
| 4992 | it->dpvec = it->ctl_chars; | ||
| 4993 | it->dpend = it->dpvec + ctl_len; | ||
| 4994 | it->current.dpvec_index = 0; | ||
| 4995 | it->saved_face_id = it->face_id; | ||
| 4996 | it->method = next_element_from_display_vector; | ||
| 4997 | goto get_next; | ||
| 4998 | } | 4998 | } |
| 4999 | } | 4999 | } |
| 5000 | 5000 | ||
| @@ -5184,11 +5184,14 @@ set_iterator_to_next (it, reseat_p) | |||
| 5184 | && IT_STRING_CHARPOS (*it) >= 0)); | 5184 | && IT_STRING_CHARPOS (*it) >= 0)); |
| 5185 | } | 5185 | } |
| 5186 | 5186 | ||
| 5187 | |||
| 5188 | /* Load IT's display element fields with information about the next | 5187 | /* Load IT's display element fields with information about the next |
| 5189 | display element which comes from a display table entry or from the | 5188 | display element which comes from a display table entry or from the |
| 5190 | result of translating a control character to one of the forms `^C' | 5189 | result of translating a control character to one of the forms `^C' |
| 5191 | or `\003'. IT->dpvec holds the glyphs to return as characters. */ | 5190 | or `\003'. |
| 5191 | |||
| 5192 | IT->dpvec holds the glyphs to return as characters. | ||
| 5193 | IT->saved_face_id holds the face id before the display vector-- | ||
| 5194 | it is restored into IT->face_idin set_iterator_to_next. */ | ||
| 5192 | 5195 | ||
| 5193 | static int | 5196 | static int |
| 5194 | next_element_from_display_vector (it) | 5197 | next_element_from_display_vector (it) |
| @@ -5197,10 +5200,6 @@ next_element_from_display_vector (it) | |||
| 5197 | /* Precondition. */ | 5200 | /* Precondition. */ |
| 5198 | xassert (it->dpvec && it->current.dpvec_index >= 0); | 5201 | xassert (it->dpvec && it->current.dpvec_index >= 0); |
| 5199 | 5202 | ||
| 5200 | /* Remember the current face id in case glyphs specify faces. | ||
| 5201 | IT's face is restored in set_iterator_to_next. */ | ||
| 5202 | it->saved_face_id = it->face_id; | ||
| 5203 | |||
| 5204 | if (INTEGERP (*it->dpvec) | 5203 | if (INTEGERP (*it->dpvec) |
| 5205 | && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) | 5204 | && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) |
| 5206 | { | 5205 | { |
| @@ -5384,28 +5383,7 @@ next_element_from_ellipsis (it) | |||
| 5384 | struct it *it; | 5383 | struct it *it; |
| 5385 | { | 5384 | { |
| 5386 | if (it->selective_display_ellipsis_p) | 5385 | if (it->selective_display_ellipsis_p) |
| 5387 | { | 5386 | setup_for_ellipsis (it, it->len); |
| 5388 | if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp))) | ||
| 5389 | { | ||
| 5390 | /* Use the display table definition for `...'. Invalid glyphs | ||
| 5391 | will be handled by the method returning elements from dpvec. */ | ||
| 5392 | struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); | ||
| 5393 | it->dpvec_char_len = it->len; | ||
| 5394 | it->dpvec = v->contents; | ||
| 5395 | it->dpend = v->contents + v->size; | ||
| 5396 | it->current.dpvec_index = 0; | ||
| 5397 | it->method = next_element_from_display_vector; | ||
| 5398 | } | ||
| 5399 | else | ||
| 5400 | { | ||
| 5401 | /* Use default `...' which is stored in default_invis_vector. */ | ||
| 5402 | it->dpvec_char_len = it->len; | ||
| 5403 | it->dpvec = default_invis_vector; | ||
| 5404 | it->dpend = default_invis_vector + 3; | ||
| 5405 | it->current.dpvec_index = 0; | ||
| 5406 | it->method = next_element_from_display_vector; | ||
| 5407 | } | ||
| 5408 | } | ||
| 5409 | else | 5387 | else |
| 5410 | { | 5388 | { |
| 5411 | /* The face at the current position may be different from the | 5389 | /* The face at the current position may be different from the |
| @@ -5776,8 +5754,6 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5776 | result = MOVE_NEWLINE_OR_CR; | 5754 | result = MOVE_NEWLINE_OR_CR; |
| 5777 | break; | 5755 | break; |
| 5778 | } | 5756 | } |
| 5779 | if (it->method == next_element_from_display_vector) | ||
| 5780 | it->face_id = it->saved_face_id; | ||
| 5781 | } | 5757 | } |
| 5782 | #endif /* HAVE_WINDOW_SYSTEM */ | 5758 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5783 | } | 5759 | } |
| @@ -14538,7 +14514,9 @@ highlight_trailing_whitespace (f, row) | |||
| 14538 | && glyph->u.ch == ' ')) | 14514 | && glyph->u.ch == ' ')) |
| 14539 | && trailing_whitespace_p (glyph->charpos)) | 14515 | && trailing_whitespace_p (glyph->charpos)) |
| 14540 | { | 14516 | { |
| 14541 | int face_id = lookup_named_face (f, Qtrailing_whitespace, 0); | 14517 | int face_id = lookup_named_face (f, Qtrailing_whitespace, 0, 0); |
| 14518 | if (face_id < 0) | ||
| 14519 | return; | ||
| 14542 | 14520 | ||
| 14543 | while (glyph >= start | 14521 | while (glyph >= start |
| 14544 | && BUFFERP (glyph->object) | 14522 | && BUFFERP (glyph->object) |
| @@ -14631,8 +14609,10 @@ display_line (it) | |||
| 14631 | hscrolled. This may stop at an x-position < IT->first_visible_x | 14609 | hscrolled. This may stop at an x-position < IT->first_visible_x |
| 14632 | if the first glyph is partially visible or if we hit a line end. */ | 14610 | if the first glyph is partially visible or if we hit a line end. */ |
| 14633 | if (it->current_x < it->first_visible_x) | 14611 | if (it->current_x < it->first_visible_x) |
| 14634 | move_it_in_display_line_to (it, ZV, it->first_visible_x, | 14612 | { |
| 14635 | MOVE_TO_POS | MOVE_TO_X); | 14613 | move_it_in_display_line_to (it, ZV, it->first_visible_x, |
| 14614 | MOVE_TO_POS | MOVE_TO_X); | ||
| 14615 | } | ||
| 14636 | 14616 | ||
| 14637 | /* Get the initial row height. This is either the height of the | 14617 | /* Get the initial row height. This is either the height of the |
| 14638 | text hscrolled, if there is any, or zero. */ | 14618 | text hscrolled, if there is any, or zero. */ |
| @@ -14791,8 +14771,6 @@ display_line (it) | |||
| 14791 | row->continued_p = 0; | 14771 | row->continued_p = 0; |
| 14792 | row->exact_window_width_line_p = 1; | 14772 | row->exact_window_width_line_p = 1; |
| 14793 | } | 14773 | } |
| 14794 | else if (it->method == next_element_from_display_vector) | ||
| 14795 | it->face_id = it->saved_face_id; | ||
| 14796 | } | 14774 | } |
| 14797 | #endif /* HAVE_WINDOW_SYSTEM */ | 14775 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 14798 | } | 14776 | } |
| @@ -18812,7 +18790,7 @@ calc_line_height_property (it, prop, font, boff, total) | |||
| 18812 | struct face *face; | 18790 | struct face *face; |
| 18813 | struct font_info *font_info; | 18791 | struct font_info *font_info; |
| 18814 | 18792 | ||
| 18815 | face_id = lookup_named_face (it->f, face_name, ' '); | 18793 | face_id = lookup_named_face (it->f, face_name, ' ', 0); |
| 18816 | if (face_id < 0) | 18794 | if (face_id < 0) |
| 18817 | return make_number (-1); | 18795 | return make_number (-1); |
| 18818 | 18796 | ||
diff --git a/src/xfaces.c b/src/xfaces.c index b8b946bea47..eb5f617b4a1 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -3012,7 +3012,7 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 3012 | { | 3012 | { |
| 3013 | /* This is of limited utility since it works with character | 3013 | /* This is of limited utility since it works with character |
| 3014 | widths. Keep it for compatibility. --gerd. */ | 3014 | widths. Keep it for compatibility. --gerd. */ |
| 3015 | int face_id = lookup_named_face (f, face, 0); | 3015 | int face_id = lookup_named_face (f, face, 0, 0); |
| 3016 | struct face *face = (face_id < 0 | 3016 | struct face *face = (face_id < 0 |
| 3017 | ? NULL | 3017 | ? NULL |
| 3018 | : FACE_FROM_ID (f, face_id)); | 3018 | : FACE_FROM_ID (f, face_id)); |
| @@ -4926,7 +4926,7 @@ If FRAME is omitted or nil, use the selected frame. */) | |||
| 4926 | else | 4926 | else |
| 4927 | { | 4927 | { |
| 4928 | struct frame *f = frame_or_selected_frame (frame, 1); | 4928 | struct frame *f = frame_or_selected_frame (frame, 1); |
| 4929 | int face_id = lookup_named_face (f, face, 0); | 4929 | int face_id = lookup_named_face (f, face, 0, 1); |
| 4930 | struct face *face = FACE_FROM_ID (f, face_id); | 4930 | struct face *face = FACE_FROM_ID (f, face_id); |
| 4931 | return face ? build_string (face->font_name) : Qnil; | 4931 | return face ? build_string (face->font_name) : Qnil; |
| 4932 | } | 4932 | } |
| @@ -5618,10 +5618,11 @@ lookup_face (f, attr, c, base_face) | |||
| 5618 | isn't realized and cannot be realized. */ | 5618 | isn't realized and cannot be realized. */ |
| 5619 | 5619 | ||
| 5620 | int | 5620 | int |
| 5621 | lookup_named_face (f, symbol, c) | 5621 | lookup_named_face (f, symbol, c, signal_p) |
| 5622 | struct frame *f; | 5622 | struct frame *f; |
| 5623 | Lisp_Object symbol; | 5623 | Lisp_Object symbol; |
| 5624 | int c; | 5624 | int c; |
| 5625 | int signal_p; | ||
| 5625 | { | 5626 | { |
| 5626 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 5627 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 5627 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; | 5628 | Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE]; |
| @@ -5634,7 +5635,9 @@ lookup_named_face (f, symbol, c) | |||
| 5634 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 5635 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 5635 | } | 5636 | } |
| 5636 | 5637 | ||
| 5637 | get_lface_attributes (f, symbol, symbol_attrs, 1); | 5638 | if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p)) |
| 5639 | return -1; | ||
| 5640 | |||
| 5638 | bcopy (default_face->lface, attrs, sizeof attrs); | 5641 | bcopy (default_face->lface, attrs, sizeof attrs); |
| 5639 | merge_face_vectors (f, symbol_attrs, attrs, 0); | 5642 | merge_face_vectors (f, symbol_attrs, attrs, 0); |
| 5640 | 5643 | ||
| @@ -5655,7 +5658,7 @@ ascii_face_of_lisp_face (f, lface_id) | |||
| 5655 | if (lface_id >= 0 && lface_id < lface_id_to_name_size) | 5658 | if (lface_id >= 0 && lface_id < lface_id_to_name_size) |
| 5656 | { | 5659 | { |
| 5657 | Lisp_Object face_name = lface_id_to_name[lface_id]; | 5660 | Lisp_Object face_name = lface_id_to_name[lface_id]; |
| 5658 | face_id = lookup_named_face (f, face_name, 0); | 5661 | face_id = lookup_named_face (f, face_name, 0, 1); |
| 5659 | } | 5662 | } |
| 5660 | else | 5663 | else |
| 5661 | face_id = -1; | 5664 | face_id = -1; |
diff --git a/src/xfns.c b/src/xfns.c index a99f3ddd1b8..1679cc1c21d 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -152,6 +152,10 @@ char *gray_bitmap_bits = gray_bits; | |||
| 152 | 152 | ||
| 153 | int display_hourglass_p; | 153 | int display_hourglass_p; |
| 154 | 154 | ||
| 155 | /* Non-zero means prompt with the old GTK file selection dialog. */ | ||
| 156 | |||
| 157 | int x_use_old_gtk_file_dialog; | ||
| 158 | |||
| 155 | /* The background and shape of the mouse pointer, and shape when not | 159 | /* The background and shape of the mouse pointer, and shape when not |
| 156 | over text or in the modeline. */ | 160 | over text or in the modeline. */ |
| 157 | 161 | ||
| @@ -5598,6 +5602,14 @@ such a font. This is especially effective for such large fonts as | |||
| 5598 | Chinese, Japanese, and Korean. */); | 5602 | Chinese, Japanese, and Korean. */); |
| 5599 | Vx_pixel_size_width_font_regexp = Qnil; | 5603 | Vx_pixel_size_width_font_regexp = Qnil; |
| 5600 | 5604 | ||
| 5605 | /* This is not ifdef:ed, so other builds than GTK can customize it. */ | ||
| 5606 | DEFVAR_BOOL ("x-use-old-gtk-file-dialog", &x_use_old_gtk_file_dialog, | ||
| 5607 | doc: /* *Non-nil means prompt with the old GTK file selection dialog. | ||
| 5608 | If nil or if the file selection dialog is not available, the new GTK file | ||
| 5609 | chooser is used instead. To turn off all file dialogs set the | ||
| 5610 | variable `use-file-dialog'. */); | ||
| 5611 | x_use_old_gtk_file_dialog = 0; | ||
| 5612 | |||
| 5601 | #ifdef USE_X_TOOLKIT | 5613 | #ifdef USE_X_TOOLKIT |
| 5602 | Fprovide (intern ("x-toolkit"), Qnil); | 5614 | Fprovide (intern ("x-toolkit"), Qnil); |
| 5603 | #ifdef USE_MOTIF | 5615 | #ifdef USE_MOTIF |
| @@ -5617,14 +5629,6 @@ Chinese, Japanese, and Korean. */); | |||
| 5617 | Fprovide (intern ("x-toolkit"), Qnil); | 5629 | Fprovide (intern ("x-toolkit"), Qnil); |
| 5618 | Fprovide (intern ("gtk"), Qnil); | 5630 | Fprovide (intern ("gtk"), Qnil); |
| 5619 | 5631 | ||
| 5620 | #ifdef HAVE_GTK_FILE_BOTH | ||
| 5621 | DEFVAR_BOOL ("use-old-gtk-file-dialog", &use_old_gtk_file_dialog, | ||
| 5622 | doc: /* *Non-nil means that the old GTK file selection dialog is used. | ||
| 5623 | If nil the new GTK file chooser is used instead. To turn off | ||
| 5624 | all file dialogs set the variable `use-file-dialog'. */); | ||
| 5625 | use_old_gtk_file_dialog = 0; | ||
| 5626 | #endif | ||
| 5627 | |||
| 5628 | DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string, | 5632 | DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string, |
| 5629 | doc: /* Version info for GTK+. */); | 5633 | doc: /* Version info for GTK+. */); |
| 5630 | { | 5634 | { |
diff --git a/src/xmenu.c b/src/xmenu.c index f50237ea8c8..45b0742df0e 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -741,8 +741,7 @@ POSITION is a position specification. This is either a mouse button event | |||
| 741 | or a list ((XOFFSET YOFFSET) WINDOW) | 741 | or a list ((XOFFSET YOFFSET) WINDOW) |
| 742 | where XOFFSET and YOFFSET are positions in pixels from the top left | 742 | where XOFFSET and YOFFSET are positions in pixels from the top left |
| 743 | corner of WINDOW's frame. (WINDOW may be a frame object instead of a window.) | 743 | corner of WINDOW's frame. (WINDOW may be a frame object instead of a window.) |
| 744 | This controls the position of the center of the first line | 744 | This controls the position of the top left of the menu as a whole. |
| 745 | in the first pane of the menu, not the top left of the menu as a whole. | ||
| 746 | If POSITION is t, it means to use the current mouse position. | 745 | If POSITION is t, it means to use the current mouse position. |
| 747 | 746 | ||
| 748 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap. | 747 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap. |
| @@ -3256,7 +3255,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3256 | char *datap; | 3255 | char *datap; |
| 3257 | int ulx, uly, width, height; | 3256 | int ulx, uly, width, height; |
| 3258 | int dispwidth, dispheight; | 3257 | int dispwidth, dispheight; |
| 3259 | int i, j; | 3258 | int i, j, lines, maxlines; |
| 3260 | int maxwidth; | 3259 | int maxwidth; |
| 3261 | int dummy_int; | 3260 | int dummy_int; |
| 3262 | unsigned int dummy_uint; | 3261 | unsigned int dummy_uint; |
| @@ -3287,31 +3286,8 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3287 | 3286 | ||
| 3288 | #ifdef HAVE_X_WINDOWS | 3287 | #ifdef HAVE_X_WINDOWS |
| 3289 | /* Adjust coordinates to relative to the outer (window manager) window. */ | 3288 | /* Adjust coordinates to relative to the outer (window manager) window. */ |
| 3290 | { | 3289 | x += FRAME_OUTER_TO_INNER_DIFF_X (f); |
| 3291 | Window child; | 3290 | y += FRAME_OUTER_TO_INNER_DIFF_Y (f); |
| 3292 | int win_x = 0, win_y = 0; | ||
| 3293 | |||
| 3294 | /* Find the position of the outside upper-left corner of | ||
| 3295 | the inner window, with respect to the outer window. */ | ||
| 3296 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | ||
| 3297 | { | ||
| 3298 | BLOCK_INPUT; | ||
| 3299 | XTranslateCoordinates (FRAME_X_DISPLAY (f), | ||
| 3300 | |||
| 3301 | /* From-window, to-window. */ | ||
| 3302 | f->output_data.x->window_desc, | ||
| 3303 | f->output_data.x->parent_desc, | ||
| 3304 | |||
| 3305 | /* From-position, to-position. */ | ||
| 3306 | 0, 0, &win_x, &win_y, | ||
| 3307 | |||
| 3308 | /* Child of window. */ | ||
| 3309 | &child); | ||
| 3310 | UNBLOCK_INPUT; | ||
| 3311 | x += win_x; | ||
| 3312 | y += win_y; | ||
| 3313 | } | ||
| 3314 | } | ||
| 3315 | #endif /* HAVE_X_WINDOWS */ | 3291 | #endif /* HAVE_X_WINDOWS */ |
| 3316 | 3292 | ||
| 3317 | /* Adjust coordinates to be root-window-relative. */ | 3293 | /* Adjust coordinates to be root-window-relative. */ |
| @@ -3319,7 +3295,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3319 | y += f->top_pos; | 3295 | y += f->top_pos; |
| 3320 | 3296 | ||
| 3321 | /* Create all the necessary panes and their items. */ | 3297 | /* Create all the necessary panes and their items. */ |
| 3322 | i = 0; | 3298 | maxlines = lines = i = 0; |
| 3323 | while (i < menu_items_used) | 3299 | while (i < menu_items_used) |
| 3324 | { | 3300 | { |
| 3325 | if (EQ (XVECTOR (menu_items)->contents[i], Qt)) | 3301 | if (EQ (XVECTOR (menu_items)->contents[i], Qt)) |
| @@ -3328,6 +3304,8 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3328 | Lisp_Object pane_name, prefix; | 3304 | Lisp_Object pane_name, prefix; |
| 3329 | char *pane_string; | 3305 | char *pane_string; |
| 3330 | 3306 | ||
| 3307 | maxlines = max (maxlines, lines); | ||
| 3308 | lines = 0; | ||
| 3331 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 3309 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
| 3332 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 3310 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
| 3333 | pane_string = (NILP (pane_name) | 3311 | pane_string = (NILP (pane_name) |
| @@ -3420,9 +3398,12 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3420 | return Qnil; | 3398 | return Qnil; |
| 3421 | } | 3399 | } |
| 3422 | i += MENU_ITEMS_ITEM_LENGTH; | 3400 | i += MENU_ITEMS_ITEM_LENGTH; |
| 3401 | lines++; | ||
| 3423 | } | 3402 | } |
| 3424 | } | 3403 | } |
| 3425 | 3404 | ||
| 3405 | maxlines = max (maxlines, lines); | ||
| 3406 | |||
| 3426 | /* All set and ready to fly. */ | 3407 | /* All set and ready to fly. */ |
| 3427 | XMenuRecompute (FRAME_X_DISPLAY (f), menu); | 3408 | XMenuRecompute (FRAME_X_DISPLAY (f), menu); |
| 3428 | dispwidth = DisplayWidth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)); | 3409 | dispwidth = DisplayWidth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)); |
| @@ -3446,6 +3427,15 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 3446 | if (ulx < 0) x -= ulx; | 3427 | if (ulx < 0) x -= ulx; |
| 3447 | if (uly < 0) y -= uly; | 3428 | if (uly < 0) y -= uly; |
| 3448 | 3429 | ||
| 3430 | if (! for_click) | ||
| 3431 | { | ||
| 3432 | /* If position was not given by a mouse click, adjust so upper left | ||
| 3433 | corner of the menu as a whole ends up at given coordinates. This | ||
| 3434 | is what x-popup-menu says in its documentation. */ | ||
| 3435 | x += width/2; | ||
| 3436 | y += 1.5*height/(maxlines+2); | ||
| 3437 | } | ||
| 3438 | |||
| 3449 | XMenuSetAEQ (menu, TRUE); | 3439 | XMenuSetAEQ (menu, TRUE); |
| 3450 | XMenuSetFreeze (menu, TRUE); | 3440 | XMenuSetFreeze (menu, TRUE); |
| 3451 | pane = selidx = 0; | 3441 | pane = selidx = 0; |