* emacsclient.c (set_local_socket): Use strchr, strrchr instead of
index, rindex.
* movemail.c (mail_spool_name, popmail): Likewise.
* pop.c (pop_list): Likewise.
* CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove.
* configure.in: Don't check for index and rindex, check for strchr
and strrchr. Define strchr and strrchr as index and rindex,
resp., in src/config.h if not available.
Ken Raeburn [Sun, 11 Jul 2010 06:59:55 +0000 (02:59 -0400)]
Make doprnt and related functions ANSI C compliant, with prototypes.
* doprnt.c (doprnt): Take a va_list argument instead of count and
pointer.
* eval.c (error): Change to a standard-C variadic function.
* xdisp.c (vmessage): Renamed from message, made static, and
changed to take a va_list argument.
(message): New variadic wrapper.
(message_nolog): Now a variadic function, calling vmessage.
* lisp.h: Include stdarg.h for va_list.
(doprnt, error, message, message_nolog): Decls updated.
* frame.c (make_frame): Initialize menu_bar_lines and
tool_bar_lines members.
(make_initial_frame, make_terminal_frame): Initialize
menu_bar_lines using value of menu-bar-mode.
* msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines.
Eli Zaretskii [Sat, 10 Jul 2010 13:26:44 +0000 (16:26 +0300)]
Unify the two branches, with and without subprocesses.
process.c: Reshuffle #include's. Condition some of the global
and static variables on `subprocesses'.
(hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
Leave only one implementation.
(Fget_buffer_process, Fprocess_inherit_coding_system_flag)
(kill_buffer_processes, Flist_system_processes)
(Fprocess_attributes, init_process, syms_of_process): Unify the
implementations for with subprocesses and without them.
Jan D [Fri, 9 Jul 2010 16:39:51 +0000 (18:39 +0200)]
Fix frame sizing for Lucid/Motif/Lesstif.
* xfns.c (x_window): Set borderWidth to 0 for pane and
EmacsFrame. Frame size calculation is wrong otherwise.
* xmenu.c (set_frame_menubar): Must realize menubar_widget to get the
correct size for Motif.
(free_frame_menubar): Call x_set_window_size to update frame size.
Michael Albinus [Fri, 9 Jul 2010 09:05:47 +0000 (11:05 +0200)]
* dbusbind.c (xd_initialize): Add new argument RAISE_ERROR, which
allows to suppress errors when polling in Emacs' main loop.
(Fdbus_init_bus, Fdbus_get_unique_name, Fdbus_call_method)
(Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
(Fdbus_method_error_internal, Fdbus_send_signal)
(xd_get_dispatch_status, xd_read_message, Fdbus_register_signal)
(Fdbus_register_method): Use it. (Bug#6579)
Eli Zaretskii [Thu, 8 Jul 2010 17:41:04 +0000 (20:41 +0300)]
Fix MS-DOS configury.
sed1v2.inp (stamp-oldxmenu): Don't edit out in `temacs:' target,
which doesn't exist.
sed2v2.inp (HAVE_MEMCPY): Don't edit, already defined on <sys/config.h>.
* lwlib.c (allocate_widget_info, lw_register_widget): Change from K&R
to prototype.
(lw_internal_update_other_instances, merge_widget_value): Reformat.
* xlwmenu.c (size_menu_item): Change from K&R to prototype.
Change label_width and height to int.
(draw_arrow, draw_shadow_rectangle, draw_shadow_rhombus)
(draw_separator, display_menu, fit_to_screen, motion_event_is_in_menu)
(map_event_to_widget_value): Reformat.
(display_menu_item): Change from K&R to prototype.
Dan Nicolaescu [Thu, 8 Jul 2010 03:03:52 +0000 (20:03 -0700)]
Simplify start_of_data, start_of_text and related code.
* src/mem-limits.h: Remove !emacs and _LIBC conditional code.
(start_of_data): Merge into start_of_data function.
* src/sysdep.c (start_of_text): Remove. Move simplified versions of
it in the only users: src/unexaix.c and unexec.c.
(read_input_waiting): Remove local declaration of quit_char.
(start, etext): Remove declarations.
(start_of_data): Merge with the version in mem-limits.h and move
to vm-limits.c.
* src/vm-limit.c (start_of_data): Merged and simplified version of the
code formerly in mem-limits.h and sysdep.c.
* src/unexec.c (start): New declaration, moved from sysdep.c.
(start_of_text): Simplified version of the code formerly in sysdep.c.
* unexaix.c (start_of_text): Simplified version of the code
formerly in sysdep.c.
* src/m/alpha.h (HAVE_TEXT_START): Remove.
(TEXT_START): Move ...
* src/unexalpha.c (TEXT_START): ... here.
* src/s/hpux10-20.h (TEXT_START): Remove.
* src/s/darwin.h (TEXT_START):
* src/m/mips.h (TEXT_START):
* src/m/macppc.h (HAVE_TEXT_START):
* src/m/m68k.h (TEXT_START):
* src/m/iris4d.h (TEXT_START):
* src/m/intel386.h (TEXT_START):
* src/m/ibmrs6000.h (TEXT_START):
* src/m/ia64.h (HAVE_TEXT_START):
* src/s/msdos.h (TEXT_START): Likewise.
Jan D [Wed, 7 Jul 2010 17:39:49 +0000 (19:39 +0200)]
If kbd_buffer is becoming full, stop reading until it drains (Bug#6571).
* keyboard.c (input_available_signal): Declare.
(kbd_buffer_nr_stored): New function.
(kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
(kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
(tty_read_avail_input): If input is on hold, return.
Don't read more that free slots in kbd_buffer (Bug#6571).
* process.c (kbd_is_on_hold): New variable.
(hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p): New
functions.
(wait_reading_process_output): If kbd_on_hold_p returns non-zero,
select on empty input mask.
(init_process): Initialize kbd_is_on_hold to 0.
* ispell.el (ispell-alternate-dictionary): Use file-readable-p.
Return nil if no word-list is found at default locations.
(ispell-complete-word-dict): Default to nil.
(ispell-command-loop): Use 'word-list' when using lookup-words.
(lookup-words): Use ispell-complete-word-dict or
ispell-alternate-dictionary. Check for word-list availability
and handle errors if needed with better messages (Bug#6539).
(ispell-complete-word): Use ispell-complete-word-dict or
ispell-alternate-dictionary.
Minor zone.el fixes for bug#6483.
Zone did not like the intangible newlines etc in the gomoku buffer.
* lisp/play/zone.el (top-level): Do not require timer, tabify, or cl.
(zone-shift-left): Ignore intangibility, and any errors from forward-char.
(zone-shift-right): Remove no-op end-of-line. Ignore intangibility.
(zone-pgm-putz-with-case): Use upcase-region rather than inserting,
deleting, and copying text properties.
(zone-line-specs, zone-pgm-stress): Check forward-line exit status.
(zone-pgm-rotate): Handle odd buffers like that of gomoku, where getting
to point-max is hard.
(zone-fret, zone-fill-out-screen): Replace cl's do with dotimes.
(zone-fill-out-screen): Ignore intangibility.
Dan Nicolaescu [Wed, 7 Jul 2010 02:49:37 +0000 (19:49 -0700)]
Make the function member of Lisp_Subr use standard C prototypes.
* src/lisp.h (struct Lisp_Subr): Use a union for the function member.
(DECL_ALIGN): Add a cast for the function.
* src/eval.c (Feval, Ffuncall): Use the proper type for each type
function call.
Dan Nicolaescu [Mon, 5 Jul 2010 16:29:35 +0000 (09:29 -0700)]
Convert function definitions and declarations to standard C.
* src/vm-limit.c (memory_warnings):
* src/keyboard.c (modify_event_symbol):
* src/floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
(round2, emacs_rint):
* src/process.c (send_process, old_sigpipe): Convert function
definitions and declarations to standard C.
* fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here.
Take account of bitmap offset.
(draw_window_fringes): Take account of window vscroll.
(update_window_fringes): Likewise. Extend top-aligned top indicator
or bottom-aligned bottom indicator to adjacent rows if it doesn't fit
in one row. Don't set redraw_fringe_bitmaps_p outside row comparison.
Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325).
Jan D [Mon, 5 Jul 2010 09:17:12 +0000 (11:17 +0200)]
Fix some bad prototypes and formatting after conversion from K&R declaration.
* lwlib/lwlib-Xaw.c: Include <ctype.h> for isdigit.
(fill_xft_data, set_text): Remove unused variable screen.
(draw_text): Cast bp to FcChar8*.
(find_xft_data): Return 0 if inst or xft_data is not set.
(wm_delete_window): Correct prototype. Initialize widget to 0
and return if widget is still 0 after loop.
* src/xsmfns.c (SSDATA): New macro.
(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
passed to strlen/strcpy/strcat.
(create_client_leader_window): Surround with #ifndef USE_GTK. Cast
7:th arg to XChangeProperty to (unsigned char *)
* atimer.c (start_atimer): Use EMACS_TIME, not struct timeval.
* sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval.
* xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME.
* dired.c (file_name_completion_stat): Use DIRENTRY, not struct dirent.
* fileio.c (read_non_regular, read_non_regular_quit): Pass Lisp_Object,
as required by internal_condition_case_1.
* regex.c (bcmp_translate): Use RE_TRANSLATE_TYPE, not Lisp_Object.
(analyse_first): Fix "const const".
Michael Albinus [Sun, 4 Jul 2010 09:52:57 +0000 (11:52 +0200)]
* net/dbus.el: Implement signal "PropertiesChanged" (from D-Bus 1.3.1).
(dbus-register-property): New optional argument EMITS-SIGNAL.
(dbus-property-handler): Send signal "PropertiesChanged" if requested.
Dan Nicolaescu [Sun, 4 Jul 2010 05:47:55 +0000 (22:47 -0700)]
Convert function definitions in lwlib files to standard C.
* lwlib/lwlib-Xaw.c: Convert function definitions to standard C.
* lwlib/lwlib-Xlw.c:
* lwlib/lwlib-utils.c:
* lwlib/lwlib.c:
* lwlib/lwlib.h:
* lwlib/xlwmenu.c: Likewise.
Eli Zaretskii [Sat, 3 Jul 2010 14:42:02 +0000 (17:42 +0300)]
Fix menu bar and colors on MS-DOS.
msdos.c (IT_set_frame_parameters): Set menu-bar-lines
according to menu-bar-mode, if not set in the frame parameters
or in default-frame-alist. Fix setting of colors in frames
other than the initial one. Fix reversal of colors when
`reverse' is specified in the frame parameters. Call
update_face_from_frame_parameter instead of
internal-set-lisp-face-attribute. Initialize screen colors
from initial_screen_colors[] when f->default_face_done_p is
zero, instead of depending on being called with
default-frame-alist as the alist argument.
xfaces.c (update_face_from_frame_parameter): Move out of
HAVE_WINDOW_SYSTEM portion. Condition window-system only parts
with HAVE_WINDOW_SYSTEM.
Eli Zaretskii [Sat, 3 Jul 2010 14:36:18 +0000 (17:36 +0300)]
Fix setting colors on MS-DOS frames.
msdos.c (IT_set_frame_parameters): Fix setting of colors in
frames other than the initial one. Fix reversal of colors when
`reverse' is specified in the frame parameters. Call
update_face_from_frame_parameter instead of
internal-set-lisp-face-attribute. Initialize screen colors from
initial_screen_colors[] when f->default_face_done_p is zero,
instead of depending on being called with default-frame-alist as
the alist argument.
xfaces.c (update_face_from_frame_parameter): Move out of
HAVE_WINDOW_SYSTEM portion. Condition window-system only parts
with HAVE_WINDOW_SYSTEM.
Michael Albinus [Sat, 3 Jul 2010 11:12:53 +0000 (13:12 +0200)]
* net/zeroconf.el (zeroconf-resolve-service)
(zeroconf-service-resolver-handler): Use
`dbus-byte-array-to-string'.
(zeroconf-publish-service): Use `dbus-string-to-byte-array'.
* lib-src/ebrowse.c (match_qualified_namespace_alias):
Pass sym* to find_namespace, not link*.
* lib-src/emacsclient.c (send_to_emacs, quote_argument): Arg s is HSOCKET.
* lib-src/sorted-doc.c (qsort_compare): New typedef.
(main): Use it to cast cmpdoc.
Simplify mouse-dragging implementation.
Now that DEL deletes active regions, we can handle it by using the
ordinary region instead of a separate overlay.
* mouse.el (mouse-drag-overlay): Variable deleted.
(mouse-move-drag-overlay, mouse-show-mark): Functions deleted.
(mouse--remap-link-click-p): New function.
(mouse-drag-track): Handle dragging by using temporary Transient
Mark mode, instead of a special overlay.
(mouse-kill-ring-save, mouse-save-then-kill): Don't call
mouse-show-mark.