diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-08-11 07:42:48 +0200 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-08-11 07:42:48 +0200 |
commit | c566235d981eba73c88bbff00b6a1d88360b6e9f (patch) | |
tree | f8d653add3570fe750a83d1123ed35022e0bf4ef /src | |
parent | 0bfdb86f425a88fe43ebc88851c6f9a6418e1862 (diff) | |
parent | 490b89acab3e759426ede25c31c94268df55e925 (diff) | |
download | emacs-c566235d981eba73c88bbff00b6a1d88360b6e9f.tar.gz |
Merge from trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/.gdbinit | 3 | ||||
-rw-r--r-- | src/ChangeLog.10 | 18 | ||||
-rw-r--r-- | src/ChangeLog.2 | 36 | ||||
-rw-r--r-- | src/ChangeLog.3 | 2 | ||||
-rw-r--r-- | src/ChangeLog.5 | 64 | ||||
-rw-r--r-- | src/ChangeLog.6 | 2 | ||||
-rw-r--r-- | src/ChangeLog.9 | 52 | ||||
-rw-r--r-- | src/ChangeLog.trunk | 893 | ||||
-rw-r--r-- | src/alloc.c | 24 | ||||
-rw-r--r-- | src/bidi.c | 2 | ||||
-rw-r--r-- | src/buffer.c | 19 | ||||
-rw-r--r-- | src/callint.c | 11 | ||||
-rw-r--r-- | src/callproc.c | 21 | ||||
-rw-r--r-- | src/ccl.c | 2 | ||||
-rw-r--r-- | src/character.c | 6 | ||||
-rw-r--r-- | src/character.h | 4 | ||||
-rw-r--r-- | src/charset.c | 99 | ||||
-rw-r--r-- | src/charset.h | 2 | ||||
-rw-r--r-- | src/cmds.c | 12 | ||||
-rw-r--r-- | src/coding.c | 10 | ||||
-rw-r--r-- | src/coding.h | 3 | ||||
-rw-r--r-- | src/composite.c | 5 | ||||
-rw-r--r-- | src/config.in | 24 | ||||
-rw-r--r-- | src/data.c | 13 | ||||
-rw-r--r-- | src/deps.mk | 2 | ||||
-rw-r--r-- | src/dired.c | 32 | ||||
-rw-r--r-- | src/dispextern.h | 31 | ||||
-rw-r--r-- | src/dispnew.c | 22 | ||||
-rw-r--r-- | src/doc.c | 5 | ||||
-rw-r--r-- | src/ecrt0.c | 95 | ||||
-rw-r--r-- | src/editfns.c | 28 | ||||
-rw-r--r-- | src/emacs-icon.h | 2 | ||||
-rw-r--r-- | src/emacs.c | 51 | ||||
-rw-r--r-- | src/eval.c | 22 | ||||
-rw-r--r-- | src/fileio.c | 15 | ||||
-rw-r--r-- | src/filelock.c | 10 | ||||
-rw-r--r-- | src/floatfns.c | 4 | ||||
-rw-r--r-- | src/fns.c | 31 | ||||
-rw-r--r-- | src/font.c | 78 | ||||
-rw-r--r-- | src/font.h | 22 | ||||
-rw-r--r-- | src/fontset.c | 5 | ||||
-rw-r--r-- | src/fontset.h | 2 | ||||
-rw-r--r-- | src/frame.c | 57 | ||||
-rw-r--r-- | src/frame.h | 15 | ||||
-rw-r--r-- | src/fringe.c | 8 | ||||
-rw-r--r-- | src/ftfont.c | 22 | ||||
-rw-r--r-- | src/ftfont.h | 3 | ||||
-rw-r--r-- | src/gtkutil.c | 502 | ||||
-rw-r--r-- | src/gtkutil.h | 18 | ||||
-rw-r--r-- | src/image.c | 95 | ||||
-rw-r--r-- | src/indent.c | 1 | ||||
-rw-r--r-- | src/insdel.c | 16 | ||||
-rw-r--r-- | src/keyboard.c | 118 | ||||
-rw-r--r-- | src/keyboard.h | 50 | ||||
-rw-r--r-- | src/keymap.c | 21 | ||||
-rw-r--r-- | src/keymap.h | 11 | ||||
-rw-r--r-- | src/lisp.h | 125 | ||||
-rw-r--r-- | src/lread.c | 16 | ||||
-rw-r--r-- | src/m/alpha.h | 10 | ||||
-rw-r--r-- | src/m/amdx86-64.h | 4 | ||||
-rw-r--r-- | src/m/arm.h | 6 | ||||
-rw-r--r-- | src/m/hp800.h | 4 | ||||
-rw-r--r-- | src/m/ia64.h | 4 | ||||
-rw-r--r-- | src/m/ibmrs6000.h | 1 | ||||
-rw-r--r-- | src/m/ibms390.h | 4 | ||||
-rw-r--r-- | src/m/intel386.h | 6 | ||||
-rw-r--r-- | src/m/iris4d.h | 16 | ||||
-rw-r--r-- | src/m/m68k.h | 5 | ||||
-rw-r--r-- | src/m/macppc.h | 4 | ||||
-rw-r--r-- | src/m/mips.h | 6 | ||||
-rw-r--r-- | src/m/sh3.h | 4 | ||||
-rw-r--r-- | src/m/sparc.h | 7 | ||||
-rw-r--r-- | src/m/template.h | 10 | ||||
-rw-r--r-- | src/m/vax.h | 4 | ||||
-rw-r--r-- | src/m/xtensa.h | 6 | ||||
-rw-r--r-- | src/macros.c | 2 | ||||
-rw-r--r-- | src/makefile.w32-in | 1 | ||||
-rw-r--r-- | src/md5.c | 6 | ||||
-rw-r--r-- | src/mem-limits.h | 21 | ||||
-rw-r--r-- | src/menu.c | 8 | ||||
-rw-r--r-- | src/menu.h | 9 | ||||
-rw-r--r-- | src/minibuf.c | 14 | ||||
-rw-r--r-- | src/msdos.c | 9 | ||||
-rw-r--r-- | src/ndir.h | 9 | ||||
-rw-r--r-- | src/nsfns.m | 36 | ||||
-rw-r--r-- | src/nsfont.m | 4 | ||||
-rw-r--r-- | src/nsimage.m | 4 | ||||
-rw-r--r-- | src/nsmenu.m | 31 | ||||
-rw-r--r-- | src/nsterm.h | 33 | ||||
-rw-r--r-- | src/nsterm.m | 43 | ||||
-rw-r--r-- | src/print.c | 9 | ||||
-rw-r--r-- | src/process.c | 129 | ||||
-rw-r--r-- | src/process.h | 3 | ||||
-rw-r--r-- | src/ralloc.c | 33 | ||||
-rw-r--r-- | src/s/aix4-2.h | 5 | ||||
-rw-r--r-- | src/s/bsd-common.h | 2 | ||||
-rw-r--r-- | src/s/cygwin.h | 1 | ||||
-rw-r--r-- | src/s/freebsd.h | 1 | ||||
-rw-r--r-- | src/s/gnu-linux.h | 2 | ||||
-rw-r--r-- | src/s/hpux10-20.h | 6 | ||||
-rw-r--r-- | src/s/irix6-5.h | 4 | ||||
-rw-r--r-- | src/s/ms-w32.h | 4 | ||||
-rw-r--r-- | src/s/msdos.h | 8 | ||||
-rw-r--r-- | src/s/sol2-6.h | 4 | ||||
-rw-r--r-- | src/s/template.h | 5 | ||||
-rw-r--r-- | src/s/unixware.h | 4 | ||||
-rw-r--r-- | src/s/usg5-4-common.h (renamed from src/s/usg5-4.h) | 6 | ||||
-rw-r--r-- | src/search.c | 4 | ||||
-rw-r--r-- | src/sound.c | 33 | ||||
-rw-r--r-- | src/sysdep.c | 45 | ||||
-rw-r--r-- | src/syssignal.h | 30 | ||||
-rw-r--r-- | src/systime.h | 3 | ||||
-rw-r--r-- | src/term.c | 42 | ||||
-rw-r--r-- | src/terminfo.c | 6 | ||||
-rw-r--r-- | src/unexalpha.c | 539 | ||||
-rw-r--r-- | src/unexcoff.c (renamed from src/unexec.c) | 97 | ||||
-rw-r--r-- | src/unexelf.c | 2 | ||||
-rw-r--r-- | src/unexmacosx.c | 20 | ||||
-rw-r--r-- | src/vm-limit.c | 17 | ||||
-rw-r--r-- | src/w32.c | 4 | ||||
-rw-r--r-- | src/w32fns.c | 21 | ||||
-rw-r--r-- | src/w32font.c | 2 | ||||
-rw-r--r-- | src/w32gui.h | 2 | ||||
-rw-r--r-- | src/w32heap.h | 6 | ||||
-rw-r--r-- | src/w32menu.c | 32 | ||||
-rw-r--r-- | src/w32select.c | 1 | ||||
-rw-r--r-- | src/w32term.c | 2 | ||||
-rw-r--r-- | src/w32term.h | 32 | ||||
-rw-r--r-- | src/window.c | 20 | ||||
-rw-r--r-- | src/xdisp.c | 123 | ||||
-rw-r--r-- | src/xfaces.c | 33 | ||||
-rw-r--r-- | src/xfns.c | 138 | ||||
-rw-r--r-- | src/xfont.c | 12 | ||||
-rw-r--r-- | src/xftfont.c | 6 | ||||
-rw-r--r-- | src/xmenu.c | 32 | ||||
-rw-r--r-- | src/xrdb.c | 108 | ||||
-rw-r--r-- | src/xselect.c | 23 | ||||
-rw-r--r-- | src/xsettings.c | 3 | ||||
-rw-r--r-- | src/xsmfns.c | 4 | ||||
-rw-r--r-- | src/xterm.c | 70 | ||||
-rw-r--r-- | src/xterm.h | 67 |
141 files changed, 2586 insertions, 2412 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 1fd7e288736..b3bb6b58267 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -535,6 +535,9 @@ define pgx if ($g->overlaps_vertically_p) printf " OVL" end + if ($g->avoid_cursor_p) + printf " AVOID" + end if ($g->left_box_line_p) printf " [" end diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 24818e6770f..dd847f8a64e 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -3252,7 +3252,7 @@ 2006-07-02 Kim F. Storm <storm@cua.dk> * xdisp.c (display_tool_bar_line): Skip glyphs which are too big - to ever fit the tool-bar, + to ever fit the tool-bar. (MAX_FRAME_TOOL_BAR_HEIGHT): New macro. (tool_bar_lines_needed): Use unused mode-line row as temp_row. (redisplay_tool_bar): Only clear desired matrix if we actually @@ -7869,7 +7869,7 @@ 2005-07-19 Juanma Barranquero <lekktu@gmail.com> - * eval.c (Fprog2, Fcalled_interactively_p), + * eval.c (Fprog2, Fcalled_interactively_p) (syms_of_eval) <debug-on-quit>: Doc fixes. (syms_of_eval) <max-specpdl-size>: (Finteractive_p): Fix typos in docstrings. @@ -11250,7 +11250,7 @@ 2004-12-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * macterm.c (endif, x_font_name_to_mac_font_name): - Use maccentraleurroman instead of maccentraleuropean + Use maccentraleurroman instead of maccentraleuropean. (mac_c_string_match, mac_do_list_fonts): Speed up font search by quickly finding a specific font without needing regexps. @@ -12477,7 +12477,7 @@ * gtkutil.h (xg_frame_cleared): Remove. - * xterm.c (x_clear_frame): Remove call to xg_frame_cleared + * xterm.c (x_clear_frame): Remove call to xg_frame_cleared. (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove arguments left and width to xg_update_scrollbar_pos. (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. @@ -13017,9 +13017,9 @@ * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte strings in menu items. - (single_submenu): Use ENCODE_MENU_STRING + (single_submenu): Use ENCODE_MENU_STRING. (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because - button release isn't passed to event loop + button release isn't passed to event loop. (add_menu_item): Use SetMenuItemWithCFString. 2004-08-26 Steven Tamm <steventamm@mac.com> @@ -15407,7 +15407,7 @@ (Fxw_display_color_p): Use dpyinfo->color_p. (Fx_display_grayscale_p, Fx_display_planes): Don't use dpyinfo->n_cbits. - (Fx_display_color_cells): Use dpyinfo->n_planes; + (Fx_display_color_cells): Use dpyinfo->n_planes. (QCmatrix, QCcolor_adjustment, QCmask, Qemboss, Qedge_detection) (Qheuristic, cross_disabled_images, emboss_matrix) (laplace_matrix): New variables (from xfns.c). @@ -16414,7 +16414,7 @@ (append_glyph, append_composite_glyph, produce_image_glyph) (append_stretch_glyph): Set glyph's ascent and descent. (on_hot_spot_p): New function to check if position is inside an - rectangular, circular, or polygon-shaped image hot-spot, + rectangular, circular, or polygon-shaped image hot-spot. (find_hot_spot): New function to search for image hot-spot. (Flookup_image_map): New defun to search for image hot-spot. (define_frame_cursor1): New aux function to determine frame @@ -18570,7 +18570,7 @@ change/simplify relevant callers. (x_y_to_hpos_vpos): Adapt to per-window fringes and scroll bars, and new fringe vs. display margin position. - Use window_box_left_offset and window_box_right_offset + Use window_box_left_offset and window_box_right_offset. (get_glyph_string_clip_rect): Adapt to per-window fringes and scroll bars, and new fringe vs. display margin position. Use WINDOW_LEFT_EDGE_X and WINDOW_TOTAL_WIDTH. diff --git a/src/ChangeLog.2 b/src/ChangeLog.2 index 7313f56ae8e..f087802e27d 100644 --- a/src/ChangeLog.2 +++ b/src/ChangeLog.2 @@ -683,7 +683,7 @@ (That `select' saw something on channel 0 doesn't mean it is kbd input; it could be an expose event.) - * keyboard.c (read_avail_input) [FIONREAD]: Now static. + * keyboard.c (read_avail_input) [FIONREAD]: Now static. New arg specifies value of NREAD; if it is nonzero, don't call get_input_pending to get it. Use kbd_buffer_store_char to put chars into kbd_buffer. @@ -1210,7 +1210,7 @@ Remove #ifndef VMS around the sleep when buffer is full. * s-vms.h: Define nonstandard PENDING_OUTPUT_COUNT for VMS use. - * fileio.c (file_name_as_directory) [VMS]: Fix 3rd arg to strncmp. + * fileio.c (file_name_as_directory) [VMS]: Fix 3rd arg to strncmp. 1987-07-17 Paul Rubin (phr@prep) @@ -1323,7 +1323,7 @@ 1987-06-09 Richard M. Stallman (rms@prep) - * syntax.c: (scan_lists): Clear mathexit on 2nd math-char in a pair. + * syntax.c (scan_lists): Clear mathexit on 2nd math-char in a pair. 1987-06-08 Richard M. Stallman (rms@prep) @@ -1442,7 +1442,7 @@ Turn on call to vmserrstr. * sysdep.c (vmserrstr) [VMS]: Define this function. - * process.c (create_process) [IRIS]: Don't open the pty's tty + * process.c (create_process) [IRIS]: Don't open the pty's tty in the parent process. Open only once, in the child. * xdisp.c (redisplay_window): If window-start points nowhere, @@ -1544,8 +1544,8 @@ 1987-05-05 Richard Mlynarik (mly@prep) - * m-irist.h: New version from raible@orville.arpa - * s-iris3-5.h: New file. (s-usg5-2 with additions) + * m-irist.h: New version from raible@orville.arpa + * s-iris3-5.h: New file. (s-usg5-2 with additions) * keyboard.c: IRIS, like HPUX, #defines but does not implement FIONREAD. @@ -1566,7 +1566,7 @@ Fcopy_file, Fset_file_modes: Don't use un*x modes if env var USE_DOMAIN_ACLS is set. Fset_file_modes: utimes fix. - Finsert_file_contents: Must do fstat after open for Apollo. + Finsert_file_contents: Must do fstat after open for Apollo. * emacs.c (main): (APOLLO from lnz): Don't use un*x modes if env var USE_DOMAIN_ACLS set. @@ -1675,7 +1675,7 @@ 1987-03-20 Richard Mlynarik (mly@prep) - * filemode.c: Hacks for set-uid/gid but not executable. + * filemode.c: Hacks for set-uid/gid but not executable. 1987-03-20 Richard M. Stallman (rms@prep) @@ -1966,7 +1966,7 @@ 1987-02-22 Richard M. Stallman (rms@prep) - * dispnew.c (Fopen_termscript): Close existing termscript + * dispnew.c (Fopen_termscript): Close existing termscript file before trying to open a new one. Report open failure with report_file_error. @@ -2071,7 +2071,7 @@ 1987-02-10 Richard Mlynarik (mly@prep) - * xfns.c (Fx_get_default): Add (unsigned char *) cast. + * xfns.c (Fx_get_default): Add (unsigned char *) cast. * window.c: typo. @@ -2853,7 +2853,7 @@ local variables for more register decls. Compute and pass `envlen' arg to child_setup. - * process.c (create_process): Compute and pass `envlen' arg + * process.c (create_process): Compute and pass `envlen' arg to child_setup. * xterm.c (x_term_init): Don't call XPopUpWindow at all. @@ -3102,9 +3102,9 @@ [So (-259 . (259 . x)) means to format x -exactly- 259 chars wide.] * dispnew.c (Fding): - Do not terminate macro-definition if given an argument + Do not terminate macro-definition if given an argument. (This is so things like asynchronous process notifications - can beep but not screw) + can beep but not screw.) 1986-11-10 Richard M. Stallman (rms@prep) @@ -3998,7 +3998,7 @@ * editfns.c (Fuser_uid, Fuser_real_uid): New functions that return values of geteuid and getuid system calls. - * dired.c (Ffile_attributes): Value has additional element + * dired.c (Ffile_attributes): Value has additional element t iff file gid would change if Emacs deletes it and recreates it. * xdisp.c (display_mode_element): @@ -4078,7 +4078,7 @@ being unbound. struct catchtag has two new fields, gcpro and pdlcount. - * eval.c (Fthrow, Fsignal): Use unbind_catch before longjmp. + * eval.c (Fthrow, Fsignal): Use unbind_catch before longjmp. * eval.c (internal_catch): No need to restore anything from the catchtag after throw, because unbind_catch does it all. @@ -4657,14 +4657,14 @@ * fileio.c (Ffile_newer_than_file_p): New Lisp primitive. - * fileio.c (Ffile_exists_p): this is now distinct from + * fileio.c (Ffile_exists_p): This is now distinct from Ffile_readable_p; it checks only for existence, not for readability. * editfns.c (Fgoto_char): Use new interactive code N. - * callint.c (Fcall_interactively): New code N - means use prefix argif have one, else read number from minibuffer. + * callint.c (Fcall_interactively): New code N means use + prefix arg if have one, else read number from minibuffer. * buffer.c (record_buffer): Don't use Frassq, Fmemq or Fdelq since their loops diff --git a/src/ChangeLog.3 b/src/ChangeLog.3 index 241019b51c7..e3c5ab70f66 100644 --- a/src/ChangeLog.3 +++ b/src/ChangeLog.3 @@ -6993,7 +6993,7 @@ * keyboard.c (Qvertical_split): Renamed to `vertical-line', since the window arrangement is actually referred to as a - `horizontal split.' + `horizontal split'. (make_lispy_event, make_lispy_movement, syms_of_keyboard): Uses renamed here. * keyboard.h (Qvertical_split): Extern declaration changed here. diff --git a/src/ChangeLog.5 b/src/ChangeLog.5 index e4991971461..9be45e2fc54 100644 --- a/src/ChangeLog.5 +++ b/src/ChangeLog.5 @@ -176,7 +176,7 @@ 1995-06-12 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * mem-limits.h [_LIBC] (start_of_data): Define to &__data_start - for GNU libc. + for GNU libc. 1995-06-11 Richard Stallman <rms@gnu.ai.mit.edu> @@ -227,7 +227,7 @@ * xterm.c (x_get_keysym_name): New function. * keyboard.c (modify_event_symbol): Mask out high bits here, and only for certain purposes. table_size now unsigned. - (modify_event_symbol) [HAVE_X_WINDOWS]: Use x_get_keysym_name. + (modify_event_symbol) [HAVE_X_WINDOWS]: Use x_get_keysym_name. (make_lispy_event): Don't mask high bits here. Supply -1 as table_size for system-specific keys. @@ -316,9 +316,9 @@ (Fexecute_extended_command, init_kboard, syms_of_keyboard): Undo Feb 28 change; prefix arg handling is now in Lisp code again. - * buffer.c: (syms_of_buffer): Doc fix. + * buffer.c (syms_of_buffer): Doc fix. - * buffer.c: (Fbuffer_disable_undo): Make this function interactive. + * buffer.c (Fbuffer_disable_undo): Make this function interactive. 1995-06-07 Richard Stallman <rms@gnu.ai.mit.edu> @@ -335,7 +335,7 @@ (ALL_CFLAGS): Insert $(TOOLKIT_DEFINES) here. * xfns.c (syms_of_xfns): Provide motif in Motif version. - * lisp.h: (Fwaiting_for_user_input_p): Function declared. + * lisp.h (Fwaiting_for_user_input_p): Function declared. (Fupcase_initials, Fupcase_initials_region): Likewise. (Fplist_get, get_local_map, Fx_popup_menu, Fx_popup_dialog): Likewise. (Fframe_first_window): Likewise. @@ -387,7 +387,7 @@ based on frame name and icon_name fields. (x_set_icon_name): New function. (x_icon): Call x_text_icon. - (x_set_name): Look at icon_name field when setting the icon name, + (x_set_name): Look at icon_name field when setting the icon name. (x_frame_parms): Add icon-name. (syms_of_xfns): Set up Qicon_name. @@ -849,7 +849,7 @@ 1995-05-07 Richard Stallman <rms@mole.gnu.ai.mit.edu> * process.c (wait_reading_process_input): Pass arg in new call to - set_waiting_for_input. + set_waiting_for_input. * xfns.c (Funfocus_frame): Check for live X frame. @@ -903,7 +903,7 @@ 1995-05-04 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * s/freebsd.h: (GETPGRP_NO_ARG): Defined + * s/freebsd.h (GETPGRP_NO_ARG): Define. (HAVE_GETPAGESIZE): Definition deleted. * data.c (store_symval_forwarding): Error if value out of range @@ -1308,7 +1308,7 @@ * ntinevt.c (do_mouse_event): Use XSETFASTINT. (SET_FRAME): Undefined. - (select): Renamed to sys_select to correspond to routine in sysdep.c + (select): Renamed to sys_select to correspond to routine in sysdep.c. (sys_select): Support struct timeval. (key_event): Support German keyboard. Replace SET_FRAME with XSETFRAME. @@ -1366,8 +1366,8 @@ 1995-04-11 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * process.c (create_process): Set PROCESS's tty_name to Qnil when - !PTY_FLAG, so Fprocess_tty_name returns nil for pipes as its - docstring says. + !PTY_FLAG, so Fprocess_tty_name returns nil for pipes as its + docstring says. 1995-04-11 Richard Stallman <rms@mole.gnu.ai.mit.edu> @@ -1764,12 +1764,12 @@ * keyboard.c (kbd_buffer_get_event): Pass 0 for `insist' arg. * m/intel386.h (C_SWITCH_SYSTEM): Don't #undef or define it. - [SOLARIS2, SOLARIS2_4, !__GNUC__] (C_SWITCH_MACHINE): Define instead. + [SOLARIS2, SOLARIS2_4, !__GNUC__] (C_SWITCH_MACHINE): Define instead. 1995-03-26 Germano Caronni <caronni@tik.ethz.ch> * ralloc.c (r_re_alloc): Correct realloc behavior--allow shrinking - of blocks while reallocating, if shrinking by more than one page. + of blocks while reallocating, if shrinking by more than one page. (relocate_blocs, resize_blocs): Added failsafe to protect future calling of these routines when in frozen state. (r_alloc_thaw): Added call to r_alloc_init. @@ -1820,7 +1820,7 @@ * m/sparc.h: Don't include alloca.h if NOT_C_CODE. * m/mips-siemens.h (UNEXEC): Override the definition. - (LIBS_DEBUG, ORDINARY_LINK): Add #undefs. + (LIBS_DEBUG, ORDINARY_LINK): Add #undefs. 1995-03-22 Karl Heuer <kwzh@hal.gnu.ai.mit.edu> @@ -2334,7 +2334,7 @@ 1995-02-14 Richard Stallman <rms@geech.gnu.ai.mit.edu> - * filelock.c: (unlock_buffer, unlock_all_files, Flock_buffer) + * filelock.c (unlock_buffer, unlock_all_files, Flock_buffer) (Funlock_buffer): Use buffer's file_truename, not filename. * buffer.c (syms_of_buffer): Set up Lisp var buffer-file-truename. @@ -3107,7 +3107,7 @@ * lisp.h (enum Lisp_Type): Lisp_Process, Lisp_Window, Lisp_Frame, Lisp_Subr deleted. - (PSEUDOVECTORP, GC_PSEUDOVECTORP): Add paren for proper nesting. + (PSEUDOVECTORP, GC_PSEUDOVECTORP): Add paren for proper nesting. (PROCESSP, GC_PROCESSP, XSETPROCESS): Rewrite to use pseudovectors. (WINDOWP, GC_WINDOWP, XSETWINDOW): Likewise. (FRAMEP, GC_FRAMEP): Likewise. @@ -3461,7 +3461,7 @@ 1994-11-19 Francesco Potortì <pot@cnuce.cnr.it> - * lisp.h: (running_asynch_code): New global flag. + * lisp.h (running_asynch_code): New global flag. * emacs.c (running_asynch_code): New global flag. (main): Initialise it. * process.c (read_process_output, exec_sentinel): Set and @@ -3493,7 +3493,7 @@ 1994-11-17 Karl Heuer <kwzh@hal.gnu.ai.mit.edu> - * lisp.h: (enum Lisp_Misc_Type): Rename Lisp_Vector to + * lisp.h (enum Lisp_Misc_Type): Rename Lisp_Vector to Lisp_Vectorlike. Mark Lisp_Window_Configuration as obsolete. (PSEUDOVECTOR_FLAG, PSEUDOVECTOR_SIZE_MASK, PVEC_BUFFER, PVEC_PROCESS, PVEC_FRAME, PVEC_COMPILED, PVEC_WINDOW, @@ -3645,7 +3645,7 @@ 1994-11-14 Karl Heuer <kwzh@hal.gnu.ai.mit.edu> - * lisp.h: (enum Lisp_Misc_Type): Add new enumeration Lisp_Misc_Overlay. + * lisp.h (enum Lisp_Misc_Type): Add new enumeration Lisp_Misc_Overlay. (enum Lisp_Type): Delete the corresponding enumeration from here. (struct Lisp_Overlay): New structure. (XOVERLAY, OVERLAYP): Access the new structure. @@ -3711,7 +3711,7 @@ 1994-11-11 Karl Heuer <kwzh@nutrimat.gnu.ai.mit.edu> - * lisp.h: (enum Lisp_Misc_Type): Add new enumerations + * lisp.h (enum Lisp_Misc_Type): Add new enumerations Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value. (enum Lisp_Type): Delete the corresponding enumerations from here. (struct Lisp_Buffer_Local_Value): New structure. @@ -3798,7 +3798,7 @@ * xfns.c (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref to compare it against. - * editfns.c: (Fdecode_time): Fix Lisp_Object vs. integer problems. + * editfns.c (Fdecode_time): Fix Lisp_Object vs. integer problems. Don't use tm_gmtoff; it's not portable. * lisp.h: Leave DEVICE_SEP undefined by default. @@ -3955,7 +3955,7 @@ Use the return value of child_setup to get the child's pid; don't call vfork etc. explicitly. - * callproc.c [WINDOWSNT]: Add includes. Define NOMINMAX, _P_NOWAIT. + * callproc.c [WINDOWSNT]: Add includes. Define NOMINMAX, _P_NOWAIT. (Vbinary_process_input, Vbinary_process_output) (Qbuffer_file_type): Test DOS_NT, not MSDOS. (syms_of_callproc): Test DOS_NT, not MSDOS. @@ -4217,7 +4217,7 @@ * process.c: Handle multiple keyboard input descriptors. (non_keyboard_wait_mask): New variable. - (Fset_process_filter): Update non_keyboard_wait_mask + (Fset_process_filter): Update non_keyboard_wait_mask. (create_process, Fopen_network_stream, deactivate_process): (init_process, sigchld_handler): Likewise. (wait_reading_process_input): Maybe use non_keyboard_wait_mask. @@ -4367,7 +4367,7 @@ (the_x_screen): Variable moved here. (syms_of_xterm): Staticpro parts of the_x_screen. * xfns.c (Fx_open_connection): Get dpyinfo from x_term_init. - Don't set up atoms, xrdb here. Pass name as Lisp_Object. + Don't set up atoms, xrdb here. Pass name as Lisp_Object. (the_x_screen): Variable moved to xterm.c. (syms_of_xfns): Don't staticpro it here. @@ -4456,7 +4456,7 @@ * xfns.c: Use FRAME_X_DISPLAY instead of x_current_display and XDISPLAY. - (x_in_use): New variable, + (x_in_use): New variable. (check_x, using_x_p): Test x_in_use. (Fx_open_connection): Set x_in_use. (check_x_frame): New function. @@ -4511,7 +4511,7 @@ 1994-10-19 Karl Heuer <kwzh@hal.gnu.ai.mit.edu> - * search.c: (searchbufs): New variable, replaces searchbuf and + * search.c (searchbufs): New variable, replaces searchbuf and last_regexp and search_fastmap. (syms_of_search): Initialize it. (searchbuf_head): New variable. @@ -4597,7 +4597,7 @@ * frame.h [!MULTI_FRAME]: We give up having selected_frame be an always-zero integer variable. From now on it will be a pointer to a `struct frame' just like in the MULTI_FRAME case. - (selected_frame, last_nonminibuf_frame): use FRAME_PTR, not EMACS_INT. + (selected_frame, last_nonminibuf_frame): use FRAME_PTR, not EMACS_INT. (XFRAME): Redefine to use the_only_frame. (XSETFRAME): Define to set Lisp value. (WINDOW_FRAME): Redefine to return Lisp value. @@ -4640,7 +4640,7 @@ (the_only_x_display, x_current_display) [!HAVE_X_WINDOWS]: New variables. - * msdos.h: (XFontStruct, GC, Pixmap, Display, Window) [MSDOS_NO_X]: + * msdos.h (XFontStruct, GC, Pixmap, Display, Window) [MSDOS_NO_X]: Dummy types. (struct face, FACE_HAS_GC, FACE_GC, FACE_FOREGROUND, FACE_BACKGROUND, FACE_FONT, FACE_STIPPLE, FACE_UNDERLINE_P) [MSDOS_NO_X]: Define like @@ -4937,7 +4937,7 @@ (struct Lisp_Free): New structure. (Lisp_Misc_Free): Type code for that structure. * buffer.h (OVERLAY_POSITION): Marker assert now tests substructure. - * alloc.c: (MARKER_BLOCK_SIZE, marker_block, marker_free_list): + * alloc.c (MARKER_BLOCK_SIZE, marker_block, marker_free_list): Now refers to the superset type, not just markers. (allocate_misc): New function, extracted from Fmake_marker. (Fpurecopy): Check the substructure. @@ -5185,7 +5185,7 @@ 1994-10-02 Paul Reilly <pmr@geech.gnu.ai.mit.edu> - * xfns.c: (HACK_EDITRES): Declare if using X11R5. + * xfns.c (HACK_EDITRES): Declare if using X11R5. (widget_id_tick): New variable. (x_any_window_to_frame): Use lw_window_is_in_menubar for widget set independence. @@ -5953,7 +5953,7 @@ 1994-09-03 Kaveh R. Ghazi (ghazi@noc.rutgers.edu) * m/delta88k.h [__GNUC__] (HAVE_ALLOCA): Defined. - [__GNUC__] (C_ALLOCA): Add #undef + [__GNUC__] (C_ALLOCA): Add #undef. (LIB_X11_LIB): Add #undef. (HAVE_TERMIOS): Defined. (HAVE_TERMIO): Add #undef. @@ -7039,7 +7039,7 @@ 1994-06-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * mips-siemens.h: Include pyramid.h, not mips.h. + * mips-siemens.h: Include pyramid.h, not mips.h. (LOAD_AVE_TYPE, LOAD_AVE_CVT): Definitions deleted. (NO_ARG_ARRAY, HAVE_ALLOCA): Defined. (BROKEN_FIONREAD): Add #undef. diff --git a/src/ChangeLog.6 b/src/ChangeLog.6 index 6c7d04a531e..3b1bdbffabc 100644 --- a/src/ChangeLog.6 +++ b/src/ChangeLog.6 @@ -2830,7 +2830,7 @@ * dosfns.c (Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize arguments with documentation. - * editfns.c (Fchar_to_string, Fstring_to_char, Fgoto_char, Fencode_time, + * editfns.c (Fchar_to_string, Fstring_to_char, Fgoto_char, Fencode_time) (Finsert_char, Fbuffer_substring, Fbuffer_substring_no_properties) (Finsert_buffer_substring, Fdelete_region, Fnarrow_to_region): Harmonize arguments with documentation. diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index 6e53a39ac93..fc4f2d4ad37 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -319,7 +319,7 @@ * lisp.h (Ftop_level): Add prototype. - * xterm.c: (xlwmenu_window_p, xlwmenu_redisplay): Add prototypes. + * xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Add prototypes. (XTread_socket): Improve style of comments to follow other comments. @@ -1126,7 +1126,7 @@ * xterm.c (note_mouse_highlight) <help-echo>: When looking for help-echo for a string which doesn't have help-echo itself, use - get-char-property to obtain the help-echo from the string's buffer + get-char-property to obtain the help-echo from the string's buffer. (note_mouse_highlight) <mouse-face>: When on a string that doesn't have mouse-face, look ``under'' the string for mouse-face from an overlay. @@ -1496,7 +1496,7 @@ * coding.c (setup_coding_system): Don't do any designation based on reg_bits if charset is not yet defined. - * lisp.h (XVECTOR): Verify correct object type before returning a + * lisp.h (XVECTOR): Verify correct object type before returning a pointer, using eassert. 2001-07-17 Gerd Moellmann <gerd@gnu.org> @@ -1752,7 +1752,7 @@ creating the directory might signal an error, and leaves Emacs in a strange state. - * term.c: (tty_cursor_hidden): New variable. + * term.c (tty_cursor_hidden): New variable. (update_begin): Don't call tty_hide_cursor. Clean up. (update_end, set_terminal_window, set_scroll_region): Clean up. (ring_bell, reset_terminal_modes): Clean up. @@ -3109,7 +3109,7 @@ * w32term.c (w32_encode_char): Treat eight bit graphic and control characters the same as ASCII and latin-1. - (x_display_and_set_cursor): Check for the focus frame's selected + (x_display_and_set_cursor): Check for the focus frame's selected window instead of selected_window. (x_after_update_window_line): Don't clear if frame's internal border width is zero. @@ -3119,7 +3119,7 @@ * w32fns.c (Fx_show_tip): Fix calls to make_number. (x_set_font): If font hasn't changed, avoid recomputing faces and other things. - (x_set_tool_bar_lines): Do nothing if frame is minibuffer-only, + (x_set_tool_bar_lines): Do nothing if frame is minibuffer-only. (Fx_create_frame): Add the tool bar height to the frame height. (x_create_tip_frame): Prevent changing the tooltip's background color by specifying a color for the default font @@ -3896,7 +3896,7 @@ 2001-01-07 Dave Love <fx@gnu.org> - * keyboard.c (Fread_key_sequence_vector): Avoid newline in + * keyboard.c (Fread_key_sequence_vector): Avoid newline in arglist, for documentation's sake. 2001-01-06 Andrew Innes <andrewi@gnu.org> @@ -4180,7 +4180,7 @@ what's displayed in the window. * xdisp.c (try_window_reusing_current_matrix) - <new start <= old start>: Disable rows in the current matrix + <new start <= old start>: Disable rows in the current matrix which are below the window after scrolling. * xdisp.c (move_it_by_lines): Don't do optimizations if NEED_Y_P @@ -4887,7 +4887,7 @@ * md5.c: Delay include of md5.h until after namespace cleaning. - * makefile.w32-in (fns.o): Depend on md5.h + * makefile.w32-in (fns.o): Depend on md5.h. (md5.o): New target. (sunfns.o): Remove. @@ -5004,7 +5004,7 @@ the metrics of BDF fonts. (x_estimate_mode_line_height): If `mode-line' face hasn't a font, use that of the frame, as drawing glyphs does. - (note_mouse_highlight): Change the cursor shape on the vertical + (note_mouse_highlight): Change the cursor shape on the vertical border between windows [not enabled]. * w32term.h (struct w32_output): Add member horizontal_drag_cursor. @@ -5480,7 +5480,7 @@ * lisp.h (pos_visible_p): Change prototype. * dispextern.h (CURRENT_MODE_LINE_HEIGHT) - (CURRENT_HEADER_LINE_HEIGHT): Look at current_mode_line_height + (CURRENT_HEADER_LINE_HEIGHT): Look at current_mode_line_height and current_header_line_height first. (current_mode_line_height, current_header_line_height): Declare extern. @@ -6683,7 +6683,7 @@ (create_offscreen_bitmap): New function. (w32_BDF_TextOut): Use it. Draw glyphs as DIBs. - * w32term.c (x_produce_glyphs): If the distance from the current + * w32term.c (x_produce_glyphs): If the distance from the current position to the next tab stop is less than a canonical character width, use the tab stop after that. (x_draw_glyphs): Handle case START and END are out of bounds more @@ -7254,7 +7254,7 @@ * charset.h (MAKE_CHAR): Be sure to set MSB of C1 to 0. - * charset.c: Include composite.h + * charset.c: Include composite.h. (lisp_string_width): New function. (Fstring_width): Call lisp_string_width instead of strwidth. @@ -7333,7 +7333,7 @@ * s/ms-w32.h (ORDINARY_LINK): New define. - * w32.c (_ANONYMOUS_UNION) [__GNUC__]: New define + * w32.c (_ANONYMOUS_UNION) [__GNUC__]: New define. (_ANONYMOUS_STRUCT) [__GNUC__]: New define. * makefile.w32-in (clean): Don't delete config.h and epaths.h. @@ -7536,7 +7536,7 @@ CYCLE_CHECK arguments. (merge_face_vector_with_property, Finternal_merge_in_global_face) (lookup_named_face, lookup_derived_face, realize_named_face) - (face_at_string_position, face_at_buffer_position): Supply + (face_at_string_position, face_at_buffer_position): Supply new F and CYCLE_CHECK arguments to merge_face_vectors. (merge_face_heights): New function. (merge_face_vectors, merge_face_vector_with_property) @@ -7826,7 +7826,7 @@ (x_compute_glyph_string_overhangs): Incomplete body removed, as the X way of doing this will not work for W32. (w32_intersect_rectangles): Removed. Use IntersectRect API call. - (x_draw_image_foreground): Avoid drawing outside of the clip area + (x_draw_image_foreground): Avoid drawing outside of the clip area when image doesn't have a mask. (note_mouse_highlight): Process overlays in the right order of priority. Set help_echo_window. @@ -8409,7 +8409,7 @@ (encode_coding_iso2022): New local variable safe_chars. Check unsafe chars. (setup_coding_system): Delete the code to initialize - coding->safe_charses + coding->safe_charses. (intersection, find_safe_codings): New functions. (Ffind_coding_systems_region_internal): New function. (syms_of_coding): Defsubr it. Initialize Qsafe_chars, @@ -8729,7 +8729,7 @@ * w32term.c (help_echo_object, help_echo_pos): New variables. (note_mode_line_highlight): Store additional information about the help-echo in help_echo_object and help_echo_pos. Check both - `local-map' and `keymap' properties for changing the cursor + `local-map' and `keymap' properties for changing the cursor. (note_mouse_highlight): Store additional information about the help-echo in help_echo_object and help_echo_pos. (note_tool_bar_highlight): Set help_echo_object to nil and @@ -8797,7 +8797,7 @@ * xterm.c (help_echo_object, help_echo_pos): New variables. (note_mode_line_highlight): Store additional information about the help-echo in help_echo_object and help_echo_pos. Check both - `local-map' and `keymap' properties for changing the cursor + `local-map' and `keymap' properties for changing the cursor. (note_mouse_highlight): Store additional information about the help-echo in help_echo_object and help_echo_pos. (note_tool_bar_highlight): Set help_echo_object to nil and @@ -10156,7 +10156,7 @@ (encode_coding_string): Likewise. * ccl.c (ccl_driver) <CCL_ReadMultibyteChar2> - <CCL_WriteMultibyteChar2>: Handle charsets eight-bit-control and + <CCL_WriteMultibyteChar2>: Handle charsets eight-bit-control and eight-bit-graphic correctly. 2000-05-24 Kenichi HANDA <handa@etl.go.jp> @@ -11979,7 +11979,7 @@ (detect_coding_utf_8): New function. (UTF_16_INVALID_P, UTF_16_HIGH_SURROGATE_P UTF_16_LOW_SURROGATE_P): New macros. - (detect_coding_utf_16): New function + (detect_coding_utf_16): New function. (detect_coding_mask): When priorities are specified, skip any categories that have `nil' coding-system. Fix bug of returning wrong mask when PRIORITIES is specified and detect_coding_XXX() @@ -12222,7 +12222,7 @@ * makefile.nt: Add atimer.h to dependencies. * w32.c (init_environment): Set Vw32_num_mouse_buttons here. - * w32console.c: Only disable window system features for dispextern.h + * w32console.c: Only disable window system features for dispextern.h. (initialize_w32_display): Build a display info for the console. * w32faces.c (tty_defined_color): Apply xfaces.c change from 02-17. * w32fns.c (w32_wnd_proc) [WM_LBUTTON_DOWN, WM_RBUTTON_DOWN, @@ -12812,7 +12812,7 @@ (xim_destroy_callback, xim_open_dpy, xim_instantiate_callback) (xim_initialize, xim_close) [HAVE_X_I18N && HAVE_X11R6]: New functions. - (x_destroy_window) [HAVE_X_I18N]: Call xic_destroy_frame. + (x_destroy_window) [HAVE_X_I18N]: Call xic_destroy_frame. (x_term_init) [HAVE_X_I18N]: Call xim_initialize. (x_delete_display) [HAVE_X_I18N]: Call xim_close. @@ -12825,7 +12825,7 @@ (FRAME_XIM): Removed. * xfns.c (supported_styles): New variable. - (DEFAULT_STYLE, DEFAULT_FONT): New macros + (DEFAULT_STYLE, DEFAULT_FONT): New macros. (xic_create_xfontset, best_style, xic_create_frame) (xic_destroy_frame, xic_set_preeditarea, xic_set_statusarea) (xic_set_xfontset): New functions. @@ -13029,7 +13029,7 @@ 2000-01-19 Dave Love <fx@gnu.org> - * lread.c: (syms_of_lread) [user-init-file]: Doc change. + * lread.c (syms_of_lread) [user-init-file]: Doc change. 2000-01-18 Kenichi Handa <handa@etl.go.jp> @@ -13156,7 +13156,7 @@ (GC_STRING_BYTES, GC_STRING_CHARS): New macros. (DONT_COPY_FLAG): Removed. (SBLOCK_SIZE, LARGE_STRING_BYTES): New macros. - (struct sdata, struct sblock): New + (struct sdata, struct sblock): New. (struct string_block): Rewritten. (STRINGS_IN_STRING_BLOCK): New macro. (oldest_sblock, current_sblock, total_strings, total_free_strings) diff --git a/src/ChangeLog.trunk b/src/ChangeLog.trunk index 6a0475f5741..a3e08cf699d 100644 --- a/src/ChangeLog.trunk +++ b/src/ChangeLog.trunk @@ -1,5 +1,878 @@ +2010-08-09 Dan Nicolaescu <dann@ics.uci.edu> + + * font.h (font_parse_xlfd, font_parse_fcname, font_unparse_fcname) + (font_parse_name): font_open_by_name): + * font.c (font_parse_xlfd, font_parse_fcname, font_unparse_fcname) + (font_parse_name): font_open_by_name): Remove const. + +2010-08-09 Andreas Schwab <schwab@linux-m68k.org> + + Use autoconf determined WORDS_BIGENDIAN instead of hardcoded + definition. + + * m/alpha.h: Don't define/undef WORDS_BIG_ENDIAN. + * m/amdx86-64.h: Likewise. + * m/arm.h: Likewise. + * m/hp800.h: Likewise. + * m/ia64.h: Likewise. + * m/ibmrs6000.h: Likewise. + * m/ibms390.h: Likewise. + * m/intel386.h: Likewise. + * m/iris4d.h: Likewise. + * m/m68k.h: Likewise. + * m/macppc.h: Likewise. + * m/mips.h: Likewise. + * m/sh3.h: Likewise. + * m/sparc.h: Likewise. + * m/template.h: Likewise. + * m/vax.h: Likewise. + * m/xtensa.h: Likewise. + * fringe.c (init_fringe_bitmap): Test WORDS_BIGENDIAN instead of + WORDS_BIG_ENDIAN. + * lisp.h: Likewise. + * md5.c: Likewise. + * sound.c (le2hl, le2hs, be2hl, be2hs): Likewise. + +2010-08-09 Dan Nicolaescu <dann@ics.uci.edu> + + Use const char* instead of char*. + Reduce the number of warnings with -Wwrite-strings. + * xrdb.c (get_environ_db, get_system_name): + * unexelf.c (find_section): + * term.c (string_cost, string_cost_one_line, per_line_cost) + (get_named_tty, init_tty): + * sysdep.c (sys_subshell): + * sound.c (sound_perror, sound_warning, vox_open, vox_init) + (alsa_sound_perror, alsa_open, alsa_configure, alsa_init): + * search.c (Freplace_match): + * process.c (Fmake_network_process, send_process, init_process): + * lread.c (Fload, init_lread): + * keymap.c (Fdescribe_buffer_bindings, describe_map_tree): + * keyboard.c (parse_tool_bar_item, struct event_head): + * gtkutil.h (xg_get_font_name): + * gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name) + (make_widget_for_menu_item, make_menu_item, create_menus) + (xg_make_tool_item): + * font.c (parse_matrix, font_parse_name): + * floatfns.c (rounding_driver, float_error_fn_name): + * filelock.c (get_boot_time_1, lock_file_1): + * fileio.c (barf_or_query_if_file_exists, check_writable): + * editfns.c (get_system_name, get_operating_system_release) + (Fencode_time, Fset_time_zone_rule): + * dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty): + * buffer.c (defvar_per_buffer): Use const. + +2010-08-08 Kenichi Handa <handa@m17n.org> + + * charset.c: Include <stdlib.h> + (struct charset_sort_data): New struct. + (charset_compare): New function. + (Fsort_charsets): New funciton. + (syms_of_charset): Declare Fsort_charsets as a Lisp function. + + * coding.c (decode_coding_iso_2022): Fix checking of dimension + number in CTEXT extended segment. + +2010-08-08 Juanma Barranquero <lekktu@gmail.com> + + * w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring. + * xfns.c (syms_of_xfns) <x-max-tooltip-size>: Reflow docstring. + +2010-08-08 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (Fsubstring_no_properties, Fnthcdr, Ffeaturep) + (Fhash_table_size): Fix typos in docstrings. + (Fmake_hash_table): Doc fix. + +2010-08-08 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (syms_of_minibuf) <read-buffer-function>: + Doc fix (bug#5625). + +2010-08-08 Ken Brown <kbrown@cornell.edu> + + * dired.c (DIRENTRY_NONEMPTY) [cygwin]: Use d_ino instead of + the MSDOS definition. + +2010-08-08 Dan Nicolaescu <dann@ics.uci.edu> + + Use const char* instead of char*. + * xterm.c (x_create_toolkit_scroll_bar): + * xfont.c (xfont_list_pattern): + * xfns.c (x_default_scroll_bar_color_parameter) + (xic_create_fontsetname, x_default_font_parameter) + (x_screen_planes): + * xdisp.c (c_string_pos, number_of_chars, reseat_to_string) + (store_mode_line_string, decode_mode_spec, display_string): + * menu.c (digest_single_submenu): + * keymap.h (initial_define_key, initial_define_lispy_key): + * keymap.c (initial_define_key, initial_define_lispy_key): + * image.c (image_error, image_keyword): + * gtkutil.h (xg_create_widget, xg_create_scroll_bar): + * gtkutil.c (xg_create_widget, xg_create_scroll_bar): + * ftfont.c (struct fc_charset_table, ftfont_spec_pattern) + (ftfont_list, ftfont_match): + * frame.c (frame_parm_table): + * font.h (font_intern_prop, font_parse_xlfd, font_parse_fcname) + (font_unparse_fcname, font_unparse_fcname, font_open_by_name) + (font_add_log, font_deferred_log): + * font.c (font_intern_prop, font_parse_xlfd, font_parse_fcname) + (font_unparse_fcname, font_unparse_fcname, font_open_by_name) + (font_add_log, font_deferred_log): + * emacs.c (argmatch): + * dispextern.h (struct it): + * coding.c (ENCODE_DESIGNATION): + * charset.c (define_charset_internal): Use const. + + * s/freebsd.h (DECLARE_GETPWUID_WITH_UID_T): Remove, unused. + + * xrdb.c: Remove include guard. Remove + DECLARE_GETPWUID_WITH_UID_T conditional it had no effect. + Remove #if 0 code. Replace malloc->xmalloc, free->xfree, + realloc->xrealloc instead of using #defines. + +2010-08-08 Eli Zaretskii <eliz@gnu.org> + + * cmds.c (Fforward_line, Fbeginning_of_line, Fend_of_line): + * editfns.c (Fline_beginning_position, Fline_end_position): State + in the doc strings that start and end of line are in the logical + order. + + * xdisp.c (display_line): Move the handling of overlay arrow after + the call to find_row_edges. (Bug#6699) + +2010-08-07 Chong Yidong <cyd@stupidchicken.com> + + * keyboard.c (command_loop_1): + * insdel.c (prepare_to_modify_buffer): Don't call validate_region. + +2010-08-07 Chong Yidong <cyd@stupidchicken.com> + + * insdel.c (prepare_to_modify_buffer): Save active region text to + Vsaved_region_selection. + + * xselect.c (QPRIMARY): Move to keyboard.c. + + * keyboard.c (Vselect_active_regions): Move from simple.el. + (Vsaved_region_selection, Qx_set_selection, QPRIMARY, Qlazy): New vars. + (command_loop_1): Set window selection prior to deactivating the mark. + +2010-08-07 Juanma Barranquero <lekktu@gmail.com> + + * alloc.c (lisp_malloc): + * buffer.c (set_buffer_internal, set_buffer_internal_1): + * charset.h (emacs_mule_charset): + * dispextern.h (inhibit_free_realized_faces, redraw_frame) + (redraw_garbaged_frames, scroll_cost, update_frame, scrolling) + (bitch_at_user): + * lisp.h (Fcheck_coding_system, Fget_text_property) + (Qfunction, Qcompletion_ignore_case, QCwidth, QCsize): + Remove duplicate declarations. + +2010-08-06 Dan Nicolaescu <dann@ics.uci.edu> + + * process.c: Simplify include logic. + + * keyboard.h (quit_char): Add declaration. + * process.h (QCport, QCspeed, QCprocess, QCbytesize, QCstopbits) + (QCparity, Qodd, Qeven, QCflowcontrol, Qhw, Qsw, QCsummary): + Add declarations. + * sysdep.c: + * w32.c: Remove the above declarations. + + Remove extern declarations in .c files, .h files have them. + * xterm.c: + * xdisp.c: + * msdos.c: + * image.c: + * gtkutil.c: + * fileio.c: + * eval.c: Remove declarations. + + * frame.c (frame_params): Make const. + + * lisp.h (fatal_error_signal, emacs_root_dir): Add declaration. + + * emacs.c (emacs_copyright, emacs_version): Make static. + (Vinitial_window_system, Vauto_save_list_file_name) + (Vinhibit_redisplay): Remove declarations. + (main): Remove HAVE_SHM code, unused. Remove _I386 conditional + for AIX. + + Use const for some arrays and functions. + * xterm.h (xg_set_icon_from_xpm_data): + * xfns.c (xg_set_icon_from_xpm_data): + * term.c (fkeys): + * keyboard.c (lispy_accent_keys, lispy_function_keys) + (lispy_multimedia_keys, lispy_kana_keys, iso_lispy_function_keys) + (lispy_drag_n_drop_names, scroll_bar_parts, modify_event_symbol) + (frame.c frame_parms): + * emacs-icon.h (gnu_xpm_bits): + * callint.c (callint_argfuns): Use const. + +2010-08-06 Jan Djärv <jan.h.d@swipnet.se> + + * sysdep.c: Move include term.h last of includes (Bug#6812). + +2010-08-06 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (realloc_glyph_pool): Zero out newly allocated glyphs. + + * msdos.c (IT_display_cursor): Log cursor position on termscript. + + * .gdbinit (pgx): Display the avoid_cursor_p flag. + +2010-08-06 Juanma Barranquero <lekktu@gmail.com> + + * makefile.w32-in ($(BLD)/xdisp.$(O)): Update dependencies. + +2010-08-06 Jan Djärv <jan.h.d@swipnet.se> + + * xterm.h (x_get_focus_frame): Declare. + + * keyboard.h (poll_for_input_1): Unconditionally declare. + + * nsterm.h (x_set_menu_bar_lines): Declare. + + * window.c: Don't include menu.h, it depends on lots of other .h-files. + + * xfaces.c (x_create_gc, x_free_gc): Convert to ANSI C prototypes. + + * window.c: Include menu.h. + + * unexmacosx.c (print_region_list, print_regions) + (build_region_list, find_emacs_zone_regions) + (unexec_regions_merge, read_load_commands, dump_it) + (unexec_init_emacs_zone): Convert to ANSI C prototypes. + + * term.c: Check HAVE_SYS_IOCTL_H. + + * sysdep.c: Check HAVE_TERM_H. + + * process.c: Check HAVE_UTIL_H. Include nsterm.h if HAVE_NS. + + * nsterm.m (ns_init_paths, ns_alloc_autorelease_pool) + (ns_ring_bell, ns_defined_color, hide_hourglass) + (x_display_pixel_height, x_display_pixel_width, syms_of_nsterm): + Convert to ANSI C prototypes. + (x_set_window_size, ns_draw_fringe_bitmap, judge): Move declarations + before code. + + * nsterm.h : Include sysselect.h. + (x_sync, x_get_focus_frame, x_set_mouse_position) + (x_set_mouse_pixel_position, x_make_frame_visible) + (x_make_frame_invisible, x_iconify_frame, x_char_width, x_char_height) + (x_pixel_width, x_pixel_height, x_set_frame_alpha, x_set_tool_bar_lines) + (x_activate_menubar, free_frame_menubar, ns_init_paths, ns_select) + (syms_of_nsterm, syms_of_nsfns, syms_of_nsmenu, syms_of_nsselect): + Declare. + + * nsmenu.m (popup_activated, name_is_separator) + (syms_of_nsmenu): Convert to ANSI C prototypes. + (runMenuAt): Prototypes and move declarations before code. + + * nsimage.m (ns_load_image): Move NSTRACE after declarations. + + * nsfont.m (ns_fallback_entity, syms_of_nsfont): Convert to ANSI C + prototypes. + + * nsfns.m (have_menus_p, ns_display_info_for_name) + (x_set_cursor_type, ns_appkit_version_str) + (ns_appkit_version_int, ns_do_applescript) + (x_set_scroll_bar_default_width, x_sync, compute_tip_xy) + (syms_of_nsfns): Convert to ANSI C prototypes. + + * menu.h (x_set_menu_bar_line): Declare. + (free_menubar_widget_value_tree et.al): Add HAVE_NS for these functions. + + * lisp.h (fmod_float): Declare. + + * image.c (xpm_scan, xpm_make_color_table_v) + (xpm_put_color_table_v, xpm_get_color_table_v) + (xpm_make_color_table_h, xpm_put_color_table_h) + (xpm_get_color_table_h, xpm_str_to_color_key, xpm_load_image) + (xpm_load): Convert to ANSI C prototypes. + + * emacs.c: Include nsterm.h if HAVE_NS. + + * bidi.c (bidi_dump_cached_states): Fix fprintf warning. + +2010-08-06 Dan Nicolaescu <dann@ics.uci.edu> + + * process.c: Remove HAVE_SOCKETS #ifdefs inside #ifdef + subprocesses, only MSDOS does not define HAVE_SOCKETS. + (socket_options): Use const char* for name. + +2010-08-06 Juanma Barranquero <lekktu@gmail.com> + + Fix changes in 2010-08-05T23:15:24Z!dann@ics.uci.edu..2010-08-05T23:34:12Z!dann@ics.uci.edu for Windows build. + + * xmenu.c [USE_X_TOOLKIT || USE_GTK]: + Don't declare xmalloc_widget_value and digest_single_submenu. + + * w32font.c (Qlatin): Remove declaration. + + * menu.h (xmalloc_widget_value, digest_single_submenu): Declare. + + * dired.c (compile_pattern): Restore declaration. + +2010-08-05 Dan Nicolaescu <dann@ics.uci.edu> + + Remove extern declarations in .c files, .h files have them. + * data.c: + * dired.c: + * editfns.c: + * filelock.c: + * fns.c: + * font.c: + * fontset.c: + * frame.c: + * fringe.c: + * ftfont.c: + * gtkutil.c: + * indent.c: + * keyboard.c: + * keymap.c: + * lread.c: + * menu.c: + * print.c: + * search.c: + * sound.c: + * window.c: + * xdisp.c: + * xfaces.c: + * xfns.c: + * xfont.c: + * xftfont.c: + * xmenu.c: + * xterm.c: Remove declarations. + + Cleanup syssignal.h. + * syssignal.h (sighold, sigrelse, RETSIGTYPE): Remove, unused. + (main_thread): Move down to remove #ifdef. + (SIGMASKTYPE, SIGEMPTYMASK, SIGFULLMASK, sigmask, sigunblock): + Remove conditional definition following unconditional ones. + + * lisp.h: Remove HAVE_SHM code, unused. + (QCmap, QCrehash_size, QCrehash_threshold, QCsize, QCtest) + (QCweakness, Qabove_handle, Qbackquote, Qbar, Qbelow_handle) + (Qborder, Qbottom, Qbox, Qcircular_list, Qcomma, Qcomma_at) + (Qcomma_dot, Qcursor, Qdefault, Qdown, Qend_scroll, Qeq, Qeql) + (Qequal, Qfile_exists_p, Qfont_param, Qfringe, Qfunction) + (Qfunction_documentation, Qhandle, Qhbar, Qheader_line, Qhollow) + (Qidentity, Qleft_margin, Qmenu, Qmenu_bar_update_hook) + (Qmode_line_inactive, Qmouse, Qoverriding_local_map) + (Qoverriding_terminal_local_map, Qratio, Qregion, Qright_margin) + (Qscroll_bar, Qtool_bar, Qtop, Qup, Qvertical_border, Qwhen) + (Qwindow_scroll_functions, Vafter_load_alist) + (Vauto_save_list_file_name, Vface_alternative_font_family_alist) + (Vface_alternative_font_registry_alist, Vface_font_rescale_alist) + (Vface_ignored_fonts, Vinhibit_redisplay, Vminibuffer_list) + (Vprint_length, Vprint_level, Vscalable_fonts_allowed) + (Vshell_file_name, Vsystem_name, Vwindow_scroll_functions) + (Vwindow_system_version, Vx_no_window_manager, initial_argc) + (initial_argv, last_nonmenu_event, load_in_progress) + (noninteractive_need_newline, scroll_margin): Add declarations. + + * keyboard.h (xmalloc_widget_value, digest_single_submenu): Remove + declarations, menu.h has them. + (QCbutton, QCtoggle, QCradio, QClabel, extra_keyboard_modifiers) + (Vinput_method_function, Qinput_method_function) + (Qevent_symbol_element_mask, last_event_timestamp): + * dispextern.h (Voverflow_newline_into_fringe): + * font.h (QCantialias, Qp, syms_of_ftfont, syms_of_xfns) + (syms_of_ftxfont, syms_of_xftfont, syms_of_bdffont) + (syms_of_w32font, syms_of_nsfont): + * fontset.h (find_font_encoding, Qlatin): + * frame.h (Qtooltip, Qrun_hook_with_args, Vmenu_bar_mode) + (Vtool_bar_mode, set_frame_menubar): + * ftfont.h (ftfont_font_format, ftfont_get_fc_charset): + * xterm.h (Qx_gtk_map_stock): + * keymap.h (meta_prefix_char): Add declarations. + + * term.c: Remove dead code. + + Fix emacs -Q -f server-start & emacsclient -t on GNU/Linux. + * term.c (dissociate_if_controlling_tty): Use USG5 instead of + USG. This is equivalent to defined (USG) && !defined (BSD_PGRPS), + which is what was there before BSD_PGRPS was removed. + +2010-08-05 Eli Zaretskii <eliz@gnu.org> + + * deps.mk (unexcoff.o): Rename unexec.[co] => unexcoff.[co]. + + * unexcoff.c: Renamed from unexec.c. + +2010-08-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * sysdep.c (child_setup_tty): Comment-out left-over non-ICANON code. + +2010-08-03 Johan Bockgård <bojohan@gnu.org> + + * data.c (Flocal_variable_p): Handle variable aliases correctly. + (Bug#6744) + +2010-08-02 Jan Djärv <jan.h.d@swipnet.se> + + * xterm.c (x_create_toolkit_scroll_bar): Only set XtNbeNiceToColormap + to TRUE if depth of screen is < 16. + + * gtkutil.c (hierarchy_ch_cb, qttip_cb): Do not define unless + USE_GTK_TOOLTIP. + (xg_prepare_tooltip): Return 0 unless USE_GTK_TOOLTIP. + (xg_show_tooltip, xg_hide_tooltip): Do nothing unless USE_GTK_TOOLTIP. + (xg_create_frame_widgets): Surround tooltip-related code with ifdef + USE_GTK_TOOLTIP. + (xg_free_frame_widgets): Don't delete ttip_* unless USE_GTK_TOOLTIP. + + * xterm.h (USE_GTK_TOOLTIP): New define. + (struct x_output): Put ttip_* inside ifdef USE_GTK_TOOLTIP. + + * sysdep.c (child_setup_tty): Enable ICANON in lflags and set VEOF + to Control-D (Bug#6771). + +2010-08-02 Juanma Barranquero <lekktu@gmail.com> + + * editfns.c (Fregion_beginning, Fregion_end): Doc fixes (bug#6493). + Wording by Drew Adams <drew.adams@oracle.com>. + +2010-08-01 Jan Djärv <jan.h.d@swipnet.se> + + * xterm.h (struct x_output): Add ttip_widget, ttip_window and + ttip_lbl. + + * xterm.c (x_clear_frame): Check FRAME_GTK_WIDGET (f) before + calling gtk_widget_queue_draw. + (x_free_frame_resources): Call xg_free_frame_widgets. + + * xfns.c (x_gtk_use_system_tooltips): New variable. + (Fx_show_tip): If USE_GTK and x_gtk_use_system_tooltips, call + new gtkutil tooltip functions to show the tooltip. + (Fx_hide_tip): Call xg_hide_tooltip. + (syms_of_xfns): Defvar x-gtk-use-system-tooltips. + + * gtkutil.h (xg_free_frame_widgets, xg_prepare_tooltip) + (xg_show_tooltip, xg_hide_tooltip): Declare. + + * gtkutil.c (hierarchy_ch_cb, qttip_cb, xg_prepare_tooltip) + (xg_show_tooltip, xg_hide_tooltip, xg_free_frame_widgets): + New functions. + (xg_create_frame_widgets): Set ttip_* to 0. Set a dummy tooltip + text so qttip_cb is called. Connect query-tooltip to qttip_cb. + Remove code that is commented out. + +2010-08-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fdefine_key, Flookup_key): Say what event is invalid. + +2010-07-31 Chong Yidong <cyd@stupidchicken.com> + + * xselect.c (x_own_selection): Use list4. + +2010-07-30 Dan Nicolaescu <dann@ics.uci.edu> + + * buffer.c (Qwindow): Do not define, already defined in data.c. + (syms_of_buffer): Do not intern and staticpro Qwindow. (Bug#6760) + +2010-07-29 Chad Brown <yandros@mit.edu> + + Replace tests for SYSV_SYSTEM_DIR with HAVE_DIRENT_H, set via autoconf. + * dired.c, sysdep.c: Test HAVE_DIRENT_H instead of SYSV_SYSTEM_DIR. + * config.in: Undef HAVE_DIRENT_H. + * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, + * s/msdos.h, s/usg5-4.h: Don't define SYSV_SYSTEM_DIR. + +2010-07-29 Dan Nicolaescu <dann@ics.uci.edu> + + Rename s/usg5-4.h -> s/usg5-4-common.h. + * s/usg5-4.h: Rename file to ... + * s/usg5-4-common.h: ... this for consistency with what we do for BSD. + * s/unixware.h: + * s/sol2-6.h: + * s/irix6-5.h: Update includes accordingly. + +2010-07-29 Jan Djärv <jan.h.d@swipnet.se> + + * xfns.c (x_set_tool_bar_position): Remove debug fprintf. + + * xterm.h (struct x_output): Add toolbar_top_height, + toolbar_bottom_height, toolbar_left_width, toolbar_right_width. + Remove toolbar_height. + If USE_GTK: Add hbox_widget and toolbar_in_hbox. + (FRAME_TOOLBAR_TOP_HEIGHT, FRAME_TOOLBAR_BOTTOM_HEIGHT) + (FRAME_TOOLBAR_LEFT_WIDTH, FRAME_TOOLBAR_RIGHT_WIDTH): New macros. + (FRAME_TOOLBAR_HEIGHT): Is now TOP_HEIGHT + BOTTOM_HEIGHT. + + * xterm.c (x_set_window_size_1): Add FRAME_TOOLBAR_WIDTH to pixelwidth. + + * xfns.c (x_set_tool_bar_position): New function. + (xic_set_statusarea): Use FRAME_TOOLBAR_TOP_HEIGHT. + (x_frame_parm_handlers): Add x_set_tool_bar_position. + (syms_of_xfns): If USE_GTK, provide move-toolbar. + + * window.c (calc_absolute_offset): Check for FRAME_TOOLBAR_TOP_HEIGHT + and FRAME_TOOLBAR_LEFT_WIDTH. + + * gtkutil.h (xg_change_toolbar_position): Declare. + + * gtkutil.c (FRAME_TOTAL_PIXEL_WIDTH): New macro. + (xg_frame_set_char_size): Add FRAME_TOOLBAR_WIDTH to pixelwidth. + (xg_height_or_width_changed): Use FRAME_TOTAL_PIXEL_WIDTH. + (xg_create_frame_widgets): Create a hobox for placing widgets + vertically. Use gtk_box_pack_start. + (xg_height_or_width_changed): Renamed from xg_height_changed. + (x_wm_set_size_hint): Add FRAME_TOOLBAR_WIDTH to base_width. + (xg_update_frame_menubar, free_frame_menubar): Change to + xg_height_or_width_changed. + (xg_tool_bar_detach_callback): Update left/right/top/bottom tool bar + size correctly. Remove hardcoded 4, instead use handlebox size - + toolbar size. + (xg_tool_bar_attach_callback): Update left/right/top/bottom tool bar + size correctly. Use handlebox size + toolbar size as additional size. + (xg_pack_tool_bar): POS is a new parameter. + Set orientation of tool bar based on pos. + Only make handlebox_widget if NULL. + Check if tool bar goes to vbox or hbox depending on pos. + (xg_update_tool_bar_sizes): New function. + (update_frame_tool_bar): Remove old_req, new_req. Do not get tool bar + height, call xg_update_tool_bar_sizes instead. + (free_frame_tool_bar): Remove from hbox or vbox depending on + toolbar_in_hbox, Set all FRAME_TOOLBAR_*_(WIDTH|HEIGHT) to zero. + (xg_change_toolbar_position): New function. + + * frame.h (struct frame): Add tool_bar_position. + (Qbottom): Declare. + + * frame.c (Qtool_bar_position): New variable. + (make_frame): Set tool_bar_position to Qtop. + (frame_parms): Add tool-bar-position. + (x_report_frame_params): Store tool_bar_position. + (x_set_fringe_width): Reset wm size hint after fringe changes. + +2010-07-29 Dan Nicolaescu <dann@ics.uci.edu> + + Make lisp_time_argument declaration work on all systems. + * lisp.h (lisp_time_argument): Move declaration ... + * systime.h (lisp_time_argument): ... here + * editfns.c (lisp_time_argument): Remove declaration. (Bug#6751) + +2010-07-29 Jan Djärv <jan.h.d@swipnet.se> + + * vm-limit.c (POINTER): Add typedef for it. + (start_of_data): Change return type from POINTER to char *. + + * frame.h (Qtty_color_mode): Move declaration out of ifdef + HAVE_WINDOW_SYSTEM. + +2010-07-29 Dan Nicolaescu <dann@ics.uci.edu> + + * vm-limit.c: Do not include sys/resource.h, mem-limits.h does it. + Remove reference to __osf__, unused. + + * mem-limits.h: Remove duplicated includes. + (NULL): Remove definition, unused. + (POINTER): Remove definition. + (start_of_data): Use char* in prototype, as the function + definition does. + + Remove extern declarations from .c files, and them to .h files. + * keyboard.h (Qhelp_echo, waiting_for_input) + (input_available_clear_time, ignore_mouse_drag_p) + (Vdouble_click_time, real_this_command, Vthis_original_command): + * keymap.h (Qremap, Qmenu_item, Voverriding_local_map) + (Voverriding_local_map_menu_flag): + * lisp.h (Qinteractive_form, use_file_dialog) + (Qcursor_in_echo_area, QCascent, QCmargin, QCrelief, Qcount) + (Qextension_data, QCconversion, QCcolor_symbols, QCheuristic_mask) + (QCindex, QCmatrix, QCcolor_adjustment, QCmask) + (Qrisky_local_variable, map_char_table_for_charset, Vprint_level) + (Qfunction, debug_on_next_call, Qfield) + (Vinhibit_field_text_motion, Vuser_login_name, lisp_time_argument) + (Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string) + (Qfile_directory_p, Qinsert_file_contents) + (Qcompletion_ignore_case, Qcompletion_ignore_case) + (Vcompletion_regexp_list, Vhistory_length, completion_ignore_case) + (history_delete_duplicates, minibuffer_auto_raise, Qonly) + (Qfile_name_handler_alist, Qfront_sticky, Qrear_nonsticky) + (Qminibuffer_prompt) + (Vtemporary_file_directory,char_ins_del_vector, Qface): + * xterm.h (gray_bitmap_width, gray_bitmap_height) + (gray_bitmap_bits, xic_create_fontsetname): + * coding.h (Vtranslation_table_for_input): Add extern declarations. + + * xsmfns.c (Vuser_login_name): + * xrdb.c (Vdouble_click_time): + * xfaces.c (xic_create_fontsetname): + * w32select.c (waiting_for_input): + * print.c (minibuffer_auto_raise): + * msdos.c (Qhelp_echo): + * macros.c (real_this_command): + * keymap.c (Voverriding_local_map): + * xterm.c (poll_for_input_1, gray_bitmap_width) + (gray_bitmap_height, gray_bitmap_bits; + * xmenu.c ( Voverriding_local_map) + (Voverriding_local_map_menu_flag; Qmenu_item; use_dialog_box) + (use_file_dialog, Xt_app_con): + * xdisp.c (minibuffer_auto_raise, Voverriding_local_map) + (Voverriding_local_map_menu_flag, Qmenu_item, Qface, Qinvisible) + (Qwidth, Qinvisible, Qwindow, Qpriority, Qtool_bar_lines) + (Qtool_bar_lines, ignore_mouse_drag_p): + * minibuf.c (Voverriding_local_map, Qfield, Qfront_sticky) + (Qrear_nonsticky, nconc2): + * keyboard.c (current_global_map, minibuf_level, Qmenu_item) + (Vhistory_length, Vtranslation_table_for_input, Qcomposition) + (Qdisplay, Qafter_string, Qbefore_string, Qundefined): + * fileio.c (use_dialog_box, use_file_dialog, Vuser_login_name) + (minibuf_level, minibuffer_auto_raise, lisp_time_argument): + * eval.c (Qinteractive_form, Qrisky_local_variable, Qfunction) + (gc_in_progress): + * doc.c (Voverriding_local_map, Qremap): + * dired.c (completion_ignore_case, Qcompletion_ignore_case) + (Vcompletion_regexp_list): + * coding.c (Qmac, Qinsert_file_contents, Qwrite_region) + (Qcompletion_ignore_case): + * callint.c (Qcursor_in_echo_area, Qfile_directory_p, Qonly) + (Vhistory_length, Vthis_original_command, real_this_command) + (Qface, Qminibuffer_prompt, history_delete_duplicates): + * image.c (Qrisky_local_variable): + * fontset.c (QCname): + * fns.c (minibuffer_auto_raise, QCname): + * dispnew.c (char_ins_del_cost): + * composite.c (font_fill_lglyph_metrics): + * cmds.c (Qface, Vtranslation_table_for_input): + * charset.c (map_char_table_for_charset, Qfile_name_handler_alist): + * ccl.c (charset_unicode): + * callproc.c (Vtemporary_file_directory): + * buffer.c (emacs_strerror): Remove extern declarations. + + * data.c (Qwindow): Make non-static, used from other files too. + * frame.c (validate_x_resource_name): Remove shadow definition for i. + + * unexec.c (make_hdr): Remove references to NO_REMAP, COFF, + SEGMENT_MASK, SECTION_ALIGNMENT, ADJUST_EXEC_HEADER. + * s/usg5-4.h (COFF): + * s/template.h: + * s/msdos.h (COFF, NO_REMAP): + * s/ms-w32.h (NO_REMAP): + * s/hpux10-20.h (NO_REMAP): + * m/sparc.h (SEGMENT_MASK): + * m/m68k.h (NO_REMAP): + * m/intel386.h (SEGMENT_MASK): + * m/arm.h (NO_REMAP): + * m/alpha.h (COFF): + * m/template.h: Remove references to unused defines. + +2010-07-28 Jan Djärv <jan.h.d@swipnet.se> + + * xsettings.c (Ftool_bar_get_system_style): Also check for + Qtext_image_horiz. + + * xdisp.c (Qtext_image_horiz): Define. + (syms_of_xdisp): Initialize Qtext_image_horiz. Add text-image-horiz + to documentation of tool-bar-style. + + * lisp.h (Qtext_image_horiz): Declare. + + * gtkutil.c (xg_make_tool_item, xg_show_toolbar_item): Handle tool bar + style text_image_horiz. + +2010-07-27 Dan Nicolaescu <dann@ics.uci.edu> + + * emacs.c (Fkill_emacs): Remove return statement. + + * term.c (Qspace, QCalign_to, QCwidth): Remove declarations. + (encode_terminal_code, produce_composite_glyph): Remove unused variables. + (set_tty_color_mode, term_mouse_highlight, term_get_fkeys): Remove + local extern declarations. + + * xmenu.c: Do not included lwlib.h, not needed. + + * m/iris4d.h (XUINT, XSET): Remove, not needed. + + * process.c: Move definitions earlier to minimize #ifdefs. + + * xterm.h (x_get_customization_string, x_load_resources) + (x_get_resource, x_text_icon, x_text_icon, x_check_errors) + (x_check_errors, x_property_data_to_lisp, defined_color) + (xic_set_xfontset, x_defined_color): Use const. + + * xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Remove declarations. + (x_text_icon, x_check_errors, x_connection_closed): Use const. + + * xselect.c (selection_data_to_lisp_data) + (x_property_data_to_lisp): + * xrdb.c (x_get_string_resource, file_p) + (x_get_customization_string, magic_file_p, search_magic_path) + (get_system_app, get_user_app, x_load_resources, x_get_resource) + (x_get_string_resource): Use const. + + * xfns.c: Include xlwmenu.h when USE_LUCID. + (x_defined_color, xic_set_xfontset): Use const. + (Fx_hide_tip): Remove local extern declaration. + + * xfaces.c (Qmouse_face): Remove declaration. + (face_color_gray_p, tty_defined_color, defined_color) + (face_color_gray_p, face_color_supported_p): Add const. + + * xdisp.c (do_mouse_tracking): Remove declaration. + (add_to_log): Use const. + + * minibuf.c (Qmouse_face): Remove declaration. + + * msdos.c (IT_note_mouse_highlight): Remove local extern declaration. + + * keyboard.h (do_mouse_tracking): Add declaration. + + * image.c (QCwidth, QCheight, QCforeground, QCbackground, QCfile) + (QCdata, QCtype, Qcenter): Remove declarations. + + * frame.c (x_get_resource_string, x_get_string_resource) + (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) + (x_default_parameter): Use const. + + * font.c (Qnormal, QCtype, QCfamily, QCweight, QCslant, QCwidth) + (QCheight, QCsize, QCname): Remove declarations. + + * emacs.c (main): Remove local extern declaration. + + * editfns.c (region_limit, syms_of_editfns): Remove local extern + declarations. + + * dispnew.c: Remove duplicate #include <unistd.h>. + (update_window, update_frame_1, init_display): Remove local extern + declarations. + + * dispextern.h (add_to_log): Remove declaration. + (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) + (x_frame_get_and_record_arg, x_default_parameter): Add const. + + * dired.c (scmp): Add const. + (directory_files_internal): Remove local extern declaration. + + * data.c (Finteractive_form): Use const. + + * composite.c (syms_of_composite): Remove local extern declarations. + + * charset.c (add_to_log): Remove declaration. + + * character.c (strwidth, parse_str_to_multibyte): Add const. + + * character.h (strwidth, parse_str_to_multibyte): Likewise. + + * buffer.c (Fset_buffer_multibyte): Remove local extern declaration. + + * lisp.h (Fkill_emacs): Mark as NO_RETURN. + (Lisp_Subr): Make doc and intspec constant. + (QCsize, Qspace, Qcenter, QCalign_to, QCdata, QCfile, QCtype) + (Qlocal, Qapply, Qnormal, QCfamily, QCweight, QCslant, QCwidth) + (QCheight, QCsize, QCname, QCwidth, QCforeground) + (QCbackground, add_to_log, stack_base, Vmark_even_if_inactive) + (display_arg): Add declarations. + +2010-07-27 Christoph Scholtes <cschol2112@gmail.com> + + * minibuf.c (Fread_buffer): Doc fix (bug#6528). + + * window.c (Fwindow_height): Doc fix (bug#6518). + +2010-07-27 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <fringe-indicator-alist>: Doc fix. + +2010-07-26 Dan Nicolaescu <dann@ics.uci.edu> + + * keyboard.c (Ftop_level, Fexit_recursive_edit) + (Fabort_recursive_edit): Remove return statements in NO_RETURN + functions. + + * frame.h (Qtty_color_mode): Add declaration. + + * lisp.h (Ftop_level, Fexit_recursive_edit) + (Fabort_recursive_edit): Mark as NO_RETURN. + +2010-07-26 Kenichi Handa <handa@m17n.org> + + * font.c (Ffont_shape_gstring): Terminate GSTRING by nil if the + number of glyphs gets smaller than the original length. (Bug#6621) + +2010-07-26 Juanma Barranquero <lekktu@gmail.com> + + * lread.c (unreadpure, mapatoms_1): Make static. + +2010-07-25 Juanma Barranquero <lekktu@gmail.com> + + * terminfo.c (tparam): Fix prototype of tparm. + +2010-07-25 Andreas Schwab <schwab@linux-m68k.org> + + * emacs.c (main) [PROFILING]: Use __executable_start if defined to + find start of text segment. + * dispnew.c (safe_bcopy): Don't define if HAVE___EXECUTABLE_START + is defined. + + * callproc.c (set_initial_environment): Avoid unbalanced braces. + +2010-07-25 Ken Brown <kbrown@cornell.edu> + + * vm-limit.c (check_memory_limits): Fix previous change; + accidentally reverted an earlier change. + +2010-07-25 Ken Brown <kbrown@cornell.edu> + + * mem-limits.h (BSD4_2) [cygwin]: Don't define here; instead... + * vm-limit.c: ...add 'defined (CYGWIN)' here (Bug#6715). + +2010-07-25 Juanma Barranquero <lekktu@gmail.com> + + * callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT. + * dired.c (opendir, readdir): Fix prototypes. + * editfns.c (w32_get_internal_run_time): Fix prototypes. + * keyboard.c (input_available_signal): Declare inside #ifdef SIGIO. + * ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes. + (telldir): Remove declaration. + * ralloc.c (real_morecore, __morecore): Fix prototypes. + * sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA. + * syssignal.h (strsignal): Fix prototype. + * term.c (tparam): Fix prototype. + (term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1) + (term_get_fkeys): Set inside "#ifndef DOS_NT". + * vm-limit.c (check_memory_limits): Fix prototypes of real_morecore + and __morecore. + * w32gui.h (XParseGeometry): Fix prototype. + * w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes. + * w32term.c (my_set_focus): Declare inside #if 0. + * w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init) + (w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit) + (drain_message_queue, get_next_msg, post_msg, parse_button) + (ClipboardSequence_Proc): Fix prototypes. + (wait_for_sync): Remove declaration. + +2010-07-24 Juanma Barranquero <lekktu@gmail.com> + + * w32fns.c (w32_to_x_color): Remove, unused. + +2010-07-24 Andreas Schwab <schwab@linux-m68k.org> + + * lisp.h: Remove leftover P_. + +2010-07-24 Dan Nicolaescu <dann@ics.uci.edu> + + * ecrt0.c, unexalpha.c: Remove files, unused. + +2010-07-24 Andreas Schwab <schwab@linux-m68k.org> + + * cmds.c (internal_self_insert): Make static. + * lisp.h (internal_self_insert): Remove declaration. + 2010-07-23 Juanma Barranquero <lekktu@gmail.com> + * alloc.c (free_float): + * font.c [ENABLE_CHECKING] (font_match_xlfd, font_check_xlfd_parse): + * frame.c (delete_frame_handler): + * ralloc.c (reorder_bloc): + * w32menu.c (menubar_id_to_frame, add_left_right_boundary): + Remove unused static functions. + * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS"; it is called only from NS code. @@ -2739,7 +3612,7 @@ (struct xsettings): Add font and tb_style, set xft stuff inside #ifdef HAVE_XFT. (something_changedCB): store_font_changed_event is now - store_config_changed_event + store_config_changed_event. (parse_settings): Rename from parse_xft_settings. Read non-xft xsettings outside #ifdef HAVE_XFT. (read_settings): Renamed from read_xft_settings. @@ -3241,8 +4114,8 @@ (syms_of_xsettings): Initialize current_font. defsubr Sfont_get_system_normal_font. - * xsettings.h (Ffont_get_system_normal_font, - xsettings_get_system_normal_font): Declare. + * xsettings.h (Ffont_get_system_normal_font) + (xsettings_get_system_normal_font): Declare. * xfns.c (extern xlwmenu_default_font): Remove. (Fx_create_frame): Remove setting of xlwmenu_default_font, moved @@ -4488,7 +5361,7 @@ (scroll_end_callback): Remove. (xg_create_scroll_bar): Add parameter end_callback, bind it to button-release-event. Replace value-changed event with change-value, - bug #5177, + bug #5177. (xg_event_is_for_scrollbar): Only return true if button is less than 4, bug #5177. @@ -4509,7 +5382,7 @@ 2009-12-12 Eli Zaretskii <eliz@gnu.org> - * dispextern.h (struct text_pos): Use EMACS_INT; + * dispextern.h (struct text_pos): Use EMACS_INT. (struct glyph): Use EMACS_INT for charpos. (struct it): Use EMACS_INT for stop_charpos, end_charpos, region_beg_charpos, region_end_charpos, @@ -5044,7 +5917,7 @@ (store_symval_forwarding): Take into account the fact that Ints can now have more than one tag. * buffer.c (syms_of_buffer): Use LISP_INT_TAG. - buffer_slot_type_mismatch): + (buffer_slot_type_mismatch): * xfaces.c (face_attr_equal_p): * print.c (print_object): * alloc.c (mark_maybe_object, mark_object, survives_gc_p): @@ -12075,8 +12948,8 @@ 2008-07-15 Chris Hall <chris@web.workinglinux.com> (tiny change) YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - (make_initial_frame): Call init_frame_faces(f) in CANNOT_DUMP case -- - fix crash due to different init order. + * frame.c (make_initial_frame): Call init_frame_faces(f) in + CANNOT_DUMP case -- fix crash due to different init order. 2008-07-15 Adrian Robert <Adrian.B.Robert@gmail.com> @@ -12273,7 +13146,7 @@ * m/macppc.h: * m/alpha.h: Use GNU_LINUX instead of LINUX. Reorganize conditionals. - * m/ibms390x.h (XINT, XUINT): Don't define, same as the default + * m/ibms390x.h (XINT, XUINT): Don't define, same as the default. (SPECIAL_EMACS_INT): * m/ia64.h (SPECIAL_EMACS_INT): * m/amdx86-64.h (SPECIAL_EMACS_INT): @@ -20905,7 +21778,7 @@ * charset.c (charset_ordered_list_tick): New variable. (Fdefine_charset_internal): Increment charset_ordered_list_tick. (Funify_charset): New optional arg DEUNIFY. If it is non-nil, - deunify intead of unify a charset. + deunify instead of unify a charset. (string_xstring_p): Add `const' to local variables. (find_charsets_in_text): Add `const' to arguments and local variables. (encode_char): Adjust for the change of Funify_charset. Fix diff --git a/src/alloc.c b/src/alloc.c index 7c8081f03df..23debbdf2e8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -448,7 +448,6 @@ static void *min_heap_address, *max_heap_address; static struct mem_node mem_z; #define MEM_NIL &mem_z -static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); static void lisp_free (POINTER_TYPE *); static void mark_stack (void); @@ -1509,8 +1508,7 @@ mark_interval_tree (register INTERVAL tree) can't create number objects in macros. */ #ifndef make_number Lisp_Object -make_number (n) - EMACS_INT n; +make_number (EMACS_INT n) { Lisp_Object obj; obj.s.val = n; @@ -2538,16 +2536,6 @@ init_float (void) } -/* Explicitly free a float cell by putting it on the free-list. */ - -static void -free_float (struct Lisp_Float *ptr) -{ - ptr->u.chain = float_free_list; - float_free_list = ptr; -} - - /* Return a new float object with value FLOAT_VALUE. */ Lisp_Object @@ -2992,10 +2980,8 @@ See also the function `vector'. */) See the function `funvec' for more detail. */ Lisp_Object -make_funvec (kind, num_nil_slots, num_params, params) - Lisp_Object kind; - int num_nil_slots, num_params; - Lisp_Object *params; +make_funvec (Lisp_Object kind, int num_nil_slots, int num_params, + Lisp_Object *params) { int param_index; Lisp_Object funvec; @@ -3048,9 +3034,7 @@ implemented values of KIND, and their meaning, are: time of the call; see the `curry' function. usage: (funvec KIND &rest PARAMS) */) - (nargs, args) - register int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return make_funvec (args[0], 0, nargs - 1, args + 1); } diff --git a/src/bidi.c b/src/bidi.c index e17676ea6d7..b31de597688 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1774,6 +1774,6 @@ bidi_dump_cached_states (void) fputs ("\n", stderr); fputs ("pos ", stderr); for (i = 0; i < bidi_cache_idx; i++) - fprintf (stderr, "%*d", ndigits, bidi_cache[i].charpos); + fprintf (stderr, "%*ld", ndigits, (long)bidi_cache[i].charpos); fputs ("\n", stderr); } diff --git a/src/buffer.c b/src/buffer.c index bfef1c369ef..86a638eb230 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -106,8 +106,6 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; int last_per_buffer_idx; EXFUN (Fset_buffer, 1); -void set_buffer_internal (struct buffer *b); -void set_buffer_internal_1 (struct buffer *b); static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); @@ -162,7 +160,7 @@ Lisp_Object Qget_file_buffer; Lisp_Object Qoverlayp; -Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string; +Lisp_Object Qpriority, Qevaporate, Qbefore_string, Qafter_string; Lisp_Object Qmodification_hooks; Lisp_Object Qinsert_in_front_hooks; @@ -174,8 +172,6 @@ static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT); static Lisp_Object buffer_lisp_local_variables (struct buffer *); -extern char * emacs_strerror (int); - /* For debugging; temporary. See set_buffer_internal. */ /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ @@ -2512,7 +2508,6 @@ current buffer is cleared. */) if (!EQ (old_undo, Qt)) { /* Represent all the above changes by a special undo entry. */ - extern Lisp_Object Qapply; current_buffer->undo_list = Fcons (list3 (Qapply, intern ("set-buffer-multibyte"), NILP (flag) ? Qt : Qnil), @@ -5288,7 +5283,7 @@ init_buffer (void) } while (0) static void -defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring, +defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, Lisp_Object *address, Lisp_Object type, char *doc) { struct Lisp_Symbol *sym; @@ -5349,8 +5344,6 @@ syms_of_buffer (void) staticpro (&Qget_file_buffer); Qpriority = intern_c_string ("priority"); staticpro (&Qpriority); - Qwindow = intern_c_string ("window"); - staticpro (&Qwindow); Qbefore_string = intern_c_string ("before-string"); staticpro (&Qbefore_string); Qafter_string = intern_c_string ("after-string"); @@ -5900,14 +5893,14 @@ fringe indicator. INDICATOR specifies the logical indicator type which is one of the following symbols: `truncation' , `continuation', `overlay-arrow', -`top', `bottom', `up', `down', `one-line', `empty-line', or `unknown'. +`top', `bottom', `top-bottom', `up', `down', empty-line', or `unknown'. -BITMAPS is list of symbols (LEFT RIGHT [LEFT1 RIGHT1]) which specifies +BITMAPS is a list of symbols (LEFT RIGHT [LEFT1 RIGHT1]) which specifies the actual bitmap shown in the left or right fringe for the logical indicator. LEFT and RIGHT are the bitmaps shown in the left and/or right fringe for the specific indicator. The LEFT1 or RIGHT1 bitmaps -are used only for the `bottom' and `one-line' indicators when the last -\(only) line in has no final newline. BITMAPS may also be a single +are used only for the `bottom' and `top-bottom' indicators when the +last (only) line has no final newline. BITMAPS may also be a single symbol which is used in both left and right fringes. */); DEFVAR_PER_BUFFER ("fringe-cursor-alist", diff --git a/src/callint.c b/src/callint.c index fa0be112bea..ae11c7cb24d 100644 --- a/src/callint.c +++ b/src/callint.c @@ -29,21 +29,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "window.h" #include "keymap.h" -extern Lisp_Object Qcursor_in_echo_area; -extern Lisp_Object Qfile_directory_p; -extern Lisp_Object Qonly; - Lisp_Object Vcurrent_prefix_arg, Qminus, Qplus; Lisp_Object Qcall_interactively; Lisp_Object Vcommand_history; -extern Lisp_Object Vhistory_length; -extern Lisp_Object Vthis_original_command, real_this_command; -extern int history_delete_duplicates; - Lisp_Object Vcommand_debug_status, Qcommand_debug_status; Lisp_Object Qenable_recursive_minibuffers; -extern Lisp_Object Qface, Qminibuffer_prompt; /* Non-nil means treat the mark as active even if mark_active is 0. */ @@ -158,7 +149,7 @@ quotify_args (Lisp_Object exp) return exp; } -char *callint_argfuns[] +static const char *callint_argfuns[] = {"", "point", "mark", "region-beginning", "region-end"}; static void diff --git a/src/callproc.c b/src/callproc.c index 4286ab1ae29..ca9ff93a6d9 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -102,8 +102,6 @@ Lisp_Object Vconfigure_info_directory, Vshared_game_score_directory; /* Pattern used by call-process-region to make temp files. */ static Lisp_Object Vtemp_file_name_pattern; -extern Lisp_Object Vtemporary_file_directory; - Lisp_Object Vshell_file_name; Lisp_Object Vprocess_environment, Vinitial_environment; @@ -984,7 +982,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args))); } +#ifndef WINDOWSNT static int relocate_fd (int fd, int minfd); +#endif static char ** add_env (char **env, char **new_env, char *string) @@ -1113,7 +1113,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L char **p, **q; register int new_length; Lisp_Object display = Qnil; - + new_length = 0; for (tem = Vprocess_environment; @@ -1149,7 +1149,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L but with corrected value. */ if (egetenv ("PWD")) *new_env++ = pwd_var; - + if (STRINGP (display)) { int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1; @@ -1179,7 +1179,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L } } - + #ifdef WINDOWSNT prepare_standard_handles (in, out, err, handles); set_process_dir (SDATA (current_dir)); @@ -1265,6 +1265,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L #endif /* not MSDOS */ } +#ifndef WINDOWSNT /* Move the file descriptor FD so that its number is not less than MINFD. If the file descriptor is moved at all, the original is freed. */ static int @@ -1298,6 +1299,7 @@ relocate_fd (int fd, int minfd) return new; } } +#endif /* not WINDOWSNT */ static int getenv_internal_1 (const char *var, int varlen, char **value, int *valuelen, @@ -1526,13 +1528,12 @@ void set_initial_environment (void) { register char **envp; -#ifndef CANNOT_DUMP - if (initialized) - { +#ifdef CANNOT_DUMP + Vprocess_environment = Qnil; #else - { - Vprocess_environment = Qnil; + if (initialized) #endif + { for (envp = environ; *envp; envp++) Vprocess_environment = Fcons (build_string (*envp), Vprocess_environment); diff --git a/src/ccl.c b/src/ccl.c index b5a4f26197c..f418c65b01e 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -72,8 +72,6 @@ Lisp_Object Vtranslation_hash_table_vector; #define GET_HASH_TABLE(id) \ (XHASH_TABLE (XCDR(XVECTOR(Vtranslation_hash_table_vector)->contents[(id)]))) -extern int charset_unicode; - /* CCL (Code Conversion Language) is a simple language which has operations on one input buffer, one output buffer, and 7 registers. The syntax of CCL is described in `ccl.el'. Emacs Lisp function diff --git a/src/character.c b/src/character.c index 470157b36ed..c4a3a008bcd 100644 --- a/src/character.c +++ b/src/character.c @@ -430,7 +430,7 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i occupies on the screen. */ int -strwidth (unsigned char *str, int len) +strwidth (const unsigned char *str, int len) { return c_string_width (str, len, -1, NULL, NULL); } @@ -710,9 +710,9 @@ str_as_multibyte (unsigned char *str, int len, int nbytes, int *nchars) `str_to_multibyte'. */ int -parse_str_to_multibyte (unsigned char *str, int len) +parse_str_to_multibyte (const unsigned char *str, int len) { - unsigned char *endp = str + len; + const unsigned char *endp = str + len; int bytes; for (bytes = 0; str < endp; str++) diff --git a/src/character.h b/src/character.h index b32dabba12e..8726b2ae1d6 100644 --- a/src/character.h +++ b/src/character.h @@ -605,13 +605,13 @@ extern int translate_char (Lisp_Object, int c); extern int char_printable_p (int c); extern void parse_str_as_multibyte (const unsigned char *, int, int *, int *); -extern int parse_str_to_multibyte (unsigned char *, int); +extern int parse_str_to_multibyte (const unsigned char *, int); extern int str_as_multibyte (unsigned char *, int, int, int *); extern int str_to_multibyte (unsigned char *, int, int); extern int str_as_unibyte (unsigned char *, int); extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, EMACS_INT, int); -extern int strwidth (unsigned char *, int); +extern int strwidth (const unsigned char *, int); extern int c_string_width (const unsigned char *, int, int, int *, int *); extern int lisp_string_width (Lisp_Object, int, int *, int *); diff --git a/src/charset.c b/src/charset.c index 84df00da63a..036d7146db6 100644 --- a/src/charset.c +++ b/src/charset.c @@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include <ctype.h> #include <sys/types.h> @@ -127,13 +128,6 @@ int inhibit_load_charset_map; Lisp_Object Vcurrent_iso639_language; -/* Defined in chartab.c */ -extern void -map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), - Lisp_Object function, Lisp_Object table, - Lisp_Object arg, struct charset *charset, - unsigned from, unsigned to); - #define CODE_POINT_TO_INDEX(charset, code) \ ((charset)->code_linear_p \ ? (code) - (charset)->min_code \ @@ -472,8 +466,6 @@ read_hex (FILE *fp, int *eof) return n; } -extern Lisp_Object Qfile_name_handler_alist; - /* Return a mapping vector for CHARSET loaded from MAPFILE. Each line of MAPFILE has this form 0xAAAA 0xCCCC @@ -491,8 +483,6 @@ extern Lisp_Object Qfile_name_handler_alist; Note that this function uses `openp' to open MAPFILE but ignores `file-name-handler-alist' to avoid running any Lisp code. */ -extern void add_to_log (char *, Lisp_Object, Lisp_Object); - static void load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int control_flag) { @@ -1276,7 +1266,7 @@ usage: (define-charset-internal ...) */) static int define_charset_internal (Lisp_Object name, int dimension, - unsigned char *code_space, + const unsigned char *code_space, unsigned min_code, unsigned max_code, int iso_final, int iso_revision, int emacs_mule_id, int ascii_compatible, int supplementary, @@ -2082,23 +2072,22 @@ that case, find the charset from what supported by that coding system. */) charset = CHAR_CHARSET (XINT (ch)); else { - Lisp_Object charset_list; - if (CONSP (restriction)) { - for (charset_list = Qnil; CONSP (restriction); - restriction = XCDR (restriction)) + int c = XFASTINT (ch); + + for (; CONSP (restriction); restriction = XCDR (restriction)) { - int id; + struct charset *charset; - CHECK_CHARSET_GET_ID (XCAR (restriction), id); - charset_list = Fcons (make_number (id), charset_list); + CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset); + if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset)) + return XCAR (restriction); } - charset_list = Fnreverse (charset_list); + return Qnil; } - else - charset_list = coding_system_charset_list (restriction); - charset = char_charset (XINT (ch), charset_list, NULL); + restriction = coding_system_charset_list (restriction); + charset = char_charset (XINT (ch), restriction, NULL); if (! charset) return Qnil; } @@ -2249,6 +2238,69 @@ Return charset identification number of CHARSET. */) return make_number (id); } +struct charset_sort_data +{ + Lisp_Object charset; + int id; + int priority; +}; + +static int +charset_compare (const void *d1, const void *d2) +{ + const struct charset_sort_data *data1 = d1, *data2 = d2; + return (data1->priority - data2->priority); +} + +DEFUN ("sort-charsets", Fsort_charsets, Ssort_charsets, 1, 1, 0, + doc: /* Sort charset list CHARSETS by a priority of each charset. +Return the sorted list. CHARSETS is modified by side effects. +See also `charset-priority-list' and `set-charset-priority'. */) + (Lisp_Object charsets) +{ + Lisp_Object len = Flength (charsets); + int n = XFASTINT (len), i, j, done; + Lisp_Object tail, elt, attrs; + struct charset_sort_data *sort_data; + int id, min_id, max_id; + USE_SAFE_ALLOCA; + + if (n == 0) + return Qnil; + SAFE_ALLOCA (sort_data, struct charset_sort_data *, sizeof (*sort_data) * n); + for (tail = charsets, i = 0; CONSP (tail); tail = XCDR (tail), i++) + { + elt = XCAR (tail); + CHECK_CHARSET_GET_ATTR (elt, attrs); + sort_data[i].charset = elt; + sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs)); + if (i == 0) + min_id = max_id = id; + else if (id < min_id) + min_id = id; + else if (id > max_id) + max_id = id; + } + for (done = 0, tail = Vcharset_ordered_list, i = 0; + done < n && CONSP (tail); tail = XCDR (tail), i++) + { + elt = XCAR (tail); + id = XFASTINT (elt); + if (id >= min_id && id <= max_id) + for (j = 0; j < n; j++) + if (sort_data[j].id == id) + { + sort_data[j].priority = i; + done++; + } + } + qsort (sort_data, n, sizeof *sort_data, charset_compare); + for (i = 0, tail = charsets; CONSP (tail); tail = XCDR (tail), i++) + XSETCAR (tail, sort_data[i].charset); + SAFE_FREE (); + return charsets; +} + void init_charset (void) @@ -2351,6 +2403,7 @@ syms_of_charset (void) defsubr (&Scharset_priority_list); defsubr (&Sset_charset_priority); defsubr (&Scharset_id_internal); + defsubr (&Ssort_charsets); DEFVAR_LISP ("charset-map-path", &Vcharset_map_path, doc: /* *List of directories to search for charset map files. */); diff --git a/src/charset.h b/src/charset.h index 095dcefe15b..dbe9c776a0d 100644 --- a/src/charset.h +++ b/src/charset.h @@ -517,8 +517,6 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; #define EMACS_MULE_LEADING_CODE_PRIVATE_21 0x9C /* 2/2 */ #define EMACS_MULE_LEADING_CODE_PRIVATE_22 0x9D /* 2/2 */ -extern struct charset *emacs_mule_charset[256]; - extern Lisp_Object Qcharsetp; diff --git a/src/cmds.c b/src/cmds.c index 81f975a9885..4cb6ca199e7 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -43,8 +43,7 @@ Lisp_Object Vself_insert_face; /* This is the command that set up Vself_insert_face. */ Lisp_Object Vself_insert_face_command; -extern Lisp_Object Qface; -extern Lisp_Object Vtranslation_table_for_input; +static int internal_self_insert (int, int); DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, doc: /* Return buffer position N characters after (before if N negative) point. */) @@ -114,7 +113,8 @@ right or to the left on the screen. This is in contrast with DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "^p", doc: /* Move N lines forward (backward if N is negative). -Precisely, if point is on line I, move to the start of line I + N. +Precisely, if point is on line I, move to the start of line I + N +\("start of line" in the logical order). If there isn't room, go as far as possible (no error). Returns the count of lines left to move. If moving forward, that is N - number of lines moved; if backward, N + number moved. @@ -158,7 +158,7 @@ successfully moved (for the return value). */) } DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, 0, 1, "^p", - doc: /* Move point to beginning of current line. + doc: /* Move point to beginning of current line (in the logical order). With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. @@ -182,7 +182,7 @@ instead. For instance, `(forward-line 0)' does the same thing as } DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "^p", - doc: /* Move point to end of current line. + doc: /* Move point to end of current line (in the logical order). With argument N not nil or 1, move forward N - 1 lines first. If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. @@ -347,7 +347,7 @@ After insertion, the value of `auto-fill-function' is called if the static Lisp_Object Qexpand_abbrev; -int +static int internal_self_insert (int c, int noautofill) { int hairy = 0; diff --git a/src/coding.c b/src/coding.c index dcd31fe9f28..6012978b60a 100644 --- a/src/coding.c +++ b/src/coding.c @@ -303,7 +303,6 @@ Lisp_Object Vcoding_system_hash_table; Lisp_Object Qcoding_system, Qcoding_aliases, Qeol_type; Lisp_Object Qunix, Qdos; -extern Lisp_Object Qmac; /* frame.c */ Lisp_Object Qbuffer_file_coding_system; Lisp_Object Qpost_read_conversion, Qpre_write_conversion; Lisp_Object Qdefault_char; @@ -317,7 +316,6 @@ Lisp_Object QCdecode_translation_table, QCencode_translation_table; Lisp_Object QCpost_read_conversion, QCpre_write_conversion; Lisp_Object QCascii_compatible_p; -extern Lisp_Object Qinsert_file_contents, Qwrite_region; Lisp_Object Qcall_process, Qcall_process_region; Lisp_Object Qstart_process, Qopen_network_stream; Lisp_Object Qtarget_idx; @@ -325,8 +323,6 @@ Lisp_Object Qtarget_idx; Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; Lisp_Object Qinterrupted, Qinsufficient_memory; -extern Lisp_Object Qcompletion_ignore_case; - /* If a symbol has this property, evaluate the value to define the symbol as a coding system. */ static Lisp_Object Qcoding_system_define_form; @@ -3906,7 +3902,7 @@ decode_coding_iso_2022 (struct coding_system *coding) int size; ONE_MORE_BYTE (dim); - if (dim < 0 || dim > 4) + if (dim < '0' || dim > '4') goto invalid_code; ONE_MORE_BYTE (M); if (M < 128) @@ -4101,8 +4097,8 @@ decode_coding_iso_2022 (struct coding_system *coding) #define ENCODE_DESIGNATION(charset, reg, coding) \ do { \ unsigned char final_char = CHARSET_ISO_FINAL (charset); \ - char *intermediate_char_94 = "()*+"; \ - char *intermediate_char_96 = ",-./"; \ + const char *intermediate_char_94 = "()*+"; \ + const char *intermediate_char_96 = ",-./"; \ int revision = -1; \ int c; \ \ diff --git a/src/coding.h b/src/coding.h index 75ed84bef71..0caa5b2f96f 100644 --- a/src/coding.h +++ b/src/coding.h @@ -802,6 +802,9 @@ extern struct coding_system safe_terminal_coding; /* Default coding systems used for process I/O. */ extern Lisp_Object Vdefault_process_coding_system; +/* Char table for translating Quail and self-inserting input. */ +extern Lisp_Object Vtranslation_table_for_input; + /* Function to call to force a user to force select a propert coding system. */ extern Lisp_Object Vselect_safe_coding_system_function; diff --git a/src/composite.c b/src/composite.c index 4568698619f..392da1ceba1 100644 --- a/src/composite.c +++ b/src/composite.c @@ -848,8 +848,6 @@ fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lis return header; } -extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); - static void fill_gstring_body (Lisp_Object gstring) { @@ -1939,7 +1937,6 @@ syms_of_composite (void) /* Make a hash table for static composition. */ { Lisp_Object args[6]; - extern Lisp_Object QCsize; args[0] = QCtest; args[1] = Qequal; @@ -1959,8 +1956,6 @@ syms_of_composite (void) /* Make a hash table for glyph-string. */ { Lisp_Object args[6]; - extern Lisp_Object QCsize; - args[0] = QCtest; args[1] = Qequal; args[2] = QCweakness; diff --git a/src/config.in b/src/config.in index 40b62633446..ea17a54d913 100644 --- a/src/config.in +++ b/src/config.in @@ -27,6 +27,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define EMACS_CONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to 1 if the mktime function is broken. */ #undef BROKEN_MKTIME @@ -150,6 +153,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME +/* Define to 1 if you have the <dirent.h> header file. */ +#undef HAVE_DIRENT_H + /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 @@ -728,6 +734,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the <util.h> header file. */ +#undef HAVE_UTIL_H + /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES @@ -801,6 +810,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you want to use the X window system. */ #undef HAVE_X_WINDOWS +/* Define to 1 if you have the `__executable_start' function. */ +#undef HAVE___EXECUTABLE_START + /* Define to 1 if you have the `__fpending' function. */ #undef HAVE___FPENDING @@ -967,6 +979,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if using an X toolkit. */ #undef USE_X_TOOLKIT +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* Define this to check for malloc buffer overrun. */ #undef XMALLOC_OVERRUN_CHECK diff --git a/src/data.c b/src/data.c index cccd53f6076..9490b7ac79a 100644 --- a/src/data.c +++ b/src/data.c @@ -82,7 +82,8 @@ Lisp_Object Qnumberp, Qnumber_or_marker_p; Lisp_Object Qinteger; static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay; -static Lisp_Object Qfloat, Qwindow_configuration, Qwindow; +Lisp_Object Qwindow; +static Lisp_Object Qfloat, Qwindow_configuration; Lisp_Object Qprocess; static Lisp_Object Qcompiled_function, Qfunction_vector, Qbuffer, Qframe, Qvector; static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; @@ -416,8 +417,7 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p, DEFUN ("funvecp", Ffunvecp, Sfunvecp, 1, 1, 0, doc: /* Return t if OBJECT is a `function vector' object. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return FUNVECP (object) ? Qt : Qnil; } @@ -675,8 +675,6 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, return definition; } -extern Lisp_Object Qfunction_documentation; - DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. Associates the function with the current load file, if any. @@ -761,7 +759,7 @@ Value, if non-nil, is a list \(interactive SPEC). */) if (SUBRP (fun)) { - char *spec = XSUBR (fun)->intspec; + const char *spec = XSUBR (fun)->intspec; if (spec) return list2 (Qinteractive, (*spec != '(') ? build_string (spec) : @@ -1876,6 +1874,7 @@ BUFFER defaults to the current buffer. */) Lisp_Object tail, elt, tmp; struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); XSETBUFFER (tmp, buf); + XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) { @@ -2512,8 +2511,6 @@ enum arithop static Lisp_Object float_arith_driver (double, int, enum arithop, int, Lisp_Object *); -extern Lisp_Object fmod_float (Lisp_Object, Lisp_Object); - Lisp_Object arith_driver (enum arithop code, int nargs, register Lisp_Object *args) { diff --git a/src/deps.mk b/src/deps.mk index e9269397720..8eeed3822d0 100644 --- a/src/deps.mk +++ b/src/deps.mk @@ -190,7 +190,7 @@ undo.o: undo.c buffer.h commands.h window.h dispextern.h lisp.h $(config_h) unexaix.o: unexaix.c lisp.h $(config_h) unexalpha.o: unexalpha.c $(config_h) unexcw.o: unexcw.c lisp.h $(config_h) -unexec.o: unexec.c lisp.h $(config_h) +unexcoff.o: unexcoff.c lisp.h $(config_h) unexelf.o: unexelf.c $(config_h) unexhp9k800.o: unexhp9k800.c $(config_h) unexmacosx.o: unexmacosx.c $(config_h) diff --git a/src/dired.c b/src/dired.c index cdb4545e81c..d72ea54a518 100644 --- a/src/dired.c +++ b/src/dired.c @@ -48,32 +48,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ Since applying strlen to the name always works, we'll just do that. */ #define NAMLEN(p) strlen (p->d_name) -#ifdef SYSV_SYSTEM_DIR +#ifdef HAVE_DIRENT_H #include <dirent.h> #define DIRENTRY struct dirent -#else /* not SYSV_SYSTEM_DIR */ +#else /* not HAVE_DIRENT_H */ -#ifdef MSDOS -#include <dirent.h> -#else #include <sys/dir.h> -#endif - #include <sys/stat.h> -#ifndef MSDOS #define DIRENTRY struct direct -extern DIR *opendir (); -extern struct direct *readdir (); +extern DIR *opendir (char *); +extern struct direct *readdir (DIR *); -#endif /* not MSDOS */ -#endif /* not SYSV_SYSTEM_DIR */ +#endif /* HAVE_DIRENT_H */ -/* Some versions of Cygwin don't have d_ino in `struct dirent'. */ -#if defined(MSDOS) || defined(__CYGWIN__) +#ifdef MSDOS #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) #else #define DIRENTRY_NONEMPTY(p) ((p)->d_ino) @@ -90,7 +82,9 @@ extern struct direct *readdir (); #include "blockinput.h" /* Returns a search buffer, with a fastmap allocated and ready to go. */ -extern struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, Lisp_Object, int, int); +extern struct re_pattern_buffer *compile_pattern (Lisp_Object, + struct re_registers *, + Lisp_Object, int, int); /* From filemode.c. Can't go in Lisp.h because of `stat'. */ extern void filemodestring (struct stat *, char *); @@ -102,9 +96,6 @@ extern void filemodestring (struct stat *, char *); #define lstat stat #endif -extern int completion_ignore_case; -extern Lisp_Object Qcompletion_ignore_case; -extern Lisp_Object Vcompletion_regexp_list; extern Lisp_Object Vw32_get_true_file_attributes; Lisp_Object Vcompletion_ignored_extensions; @@ -115,7 +106,7 @@ Lisp_Object Qfile_name_all_completions; Lisp_Object Qfile_attributes; Lisp_Object Qfile_attributes_lessp; -static int scmp (unsigned char *, unsigned char *, int); +static int scmp (const unsigned char *, const unsigned char *, int); #ifdef WINDOWSNT Lisp_Object @@ -206,7 +197,6 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m #ifdef WINDOWSNT if (attrs) { - extern Lisp_Object Qlocal; extern int is_slow_fs (const char *); /* Do this only once to avoid doing it (in w32.c:stat) for each @@ -813,7 +803,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v else number of chars that match at the beginning. */ static int -scmp (register unsigned char *s1, register unsigned char *s2, int len) +scmp (const unsigned char *s1, const unsigned char *s2, int len) { register int l = len; diff --git a/src/dispextern.h b/src/dispextern.h index 5ca7e813a1e..c36db91ea02 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2050,7 +2050,7 @@ struct it /* C string to iterate over. Non-null means get characters from this string, otherwise characters are read from current_buffer or it->string. */ - unsigned char *s; + const unsigned char *s; /* Number of characters in the string (s, or it->string) we iterate over. */ @@ -2430,7 +2430,6 @@ struct it #define PRODUCE_GLYPHS(IT) \ do { \ - extern int inhibit_free_realized_faces; \ if ((IT)->glyph_row != NULL && (IT)->bidi_p) \ { \ if ((IT)->bidi_it.paragraph_dir == R2L) \ @@ -2951,7 +2950,6 @@ extern Lisp_Object Qtool_bar; extern Lisp_Object Vshow_trailing_whitespace; extern int mode_line_in_non_selected_windows; extern int redisplaying_p; -extern void add_to_log (char *, Lisp_Object, Lisp_Object); extern int help_echo_showing_p; extern int current_mode_line_height, current_header_line_height; extern Lisp_Object help_echo_string, help_echo_window; @@ -3032,6 +3030,7 @@ extern int x_intersect_rectangles (XRectangle *, XRectangle *, /* Defined in fringe.c */ +extern Lisp_Object Voverflow_newline_into_fringe; int lookup_fringe_bitmap (Lisp_Object); void draw_fringe_bitmap (struct window *, struct glyph_row *, int); void draw_row_fringe_bitmaps (struct window *, struct glyph_row *); @@ -3243,15 +3242,9 @@ void clear_glyph_row (struct glyph_row *); void prepare_desired_row (struct glyph_row *); int line_hash_code (struct glyph_row *); void set_window_update_flags (struct window *, int); -void redraw_frame (struct frame *); -void redraw_garbaged_frames (void); -int scroll_cost (struct frame *, int, int, int); -int update_frame (struct frame *, int, int); void update_single_window (struct window *, int); -int scrolling (struct frame *); void do_pending_window_change (int); void change_frame_size (struct frame *, int, int, int, int, int); -void bitch_at_user (void); void init_display (void); void syms_of_display (void); extern Lisp_Object Qredisplay_dont_pause; @@ -3282,18 +3275,18 @@ extern void tty_set_terminal_modes (struct terminal *); extern void tty_reset_terminal_modes (struct terminal *); extern void tty_turn_off_insert (struct tty_display_info *); extern void tty_turn_off_highlight (struct tty_display_info *); -extern int string_cost (char *); -extern int per_line_cost (char *); +extern int string_cost (const char *); +extern int per_line_cost (const char *); extern void calculate_costs (struct frame *); extern void produce_glyphs (struct it *); extern void produce_special_glyphs (struct it *, enum display_element_type); extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); extern void set_tty_color_mode (struct tty_display_info *, struct frame *); extern struct terminal *get_tty_terminal (Lisp_Object, int); -extern struct terminal *get_named_tty (char *); +extern struct terminal *get_named_tty (const char *); EXFUN (Ftty_type, 1); extern void create_tty_output (struct frame *); -extern struct terminal *init_tty (char *, char *, int); +extern struct terminal *init_tty (const char *, const char *, int); /* Defined in scroll.c */ @@ -3322,18 +3315,18 @@ enum resource_types }; extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object, - Lisp_Object, char *, char *class, + Lisp_Object, const char *, const char *class, enum resource_types); extern Lisp_Object x_frame_get_arg (struct frame *, Lisp_Object, - Lisp_Object, char *, char *, + Lisp_Object, const char *, const char *, enum resource_types); -extern Lisp_Object x_frame_get_and_record_arg ( - struct frame *, Lisp_Object, - Lisp_Object, char *, char *, +extern Lisp_Object x_frame_get_and_record_arg (struct frame *, Lisp_Object, + Lisp_Object, + const char *, const char *, enum resource_types); extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object, Lisp_Object, Lisp_Object, - char *, char *, + const char *, const char *, enum resource_types); #endif /* HAVE_WINDOW_SYSTEM */ diff --git a/src/dispnew.c b/src/dispnew.c index fe64143ec07..35893872c73 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -66,12 +66,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "systime.h" #include <errno.h> -/* To get the prototype for `sleep'. */ - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - /* Get number of chars of output now in the buffer of a stdio stream. This ought to be built in in stdio, but it isn't. Some s- files override this because their stdio internals differ. */ @@ -436,7 +430,7 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history, #endif /* GLYPH_DEBUG == 0 */ -#ifdef PROFILING +#if defined PROFILING && !HAVE___EXECUTABLE_START /* FIXME: only used to find text start for profiling. */ void @@ -1534,7 +1528,11 @@ realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) int size = needed * sizeof (struct glyph); if (pool->glyphs) - pool->glyphs = (struct glyph *) xrealloc (pool->glyphs, size); + { + pool->glyphs = (struct glyph *) xrealloc (pool->glyphs, size); + memset (pool->glyphs + pool->nglyphs, 0, + size - pool->nglyphs * sizeof (struct glyph)); + } else { pool->glyphs = (struct glyph *) xmalloc (size); @@ -3664,8 +3662,6 @@ update_window (struct window *w, int force_p) #if !PERIODIC_PREEMPTION_CHECKING int preempt_count = baud_rate / 2400 + 1; #endif - extern int input_pending; - extern Lisp_Object do_mouse_tracking; struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); #if GLYPH_DEBUG /* Check that W's frame doesn't have glyph matrices. */ @@ -4710,7 +4706,6 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p) int i; int pause; int preempt_count = baud_rate / 2400 + 1; - extern int input_pending; xassert (current_matrix && desired_matrix); @@ -5039,7 +5034,6 @@ count_match (struct glyph *str1, struct glyph *end1, struct glyph *str2, struct /* Char insertion/deletion cost vector, from term.c */ -extern int *char_ins_del_vector; #define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_TOTAL_COLS((f))]) @@ -6235,10 +6229,6 @@ init_display (void) { char *terminal_type; -#ifdef HAVE_X_WINDOWS - extern int display_arg; -#endif - /* Construct the space glyph. */ space_glyph.type = CHAR_GLYPH; SET_CHAR_GLYPH (space_glyph, ' ', DEFAULT_FACE_ID, 0); diff --git a/src/doc.c b/src/doc.c index 5f4fe426da0..f08976faf87 100644 --- a/src/doc.c +++ b/src/doc.c @@ -52,10 +52,7 @@ Lisp_Object Qfunction_documentation; /* A list of files used to build this Emacs binary. */ static Lisp_Object Vbuild_files; -extern Lisp_Object Voverriding_local_map, Qclosure; - -extern Lisp_Object Qremap; - +extern Lisp_Object Qclosure; /* Buffer used for reading from documentation file. */ static char *get_doc_string_buffer; static int get_doc_string_buffer_size; diff --git a/src/ecrt0.c b/src/ecrt0.c deleted file mode 100644 index 458771319c7..00000000000 --- a/src/ecrt0.c +++ /dev/null @@ -1,95 +0,0 @@ -/* C code startup routine. - Copyright (C) 1985, 1986, 1992, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - - -/* The standard Vax 4.2 Unix crt0.c cannot be used for Emacs - because it makes `environ' an initialized variable. - It is easiest to have a special crt0.c on all machines - though I don't know whether other machines actually need it. */ - -/* On the vax and 68000, in BSD4.2 and USG5.2, - this is the data format on startup: - (vax) ap and fp are unpredictable as far as I know; don't use them. - sp -> word containing argc - word pointing to first arg string - [word pointing to next arg string]... 0 or more times - 0 -Optionally: - [word pointing to environment variable]... 1 or more times - ... - 0 -And always: - first arg string - [next arg string]... 0 or more times -*/ - -#ifdef emacs -#include <config.h> -#endif - -/* ******** WARNING ******** - Do not insert any data definitions before data_start! - Since this is the first file linked, the address of the following - variable should correspond to the start of initialized data space. - On some systems this is a constant that is independent of the text - size for shared executables. On others, it is a function of the - text size. In short, this seems to be the most portable way to - discover the start of initialized data space dynamically at runtime, - for either shared or unshared executables, on either swapping or - virtual systems. It only requires that the linker allocate objects - in the order encountered, a reasonable model for most Unix systems. - Similarly, note that the address of _start() should be the start - of text space. Fred Fish, UniSoft Systems Inc. */ - -int data_start = 0; - -char **environ; - -static start1 (); - -/* Define symbol "start": here; some systems want that symbol. */ -asm(" .text "); -asm(" .globl start "); -asm(" start: "); - -_start () -{ -/* On vax, nothing is pushed here */ - start1 (); -} - -static -start1 (bogus_fp, argc, xargv) - int argc; - char *xargv; -{ - register char **argv = &xargv; - environ = argv + argc + 1; - - if ((char *)environ == xargv) - environ--; - exit (main (argc, argv, environ)); - - /* Refer to `start1' so GCC will not think it is never called - and optimize it out. */ - (void) &start1; -} - -/* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74 - (do not change this comment) */ diff --git a/src/editfns.c b/src/editfns.c index 805dba60446..1bd6682c3b6 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -90,14 +90,13 @@ extern size_t emacs_strftimeu (char *, size_t, const char *, const struct tm *, int); #ifdef WINDOWSNT -extern Lisp_Object w32_get_internal_run_time (); +extern Lisp_Object w32_get_internal_run_time (void); #endif static int tm_diff (struct tm *, struct tm *); static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *); static void update_buffer_properties (int, int); static Lisp_Object region_limit (int); -int lisp_time_argument (Lisp_Object, time_t *, int *); static size_t emacs_memftimeu (char *, size_t, const char *, size_t, const struct tm *, int); static void general_insert_function (void (*) (const unsigned char *, EMACS_INT), @@ -320,7 +319,6 @@ The return value is POSITION. */) static Lisp_Object region_limit (int beginningp) { - extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */ Lisp_Object m; if (!NILP (Vtransient_mark_mode) @@ -338,14 +336,14 @@ region_limit (int beginningp) } DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0, - doc: /* Return position of beginning of region, as an integer. */) + doc: /* Return the integer value of point or mark, whichever is smaller. */) (void) { return region_limit (1); } DEFUN ("region-end", Fregion_end, Sregion_end, 0, 0, 0, - doc: /* Return position of end of region, as an integer. */) + doc: /* Return the integer value of point or mark, whichever is larger. */) (void) { return region_limit (0); @@ -807,6 +805,9 @@ DEFUN ("line-beginning-position", With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. +The returned position is of the first character in the logical order, +i.e. the one that has the smallest character position. + This function constrains the returned position to the current field unless that would be on a different line than the original, unconstrained result. If N is nil or 1, and a front-sticky field @@ -845,6 +846,9 @@ DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. +The returned position is of the last character in the logical order, +i.e. the character whose buffer position is the largest one. + This function constrains the returned position to the current field unless that would be on a different line than the original, unconstrained result. If N is nil or 1, and a rear-sticky field ends @@ -1400,16 +1404,16 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, /* For the benefit of callers who don't want to include lisp.h */ -char * +const char * get_system_name (void) { if (STRINGP (Vsystem_name)) - return (char *) SDATA (Vsystem_name); + return (const char *) SDATA (Vsystem_name); else return ""; } -char * +const char * get_operating_system_release (void) { if (STRINGP (Voperating_system_release)) @@ -1815,7 +1819,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) else { char tzbuf[100]; - char *tzstring; + const char *tzstring; char **oldenv = environ, **newenv; if (EQ (zone, Qt)) @@ -1997,7 +2001,7 @@ If TZ is nil, use implementation-defined default time zone information. If TZ is t, use Universal Time. */) (Lisp_Object tz) { - char *tzstring; + const char *tzstring; /* When called for the first time, save the original TZ. */ if (!environbuf) @@ -3382,9 +3386,6 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) return val; } } -#ifdef HAVE_MENUS -extern Lisp_Object last_nonmenu_event; -#endif DEFUN ("message-or-box", Fmessage_or_box, Smessage_or_box, 1, MANY, 0, doc: /* Display a message in a dialog box or in the echo area. @@ -4554,7 +4555,6 @@ of the buffer being accessed. */); { Lisp_Object obuf; - extern Lisp_Object Vprin1_to_string_buffer; obuf = Fcurrent_buffer (); /* Do this here, because init_buffer_once is too early--it won't work. */ Fset_buffer (Vprin1_to_string_buffer); diff --git a/src/emacs-icon.h b/src/emacs-icon.h index 42c7d80bbe0..82f0a6e701c 100644 --- a/src/emacs-icon.h +++ b/src/emacs-icon.h @@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Note that the GTK port uses gdk to display the icon, so Emacs need not have XPM support compiled in. */ #if (defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)) || defined (USE_GTK) -static char * gnu_xpm_bits[] = { +static const char * gnu_xpm_bits[] = { /* width height ncolors chars_per_pixel */ "32 32 255 2", /* colors */ diff --git a/src/emacs.c b/src/emacs.c index fbae7763877..4dc670e6032 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -63,6 +63,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "keyboard.h" #include "keymap.h" +#ifdef HAVE_NS +#include "nsterm.h" +#endif + #ifdef HAVE_SETLOCALE #include <locale.h> #endif @@ -87,8 +91,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif #endif -const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; -const char emacs_version[] = "24.0.50"; +static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; +static const char emacs_version[] = "24.0.50"; /* Make these values available in GDB, which doesn't see macros. */ @@ -213,15 +217,6 @@ static unsigned long heap_bss_diff; output a warning in dump-emacs. */ #define MAX_HEAP_BSS_DIFF (1024*1024) - -#ifdef HAVE_WINDOW_SYSTEM -extern Lisp_Object Vinitial_window_system; -#endif /* HAVE_WINDOW_SYSTEM */ - -extern Lisp_Object Vauto_save_list_file_name; - -extern Lisp_Object Vinhibit_redisplay; - /* Nonzero means running Emacs without interactive terminal. */ int noninteractive; @@ -634,7 +629,7 @@ void __main (void) enough information to do it right. */ static int -argmatch (char **argv, int argc, char *sstr, char *lstr, int minlen, char **valptr, int *skipptr) +argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) { char *p = NULL; int arglen; @@ -757,7 +752,6 @@ main (int argc, char **argv) char *ch_to_dir; #if GC_MARK_STACK - extern Lisp_Object *stack_base; stack_base = &dummy; #endif @@ -861,23 +855,6 @@ main (int argc, char **argv) } #endif /* HAVE_PERSONALITY_LINUX32 */ - -/* Map in shared memory, if we are using that. */ -#ifdef HAVE_SHM - if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) - { - map_in_data (0); - /* The shared memory was just restored, which clobbered this. */ - skip_args = 1; - } - else - { - map_in_data (1); - /* The shared memory was just restored, which clobbered this. */ - skip_args = 0; - } -#endif - #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) /* Extend the stack space available. Don't do that if dumping, since some systems (e.g. DJGPP) @@ -1276,9 +1253,7 @@ main (int argc, char **argv) #ifdef AIX /* 20 is SIGCHLD, 21 is SIGTTIN, 22 is SIGTTOU. */ signal (SIGXCPU, fatal_error_signal); -#ifndef _I386 signal (SIGIOINT, fatal_error_signal); -#endif signal (SIGGRANT, fatal_error_signal); signal (SIGRETRACT, fatal_error_signal); signal (SIGSOUND, fatal_error_signal); @@ -1747,9 +1722,18 @@ main (int argc, char **argv) #else extern char etext; #endif +#ifdef HAVE___EXECUTABLE_START + /* This symbol is defined by GNU ld to the start of the text + segment. */ + extern char __executable_start[]; +#else extern void safe_bcopy (); +#endif atexit (_mcleanup); +#ifdef HAVE___EXECUTABLE_START + monstartup (__executable_start, &etext); +#else /* This uses safe_bcopy because that function comes first in the Emacs executable. It might be better to use something that gives the start of the text segment, but start_of_text is not @@ -1757,6 +1741,7 @@ main (int argc, char **argv) /* FIXME: Does not work on architectures with function descriptors. */ monstartup (safe_bcopy, &etext); +#endif } else moncontrol (0); @@ -2084,8 +2069,6 @@ all of which are called before Emacs is actually killed. */) unlink (SDATA (Vauto_save_list_file_name)); exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS); - /* NOTREACHED */ - return Qnil; } diff --git a/src/eval.c b/src/eval.c index 940e52a4d0a..6d0a49c0d7e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -66,7 +66,6 @@ Lisp_Object Qcurry; Lisp_Object Qinternal_interpreter_environment, Qclosure; Lisp_Object Qdebug; -extern Lisp_Object Qinteractive_form; /* This holds either the symbol `run-hooks' or nil. It is nil at an early stage of startup, and when Emacs @@ -176,9 +175,6 @@ int handling_signal; Lisp_Object Vmacro_declaration_function; -extern Lisp_Object Qrisky_local_variable; -extern Lisp_Object Qfunction; - static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object *, Lisp_Object); static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; @@ -1707,8 +1703,6 @@ See also the function `condition-case'. */) That is a special case--don't do this in other situations. */ register struct handler *allhandlers = handlerlist; Lisp_Object conditions; - extern int gc_in_progress; - extern int waiting_for_input; Lisp_Object string; Lisp_Object real_error_symbol; struct backtrace *bp; @@ -3007,8 +3001,7 @@ call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0, doc: /* Return non-nil if OBJECT is a type of object that can be called as a function. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (SYMBOLP (object) && !NILP (Ffboundp (object))) { @@ -3258,10 +3251,7 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag, length NARGS). */ static Lisp_Object -funcall_funvec (fun, nargs, args) - Lisp_Object fun; - int nargs; - Lisp_Object *args; +funcall_funvec (Lisp_Object fun, int nargs, Lisp_Object *args) { int size = FUNVEC_SIZE (fun); Lisp_Object tag = (size > 0 ? AREF (fun, 0) : Qnil); @@ -3662,8 +3652,7 @@ DEFUN ("special-variable-p", Fspecial_variable_p, Sspecial_variable_p, 1, 1, 0, doc: /* Return non-nil if SYMBOL's global binding has been declared special. A special variable is one that will be bound dynamically, even in a context where binding is lexical by default. */) - (symbol) - Lisp_Object symbol; + (Lisp_Object symbol) { CHECK_SYMBOL (symbol); return XSYMBOL (symbol)->declared_special ? Qt : Qnil; @@ -3683,9 +3672,7 @@ and: => ("The a" "The b" "The c") usage: (curry FUN &rest ARGS) */) - (nargs, args) - register int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return make_funvec (Qcurry, 0, nargs, args); } @@ -3721,7 +3708,6 @@ Output stream used is value of `standard-output'. */) register int i; Lisp_Object tail; Lisp_Object tem; - extern Lisp_Object Vprint_level; struct gcpro gcpro1; XSETFASTINT (Vprint_level, 3); diff --git a/src/fileio.c b/src/fileio.c index c942803e280..a04cd4e76f5 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -104,8 +104,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif #include "commands.h" -extern int use_dialog_box; -extern int use_file_dialog; #ifndef O_WRONLY #define O_WRONLY 1 @@ -214,16 +212,10 @@ Lisp_Object Qcopy_directory; /* Lisp function for recursively deleting directories. */ Lisp_Object Qdelete_directory; -extern Lisp_Object Vuser_login_name; - #ifdef WINDOWSNT extern Lisp_Object Vw32_get_true_file_attributes; #endif -extern int minibuf_level; - -extern int minibuffer_auto_raise; - /* These variables describe handlers that have "already" had a chance to handle the current operation. @@ -862,8 +854,6 @@ filesystem tree, not (expand-file-name ".." dirname). */) To avoid this, we set default_directory to the root of the current drive. */ - extern char *emacs_root_dir (void); - default_directory = build_string (emacs_root_dir ()); #else default_directory = build_string ("/"); @@ -1833,7 +1823,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir) If QUICK is nonzero, we ask for y or n, not yes or no. */ void -barf_or_query_if_file_exists (Lisp_Object absname, unsigned char *querystring, int interactive, struct stat *statptr, int quick) +barf_or_query_if_file_exists (Lisp_Object absname, const unsigned char *querystring, int interactive, struct stat *statptr, int quick) { register Lisp_Object tem, encoded_filename; struct stat statbuf; @@ -2483,7 +2473,7 @@ check_executable (char *filename) /* Return nonzero if file FILENAME exists and can be written. */ static int -check_writable (char *filename) +check_writable (const char *filename) { #ifdef MSDOS struct stat st; @@ -3049,7 +3039,6 @@ The value is an integer. */) return value; } -extern int lisp_time_argument (Lisp_Object, time_t *, int *); DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0, doc: /* Set times of file FILENAME to TIME. diff --git a/src/filelock.c b/src/filelock.c index c3f1bfde292..15ed546bc50 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -117,10 +117,8 @@ Lisp_Object Vtemporary_file_directory; static time_t boot_time; static int boot_time_initialized; -extern Lisp_Object Vshell_file_name; - #ifdef BOOT_TIME -static void get_boot_time_1 (char *, int); +static void get_boot_time_1 (const char *, int); #endif static time_t @@ -251,7 +249,7 @@ get_boot_time (void) Success is indicated by setting BOOT_TIME to a larger value. */ void -get_boot_time_1 (char *filename, int newest) +get_boot_time_1 (const char *filename, int newest) { struct utmp ut, *utp; int desc; @@ -362,8 +360,8 @@ lock_file_1 (char *lfname, int force) { register int err; time_t boot_time; - char *user_name; - char *host_name; + const char *user_name; + const char *host_name; char *lock_info_str; /* Call this first because it can GC. */ diff --git a/src/floatfns.c b/src/floatfns.c index 4c1548cfd8f..1c3e40eefde 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -117,7 +117,7 @@ static int in_float; static Lisp_Object float_error_arg, float_error_arg2; -static char *float_error_fn_name; +static const char *float_error_fn_name; /* Evaluate the floating point expression D, recording NUM as the original argument for error messages. @@ -746,7 +746,7 @@ static Lisp_Object rounding_driver (Lisp_Object arg, Lisp_Object divisor, double (*double_round) (double), EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT), - char *name) + const char *name) { CHECK_NUMBER_OR_FLOAT (arg); diff --git a/src/fns.c b/src/fns.c index c02f5584a8f..83b4bd5492d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -61,19 +61,12 @@ int use_dialog_box; questions asked by mouse commands. */ int use_file_dialog; -extern int minibuffer_auto_raise; -extern Lisp_Object minibuf_window; -extern Lisp_Object Vlocale_coding_system; -extern int load_in_progress; - Lisp_Object Qstring_lessp, Qprovide, Qrequire; Lisp_Object Qyes_or_no_p_history; Lisp_Object Qcursor_in_echo_area; Lisp_Object Qwidget_type; Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper; -extern Lisp_Object Qinput_method_function; - static int internal_equal (Lisp_Object , Lisp_Object, int, int); extern long get_random (void); @@ -232,9 +225,8 @@ Symbols are also allowed; their print names are used instead. */) return Qt; } -DEFUN ("compare-strings", Fcompare_strings, - Scompare_strings, 6, 7, 0, -doc: /* Compare the contents of two strings, converting to multibyte if needed. +DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, + doc: /* Compare the contents of two strings, converting to multibyte if needed. In string STR1, skip the first START1 characters and stop at END1. In string STR2, skip the first START2 characters and stop at END2. END1 and END2 default to the full lengths of the respective strings. @@ -1206,7 +1198,7 @@ value is a new vector that contains the elements between index FROM DEFUN ("substring-no-properties", Fsubstring_no_properties, Ssubstring_no_properties, 1, 3, 0, doc: /* Return a substring of STRING, without text properties. -It starts at index FROM and ending before TO. +It starts at index FROM and ends before TO. TO may be nil or omitted; then the substring runs to the end of STRING. If FROM is nil or omitted, the substring starts at the beginning of STRING. If FROM or TO is negative, it counts from the end. @@ -1298,7 +1290,7 @@ substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte } DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, - doc: /* Take cdr N times on LIST, returns the result. */) + doc: /* Take cdr N times on LIST, return the result. */) (Lisp_Object n, Lisp_Object list) { register int i, num; @@ -1337,7 +1329,7 @@ DEFUN ("elt", Felt, Selt, 2, 2, 0, } DEFUN ("member", Fmember, Smember, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -1355,7 +1347,7 @@ The value is actually the tail of LIST whose car is ELT. */) } DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -1381,7 +1373,7 @@ The value is actually the tail of LIST whose car is ELT. */) } DEFUN ("memql", Fmemql, Smemql, 2, 2, 0, -doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. + doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. The value is actually the tail of LIST whose car is ELT. */) (register Lisp_Object elt, Lisp_Object list) { @@ -2710,10 +2702,9 @@ advisable. */) } Lisp_Object Vfeatures, Qsubfeatures; -extern Lisp_Object Vafter_load_alist; DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0, - doc: /* Returns t if FEATURE is present in this Emacs. + doc: /* Return t if FEATURE is present in this Emacs. Use this to conditionalize execution of lisp code based on the presence or absence of Emacs or environment extensions. @@ -4436,8 +4427,8 @@ is a float, it must be > 1.0, and the new size is computed by multiplying the old size with that factor. Default is 1.5. :rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0. -Resize the hash table when ratio of the number of entries in the -table. Default is 0.8. +Resize the hash table when the ratio (number of entries / table size) +is greater or equal than THRESHOLD. Default is 0.8. :weakness WEAK -- WEAK must be one of nil, t, `key', `value', `key-or-value', or `key-and-value'. If WEAK is not nil, the table @@ -4560,7 +4551,7 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0, doc: /* Return the size of TABLE. The size can be used as an argument to `make-hash-table' to create -a hash table than can hold as many elements of TABLE holds +a hash table than can hold as many elements as TABLE holds without need for resizing. */) (Lisp_Object table) { diff --git a/src/font.c b/src/font.c index cb3e9c5d326..eba75c11b2f 100644 --- a/src/font.c +++ b/src/font.c @@ -48,10 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "nsterm.h" #endif /* HAVE_NS */ -#ifdef HAVE_NS -extern Lisp_Object Qfontsize; -#endif - Lisp_Object Qopentype; /* Important character set strings. */ @@ -127,12 +123,6 @@ static const struct table_entry width_table[] = { 200, { "ultra-expanded", "ultraexpanded", "wide" }} }; -extern Lisp_Object Qnormal; - -/* Symbols representing keys of normal font properties. */ -extern Lisp_Object QCtype, QCfamily, QCweight, QCslant, QCwidth; -extern Lisp_Object QCheight, QCsize, QCname; - Lisp_Object QCfoundry, QCadstyle, QCregistry; /* Symbols representing keys of font extra info. */ Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth; @@ -242,7 +232,7 @@ static int num_font_drivers; STR. */ Lisp_Object -font_intern_prop (char *str, int len, int force_symbol) +font_intern_prop (const char *str, int len, int force_symbol) { int i; Lisp_Object tem; @@ -400,11 +390,6 @@ font_style_symbolic (Lisp_Object font, enum font_property_index prop, int for_fa return (for_face ? AREF (elt, 1) : AREF (elt, (i & 0xF) + 1)); } -extern Lisp_Object Vface_alternative_font_family_alist; - -extern Lisp_Object find_font_encoding (Lisp_Object); - - /* Return ENCODING or a cons of ENCODING and REPERTORY of the font FONTNAME. ENCODING is a charset symbol that specifies the encoding of the font. REPERTORY is a charset symbol or nil. */ @@ -609,7 +594,7 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val) /* Structure of known font property keys and validater of the values. */ -struct +static const struct { /* Pointer to the key symbol. */ Lisp_Object *key; @@ -714,7 +699,7 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val) /* Font name parser and unparser */ -static int parse_matrix (char *); +static int parse_matrix (const char *); static int font_expand_wildcards (Lisp_Object *, int); static int font_parse_name (char *, Lisp_Object); @@ -773,7 +758,7 @@ enum xlfd_field_mask -1. */ static int -parse_matrix (char *p) +parse_matrix (const char *p) { double matrix[4]; char *end; @@ -980,39 +965,6 @@ font_expand_wildcards (Lisp_Object *field, int n) } -#ifdef ENABLE_CHECKING -/* Match a 14-field XLFD pattern against a full XLFD font name. */ -static int -font_match_xlfd (char *pattern, char *name) -{ - while (*pattern && *name) - { - if (*pattern == *name) - pattern++; - else if (*pattern == '*') - if (*name == pattern[1]) - pattern += 2; - else - ; - else - return 0; - name++; - } - return 1; -} - -/* Make sure the font object matches the XLFD font name. */ -static int -font_check_xlfd_parse (Lisp_Object font, char *name) -{ - char name_check[256]; - font_unparse_xlfd (font, 0, name_check, 255); - return font_match_xlfd (name_check, name); -} - -#endif - - /* Parse NAME (null terminated) as XLFD and store information in FONT (font-spec or font-entity). Size property of FONT is set as follows: @@ -1619,7 +1571,7 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes) int i, len = 1; char *p; Lisp_Object styles[3]; - char *style_names[3] = { "weight", "slant", "width" }; + const char *style_names[3] = { "weight", "slant", "width" }; char work[256]; family = AREF (font, FONT_FAMILY_INDEX); @@ -2177,9 +2129,6 @@ static int font_compare (const void *, const void *); static Lisp_Object font_sort_entities (Lisp_Object, Lisp_Object, Lisp_Object, int); -/* Return a rescaling ratio of FONT_ENTITY. */ -extern Lisp_Object Vface_font_rescale_alist; - static double font_rescale_ratio (Lisp_Object font_entity) { @@ -2762,8 +2711,6 @@ static Lisp_Object scratch_font_spec, scratch_font_prefer; (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). */ -extern Lisp_Object Vface_ignored_fonts; - Lisp_Object font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size) { @@ -4492,6 +4439,8 @@ created glyph-string. Otherwise, the value is nil. */) } if (i == 3 || XINT (n) == 0) return Qnil; + if (XINT (n) < LGSTRING_GLYPH_LEN (gstring)) + LGSTRING_SET_GLYPH (gstring, XINT (n), Qnil); glyph = LGSTRING_GLYPH (gstring, 0); from = LGLYPH_FROM (glyph); @@ -5111,7 +5060,7 @@ static Lisp_Object Vfont_log_deferred; opening), ARG is the argument for the action, and RESULT is the result of the action. */ void -font_add_log (char *action, Lisp_Object arg, Lisp_Object result) +font_add_log (const char *action, Lisp_Object arg, Lisp_Object result) { Lisp_Object tail, val; int i; @@ -5197,7 +5146,7 @@ font_add_log (char *action, Lisp_Object arg, Lisp_Object result) as font_add_log. */ void -font_deferred_log (char *action, Lisp_Object arg, Lisp_Object result) +font_deferred_log (const char *action, Lisp_Object arg, Lisp_Object result) { if (EQ (Vfont_log, Qt)) return; @@ -5206,15 +5155,6 @@ font_deferred_log (char *action, Lisp_Object arg, Lisp_Object result) ASET (Vfont_log_deferred, 2, result); } -extern void syms_of_ftfont (void); -extern void syms_of_xfont (void); -extern void syms_of_xftfont (void); -extern void syms_of_ftxfont (void); -extern void syms_of_bdffont (void); -extern void syms_of_w32font (void); -extern void syms_of_atmfont (void); -extern void syms_of_nsfont (void); - void syms_of_font (void) { diff --git a/src/font.h b/src/font.h index 694f07e5f07..5f1a442b59e 100644 --- a/src/font.h +++ b/src/font.h @@ -239,7 +239,9 @@ enum font_property_index ASET ((font), prop, make_number (font_style_to_value (prop, val, 1))) extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript; -extern Lisp_Object QCavgwidth, QCfont_entity, QCfc_unknown_spec; +extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity, QCfc_unknown_spec; +extern Lisp_Object Qp; + /* Important character set symbols. */ extern Lisp_Object Qascii_0; @@ -784,7 +786,7 @@ extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); extern Lisp_Object font_open_by_name (FRAME_PTR f, char *name); extern void font_close_object (FRAME_PTR f, Lisp_Object font_object); -extern Lisp_Object font_intern_prop (char *str, int len, int force_symbol); +extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol); extern void font_update_sort_order (int *order); extern void font_parse_family_registry (Lisp_Object family, @@ -821,29 +823,41 @@ extern void *font_get_frame_data (FRAME_PTR f, #ifdef HAVE_FREETYPE extern struct font_driver ftfont_driver; +extern void syms_of_ftfont (void); #endif /* HAVE_FREETYPE */ #ifdef HAVE_X_WINDOWS extern struct font_driver xfont_driver; extern struct font_driver ftxfont_driver; +extern void syms_of_xfont (void); +extern void syms_of_ftxfont (void); #ifdef HAVE_XFT extern struct font_driver xftfont_driver; +extern void syms_of_xftfont (void); #endif /* HAVE_XFT */ +#ifdef HAVE_BDFFONT +extern void syms_of_bdffont (void); +#endif /* HAVE_BDFFONT */ #endif /* HAVE_X_WINDOWS */ #ifdef WINDOWSNT extern struct font_driver w32font_driver; extern struct font_driver uniscribe_font_driver; +extern void syms_of_w32font (void); #endif /* WINDOWSNT */ #ifdef HAVE_NS +extern Lisp_Object Qfontsize; extern struct font_driver nsfont_driver; +extern void syms_of_nsfont (void); #endif /* HAVE_NS */ #ifndef FONT_DEBUG #define FONT_DEBUG #endif +extern Lisp_Object QCfoundry, QCadstyle, QCregistry; + extern Lisp_Object Vfont_log; -extern void font_add_log (char *, Lisp_Object, Lisp_Object); -extern void font_deferred_log (char *, Lisp_Object, Lisp_Object); +extern void font_add_log (const char *, Lisp_Object, Lisp_Object); +extern void font_deferred_log (const char *, Lisp_Object, Lisp_Object); #define FONT_ADD_LOG(ACTION, ARG, RESULT) \ do { \ diff --git a/src/fontset.c b/src/fontset.c index 9a27fc3e36b..b273ace75af 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -177,7 +177,6 @@ EXFUN (Fclear_face_cache, 1); /********** VARIABLES and FUNCTION PROTOTYPES **********/ -extern Lisp_Object Qfont; static Lisp_Object Qfontset; static Lisp_Object Qfontset_info; static Lisp_Object Qprepend, Qappend; @@ -388,8 +387,6 @@ fontset_compare_rfontdef (const void *val1, const void *val2) If PREFERRED_FAMILY is not nil, that family has the higher priority if the encoding charsets or languages in font-specs are the same. */ -extern Lisp_Object Fassoc_string (Lisp_Object, Lisp_Object, Lisp_Object); - static void reorder_font_vector (Lisp_Object font_group, struct font *font) { @@ -1395,7 +1392,6 @@ set_fontset_font (Lisp_Object arg, Lisp_Object range) ASET (arg, 4, script_range_list); } -extern Lisp_Object QCfamily, QCregistry; static void update_auto_fontset_alist (Lisp_Object, Lisp_Object); @@ -1457,7 +1453,6 @@ appended. By default, FONT-SPEC overrides the previous settings. */) else if (STRINGP (font_spec)) { Lisp_Object args[2]; - extern Lisp_Object QCname; fontname = font_spec; args[0] = QCname; diff --git a/src/fontset.h b/src/fontset.h index 178170a04ce..661638feb39 100644 --- a/src/fontset.h +++ b/src/fontset.h @@ -44,7 +44,9 @@ extern int fontset_from_font (Lisp_Object); extern int fs_query_fontset (Lisp_Object, int); EXFUN (Fquery_fontset, 2); extern Lisp_Object list_fontsets (struct frame *, Lisp_Object, int); +extern Lisp_Object find_font_encoding (Lisp_Object); +extern Lisp_Object Qlatin; extern Lisp_Object Vuse_default_ascent; extern Lisp_Object Vignore_relative_composition; extern Lisp_Object Valternate_fontname_alist; diff --git a/src/frame.c b/src/frame.c index 69a640cdc96..93a6e898c9b 100644 --- a/src/frame.c +++ b/src/frame.c @@ -119,7 +119,7 @@ Lisp_Object Qparent_id; Lisp_Object Qtitle, Qname; Lisp_Object Qexplicit_name; Lisp_Object Qunsplittable; -Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; +Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position; Lisp_Object Vmenu_bar_mode, Vtool_bar_mode; Lisp_Object Qleft_fringe, Qright_fringe; Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; @@ -198,13 +198,6 @@ set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) Lisp_Object Vframe_list; -extern Lisp_Object Vminibuffer_list; -extern Lisp_Object get_minibuffer (int); -extern Lisp_Object Fhandle_switch_frame (Lisp_Object event); -extern Lisp_Object Fredirect_frame_focus (Lisp_Object frame, Lisp_Object focus_frame); -extern Lisp_Object x_get_focus_frame (struct frame *frame); -extern Lisp_Object QCname, Qfont_param; - DEFUN ("framep", Fframep, Sframep, 1, 1, 0, doc: /* Return non-nil if OBJECT is a frame. @@ -323,6 +316,7 @@ make_frame (int mini_p) f->menu_bar_window = Qnil; f->tool_bar_window = Qnil; f->tool_bar_items = Qnil; + f->tool_bar_position = Qtop; f->desired_tool_bar_string = f->current_tool_bar_string = Qnil; f->n_tool_bar_items = 0; f->left_fringe_width = f->right_fringe_width = 0; @@ -1280,16 +1274,6 @@ other_visible_frames (FRAME_PTR f) return 1; } -/* Error handler for `delete-frame-functions'. */ -static Lisp_Object -delete_frame_handler (Lisp_Object arg) -{ - add_to_log ("Error during `delete-frame': %s", arg, Qnil); - return Qnil; -} - -extern Lisp_Object Qrun_hook_with_args; - /* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME unconditionally. x_connection_closed and delete_terminal use this. Any other value of FORCE implements the semantics @@ -1299,7 +1283,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* If we use `register' here, gcc-4.0.2 on amd64 using -DUSE_LISP_UNION_TYPE complains further down that we're getting the address of `force'. Go figure. */ - + { struct frame *f; struct frame *sf = SELECTED_FRAME (); @@ -2786,11 +2770,11 @@ the rightmost or bottommost possible position (that stays within the screen). * that is an index in this table. */ struct frame_parm_table { - char *name; + const char *name; Lisp_Object *variable; }; -static struct frame_parm_table frame_parms[] = +static const struct frame_parm_table frame_parms[] = { {"auto-raise", &Qauto_raise}, {"auto-lower", &Qauto_lower}, @@ -2824,13 +2808,11 @@ static struct frame_parm_table frame_parms[] = {"font-backend", &Qfont_backend}, {"alpha", &Qalpha}, {"sticky", &Qsticky}, + {"tool-bar-position", &Qtool_bar_position}, }; #ifdef HAVE_WINDOW_SYSTEM -extern Lisp_Object Qbox; -extern Lisp_Object Qtop; - /* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the wanted positions of the WM window (not Emacs window). Return in *WIDTH and *HEIGHT the wanted width and height of Emacs @@ -3217,6 +3199,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc); store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil)); store_in_alist (alistptr, Qparent_id, tem); + store_in_alist (alistptr, Qtool_bar_position, f->tool_bar_position); } @@ -3449,6 +3432,11 @@ void x_set_fringe_width (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) { compute_fringe_widths (f, 1); +#ifdef HAVE_X_WINDOWS + /* Must adjust this so window managers report correct number of columns. */ + if (FRAME_X_WINDOW (f) != 0) + x_wm_set_size_hint (f, 0, 0); +#endif } void @@ -3678,7 +3666,6 @@ validate_x_resource_name (void) if (STRINGP (Vx_resource_name)) { unsigned char *p = SDATA (Vx_resource_name); - int i; len = SBYTES (Vx_resource_name); @@ -3729,7 +3716,7 @@ validate_x_resource_name (void) } -extern char *x_get_string_resource (XrmDatabase, char *, char *); +extern char *x_get_string_resource (XrmDatabase, const char *, const char *); extern Display_Info *check_x_display_info (Lisp_Object); @@ -3831,7 +3818,7 @@ display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Objec /* Used when C code wants a resource value. */ /* Called from oldXMenu/Create.c. */ char * -x_get_resource_string (char *attribute, char *class) +x_get_resource_string (const char *attribute, const char *class) { char *name_key; char *class_key; @@ -3864,7 +3851,8 @@ x_get_resource_string (char *attribute, char *class) and don't let it get stored in any Lisp-visible variables! */ Lisp_Object -x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type) +x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, + const char *attribute, const char *class, enum resource_types type) { register Lisp_Object tem; @@ -3962,7 +3950,9 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, char *at } Lisp_Object -x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type) +x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, + const char *attribute, const char *class, + enum resource_types type) { return x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param, attribute, class, type); @@ -3971,7 +3961,10 @@ x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *at /* Like x_frame_get_arg, but also record the value in f->param_alist. */ Lisp_Object -x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type) +x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, + Lisp_Object param, + const char *attribute, const char *class, + enum resource_types type) { Lisp_Object value; @@ -3991,7 +3984,9 @@ x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, Lisp_Object para If that is not found either, use the value DEFLT. */ Lisp_Object -x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, Lisp_Object deflt, char *xprop, char *xclass, enum resource_types type) +x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, + Lisp_Object deflt, const char *xprop, const char *xclass, + enum resource_types type) { Lisp_Object tem; diff --git a/src/frame.h b/src/frame.h index 0abd878a31f..088b477dfce 100644 --- a/src/frame.h +++ b/src/frame.h @@ -191,6 +191,10 @@ struct frame /* Desired and current tool-bar items. */ Lisp_Object tool_bar_items; + /* Where tool bar is, can be left, right, top or bottom. The native + tool bar only supports top. */ + Lisp_Object tool_bar_position; + /* Desired and current contents displayed in tool_bar_window. */ Lisp_Object desired_tool_bar_string, current_tool_bar_string; @@ -823,6 +827,7 @@ typedef struct frame *FRAME_PTR; extern Lisp_Object Qframep, Qframe_live_p; extern Lisp_Object Qtty, Qtty_type; +extern Lisp_Object Qtty_color_mode; extern Lisp_Object Qterminal, Qterminal_live_p; extern Lisp_Object Qnoelisp; @@ -1044,6 +1049,7 @@ extern Lisp_Object Qfont; extern Lisp_Object Qbackground_color, Qforeground_color; extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; extern Lisp_Object Qinternal_border_width; +extern Lisp_Object Qtooltip; extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; extern Lisp_Object Qmouse_color; extern Lisp_Object Qname, Qtitle; @@ -1063,7 +1069,6 @@ extern Lisp_Object Qalpha; extern Lisp_Object Qleft_fringe, Qright_fringe; extern Lisp_Object Qheight, Qwidth; extern Lisp_Object Qminibuffer, Qmodeline; -extern Lisp_Object Qonly; extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; extern Lisp_Object Qvisible; extern Lisp_Object Qdisplay_type; @@ -1071,9 +1076,11 @@ extern Lisp_Object Qbackground_mode; extern Lisp_Object Qx_resource_name; -extern Lisp_Object Qleft, Qright, Qtop, Qbox; +extern Lisp_Object Qleft, Qright, Qtop, Qbox, Qbottom; extern Lisp_Object Qdisplay; +extern Lisp_Object Qrun_hook_with_args; + #ifdef HAVE_WINDOW_SYSTEM /* The class of this X application. */ @@ -1091,6 +1098,7 @@ extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int); extern Lisp_Object Vx_resource_name; extern Lisp_Object Vx_resource_class; +extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode; extern Lisp_Object Qface_set_after_frame_default; @@ -1134,6 +1142,9 @@ extern Lisp_Object display_x_get_resource (Display_Info *, Lisp_Object component, Lisp_Object subclass); +/* In xmenu.c */ +extern void set_frame_menubar (FRAME_PTR, int, int); + #endif /* HAVE_WINDOW_SYSTEM */ #endif /* not EMACS_FRAME_H */ diff --git a/src/fringe.c b/src/fringe.c index bfb2c217172..fce100b1463 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -32,10 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_WINDOW_SYSTEM -extern Lisp_Object Qfringe; -extern Lisp_Object Qtop, Qbottom, Qcenter; -extern Lisp_Object Qup, Qdown, Qleft, Qright; - /* Non-nil means that newline may flow into the right fringe. */ Lisp_Object Voverflow_newline_into_fringe; @@ -83,10 +79,8 @@ Lisp_Object Vfringe_bitmaps; must specify physical bitmap symbols. */ -extern Lisp_Object Qunknown; Lisp_Object Qtruncation, Qcontinuation, Qoverlay_arrow; Lisp_Object Qempty_line, Qtop_bottom; -extern Lisp_Object Qbar, Qhbar, Qbox, Qhollow; Lisp_Object Qhollow_small; enum fringe_bitmap_align @@ -1500,7 +1494,7 @@ init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p) | (swap_nibble[(b>>8) & 0xf] << 4) | (swap_nibble[(b>>12) & 0xf])); b >>= (16 - fb->width); -#ifdef WORDS_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN b = ((b >> 8) | (b << 8)); #endif *bits++ = b; diff --git a/src/ftfont.c b/src/ftfont.c index 1fdf4c265ce..b99e50ca3ff 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -96,11 +96,11 @@ Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object); static struct { /* registry name */ - char *name; + const char *name; /* characters to distinguish the charset from the others */ int uniquifier[6]; /* additional constraint by language */ - char *lang; + const char *lang; /* set on demand */ FcCharSet *fc_charset; } fc_charset_table[] = @@ -144,8 +144,6 @@ static struct { NULL } }; -extern Lisp_Object Qc, Qm, Qp, Qd; - /* Dirty hack for handing ADSTYLE property. Fontconfig (actually the underlying FreeType) gives such ADSTYLE @@ -548,8 +546,6 @@ struct font_driver ftfont_driver = ftfont_filter_properties, /* filter_properties */ }; -extern Lisp_Object QCname; - static Lisp_Object ftfont_get_cache (FRAME_PTR f) { @@ -695,12 +691,8 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec) return spec; } -static FcPattern *ftfont_spec_pattern (Lisp_Object, char *, - struct OpenTypeSpec **, - char **langname); - static FcPattern * -ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **otspec, char **langname) +ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **otspec, const char **langname) { Lisp_Object tmp, extra; FcPattern *pattern = NULL; @@ -870,7 +862,7 @@ ftfont_list (Lisp_Object frame, Lisp_Object spec) char otlayout[15]; /* For "otlayout:XXXX" */ struct OpenTypeSpec *otspec = NULL; int spacing = -1; - char *langname = NULL; + const char *langname = NULL; if (! fc_initialized) { @@ -1061,7 +1053,7 @@ ftfont_match (Lisp_Object frame, Lisp_Object spec) FcResult result; char otlayout[15]; /* For "otlayout:XXXX" */ struct OpenTypeSpec *otspec = NULL; - char *langname = NULL; + const char *langname = NULL; if (! fc_initialized) { @@ -2333,8 +2325,6 @@ static MFLTGlyphString gstring; static int m17n_flt_initialized; -extern Lisp_Object QCfamily; - static Lisp_Object ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, FT_Face ft_face, OTF *otf, FT_Matrix *matrix) @@ -2636,7 +2626,7 @@ ftfont_filter_properties (Lisp_Object font, Lisp_Object alist) if (strcmp (ftfont_booleans[i], keystr) == 0) { - char *str = SYMBOLP (val) ? SDATA (SYMBOL_NAME (val)) : NULL; + const char *str = SYMBOLP (val) ? SDATA (SYMBOL_NAME (val)) : NULL; if (INTEGERP (val)) str = XINT (val) != 0 ? "true" : "false"; if (str == NULL) str = "true"; diff --git a/src/ftfont.h b/src/ftfont.h index 7ad9b8a008c..9053c9ce81d 100644 --- a/src/ftfont.h +++ b/src/ftfont.h @@ -36,6 +36,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif /* HAVE_M17N_FLT */ #endif /* HAVE_LIBOTF */ +extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object); +extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); + #endif /* EMACS_FTFONT_H */ /* arch-tag: cec13d1c-7156-4997-9ebd-e989040c3d78 diff --git a/src/gtkutil.c b/src/gtkutil.c index b1bb2e32324..b1591b79f9c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -44,6 +44,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define FRAME_TOTAL_PIXEL_HEIGHT(f) \ (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) +#define FRAME_TOTAL_PIXEL_WIDTH(f) \ + (FRAME_PIXEL_WIDTH (f) + FRAME_TOOLBAR_WIDTH (f)) + /* Avoid "differ in sign" warnings */ #define SSDATA(x) ((char *) SDATA (x)) @@ -288,7 +291,6 @@ file_for_image (Lisp_Object image) { Lisp_Object specified_file = Qnil; Lisp_Object tail; - extern Lisp_Object QCfile; for (tail = XCDR (image); NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail)); @@ -505,6 +507,172 @@ get_utf8_string (char *str) /*********************************************************************** + Tooltips + ***********************************************************************/ +/* Gtk+ calls this callback when the parent of our tooltip dummy changes. + We use that to pop down the tooltip. This happens if Gtk+ for some + reason wants to change or hide the tooltip. */ + +#ifdef USE_GTK_TOOLTIP + +static void +hierarchy_ch_cb (GtkWidget *widget, + GtkWidget *previous_toplevel, + gpointer user_data) +{ + FRAME_PTR f = (FRAME_PTR) user_data; + struct x_output *x = f->output_data.x; + GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); + + if (! top || ! GTK_IS_WINDOW (top)) + gtk_widget_hide (previous_toplevel); +} + +/* Callback called when Gtk+ thinks a tooltip should be displayed. + We use it to get the tooltip window and the tooltip widget so + we can manipulate the ourselves. + + Return FALSE ensures that the tooltip is not shown. */ + +static gboolean +qttip_cb (GtkWidget *widget, + gint xpos, + gint ypos, + gboolean keyboard_mode, + GtkTooltip *tooltip, + gpointer user_data) +{ + FRAME_PTR f = (FRAME_PTR) user_data; + struct x_output *x = f->output_data.x; + if (x->ttip_widget == NULL) + { + g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL); + x->ttip_widget = tooltip; + g_object_ref (G_OBJECT (tooltip)); + x->ttip_lbl = gtk_label_new (""); + g_object_ref (G_OBJECT (x->ttip_lbl)); + gtk_tooltip_set_custom (tooltip, x->ttip_lbl); + x->ttip_window = GTK_WINDOW (gtk_widget_get_toplevel (x->ttip_lbl)); + /* Realize so we can safely get screen later on. */ + gtk_widget_realize (GTK_WIDGET (x->ttip_window)); + gtk_widget_realize (x->ttip_lbl); + + g_signal_connect (x->ttip_lbl, "hierarchy-changed", + G_CALLBACK (hierarchy_ch_cb), f); + } + return FALSE; +} + +#endif /* USE_GTK_TOOLTIP */ + +/* Prepare a tooltip to be shown, i.e. calculate WIDTH and HEIGHT. + Return zero if no system tooltip available, non-zero otherwise. */ + +int +xg_prepare_tooltip (FRAME_PTR f, + Lisp_Object string, + int *width, + int *height) +{ +#ifndef USE_GTK_TOOLTIP + return 0; +#else + struct x_output *x = f->output_data.x; + GtkWidget *widget; + GdkWindow *gwin; + GdkScreen *screen; + GtkSettings *settings; + gboolean tt_enabled = TRUE; + GtkRequisition req; + Lisp_Object encoded_string; + + if (!x->ttip_lbl) return 0; + + BLOCK_INPUT; + encoded_string = ENCODE_UTF_8 (string); + widget = GTK_WIDGET (x->ttip_lbl); + gwin = gtk_widget_get_window (GTK_WIDGET (x->ttip_window)); + screen = gdk_drawable_get_screen (gwin); + settings = gtk_settings_get_for_screen (screen); + g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL); + if (tt_enabled) + { + g_object_set (settings, "gtk-enable-tooltips", FALSE, NULL); + /* Record that we disabled it so it can be enabled again. */ + g_object_set_data (G_OBJECT (x->ttip_window), "restore-tt", + (gpointer)f); + } + + /* Prevent Gtk+ from hiding tooltip on mouse move and such. */ + g_object_set_data (G_OBJECT + (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))), + "gdk-display-current-tooltip", NULL); + + /* Put out dummy widget in so we can get callbacks for unrealize and + hierarchy-changed. */ + gtk_tooltip_set_custom (x->ttip_widget, widget); + + gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string)); + gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req); + if (width) *width = req.width; + if (height) *height = req.height; + + UNBLOCK_INPUT; + + return 1; +#endif /* USE_GTK_TOOLTIP */ +} + +/* Show the tooltip at ROOT_X and ROOT_Y. + xg_prepare_tooltip must have been called before this function. */ + +void +xg_show_tooltip (FRAME_PTR f, int root_x, int root_y) +{ +#ifdef USE_GTK_TOOLTIP + struct x_output *x = f->output_data.x; + if (x->ttip_window) + { + BLOCK_INPUT; + gtk_window_move (x->ttip_window, root_x, root_y); + gtk_widget_show_all (GTK_WIDGET (x->ttip_window)); + UNBLOCK_INPUT; + } +#endif +} + +/* Hide tooltip if shown. Do nothing if not shown. + Return non-zero if tip was hidden, non-ero if not (i.e. not using + system tooltips). */ + +int +xg_hide_tooltip (FRAME_PTR f) +{ + int ret = 0; +#ifdef USE_GTK_TOOLTIP + if (f->output_data.x->ttip_window) + { + GtkWindow *win = f->output_data.x->ttip_window; + BLOCK_INPUT; + gtk_widget_hide (GTK_WIDGET (win)); + + if (g_object_get_data (G_OBJECT (win), "restore-tt")) + { + GdkWindow *gwin = gtk_widget_get_window (GTK_WIDGET (win)); + GdkScreen *screen = gdk_drawable_get_screen (gwin); + GtkSettings *settings = gtk_settings_get_for_screen (screen); + g_object_set (settings, "gtk-enable-tooltips", TRUE, NULL); + } + UNBLOCK_INPUT; + + ret = 1; + } +#endif + return ret; +} + + +/*********************************************************************** General functions for creating widgets, resizing, events, e.t.c. ***********************************************************************/ @@ -640,7 +808,8 @@ xg_frame_set_char_size (FRAME_PTR f, int cols, int rows) /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it after calculating that value. */ - pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); + pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols) + + FRAME_TOOLBAR_WIDTH (f); /* Do this before resize, as we don't know yet if we will be resized. */ @@ -677,14 +846,15 @@ xg_frame_set_char_size (FRAME_PTR f, int cols, int rows) } } -/* Handle height changes (i.e. add/remove menu/toolbar). +/* Handle height/width changes (i.e. add/remove/move menu/toolbar). The policy is to keep the number of editable lines. */ static void -xg_height_changed (FRAME_PTR f) +xg_height_or_width_changed (FRAME_PTR f) { gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f)); + FRAME_TOTAL_PIXEL_WIDTH (f), + FRAME_TOTAL_PIXEL_HEIGHT (f)); f->output_data.x->hint_flags = 0; x_wm_set_size_hint (f, 0, 0); } @@ -733,7 +903,7 @@ int xg_create_frame_widgets (FRAME_PTR f) { GtkWidget *wtop; - GtkWidget *wvbox; + GtkWidget *wvbox, *whbox; GtkWidget *wfixed; GdkColor bg; GtkRcStyle *style; @@ -749,12 +919,14 @@ xg_create_frame_widgets (FRAME_PTR f) xg_set_screen (wtop, f); wvbox = gtk_vbox_new (FALSE, 0); + whbox = gtk_hbox_new (FALSE, 0); wfixed = gtk_fixed_new (); /* Must have this to place scroll bars */ - if (! wtop || ! wvbox || ! wfixed) + if (! wtop || ! wvbox || ! whbox || ! wfixed) { if (wtop) gtk_widget_destroy (wtop); if (wvbox) gtk_widget_destroy (wvbox); + if (whbox) gtk_widget_destroy (whbox); if (wfixed) gtk_widget_destroy (wfixed); UNBLOCK_INPUT; @@ -775,11 +947,13 @@ xg_create_frame_widgets (FRAME_PTR f) FRAME_GTK_OUTER_WIDGET (f) = wtop; FRAME_GTK_WIDGET (f) = wfixed; f->output_data.x->vbox_widget = wvbox; + f->output_data.x->hbox_widget = whbox; gtk_widget_set_has_window (wfixed, TRUE); gtk_container_add (GTK_CONTAINER (wtop), wvbox); - gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (wvbox), whbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (whbox), wfixed, TRUE, TRUE, 0); if (FRAME_EXTERNAL_TOOL_BAR (f)) update_frame_tool_bar (f); @@ -838,17 +1012,38 @@ xg_create_frame_widgets (FRAME_PTR f) style->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup ("<none>"); gtk_widget_modify_style (wfixed, style); - /* GTK does not set any border, and they look bad with GTK. */ - /* That they look bad is no excuse for imposing this here. --Stef - It should be done by providing the proper default in Fx_create_Frame. - f->border_width = 0; - f->internal_border_width = 0; */ +#ifdef USE_GTK_TOOLTIP + /* Steal a tool tip window we can move ourselves. */ + f->output_data.x->ttip_widget = 0; + f->output_data.x->ttip_lbl = 0; + f->output_data.x->ttip_window = 0; + gtk_widget_set_tooltip_text (wtop, "Dummy text"); + g_signal_connect (wtop, "query-tooltip", G_CALLBACK (qttip_cb), f); +#endif UNBLOCK_INPUT; return 1; } +void +xg_free_frame_widgets (FRAME_PTR f) +{ + if (FRAME_GTK_OUTER_WIDGET (f)) + { + struct x_output *x = f->output_data.x; + gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f)); + FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */ + FRAME_GTK_OUTER_WIDGET (f) = 0; +#ifdef USE_GTK_TOOLTIP + if (x->ttip_lbl) + gtk_widget_destroy (x->ttip_lbl); + if (x->ttip_widget) + g_object_unref (G_OBJECT (x->ttip_widget)); +#endif + } +} + /* Set the normal size hints for the window manager, for frame F. FLAGS is the flags word to use--or 0 meaning preserve the flags that the window now has. @@ -889,7 +1084,7 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) size_hints.height_inc = FRAME_LINE_HEIGHT (f); hint_flags |= GDK_HINT_BASE_SIZE; - base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); + base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0) + FRAME_TOOLBAR_WIDTH (f); base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); @@ -988,10 +1183,10 @@ xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask) /* Return the dialog title to use for a dialog of type KEY. This is the encoding used by lwlib. We use the same for GTK. */ -static char * +static const char * get_dialog_title (char key) { - char *title = ""; + const char *title = ""; switch (key) { case 'E': case 'e': @@ -1048,7 +1243,7 @@ create_dialog (widget_value *wv, GCallback select_cb, GCallback deactivate_cb) { - char *title = get_dialog_title (wv->name[0]); + const char *title = get_dialog_title (wv->name[0]); int total_buttons = wv->name[1] - '0'; int right_buttons = wv->name[4] - '0'; int left_buttons; @@ -1566,7 +1761,7 @@ xg_get_file_name (FRAME_PTR f, DEFAULT_NAME, if non-zero, is the default font name. */ char * -xg_get_font_name (FRAME_PTR f, char *default_name) +xg_get_font_name (FRAME_PTR f, const char *default_name) { GtkWidget *w; char *fontname = NULL; @@ -1776,7 +1971,7 @@ menu_destroy_callback (GtkWidget *w, gpointer client_data) Returns the GtkHBox. */ static GtkWidget * -make_widget_for_menu_item (char *utf8_label, char *utf8_key) +make_widget_for_menu_item (const char *utf8_label, const char *utf8_key) { GtkWidget *wlbl; GtkWidget *wkey; @@ -1814,8 +2009,8 @@ make_widget_for_menu_item (char *utf8_label, char *utf8_key) but the MacOS X version doesn't either, so I guess that is OK. */ static GtkWidget * -make_menu_item (char *utf8_label, - char *utf8_key, +make_menu_item (const char *utf8_label, + const char *utf8_key, widget_value *item, GSList **group) { @@ -2043,7 +2238,7 @@ create_menus (widget_value *data, int add_tearoff_p, GtkWidget *topmenu, xg_menu_cb_data *cl_data, - char *name) + const char *name) { widget_value *item; GtkWidget *wmenu = topmenu; @@ -2175,7 +2370,7 @@ create_menus (widget_value *data, Returns the widget created. */ GtkWidget * -xg_create_widget (char *type, char *name, FRAME_PTR f, widget_value *val, +xg_create_widget (const char *type, const char *name, FRAME_PTR f, widget_value *val, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb) { @@ -2828,7 +3023,7 @@ xg_update_frame_menubar (FRAME_PTR f) gtk_widget_show_all (x->menubar_widget); gtk_widget_size_request (x->menubar_widget, &req); FRAME_MENUBAR_HEIGHT (f) = req.height; - xg_height_changed (f); + xg_height_or_width_changed (f); UNBLOCK_INPUT; return 1; @@ -2851,7 +3046,7 @@ free_frame_menubar (FRAME_PTR f) the container. */ x->menubar_widget = 0; FRAME_MENUBAR_HEIGHT (f) = 0; - xg_height_changed (f); + xg_height_or_width_changed (f); UNBLOCK_INPUT; } } @@ -3038,7 +3233,7 @@ xg_create_scroll_bar (FRAME_PTR f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, - char *scroll_bar_name) + const char *scroll_bar_name) { GtkWidget *wscroll; GtkWidget *webox; @@ -3548,13 +3743,21 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox, if (f) { + GtkRequisition req, req2; FRAME_X_OUTPUT (f)->toolbar_detached = 1; - - /* When detaching a tool bar, not everything dissapear. There are - a few pixels left that are used to drop the tool bar back into - place. */ - FRAME_TOOLBAR_HEIGHT (f) = 4; - xg_height_changed (f); + gtk_widget_size_request (GTK_WIDGET (wbox), &req); + gtk_widget_size_request (w, &req2); + req.width -= req2.width; + req.height -= req2.height; + if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0) + FRAME_TOOLBAR_TOP_HEIGHT (f) = req.height; + else if (FRAME_TOOLBAR_BOTTOM_HEIGHT (f) != 0) + FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = req.height; + else if (FRAME_TOOLBAR_RIGHT_WIDTH (f) != 0) + FRAME_TOOLBAR_RIGHT_WIDTH (f) = req.width; + else if (FRAME_TOOLBAR_LEFT_WIDTH (f) != 0) + FRAME_TOOLBAR_LEFT_WIDTH (f) = req.width; + xg_height_or_width_changed (f); } } @@ -3575,13 +3778,21 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox, if (f) { - GtkRequisition req; - + GtkRequisition req, req2; FRAME_X_OUTPUT (f)->toolbar_detached = 0; - - gtk_widget_size_request (w, &req); - FRAME_TOOLBAR_HEIGHT (f) = req.height; - xg_height_changed (f); + gtk_widget_size_request (GTK_WIDGET (wbox), &req); + gtk_widget_size_request (w, &req2); + req.width += req2.width; + req.height += req2.height; + if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0) + FRAME_TOOLBAR_TOP_HEIGHT (f) = req.height; + else if (FRAME_TOOLBAR_BOTTOM_HEIGHT (f) != 0) + FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = req.height; + else if (FRAME_TOOLBAR_RIGHT_WIDTH (f) != 0) + FRAME_TOOLBAR_RIGHT_WIDTH (f) = req.width; + else if (FRAME_TOOLBAR_LEFT_WIDTH (f) != 0) + FRAME_TOOLBAR_LEFT_WIDTH (f) = req.width; + xg_height_or_width_changed (f); } } @@ -3656,41 +3867,63 @@ xg_tool_bar_item_expose_callback (GtkWidget *w, return FALSE; } +#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION +#define toolbar_set_orientation(w, o) \ + gtk_orientable_set_orientation (GTK_ORIENTABLE (w), o) +#else +#define toolbar_set_orientation(w, o) \ + gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o) +#endif + /* Attach a tool bar to frame F. */ static void -xg_pack_tool_bar (FRAME_PTR f) +xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos) { struct x_output *x = f->output_data.x; - int vbox_pos = x->menubar_widget ? 1 : 0; - - x->handlebox_widget = gtk_handle_box_new (); - g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached", - G_CALLBACK (xg_tool_bar_detach_callback), f); - g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached", - G_CALLBACK (xg_tool_bar_attach_callback), f); + int into_hbox = EQ (pos, Qleft) || EQ (pos, Qright); - gtk_container_add (GTK_CONTAINER (x->handlebox_widget), - x->toolbar_widget); - - gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget, - FALSE, FALSE, 0); - - gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->handlebox_widget, - vbox_pos); + toolbar_set_orientation (x->toolbar_widget, + into_hbox + ? GTK_ORIENTATION_VERTICAL + : GTK_ORIENTATION_HORIZONTAL); + if (!x->handlebox_widget) + { + x->handlebox_widget = gtk_handle_box_new (); + g_signal_connect (G_OBJECT (x->handlebox_widget), "child-detached", + G_CALLBACK (xg_tool_bar_detach_callback), f); + g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached", + G_CALLBACK (xg_tool_bar_attach_callback), f); + gtk_container_add (GTK_CONTAINER (x->handlebox_widget), + x->toolbar_widget); + } - gtk_widget_show (x->toolbar_widget); - gtk_widget_show (x->handlebox_widget); + if (into_hbox) + { + gtk_box_pack_start (GTK_BOX (x->hbox_widget), x->handlebox_widget, + FALSE, FALSE, 0); + + if (EQ (pos, Qleft)) + gtk_box_reorder_child (GTK_BOX (x->hbox_widget), + x->handlebox_widget, + 0); + x->toolbar_in_hbox = 1; + } + else + { + int vbox_pos = x->menubar_widget ? 1 : 0; + gtk_box_pack_start (GTK_BOX (x->vbox_widget), x->handlebox_widget, + FALSE, FALSE, 0); + + if (EQ (pos, Qtop)) + gtk_box_reorder_child (GTK_BOX (x->vbox_widget), + x->handlebox_widget, + vbox_pos); + x->toolbar_in_hbox = 0; + } } /* Create a tool bar for frame F. */ -#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION -#define toolbar_set_orientation(w, o) \ - gtk_orientable_set_orientation (GTK_ORIENTABLE (w), o) -#else -#define toolbar_set_orientation(w, o) \ - gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o) -#endif static void xg_create_tool_bar (FRAME_PTR f) @@ -3703,8 +3936,7 @@ xg_create_tool_bar (FRAME_PTR f) gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar"); gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); - toolbar_set_orientation (x->toolbar_widget, - GTK_ORIENTATION_HORIZONTAL); + toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); } @@ -3745,19 +3977,27 @@ static GtkToolItem * xg_make_tool_item (FRAME_PTR f, GtkWidget *wimage, GtkWidget **wbutton, - char *label, + const char *label, int i) { GtkToolItem *ti = gtk_tool_item_new (); - GtkWidget *vb = EQ (Vtool_bar_style, Qboth_horiz) + Lisp_Object style = Ftool_bar_get_system_style (); + int both_horiz = EQ (style, Qboth_horiz); + int text_image = EQ (style, Qtext_image_horiz); + + GtkWidget *vb = both_horiz || text_image ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0); GtkWidget *wb = gtk_button_new (); GtkWidget *weventbox = gtk_event_box_new (); - if (wimage) + if (wimage && ! text_image) gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vb), gtk_label_new (label), TRUE, TRUE, 0); + + if (wimage && text_image) + gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0); + gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE); gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE); gtk_container_add (GTK_CONTAINER (wb), vb); @@ -3819,11 +4059,12 @@ static void xg_show_toolbar_item (GtkToolItem *ti) { Lisp_Object style = Ftool_bar_get_system_style (); + int both_horiz = EQ (style, Qboth_horiz); + int text_image = EQ (style, Qtext_image_horiz); - int show_label = EQ (style, Qboth) - || EQ (style, Qboth_horiz) || EQ (style, Qtext); + int horiz = both_horiz || text_image; + int show_label = ! EQ (style, Qimage); int show_image = ! EQ (style, Qtext); - int horiz = EQ (style, Qboth_horiz); GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (ti)); GtkWidget *wbutton = gtk_bin_get_child (GTK_BIN (weventbox)); @@ -3836,15 +4077,21 @@ xg_show_toolbar_item (GtkToolItem *ti) new_box = gtk_hbox_new (FALSE, 0); else if (GTK_IS_HBOX (vb) && !horiz && show_label && show_image) new_box = gtk_vbox_new (FALSE, 0); - if (new_box) + + if (!new_box && horiz) + gtk_box_reorder_child (GTK_BOX (vb), wlbl, text_image ? 0 : 1); + else if (new_box) { g_object_ref (G_OBJECT (wimage)); g_object_ref (G_OBJECT (wlbl)); gtk_container_remove (GTK_CONTAINER (vb), wimage); gtk_container_remove (GTK_CONTAINER (vb), wlbl); gtk_widget_destroy (GTK_WIDGET (vb)); - gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0); + if (! text_image) + gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (new_box), wlbl, TRUE, TRUE, 0); + if (text_image) + gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (wbutton), new_box); g_object_unref (G_OBJECT (wimage)); g_object_unref (G_OBJECT (wlbl)); @@ -3861,16 +4108,57 @@ xg_show_toolbar_item (GtkToolItem *ti) gtk_widget_show (GTK_WIDGET (ti)); } +static int +xg_update_tool_bar_sizes (FRAME_PTR f) +{ + struct x_output *x = f->output_data.x; + GtkRequisition req; + int nl = 0, nr = 0, nt = 0, nb = 0; -/* Update the tool bar for frame F. Add new buttons and remove old. */ + gtk_widget_size_request (GTK_WIDGET (x->handlebox_widget), &req); + if (x->toolbar_in_hbox) + { + int pos; + gtk_container_child_get (GTK_CONTAINER (x->hbox_widget), + x->handlebox_widget, + "position", &pos, NULL); + if (pos == 0) nl = req.width; + else nr = req.width; + } + else + { + int pos; + gtk_container_child_get (GTK_CONTAINER (x->vbox_widget), + x->handlebox_widget, + "position", &pos, NULL); + if (pos == 0 || (pos == 1 && x->menubar_widget)) nt = req.height; + else nb = req.height; + } + + if (nl != FRAME_TOOLBAR_LEFT_WIDTH (f) + || nr != FRAME_TOOLBAR_RIGHT_WIDTH (f) + || nt != FRAME_TOOLBAR_TOP_HEIGHT (f) + || nb != FRAME_TOOLBAR_BOTTOM_HEIGHT (f)) + { + FRAME_TOOLBAR_RIGHT_WIDTH (f) = FRAME_TOOLBAR_LEFT_WIDTH (f) + = FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0; + FRAME_TOOLBAR_LEFT_WIDTH (f) = nl; + FRAME_TOOLBAR_RIGHT_WIDTH (f) = nr; + FRAME_TOOLBAR_TOP_HEIGHT (f) = nt; + FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = nb; + return 1; + } -extern Lisp_Object Qx_gtk_map_stock; + return 0; +} + + +/* Update the tool bar for frame F. Add new buttons and remove old. */ void update_frame_tool_bar (FRAME_PTR f) { int i; - GtkRequisition old_req, new_req; struct x_output *x = f->output_data.x; int hmargin = 0, vmargin = 0; GtkToolbar *wtoolbar; @@ -3911,7 +4199,6 @@ update_frame_tool_bar (FRAME_PTR f) xg_create_tool_bar (f); wtoolbar = GTK_TOOLBAR (x->toolbar_widget); - gtk_widget_size_request (GTK_WIDGET (wtoolbar), &old_req); dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar)); for (i = 0; i < f->n_tool_bar_items; ++i) @@ -4129,18 +4416,16 @@ update_frame_tool_bar (FRAME_PTR f) if (ti) gtk_widget_hide_all (GTK_WIDGET (ti)); } while (ti != NULL); - new_req.height = 0; - if (pack_tool_bar && f->n_tool_bar_items != 0) - xg_pack_tool_bar (f); - - - gtk_widget_size_request (GTK_WIDGET (wtoolbar), &new_req); - if (old_req.height != new_req.height - && ! FRAME_X_OUTPUT (f)->toolbar_detached) + if (f->n_tool_bar_items != 0) { - FRAME_TOOLBAR_HEIGHT (f) = new_req.height; - xg_height_changed (f); + if (pack_tool_bar) + xg_pack_tool_bar (f, f->tool_bar_position); + gtk_widget_show (x->toolbar_widget); + gtk_widget_show (x->handlebox_widget); + if (xg_update_tool_bar_sizes (f)) + xg_height_or_width_changed (f); } + UNBLOCK_INPUT; } @@ -4158,21 +4443,54 @@ free_frame_tool_bar (FRAME_PTR f) BLOCK_INPUT; /* We may have created the toolbar_widget in xg_create_tool_bar, but not the x->handlebox_widget which is created in xg_pack_tool_bar. */ - if (is_packed) - gtk_container_remove (GTK_CONTAINER (x->vbox_widget), - x->handlebox_widget); + if (is_packed) + { + if (x->toolbar_in_hbox) + gtk_container_remove (GTK_CONTAINER (x->hbox_widget), + x->handlebox_widget); + else + gtk_container_remove (GTK_CONTAINER (x->vbox_widget), + x->handlebox_widget); + } else gtk_widget_destroy (x->toolbar_widget); x->toolbar_widget = 0; x->handlebox_widget = 0; - FRAME_TOOLBAR_HEIGHT (f) = 0; - xg_height_changed (f); + FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0; + FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0; + + xg_height_or_width_changed (f); UNBLOCK_INPUT; } } +int +xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos) +{ + struct x_output *x = f->output_data.x; + + if (! x->toolbar_widget || ! x->handlebox_widget) + return 1; + + BLOCK_INPUT; + g_object_ref (x->handlebox_widget); + if (x->toolbar_in_hbox) + gtk_container_remove (GTK_CONTAINER (x->hbox_widget), + x->handlebox_widget); + else + gtk_container_remove (GTK_CONTAINER (x->vbox_widget), + x->handlebox_widget); + xg_pack_tool_bar (f, pos); + g_object_unref (x->handlebox_widget); + if (xg_update_tool_bar_sizes (f)) + xg_height_or_width_changed (f); + + UNBLOCK_INPUT; + return 1; +} + /*********************************************************************** diff --git a/src/gtkutil.h b/src/gtkutil.h index 14693650de5..75620c54d10 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -133,10 +133,10 @@ extern char *xg_get_file_name (FRAME_PTR f, int mustmatch_p, int only_dir_p); -extern char *xg_get_font_name (FRAME_PTR f, char *); +extern char *xg_get_font_name (FRAME_PTR f, const char *); -extern GtkWidget *xg_create_widget (char *type, - char *name, +extern GtkWidget *xg_create_widget (const char *type, + const char *name, FRAME_PTR f, widget_value *val, GCallback select_cb, @@ -163,7 +163,7 @@ extern void xg_create_scroll_bar (FRAME_PTR f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, - char *scroll_bar_name); + const char *scroll_bar_name); extern void xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id); extern void xg_update_scrollbar_pos (FRAME_PTR f, @@ -181,6 +181,7 @@ extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); extern void update_frame_tool_bar (FRAME_PTR f); extern void free_frame_tool_bar (FRAME_PTR f); +extern int xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos); extern void xg_frame_resized (FRAME_PTR f, int pixelwidth, @@ -193,6 +194,7 @@ extern void xg_display_close (Display *dpy); extern GdkCursor * xg_create_default_cursor (Display *dpy); extern int xg_create_frame_widgets (FRAME_PTR f); +extern void xg_free_frame_widgets (FRAME_PTR f); extern void x_wm_set_size_hint (FRAME_PTR f, long flags, int user_position); @@ -202,6 +204,14 @@ extern void xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask); +extern int xg_prepare_tooltip (FRAME_PTR f, + Lisp_Object string, + int *width, + int *height); +extern void xg_show_tooltip (FRAME_PTR f, int root_x, int root_y); +extern int xg_hide_tooltip (FRAME_PTR f); + + /* Mark all callback data that are Lisp_object:s during GC. */ extern void xg_mark_data (void); diff --git a/src/image.c b/src/image.c index 2ea70e221cf..916fcfe8178 100644 --- a/src/image.c +++ b/src/image.c @@ -126,6 +126,9 @@ typedef struct ns_bitmap_record Bitmap_Record; Lisp_Object Vx_bitmap_file_path; +/* The symbol `postscript' identifying images of this type. */ + +Lisp_Object Qpostscript; static void x_disable_image (struct frame *, struct image *); static void x_edge_detection (struct frame *, struct image *, Lisp_Object, @@ -578,9 +581,6 @@ Lisp_Object Qxbm; /* Keywords. */ -extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; -extern Lisp_Object QCdata, QCtype; -extern Lisp_Object Qcenter; Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask; @@ -598,7 +598,7 @@ Lisp_Object Vimage_cache_eviction_delay; static Lisp_Object define_image_type (struct image_type *type, int loaded); static struct image_type *lookup_image_type (Lisp_Object symbol); -static void image_error (char *format, Lisp_Object, Lisp_Object); +static void image_error (const char *format, Lisp_Object, Lisp_Object); static void x_laplace (struct frame *, struct image *); static void x_emboss (struct frame *, struct image *); static int x_build_heuristic_mask (struct frame *, struct image *, @@ -699,7 +699,7 @@ valid_image_p (Lisp_Object object) therefore simply displays a message. */ static void -image_error (char *format, Lisp_Object arg1, Lisp_Object arg2) +image_error (const char *format, Lisp_Object arg1, Lisp_Object arg2) { add_to_log (format, arg1, arg2); } @@ -731,7 +731,7 @@ enum image_value_type struct image_keyword { /* Name of keyword. */ - char *name; + const char *name; /* The type of value allowed. */ enum image_value_type type; @@ -1759,8 +1759,6 @@ lookup_image (struct frame *f, Lisp_Object spec) /* If not found, create a new image and cache it. */ if (img == NULL) { - extern Lisp_Object Qpostscript; - BLOCK_INPUT; img = make_image (spec, hash); cache_image (f, img); @@ -3661,9 +3659,10 @@ enum xpm_token length of the corresponding token, respectively. */ static int -xpm_scan (s, end, beg, len) - const unsigned char **s, *end, **beg; - int *len; +xpm_scan (const unsigned char **s, + const unsigned char *end, + const unsigned char **beg, + int *len) { int c; @@ -3727,9 +3726,13 @@ xpm_scan (s, end, beg, len) hash table is used. */ static Lisp_Object -xpm_make_color_table_v (put_func, get_func) - void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object); - Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int); +xpm_make_color_table_v (void (**put_func) (Lisp_Object, + const unsigned char *, + int, + Lisp_Object), + Lisp_Object (**get_func) (Lisp_Object, + const unsigned char *, + int)) { *put_func = xpm_put_color_table_v; *get_func = xpm_get_color_table_v; @@ -3737,28 +3740,30 @@ xpm_make_color_table_v (put_func, get_func) } static void -xpm_put_color_table_v (color_table, chars_start, chars_len, color) - Lisp_Object color_table; - const unsigned char *chars_start; - int chars_len; - Lisp_Object color; +xpm_put_color_table_v (Lisp_Object color_table, + const unsigned char *chars_start, + int chars_len, + Lisp_Object color) { XVECTOR (color_table)->contents[*chars_start] = color; } static Lisp_Object -xpm_get_color_table_v (color_table, chars_start, chars_len) - Lisp_Object color_table; - const unsigned char *chars_start; - int chars_len; +xpm_get_color_table_v (Lisp_Object color_table, + const unsigned char *chars_start, + int chars_len) { return XVECTOR (color_table)->contents[*chars_start]; } static Lisp_Object -xpm_make_color_table_h (put_func, get_func) - void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object); - Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int); +xpm_make_color_table_h (void (**put_func) (Lisp_Object, + const unsigned char *, + int, + Lisp_Object), + Lisp_Object (**get_func) (Lisp_Object, + const unsigned char *, + int)) { *put_func = xpm_put_color_table_h; *get_func = xpm_get_color_table_h; @@ -3769,11 +3774,10 @@ xpm_make_color_table_h (put_func, get_func) } static void -xpm_put_color_table_h (color_table, chars_start, chars_len, color) - Lisp_Object color_table; - const unsigned char *chars_start; - int chars_len; - Lisp_Object color; +xpm_put_color_table_h (Lisp_Object color_table, + const unsigned char *chars_start, + int chars_len, + Lisp_Object color) { struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); unsigned hash_code; @@ -3784,10 +3788,9 @@ xpm_put_color_table_h (color_table, chars_start, chars_len, color) } static Lisp_Object -xpm_get_color_table_h (color_table, chars_start, chars_len) - Lisp_Object color_table; - const unsigned char *chars_start; - int chars_len; +xpm_get_color_table_h (Lisp_Object color_table, + const unsigned char *chars_start, + int chars_len) { struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), @@ -3807,8 +3810,7 @@ enum xpm_color_key { static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"}; static int -xpm_str_to_color_key (s) - const char *s; +xpm_str_to_color_key (const char *s) { int i; @@ -3821,10 +3823,10 @@ xpm_str_to_color_key (s) } static int -xpm_load_image (f, img, contents, end) - struct frame *f; - struct image *img; - const unsigned char *contents, *end; +xpm_load_image (struct frame *f, + struct image *img, + const unsigned char *contents, + const unsigned char *end) { const unsigned char *s = contents, *beg, *str; unsigned char buffer[BUFSIZ]; @@ -4056,9 +4058,8 @@ xpm_load_image (f, img, contents, end) } static int -xpm_load (f, img) - struct frame *f; - struct image *img; +xpm_load (struct frame *f, + struct image *img) { int success_p = 0; Lisp_Object file_name; @@ -7742,10 +7743,6 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. * #define HAVE_GHOSTSCRIPT 1 #endif /* HAVE_X_WINDOWS */ -/* The symbol `postscript' identifying images of this type. */ - -Lisp_Object Qpostscript; - #ifdef HAVE_GHOSTSCRIPT static int gs_image_p (Lisp_Object object); @@ -8133,8 +8130,6 @@ of `image-library-alist', which see). */) void syms_of_image (void) { - extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ - /* Initialize this only once, since that's what we do with Vimage_types and they are supposed to be in sync. Initializing here gives correct operation on GNU/Linux of calling dump-emacs after loading some images. */ diff --git a/src/indent.c b/src/indent.c index 0f71c6d82d7..970904cba7b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -469,7 +469,6 @@ current_column (void) return col; } -extern Lisp_Object Qspace, QCwidth, QCalign_to; /* Check the presence of a display property and compute its width. If a property was found and its width was found as well, return diff --git a/src/insdel.c b/src/insdel.c index 8b0b2f7ab01..00025808e37 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -74,6 +74,8 @@ Lisp_Object combine_after_change_buffer; Lisp_Object Qinhibit_modification_hooks; +extern Lisp_Object Vselect_active_regions, Vsaved_region_selection; + /* Check all markers in the current buffer, looking for something invalid. */ @@ -2047,6 +2049,20 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, base_buffer->filename); #endif /* not CLASH_DETECTION */ + /* If `select-active-regions' is non-nil, save the region text. */ + if (!NILP (Vselect_active_regions) + && !NILP (current_buffer->mark_active) + && !NILP (Vtransient_mark_mode) + && NILP (Vsaved_region_selection)) + { + int b = XINT (Fmarker_position (current_buffer->mark)); + int e = XINT (make_number (PT)); + if (b < e) + Vsaved_region_selection = make_buffer_string (b, e, 0); + else if (b > e) + Vsaved_region_selection = make_buffer_string (e, b, 0); + } + signal_before_change (start, end, preserve_ptr); if (current_buffer->newline_cache) diff --git a/src/keyboard.c b/src/keyboard.c index ce80bb9d641..aaa9306eded 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -246,9 +246,6 @@ Lisp_Object Vminibuffer_message_timeout; ASCII character. */ int quit_char; -extern Lisp_Object current_global_map; -extern int minibuf_level; - /* If non-nil, this is a map that overrides all other local maps. */ Lisp_Object Voverriding_local_map; @@ -364,6 +361,15 @@ Lisp_Object Vlast_event_frame; X Windows wants this for selection ownership. */ unsigned long last_event_timestamp; +/* If non-nil, active regions automatically become the window selection. */ +Lisp_Object Vselect_active_regions; + +/* The text in the active region prior to modifying the buffer. + Used by the `select-active-regions' feature. */ +Lisp_Object Vsaved_region_selection; + +Lisp_Object Qx_set_selection, QPRIMARY, Qlazy; + Lisp_Object Qself_insert_command; Lisp_Object Qforward_char; Lisp_Object Qbackward_char; @@ -468,8 +474,6 @@ Lisp_Object Qmake_frame_visible; Lisp_Object Qselect_window; Lisp_Object Qhelp_echo; -extern Lisp_Object Qremap; - #if defined (HAVE_MOUSE) || defined (HAVE_GPM) Lisp_Object Qmouse_fixup_help_message; #endif @@ -497,7 +501,6 @@ Lisp_Object Qevent_symbol_elements; Lisp_Object Qmenu_enable; Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence; Lisp_Object QCbutton, QCtoggle, QCradio, QClabel; -extern Lisp_Object Qmenu_item; /* An event header symbol HEAD may have a property named Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); @@ -517,17 +520,12 @@ Lisp_Object Qmode_line; Lisp_Object Qvertical_line; Lisp_Object Qvertical_scroll_bar; Lisp_Object Qmenu_bar; -extern Lisp_Object Qleft_margin, Qright_margin; -extern Lisp_Object Qleft_fringe, Qright_fringe; -extern Lisp_Object QCmap; Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void); Lisp_Object Fthis_command_keys (void); Lisp_Object Qextended_command_history; EMACS_TIME timer_check (int do_it_now); -extern Lisp_Object Vhistory_length, Vtranslation_table_for_input; - static void record_menu_key (Lisp_Object c); static int echo_length (void); @@ -542,8 +540,6 @@ Lisp_Object Vtimer_idle_list; /* Incremented whenever a timer is run. */ int timers_run; -extern Lisp_Object Vprint_level, Vprint_length; - /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt happens. */ EMACS_TIME *input_available_clear_time; @@ -626,7 +622,7 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, unsigned long); #endif static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object, - Lisp_Object, char **, + Lisp_Object, const char **, Lisp_Object *, unsigned); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static void save_getcjmp (jmp_buf); @@ -635,7 +631,9 @@ static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); static SIGTYPE interrupt_signal (int signalnum); +#ifdef SIGIO static SIGTYPE input_available_signal (int signo); +#endif static void handle_interrupt (void); static void timer_start_idle (void); static void timer_stop_idle (void); @@ -648,7 +646,6 @@ static int store_user_signal_events (void); to support it. */ static int cannot_suspend; -extern Lisp_Object Qidentity, Qonly; /* Install the string STR as the beginning of the string of echoing, so that it serves as a prompt for the next character. @@ -1378,7 +1375,7 @@ This also exits all active minibuffers. */) while (INPUT_BLOCKED_P) UNBLOCK_INPUT; - return Fthrow (Qtop_level, Qnil); + Fthrow (Qtop_level, Qnil); } DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", @@ -1389,7 +1386,6 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, Fthrow (Qexit, Qnil); error ("No recursive edit is in progress"); - return Qnil; } DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", @@ -1400,7 +1396,6 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, Fthrow (Qexit, Qt); error ("No recursive edit is in progress"); - return Qnil; } #if defined (HAVE_MOUSE) || defined (HAVE_GPM) @@ -1795,11 +1790,29 @@ command_loop_1 (void) Vtransient_mark_mode = Qnil; else if (EQ (Vtransient_mark_mode, Qonly)) Vtransient_mark_mode = Qidentity; + else if (EQ (Vselect_active_regions, Qlazy) + ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) + : (!NILP (Vselect_active_regions) + && !NILP (Vtransient_mark_mode))) + { + /* Set window selection. If `select-active-regions' is + `lazy', only do it for temporarily active regions. */ + int beg = XINT (Fmarker_position (current_buffer->mark)); + int end = XINT (make_number (PT)); + if (beg < end) + call2 (Qx_set_selection, QPRIMARY, + make_buffer_string (beg, end, 0)); + else if (beg > end) + call2 (Qx_set_selection, QPRIMARY, + make_buffer_string (end, beg, 0)); + } if (!NILP (Vdeactivate_mark)) call0 (Qdeactivate_mark); else if (current_buffer != prev_buffer || MODIFF != prev_modiff) call1 (Vrun_hooks, intern ("activate-mark-hook")); + + Vsaved_region_selection = Qnil; } finalize: @@ -1836,16 +1849,11 @@ command_loop_1 (void) } } -extern Lisp_Object Qcomposition, Qdisplay; - /* Adjust point to a boundary of a region that has such a property that should be treated intangible. For the moment, we check `composition', `display' and `invisible' properties. LAST_PT is the last position of point. */ -extern Lisp_Object Qafter_string, Qbefore_string; -extern Lisp_Object get_pos_property (Lisp_Object, Lisp_Object, Lisp_Object); - static void adjust_point_for_property (int last_pt, int modified) { @@ -3895,7 +3903,7 @@ kbd_buffer_get_event (KBOARD **kbp, { register int c; Lisp_Object obj; - + if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4) { /* Start reading input again, we have processed enough so we can @@ -4372,8 +4380,6 @@ struct input_event last_timer_event; ...). Each element has the form (FUN . ARGS). */ Lisp_Object pending_funcalls; -extern Lisp_Object Qapply; - /* Check whether a timer has fired. To prevent larger problems we simply disregard elements that are not proper timers. Do not make a circular timer list for the time being. @@ -4745,7 +4751,7 @@ static const int lispy_accent_codes[] = /* This is a list of Lisp names for special "accent" characters. It parallels lispy_accent_codes. */ -static char *lispy_accent_keys[] = +static const char *lispy_accent_keys[] = { "dead-circumflex", "dead-grave", @@ -4772,7 +4778,7 @@ static char *lispy_accent_keys[] = #ifdef HAVE_NTGUI #define FUNCTION_KEY_OFFSET 0x0 -char *lispy_function_keys[] = +char const *lispy_function_keys[] = { 0, /* 0 */ @@ -4966,7 +4972,7 @@ char *lispy_function_keys[] = /* Some of these duplicate the "Media keys" on newer keyboards, but they are delivered to the application in a different way. */ -static char *lispy_multimedia_keys[] = +static const char *lispy_multimedia_keys[] = { 0, "browser-back", @@ -5030,7 +5036,7 @@ static char *lispy_multimedia_keys[] = the XK_kana_A case below. */ #if 0 #ifdef XK_kana_A -static char *lispy_kana_keys[] = +static const char *lispy_kana_keys[] = { /* X Keysym value */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x400 .. 0x40f */ @@ -5069,7 +5075,7 @@ static char *lispy_kana_keys[] = /* You'll notice that this table is arranged to be conveniently indexed by X Windows keysym values. */ -static char *lispy_function_keys[] = +static const char *lispy_function_keys[] = { /* X Keysym value */ @@ -5155,7 +5161,7 @@ static char *lispy_function_keys[] = /* ISO 9995 Function and Modifier Keys; the first byte is 0xFE. */ #define ISO_FUNCTION_KEY_OFFSET 0xfe00 -static char *iso_lispy_function_keys[] = +static const char *iso_lispy_function_keys[] = { 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe00 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe08 */ @@ -5178,14 +5184,14 @@ static char *iso_lispy_function_keys[] = Lisp_Object Vlispy_mouse_stem; -static char *lispy_wheel_names[] = +static const char *lispy_wheel_names[] = { "wheel-up", "wheel-down", "wheel-left", "wheel-right" }; /* drag-n-drop events are generated when a set of selected files are dragged from another application and dropped onto an Emacs window. */ -static char *lispy_drag_n_drop_names[] = +static const char *lispy_drag_n_drop_names[] = { "drag-n-drop" }; @@ -5196,7 +5202,7 @@ Lisp_Object Qup, Qdown, Qbottom, Qend_scroll; Lisp_Object Qtop, Qratio; /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ -Lisp_Object *scroll_bar_parts[] = { +const Lisp_Object *scroll_bar_parts[] = { &Qabove_handle, &Qhandle, &Qbelow_handle, &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio }; @@ -6563,7 +6569,7 @@ reorder_modifiers (Lisp_Object symbol) static Lisp_Object modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind, - Lisp_Object name_alist_or_stem, char **name_table, + Lisp_Object name_alist_or_stem, const char **name_table, Lisp_Object *symbol_table, unsigned int table_size) { Lisp_Object value; @@ -8016,9 +8022,8 @@ static Lisp_Object tool_bar_item_properties; static int ntool_bar_items; -/* The symbols `tool-bar', `:image' and `:rtl'. */ +/* The symbols `:image' and `:rtl'. */ -extern Lisp_Object Qtool_bar; Lisp_Object QCimage; Lisp_Object Qrtl; @@ -8116,7 +8121,6 @@ static void process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void *args) { int i; - extern Lisp_Object Qundefined; struct gcpro gcpro1, gcpro2; /* Protect KEY and DEF from GC because parse_tool_bar_item may call @@ -8322,8 +8326,8 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) /* Try to make one from caption and key. */ Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY); Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION); - char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : ""; - char *caption = STRINGP (capt) ? (char *) SDATA (capt) : ""; + const char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : ""; + const char *caption = STRINGP (capt) ? (char *) SDATA (capt) : ""; char buf[64]; EMACS_INT max_lbl = 2*tool_bar_max_label_size; Lisp_Object new_lbl; @@ -10243,7 +10247,6 @@ a special event, so ignore the prefix argument and don't clear it. */) register Lisp_Object final; register Lisp_Object tem; Lisp_Object prefixarg; - extern int debug_on_next_call; debug_on_next_call = 0; @@ -11529,7 +11532,7 @@ init_keyboard (void) event header symbols and put properties on them. */ struct event_head { Lisp_Object *var; - char *name; + const char *name; Lisp_Object *kind; }; @@ -11706,6 +11709,13 @@ syms_of_keyboard (void) Qinput_method_function = intern_c_string ("input-method-function"); staticpro (&Qinput_method_function); + Qx_set_selection = intern_c_string ("x-set-selection"); + staticpro (&Qx_set_selection); + QPRIMARY = intern_c_string ("PRIMARY"); + staticpro (&QPRIMARY); + Qlazy = intern_c_string ("lazy"); + staticpro (&Qlazy); + Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); staticpro (&Qinput_method_exit_on_first_char); Qinput_method_use_echo_area = intern_c_string ("input-method-use-echo-area"); @@ -12313,6 +12323,28 @@ Help functions bind this to allow help on disabled menu items and tool-bar buttons. */); Venable_disabled_menus_and_buttons = Qnil; + DEFVAR_LISP ("select-active-regions", + &Vselect_active_regions, + doc: /* If non-nil, an active region automatically becomes the window selection. +This takes effect only when Transient Mark mode is enabled. + +If the value is `lazy', Emacs only sets the window selection during +`deactivate-mark'; unless the region is temporarily active +(e.g. mouse-drags or shift-selection), in which case it sets the +window selection after each command. + +For other non-nil value, Emacs sets the window selection after every +command. */); + Vselect_active_regions = Qlazy; + + DEFVAR_LISP ("saved-region-selection", + &Vsaved_region_selection, + doc: /* Contents of active region prior to buffer modification. +If `select-active-regions' is non-nil, Emacs sets this to the +text in the region before modifying the buffer. The next +`deactivate-mark' call uses this to set the window selection. */); + Vsaved_region_selection = Qnil; + /* Create the initial keyboard. */ initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (initial_kboard); diff --git a/src/keyboard.h b/src/keyboard.h index a6eb750c373..693137b08f4 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -366,8 +366,6 @@ typedef struct _widget_value struct _widget_value* next; } widget_value; -extern widget_value *xmalloc_widget_value (void); -extern widget_value *digest_single_submenu (int, int, int); #endif /* HAVE_NS || HAVE_NTGUI */ @@ -406,6 +404,8 @@ extern widget_value *digest_single_submenu (int, int, int); #define POSN_INBUFFER_P(posn) (NILP (POSN_STRING (posn))) #define POSN_BUFFER_POSN(posn) (Fnth (make_number (5), (posn))) +extern Lisp_Object do_mouse_tracking; + /* Some of the event heads. */ extern Lisp_Object Qswitch_frame; @@ -420,6 +420,8 @@ extern Lisp_Object Qevent_kind, Qevent_symbol_elements; extern Lisp_Object Qfunction_key, Qmouse_click, Qmouse_movement; extern Lisp_Object Qscroll_bar_movement; +extern Lisp_Object Qhelp_echo; + /* Getting the kind of an event head. */ #define EVENT_HEAD_KIND(event_head) \ (Fget ((event_head), Qevent_kind)) @@ -427,6 +429,17 @@ extern Lisp_Object Qscroll_bar_movement; /* Symbols to use for non-text mouse positions. */ extern Lisp_Object Qmode_line, Qvertical_line, Qheader_line; +/* True while doing kbd input. */ +extern int waiting_for_input; + +/* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt + happens. */ +extern EMACS_TIME *input_available_clear_time; + +extern int ignore_mouse_drag_p; + +extern Lisp_Object Vdouble_click_time; + /* Forward declaration for prototypes. */ struct input_event; @@ -443,6 +456,37 @@ extern Lisp_Object Vfunction_key_map; /* Keymap of key translations that can override keymaps. */ extern Lisp_Object Vkey_translation_map; +/* This is like Vthis_command, except that commands never set it. */ +extern Lisp_Object real_this_command; + +/* If the lookup of the command returns a binding, the original + command is stored in this-original-command. It is nil otherwise. */ +extern Lisp_Object Vthis_original_command; + +/* Non-nil disable property on a command means + do not execute it; call disabled-command-function's value instead. */ +extern Lisp_Object QCbutton, QCtoggle, QCradio, QClabel; + +/* A mask of extra modifier bits to put into every keyboard char. */ +extern EMACS_INT extra_keyboard_modifiers; + +/* If non-nil, this implements the current input method. */ +extern Lisp_Object Vinput_method_function; +extern Lisp_Object Qinput_method_function; + +/* An event header symbol HEAD may have a property named + Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); + BASE is the base, unmodified version of HEAD, and MODIFIERS is the + mask of modifiers applied to it. If present, this is used to help + speed up parse_modifiers. */ +extern Lisp_Object Qevent_symbol_element_mask; + +/* The timestamp of the last input event we received from the X server. + X Windows wants this for selection ownership. */ +extern unsigned long last_event_timestamp; + +extern int quit_char; + extern int parse_menu_item (Lisp_Object, int); extern void echo_now (void); @@ -473,9 +517,7 @@ extern void kbd_buffer_store_event (struct input_event *); extern void kbd_buffer_store_event_hold (struct input_event *, struct input_event *); extern void kbd_buffer_unget_event (struct input_event *); -#ifdef POLL_FOR_INPUT extern void poll_for_input_1 (void); -#endif extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int); extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object, diff --git a/src/keymap.c b/src/keymap.c index 8a0c855e0dc..cc25d350d44 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -103,13 +103,6 @@ static Lisp_Object exclude_keys; /* Pre-allocated 2-element vector for Fcommand_remapping to use. */ static Lisp_Object command_remapping_vector; -/* A char with the CHAR_META bit set in a vector or the 0200 bit set - in a string key sequence is equivalent to prefixing with this - character. */ -extern Lisp_Object meta_prefix_char; - -extern Lisp_Object Voverriding_local_map; - /* Hash table used to cache a reverse-map to speed up calls to where-is. */ static Lisp_Object where_is_cache; /* Which keymaps are reverse-stored in the cache. */ @@ -181,13 +174,13 @@ in case you use it as a menu with `x-popup-menu'. */) initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */ void -initial_define_key (Lisp_Object keymap, int key, char *defname) +initial_define_key (Lisp_Object keymap, int key, const char *defname) { store_in_keymap (keymap, make_number (key), intern_c_string (defname)); } void -initial_define_lispy_key (Lisp_Object keymap, char *keyname, char *defname) +initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname) { store_in_keymap (keymap, intern_c_string (keyname), intern_c_string (defname)); } @@ -1228,7 +1221,7 @@ binding KEY to DEF is added at the front of KEYMAP. */) && (!CONSP (c) /* If C is a range, it must be a leaf. */ || (INTEGERP (XCAR (c)) && idx != length))) - error ("Key sequence contains invalid event"); + message_with_string ("Key sequence contains invalid event %s", c, 1); if (idx == length) RETURN_UNGCPRO (store_in_keymap (keymap, c, def)); @@ -1342,7 +1335,7 @@ recognize the default bindings, just as `read-key-sequence' does. */) /* Allow string since binding for `menu-bar-select-buffer' includes the buffer name in the key sequence. */ if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c) && !STRINGP (c)) - error ("Key sequence contains invalid event"); + message_with_string ("Key sequence contains invalid event %s", c, 1); cmd = access_keymap (keymap, c, t_ok, 0, 1); if (idx == length) @@ -2969,7 +2962,7 @@ The optional argument MENUS, if non-nil, says to mention menu bindings. register Lisp_Object start1; struct gcpro gcpro1; - char *alternate_heading + const char *alternate_heading = "\ Keyboard translations:\n\n\ You type Translation\n\ @@ -3141,13 +3134,13 @@ You type Translation\n\ void describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, - Lisp_Object prefix, char *title, int nomenu, int transl, + Lisp_Object prefix, const char *title, int nomenu, int transl, int always_title, int mention_shadow) { Lisp_Object maps, orig_maps, seen, sub_shadows; struct gcpro gcpro1, gcpro2, gcpro3; int something = 0; - char *key_heading + const char *key_heading = "\ key binding\n\ --- -------\n"; diff --git a/src/keymap.h b/src/keymap.h index 024b03dd1c3..c68d763204d 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -22,6 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define KEYMAPP(m) (!NILP (get_keymap (m, 0, 0))) extern Lisp_Object Qkeymap, Qmenu_bar; +extern Lisp_Object Qremap; +extern Lisp_Object Qmenu_item; +extern Lisp_Object meta_prefix_char; +extern Lisp_Object Voverriding_local_map; +extern Lisp_Object Voverriding_local_map_menu_flag; extern Lisp_Object current_global_map; EXFUN (Fmake_sparse_keymap, 1); EXFUN (Fkeymap_prompt, 1); @@ -38,10 +43,10 @@ extern Lisp_Object get_keyelt (Lisp_Object, int); extern Lisp_Object get_keymap (Lisp_Object, int, int); EXFUN (Fset_keymap_parent, 2); extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object, - char *, int, int, int, int); + const char *, int, int, int, int); extern int current_minor_maps (Lisp_Object **, Lisp_Object **); -extern void initial_define_key (Lisp_Object, int, char *); -extern void initial_define_lispy_key (Lisp_Object, char *, char *); +extern void initial_define_key (Lisp_Object, int, const char *); +extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); extern void syms_of_keymap (void); extern void keys_of_keymap (void); diff --git a/src/lisp.h b/src/lisp.h index 0559503c890..94851d157d1 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -254,7 +254,7 @@ enum Lisp_Fwd_Type #ifdef USE_LISP_UNION_TYPE -#ifndef WORDS_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN /* Definition of Lisp_Object for little-endian machines. */ @@ -278,7 +278,7 @@ union Lisp_Object } Lisp_Object; -#else /* If WORDS_BIG_ENDIAN */ +#else /* If WORDS_BIGENDIAN */ typedef union Lisp_Object @@ -300,7 +300,7 @@ union Lisp_Object } Lisp_Object; -#endif /* WORDS_BIG_ENDIAN */ +#endif /* WORDS_BIGENDIAN */ #ifdef __GNUC__ static __inline__ Lisp_Object @@ -508,12 +508,6 @@ extern Lisp_Object make_number (EMACS_INT); #define EQ(x, y) (XHASH (x) == XHASH (y)) #ifndef XPNTR -#ifdef HAVE_SHM -/* In this representation, data is found in two widely separated segments. */ -extern size_t pure_size; -#define XPNTR(a) \ - (XUINT (a) | (XUINT (a) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS)) -#else /* not HAVE_SHM */ #ifdef DATA_SEG_BITS /* This case is used for the rt-pc. In the diffs I was given, it checked for ptr = 0 @@ -528,7 +522,6 @@ extern size_t pure_size; size. */ #define XPNTR(a) ((EMACS_INT) XUINT (a)) #endif -#endif /* not HAVE_SHM */ #endif /* no XPNTR */ /* Largest and smallest representable fixnum values. These are the C @@ -979,8 +972,8 @@ struct Lisp_Subr } function; short min_args, max_args; const char *symbol_name; - char *intspec; - char *doc; + const char *intspec; + const char *doc; }; @@ -2295,7 +2288,8 @@ extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; extern Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive; extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; extern Lisp_Object Qtext_read_only; - +extern Lisp_Object Qinteractive_form; +extern Lisp_Object Qcircular_list; extern Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp; extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; @@ -2419,7 +2413,6 @@ extern void swap_in_global_binding (struct Lisp_Symbol *); EXFUN (Fend_of_line, 1); EXFUN (Fforward_char, 1); EXFUN (Fforward_line, 1); -extern int internal_self_insert (int, int); extern void syms_of_cmds (void); extern void keys_of_cmds (void); @@ -2428,7 +2421,6 @@ EXFUN (Fcoding_system_p, 1); EXFUN (Fcoding_system_base, 1); EXFUN (Fcoding_system_eol_type, 1); EXFUN (Fcheck_coding_system, 1); -EXFUN (Fcheck_coding_system, 1); EXFUN (Fread_coding_system, 2); EXFUN (Fread_non_nil_coding_system, 1); EXFUN (Ffind_operation_coding_system, MANY); @@ -2475,13 +2467,16 @@ extern void init_syntax_once (void); extern void syms_of_syntax (void); /* Defined in fns.c */ +extern Lisp_Object QCrehash_size, QCrehash_threshold; extern int use_dialog_box; +extern int use_file_dialog; extern int next_almost_prime (int); extern Lisp_Object larger_vector (Lisp_Object, int, Lisp_Object); extern void sweep_weak_hash_tables (void); +extern Lisp_Object Qcursor_in_echo_area; extern Lisp_Object Qstring_lessp; extern Lisp_Object Vfeatures; -extern Lisp_Object QCtest, QCweakness, Qequal, Qeq; +extern Lisp_Object QCsize, QCtest, QCweakness, Qequal, Qeq, Qeql; unsigned sxhash (Lisp_Object, int); Lisp_Object make_hash_table (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, @@ -2578,6 +2573,7 @@ EXFUN (Ffloat, 1); EXFUN (Ftruncate, 2); extern void init_floatfns (void); extern void syms_of_floatfns (void); +extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y); /* Defined in fringe.c */ extern void syms_of_fringe (void); @@ -2585,6 +2581,9 @@ extern void init_fringe (void); extern void init_fringe_once (void); /* Defined in image.c */ +extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; +extern Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; +extern Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask; EXFUN (Finit_image_library, 2); extern void syms_of_image (void); extern void init_image (void); @@ -2643,6 +2642,7 @@ extern void syms_of_insdel (void); /* Defined in dispnew.c */ extern Lisp_Object selected_frame; +extern Lisp_Object Vwindow_system_version; extern EMACS_INT baud_rate; EXFUN (Fding, 1); EXFUN (Fredraw_frame, 1); @@ -2658,10 +2658,23 @@ extern Lisp_Object Qinhibit_point_motion_hooks; extern Lisp_Object Qinhibit_redisplay, Qdisplay; extern Lisp_Object Qinhibit_eval_during_redisplay; extern Lisp_Object Qmessage_truncate_lines; -extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz; +extern Lisp_Object Qmenu_bar_update_hook; +extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; +extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; +extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz, Qtext_image_horiz; +extern Lisp_Object Qspace, Qcenter, QCalign_to; +extern Lisp_Object Qbar, Qhbar, Qbox, Qhollow; +extern Lisp_Object Qleft_margin, Qright_margin; extern Lisp_Object Vmessage_log_max; +extern Lisp_Object QCdata, QCfile; +extern Lisp_Object QCmap; +extern Lisp_Object Qrisky_local_variable; +extern Lisp_Object Vinhibit_redisplay; extern int message_enable_multibyte; +extern int noninteractive_need_newline; +extern EMACS_INT scroll_margin; extern Lisp_Object echo_area_buffer[2]; +extern void add_to_log (const char *, Lisp_Object, Lisp_Object); extern void check_message_stack (void); extern void setup_echo_area_for_printing (int); extern int push_message (void); @@ -2716,6 +2729,7 @@ extern int survives_gc_p (Lisp_Object); extern void mark_object (Lisp_Object); extern Lisp_Object Vpurify_flag; extern Lisp_Object Vmemory_full; +extern Lisp_Object *stack_base; EXFUN (Fcons, 2); EXFUN (list1, 1); EXFUN (list2, 2); @@ -2799,10 +2813,15 @@ extern int char_table_translate (Lisp_Object, int); extern void map_char_table (void (*) (Lisp_Object, Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object); +extern void map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), + Lisp_Object, Lisp_Object, + Lisp_Object, struct charset *, + unsigned, unsigned); extern void syms_of_chartab (void); /* Defined in print.c */ extern Lisp_Object Vprin1_to_string_buffer; +extern Lisp_Object Vprint_level, Vprint_length; extern void debug_print (Lisp_Object); EXFUN (Fprin1, 2); EXFUN (Fprin1_to_string, 2); @@ -2828,8 +2847,11 @@ extern void syms_of_print (void); extern int doprnt (char *, int, const char *, const char *, va_list); /* Defined in lread.c */ +extern Lisp_Object Vafter_load_alist; extern Lisp_Object Qvariable_documentation, Qstandard_input; +extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; extern Lisp_Object Vobarray, initial_obarray, Vstandard_input; +extern int load_in_progress; EXFUN (Fread, 1); EXFUN (Fread_from_string, 3); EXFUN (Fintern, 2); @@ -2870,6 +2892,7 @@ extern Lisp_Object Vautoload_queue; extern Lisp_Object Vdebug_on_error; extern Lisp_Object Vsignaling_function; extern int handling_signal; +extern int debug_on_next_call; extern int interactive_p (int); /* To run a normal hook, use the appropriate function from the list below. @@ -2950,6 +2973,11 @@ extern void init_eval (void); extern void syms_of_eval (void); /* Defined in editfns.c */ +extern Lisp_Object last_nonmenu_event; +extern Lisp_Object Qfield; +extern Lisp_Object Vinhibit_field_text_motion; +extern Lisp_Object Vsystem_name; +extern Lisp_Object Vuser_login_name; EXFUN (Fpropertize, MANY); EXFUN (Fcurrent_message, 0); EXFUN (Fgoto_char, 1); @@ -2996,7 +3024,6 @@ extern Lisp_Object make_buffer_string (int, int, int); extern Lisp_Object make_buffer_string_both (int, int, int, int, int); extern void init_editfns (void); extern void syms_of_editfns (void); -extern Lisp_Object Vinhibit_field_text_motion; EXFUN (Fconstrain_to_field, 5); EXFUN (Ffield_string, 1); EXFUN (Fdelete_field, 1); @@ -3038,7 +3065,7 @@ EXFUN (Fbuffer_disable_undo, 1); EXFUN (Fbuffer_enable_undo, 1); EXFUN (Ferase_buffer, 0); extern Lisp_Object Qoverlayp; -extern Lisp_Object Qevaporate; +extern Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string; extern Lisp_Object get_truename_buffer (Lisp_Object); extern struct buffer *all_buffers; EXFUN (Fprevious_overlay_change, 1); @@ -3070,6 +3097,10 @@ extern void syms_of_marker (void); /* Defined in fileio.c */ extern Lisp_Object Qfile_error; +extern Lisp_Object Qfile_exists_p; +extern Lisp_Object Qfile_directory_p; +extern Lisp_Object Qinsert_file_contents; +extern Lisp_Object Vauto_save_list_file_name; EXFUN (Ffind_file_name_handler, 2); EXFUN (Ffile_name_as_directory, 1); EXFUN (Fmake_temp_name, 1); @@ -3129,7 +3160,14 @@ extern void clear_regexp_cache (void); /* Defined in minibuf.c */ +extern Lisp_Object Qcompletion_ignore_case; +extern Lisp_Object Vcompletion_regexp_list; +extern Lisp_Object Vhistory_length; +extern Lisp_Object Vminibuffer_list; extern Lisp_Object last_minibuf_string; +extern int completion_ignore_case; +extern int history_delete_duplicates; +extern int minibuffer_auto_raise; extern void choose_minibuf_frame (void); EXFUN (Fcompleting_read, 8); EXFUN (Fread_from_minibuffer, 7); @@ -3148,7 +3186,9 @@ extern void syms_of_minibuf (void); /* Defined in callint.c */ extern Lisp_Object Qminus, Qplus, Vcurrent_prefix_arg; +extern Lisp_Object Qwhen; extern Lisp_Object Vcommand_history; +extern Lisp_Object Vmark_even_if_inactive; extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; EXFUN (Fcall_interactively, 3); EXFUN (Fprefix_numeric_value, 1); @@ -3156,6 +3196,7 @@ extern void syms_of_callint (void); /* Defined in casefiddle.c */ +extern Lisp_Object Qidentity; EXFUN (Fdowncase, 1); EXFUN (Fupcase, 1); EXFUN (Fcapitalize, 1); @@ -3179,12 +3220,17 @@ extern Lisp_Object echo_message_buffer; extern struct kboard *echo_kboard; extern void cancel_echoing (void); extern Lisp_Object Qdisabled, QCfilter; +extern Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; +extern Lisp_Object Qup, Qdown, Qbottom, Qend_scroll; +extern Lisp_Object Qtop, Qratio; extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level; extern Lisp_Object Vthrow_on_input; extern int input_pending; EXFUN (Fdiscard_input, 0); EXFUN (Frecursive_edit, 0); -EXFUN (Ftop_level, 0); +EXFUN (Ftop_level, 0) NO_RETURN; +EXFUN (Fexit_recursive_edit, 0) NO_RETURN; +EXFUN (Fabort_recursive_edit, 0) NO_RETURN; EXFUN (Fcommand_execute, 4); EXFUN (Finput_pending_p, 0); extern Lisp_Object menu_bar_items (Lisp_Object); @@ -3228,6 +3274,7 @@ extern void syms_of_indent (void); extern Lisp_Object Vx_resource_name; extern Lisp_Object Vx_resource_class; #endif /* HAVE_WINDOW_SYSTEM */ +extern Lisp_Object Qonly; extern Lisp_Object Qvisible; extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object); @@ -3267,12 +3314,19 @@ extern void frames_bury_buffer (Lisp_Object); extern void syms_of_frame (void); /* Defined in emacs.c */ +extern char **initial_argv; +extern int initial_argc; +#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS) +extern int display_arg; +#endif extern Lisp_Object decode_env_path (const char *, const char *); extern Lisp_Object Vinvocation_name, Vinvocation_directory; extern Lisp_Object Vbefore_init_time, Vafter_init_time; extern Lisp_Object Vinstallation_directory; extern Lisp_Object empty_unibyte_string, empty_multibyte_string; -EXFUN (Fkill_emacs, 1); +extern Lisp_Object Qfile_name_handler_alist; +extern void (*fatal_error_signal_hook) (void); +EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale (void); void synchronize_system_messages_locale (void); @@ -3301,6 +3355,7 @@ extern int inhibit_window_system; extern int running_asynch_code; /* Defined in process.c */ +extern Lisp_Object QCtype, Qlocal; EXFUN (Fget_process, 1); EXFUN (Fget_buffer_process, 1); EXFUN (Fprocessp, 1); @@ -3327,6 +3382,7 @@ extern void setup_process_coding_systems (Lisp_Object); extern Lisp_Object Vexec_path, Vexec_suffixes, Vexec_directory, Vdata_directory; extern Lisp_Object Vdoc_directory; +extern Lisp_Object Vshell_file_name; EXFUN (Fcall_process, MANY); extern int child_setup (int, int, int, char **, int, Lisp_Object); extern void init_callproc_1 (void); @@ -3335,6 +3391,7 @@ extern void set_initial_environment (void); extern void syms_of_callproc (void); /* Defined in doc.c */ +extern Lisp_Object Qfunction_documentation; extern Lisp_Object Vdoc_file_name; EXFUN (Fsubstitute_command_keys, 1); EXFUN (Fdocumentation, 2); @@ -3362,6 +3419,7 @@ extern void init_macros (void); extern void syms_of_macros (void); /* Defined in undo.c */ +extern Lisp_Object Qapply; extern Lisp_Object Qinhibit_read_only; EXFUN (Fundo_boundary, 0); extern void truncate_undo_list (struct buffer *); @@ -3378,12 +3436,14 @@ extern Lisp_Object Vundo_outer_limit; /* Defined in textprop.c */ extern Lisp_Object Qfont, Qmouse_face; extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks; +extern Lisp_Object Qfront_sticky, Qrear_nonsticky; +extern Lisp_Object Qminibuffer_prompt; + EXFUN (Fnext_single_property_change, 4); EXFUN (Fnext_single_char_property_change, 4); EXFUN (Fprevious_single_property_change, 4); EXFUN (Fget_text_property, 3); EXFUN (Fput_text_property, 5); -EXFUN (Fget_text_property, 3); EXFUN (Fprevious_char_property_change, 2); EXFUN (Fnext_char_property_change, 2); extern void report_interval_modification (Lisp_Object, Lisp_Object); @@ -3443,6 +3503,7 @@ extern int memcmp (void *, void *, size_t); #endif /* Defined in filelock.c */ +extern Lisp_Object Vtemporary_file_directory; EXFUN (Funlock_buffer, 0); EXFUN (Ffile_locked_p, 1); extern void unlock_all_files (void); @@ -3472,6 +3533,7 @@ extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, int, Lisp_Object); /* Defined in term.c */ +extern int *char_ins_del_vector; extern void syms_of_term (void); extern void fatal (const char *msgid, ...) NO_RETURN; @@ -3491,12 +3553,26 @@ EXFUN (Fset_fontset_font, 5); EXFUN (Fnew_fontset, 2); /* Defined in xfns.c, w32fns.c, or macfns.c */ +extern Lisp_Object Qfont_param; +extern Lisp_Object Vx_no_window_manager; EXFUN (Fxw_display_color_p, 1); EXFUN (Fx_file_dialog, 5); EXFUN (Fx_focus_frame, 1); #endif /* Defined in xfaces.c */ +extern Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe; +extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu; +extern Lisp_Object Qmode_line_inactive, Qvertical_border; +extern Lisp_Object Qface; +extern Lisp_Object Qnormal; +extern Lisp_Object QCfamily, QCweight, QCslant; +extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground; +extern Lisp_Object Vface_alternative_font_family_alist; +extern Lisp_Object Vface_font_rescale_alist; +extern Lisp_Object Vface_ignored_fonts; +extern Lisp_Object Vface_alternative_font_registry_alist; +extern Lisp_Object Vscalable_fonts_allowed; EXFUN (Fclear_face_cache, 1); EXFUN (Fx_load_color_file, 1); extern void syms_of_xfaces (void); @@ -3542,6 +3618,11 @@ int xd_pending_messages (void); void xd_read_queued_messages (void); void syms_of_dbusbind (void); #endif + +#ifdef DOS_NT +/* Defined in msdos.c, w32.c */ +extern char *emacs_root_dir (void); +#endif /* DOS_NT */ /* Nonzero means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ diff --git a/src/lread.c b/src/lread.c index 96c425850e4..1a6d7e832f6 100644 --- a/src/lread.c +++ b/src/lread.c @@ -75,7 +75,6 @@ Lisp_Object Qtest, Qsize; Lisp_Object Qweakness; Lisp_Object Qrehash_size; Lisp_Object Qrehash_threshold; -extern Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness; Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; @@ -92,8 +91,6 @@ static Lisp_Object Qget_emacs_mule_file_char; static Lisp_Object Qload_force_doc_strings; -extern Lisp_Object Qevent_symbol_element_mask; -extern Lisp_Object Qfile_exists_p; extern Lisp_Object Qinternal_interpreter_environment; /* non-zero if inside `load' */ @@ -858,8 +855,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, nothing is read. */ static int -lisp_file_lexically_bound_p (readcharfun) - Lisp_Object readcharfun; +lisp_file_lexically_bound_p (Lisp_Object readcharfun) { int ch = READCHAR; if (ch != ';') @@ -1105,7 +1101,7 @@ Return t if the file exists and loads successfully. */) int compiled = 0; Lisp_Object handler; int safe_p = 1; - char *fmode = "r"; + const char *fmode = "r"; Lisp_Object tmp[2]; int version; @@ -1405,7 +1401,6 @@ Return t if the file exists and loads successfully. */) static Lisp_Object load_unwind (Lisp_Object arg) /* used as unwind-protect function in load */ - { FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; if (stream != NULL) @@ -1696,9 +1691,8 @@ build_load_history (Lisp_Object filename, int entire) Vload_history); } -Lisp_Object +static Lisp_Object unreadpure (Lisp_Object junk) /* Used as unwind-protect function in readevalloop */ - { read_pure = 0; return Qnil; @@ -3975,7 +3969,7 @@ map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Ob } } -void +static void mapatoms_1 (Lisp_Object sym, Lisp_Object function) { call1 (function, sym); @@ -4139,7 +4133,7 @@ static Lisp_Object dump_path; void init_lread (void) { - char *normal; + const char *normal; int turn_off_warning = 0; /* Compute the default load-path. */ diff --git a/src/m/alpha.h b/src/m/alpha.h index ae8fd62d6f8..3b6d7da92df 100644 --- a/src/m/alpha.h +++ b/src/m/alpha.h @@ -25,10 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define _LP64 /* This doesn't appear to be necessary on OSF 4/5 -- fx. */ #endif -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ /* __alpha defined automatically */ @@ -64,12 +60,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ termio and struct termios are mutually incompatible. */ #define NO_TERMIO -#if defined (GNU_LINUX) || defined (__NetBSD__) || defined (__OpenBSD__) -# ifndef __ELF__ -# define COFF -# endif /* notdef __ELF__ */ -#endif - /* Many Alpha implementations (e.g. gas 2.8) can't handle DBL_MIN: they generate code that uses a signaling NaN instead of DBL_MIN. Define DBL_MIN_REPLACEMENT to be the next value larger than DBL_MIN: diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h index 1910c37bffc..30aa2678717 100644 --- a/src/m/amdx86-64.h +++ b/src/m/amdx86-64.h @@ -21,10 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define BITS_PER_LONG 64 #define BITS_PER_EMACS_INT 64 -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, diff --git a/src/m/arm.h b/src/m/arm.h index cf30e2e1b19..8b659bb5bd0 100644 --- a/src/m/arm.h +++ b/src/m/arm.h @@ -18,11 +18,5 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - -#define NO_REMAP - /* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42 (do not change this comment) */ diff --git a/src/m/hp800.h b/src/m/hp800.h index 3889a1a3e60..9998f701a6b 100644 --- a/src/m/hp800.h +++ b/src/m/hp800.h @@ -18,10 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend the bit field into an int. In other words, if bit fields are always unsigned. diff --git a/src/m/ia64.h b/src/m/ia64.h index 5266c682c78..bbf09ac878b 100644 --- a/src/m/ia64.h +++ b/src/m/ia64.h @@ -23,10 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define BITS_PER_LONG 64 #define BITS_PER_EMACS_INT 64 -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ /* __ia64__ defined automatically */ diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h index a44b2c4ec3b..785719e908b 100644 --- a/src/m/ibmrs6000.h +++ b/src/m/ibmrs6000.h @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ An address of data cannot be stored correctly in a Lisp object; we always lose the high bits. We must tell XPNTR to add them back. */ #define DATA_START 0x20000000 -#define WORDS_BIG_ENDIAN #define DATA_SEG_BITS 0x20000000 #ifndef NLIST_STRUCT diff --git a/src/m/ibms390.h b/src/m/ibms390.h index 087607b547d..0acc826a1ea 100644 --- a/src/m/ibms390.h +++ b/src/m/ibms390.h @@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend the 24-bit bit field into an int. In other words, if bit fields are always unsigned. diff --git a/src/m/intel386.h b/src/m/intel386.h index 76e5929e4e6..15601fae76e 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - #ifdef WINDOWSNT #define VIRT_ADDR_VARIES #define DATA_START get_data_start () @@ -32,8 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */ /* we cannot get the maximum address for brk */ #define ULIMIT_BREAK_VALUE (32*1024*1024) - -#define SEGMENT_MASK ((SEGMENT_SIZE)-1) #endif /* arch-tag: 746338f0-cb7b-4f49-a98c-cb50817cf2ec diff --git a/src/m/iris4d.h b/src/m/iris4d.h index 2ba6b5ba7ce..31f08d05cfc 100644 --- a/src/m/iris4d.h +++ b/src/m/iris4d.h @@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend the bit field into an int. In other words, if bit fields are always unsigned. @@ -36,17 +32,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define DATA_START 0x10000000 #define DATA_SEG_BITS 0x10000000 - -#if _MIPS_SZLONG != 64 -/* fixme: should there be 64-bit definitions? (The ones below aren't OK.) */ - -/* The standard definitions of these macros would work ok, - but these are faster because the constants are short. */ -#define XUINT(a) (((unsigned)(a) << BITS_PER_INT-VALBITS) >> BITS_PER_INT-VALBITS) - -#define XSET(var, type, ptr) \ - ((var) = ((int)(type) << VALBITS) + (((unsigned) (ptr) << BITS_PER_INT-VALBITS) >> BITS_PER_INT-VALBITS)) -#endif /* _LP64 */ - /* arch-tag: fff5e139-9ae0-465d-afec-837c41ea0aa6 (do not change this comment) */ diff --git a/src/m/m68k.h b/src/m/m68k.h index 5a083205e50..8d53424ccec 100644 --- a/src/m/m68k.h +++ b/src/m/m68k.h @@ -18,10 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ #ifndef m68k @@ -40,7 +36,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define DATA_SEG_BITS 0x80000000 #endif -#define NO_REMAP #endif /* arch-tag: 4eadd161-b4e8-4b82-82a1-e4ce7f42969d diff --git a/src/m/macppc.h b/src/m/macppc.h index 2764ae56115..01735790b20 100644 --- a/src/m/macppc.h +++ b/src/m/macppc.h @@ -18,10 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/mips.h b/src/m/mips.h index 39a948c0cde..b3a754c2b61 100644 --- a/src/m/mips.h +++ b/src/m/mips.h @@ -18,12 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#if ! (defined (__MIPSEL__) || defined (MIPSEL) || defined (_MIPSEL)) -#define WORDS_BIG_ENDIAN -#endif - /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend the 24-bit bit field into an int. In other words, if bit fields are always unsigned. diff --git a/src/m/sh3.h b/src/m/sh3.h index 703513d23f7..ebfdb5b2d64 100644 --- a/src/m/sh3.h +++ b/src/m/sh3.h @@ -1,8 +1,4 @@ /* Machine description file for SuperH. */ -#ifdef __BIG_ENDIAN__ -# define WORDS_BIG_ENDIAN -#endif - /* arch-tag: 1b01b84f-f044-4afa-aa4b-caa54ec38966 (do not change this comment) */ diff --git a/src/m/sparc.h b/src/m/sparc.h index 39240dcbf5c..26ca3caaebe 100644 --- a/src/m/sparc.h +++ b/src/m/sparc.h @@ -18,10 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* __sparc__ is defined by the compiler by default. */ /* XINT must explicitly sign-extend @@ -34,9 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Convert that into an integer that is 100 for a load average of 1.0 */ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Mask for address bits within a memory segment */ -#define SEGMENT_MASK (SEGSIZ - 1) - #ifdef __arch64__ /* GCC, 64-bit ABI. */ #define BITS_PER_LONG 64 diff --git a/src/m/template.h b/src/m/template.h index 0b149411a0a..4efc9158a45 100644 --- a/src/m/template.h +++ b/src/m/template.h @@ -18,10 +18,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#define WORDS_BIG_ENDIAN - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. Ones defined so far include m68k and many others */ @@ -47,12 +43,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ numerically. */ #define VIRT_ADDR_VARIES -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ -#define NO_REMAP - /* After adding support for a new machine, modify the large case statement in configure.in to recognize reasonable configuration names, and add a description of the system to diff --git a/src/m/vax.h b/src/m/vax.h index 3426a20d55e..16e790a2769 100644 --- a/src/m/vax.h +++ b/src/m/vax.h @@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ -#undef WORDS_BIG_ENDIAN - /* #define vax -- appears to be done automatically */ /* USG systems I know of running on Vaxes do not actually diff --git a/src/m/xtensa.h b/src/m/xtensa.h index 664f18dcb10..8e1da54b25b 100644 --- a/src/m/xtensa.h +++ b/src/m/xtensa.h @@ -2,11 +2,5 @@ Add a license notice if this grows to > 10 lines of code. */ -#ifdef __LITTLE_ENDIAN -#undef WORDS_BIG_ENDIAN -#else -#define WORDS_BIG_ENDIAN -#endif - /* arch-tag: fe5872de-d565-4d81-8fe0-ea19865b3e6a (do not change this comment) */ diff --git a/src/macros.c b/src/macros.c index 0e0d3f3597e..c281c89aa3e 100644 --- a/src/macros.c +++ b/src/macros.c @@ -51,8 +51,6 @@ int executing_kbd_macro_iterations; Lisp_Object executing_kbd_macro; -extern Lisp_Object real_this_command; - Lisp_Object Fexecute_kbd_macro (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc); DEFUN ("start-kbd-macro", Fstart_kbd_macro, Sstart_kbd_macro, 1, 2, "P", diff --git a/src/makefile.w32-in b/src/makefile.w32-in index c938ae752bf..fc86ae6cb0c 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1506,6 +1506,7 @@ $(BLD)/xdisp.$(O) : \ $(SRC)/systime.h \ $(SRC)/termchar.h \ $(SRC)/termhooks.h \ + $(SRC)/termopts.h \ $(SRC)/w32gui.h \ $(SRC)/w32term.h \ $(SRC)/window.h diff --git a/src/md5.c b/src/md5.c index 1840c2ac92b..6e7f651189e 100644 --- a/src/md5.c +++ b/src/md5.c @@ -1,7 +1,7 @@ /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -40,7 +40,7 @@ #ifdef _LIBC # include <endian.h> # if __BYTE_ORDER == __BIG_ENDIAN -# define WORDS_BIG_ENDIAN 1 +# define WORDS_BIGENDIAN 1 # endif /* We need to keep the namespace clean so define the MD5 function protected using leading __ . */ @@ -55,7 +55,7 @@ #include "md5.h" -#ifdef WORDS_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else diff --git a/src/mem-limits.h b/src/mem-limits.h index a550e1464b8..9ec1558527d 100644 --- a/src/mem-limits.h +++ b/src/mem-limits.h @@ -34,28 +34,9 @@ extern int etext; # endif #endif -#ifdef CYGWIN -#define BSD4_2 -#endif - -#ifdef BSD4_2 -#include <sys/time.h> -#include <sys/resource.h> -#endif /* BSD4_2 */ - -/* The important properties of this type are that 1) it's a pointer, and - 2) arithmetic on it should work as if the size of the object pointed - to has a size of 1. */ -typedef POINTER_TYPE *POINTER; - typedef unsigned long SIZE; -#ifdef NULL -#undef NULL -#endif -#define NULL ((POINTER) 0) - -extern POINTER start_of_data (void); +extern char *start_of_data (void); #if defined USE_LSB_TAG #define EXCEEDS_LISP_PTR(ptr) 0 #elif defined DATA_SEG_BITS diff --git a/src/menu.c b/src/menu.c index 321dc2677a1..ab20a47fba6 100644 --- a/src/menu.c +++ b/src/menu.c @@ -61,12 +61,6 @@ extern HMENU current_popup_menu; #define HAVE_BOXES 1 #endif -/* The timestamp of the last input event Emacs received from the X server. */ -/* Defined in keyboard.c. */ -extern unsigned long last_event_timestamp; - -extern Lisp_Object QCtoggle, QCradio; - Lisp_Object menu_items; /* If non-nil, means that the global vars defined here are already in use. @@ -668,7 +662,7 @@ digest_single_submenu (int start, int end, int top_level_items) { /* Create a new pane. */ Lisp_Object pane_name, prefix; - char *pane_string; + const char *pane_string; panes_seen++; diff --git a/src/menu.h b/src/menu.h index eff6f5ddf70..c8691169ccb 100644 --- a/src/menu.h +++ b/src/menu.h @@ -21,17 +21,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ extern Lisp_Object Vmenu_updating_frame; +extern void x_set_menu_bar_lines (struct frame *f, + Lisp_Object value, + Lisp_Object oldval); + extern void init_menu_items (void); extern void finish_menu_items (void); extern void discard_menu_items (void); extern void save_menu_items (void); extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object); extern void list_of_panes (Lisp_Object); -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \ + || defined (HAVE_NS) extern void free_menubar_widget_value_tree (widget_value *); extern void update_submenu_strings (widget_value *); extern void find_and_call_menu_selection (FRAME_PTR, int, Lisp_Object, void *); +extern widget_value *xmalloc_widget_value (void); +extern widget_value *digest_single_submenu (int, int, int); #endif #ifdef HAVE_X_WINDOWS diff --git a/src/minibuf.c b/src/minibuf.c index 5dc7b0b1f06..009d94c36a8 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -143,11 +143,6 @@ Lisp_Object Qcase_fold_search; Lisp_Object Qread_expression_history; -extern Lisp_Object Voverriding_local_map; - -extern Lisp_Object Qmouse_face; - -extern Lisp_Object Qfield; /* Put minibuf on currently selected frame's minibuffer. We do this whenever the user starts a new minibuffer @@ -444,9 +439,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, Lisp_Object empty_minibuf; Lisp_Object dummy, frame; - extern Lisp_Object Qfront_sticky; - extern Lisp_Object Qrear_nonsticky; - specbind (Qminibuffer_default, defalt); /* If Vminibuffer_completing_file_name is `lambda' on entry, it was t @@ -824,7 +816,6 @@ get_minibuffer (int depth) { Lisp_Object tail, num, buf; char name[24]; - extern Lisp_Object nconc2 (Lisp_Object, Lisp_Object); XSETFASTINT (num, depth); tail = Fnthcdr (num, Vminibuffer_list); @@ -1152,7 +1143,7 @@ Optional second arg DEF is value to return if user enters an empty line. If DEF is a list of default values, return its first element. Optional third arg REQUIRE-MATCH determines whether non-existing buffer names are allowed. It has the same meaning as the - REQUIRE-MATCH argument of `confirm-after-completion'. + REQUIRE-MATCH argument of `completing-read'. The argument PROMPT should be a string ending with a colon and a space. If `read-buffer-completion-ignore-case' is non-nil, completion ignores case while reading the buffer name. @@ -2089,7 +2080,8 @@ syms_of_minibuf (void) staticpro (&Qread_expression_history); DEFVAR_LISP ("read-buffer-function", &Vread_buffer_function, - doc: /* If this is non-nil, `read-buffer' does its work by calling this function. */); + doc: /* If this is non-nil, `read-buffer' does its work by calling this function. +The function is called with the arguments passed to `read-buffer'. */); Vread_buffer_function = Qnil; DEFVAR_BOOL ("read-buffer-completion-ignore-case", diff --git a/src/msdos.c b/src/msdos.c index 8bfdce22fcd..ad529d00dea 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1191,7 +1191,6 @@ IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) if (row->enabled_p) { - extern Lisp_Object Qhelp_echo; struct glyph *glyph, *end; Lisp_Object help, map; @@ -1330,7 +1329,6 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) /* Check for mouse-face and help-echo. */ { - extern Lisp_Object Qmouse_face; Lisp_Object mouse_face, overlay, position, *overlay_vec; int noverlays, obegv, ozv; struct buffer *obuf; @@ -1455,7 +1453,6 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) /* Look for a `help-echo' property. */ { Lisp_Object help; - extern Lisp_Object Qhelp_echo; /* Check overlays first. */ help = Qnil; @@ -1595,14 +1592,16 @@ IT_display_cursor (int on) ScreenSetCursor (current_pos_Y, current_pos_X); cursor_cleared = 0; if (tty->termscript) - fprintf (tty->termscript, "\nCURSOR ON"); + fprintf (tty->termscript, "\nCURSOR ON (%dx%d)", + current_pos_Y, current_pos_X); } else if (!on && !cursor_cleared) { ScreenSetCursor (-1, -1); cursor_cleared = 1; if (tty->termscript) - fprintf (tty->termscript, "\nCURSOR OFF"); + fprintf (tty->termscript, "\nCURSOR OFF (%dx%d)", + current_pos_Y, current_pos_X); } } diff --git a/src/ndir.h b/src/ndir.h index d7bac9d3fae..92d198334b7 100644 --- a/src/ndir.h +++ b/src/ndir.h @@ -32,11 +32,10 @@ typedef struct char dd_buf[DIRBLKSIZ]; /* directory block */ } DIR; /* stream data from opendir() */ -extern DIR *opendir(); -extern struct direct *readdir(); -extern long telldir(); -extern void seekdir(); -extern void closedir(); +extern DIR *opendir (char *); +extern struct direct *readdir (DIR *); +extern void seekdir (DIR *, long); +extern void closedir (DIR *); #define rewinddir( dirp ) seekdir( dirp, 0L ) diff --git a/src/nsfns.m b/src/nsfns.m index fd0ec1a965c..aac2ef0ed3a 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -125,7 +125,7 @@ check_ns (void) /* Nonzero if we can use mouse menus. */ int -have_menus_p () +have_menus_p (void) { return NSApp != nil; } @@ -240,8 +240,7 @@ ns_get_screen (Lisp_Object screen) /* Return the X display structure for the display named NAME. Open a new connection if necessary. */ struct ns_display_info * -ns_display_info_for_name (name) - Lisp_Object name; +ns_display_info_for_name (Lisp_Object name) { Lisp_Object names; struct ns_display_info *dpyinfo; @@ -925,9 +924,7 @@ ns_cursor_type_to_lisp (int arg) /* This is the same as the xfns.c definition. */ void -x_set_cursor_type (f, arg, oldval) - FRAME_PTR f; - Lisp_Object arg, oldval; +x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) { set_frame_cursor_types (f, arg); @@ -949,7 +946,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) #define Xstr(x) Str(x) static Lisp_Object -ns_appkit_version_str () +ns_appkit_version_str (void) { char tmp[80]; @@ -968,7 +965,7 @@ ns_appkit_version_str () have into a single int. For a better picture of the implementation running, use ns_appkit_version_str.*/ static int -ns_appkit_version_int () +ns_appkit_version_int (void) { #ifdef NS_IMPL_GNUSTEP return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION; @@ -2004,8 +2001,7 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc, string or a number containing the resulting script value. Otherwise, 1 is returned. */ static int -ns_do_applescript (script, result) - Lisp_Object script, *result; +ns_do_applescript (Lisp_Object script, Lisp_Object *result) { NSAppleEventDescriptor *desc; NSDictionary* errorDict; @@ -2108,8 +2104,7 @@ check_x_display_info (Lisp_Object frame) void -x_set_scroll_bar_default_width (f) - struct frame *f; +x_set_scroll_bar_default_width (struct frame *f) { int wid = FRAME_COLUMN_WIDTH (f); FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = NS_SCROLL_BAR_WIDTH_DEFAULT; @@ -2189,7 +2184,7 @@ x_screen_planes (struct frame *f) void -x_sync (Lisp_Object frame) +x_sync (struct frame *f) { /* XXX Not implemented XXX */ return; @@ -2367,11 +2362,14 @@ Lisp_Object tip_frame; /* TODO: move to xdisp or similar */ static void -compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) - struct frame *f; - Lisp_Object parms, dx, dy; - int width, height; - int *root_x, *root_y; +compute_tip_xy (struct frame *f, + Lisp_Object parms, + Lisp_Object dx, + Lisp_Object dy, + int width, + int height, + int *root_x, + int *root_y) { Lisp_Object left, top; EmacsView *view = FRAME_NS_VIEW (f); @@ -2595,7 +2593,7 @@ Value is t if tooltip was open, nil otherwise. */) void -syms_of_nsfns () +syms_of_nsfns (void) { int i; diff --git a/src/nsfont.m b/src/nsfont.m index 3cc1f7fb076..aaa5999e048 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -223,7 +223,7 @@ ns_descriptor_to_entity (NSFontDescriptor *desc, Lisp_Object extra, char *style) /* Default font entity. */ static Lisp_Object -ns_fallback_entity () +ns_fallback_entity (void) { return ns_descriptor_to_entity ([[NSFont userFixedPitchFontOfSize: 0] fontDescriptor], Qnil, NULL); @@ -1510,7 +1510,7 @@ ns_dump_glyphstring (struct glyph_string *s) void -syms_of_nsfont () +syms_of_nsfont (void) { nsfont_driver.type = Qns; register_font_driver (&nsfont_driver, NULL); diff --git a/src/nsimage.m b/src/nsimage.m index 6912156eb99..13761ba5f71 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -83,11 +83,11 @@ int ns_load_image (struct frame *f, struct image *img, Lisp_Object spec_file, Lisp_Object spec_data) { - NSTRACE (ns_load_image); - EmacsImage *eImg; NSSize size; + NSTRACE (ns_load_image); + if (NILP (spec_data)) { eImg = [EmacsImage allocInitFromFile: spec_file]; diff --git a/src/nsmenu.m b/src/nsmenu.m index e5b9379258f..c7ea6bb90fd 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -105,7 +105,7 @@ free_frame_menubar (struct frame *f) int -popup_activated () +popup_activated (void) { return popup_activated_flag; } @@ -509,8 +509,7 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p) /* Utility (from macmenu.c): is this item a separator? */ static int -name_is_separator (name) - const char *name; +name_is_separator ( const char *name) { const char *start = name; @@ -737,19 +736,21 @@ name_is_separator (name) keymaps: (int)keymaps { EmacsView *view = FRAME_NS_VIEW (f); + NSEvent *e, *event; + long retVal; + /* p = [view convertPoint:p fromView: nil]; */ p.y = NSHeight ([view frame]) - p.y; - NSEvent *e = [[view window] currentEvent]; - NSEvent *event = [NSEvent mouseEventWithType: NSRightMouseDown - location: p - modifierFlags: 0 - timestamp: [e timestamp] - windowNumber: [[view window] windowNumber] - context: [e context] - eventNumber: 0/*[e eventNumber] */ - clickCount: 1 - pressure: 0]; - long retVal; + e = [[view window] currentEvent]; + event = [NSEvent mouseEventWithType: NSRightMouseDown + location: p + modifierFlags: 0 + timestamp: [e timestamp] + windowNumber: [[view window] windowNumber] + context: [e context] + eventNumber: 0/*[e eventNumber] */ + clickCount: 1 + pressure: 0]; context_menu_value = -1; [NSMenu popUpContextMenu: self withEvent: event forView: view]; @@ -1801,7 +1802,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_ ========================================================================== */ void -syms_of_nsmenu () +syms_of_nsmenu (void) { defsubr (&Sx_popup_dialog); defsubr (&Sns_reset_menu); diff --git a/src/nsterm.h b/src/nsterm.h index bc0e6e286c2..9b7f0accad1 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "frame.h" #include "character.h" #include "font.h" +#include "sysselect.h" #ifdef HAVE_NS @@ -712,7 +713,9 @@ extern void ns_set_name_as_filename (struct frame *f); extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg); extern int -ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, +ns_defined_color (struct frame *f, + const char *name, + XColor *color_def, int alloc, char makeIndex); extern void ns_query_color (void *col, XColor *color_def, int setPixel); @@ -742,10 +745,34 @@ extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f, extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header); -/* two more prototypes that should be moved to a more general include file */ +/* More prototypes that should be moved to a more general include file */ extern void set_frame_menubar (struct frame *f, int first_time, int deep_p); extern void x_set_window_size (struct frame *f, int change_grav, int cols, int rows); +extern void x_sync (struct frame *); +extern Lisp_Object x_get_focus_frame (struct frame *); +extern void x_set_mouse_position (struct frame *f, int h, int v); +extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); +extern void x_make_frame_visible (struct frame *f); +extern void x_make_frame_invisible (struct frame *f); +extern void x_iconify_frame (struct frame *f); +extern int x_char_width (struct frame *f); +extern int x_char_height (struct frame *f); +extern int x_pixel_width (struct frame *f); +extern int x_pixel_height (struct frame *f); +extern void x_set_frame_alpha (struct frame *f); +extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); +extern void x_set_tool_bar_lines (struct frame *f, + Lisp_Object value, + Lisp_Object oldval); +extern void x_activate_menubar (struct frame *); +extern void free_frame_menubar (struct frame *); + +extern void ns_init_paths (void); +extern void syms_of_nsterm (void); +extern void syms_of_nsfns (void); +extern void syms_of_nsmenu (void); +extern void syms_of_nsselect (void); /* From nsimage.m, needed in image.c */ struct image; @@ -764,6 +791,8 @@ extern int x_display_pixel_height (struct ns_display_info *); extern int x_display_pixel_width (struct ns_display_info *); /* This in nsterm.m */ +extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout); extern unsigned long ns_get_rgb_color (struct frame *f, float r, float g, float b, float a); extern NSPoint last_mouse_motion_position; diff --git a/src/nsterm.m b/src/nsterm.m index 58245f4aebf..88d47d41972 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -296,7 +296,7 @@ append2 (Lisp_Object list, Lisp_Object item) void -ns_init_paths () +ns_init_paths (void) /* -------------------------------------------------------------------------- Used to allow emacs to find its resources under Emacs.app Called from emacs.c at startup. @@ -479,7 +479,7 @@ ns_retain_object (void *obj) void * -ns_alloc_autorelease_pool () +ns_alloc_autorelease_pool (void) /* -------------------------------------------------------------------------- Allocate a pool for temporary objects (callable from C) -------------------------------------------------------------------------- */ @@ -790,7 +790,7 @@ ns_clip_to_row (struct window *w, struct glyph_row *row, int area, BOOL gc) static void -ns_ring_bell () +ns_ring_bell (struct frame *f) /* -------------------------------------------------------------------------- "Beep" routine -------------------------------------------------------------------------- */ @@ -1186,12 +1186,14 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) difference between the real width and Emacs' imagined one. For right-hand bars, don't worry about it since the extra is never used. (Obviously doesn't work for vertically split windows tho..) */ - NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) - ? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f) - - NS_SCROLL_BAR_WIDTH (f), 0) - : NSMakePoint (0, 0); - [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)]; - [view setBoundsOrigin: origin]; + { + NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) + ? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f) + - NS_SCROLL_BAR_WIDTH (f), 0) + : NSMakePoint (0, 0); + [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)]; + [view setBoundsOrigin: origin]; + } change_frame_size (f, rows, cols, 0, 1, 0); /* pretend, delay, safe */ FRAME_PIXEL_WIDTH (f) = pixelwidth; @@ -1507,7 +1509,10 @@ ns_query_color(void *col, XColor *color_def, int setPixel) int -ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, +ns_defined_color (struct frame *f, + const char *name, + XColor *color_def, + int alloc, char makeIndex) /* -------------------------------------------------------------------------- Return 1 if named color found, and set color_def rgb accordingly. @@ -2184,9 +2189,8 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, int yAdjust = rowY - FRAME_INTERNAL_BORDER_WIDTH (f) < 5 ? -FRAME_INTERNAL_BORDER_WIDTH (f) : 0; int yIncr = FRAME_PIXEL_HEIGHT (f) - (p->by+yAdjust + p->ny) < 5 ? - FRAME_INTERNAL_BORDER_WIDTH (f) : 0; - if (yAdjust) - yIncr += FRAME_INTERNAL_BORDER_WIDTH (f); + FRAME_INTERNAL_BORDER_WIDTH (f) : 0 + + (yAdjust ? FRAME_INTERNAL_BORDER_WIDTH (f) : 0); NSRect r = NSMakeRect (p->bx+xAdjust, p->by+yAdjust, p->nx, p->ny+yIncr); NSRectClip (r); [ns_lookup_indexed_color(face->background, f) set]; @@ -2375,7 +2379,7 @@ show_hourglass (struct atimer *timer) void -hide_hourglass () +hide_hourglass (void) { if (!hourglass_shown_p) return; @@ -3406,16 +3410,14 @@ x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y) ========================================================================== */ int -x_display_pixel_height (dpyinfo) - struct ns_display_info *dpyinfo; +x_display_pixel_height (struct ns_display_info *dpyinfo) { NSScreen *screen = [NSScreen mainScreen]; return [screen frame].size.height; } int -x_display_pixel_width (dpyinfo) - struct ns_display_info *dpyinfo; +x_display_pixel_width (struct ns_display_info *dpyinfo) { NSScreen *screen = [NSScreen mainScreen]; return [screen frame].size.width; @@ -5743,9 +5745,10 @@ ns_term_shutdown (int sig) NSTRACE (judge); if (condemned) { + EmacsView *view; BLOCK_INPUT; /* ensure other scrollbar updates after deletion */ - EmacsView *view = (EmacsView *)FRAME_NS_VIEW (frame); + view = (EmacsView *)FRAME_NS_VIEW (frame); if (view != nil) view->scrollbarsNeedingUpdate++; [self removeFromSuperview]; @@ -6122,7 +6125,7 @@ ns_xlfd_to_fontname (const char *xlfd) void -syms_of_nsterm () +syms_of_nsterm (void) { NSTRACE (syms_of_nsterm); diff --git a/src/print.c b/src/print.c index 614ad6f2632..91ac68c8d30 100644 --- a/src/print.c +++ b/src/print.c @@ -42,7 +42,6 @@ Lisp_Object Vstandard_output, Qstandard_output; Lisp_Object Qtemp_buffer_setup_hook; /* These are used to print like we read. */ -extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; Lisp_Object Vfloat_output_format, Qfloat_output_format; @@ -161,13 +160,6 @@ Lisp_Object Vprint_number_table; #define PRINT_NUMBER_OBJECT(table,i) XVECTOR ((table))->contents[(i) * 2] #define PRINT_NUMBER_STATUS(table,i) XVECTOR ((table))->contents[(i) * 2 + 1] -/* Nonzero means print newline to stdout before next minibuffer message. - Defined in xdisp.c */ - -extern int noninteractive_need_newline; - -extern int minibuffer_auto_raise; - void print_interval (INTERVAL interval, Lisp_Object printcharfun); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ @@ -1403,7 +1395,6 @@ print_preprocess_string (INTERVAL interval, Lisp_Object arg) /* A flag to control printing of `charset' text property. The default value is Qdefault. */ Lisp_Object Vprint_charset_text_property; -extern Lisp_Object Qdefault; static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string); diff --git a/src/process.c b/src/process.c index 219098905cf..4a658623077 100644 --- a/src/process.c +++ b/src/process.c @@ -43,7 +43,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Only MS-DOS does not define `subprocesses'. */ #ifdef subprocesses -#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> @@ -59,30 +58,21 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <sys/un.h> #endif #endif -#endif /* HAVE_SOCKETS */ #if defined(HAVE_SYS_IOCTL_H) #include <sys/ioctl.h> #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) #include <fcntl.h> #endif /* HAVE_PTYS and no O_NDELAY */ +#if defined(HAVE_NET_IF_H) +#include <net/if.h> +#endif /* HAVE_NET_IF_H */ #endif /* HAVE_SYS_IOCTL_H */ #ifdef NEED_BSDTTY #include <bsdtty.h> #endif -/* Can we use SIOCGIFCONF and/or SIOCGIFADDR */ -#ifdef HAVE_SOCKETS -#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_NET_IF_H) -/* sys/ioctl.h may have been included already */ -#ifndef SIOCGIFADDR -#include <sys/ioctl.h> -#endif -#include <net/if.h> -#endif -#endif - #ifdef HAVE_SYS_WAIT #include <sys/wait.h> #endif @@ -93,6 +83,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <resolv.h> #endif +#ifdef HAVE_UTIL_H +#include <util.h> +#endif + #endif /* subprocesses */ #include "lisp.h" @@ -120,6 +114,27 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #if defined (USE_GTK) || defined (HAVE_GCONF) #include "xgselect.h" #endif /* defined (USE_GTK) || defined (HAVE_GCONF) */ +#ifdef HAVE_NS +#include "nsterm.h" +#endif +extern int timers_run; + +Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid; +Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime; +Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; +Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; +Lisp_Object QCname, QCtype; + +/* Non-zero if keyboard input is on hold, zero otherwise. */ + +static int kbd_is_on_hold; + +/* Nonzero means delete a process right away if it exits. */ +static int delete_exited_processes; + +/* Nonzero means don't run process sentinels. This is used + when exiting. */ +int inhibit_sentinels; #ifdef subprocesses @@ -150,17 +165,10 @@ extern Lisp_Object QCfamily; /* QCfilter is defined in keyboard.c. */ extern Lisp_Object QCfilter; -#ifdef HAVE_SOCKETS #define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) #define NETCONN1_P(p) (EQ ((p)->type, Qnetwork)) #define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) #define SERIALCONN1_P(p) (EQ ((p)->type, Qserial)) -#else -#define NETCONN_P(p) 0 -#define NETCONN1_P(p) 0 -#define SERIALCONN_P(p) 0 -#define SERIALCONN1_P(p) 0 -#endif /* HAVE_SOCKETS */ /* Define first descriptor number available for subprocesses. */ #define FIRST_PROC_DESC 3 @@ -172,7 +180,7 @@ extern Lisp_Object QCfilter; #define SIGCHLD SIGCLD #endif /* SIGCLD */ -extern char *get_operating_system_release (void); +extern const char *get_operating_system_release (void); /* Serial processes require termios or Windows. */ #if defined (HAVE_TERMIOS) || defined (WINDOWSNT) @@ -206,7 +214,6 @@ int update_tick; #undef NON_BLOCKING_CONNECT #else #ifndef NON_BLOCKING_CONNECT -#ifdef HAVE_SOCKETS #ifdef HAVE_SELECT #if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX) #if defined (O_NONBLOCK) || defined (O_NDELAY) @@ -216,7 +223,6 @@ int update_tick; #endif /* O_NONBLOCK || O_NDELAY */ #endif /* HAVE_GETPEERNAME || GNU_LINUX */ #endif /* HAVE_SELECT */ -#endif /* HAVE_SOCKETS */ #endif /* NON_BLOCKING_CONNECT */ #endif /* BROKEN_NON_BLOCKING_CONNECT */ @@ -229,13 +235,11 @@ int update_tick; #undef DATAGRAM_SOCKETS #else #ifndef DATAGRAM_SOCKETS -#ifdef HAVE_SOCKETS #if defined (HAVE_SELECT) || defined (FIONREAD) #if defined (HAVE_SENDTO) && defined (HAVE_RECVFROM) && defined (EMSGSIZE) #define DATAGRAM_SOCKETS #endif /* HAVE_SENDTO && HAVE_RECVFROM && EMSGSIZE */ #endif /* HAVE_SELECT || FIONREAD */ -#endif /* HAVE_SOCKETS */ #endif /* DATAGRAM_SOCKETS */ #endif /* BROKEN_DATAGRAM_SOCKETS */ @@ -287,29 +291,6 @@ static void create_pty (Lisp_Object); static Lisp_Object get_process (register Lisp_Object name); static void exec_sentinel (Lisp_Object proc, Lisp_Object reason); -#endif /* subprocesses */ - -extern int timers_run; - -Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid; -Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime; -Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; -Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; -Lisp_Object QCname, QCtype; - -/* Non-zero if keyboard input is on hold, zero otherwise. */ - -static int kbd_is_on_hold; - -/* Nonzero means delete a process right away if it exits. */ -static int delete_exited_processes; - -/* Nonzero means don't run process sentinels. This is used - when exiting. */ -int inhibit_sentinels; - -#ifdef subprocesses - /* Mask of bits indicating the descriptors that we wait for input on. */ static SELECT_TYPE input_wait_mask; @@ -1148,7 +1129,6 @@ nil, indicating the current buffer's process. */) return XPROCESS (proc)->type; } -#ifdef HAVE_SOCKETS DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, 1, 2, 0, doc: /* Convert network ADDRESS from internal format to a string. @@ -1222,7 +1202,6 @@ Returns nil if format of ADDRESS is invalid. */) return Qnil; } -#endif static Lisp_Object list_processes_1 (Lisp_Object query_only) @@ -1727,25 +1706,6 @@ create_process_1 (struct atimer *timer) } -#if 0 /* This doesn't work; see the note before sigchld_handler. */ -#ifdef USG -#ifdef SIGCHLD -/* Mimic blocking of signals on system V, which doesn't really have it. */ - -/* Nonzero means we got a SIGCHLD when it was supposed to be blocked. */ -int sigchld_deferred; - -SIGTYPE -create_process_sigchld () -{ - signal (SIGCHLD, create_process_sigchld); - - sigchld_deferred = 1; -} -#endif -#endif -#endif - void create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) { @@ -2215,8 +2175,6 @@ create_pty (Lisp_Object process) } -#ifdef HAVE_SOCKETS - /* Convert an internal struct sockaddr to a lisp object (vector or string). The address family of sa is not included in the result. */ @@ -2447,7 +2405,7 @@ Returns nil upon error setting address, ADDRESS otherwise. */) static const struct socket_options { /* The name of this option. Should be lowercase version of option name without SO_ prefix. */ - char *name; + const char *name; /* Option level SOL_... */ int optlevel; /* Option number SO_... */ @@ -3075,7 +3033,8 @@ usage: (make-network-process &rest ARGS) */) #ifdef HAVE_GETADDRINFO struct addrinfo ai, *res, *lres; struct addrinfo hints; - char *portstring, portbuf[128]; + const char *portstring; + char portbuf[128]; #else /* HAVE_GETADDRINFO */ struct _emacs_addrinfo { @@ -3770,10 +3729,9 @@ usage: (make-network-process &rest ARGS) */) UNGCPRO; return proc; } -#endif /* HAVE_SOCKETS */ -#if defined(HAVE_SOCKETS) && defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) +#if defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) #ifdef SIOCGIFCONF DEFUN ("network-interface-list", Fnetwork_interface_list, Snetwork_interface_list, 0, 0, 0, @@ -4016,7 +3974,7 @@ FLAGS is the current flags of the interface. */) return any ? res : Qnil; } #endif -#endif /* HAVE_SOCKETS */ +#endif /* defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) */ /* Turn off input and output for process PROC. */ @@ -5458,7 +5416,7 @@ send_process_trap (int ignore) This function can evaluate Lisp code and can garbage collect. */ static void -send_process (volatile Lisp_Object proc, unsigned char *volatile buf, +send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, volatile int len, volatile Lisp_Object object) { /* Use volatile to protect variables from being clobbered by longjmp. */ @@ -6064,7 +6022,6 @@ If PROCESS is a network or serial process, inhibit handling of incoming traffic. */) (Lisp_Object process, Lisp_Object current_group) { -#ifdef HAVE_SOCKETS if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process))) { struct Lisp_Process *p; @@ -6079,7 +6036,6 @@ traffic. */) p->command = Qt; return process; } -#endif #ifndef SIGTSTP error ("No SIGTSTP support"); #else @@ -6095,7 +6051,6 @@ If PROCESS is a network or serial process, resume handling of incoming traffic. */) (Lisp_Object process, Lisp_Object current_group) { -#ifdef HAVE_SOCKETS if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process))) { struct Lisp_Process *p; @@ -6118,7 +6073,6 @@ traffic. */) p->command = Qnil; return process; } -#endif #ifdef SIGCONT process_send_signal (process, SIGCONT, current_group, 0); #else @@ -6402,8 +6356,7 @@ sigchld_handler (int signo) { int old_errno = errno; Lisp_Object proc; - register struct Lisp_Process *p; - extern EMACS_TIME *input_available_clear_time; + struct Lisp_Process *p; SIGNAL_THREAD_CHECK (signo); @@ -7430,7 +7383,6 @@ init_process (void) memset (datagram_address, 0, sizeof datagram_address); #endif -#ifdef HAVE_SOCKETS { Lisp_Object subfeatures = Qnil; const struct socket_options *sopt; @@ -7466,14 +7418,13 @@ init_process (void) Fprovide (intern_c_string ("make-network-process"), subfeatures); } -#endif /* HAVE_SOCKETS */ #if defined (DARWIN_OS) /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive processes. As such, we only change the default value. */ if (initialized) { - char *release = get_operating_system_release (); + const char *release = get_operating_system_release (); if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION && release[1] == '.')) { Vprocess_connection_type = Qnil; @@ -7725,19 +7676,17 @@ The variable takes effect when `start-process' is called. */); defsubr (&Sserial_process_configure); defsubr (&Smake_serial_process); #endif /* HAVE_SERIAL */ -#ifdef HAVE_SOCKETS defsubr (&Sset_network_process_option); defsubr (&Smake_network_process); defsubr (&Sformat_network_address); -#endif /* HAVE_SOCKETS */ -#if defined(HAVE_SOCKETS) && defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) +#if defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) #ifdef SIOCGIFCONF defsubr (&Snetwork_interface_list); #endif #if defined(SIOCGIFADDR) || defined(SIOCGIFHWADDR) || defined(SIOCGIFFLAGS) defsubr (&Snetwork_interface_info); #endif -#endif /* HAVE_SOCKETS ... */ +#endif /* defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H) */ #ifdef DATAGRAM_SOCKETS defsubr (&Sprocess_datagram_address); defsubr (&Sset_process_datagram_address); diff --git a/src/process.h b/src/process.h index 12b91d697b9..6d4832ffde8 100644 --- a/src/process.h +++ b/src/process.h @@ -166,6 +166,9 @@ extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime; extern Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; extern Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtpgid, Qcstime; extern Lisp_Object Qtime, Qctime; +extern Lisp_Object QCport, QCspeed, QCprocess; +extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; +extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; extern Lisp_Object list_system_processes (void); extern Lisp_Object system_process_attributes (Lisp_Object); diff --git a/src/ralloc.c b/src/ralloc.c index 0a2b156e393..5f2b52fcc4b 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -79,7 +79,7 @@ static void r_alloc_init (void); /* Declarations for working with the malloc, ralloc, and system breaks. */ /* Function to set the real break value. */ -POINTER (*real_morecore) (); +POINTER (*real_morecore) (long int); /* The break value, as seen by malloc. */ static POINTER virtual_break_value; @@ -111,7 +111,7 @@ static int extra_bytes; from the system. */ #ifndef SYSTEM_MALLOC -extern POINTER (*__morecore) (); +extern POINTER (*__morecore) (long int); #endif @@ -519,35 +519,6 @@ relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address) return 1; } - -/* Reorder the bloc BLOC to go before bloc BEFORE in the doubly linked list. - This is necessary if we put the memory of space of BLOC - before that of BEFORE. */ - -static void -reorder_bloc (bloc_ptr bloc, bloc_ptr before) -{ - bloc_ptr prev, next; - - /* Splice BLOC out from where it is. */ - prev = bloc->prev; - next = bloc->next; - - if (prev) - prev->next = next; - if (next) - next->prev = prev; - - /* Splice it in before BEFORE. */ - prev = before->prev; - - if (prev) - prev->next = bloc; - bloc->prev = prev; - - before->prev = bloc; - bloc->next = before; -} /* Update the records of which heaps contain which blocs, starting with heap HEAP and bloc BLOC. */ diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index cf06f9befe0..84920f888e1 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -47,11 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ #define HAVE_SOCKETS - -/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library - functions. Almost, but not quite the same as the 4.2 functions. */ -#define SYSV_SYSTEM_DIR - /* The file containing the kernel's symbol table is called /unix. */ #define KERNEL_FILE "/unix" diff --git a/src/s/bsd-common.h b/src/s/bsd-common.h index ffb7a637488..bf78f4ec347 100644 --- a/src/s/bsd-common.h +++ b/src/s/bsd-common.h @@ -45,8 +45,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define HAVE_TERMIOS #define NO_TERMIO -#define SYSV_SYSTEM_DIR - /* If the system's imake configuration file defines `NeedWidePrototypes' as `NO', we must define NARROWPROTO manually. Such a define is generated in the Makefile generated by `xmkmf'. If we don't diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 93df925fcab..1b78ada53bd 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -89,7 +89,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define CYGWIN 1 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -#define SYSV_SYSTEM_DIR 1 #define HAVE_SOCKETS diff --git a/src/s/freebsd.h b/src/s/freebsd.h index 9082935db07..cfed343d6c5 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -28,7 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) #define HAVE_GETLOADAVG 1 -#define DECLARE_GETPWUID_WITH_UID_T /* This silences a few compilation warnings. */ #undef BSD_SYSTEM diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 80092f725fc..cf3b3079726 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -124,8 +124,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define INTERRUPT_INPUT #endif /* emacs */ -#define SYSV_SYSTEM_DIR /* use dirent.h */ - #define POSIX /* affects getpagesize.h and systty.h */ /* This is to work around mysterious gcc failures in some system versions. diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h index ee841041edb..ee0fa9abe02 100644 --- a/src/s/hpux10-20.h +++ b/src/s/hpux10-20.h @@ -113,12 +113,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ on HP-UX. (You get duplicate symbol errors on linking). */ #undef _FILE_OFFSET_BITS -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ -#define NO_REMAP - /* Define VIRT_ADDR_VARIES if the virtual addresses of pure and impure space as loaded can vary, and even their relative order cannot be relied on. diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index e2b18b2ec2b..10481f609c3 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define IRIX6_5 /* used in m/iris4d */ -#include "usg5-4.h" +#include "usg5-4-common.h" #undef _longjmp /* use system versions, not conservative aliases */ #undef _setjmp @@ -91,7 +91,7 @@ char *_getpty(); #undef SA_RESTART -#undef TIOCSIGSEND /* defined in usg5-4.h */ +#undef TIOCSIGSEND /* defined in usg5-4-common.h */ /* Tested on Irix 6.5. SCM worked on earlier versions. */ #define GC_SETJMP_WORKS 1 diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index b3e9db8be8a..f61fae57eff 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -62,10 +62,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ for received packets, so datagrams are broken too. */ #define BROKEN_DATAGRAM_SOCKETS 1 -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ -#define COFF 1 - #define MAIL_USE_POP 1 #define MAIL_USE_SYSTEM_LOCK 1 diff --git a/src/s/msdos.h b/src/s/msdos.h index b76b583250c..8dd8e3cf490 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -38,17 +38,11 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ It sets the Lisp variable system-type. */ #define SYSTEM_TYPE "ms-dos" -#define SYSV_SYSTEM_DIR - /* subprocesses should be defined if you want to have code for asynchronous subprocesses (as used in M-x compile and M-x shell). This is the only system that needs this. */ #undef subprocesses -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ -#define COFF - /* Here, on a separate page, add any special hacks needed to make Emacs work on this system. For example, you might define certain system call names that don't exist on your system, or that do @@ -131,7 +125,5 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #define GC_SETJMP_WORKS 1 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS -#define NO_REMAP - /* arch-tag: d184f860-815d-4ff4-8187-d05c0f3c37d0 (do not change this comment) */ diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index f4719093d4a..3b707aa5c3c 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h @@ -18,7 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#include "usg5-4.h" +#include "usg5-4-common.h" #define SOLARIS2 @@ -34,7 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define HAVE_LIBKSTAT #endif -/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock +/* This is the same definition as in usg5-4-common.h, but with sigblock/sigunblock rather than sighold/sigrelse, which appear to be BSD4.1 specific. It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ diff --git a/src/s/template.h b/src/s/template.h index 67ed13e6180..dd1e56f8553 100644 --- a/src/s/template.h +++ b/src/s/template.h @@ -85,11 +85,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* #undef subprocesses */ -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ - -/* #define COFF */ - /* Define CLASH_DETECTION if you want lock files to be written so that Emacs can tell instantly when you try to modify a file that someone else has modified in his Emacs. */ diff --git a/src/s/unixware.h b/src/s/unixware.h index 864f09786b6..ac989d48e2c 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#include "usg5-4.h" +#include "usg5-4-common.h" /* fnf@cygnus.com says these exist. */ #define HAVE_TCATTR @@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #undef HAVE_SYSV_SIGPAUSE -/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock +/* This is the same definition as in usg5-4-common.h, but with sigblock/sigunblock rather than sighold/sigrelse, which appear to be BSD4.1 specific. It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ diff --git a/src/s/usg5-4.h b/src/s/usg5-4-common.h index b92a5bbb450..7ff5c6f7be3 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4-common.h @@ -35,10 +35,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ for terminal control. */ #define HAVE_TERMIO -/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library - functions. Almost, but not quite the same as the 4.2 functions. */ -#define SYSV_SYSTEM_DIR - /* The file containing the kernel's symbol table is called /unix. */ #define KERNEL_FILE "/unix" @@ -56,8 +52,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* On USG systems signal handlers return void. */ #define SIGTYPE void -#undef COFF - /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars. But get <termio.h> first to make sure ttold.h doesn't interfere. And don't try to use SIGIO yet. */ diff --git a/src/search.c b/src/search.c index 602a50c0abe..0e9840b2e5f 100644 --- a/src/search.c +++ b/src/search.c @@ -504,8 +504,6 @@ fast_string_match (Lisp_Object regexp, Lisp_Object string) This does not clobber the match data. We assume that STRING contains single-byte characters. */ -extern Lisp_Object Vascii_downcase_table; - int fast_c_string_match_ignore_case (Lisp_Object regexp, const char *string) { @@ -2657,7 +2655,7 @@ since only regular expressions have distinguished subexpressions. */) for (pos_byte = 0, pos = 0; pos_byte < length;) { unsigned char str[MAX_MULTIBYTE_LENGTH]; - unsigned char *add_stuff = NULL; + const unsigned char *add_stuff = NULL; int add_len = 0; int idx = -1; diff --git a/src/sound.c b/src/sound.c index e0ebd565151..b93099283da 100644 --- a/src/sound.c +++ b/src/sound.c @@ -99,7 +99,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Symbols. */ -extern Lisp_Object QCfile, QCdata; Lisp_Object QCvolume, QCdevice; Lisp_Object Qsound; Lisp_Object Qplay_sound_functions; @@ -115,9 +114,11 @@ enum sound_attr SOUND_ATTR_SENTINEL }; -static void alsa_sound_perror (char *, int) NO_RETURN; -static void sound_perror (char *) NO_RETURN; -static void sound_warning (char *); +#ifdef HAVE_ALSA +static void alsa_sound_perror (const char *, int) NO_RETURN; +#endif +static void sound_perror (const char *) NO_RETURN; +static void sound_warning (const char *); static int parse_sound (Lisp_Object, Lisp_Object *); /* END: Common Definitions */ @@ -328,7 +329,7 @@ static int do_play_sound (const char *, unsigned long); /* Like perror, but signals an error. */ static void -sound_perror (char *msg) +sound_perror (const char *msg) { int saved_errno = errno; @@ -346,7 +347,7 @@ sound_perror (char *msg) /* Display a warning message. */ static void -sound_warning (char *msg) +sound_warning (const char *msg) { message (msg); } @@ -480,7 +481,7 @@ sound_cleanup (Lisp_Object arg) static u_int32_t le2hl (u_int32_t value) { -#ifdef WORDS_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN unsigned char *p = (unsigned char *) &value; value = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24); #endif @@ -494,7 +495,7 @@ le2hl (u_int32_t value) static u_int16_t le2hs (u_int16_t value) { -#ifdef WORDS_BIG_ENDIAN +#ifdef WORDS_BIGENDIAN unsigned char *p = (unsigned char *) &value; value = p[0] + (p[1] << 8); #endif @@ -508,7 +509,7 @@ le2hs (u_int16_t value) static u_int32_t be2hl (u_int32_t value) { -#ifndef WORDS_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN unsigned char *p = (unsigned char *) &value; value = p[3] + (p[2] << 8) + (p[1] << 16) + (p[0] << 24); #endif @@ -524,7 +525,7 @@ be2hl (u_int32_t value) static u_int16_t be2hs (u_int16_t value) { -#ifndef WORDS_BIG_ENDIAN +#ifndef WORDS_BIGENDIAN unsigned char *p = (unsigned char *) &value; value = p[1] + (p[0] << 8); #endif @@ -726,7 +727,7 @@ au_play (struct sound *s, struct sound_device *sd) static void vox_open (struct sound_device *sd) { - char *file; + const char *file; /* Open the sound device. Default is /dev/dsp. */ if (sd->file) @@ -871,7 +872,7 @@ vox_choose_format (struct sound_device *sd, struct sound *s) static int vox_init (struct sound_device *sd) { - char *file; + const char *file; int fd; /* Open the sound device. Default is /dev/dsp. */ @@ -914,7 +915,7 @@ vox_write (struct sound_device *sd, const char *buffer, int nbytes) /* This driver is available on GNU/Linux. */ static void -alsa_sound_perror (char *msg, int err) +alsa_sound_perror (const char *msg, int err) { error ("%s: %s", msg, snd_strerror (err)); } @@ -933,7 +934,7 @@ struct alsa_params static void alsa_open (struct sound_device *sd) { - char *file; + const char *file; struct alsa_params *p; int err; @@ -1055,7 +1056,7 @@ alsa_configure (struct sound_device *sd) int chn; snd_mixer_t *handle; snd_mixer_elem_t *e; - char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE; + const char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE; if (snd_mixer_open (&handle, 0) >= 0) { @@ -1219,7 +1220,7 @@ snd_error_quiet (const char *file, int line, const char *function, int err, static int alsa_init (struct sound_device *sd) { - char *file; + const char *file; snd_pcm_t *handle; int err; diff --git a/src/sysdep.c b/src/sysdep.c index d720c7c5811..2ae3c509522 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -96,8 +96,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <memory.h> #endif /* USG */ -extern int quit_char; - #include "keyboard.h" #include "frame.h" #include "window.h" @@ -107,11 +105,12 @@ extern int quit_char; #include "dispextern.h" #include "process.h" #include "cm.h" /* for reset_sys_modes */ - -/* For serial_configure and serial_open. */ -extern Lisp_Object QCport, QCspeed, QCprocess; -extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; -extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; +#ifdef HAVE_TERM_H +/* Include this last. If it is ncurses header file, it adds a lot of + defines that interfere with stuff in other headers. Someone responsible + for ncurses messed up bigtime. See bug#6812. */ +#include <term.h> +#endif #ifdef WINDOWSNT #include <direct.h> @@ -503,17 +502,29 @@ child_setup_tty (int out) s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* AIX */ - /* We used to enable ICANON (and set VEOF to 04), but this leads to - problems where process.c wants to send EOFs every once in a while - to force the output, which leads to weird effects when the + /* We originally enabled ICANON (and set VEOF to 04), and then had + proces.c send additional EOF chars to flush the output when faced + with long lines, but this leads to weird effects when the subprocess has disabled ICANON and ends up seeing those spurious extra EOFs. So we don't send EOFs any more in - process.c:send_process, and instead we disable ICANON by default, - so if a subsprocess sets up ICANON, it's his problem (or the Elisp - package that talks to it) to deal with lines that are too long. */ - s.main.c_lflag &= ~ICANON; /* Disable line editing and eof processing */ + process.c:send_process. First we tried to disable ICANON by + default, so if a subsprocess sets up ICANON, it's his problem (or + the Elisp package that talks to it) to deal with lines that are + too long. But this disables some features, such as the ability + to send EOF signals. So we re-enabled ICANON but there is no + more "send eof to flush" going on (which is wrong and unportable + in itself). The correct way to handle too much output is to + buffer what could not be written and then write it again when + select returns ok for writing. This has it own set of + problems. Write is now asynchronous, is that a problem? How much + do we buffer, and what do we do when that limit is reached? */ + + s.main.c_lflag |= ICANON; /* Enable line editing and eof processing */ + s.main.c_cc[VEOF] = 'D'&037; /* Control-D */ +#if 0 /* These settings only apply to non-ICANON mode. */ s.main.c_cc[VMIN] = 1; s.main.c_cc[VTIME] = 0; +#endif #else /* not HAVE_TERMIO */ @@ -619,7 +630,7 @@ sys_subshell (void) if (pid == 0) { - char *sh = 0; + const char *sh = 0; #ifdef DOS_NT /* MW, Aug 1993 */ getwd (oldwd); @@ -2447,7 +2458,7 @@ croak (char *badfunc) /* Directory routines for systems that don't have them. */ -#ifdef SYSV_SYSTEM_DIR +#ifdef HAVE_DIRENT_H #include <dirent.h> @@ -2464,7 +2475,7 @@ closedir (DIR *dirp /* stream from opendir */) return rtnval; } #endif /* not HAVE_CLOSEDIR */ -#endif /* SYSV_SYSTEM_DIR */ +#endif /* HAVE_DIRENT_H */ int diff --git a/src/syssignal.h b/src/syssignal.h index e3765add425..48eb7229353 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -26,10 +26,6 @@ extern void init_signals (void); #define FORWARD_SIGNAL_TO_MAIN_THREAD #endif -#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD -extern pthread_t main_thread; -#endif - /* Don't #include <signal.h>. That header should always be #included before "config.h", because some configuration files (like s/hpux.h) indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file @@ -69,8 +65,6 @@ extern sigset_t sys_sigmask (); #ifndef sigsetmask #define sigsetmask(SIG) sys_sigsetmask (SIG) #endif -#define sighold(SIG) ONLY_USED_IN_BSD_4_1 -#define sigrelse(SIG) ONLY_USED_IN_BSD_4_1 #undef signal #define signal(SIG,ACT) sys_signal(SIG,ACT) @@ -85,27 +79,6 @@ sigset_t sys_sigsetmask (sigset_t new_mask); #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) -#ifndef SIGMASKTYPE -#define SIGMASKTYPE int -#endif - -#ifndef SIGEMPTYMASK -#define SIGEMPTYMASK (0) -#endif - -#ifndef SIGFULLMASK -#define SIGFULLMASK (0xffffffff) -#endif - -#ifndef sigmask -#define sigmask(no) (1L << ((no) - 1)) -#endif - -#ifndef sigunblock -#define sigunblock(SIG) \ -{ SIGMASKTYPE omask = sigblock (SIGFULLMASK); sigsetmask (omask & ~SIG); } -#endif - #define sigfree() sigsetmask (SIGEMPTYMASK) #if defined (SIGINFO) && defined (BROKEN_SIGINFO) @@ -160,10 +133,11 @@ sigset_t sys_sigsetmask (sigset_t new_mask); #ifndef HAVE_STRSIGNAL /* strsignal is in sysdep.c */ -char *strsignal (); +char *strsignal (int); #endif #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD +extern pthread_t main_thread; #define SIGNAL_THREAD_CHECK(signo) \ do { \ if (!pthread_equal (pthread_self (), main_thread)) \ diff --git a/src/systime.h b/src/systime.h index bd789e9bd32..9f6a907a9c2 100644 --- a/src/systime.h +++ b/src/systime.h @@ -147,6 +147,9 @@ extern void set_waiting_for_input (EMACS_TIME *); #ifdef GCPRO1 /* defined in dired.c */ extern Lisp_Object make_time (time_t); + +/* defined in editfns.c*/ +extern int lisp_time_argument (Lisp_Object, time_t *, int *); #endif /* Compare times T1 and T2. Value is 0 if T1 and T2 are the same. diff --git a/src/term.c b/src/term.c index 3233db84cf7..4f326234956 100644 --- a/src/term.c +++ b/src/term.c @@ -34,6 +34,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #if HAVE_TERMIOS_H #include <termios.h> /* For TIOCNOTTY. */ #endif +#ifdef HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif #include <signal.h> #include <stdarg.h> @@ -132,8 +135,6 @@ static int visible_cursor; /* Display space properties */ -extern Lisp_Object Qspace, QCalign_to, QCwidth; - /* Functions to call after suspending a tty. */ Lisp_Object Vsuspend_tty_functions; @@ -183,7 +184,7 @@ static int no_controlling_tty; static int system_uses_terminfo; -char *tparam (); +char *tparam (char *, char *, int, int, ...); extern char *tgetstr (char *, char **); @@ -712,7 +713,7 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi } else { - unsigned char *p = SDATA (string), *pend = p + SBYTES (string); + unsigned char *p = SDATA (string); if (! STRING_MULTIBYTE (string)) string = string_to_multibyte (string); @@ -1086,7 +1087,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n) not counting any line-dependent padding. */ int -string_cost (char *str) +string_cost (const char *str) { cost = 0; if (str) @@ -1098,7 +1099,7 @@ string_cost (char *str) counting any line-dependent padding at one line. */ static int -string_cost_one_line (char *str) +string_cost_one_line (const char *str) { cost = 0; if (str) @@ -1110,7 +1111,7 @@ string_cost_one_line (char *str) in tenths of characters. */ int -per_line_cost (char *str) +per_line_cost (const char *str) { cost = 0; if (str) @@ -1121,7 +1122,6 @@ per_line_cost (char *str) return cost; } -#ifndef old /* char_ins_del_cost[n] is cost of inserting N characters. char_ins_del_cost[-n] is cost of deleting N characters. The length of this vector is based on max_frame_cols. */ @@ -1129,7 +1129,6 @@ per_line_cost (char *str) int *char_ins_del_vector; #define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_COLS ((f))]) -#endif /* ARGSUSED */ static void @@ -1267,7 +1266,7 @@ struct fkey_table { other keys (as on the IBM PC keyboard) they get overridden. */ -static struct fkey_table keys[] = +static const struct fkey_table keys[] = { {"kh", "home"}, /* termcap */ {"kl", "left"}, /* termcap */ @@ -1363,6 +1362,7 @@ static struct fkey_table keys[] = {"!3", "S-undo"} /*shifted undo key*/ }; +#ifndef DOS_NT static char **term_get_fkeys_address; static KBOARD *term_get_fkeys_kboard; static Lisp_Object term_get_fkeys_1 (void); @@ -1382,7 +1382,6 @@ term_get_fkeys (char **address, KBOARD *kboard) function key specification, rather than giving the user an error and refusing to run at all on such a terminal. */ - extern Lisp_Object Fidentity (Lisp_Object); term_get_fkeys_address = address; term_get_fkeys_kboard = kboard; internal_condition_case (term_get_fkeys_1, Qerror, Fidentity); @@ -1500,20 +1499,12 @@ term_get_fkeys_1 (void) return Qnil; } +#endif /* not DOS_NT */ /*********************************************************************** Character Display Information ***********************************************************************/ - -/* Avoid name clash with functions defined in xterm.c */ -#ifdef static -#define append_glyph append_glyph_term -#define produce_stretch_glyph produce_stretch_glyph_term -#define append_composite_glyph append_composite_glyph_term -#define produce_composite_glyph produce_composite_glyph_term -#endif - static void append_glyph (struct it *); static void produce_stretch_glyph (struct it *); static void append_composite_glyph (struct it *); @@ -1858,8 +1849,6 @@ append_composite_glyph (struct it *it) static void produce_composite_glyph (struct it *it) { - int c; - if (it->cmp_it.ch < 0) { struct composition *cmp = composition_table[it->cmp_it.id]; @@ -2254,7 +2243,6 @@ set_tty_color_mode (struct tty_display_info *tty, struct frame *f) Lisp_Object tem, val; Lisp_Object color_mode; int mode; - extern Lisp_Object Qtty_color_mode; Lisp_Object tty_color_mode_alist = Fintern_soft (build_string ("tty-color-mode-alist"), Qnil); @@ -2313,7 +2301,7 @@ get_tty_terminal (Lisp_Object terminal, int throw) Returns NULL if the named terminal device is not opened. */ struct terminal * -get_named_tty (char *name) +get_named_tty (const char *name) { struct terminal *t; @@ -2793,7 +2781,6 @@ term_mouse_highlight (struct frame *f, int x, int y) /* Check for mouse-face. */ { - extern Lisp_Object Qmouse_face; Lisp_Object mouse_face, overlay, position, *overlay_vec; int noverlays, obegv, ozv; struct buffer *obuf; @@ -2919,7 +2906,6 @@ term_mouse_highlight (struct frame *f, int x, int y) /* Look for a `help-echo' property. */ { Lisp_Object help; - extern Lisp_Object Qhelp_echo; /* Check overlays first. */ help = Qnil; @@ -3348,7 +3334,7 @@ dissociate_if_controlling_tty (int fd) EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */ if (pgid != -1) { -#if defined (USG) +#if defined (USG5) setpgrp (); no_controlling_tty = 1; #elif defined (CYGWIN) @@ -3386,7 +3372,7 @@ dissociate_if_controlling_tty (int fd) If MUST_SUCCEED is true, then all errors are fatal. */ struct terminal * -init_tty (char *name, char *terminal_type, int must_succeed) +init_tty (const char *name, const char *terminal_type, int must_succeed) { char *area = NULL; char **address = &area; diff --git a/src/terminfo.c b/src/terminfo.c index 89d7426e8f4..50749492cfe 100644 --- a/src/terminfo.c +++ b/src/terminfo.c @@ -35,10 +35,12 @@ char *UP, *BC, PC; */ char * -tparam (char *string, char *outstring, int len, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) +tparam (char *string, char *outstring, + int len, int arg1, int arg2, int arg3, int arg4, + int arg5, int arg6, int arg7, int arg8, int arg9) { char *temp; - extern char *tparm(/* ??? */); + extern char *tparm (char *str, ...); temp = tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); if (outstring == 0) diff --git a/src/unexalpha.c b/src/unexalpha.c deleted file mode 100644 index d0faa179931..00000000000 --- a/src/unexalpha.c +++ /dev/null @@ -1,539 +0,0 @@ -/* Unexec for DEC alpha. - - Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -Author: Rainer Schoepf <schoepf@sc.ZIB-Berlin.DE> - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - - -#include <config.h> -#include <sys/types.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <stdio.h> -#include <errno.h> -#include <string.h> -#if !defined (__NetBSD__) && !defined (__OpenBSD__) -#include <filehdr.h> -#include <aouthdr.h> -#include <scnhdr.h> -#include <syms.h> -#ifndef __linux__ -# include <reloc.h> -# include <elf_abi.h> -#endif -#else /* __NetBSD__ or __OpenBSD__ */ -/* - * NetBSD/Alpha does not have 'normal' user-land ECOFF support because - * there's no desire to support ECOFF as the executable format in the - * long term. - */ -#include <sys/exec_ecoff.h> - -/* Structures, constants, etc., that NetBSD defines strangely. */ -#define filehdr ecoff_filehdr -#define aouthdr ecoff_aouthdr -#define scnhdr ecoff_scnhdr -#define HDRR struct ecoff_symhdr -#define pHDRR HDRR * -#define cbHDRR sizeof(HDRR) -#ifdef __OpenBSD__ -#define ALPHAMAGIC ECOFF_MAGIC_NATIVE_ALPHA -#else -#define ALPHAMAGIC ECOFF_MAGIC_NETBSD_ALPHA -#endif -#define ZMAGIC ECOFF_ZMAGIC - -/* Misc. constants that NetBSD doesn't define at all. */ -#define ALPHAUMAGIC 0617 -#define _MIPS_NSCNS_MAX 35 -#define STYP_TEXT 0x00000020 -#define STYP_DATA 0x00000040 -#define STYP_BSS 0x00000080 -#define STYP_RDATA 0x00000100 -#define STYP_SDATA 0x00000200 -#define STYP_SBSS 0x00000400 -#define STYP_INIT 0x80000000 -#define _TEXT ".text" -#define _DATA ".data" -#define _BSS ".bss" -#define _INIT ".init" -#define _RDATA ".rdata" -#define _SDATA ".sdata" -#define _SBSS ".sbss" -#define TEXT_START 0x120000000 -#endif /* __NetBSD__ || __OpenBSD__ */ - - -static void fatal_unexec (char *, char *); -static void mark_x (char *); - -static void update_dynamic_symbols (char *, char *, int, struct aouthdr); - -#define READ(_fd, _buffer, _size, _error_message, _error_arg) \ - errno = EEOF; \ - if (read (_fd, _buffer, _size) != _size) \ - fatal_unexec (_error_message, _error_arg); - -#define WRITE(_fd, _buffer, _size, _error_message, _error_arg) \ - if (write (_fd, _buffer, _size) != _size) \ - fatal_unexec (_error_message, _error_arg); - -#define SEEK(_fd, _position, _error_message, _error_arg) \ - errno = EEOF; \ - if (lseek (_fd, _position, L_SET) != _position) \ - fatal_unexec (_error_message, _error_arg); - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#else -void *sbrk (); -#endif - -#define EEOF -1 - -static struct scnhdr *text_section; -static struct scnhdr *rel_dyn_section; -static struct scnhdr *dynstr_section; -static struct scnhdr *dynsym_section; -static struct scnhdr *init_section; -static struct scnhdr *finit_section; -static struct scnhdr *rdata_section; -static struct scnhdr *rconst_section; -static struct scnhdr *data_section; -static struct scnhdr *pdata_section; -static struct scnhdr *xdata_section; -static struct scnhdr *got_section; -static struct scnhdr *lit8_section; -static struct scnhdr *lit4_section; -static struct scnhdr *sdata_section; -static struct scnhdr *sbss_section; -static struct scnhdr *bss_section; - -static struct scnhdr old_data_scnhdr; - -static unsigned long Brk; - -struct headers { - struct filehdr fhdr; - struct aouthdr aout; - struct scnhdr section[_MIPS_NSCNS_MAX]; -}; - - -void -unexec (new_name, a_name, data_start, bss_start, entry_address) - char *new_name, *a_name; - unsigned long data_start, bss_start, entry_address; -{ - int new, old; - char * oldptr; - struct headers ohdr, nhdr; - struct stat stat; - long pagesize, brk; - long newsyms, symrel; - int nread; - int i; - long vaddr, scnptr; -#define BUFSIZE 8192 - char buffer[BUFSIZE]; - - if ((old = open (a_name, O_RDONLY)) < 0) - fatal_unexec ("opening %s", a_name); - - new = creat (new_name, 0666); - if (new < 0) fatal_unexec ("creating %s", new_name); - - if ((fstat (old, &stat) == -1)) - fatal_unexec ("fstat %s", a_name); - - oldptr = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, old, 0); - - if (oldptr == (char *)-1) - fatal_unexec ("mmap %s", a_name); - - close (old); - - /* This is a copy of the a.out header of the original executable */ - - ohdr = (*(struct headers *)oldptr); - - /* This is where we build the new header from the in-memory copy */ - - nhdr = *((struct headers *)TEXT_START); - - /* First do some consistency checks */ - - if (nhdr.fhdr.f_magic != ALPHAMAGIC - && nhdr.fhdr.f_magic != ALPHAUMAGIC) - { - fprintf (stderr, "unexec: input file magic number is %x, not %x or %x.\n", - nhdr.fhdr.f_magic, ALPHAMAGIC, ALPHAUMAGIC); - exit (1); - } - - if (nhdr.fhdr.f_opthdr != sizeof (nhdr.aout)) - { - fprintf (stderr, "unexec: input a.out header is %d bytes, not %d.\n", - nhdr.fhdr.f_opthdr, (int)sizeof (nhdr.aout)); - exit (1); - } - if (nhdr.aout.magic != ZMAGIC) - { - fprintf (stderr, "unexec: input file a.out magic number is %o, not %o.\n", - nhdr.aout.magic, ZMAGIC); - exit (1); - } - - - /* Now check the existence of certain header section and grab - their addresses. */ - -#define CHECK_SCNHDR(ptr, name, flags) \ - ptr = NULL; \ - for (i = 0; i < nhdr.fhdr.f_nscns && !ptr; i++) \ - if (strncmp (nhdr.section[i].s_name, name, 8) == 0) \ - { \ - if (nhdr.section[i].s_flags != flags) \ - fprintf (stderr, "unexec: %x flags (%x expected) in %s section.\n", \ - nhdr.section[i].s_flags, flags, name); \ - ptr = nhdr.section + i; \ - } \ - - CHECK_SCNHDR (text_section, _TEXT, STYP_TEXT); - CHECK_SCNHDR (init_section, _INIT, STYP_INIT); -#ifdef _REL_DYN - CHECK_SCNHDR (rel_dyn_section, _REL_DYN, STYP_REL_DYN); -#endif /* _REL_DYN */ -#ifdef _DYNSYM - CHECK_SCNHDR (dynsym_section, _DYNSYM, STYP_DYNSYM); -#endif /* _REL_DYN */ -#ifdef _DYNSTR - CHECK_SCNHDR (dynstr_section, _DYNSTR, STYP_DYNSTR); -#endif /* _REL_DYN */ -#ifdef _FINI - CHECK_SCNHDR (finit_section, _FINI, STYP_FINI); -#endif /* _FINI */ - CHECK_SCNHDR (rdata_section, _RDATA, STYP_RDATA); -#ifdef _RCONST - CHECK_SCNHDR (rconst_section, _RCONST, STYP_RCONST); -#endif -#ifdef _PDATA - CHECK_SCNHDR (pdata_section, _PDATA, STYP_PDATA); -#endif /* _PDATA */ -#ifdef _GOT - CHECK_SCNHDR (got_section, _GOT, STYP_GOT); -#endif /* _GOT */ - CHECK_SCNHDR (data_section, _DATA, STYP_DATA); -#ifdef _XDATA - CHECK_SCNHDR (xdata_section, _XDATA, STYP_XDATA); -#endif /* _XDATA */ -#ifdef _LIT8 - CHECK_SCNHDR (lit8_section, _LIT8, STYP_LIT8); - CHECK_SCNHDR (lit4_section, _LIT4, STYP_LIT4); -#endif /* _LIT8 */ - CHECK_SCNHDR (sdata_section, _SDATA, STYP_SDATA); - CHECK_SCNHDR (sbss_section, _SBSS, STYP_SBSS); - CHECK_SCNHDR (bss_section, _BSS, STYP_BSS); - - - pagesize = getpagesize (); - brk = (((long) (sbrk (0))) + pagesize - 1) & (-pagesize); - - /* Remember the current break */ - - Brk = brk; - - memcpy (&old_data_scnhdr, data_section, sizeof (old_data_scnhdr)); - - nhdr.aout.dsize = brk - DATA_START; - nhdr.aout.bsize = 0; - if (entry_address == 0) - { - extern __start (); - nhdr.aout.entry = (unsigned long)__start; - } - else - nhdr.aout.entry = entry_address; - - nhdr.aout.bss_start = nhdr.aout.data_start + nhdr.aout.dsize; - - if (rdata_section != NULL) - { - rdata_section->s_size = data_start - DATA_START; - - /* Adjust start and virtual addresses of rdata_section, too. */ - rdata_section->s_vaddr = DATA_START; - rdata_section->s_paddr = DATA_START; - rdata_section->s_scnptr = text_section->s_scnptr + nhdr.aout.tsize; - } - - data_section->s_vaddr = data_start; - data_section->s_paddr = data_start; - data_section->s_size = brk - data_start; - - if (rdata_section != NULL) - { - data_section->s_scnptr = rdata_section->s_scnptr + rdata_section->s_size; - } - - vaddr = data_section->s_vaddr + data_section->s_size; - scnptr = data_section->s_scnptr + data_section->s_size; - if (lit8_section != NULL) - { - lit8_section->s_vaddr = vaddr; - lit8_section->s_paddr = vaddr; - lit8_section->s_size = 0; - lit8_section->s_scnptr = scnptr; - } - if (lit4_section != NULL) - { - lit4_section->s_vaddr = vaddr; - lit4_section->s_paddr = vaddr; - lit4_section->s_size = 0; - lit4_section->s_scnptr = scnptr; - } - if (sdata_section != NULL) - { - sdata_section->s_vaddr = vaddr; - sdata_section->s_paddr = vaddr; - sdata_section->s_size = 0; - sdata_section->s_scnptr = scnptr; - } -#ifdef _XDATA - if (xdata_section != NULL) - { - xdata_section->s_vaddr = vaddr; - xdata_section->s_paddr = vaddr; - xdata_section->s_size = 0; - xdata_section->s_scnptr = scnptr; - } -#endif -#ifdef _GOT - if (got_section != NULL) - { - memcpy (buffer, got_section, sizeof (struct scnhdr)); - - got_section->s_vaddr = vaddr; - got_section->s_paddr = vaddr; - got_section->s_size = 0; - got_section->s_scnptr = scnptr; - } -#endif /*_GOT */ - if (sbss_section != NULL) - { - sbss_section->s_vaddr = vaddr; - sbss_section->s_paddr = vaddr; - sbss_section->s_size = 0; - sbss_section->s_scnptr = scnptr; - } - if (bss_section != NULL) - { - bss_section->s_vaddr = vaddr; - bss_section->s_paddr = vaddr; - bss_section->s_size = 0; - bss_section->s_scnptr = scnptr; - } - - WRITE (new, (char *)TEXT_START, nhdr.aout.tsize, - "writing text section to %s", new_name); - WRITE (new, (char *)DATA_START, nhdr.aout.dsize, - "writing data section to %s", new_name); - -#ifdef _GOT -#define old_got_section ((struct scnhdr *)buffer) - - if (got_section != NULL) - { - SEEK (new, old_got_section->s_scnptr, - "seeking to start of got_section in %s", new_name); - WRITE (new, oldptr + old_got_section->s_scnptr, old_got_section->s_size, - "writing new got_section of %s", new_name); - SEEK (new, nhdr.aout.tsize + nhdr.aout.dsize, - "seeking to end of data section of %s", new_name); - } - -#undef old_got_section -#endif - - /* - * Construct new symbol table header - */ - - memcpy (buffer, oldptr + nhdr.fhdr.f_symptr, cbHDRR); - -#define symhdr ((pHDRR)buffer) - newsyms = nhdr.aout.tsize + nhdr.aout.dsize; - symrel = newsyms - nhdr.fhdr.f_symptr; - nhdr.fhdr.f_symptr = newsyms; - symhdr->cbLineOffset += symrel; - symhdr->cbDnOffset += symrel; - symhdr->cbPdOffset += symrel; - symhdr->cbSymOffset += symrel; - symhdr->cbOptOffset += symrel; - symhdr->cbAuxOffset += symrel; - symhdr->cbSsOffset += symrel; - symhdr->cbSsExtOffset += symrel; - symhdr->cbFdOffset += symrel; - symhdr->cbRfdOffset += symrel; - symhdr->cbExtOffset += symrel; - - WRITE (new, buffer, cbHDRR, "writing symbol table header of %s", new_name); - - /* - * Copy the symbol table and line numbers - */ - WRITE (new, oldptr + ohdr.fhdr.f_symptr + cbHDRR, - stat.st_size - ohdr.fhdr.f_symptr - cbHDRR, - "writing symbol table of %s", new_name); - -#ifdef _REL_DYN - if (rel_dyn_section) - update_dynamic_symbols (oldptr, new_name, new, nhdr.aout); -#endif - -#undef symhdr - - SEEK (new, 0, "seeking to start of header in %s", new_name); - WRITE (new, &nhdr, sizeof (nhdr), - "writing header of %s", new_name); - - close (old); - close (new); - mark_x (new_name); -} - - -static void -update_dynamic_symbols (old, new_name, new, aout) - char *old; /* Pointer to old executable */ - char *new_name; /* Name of new executable */ - int new; /* File descriptor for new executable */ - struct aouthdr aout; /* a.out info from the file header */ -{ -#if !defined (__linux__) && !defined (__NetBSD__) && !defined (__OpenBSD__) - - typedef struct dynrel_info { - char * addr; - unsigned type:8; - unsigned index:24; - unsigned info:8; - unsigned pad:8; - } dr_info; - - int nsyms = rel_dyn_section->s_size / sizeof (struct dynrel_info); - int i; - dr_info * rd_base = (dr_info *) (old + rel_dyn_section->s_scnptr); - Elf32_Sym * ds_base = (Elf32_Sym *) (old + dynsym_section->s_scnptr); - - for (i = 0; i < nsyms; i++) { - register Elf32_Sym x; - - if (rd_base[i].index == 0) - continue; - - x = ds_base[rd_base[i].index]; - -#if 0 - fprintf (stderr, "Object inspected: %s, addr = %lx, shndx = %x", - old + dynstr_section->s_scnptr + x.st_name, rd_base[i].addr, x.st_shndx); -#endif - - - if ((ELF32_ST_BIND (x.st_info) == STB_GLOBAL) - && (x.st_shndx == 0) - /* && (x.st_value == NULL) */ - ) { - /* OK, this is probably a reference to an object in a shared - library, so copy the old value. This is done in several steps: - 1. reladdr is the address of the location in question relative to - the start of the data section, - 2. oldref is the addr is the mapped in temacs executable, - 3. newref is the address of the location in question in the - undumped executable, - 4. len is the size of the object reference in bytes -- - currently only 4 (long) and 8 (quad) are supported. - */ - register unsigned long reladdr = (long)rd_base[i].addr - old_data_scnhdr.s_vaddr; - char * oldref = old + old_data_scnhdr.s_scnptr + reladdr; - unsigned long newref = aout.tsize + reladdr; - int len; - -#if 0 - fprintf (stderr, "...relocated\n"); -#endif - - if (rd_base[i].type == R_REFLONG) - len = 4; - else if (rd_base[i].type == R_REFQUAD) - len = 8; - else - fatal_unexec ("unrecognized relocation type in .dyn.rel section (symbol #%d)", (char *) i); - - SEEK (new, newref, "seeking to dynamic symbol in %s", new_name); - WRITE (new, oldref, len, "writing old dynrel info in %s", new_name); - } - -#if 0 - else - fprintf (stderr, "...not relocated\n"); -#endif - - } - -#endif /* not __linux__ and not __NetBSD__ and not __OpenBSD__ */ -} - - -/* - * mark_x - * - * After successfully building the new a.out, mark it executable - */ - -static void -mark_x (name) - char *name; -{ - struct stat sbuf; - int um = umask (777); - umask (um); - if (stat (name, &sbuf) < 0) - fatal_unexec ("getting protection on %s", name); - sbuf.st_mode |= 0111 & ~um; - if (chmod (name, sbuf.st_mode) < 0) - fatal_unexec ("setting protection on %s", name); -} - -static void -fatal_unexec (s, arg) - char *s; - char *arg; -{ - if (errno == EEOF) - fputs ("unexec: unexpected end of file, ", stderr); - else - fprintf (stderr, "unexec: %s, ", strerror (errno)); - fprintf (stderr, s, arg); - fputs (".\n", stderr); - exit (1); -} - -/* arch-tag: 46316c49-ee08-4aa3-942b-00798902f5bd - (do not change this comment) */ diff --git a/src/unexec.c b/src/unexcoff.c index 8edd9e22b96..ed319ec8e7f 100644 --- a/src/unexec.c +++ b/src/unexcoff.c @@ -18,12 +18,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* - * unexec.c - Convert a running program into an a.out file. + * unexcoff.c - Convert a running program into an a.out or COFF file. + * + * ================================================================== + * Note: This file is currently used only by the MSDOS (a.k.a. DJGPP) + * build of Emacs. If you are not interested in the MSDOS build, you + * are looking at the wrong version of unexec! + * ================================================================== * * Author: Spencer W. Thomas * Computer Science Dept. * University of Utah * Date: Tue Mar 2 1982 + * Originally under the name unexec.c. * Modified heavily since then. * * Synopsis: @@ -48,8 +55,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ * * Specifying zero for data_start means the boundary between text and data * should not be the same as when the program was loaded. - * If NO_REMAP is defined, the argument data_start is ignored and the - * segment boundaries are never changed. * * Bss_start indicates how much of the data segment is to be saved in the * a.out file and restored when the program is executed. It gives the lowest @@ -69,56 +74,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ * of Dell Computer Corporation. james@bigtex.cactus.org. */ -/* There are several compilation parameters affecting unexec: - -* COFF - -Define this if your system uses COFF for executables. - -* NO_REMAP - -Define this if you do not want to try to save Emacs's pure data areas -as part of the text segment. - -Saving them as text is good because it allows users to share more. - -However, on machines that locate the text area far from the data area, -the boundary cannot feasibly be moved. Such machines require -NO_REMAP. - -Also, remapping can cause trouble with the built-in startup routine -/lib/crt0.o, which defines `environ' as an initialized variable. -Dumping `environ' as pure does not work! So, to use remapping, -you must write a startup routine for your machine in Emacs's crt0.c. -If NO_REMAP is defined, Emacs uses the system's crt0.o. - -* SECTION_ALIGNMENT - -Some machines that use COFF executables require that each section -start on a certain boundary *in the COFF file*. Such machines should -define SECTION_ALIGNMENT to a mask of the low-order bits that must be -zero on such a boundary. This mask is used to control padding between -segments in the COFF file. - -If SECTION_ALIGNMENT is not defined, the segments are written -consecutively with no attempt at alignment. This is right for -unmodified system V. - -* SEGMENT_MASK - -Some machines require that the beginnings and ends of segments -*in core* be on certain boundaries. For most machines, a page -boundary is sufficient. That is the default. When a larger -boundary is needed, define SEGMENT_MASK to a mask of -the bits that must be zero on such a boundary. - -* ADJUST_EXEC_HEADER - -This macro can be used to generate statements to adjust or -initialize nonstandard fields in the file header - -*/ - #ifndef emacs #define PERROR(arg) perror (arg); return -1 #else @@ -264,19 +219,9 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) pagemask = getpagesize () - 1; /* Adjust text/data boundary. */ -#ifdef NO_REMAP data_start = (int) start_of_data (); -#else /* not NO_REMAP */ - if (!data_start) - data_start = (int) start_of_data (); -#endif /* not NO_REMAP */ data_start = ADDR_CORRECT (data_start); - -#ifdef SEGMENT_MASK - data_start = data_start & ~SEGMENT_MASK; /* (Down) to segment boundary. */ -#else data_start = data_start & ~pagemask; /* (Down) to page boundary. */ -#endif bss_end = ADDR_CORRECT (sbrk (0)) + pagemask; bss_end &= ~ pagemask; @@ -374,42 +319,20 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) to correspond to what we want to dump. */ f_hdr.f_flags |= (F_RELFLG | F_EXEC); -#ifndef NO_REMAP f_ohdr.text_start = (long) start_of_text (); f_ohdr.tsize = data_start - f_ohdr.text_start; f_ohdr.data_start = data_start; -#endif /* NO_REMAP */ f_ohdr.dsize = bss_start - f_ohdr.data_start; f_ohdr.bsize = bss_end - bss_start; - /* On some machines, the old values are right. - ??? Maybe on all machines with NO_REMAP. */ f_thdr.s_size = f_ohdr.tsize; f_thdr.s_scnptr = sizeof (f_hdr) + sizeof (f_ohdr); f_thdr.s_scnptr += (f_hdr.f_nscns) * (sizeof (f_thdr)); lnnoptr = f_thdr.s_lnnoptr; -#ifdef SECTION_ALIGNMENT - /* Some systems require special alignment - of the sections in the file itself. */ - f_thdr.s_scnptr - = (f_thdr.s_scnptr + SECTION_ALIGNMENT) & ~SECTION_ALIGNMENT; -#endif /* SECTION_ALIGNMENT */ text_scnptr = f_thdr.s_scnptr; f_dhdr.s_paddr = f_ohdr.data_start; f_dhdr.s_vaddr = f_ohdr.data_start; f_dhdr.s_size = f_ohdr.dsize; f_dhdr.s_scnptr = f_thdr.s_scnptr + f_thdr.s_size; -#ifdef SECTION_ALIGNMENT - /* Some systems require special alignment - of the sections in the file itself. */ - f_dhdr.s_scnptr - = (f_dhdr.s_scnptr + SECTION_ALIGNMENT) & ~SECTION_ALIGNMENT; -#endif /* SECTION_ALIGNMENT */ -#ifdef DATA_SECTION_ALIGNMENT - /* Some systems require special alignment - of the data section only. */ - f_dhdr.s_scnptr - = (f_dhdr.s_scnptr + DATA_SECTION_ALIGNMENT) & ~DATA_SECTION_ALIGNMENT; -#endif /* DATA_SECTION_ALIGNMENT */ data_scnptr = f_dhdr.s_scnptr; f_bhdr.s_paddr = f_ohdr.data_start + f_ohdr.dsize; f_bhdr.s_vaddr = f_ohdr.data_start + f_ohdr.dsize; @@ -427,10 +350,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) f_thdr.s_lnnoptr += bias; } -#ifdef ADJUST_EXEC_HEADER - ADJUST_EXEC_HEADER; -#endif /* ADJUST_EXEC_HEADER */ - if (write (new, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) { PERROR (new_name); diff --git a/src/unexelf.c b/src/unexelf.c index 2ac6bbdc06e..0de69a4cabc 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -610,7 +610,7 @@ round_up (ElfW(Addr) x, ElfW(Addr) y) if NOERROR is 0; we return -1 if NOERROR is nonzero. */ static int -find_section (char *name, char *section_names, char *file_name, +find_section (const char *name, char *section_names, char *file_name, ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, int noerror) { int idx; diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 1acc009ba90..ef43e9bef12 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -305,7 +305,7 @@ print_region (vm_address_t address, vm_size_t size, vm_prot_t prot, } static void -print_region_list () +print_region_list (void) { struct region_t *r; @@ -316,7 +316,7 @@ print_region_list () } static void -print_regions () +print_regions (void) { task_t target_task = mach_task_self (); vm_address_t address = (vm_address_t) 0; @@ -346,7 +346,7 @@ print_regions () cannot be omitted because they some regions created at run time are read-only. */ static void -build_region_list () +build_region_list (void) { task_t target_task = mach_task_self (); vm_address_t address = (vm_address_t) 0; @@ -465,7 +465,7 @@ unexec_reader (task_t task, vm_address_t address, vm_size_t size, void **ptr) } static void -find_emacs_zone_regions () +find_emacs_zone_regions (void) { num_unexec_regions = 0; @@ -495,7 +495,7 @@ unexec_regions_sort_compare (const void *a, const void *b) } static void -unexec_regions_merge () +unexec_regions_merge (void) { int i, n; unexec_region_info r; @@ -627,7 +627,7 @@ print_load_command (struct load_command *lc) the global array lca. Store the total number of load commands in global variable nlc. */ static void -read_load_commands () +read_load_commands (void) { int i; @@ -684,8 +684,8 @@ read_load_commands () } } - printf ("Highest address of load commands in input file: %#8x\n", - infile_lc_highest_addr); + printf ("Highest address of load commands in input file: %#8lx\n", + (unsigned long)infile_lc_highest_addr); printf ("Lowest offset of all sections in __TEXT segment: %#8lx\n", text_seg_lowest_offset); @@ -1143,7 +1143,7 @@ copy_other (struct load_command *lc) /* Loop through all load commands and dump them. Then write the Mach header. */ static void -dump_it () +dump_it (void) { int i; long linkedit_delta = 0; @@ -1253,7 +1253,7 @@ unexec (char *outfile, char *infile, void *start_data, void *start_bss, void -unexec_init_emacs_zone () +unexec_init_emacs_zone (void) { emacs_zone = malloc_create_zone (0, 0); malloc_set_zone_name (emacs_zone, "EmacsZone"); diff --git a/src/vm-limit.c b/src/vm-limit.c index b288276f394..63f0f47e2d0 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -25,10 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "mem-limits.h" -#ifdef HAVE_GETRLIMIT -#include <sys/resource.h> -#endif - /* Level number of warnings already issued. 0 -- no warnings issued. @@ -37,9 +33,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 3 -- 95% warning issued; keep warning frequently. */ enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; - static enum warnlevel warnlevel; +typedef POINTER_TYPE *POINTER; + /* Function to call to issue a warning; 0 means don't issue them. */ static void (*warn_function) (const char *); @@ -100,7 +97,7 @@ get_lim_data (void) } #else -#if !defined (BSD4_2) && !defined (__osf__) +#if !defined (BSD4_2) && !defined (CYGWIN) #ifdef MSDOS void @@ -148,7 +145,7 @@ get_lim_data (void) } #endif /* not MSDOS */ -#else /* BSD4_2 */ +#else /* BSD4_2 || CYGWIN */ static void get_lim_data (void) @@ -173,9 +170,9 @@ static void check_memory_limits (void) { #ifdef REL_ALLOC - extern POINTER (*real_morecore) (); + extern POINTER (*real_morecore) (SIZE); #endif - extern POINTER (*__morecore) (); + extern POINTER (*__morecore) (SIZE); register POINTER cp; unsigned long five_percent; @@ -260,7 +257,7 @@ check_memory_limits (void) * */ -POINTER +char * start_of_data (void) { #ifdef BSD_SYSTEM diff --git a/src/w32.c b/src/w32.c index 19335742347..f1ed6ae0be9 100644 --- a/src/w32.c +++ b/src/w32.c @@ -140,10 +140,6 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX { /* For serial_configure and serial_open. */ #include "process.h" -/* From process.c */ -extern Lisp_Object QCport, QCspeed, QCprocess; -extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; -extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; typedef HRESULT (WINAPI * ShGetFolderPath_fn) (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); diff --git a/src/w32fns.c b/src/w32fns.c index c5e555dc884..d1f21e8acdd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -786,25 +786,6 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map, } static Lisp_Object -w32_to_x_color (Lisp_Object rgb) -{ - Lisp_Object color; - - CHECK_NUMBER (rgb); - - BLOCK_INPUT; - - color = Frassq (rgb, Vw32_color_map); - - UNBLOCK_INPUT; - - if (!NILP (color)) - return (Fcar (color)); - else - return Qnil; -} - -static Lisp_Object w32_color_map_lookup (char *colorname) { Lisp_Object tail, ret = Qnil; @@ -7072,7 +7053,7 @@ or when you set the mouse color. */); DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, doc: /* Maximum size for tooltips. -Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); +Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, diff --git a/src/w32font.c b/src/w32font.c index d1375d58507..46fca5d78d5 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -72,7 +72,7 @@ static Lisp_Object Qstandard, Qsubpixel, Qnatural; static Lisp_Object Qzh; /* scripts */ -static Lisp_Object Qlatin, Qgreek, Qcoptic, Qcyrillic, Qarmenian, Qhebrew; +static Lisp_Object Qgreek, Qcoptic, Qcyrillic, Qarmenian, Qhebrew; static Lisp_Object Qarabic, Qsyriac, Qnko, Qthaana, Qdevanagari, Qbengali; static Lisp_Object Qgurmukhi, Qgujarati, Qoriya, Qtamil, Qtelugu; static Lisp_Object Qkannada, Qmalayalam, Qsinhala, Qthai, Qlao; diff --git a/src/w32gui.h b/src/w32gui.h index 07a6fed0b47..9cad4f21f21 100644 --- a/src/w32gui.h +++ b/src/w32gui.h @@ -118,7 +118,7 @@ extern int nCmdShow; #define PBaseSize (1L << 8) /* program specified base for incrementing */ #define PWinGravity (1L << 9) /* program specified window gravity */ -extern int XParseGeometry (); +extern int XParseGeometry (char *, int *, int *, unsigned *, unsigned *); typedef struct { diff --git a/src/w32heap.h b/src/w32heap.h index cbd7f7ae96d..20a49a4e0ac 100644 --- a/src/w32heap.h +++ b/src/w32heap.h @@ -41,8 +41,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. #define get_w32_major_version() w32_major_version #define get_w32_minor_version() w32_minor_version -extern unsigned char *get_data_start(); -extern unsigned char *get_data_end(); +extern unsigned char *get_data_start (void); +extern unsigned char *get_data_end (void); extern unsigned long reserved_heap_size; extern SYSTEM_INFO sysinfo_cache; extern OSVERSIONINFO osinfo_cache; @@ -62,7 +62,7 @@ extern int os_subtype; extern void *sbrk (unsigned long size); /* Initialize heap structures for sbrk on startup. */ -extern void init_heap (); +extern void init_heap (void); /* Round the heap to this size. */ extern void round_heap (unsigned long size); diff --git a/src/w32menu.c b/src/w32menu.c index e96b70b59dc..919f8505da8 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -111,30 +111,6 @@ void w32_free_menu_strings (HWND); int pending_menu_activation; - -/* Return the frame whose ->output_data.w32->menubar_widget equals - ID, or 0 if none. */ - -static struct frame * -menubar_id_to_frame (HMENU id) -{ - Lisp_Object tail, frame; - FRAME_PTR f; - - for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) - { - frame = XCAR (tail); - if (!FRAMEP (frame)) - continue; - f = XFRAME (frame); - if (!FRAME_WINDOW_P (f)) - continue; - if (f->output_data.w32->menubar_widget == id) - return f; - } - return 0; -} - #ifdef HAVE_MENUS DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, @@ -1316,14 +1292,6 @@ name_is_separator (char *name) return (*name == '\0' || start + 2 == name); } - -/* Indicate boundary between left and right. */ -static int -add_left_right_boundary (HMENU menu) -{ - return AppendMenu (menu, MF_MENUBARBREAK, 0, NULL); -} - /* UTF8: 0xxxxxxx, 110xxxxx 10xxxxxx, 1110xxxx, 10xxxxxx, 10xxxxxx */ static void utf8to16 (unsigned char * src, int len, WCHAR * dest) diff --git a/src/w32select.c b/src/w32select.c index 8482d3331ff..bd013a5ece9 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -398,7 +398,6 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg) with global variables and calling strange looking functions. Is this really the right way to run Lisp callbacks? */ - extern int waiting_for_input; int owfi; BLOCK_INPUT; diff --git a/src/w32term.c b/src/w32term.c index abd7843c2ef..fc03034b14b 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -268,7 +268,9 @@ static void x_draw_bar_cursor (struct window *, struct glyph_row *, int, static void w32_clip_to_row (struct window *, struct glyph_row *, int, HDC); static BOOL my_show_window (struct frame *, HWND, int); static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT); +#if 0 static void my_set_focus (struct frame *, HWND); +#endif static void my_set_foreground_window (HWND); static void my_destroy_window (struct frame *, HWND); diff --git a/src/w32term.h b/src/w32term.h index b5b3d4451f2..ea245144ac3 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -48,8 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ extern MSG CurMsg; extern BOOL bUseDflt; -extern struct frame *x_window_to_frame (); - /* Structure recording bitmaps and reference count. If REFCOUNT is 0 then this record is free to be reused. */ @@ -226,13 +224,16 @@ extern Lisp_Object w32_display_name_list; /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */ extern Lisp_Object Vx_pixel_size_width_font_regexp; -struct w32_display_info *x_display_info_for_name (); +extern struct frame *x_window_to_frame (struct w32_display_info *, HWND); + +struct w32_display_info *x_display_info_for_name (Lisp_Object); Lisp_Object display_x_get_resource (struct w32_display_info *, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -extern struct w32_display_info *w32_term_init (); +extern struct w32_display_info *w32_term_init (Lisp_Object, + char *, char *); extern int x_display_pixel_height (struct w32_display_info *); extern int x_display_pixel_width (struct w32_display_info *); @@ -544,8 +545,10 @@ struct scroll_bar { #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) -extern void w32_fill_rect (); -extern void w32_clear_window (); +struct frame; /* from frame.h */ + +extern void w32_fill_rect (struct frame *, HDC, COLORREF, RECT *); +extern void w32_clear_window (struct frame *); #define w32_fill_area(f,hdc,pix,x,y,nx,ny) \ do { \ @@ -645,10 +648,10 @@ typedef struct deferred_msg extern CRITICAL_SECTION critsect; -extern void init_crit (); -extern void delete_crit (); +extern void init_crit (void); +extern void delete_crit (void); -extern void signal_quit (); +extern void signal_quit (void); #define enter_crit() EnterCriticalSection (&critsect) #define leave_crit() LeaveCriticalSection (&critsect) @@ -658,14 +661,13 @@ extern void deselect_palette (struct frame * f, HDC hdc); extern HDC get_frame_dc (struct frame * f); extern int release_frame_dc (struct frame * f, HDC hDC); -extern void drain_message_queue (); +extern void drain_message_queue (void); -extern BOOL get_next_msg (); -extern BOOL post_msg (); +extern BOOL get_next_msg (W32Msg *, BOOL); +extern BOOL post_msg (W32Msg *); extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result); -extern void wait_for_sync (); -extern BOOL parse_button (); +extern BOOL parse_button (int, int, int *, int *); extern void w32_sys_ring_bell (struct frame *f); extern void x_delete_display (struct w32_display_info *dpyinfo); @@ -725,7 +727,7 @@ struct frame * check_x_frame (Lisp_Object); EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1); -typedef DWORD (WINAPI * ClipboardSequence_Proc) (); +typedef DWORD (WINAPI * ClipboardSequence_Proc) (void); typedef BOOL (WINAPI * AppendMenuW_Proc) ( IN HMENU, IN UINT, diff --git a/src/window.c b/src/window.c index 89563112628..1fabe72d72d 100644 --- a/src/window.c +++ b/src/window.c @@ -51,14 +51,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "nsterm.h" #endif - Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; Lisp_Object Qdisplay_buffer; Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; Lisp_Object Qwindow_size_fixed; -extern Lisp_Object Qleft_margin, Qright_margin; - static int displayed_window_lines (struct window *); static struct window *decode_window (Lisp_Object); static int count_windows (struct window *); @@ -191,16 +188,11 @@ static int window_scroll_preserve_vpos; static int inhibit_frame_unsplittable; #endif /* 0 */ -extern EMACS_INT scroll_margin; - -extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; - /* If non-nil, then the `recenter' command with a nil argument the entire frame to be redrawn; the special value `tty' causes the frame to be redrawn only if it is a tty frame. */ static Lisp_Object Vrecenter_redisplay; -extern Lisp_Object Qtty; DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, @@ -508,7 +500,10 @@ DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, doc: /* Return the number of lines in WINDOW. WINDOW defaults to the selected window. -The return value includes WINDOW's mode line and header line, if any. */) +The return value includes WINDOW's mode line and header line, if any. + +Note: The function does not take into account the value of `line-spacing' +when calculating the number of lines in WINDOW. */) (Lisp_Object window) { return decode_any_window (window)->total_lines; @@ -642,13 +637,18 @@ calc_absolute_offset(struct window *w, int *add_x, int *add_y) #ifdef FRAME_MENUBAR_HEIGHT *add_y += FRAME_MENUBAR_HEIGHT (f); #endif -#ifdef FRAME_TOOLBAR_HEIGHT +#ifdef FRAME_TOOLBAR_TOP_HEIGHT + *add_y += FRAME_TOOLBAR_TOP_HEIGHT (f); +#elif FRAME_TOOLBAR_HEIGHT *add_y += FRAME_TOOLBAR_HEIGHT (f); #endif #ifdef FRAME_NS_TITLEBAR_HEIGHT *add_y += FRAME_NS_TITLEBAR_HEIGHT (f); #endif *add_x = f->left_pos; +#ifdef FRAME_TOOLBAR_LEFT_WIDTH + *add_x += FRAME_TOOLBAR_LEFT_WIDTH (f); +#endif } DEFUN ("window-absolute-pixel-edges", Fwindow_absolute_pixel_edges, diff --git a/src/xdisp.c b/src/xdisp.c index 53fba8caa90..80df99fee48 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -239,6 +239,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "macros.h" #include "disptab.h" #include "termhooks.h" +#include "termopts.h" #include "intervals.h" #include "coding.h" #include "process.h" @@ -268,29 +269,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define INFINITY 10000000 -#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ - || defined(HAVE_NS) || defined (USE_GTK) -extern void set_frame_menubar (struct frame *f, int, int); -#endif - -extern int interrupt_input; -extern int command_loop_level; - -extern Lisp_Object do_mouse_tracking; - -extern int minibuffer_auto_raise; -extern Lisp_Object Vminibuffer_list; - -extern Lisp_Object Qface; -extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line; - -extern Lisp_Object Voverriding_local_map; -extern Lisp_Object Voverriding_local_map_menu_flag; -extern Lisp_Object Qmenu_item; -extern Lisp_Object Qwhen; -extern Lisp_Object Qhelp_echo; -extern Lisp_Object Qbefore_string, Qafter_string; - Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; Lisp_Object Qwindow_text_change_functions, Vwindow_text_change_functions; @@ -381,7 +359,6 @@ int inhibit_eval_during_redisplay; /* Names of text properties relevant for redisplay. */ Lisp_Object Qdisplay; -extern Lisp_Object Qface, Qinvisible, Qwidth; /* Symbols used in text property values. */ @@ -392,10 +369,6 @@ Lisp_Object Qslice; Lisp_Object Qcenter; Lisp_Object Qmargin, Qpointer; Lisp_Object Qline_height; -extern Lisp_Object Qheight; -extern Lisp_Object QCwidth, QCheight, QCascent; -extern Lisp_Object Qscroll_bar; -extern Lisp_Object Qcursor; /* Non-nil means highlight trailing whitespace. */ @@ -406,7 +379,6 @@ Lisp_Object Vshow_trailing_whitespace; Lisp_Object Vnobreak_char_display; #ifdef HAVE_WINDOW_SYSTEM -extern Lisp_Object Voverflow_newline_into_fringe; /* Test if overflow newline into fringe. Called with iterator IT at or past right window margin, and with IT->current_x set. */ @@ -458,7 +430,7 @@ Lisp_Object QCmap, QCpointer; Lisp_Object Qrect, Qcircle, Qpoly; /* Tool bar styles */ -Lisp_Object Qtext, Qboth, Qboth_horiz; +Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz; /* Non-zero means print newline to stdout before next mini-buffer message. */ @@ -1020,12 +992,12 @@ static int display_line (struct it *); static int display_mode_lines (struct window *); static int display_mode_line (struct window *, enum face_id, Lisp_Object); static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int); -static int store_mode_line_string (char *, Lisp_Object, int, int, int, Lisp_Object); -static char *decode_mode_spec (struct window *, int, int, int, - Lisp_Object *); +static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); +static const char *decode_mode_spec (struct window *, int, int, int, + Lisp_Object *); static void display_menu_bar (struct window *); static int display_count_lines (int, int, int, int, int *); -static int display_string (unsigned char *, Lisp_Object, Lisp_Object, +static int display_string (const unsigned char *, Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT, struct it *, int, int, int, int); static void compute_line_metrics (struct it *); static void run_redisplay_end_trigger_hook (struct it *); @@ -1048,7 +1020,7 @@ static int next_element_from_stretch (struct it *); static void load_overlay_strings (struct it *, int); static int init_from_display_pos (struct it *, struct window *, struct display_pos *); -static void reseat_to_string (struct it *, unsigned char *, +static void reseat_to_string (struct it *, const unsigned char *, Lisp_Object, int, int, int, int); static enum move_it_result move_it_in_display_line_to (struct it *, EMACS_INT, int, @@ -1063,8 +1035,8 @@ static int forward_to_next_line_start (struct it *, int *); static struct text_pos string_pos_nchars_ahead (struct text_pos, Lisp_Object, int); static struct text_pos string_pos (int, Lisp_Object); -static struct text_pos c_string_pos (int, unsigned char *, int); -static int number_of_chars (unsigned char *, int); +static struct text_pos c_string_pos (int, const unsigned char *, int); +static int number_of_chars (const unsigned char *, int); static void compute_stop_pos (struct it *); static void compute_string_pos (struct text_pos *, struct text_pos, Lisp_Object); @@ -1576,7 +1548,7 @@ string_pos (int charpos, Lisp_Object string) means recognize multibyte characters. */ static struct text_pos -c_string_pos (int charpos, unsigned char *s, int multibyte_p) +c_string_pos (int charpos, const unsigned char *s, int multibyte_p) { struct text_pos pos; @@ -1608,7 +1580,7 @@ c_string_pos (int charpos, unsigned char *s, int multibyte_p) non-zero means recognize multibyte characters. */ static int -number_of_chars (unsigned char *s, int multibyte_p) +number_of_chars (const unsigned char *s, int multibyte_p) { int nchars; @@ -3691,7 +3663,6 @@ handle_invisible_prop (struct it *it) if (STRINGP (it->string)) { - extern Lisp_Object Qinvisible; Lisp_Object prop, end_charpos, limit, charpos; /* Get the value of the invisible text property at the @@ -4875,7 +4846,6 @@ compare_overlay_entries (const void *e1, const void *e2) static void load_overlay_strings (struct it *it, int charpos) { - extern Lisp_Object Qwindow, Qpriority; Lisp_Object overlay, window, str, invisible; struct Lisp_Overlay *ov; int start, end; @@ -5611,7 +5581,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p) calling this function. */ static void -reseat_to_string (struct it *it, unsigned char *s, Lisp_Object string, +reseat_to_string (struct it *it, const unsigned char *s, Lisp_Object string, int charpos, int precision, int field_width, int multibyte) { /* No region in strings. */ @@ -7966,7 +7936,7 @@ in_display_vector_p (struct it *it) to *Messages*. */ void -add_to_log (char *format, Lisp_Object arg1, Lisp_Object arg2) +add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2) { Lisp_Object args[3]; Lisp_Object msg, fmt; @@ -10225,7 +10195,6 @@ build_desired_tool_bar_string (struct frame *f) int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); int hmargin, vmargin, relief, idx, end; - extern Lisp_Object QCrelief, QCmargin, QCconversion; /* If image is a vector, choose the image according to the button state. */ @@ -10587,7 +10556,6 @@ redisplay_tool_bar (struct frame *f) if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows), nlines != WINDOW_TOTAL_LINES (w))) { - extern Lisp_Object Qtool_bar_lines; Lisp_Object frame; int old_height = WINDOW_TOTAL_LINES (w); @@ -10679,7 +10647,6 @@ redisplay_tool_bar (struct frame *f) frame parameter. */ if (change_height_p) { - extern Lisp_Object Qtool_bar_lines; Lisp_Object frame; int old_height = WINDOW_TOTAL_LINES (w); int nrows; @@ -11385,6 +11352,8 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val))) { if (FRAME_WINDOW_P (it->f) + /* FIXME: if ROW->reversed_p is set, this should test + the right fringe, not the left one. */ && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) { #ifdef HAVE_WINDOW_SYSTEM @@ -14487,7 +14456,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p) if (redisplay_tool_bar_p && redisplay_tool_bar (f)) { - extern int ignore_mouse_drag_p; ignore_mouse_drag_p = 1; } } @@ -17414,8 +17382,8 @@ display_line (struct it *it) row->ends_at_zv_p = 1; /* A row that displays right-to-left text must always have its last face extended all the way to the end of line, - even if this row ends in ZV, because we still write to th - screen left to right. */ + even if this row ends in ZV, because we still write to + the screen left to right. */ if (row->reversed_p) extend_face_to_end_of_line (it); break; @@ -17832,6 +17800,26 @@ display_line (struct it *it) row->truncated_on_left_p = 1; } + /* Remember the position at which this line ends. + + BIDI Note: any code that needs MATRIX_ROW_START/END_CHARPOS + cannot be before the call to find_row_edges below, since that is + where these positions are determined. */ + row->end = it->current; + if (!it->bidi_p) + { + row->minpos = row->start.pos; + row->maxpos = row->end.pos; + } + else + { + /* ROW->minpos and ROW->maxpos must be the smallest and + `1 + the largest' buffer positions in ROW. But if ROW was + bidi-reordered, these two positions can be anywhere in the + row, so we must determine them now. */ + find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos); + } + /* If the start of this line is the overlay arrow-position, then mark this glyph row as the one containing the overlay arrow. This is clearly a mess with variable size fonts. It would be @@ -17877,22 +17865,6 @@ display_line (struct it *it) /* Compute pixel dimensions of this line. */ compute_line_metrics (it); - /* Remember the position at which this line ends. */ - row->end = it->current; - if (!it->bidi_p) - { - row->minpos = row->start.pos; - row->maxpos = row->end.pos; - } - else - { - /* ROW->minpos and ROW->maxpos must be the smallest and - `1 + the largest' buffer positions in ROW. But if ROW was - bidi-reordered, these two positions can be anywhere in the - row, so we must determine them now. */ - find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos); - } - /* Record whether this row ends inside an ellipsis. */ row->ends_in_ellipsis_p = (it->method == GET_FROM_DISPLAY_VECTOR @@ -18566,7 +18538,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, { int multibyte; int bytepos, charpos; - unsigned char *spec; + const unsigned char *spec; Lisp_Object string; bytepos = percent_position; @@ -18836,7 +18808,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, */ static int -store_mode_line_string (char *string, Lisp_Object lisp_string, int copy_string, +store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string, int field_width, int precision, Lisp_Object props) { int len; @@ -19252,7 +19224,7 @@ decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_ static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; -static char * +static const char * decode_mode_spec (struct window *w, register int c, int field_width, int precision, Lisp_Object *string) { @@ -19812,7 +19784,7 @@ display_count_lines (int start, int start_byte, int limit_byte, int count, Value is the number of columns displayed. */ static int -display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string, +display_string (const unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string, EMACS_INT face_string_pos, EMACS_INT start, struct it *it, int field_width, int precision, int max_x, int multibyte) { @@ -25638,6 +25610,8 @@ syms_of_xdisp (void) staticpro (&Qboth); Qboth_horiz = intern_c_string ("both-horiz"); staticpro (&Qboth_horiz); + Qtext_image_horiz = intern_c_string ("text-image-horiz"); + staticpro (&Qtext_image_horiz); QCmap = intern_c_string (":map"); staticpro (&QCmap); QCpointer = intern_c_string (":pointer"); @@ -25981,11 +25955,12 @@ vertical margin. */); DEFVAR_LISP ("tool-bar-style", &Vtool_bar_style, doc: /* *Tool bar style to use. It can be one of - image - show images only - text - show text only - both - show both, text under image - both-horiz - show text to the right of the image - any other - use system default or image if no system default. */); + image - show images only + text - show text only + both - show both, text below image + both-horiz - show text to the right of the image + text-image-horiz - show text to the left of the image + any other - use system default or image if no system default. */); Vtool_bar_style = Qnil; DEFVAR_INT ("tool-bar-max-label-size", &tool_bar_max_label_size, diff --git a/src/xfaces.c b/src/xfaces.c index c0c53f3aa1f..21adb948c91 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -321,11 +321,6 @@ Lisp_Object QCreverse_video; Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit; Lisp_Object QCfontset; -/* Keywords symbols used for font properties. */ -extern Lisp_Object QCfoundry, QCadstyle, QCregistry; -extern Lisp_Object QCspacing, QCsize, QCavgwidth; -extern Lisp_Object Qp; - /* Symbols used for attribute values. */ Lisp_Object Qnormal, Qbold, Qultra_light, Qextra_light, Qlight; @@ -351,7 +346,6 @@ Lisp_Object Qframe_set_background_mode; Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe; Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu; Lisp_Object Qmode_line_inactive, Qvertical_border; -extern Lisp_Object Qmode_line; /* The symbol `face-alias'. A symbols having that property is an alias for another face. Value of the property is the name of @@ -359,8 +353,6 @@ extern Lisp_Object Qmode_line; Lisp_Object Qface_alias; -extern Lisp_Object Qcircular_list; - /* Default stipple pattern used on monochrome displays. This stipple pattern is used on monochrome displays instead of shades of gray for a face background color. See `set-face-stipple' for possible @@ -411,7 +403,6 @@ Lisp_Object Qforeground_color, Qbackground_color; /* The symbols `face' and `mouse-face' used as text properties. */ Lisp_Object Qface; -extern Lisp_Object Qmouse_face; /* Property for basic faces which other faces cannot inherit. */ @@ -520,7 +511,7 @@ static int load_pixmap (struct frame *, Lisp_Object, unsigned *, unsigned *); static struct frame *frame_or_selected_frame (Lisp_Object, int); static void load_face_colors (struct frame *, struct face *, Lisp_Object *); static void free_face_colors (struct frame *, struct face *); -static int face_color_gray_p (struct frame *, char *); +static int face_color_gray_p (struct frame *, const char *); static struct face *realize_face (struct face_cache *, Lisp_Object *, int); static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, @@ -751,10 +742,9 @@ x_free_gc (struct frame *f, GC gc) /* NS emulation of GCs */ static INLINE GC -x_create_gc (f, mask, xgcv) - struct frame *f; - unsigned long mask; - XGCValues *xgcv; +x_create_gc (struct frame *f, + unsigned long mask, + XGCValues *xgcv) { GC gc = xmalloc (sizeof (*gc)); if (gc) @@ -763,9 +753,7 @@ x_create_gc (f, mask, xgcv) } static INLINE void -x_free_gc (f, gc) - struct frame *f; - GC gc; +x_free_gc (struct frame *f, GC gc) { xfree (gc); } @@ -1171,7 +1159,8 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, XColor /* A version of defined_color for non-X frames. */ int -tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc) +tty_defined_color (struct frame *f, const char *color_name, + XColor *color_def, int alloc) { int status = 1; @@ -1206,7 +1195,7 @@ tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int all This does the right thing for any type of frame. */ int -defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc) +defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc) { if (!FRAME_WINDOW_P (f)) return tty_defined_color (f, color_name, color_def, alloc); @@ -1266,7 +1255,7 @@ tty_color_name (struct frame *f, int idx) The criterion implemented here is not a terribly sophisticated one. */ static int -face_color_gray_p (struct frame *f, char *color_name) +face_color_gray_p (struct frame *f, const char *color_name) { XColor color; int gray_p; @@ -1293,7 +1282,7 @@ face_color_gray_p (struct frame *f, char *color_name) color. */ static int -face_color_supported_p (struct frame *f, char *color_name, int background_p) +face_color_supported_p (struct frame *f, const char *color_name, int background_p) { Lisp_Object frame; XColor not_used; @@ -3666,8 +3655,6 @@ x_update_menu_appearance (struct frame *f) if (! NILP (xlfd)) { #if defined HAVE_X_I18N - extern char *xic_create_fontsetname - (char *base_fontname, Bool motif); char *fontsetname = xic_create_fontsetname (SDATA (xlfd), motif); #else char *fontsetname = (char *) SDATA (xlfd); diff --git a/src/xfns.c b/src/xfns.c index ee020371683..bc28ccd3a63 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -101,6 +101,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <Xm/FileSB.h> #endif +#ifdef USE_LUCID +#include "../lwlib/xlwmenu.h" +#endif + #if !defined(NO_EDITRES) #define HACK_EDITRES extern void _XEditResCheckMessages (); @@ -157,6 +161,10 @@ int x_gtk_file_dialog_help_text; int x_gtk_whole_detached_tool_bar; +/* If non-zero, use Gtk+ tooltips. */ + +static int x_gtk_use_system_tooltips; + /* The background and shape of the mouse pointer, and shape when not over text or in the modeline. */ @@ -194,19 +202,6 @@ Lisp_Object Qundefined_color; Lisp_Object Qcompound_text, Qcancel_timer; Lisp_Object Qfont_param; -/* In dispnew.c */ - -extern Lisp_Object Vwindow_system_version; - -/* In editfns.c */ - -extern Lisp_Object Vsystem_name; - -/* The below are defined in frame.c. */ - -extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode; -extern Lisp_Object Qtooltip; - #if GLYPH_DEBUG int image_cache_refcount, dpyinfo_refcount; #endif @@ -506,7 +501,7 @@ void x_set_scroll_bar_background (struct frame *, Lisp_Object, static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *, Lisp_Object, Lisp_Object, - char *, char *, + const char *, const char *, int); @@ -650,7 +645,8 @@ gamma_correct (struct frame *f, XColor *color) no color could be allocated. */ int -x_defined_color (struct frame *f, char *color_name, XColor *color, int alloc_p) +x_defined_color (struct frame *f, const char *color_name, + XColor *color, int alloc_p) { int success_p; Display *dpy = FRAME_X_DISPLAY (f); @@ -710,6 +706,22 @@ x_set_wait_for_wm (struct frame *f, Lisp_Object new_value, Lisp_Object old_value f->output_data.x->wait_for_wm = !NILP (new_value); } +static void +x_set_tool_bar_position (struct frame *f, + Lisp_Object new_value, + Lisp_Object old_value) +{ + if (! EQ (new_value, Qleft) && ! EQ (new_value, Qright) + && ! EQ (new_value, Qbottom) && ! EQ (new_value, Qtop)) + return; + if (EQ (new_value, old_value)) return; + +#ifdef USE_GTK + if (xg_change_toolbar_position (f, new_value)) + f->tool_bar_position = new_value; +#endif +} + #ifdef USE_GTK /* Set icon from FILE for frame F. By using GTK functions the icon @@ -750,10 +762,10 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file) } int -xg_set_icon_from_xpm_data (FRAME_PTR f, char **data) +xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data) { int result = 0; - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data); if (!pixbuf) return 0; @@ -991,7 +1003,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0) FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f); - + if (cursor != x->text_cursor && x->text_cursor != 0) XFreeCursor (dpy, x->text_cursor); @@ -1755,7 +1767,7 @@ x_set_scroll_bar_default_width (struct frame *f) static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, - char *xprop, char *xclass, + const char *xprop, const char *xclass, int foreground_p) { struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); @@ -1896,12 +1908,12 @@ static XIMStyle supported_xim_styles[] = /* Create an X fontset on frame F with base font name BASE_FONTNAME. */ -char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; +const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; /* Create an Xt fontset spec from the name of a base font. If `motif' is True use the Motif syntax. */ char * -xic_create_fontsetname (char *base_fontname, int motif) +xic_create_fontsetname (const char *base_fontname, int motif) { const char *sep = motif ? ";" : ","; char *fontsetname; @@ -1921,7 +1933,7 @@ xic_create_fontsetname (char *base_fontname, int motif) - the base font. - the base font where the charset spec is replaced by -*-*. - the same but with the family also replaced with -*-*-. */ - char *p = base_fontname; + const char *p = base_fontname; int i; for (i = 0; *p; p++) @@ -1940,13 +1952,13 @@ xic_create_fontsetname (char *base_fontname, int motif) else { int len; - char *p1 = NULL, *p2 = NULL, *p3 = NULL; + const char *p1 = NULL, *p2 = NULL, *p3 = NULL; char *font_allcs = NULL; char *font_allfamilies = NULL; char *font_all = NULL; - char *allcs = "*-*-*-*-*-*-*"; - char *allfamilies = "-*-*-"; - char *all = "*-*-*-*-"; + const char *allcs = "*-*-*-*-*-*-*"; + const char *allfamilies = "-*-*-"; + const char *all = "*-*-*-*-"; char *base; for (i = 0, p = base_fontname; i < 8; p++) @@ -2075,7 +2087,7 @@ xic_create_xfontset (struct frame *f) char **missing_list; int missing_count; char *def_string; - char *xlfd_format = "-*-*-medium-r-normal--%d-*-*-*-*-*"; + const char *xlfd_format = "-*-*-medium-r-normal--%d-*-*-*-*-*"; sprintf (buf, xlfd_format, pixel_size); missing_list = NULL; @@ -2126,7 +2138,7 @@ xic_create_xfontset (struct frame *f) } if (! xfs) { - char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*"; + const char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*"; missing_list = NULL; xfs = XCreateFontSet (FRAME_X_DISPLAY (f), last_resort, @@ -2339,7 +2351,7 @@ xic_set_statusarea (struct frame *f) area.x = FRAME_PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f); area.y = (FRAME_PIXEL_HEIGHT (f) - area.height - FRAME_MENUBAR_HEIGHT (f) - - FRAME_TOOLBAR_HEIGHT (f) + - FRAME_TOOLBAR_TOP_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f)); XFree (needed); @@ -2353,7 +2365,7 @@ xic_set_statusarea (struct frame *f) BASE_FONTNAME. Called when a new Emacs fontset is chosen. */ void -xic_set_xfontset (struct frame *f, char *base_fontname) +xic_set_xfontset (struct frame *f, const char *base_fontname) { XVaNestedList attr; XFontSet xfs; @@ -2999,7 +3011,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms) if (! FONTP (font) && ! STRINGP (font)) { - char *names[] + const char *names[] = { #ifdef HAVE_XFT /* This will find the normal Xft font. */ @@ -3728,7 +3740,7 @@ If omitted or nil, that stands for the selected frame's display. */) (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); - char *vendor = ServerVendor (dpyinfo->display); + const char *vendor = ServerVendor (dpyinfo->display); if (! vendor) vendor = ""; return build_string (vendor); @@ -3922,7 +3934,7 @@ x_screen_planes (register struct frame *f) static struct visual_class { - char *name; + const char *name; int class; } visual_classes[] = @@ -4589,7 +4601,9 @@ unwind_create_tip_frame (Lisp_Object frame) when this happens. */ static Lisp_Object -x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms, Lisp_Object text) +x_create_tip_frame (struct x_display_info *dpyinfo, + Lisp_Object parms, + Lisp_Object text) { struct frame *f; Lisp_Object frame, tem; @@ -5016,6 +5030,27 @@ Text larger than the specified size is clipped. */) else CHECK_NUMBER (dy); +#ifdef USE_GTK + if (x_gtk_use_system_tooltips) + { + int ok; + + /* Hide a previous tip, if any. */ + Fx_hide_tip (); + + BLOCK_INPUT; + if ((ok = xg_prepare_tooltip (f, string, &width, &height)) != 0) + { + compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); + xg_show_tooltip (f, root_x, root_y); + /* This is used in Fx_hide_tip. */ + XSETFRAME (tip_frame, f); + } + UNBLOCK_INPUT; + if (ok) goto start_timer; + } +#endif /* USE_GTK */ + if (NILP (last_show_tip_args)) last_show_tip_args = Fmake_vector (make_number (3), Qnil); @@ -5176,6 +5211,7 @@ Value is t if tooltip was open, nil otherwise. */) int count; Lisp_Object deleted, frame, timer; struct gcpro gcpro1, gcpro2; + struct frame *f; /* Return quickly if nothing to do. */ if (NILP (tip_timer) && NILP (tip_frame)) @@ -5193,6 +5229,14 @@ Value is t if tooltip was open, nil otherwise. */) if (!NILP (timer)) call1 (Qcancel_timer, timer); +#ifdef USE_GTK + /* When using system tooltip, tip_frame is the Emacs frame on which + the tip is shown. */ + f = XFRAME (frame); + if (xg_hide_tooltip (f)) + frame = Qnil; +#endif + if (FRAMEP (frame)) { delete_frame (frame, Qnil); @@ -5203,9 +5247,9 @@ Value is t if tooltip was open, nil otherwise. */) redisplay procedure is not called when a tip frame over menu items is unmapped. Redisplay the menu manually... */ { - struct frame *f = SELECTED_FRAME (); - Widget w = f->output_data.x->menubar_widget; - extern void xlwmenu_redisplay (Widget); + Widget w; + f = SELECTED_FRAME (); + w = f->output_data.x->menubar_widget; if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen) && w != NULL) @@ -5235,9 +5279,6 @@ DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog, (void) { #ifdef USE_GTK - extern int use_dialog_box; - extern int use_file_dialog; - if (use_dialog_box && use_file_dialog && have_menus_p () @@ -5308,7 +5349,6 @@ or directory must exist. ONLY-DIR-P is ignored." */) Widget dialog, text, help; Arg al[10]; int ac = 0; - extern XtAppContext Xt_app_con; XmString dir_xmstring, pattern_xmstring; int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; @@ -5558,7 +5598,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. */) font_param = Ffont_get (font, intern (":name")); if (STRINGP (font_param)) default_name = xstrdup (SDATA (font_param)); - else + else { font_param = Fframe_parameter (frame, Qfont_param); if (STRINGP (font_param)) @@ -5569,7 +5609,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. */) default_name = xstrdup (x_last_font_name); /* Convert fontconfig names to Gtk names, i.e. remove - before number */ - if (default_name) + if (default_name) { char *p = strrchr (default_name, '-'); if (p) @@ -5747,6 +5787,7 @@ frame_parm_handler x_frame_parm_handlers[] = x_set_font_backend, x_set_alpha, x_set_sticky, + x_set_tool_bar_position, }; void @@ -5829,8 +5870,8 @@ or when you set the mouse color. */); Vx_cursor_fore_pixel = Qnil; DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, - doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). -Text larger than this is clipped. */); + doc: /* Maximum size for tooltips. +Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */); Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, @@ -5877,6 +5918,12 @@ The default is to just show an arrow and pressing on that arrow shows the tool bar buttons. */); x_gtk_whole_detached_tool_bar = 0; + DEFVAR_BOOL ("x-gtk-use-system-tooltips", &x_gtk_use_system_tooltips, + doc: /* *If non-nil with a Gtk+ built Emacs, the Gtk+ toolip is used. +Otherwise use Emacs own tooltip implementation. +When using Gtk+ tooltips, the tooltip face is not used. */); + x_gtk_use_system_tooltips = 1; + Fprovide (intern_c_string ("x"), Qnil); #ifdef USE_X_TOOLKIT @@ -5897,6 +5944,7 @@ the tool bar buttons. */); accepts --with-x-toolkit=gtk. */ Fprovide (intern_c_string ("x-toolkit"), Qnil); Fprovide (intern_c_string ("gtk"), Qnil); + Fprovide (intern_c_string ("move-toolbar"), Qnil); DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string, doc: /* Version info for GTK+. */); diff --git a/src/xfont.c b/src/xfont.c index b03bb1585d3..368587de6d8 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -154,8 +154,6 @@ struct font_driver xfont_driver = NULL, /* filter_properties */ }; -extern Lisp_Object QCname; - static Lisp_Object xfont_get_cache (FRAME_PTR f) { @@ -164,8 +162,6 @@ xfont_get_cache (FRAME_PTR f) return (dpyinfo->name_list_element); } -extern Lisp_Object Vface_alternative_font_registry_alist; - static int compare_font_names (const void *name1, const void *name2) { @@ -289,8 +285,6 @@ static Lisp_Object xfont_scripts_cache; /* Re-usable vector to store characteristic font properites. */ static Lisp_Object xfont_scratch_props; -extern Lisp_Object Qlatin; - /* Return a list of scripts supported by the font of FONTNAME whose characteristic properties are in PROPS and whose encoding charset is ENCODING. A caller must call BLOCK_INPUT in advance. */ @@ -339,10 +333,8 @@ xfont_supported_scripts (Display *display, char *fontname, Lisp_Object props, return scripts; } -extern Lisp_Object Vscalable_fonts_allowed; - static Lisp_Object -xfont_list_pattern (Display *display, char *pattern, +xfont_list_pattern (Display *display, const char *pattern, Lisp_Object registry, Lisp_Object script) { Lisp_Object list = Qnil; @@ -687,8 +679,6 @@ xfont_list_family (Lisp_Object frame) return list; } -extern Lisp_Object QCavgwidth; - static Lisp_Object xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) { diff --git a/src/xftfont.c b/src/xftfont.c index 68dd0af762f..dc82c28b215 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -171,10 +171,6 @@ xftfont_match (Lisp_Object frame, Lisp_Object spec) return entity; } -extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object); -extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); -extern Lisp_Object QCantialias; - static FcChar8 ascii_printable[95]; static void @@ -552,8 +548,6 @@ xftfont_done_face (FRAME_PTR f, struct face *face) } } -extern Lisp_Object Qja, Qko; - static int xftfont_has_char (Lisp_Object font, int c) { diff --git a/src/xmenu.c b/src/xmenu.c index 2fb39339b98..0b24a8f2bd6 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -89,7 +89,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <X11/Xaw/Paned.h> #endif /* HAVE_XAW3D */ #endif /* USE_LUCID */ -#include "../lwlib/lwlib.h" #else /* not USE_X_TOOLKIT */ #ifndef USE_GTK #include "../oldXMenu/XMenu.h" @@ -110,29 +109,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ Lisp_Object Qdebug_on_next_call; -extern Lisp_Object Qmenu_bar; - -extern Lisp_Object QCtoggle, QCradio; - -extern Lisp_Object Voverriding_local_map; -extern Lisp_Object Voverriding_local_map_menu_flag; - -extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; - -extern Lisp_Object Qmenu_bar_update_hook; - -#ifdef USE_X_TOOLKIT -extern void set_frame_menubar (FRAME_PTR, int, int); -extern XtAppContext Xt_app_con; - -static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object, - char **); -static void popup_get_selection (XEvent *, struct x_display_info *, - LWLIB_ID, int); -#endif /* USE_X_TOOLKIT */ - -#ifdef USE_GTK -extern void set_frame_menubar (FRAME_PTR, int, int); +#if defined (USE_X_TOOLKIT) || defined (USE_GTK) static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object, char **); #endif @@ -145,12 +122,6 @@ static int popup_activated_flag; static int next_menubar_widget_id; -/* For NS and NTGUI, these prototypes are defined in keyboard.h. */ -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) -extern widget_value *xmalloc_widget_value (void); -extern widget_value *digest_single_submenu (int, int, int); -#endif - #ifdef USE_X_TOOLKIT @@ -2210,7 +2181,6 @@ static struct frame *menu_help_frame; static void menu_help_callback (char *help_string, int pane, int item) { - extern Lisp_Object Qmenu_item; Lisp_Object *first_item; Lisp_Object pane_name; Lisp_Object menu_object; diff --git a/src/xrdb.c b/src/xrdb.c index 513768e3cde..e0d948fd3a6 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -20,9 +20,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef emacs #include <config.h> -#endif #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -52,38 +50,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ extern char *getenv (const char *); -/* This does cause trouble on AIX. I'm going to take the comment at - face value. */ -#if 0 -extern short getuid (); /* If this causes portability problems, - I think we should just delete it; it'll - default to `int' anyway. */ -#endif - -#ifdef DECLARE_GETPWUID_WITH_UID_T -extern struct passwd *getpwuid (uid_t); -extern struct passwd *getpwnam (const char *); -#else extern struct passwd *getpwuid (uid_t); extern struct passwd *getpwnam (const char *); -#endif -extern char *get_system_name (void); - -/* Make sure not to #include anything after these definitions. Let's - not step on anyone's prototypes. */ -#ifdef emacs -/* darwin.h may have already defined these. */ -#undef malloc -#undef realloc -#undef free -#define malloc xmalloc -#define realloc xrealloc -#define free xfree -#endif +extern const char *get_system_name (void); -char *x_get_string_resource (XrmDatabase rdb, char *name, char *class); -static int file_p (char *filename); +char *x_get_string_resource (XrmDatabase rdb, const char *name, + const char *class); +static int file_p (const char *filename); /* X file search path processing. */ @@ -98,7 +72,7 @@ char *x_customization_string; resource, for later use in search path decoding. If we find no such resource, return zero. */ char * -x_get_customization_string (XrmDatabase db, char *name, char *class) +x_get_customization_string (XrmDatabase db, const char *name, const char *class) { char *full_name = (char *) alloca (strlen (name) + sizeof ("customization") + 3); @@ -113,7 +87,7 @@ x_get_customization_string (XrmDatabase db, char *name, char *class) if (result) { - char *copy = (char *) malloc (strlen (result) + 1); + char *copy = (char *) xmalloc (strlen (result) + 1); strcpy (copy, result); return copy; } @@ -153,20 +127,20 @@ x_get_customization_string (XrmDatabase db, char *name, char *class) Return NULL otherwise. */ static char * -magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, char *suffix) +magic_file_p (const char *string, int string_len, const char *class, const char *escaped_suffix, const char *suffix) { char *lang = getenv ("LANG"); int path_size = 100; - char *path = (char *) malloc (path_size); + char *path = (char *) xmalloc (path_size); int path_len = 0; - char *p = string; + const char *p = string; while (p < string + string_len) { /* The chunk we're about to stick on the end of result. */ - char *next = NULL; + const char *next = NULL; int next_len; if (*p == '%') @@ -209,7 +183,7 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c case 'l': if (! lang) { - free (path); + xfree (path); return NULL; } @@ -219,7 +193,7 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c case 't': case 'c': - free (path); + xfree (path); return NULL; } } @@ -230,7 +204,7 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c if (path_len + next_len + 1 > path_size) { path_size = (path_len + next_len + 1) * 2; - path = (char *) realloc (path, path_size); + path = (char *) xrealloc (path, path_size); } memcpy (path + path_len, next, next_len); @@ -256,7 +230,7 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c if (path_len + suffix_len + 1 > path_size) { path_size = (path_len + suffix_len + 1); - path = (char *) realloc (path, path_size); + path = (char *) xrealloc (path, path_size); } memcpy (path + path_len, suffix, suffix_len); @@ -267,7 +241,7 @@ magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, c if (! file_p (path)) { - free (path); + xfree (path); return NULL; } @@ -297,7 +271,7 @@ gethomedir (void) if (ptr == NULL) return xstrdup ("/"); - copy = (char *) malloc (strlen (ptr) + 2); + copy = (char *) xmalloc (strlen (ptr) + 2); strcpy (copy, ptr); strcat (copy, "/"); @@ -306,7 +280,7 @@ gethomedir (void) static int -file_p (char *filename) +file_p (const char *filename) { struct stat status; @@ -321,9 +295,9 @@ file_p (char *filename) the path name of the one we found otherwise. */ static char * -search_magic_path (char *search_path, char *class, char *escaped_suffix, char *suffix) +search_magic_path (const char *search_path, const char *class, const char *escaped_suffix, const char *suffix) { - register char *s, *p; + const char *s, *p; for (s = search_path; *s; s = p) { @@ -332,7 +306,8 @@ search_magic_path (char *search_path, char *class, char *escaped_suffix, char *s if (p > s) { - char *path = magic_file_p (s, p - s, class, escaped_suffix, suffix); + char *path = magic_file_p (s, p - s, class, escaped_suffix, + suffix); if (path) return path; } @@ -356,7 +331,7 @@ search_magic_path (char *search_path, char *class, char *escaped_suffix, char *s /* Producing databases for individual sources. */ static XrmDatabase -get_system_app (char *class) +get_system_app (const char *class) { XrmDatabase db = NULL; char *path; @@ -368,7 +343,7 @@ get_system_app (char *class) if (path) { db = XrmGetFileDatabase (path); - free (path); + xfree (path); } return db; @@ -383,7 +358,7 @@ get_fallback (Display *display) static XrmDatabase -get_user_app (char *class) +get_user_app (const char *class) { char *path; char *file = 0; @@ -407,12 +382,12 @@ get_user_app (char *class) || (file = search_magic_path (free_it, class, "%N", 0))))) { XrmDatabase db = XrmGetFileDatabase (file); - free (file); - free (free_it); + xfree (file); + xfree (free_it); return db; } - free (free_it); + xfree (free_it); return NULL; } @@ -437,12 +412,12 @@ get_user_db (Display *display) char *xdefault; home = gethomedir (); - xdefault = (char *) malloc (strlen (home) + sizeof (".Xdefaults")); + xdefault = (char *) xmalloc (strlen (home) + sizeof (".Xdefaults")); strcpy (xdefault, home); strcat (xdefault, ".Xdefaults"); db = XrmGetFileDatabase (xdefault); - free (home); - free (xdefault); + xfree (home); + xfree (xdefault); } #ifdef HAVE_XSCREENRESOURCESTRING @@ -463,13 +438,14 @@ get_environ_db (void) { XrmDatabase db; char *p; - char *path = 0, *home = 0, *host; + char *path = 0, *home = 0; + const char *host; if ((p = getenv ("XENVIRONMENT")) == NULL) { home = gethomedir (); host = get_system_name (); - path = (char *) malloc (strlen (home) + path = (char *) xmalloc (strlen (home) + sizeof (".Xdefaults-") + strlen (host)); sprintf (path, "%s%s%s", home, ".Xdefaults-", host); @@ -478,8 +454,8 @@ get_environ_db (void) db = XrmGetFileDatabase (p); - free (path); - free (home); + xfree (path); + xfree (home); return db; } @@ -494,18 +470,18 @@ XrmRepresentation x_rm_string; /* Quark representation */ /* Load X resources based on the display and a possible -xrm option. */ XrmDatabase -x_load_resources (Display *display, char *xrm_string, char *myname, char *myclass) +x_load_resources (Display *display, const char *xrm_string, + const char *myname, const char *myclass) { XrmDatabase user_database; XrmDatabase rdb; XrmDatabase db; char line[256]; - char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1"; + const char *helv = "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1"; #ifdef USE_MOTIF - char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"; - extern Lisp_Object Vdouble_click_time; + const char *courier = "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"; #endif x_rm_string = XrmStringToQuark (XrmStringType); @@ -584,7 +560,7 @@ x_load_resources (Display *display, char *xrm_string, char *myname, char *myclas /* Figure out what the "customization string" is, so we can use it to decode paths. */ - free (x_customization_string); + xfree (x_customization_string); x_customization_string = x_get_customization_string (user_database, myname, myclass); @@ -628,7 +604,7 @@ x_load_resources (Display *display, char *xrm_string, char *myname, char *myclas and of type TYPE from database RDB. The value is returned in RET_VALUE. */ int -x_get_resource (XrmDatabase rdb, char *name, char *class, XrmRepresentation expected_type, XrmValue *ret_value) +x_get_resource (XrmDatabase rdb, const char *name, const char *class, XrmRepresentation expected_type, XrmValue *ret_value) { XrmValue value; XrmName namelist[100]; @@ -656,7 +632,7 @@ x_get_resource (XrmDatabase rdb, char *name, char *class, XrmRepresentation expe database RDB. */ char * -x_get_string_resource (XrmDatabase rdb, char *name, char *class) +x_get_string_resource (XrmDatabase rdb, const char *name, const char *class) { XrmValue value; diff --git a/src/xselect.c b/src/xselect.c index cd0307344ab..9f15c7c2d99 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -76,7 +76,8 @@ static void receive_incremental_selection (Display *, Window, Atom, static Lisp_Object x_get_window_property_as_lisp_data (Display *, Window, Atom, Lisp_Object, Atom); -static Lisp_Object selection_data_to_lisp_data (Display *, unsigned char *, +static Lisp_Object selection_data_to_lisp_data (Display *, + const unsigned char *, int, Atom, int); static void lisp_data_to_selection_data (Display *, Lisp_Object, unsigned char **, Atom *, @@ -391,7 +392,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) selecting_window = FRAME_X_WINDOW (sf); display = FRAME_X_DISPLAY (sf); dpyinfo = FRAME_X_DISPLAY_INFO (sf); - + CHECK_SYMBOL (selection_name); selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); @@ -409,10 +410,8 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) Lisp_Object prev_value; selection_time = long_to_cons ((unsigned long) time); - selection_data = Fcons (selection_name, - Fcons (selection_value, - Fcons (selection_time, - Fcons (selected_frame, Qnil)))); + selection_data = list4 (selection_name, selection_value, + selection_time, selected_frame); prev_value = assq_no_quit (selection_name, Vselection_alist); Vselection_alist = Fcons (selection_data, Vselection_alist); @@ -1014,7 +1013,7 @@ x_handle_selection_clear (struct input_event *event) } } UNBLOCK_INPUT; - + selection_symbol = x_atom_to_symbol (display, selection); local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); @@ -1758,7 +1757,8 @@ x_get_window_property_as_lisp_data (Display *display, Window window, static Lisp_Object -selection_data_to_lisp_data (Display *display, unsigned char *data, int size, Atom type, int format) +selection_data_to_lisp_data (Display *display, const unsigned char *data, + int size, Atom type, int format) { struct x_display_info *dpyinfo = x_display_info_for_display (display); @@ -2414,7 +2414,7 @@ Positive N means shift the values forward, negative means backward. */) Atom props[8]; Display *display; struct frame *sf = SELECTED_FRAME (); - + check_x (); if (! FRAME_X_P (sf)) @@ -2540,7 +2540,8 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format) Also see comment for selection_data_to_lisp_data above. */ Lisp_Object -x_property_data_to_lisp (struct frame *f, unsigned char *data, Atom type, int format, long unsigned int size) +x_property_data_to_lisp (struct frame *f, const unsigned char *data, + Atom type, int format, long unsigned int size) { return selection_data_to_lisp_data (FRAME_X_DISPLAY (f), data, size*format/8, type, format); @@ -2915,7 +2916,7 @@ A value of 0 means wait as long as necessary. This is initialized from the \"*selectionTimeout\" resource. */); x_selection_timeout = 0; - QPRIMARY = intern_c_string ("PRIMARY"); staticpro (&QPRIMARY); + /* QPRIMARY is defined in keyboard.c. */ QSECONDARY = intern_c_string ("SECONDARY"); staticpro (&QSECONDARY); QSTRING = intern_c_string ("STRING"); staticpro (&QSTRING); QINTEGER = intern_c_string ("INTEGER"); staticpro (&QINTEGER); diff --git a/src/xsettings.c b/src/xsettings.c index c02c850ac85..0d9c9cadb27 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -730,7 +730,8 @@ known style. Otherwise return image. */) if (EQ (Vtool_bar_style, Qimage) || EQ (Vtool_bar_style, Qtext) || EQ (Vtool_bar_style, Qboth) - || EQ (Vtool_bar_style, Qboth_horiz)) + || EQ (Vtool_bar_style, Qboth_horiz) + || EQ (Vtool_bar_style, Qtext_image_horiz)) return Vtool_bar_style; if (!NILP (current_tool_bar_style)) return current_tool_bar_style; diff --git a/src/xsmfns.c b/src/xsmfns.c index cb3773f7c40..0096110bd46 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -45,10 +45,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Avoid "differ in sign" warnings */ #define SSDATA(x) ((char *) SDATA (x)) -/* The user login name. */ - -extern Lisp_Object Vuser_login_name; - /* This is the event used when SAVE_SESSION_EVENT occurs. */ static struct input_event emacs_event; diff --git a/src/xterm.c b/src/xterm.c index ddc7a167684..e6bf82ab5a5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22,11 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Xt features made by Fred Pierresteguy. */ #include <config.h> - -/* On 4.3 these lose if they come after xterm.h. */ -/* Putting these at the beginning seems to be standard for other .c files. */ #include <signal.h> - #include <stdio.h> #include <setjmp.h> @@ -104,13 +100,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif #ifdef USE_LUCID -extern int xlwmenu_window_p (Widget w, Window window); -extern void xlwmenu_redisplay (Widget); -#endif - -#if defined (USE_X_TOOLKIT) || defined (USE_GTK) - -extern void free_frame_menubar (struct frame *); +#include "../lwlib/xlwmenu.h" #endif #ifdef USE_X_TOOLKIT @@ -294,23 +284,6 @@ static int input_signal_count; static int x_noop_count; -/* Initial values of argv and argc. */ - -extern char **initial_argv; -extern int initial_argc; - -extern Lisp_Object Vcommand_line_args, Vsystem_name; - -/* Tells if a window manager is present or not. */ - -extern Lisp_Object Vx_no_window_manager; - -extern Lisp_Object Qeql; - -/* A mask of extra modifier bits to put into every keyboard char. */ - -extern EMACS_INT extra_keyboard_modifiers; - /* The keysyms to use for the various modifiers. */ Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; @@ -330,9 +303,8 @@ Lisp_Object Qx_gtk_map_stock; /* Used in x_flush. */ -extern Lisp_Object Vinhibit_redisplay; - -extern XrmDatabase x_load_resources (Display *, char *, char *, char *); +extern XrmDatabase x_load_resources (Display *, const char *, const char *, + const char *); extern int x_bitmap_mask (FRAME_PTR, int); static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *); @@ -379,7 +351,7 @@ static int handle_one_xevent (struct x_display_info *, XEvent *, int *, struct input_event *); /* Don't declare this NO_RETURN because we want no interference with debugging failing X calls. */ -static SIGTYPE x_connection_closed (Display *, char *); +static SIGTYPE x_connection_closed (Display *, const char *); /* Flush display of frame F, or of all frames if F is null. */ @@ -2842,7 +2814,8 @@ x_clear_frame (struct frame *f) #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) /* Make sure scroll bars are redrawn. As they aren't redrawn by redisplay, do it here. */ - gtk_widget_queue_draw (FRAME_GTK_WIDGET (f)); + if (FRAME_GTK_WIDGET (f)) + gtk_widget_queue_draw (FRAME_GTK_WIDGET (f)); #endif XFlush (FRAME_X_DISPLAY (f)); @@ -4398,7 +4371,7 @@ xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) static void x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) { - char *scroll_bar_name = SCROLL_BAR_NAME; + const char *scroll_bar_name = SCROLL_BAR_NAME; BLOCK_INPUT; xg_create_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback), @@ -4531,8 +4504,11 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) /* We tried to allocate a color for the top/bottom shadow, and failed, so tell Xaw3d to use dithering instead. */ + /* But only if we have a small colormap. Xaw3d can allocate nice + colors itself. */ { - XtSetArg (av[ac], XtNbeNiceToColormap, True); + XtSetArg (av[ac], XtNbeNiceToColormap, + DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16); ++ac; } else @@ -7359,7 +7335,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file) Use ICON_NAME as the text. */ int -x_text_icon (struct frame *f, char *icon_name) +x_text_icon (struct frame *f, const char *icon_name) { if (FRAME_X_WINDOW (f) == 0) return 1; @@ -7422,7 +7398,7 @@ x_error_catcher (Display *display, XErrorEvent *error) Calling x_uncatch_errors resumes the normal error handling. */ -void x_check_errors (Display *dpy, char *format); +void x_check_errors (Display *dpy, const char *format); void x_catch_errors (Display *dpy) @@ -7464,7 +7440,7 @@ x_uncatch_errors (void) sprintf (a buffer, FORMAT, the x error message text) as the text. */ void -x_check_errors (Display *dpy, char *format) +x_check_errors (Display *dpy, const char *format) { /* Make sure to catch any errors incurred so far. */ XSync (dpy, False); @@ -7568,7 +7544,7 @@ x_fatal_error_signal (void) the text of an error message that lead to the connection loss. */ static SIGTYPE -x_connection_closed (Display *dpy, char *error_message) +x_connection_closed (Display *dpy, const char *error_message) { struct x_display_info *dpyinfo = x_display_info_for_display (dpy); Lisp_Object frame, tail; @@ -7643,7 +7619,6 @@ x_connection_closed (Display *dpy, char *error_message) /* If DPYINFO is null, this means we didn't open the display in the first place, so don't try to close it. */ { - extern void (*fatal_error_signal_hook) (void); fatal_error_signal_hook = x_fatal_error_signal; XtCloseDisplay (dpy); fatal_error_signal_hook = NULL; @@ -8610,7 +8585,8 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows) compute_fringe_widths (f, 0); - pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); + pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols) + + FRAME_TOOLBAR_WIDTH (f); pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); @@ -9010,7 +8986,6 @@ x_make_frame_visible (struct frame *f) /* It could be confusing if a real alarm arrives while processing the fake one. Turn it off and let the handler reset it. */ - extern void poll_for_input_1 (void); int old_poll_suppress_count = poll_suppress_count; poll_suppress_count = 1; poll_for_input_1 (); @@ -9278,14 +9253,7 @@ x_free_frame_resources (struct frame *f) #else /* !USE_X_TOOLKIT */ #ifdef USE_GTK - /* In the GTK version, tooltips are normal X - frames. We must check and free both types. */ - if (FRAME_GTK_OUTER_WIDGET (f)) - { - gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f)); - FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow below */ - FRAME_GTK_OUTER_WIDGET (f) = 0; - } + xg_free_frame_widgets (f); #endif /* USE_GTK */ if (FRAME_X_WINDOW (f)) @@ -10139,8 +10107,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) dpyinfo->connection = connection; { - extern int gray_bitmap_width, gray_bitmap_height; - extern char *gray_bitmap_bits; dpyinfo->gray = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, gray_bitmap_bits, diff --git a/src/xterm.h b/src/xterm.h index 5c1213d2bf1..972bfb50dc3 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -51,6 +51,10 @@ typedef GtkWidget *xt_or_gtk_widget; #define XSync(d, b) do { gdk_window_process_all_updates (); \ XSync (d, b); } while (0) +/* The GtkTooltip API came in 2.12, but gtk-enable-tooltips in 2.14. */ +#if GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION > 13 +#define USE_GTK_TOOLTIP +#endif #endif /* USE_GTK */ @@ -433,9 +437,15 @@ struct x_output if the menubar is turned off. */ int menubar_height; - /* Height of tool bar widget, in pixels. - Zero if not using an external tool bar. */ - int toolbar_height; + /* Height of tool bar widget, in pixels. top_height is used if tool bar + at top, bottom_height if tool bar is at the bottom. + Zero if not using an external tool bar or if tool bar is vertical. */ + int toolbar_top_height, toolbar_bottom_height; + + /* Width of tool bar widget, in pixels. left_width is used if tool bar + at left, right_width if tool bar is at the right. + Zero if not using an external tool bar or if tool bar is horizontal. */ + int toolbar_left_width, toolbar_right_width; /* The tiled border used when the mouse is out of the frame. */ Pixmap border_tile; @@ -480,6 +490,8 @@ struct x_output GtkWidget *edit_widget; /* The widget used for laying out widgets vertically. */ GtkWidget *vbox_widget; + /* The widget used for laying out widgets horizontally. */ + GtkWidget *hbox_widget; /* The menubar in this frame. */ GtkWidget *menubar_widget; /* The tool bar in this frame */ @@ -488,11 +500,20 @@ struct x_output GtkWidget *handlebox_widget; /* Non-zero if the tool bar is detached. */ int toolbar_detached; + /* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */ + int toolbar_in_hbox; /* The last size hints set. */ GdkGeometry size_hints; long hint_flags; -#endif + +#ifdef USE_GTK_TOOLTIP + GtkTooltip *ttip_widget; + GtkWidget *ttip_lbl; + GtkWindow *ttip_window; +#endif /* USE_GTK_TOOLTIP */ + +#endif /* USE_GTK */ /* If >=0, a bitmap index. The indicated bitmap is used for the icon. */ @@ -700,7 +721,15 @@ enum #define FRAME_FONT(f) ((f)->output_data.x->font) #define FRAME_FONTSET(f) ((f)->output_data.x->fontset) #define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height) -#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.x->toolbar_height) +#define FRAME_TOOLBAR_TOP_HEIGHT(f) ((f)->output_data.x->toolbar_top_height) +#define FRAME_TOOLBAR_BOTTOM_HEIGHT(f) \ + ((f)->output_data.x->toolbar_bottom_height) +#define FRAME_TOOLBAR_HEIGHT(f) \ + (FRAME_TOOLBAR_TOP_HEIGHT (f) + FRAME_TOOLBAR_BOTTOM_HEIGHT (f)) +#define FRAME_TOOLBAR_LEFT_WIDTH(f) ((f)->output_data.x->toolbar_left_width) +#define FRAME_TOOLBAR_RIGHT_WIDTH(f) ((f)->output_data.x->toolbar_right_width) +#define FRAME_TOOLBAR_WIDTH(f) \ + (FRAME_TOOLBAR_LEFT_WIDTH (f) + FRAME_TOOLBAR_RIGHT_WIDTH (f)) #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.x->baseline_offset) /* This gives the x_display_info structure for the display F is on. */ @@ -933,18 +962,21 @@ struct frame *check_x_frame (Lisp_Object); EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1); extern void x_free_gcs (struct frame *); +extern int gray_bitmap_width, gray_bitmap_height; +extern char *gray_bitmap_bits; /* From xrdb.c. */ -char *x_get_customization_string (XrmDatabase, char *, char *); -XrmDatabase x_load_resources (Display *, char *, char *, char *); -int x_get_resource (XrmDatabase, char *, char *, +char *x_get_customization_string (XrmDatabase, const char *, const char *); +XrmDatabase x_load_resources (Display *, const char *, const char *, + const char *); +int x_get_resource (XrmDatabase, const char *, const char *, XrmRepresentation, XrmValue *); void x_delete_display (struct x_display_info *); void x_make_frame_visible (struct frame *); void x_iconify_frame (struct frame *); void x_wm_set_size_hint (struct frame *, long, int); -int x_text_icon (struct frame *, char *); +int x_text_icon (struct frame *, const char *); int x_bitmap_icon (struct frame *, Lisp_Object); void x_set_window_size (struct frame *, int, int, int); void x_wm_set_window_state (struct frame *, int); @@ -954,10 +986,10 @@ int x_alloc_nearest_color (struct frame *, Colormap, XColor *); extern void cancel_mouse_face (struct frame *); extern void x_scroll_bar_clear (struct frame *); -extern int x_text_icon (struct frame *, char *); +extern int x_text_icon (struct frame *, const char *); extern int x_bitmap_icon (struct frame *, Lisp_Object); extern void x_catch_errors (Display *); -extern void x_check_errors (Display *, char *); +extern void x_check_errors (Display *, const char *); extern int x_had_errors_p (Display *); extern int x_catching_errors (void); extern void x_uncatch_errors (void); @@ -1018,7 +1050,7 @@ extern void x_fill_property_data (Display *, void *, int); extern Lisp_Object x_property_data_to_lisp (struct frame *, - unsigned char *, + const unsigned char *, Atom, int, unsigned long); @@ -1026,14 +1058,15 @@ extern Lisp_Object x_property_data_to_lisp (struct frame *, /* Defined in xfns.c */ extern struct x_display_info * check_x_display_info (Lisp_Object frame); +extern Lisp_Object x_get_focus_frame (struct frame *); #ifdef USE_GTK extern int xg_set_icon (struct frame *, Lisp_Object); -extern int xg_set_icon_from_xpm_data (struct frame *, char**); +extern int xg_set_icon_from_xpm_data (struct frame *, const char**); #endif /* USE_GTK */ extern void x_real_positions (struct frame *, int *, int *); -extern int defined_color (struct frame *, char *, XColor *, int); +extern int defined_color (struct frame *, const char *, XColor *, int); extern void x_set_border_pixel (struct frame *, int); extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); @@ -1042,16 +1075,17 @@ extern void create_frame_xic (struct frame *); extern void destroy_frame_xic (struct frame *); extern void xic_set_preeditarea (struct window *, int, int); extern void xic_set_statusarea (struct frame *); -extern void xic_set_xfontset (struct frame *, char *); +extern void xic_set_xfontset (struct frame *, const char *); extern int x_pixel_width (struct frame *); extern int x_pixel_height (struct frame *); extern int x_char_width (struct frame *); extern int x_char_height (struct frame *); extern int x_screen_planes (struct frame *); extern void x_sync (struct frame *); -extern int x_defined_color (struct frame *, char *, XColor *, int); +extern int x_defined_color (struct frame *, const char *, XColor *, int); #ifdef HAVE_X_I18N extern void free_frame_xic (struct frame *); +extern char * xic_create_fontsetname (const char *base_fontname, int motif); #endif extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object); @@ -1135,6 +1169,7 @@ enum xembed_accelerator /* Defined in xterm.c */ +extern Lisp_Object Qx_gtk_map_stock; extern void xembed_set_info (struct frame *f, enum xembed_info flags); extern void xembed_send_message (struct frame *f, Time time, enum xembed_message message, |