From: kazuhiko Date: Tue, 21 Nov 2000 09:21:48 +0000 (+0000) Subject: import xemacs-21.2.37 X-Git-Tag: r21-2-37~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=caf1416adb403b6334ce635e58b269b6c653aa39;p=chise%2Fxemacs-chise.git.1 import xemacs-21.2.37 --- diff --git a/src/ChangeLog b/src/ChangeLog index 3c85350..d447fe9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,773 @@ +2000-11-14 Martin Buchholz + + * XEmacs 21.2.37 is released. + +2000-11-13 Yoshiki Hayashi + + * fileio.c (Finsert_file_contents_internal): UNGCPRO before return. + Add comments about discarded return value. + +2000-11-09 Yoshiki Hayashi + + * callint.c: + * event-stream.c: Fix comments. Remove some #if 0'ed part. + +2000-10-27 Andy Piper + + * gutter.c (Fset_default_gutter_position): default left and right + gutters to visible. + (calculate_gutter_size): calculate resonable heuristic for left + and right gutter sizes. + (specifier_vars_of_gutter): change left and right gutter sizes to + autodetect. + (calculate_gutter_size_from_display_lines): new function. + (output_gutter): check for resizing on left and right gutters. + (clear_gutter): don't special case top and left gutters. + (specifier_vars_of_gutter): use new signature for + set_specifier_caching. + + * glyphs-x.c (x_redisplay_widget): spelling fix. + * glyphs.c (specifier_vars_of_glyphs): + * menubar.c (specifier_vars_of_menubar): + * redisplay.c (specifier_vars_of_redisplay): + * toolbar.c (specifier_vars_of_toolbar): + * window.c (specifier_vars_of_window): + * scrollbar.c (specifier_vars_of_scrollbar): + (complex_vars_of_scrollbar): use new signature for + set_specifier_caching. + + * specifier.c (set_specifier_caching): include recompute flag. + (recompute_one_cached_specifier_in_window): always recompute if + flag set. + (recompute_one_cached_specifier_in_frame): ditto. + + * specifier.h (struct specifier_caching): add recompute flag. + +2000-10-24 Andy Piper + + * unexcw.c (copy_executable_and_dump_data_section): add new + BSS_PAD_SIZE so that we can re-instate a mini-bss. This keeps gdb + 5.0 happy. + +2000-11-06 Yoshiki Hayashi + + * console-x.h (x_device): New member modifier_release_time. + * event-Xt.c (x_handle_sticky_modifiers): + Bound interval modifier keys are sticky. + * event-stream.c (Vmodifier_keys_sticky_time): New variable. + * events.h: extern it. + +2000-11-06 Yoshiki Hayashi + + * cmdloop.c (Fcommand_loop_1): Just add C-g to event queue. + +2000-11-06 Yoshiki Hayashi + + * event-stream.c (execute_command_event): Preserve current_events + and the like when event is misc-user-event. + Inhibit quit during the call to maybe_echo_keys. + +2000-10-31 Yoshiki Hayashi + + * filelock.c (lock_buffer): Cope with kill-buffer. Don't create a + symlink when buffer is killed. + (inhibit_clash_detection): New variable. + +2000-10-30 Yoshiki Hayashi + + * console.c (Fset_input_method): Trigger redisplay on tty. + +2000-11-07 Martin Buchholz + + * process.c (Fprocess_status): Revert to previous behavior: + (process-status "nosuchprocess") ==> nil + +2000-11-06 Martin Buchholz + + * mule-charset.h (CHARSET_BY_LEADING_BYTE): + Work around another GCC 2.95.2 optimizer bug. + +2000-11-02 Martin Buchholz + + * process.c (Fget_process): Use LIST_LOOP_2. + (kill_buffer_processes): Use LIST_LOOP_2. + + * minibuf.c (Fall_completions): + Delete old non-functional code for FSF fourth argument. + + * frame.c (frame_matches_frame_spec): + Renamed from `frame_matches_frametype'. Update all callers. + (device_matches_device_spec): + Renamed from 'device_matches_console_spec'. Update all callers. + + * doc.c (Fsubstitute_command_keys): + Remove buffer overflow crash. Small code cleanups. + + * casetab.c (check_case_table): Simpler code. + + * window.c (Freplace_buffer_in_windows): + Give this the same WHICH-FRAMES and WHICH-DEVICES parameters + (and similar implementation) as Fdelete_windows_on. + Update all callers. + + * alloc.c (Fmake_list): + * alloc.c (make_vector): + * alloc.c (Fmake_vector): + * alloc.c (make_bit_vector): + * alloc.c (Fmake_bit_vector): + * alloc.c (Fbit_vector): + * alloc.c (Fmake_string): + * alloc.c (Fpurecopy): + * alloc.c (Fmemory_limit): + * buffer.c: + * buffer.c (Fget_buffer): + * buffer.c (Fkill_buffer): + * buffer.c (complex_vars_of_buffer): + * bytecode.c (Fcompiled_function_stack_depth): + * callint.c (Fprefix_numeric_value): + * event-stream.c: + * event-stream.c (Fread_key_sequence): + * casetab.c: + * casetab.c (Fcase_table_p): + * casetab.c (check_case_table): + * casetab.c (Fset_case_table): + * casetab.c (Fset_standard_case_table): + * chartab.c: + * chartab.c (Fchar_table_type): + * chartab.c (Freset_char_table): + * chartab.c (Fget_char_table): + * chartab.c (Fget_range_char_table): + * chartab.c (Fput_char_table): + * chartab.c (Fmap_char_table): + * chartab.c (Fcategory_table_p): + * chartab.c (Fcheck_category_at): + * chartab.c (Fchar_in_category_p): + * chartab.c (Fcategory_table): + * chartab.c (Fcopy_category_table): + * chartab.c (Fset_category_table): + * chartab.c (Fcategory_designator_p): + * chartab.c (Fcategory_table_value_p): + * cmds.c (Fdelete_char): + * cmds.c (Fdelete_backward_char): + * cmds.c (Fself_insert_command): + * cmds.c (Fself_insert_internal): + * console.c (Fvalid_console_type_p): + * console.c (Fcdfw_console): + * console.c (Fconsole_type): + * console.c (Fconsole_name): + * console.c (Fconsole_device_list): + * console.c (Fconsole_on_window_system_p): + * data.c: + * data.c (Feq): + * data.c (Fold_eq): + * data.c (Fsubr_interactive): + * data.c (Fchar_to_int): + * data.c (Fint_to_char): + * data.c (Fsetcar): + * data.c (Fsetcdr): + * data.c (Fnumber_to_string): + * data.c (Fstring_to_number): + * data.c (Frem): + * database.c (mark_database): + * database.c (finalize_database): + * database.c (Fdatabase_live_p): + * database.c (Fdatabasep): + * device-x.c (Fx_get_resource): + * device.c (Fdfw_device): + * dired.c: + * dired.c (Ffile_name_completion): + * dired.c (Ffile_name_all_completions): + * dired.c (Fuser_name_completion): + * dired.c (Fuser_name_completion_1): + * dired.c (Fuser_name_all_completions): + * doc.c (Fdocumentation): + * doc.c (Fdocumentation_property): + * doc.c (Fsubstitute_command_keys): + * editfns.c: + * editfns.c (Fchar_to_string): + * editfns.c (Fstring_to_char): + * editfns.c (Ftemp_directory): + * editfns.c (Finsert_char): + * editfns.c (Fbuffer_substring_no_properties): + * editfns.c (Fnarrow_to_region): + * editfns.c (Fchar_equal): + * editfns.c (Fchar_Equal): + * editfns.c (Ftranspose_regions): + * emacs.c (Fdump_emacs): + * eval.c (Fthrow): + * eval.c (Fcommand_execute): + * eval.c (Fautoload): + * eval.c (Fbacktrace): + * eval.c (Fbacktrace_frame): + * events.c: + * events.c (Fcopy_event): + * events.c (Fcharacter_to_event): + * events.c (Fevent_button): + * events.c (Fevent_process): + * extents.c: + * extents.c (Fnext_extent_change): + * extents.c (Fextent_property): + * faces.c (Ffacep): + * faces.c (Fmake_face): + * file-coding.c: + * file-coding.c (Fencode_shift_jis_char): + * file-coding.c (Fencode_big5_char): + * fileio.c (Ffile_name_directory): + * fileio.c (Ffile_name_nondirectory): + * fileio.c (Ffile_name_as_directory): + * fileio.c (Fdirectory_file_name): + * fileio.c (Ffile_truename): + * fileio.c (Fsubstitute_in_file_name): + * fileio.c (Ffile_modes): + * fileio.c (Fset_file_modes): + * fileio.c (Fset_default_file_modes): + * fileio.c (Fverify_visited_file_modtime): + * floatfns.c (Facos): + * floatfns.c (Fasin): + * floatfns.c (Fatan): + * floatfns.c (Fcos): + * floatfns.c (Fsin): + * floatfns.c (Ftan): + * floatfns.c (Fbessel_j0): + * floatfns.c (Fbessel_j1): + * floatfns.c (Fbessel_jn): + * floatfns.c (Fbessel_y0): + * floatfns.c (Fbessel_y1): + * floatfns.c (Fbessel_yn): + * floatfns.c (Ferf): + * floatfns.c (Ferfc): + * floatfns.c (Flog_gamma): + * floatfns.c (Fexp): + * floatfns.c (Fexpt): + * floatfns.c (Flog): + * floatfns.c (Flog10): + * floatfns.c (Fsqrt): + * floatfns.c (Fcube_root): + * floatfns.c (Facosh): + * floatfns.c (Fasinh): + * floatfns.c (Fatanh): + * floatfns.c (Fcosh): + * floatfns.c (Fsinh): + * floatfns.c (Ftanh): + * floatfns.c (Fabs): + * floatfns.c (Ffloat): + * floatfns.c (Flogb): + * floatfns.c (Fceiling): + * floatfns.c (Ffloor): + * floatfns.c (Fround): + * floatfns.c (Ftruncate): + * floatfns.c (Ffceiling): + * floatfns.c (Fffloor): + * floatfns.c (Ffround): + * floatfns.c (Fftruncate): + * fns.c (Fstring_equal): + * fns.c (Fstring_lessp): + * fns.c (concat2): + * fns.c (concat3): + * fns.c (vconcat2): + * fns.c (vconcat3): + * fns.c (Fsubstring): + * fns.c (Fassoc): + * fns.c (Fold_assoc): + * fns.c (assoc_no_quit): + * fns.c (Fassq): + * fns.c (Fold_assq): + * fns.c (assq_no_quit): + * fns.c (Frassoc): + * fns.c (Fold_rassoc): + * fns.c (Frassq): + * fns.c (Fold_rassq): + * fns.c (rassq_no_quit): + * fns.c (Fremassoc): + * fns.c (remassoc_no_quit): + * fns.c (Fremassq): + * fns.c (remassq_no_quit): + * fns.c (Fremrassoc): + * fns.c (Fremrassq): + * fns.c (remrassq_no_quit): + * fns.c (Fsort): + * fns.c (Fplist_get): + * fns.c (Fplist_put): + * fns.c (Fplist_remprop): + * fns.c (Fplist_member): + * fns.c (Flax_plist_get): + * fns.c (Flax_plist_put): + * fns.c (Flax_plist_remprop): + * fns.c (Flax_plist_member): + * fns.c (Fequal): + * fns.c (Fold_equal): + * fns.c (Frequire): + * fns.c (Fbase64_encode_region): + * fns.c (Fbase64_encode_string): + * fns.c (Fbase64_decode_region): + * frame.c: + * frame.c (frame_matches_frame_spec): + * frame.c (device_matches_device_spec): + * frame.c (next_frame): + * frame.c (previous_frame): + * frame.c (Fnext_frame): + * frame.c (Fprevious_frame): + * frame.c (Fframe_property): + * frame.c (Fset_frame_height): + * frame.c (Fset_frame_size): + * frame.h: + * glyphs.c: + * glyphs.c (if): + * glyphs.c (decode_error_behavior_flag): + * glyphs.c (Fmake_image_instance): + * indent.c (Findent_to): + * intl.c (Fignore_defer_gettext): + * keymap.c (Fkeymapp): + * keymap.c (Flookup_key): + * lread.c: + * lread.c (Fload_internal): + * lread.c (Feval_buffer): + * lread.c (Feval_region): + * macros.c (Fexecute_kbd_macro): + * marker.c (set_marker_internal): + * marker.c (Fset_marker): + * marker.c (set_marker_restricted): + * marker.c (Fcopy_marker): + * marker.c (noseeum_copy_marker): + * menubar.c: + * menubar.c (Fpopup_menu): + * minibuf.c: + * mule-charset.c (Fcharset_name): + * mule-charset.c (Fchar_charset): + * mule-charset.c (Fchar_octet): + * mule-charset.c (Fsplit_char): + * mule-wnnfns.c (Fwnn_open): + * mule-wnnfns.c (Fwnn_dict_comment): + * mule-wnnfns.c (Fwnn_quit_henkan): + * mule-wnnfns.c (Fwnn_word_toroku): + * mule-wnnfns.c (Fwnn_word_sakujo): + * mule-wnnfns.c (Fwnn_word_use): + * mule-wnnfns.c (Fwnn_hindo_set): + * objects.c: + * objects.c (Fmake_color_instance): + * objects.c (Fmake_font_instance): + * print.c (Fwrite_char): + * process.c: + * process.c (mark_process): + * process.c (print_process): + * process.c (get_process_from_usid): + * process.c (Fprocessp): + * process.c (Fprocess_live_p): + * process.c (Fget_process): + * process.c (Fget_buffer_process): + * process.c (get_process): + * process.c (Fprocess_id): + * process.c (Fprocess_name): + * process.c (Fprocess_command): + * process.c (init_process_io_handles): + * process.c (start_process_unwind): + * process.c (Fstart_process_internal): + * process.c (Fopen_multicast_group_internal): + * process.c (Fset_process_window_size): + * process.c (read_process_output): + * process.c (send_process): + * process.c (Fprocess_tty_name): + * process.c (Fset_process_buffer): + * process.c (Fprocess_buffer): + * process.c (Fprocess_mark): + * process.c (set_process_filter): + * process.c (Fset_process_filter): + * process.c (Fprocess_filter): + * process.c (Fprocess_send_region): + * process.c (Fprocess_send_string): + * process.c (exec_sentinel): + * process.c (Fset_process_sentinel): + * process.c (Fprocess_sentinel): + * process.c (status_notify): + * process.c (Fprocess_status): + * process.c (Fprocess_exit_status): + * process.c (process_send_signal): + * process.c (Fprocess_send_eof): + * process.c (deactivate_process): + * process.c (remove_process): + * process.c (Fdelete_process): + * process.c (kill_buffer_processes): + * process.c (Fprocess_kill_without_query): + * process.c (Fprocess_kill_without_query_p): + * rangetab.c: + * rangetab.c (Fget_range_table): + * rangetab.c (Fput_range_table): + * rangetab.c (Fremove_range_table): + * rangetab.c (Fclear_range_table): + * search.c: + * search.c (Fskip_chars_forward): + * search.c (Fskip_chars_backward): + * search.c (Fskip_syntax_forward): + * search.c (Fskip_syntax_backward): + * search.c (search_command): + * search.c (Freplace_match): + * search.c (Fregexp_quote): + * select.c (Fown_selection_internal): + * select.c (Fselection_owner_p): + * select.c (Fselection_exists_p): + * select.c (Fget_selection_internal): + * specifier.c: + * symbols.c: + * symbols.c (Fintern): + * symbols.c (Fintern_soft): + * symbols.c (Funintern): + * symbols.c (Fapropos_internal): + * symbols.c (Fset_default): + * syntax.c: + * syntax.c (Fsyntax_table_p): + * syntax.c (Fcopy_syntax_table): + * syntax.c (Fset_syntax_table): + * syntax.c (Fchar_syntax): + * syntax.c (syntax_match): + * syntax.c (Fmatching_paren): + * syntax.c (Fforward_word): + * syntax.c (scan_lists): + * syntax.c (Fscan_lists): + * syntax.c (Fscan_sexps): + * syntax.c (Fparse_partial_sexp): + * toolbar.c (Fcheck_toolbar_button_syntax): + * tooltalk.doc: + * window.c: + * window.c (Fwindowp): + * window.c (Fwindow_live_p): + * window.c (Fwindow_point): + * window.c (Fdelete_window): + * window.c (Fnext_window): + * window.c (Fprevious_window): + * window.c (Fother_window): + * window.c (window_loop): + * window.c (Fget_lru_window): + * window.c (Fsplit_window): + * window.c (Fenlarge_window): + * window.c (Fenlarge_window_pixels): + * window.c (Fshrink_window): + * window.c (Fshrink_window_pixels): + * window.c (change_window_height): + * window.c (Fwindow_configuration_p): + * window.c (Fcurrent_window_configuration): + * window.h: + * casefiddle.c (casify_object): + * casefiddle.c (Fupcase): + * casefiddle.c (Fdowncase): + * casefiddle.c (Fcapitalize): + * casefiddle.c (Fupcase_initials): + * casefiddle.c (casify_region_internal): + * casefiddle.c (casify_region): + * casefiddle.c (Fupcase_region): + * casefiddle.c (Fdowncase_region): + * casefiddle.c (Fcapitalize_region): + * casefiddle.c (Fupcase_initials_region): + * casefiddle.c (Fupcase_word): + * casefiddle.c (Fdowncase_word): + * casefiddle.c (Fcapitalize_word): + Docstring arglist/Texinfo fixes. See man/ChangeLog for details. + Replace 0 with '\0' when working with bytes. + Replace initial "(" with "\(" in docstrings. + +2000-11-01 Martin Buchholz + + * config.h.in: Handle alloca with Compaq C on Alpha Linux. + + * m/alpha.h: Let configure handle SYSTEM_MALLOC on Linux. + +2000-10-31 Martin Buchholz + + * eldap.c (print_ldap): 64-bit cleaner. Fixes warning. + +2000-10-30 Yoshiki Hayashi + + * doprnt.c (emacs_do_prnt_1): Format (format "%01.2d" 10) + correctly. + +2000-10-30 Yoshiki Hayashi + + * fileio.c (Vauto_save_list_file_prefix): Moved from startup.el. + (inhibit_auto_save_session): New variable. + (vars_of_fileio): Declare and initialize them. + * fileio.c (Fdo_auto_save): Don't create session file if + Vinhibit_auto_save_session or Vauto_save_list_file_prefix is non-nil. + +2000-10-31 Martin Buchholz + + * sgiplay.c (play_internal): C++ compilability. + * alloc.c (SWEEP_FIXED_TYPE_BLOCK): Remove unused var `SFTB_prev'. + * callproc.c (Fold_call_process_internal): + Remove unused vars `env', `first'. + * scrollbar.c (update_scrollbar_instance): + #### unused var `current_window'. + * redisplay-tty.c: Put currently unused vars insert_mode_on, + etc. within #ifdef NOT_YET. + * emacs.c: #### unused vars `initial_argc', `initial_argv'. + * dialog-x.c (dbox_descriptor_to_widget_value): ### unused var `title'. + * specifier.c (specifier_instance): + #### unused var `tag'. + Use WINDOW_BUFFER, FRAME_DEVICE instead of their expansion. + +2000-10-27 Martin Buchholz + + * fns.c (Fbutlast): + * fns.c (list_sort): + * fns.c (Ffillarray): + * fns.c (bytecode_nconc2): + * fns.c (Fnconc): + * fns.c (mapcar1): + * fns.c (Fmapconcat): + Be pedantically 64-bit correct. For the time when someone will + want to have a list with length > 2**32. + + * lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6): + Work around MIPSpro compiler bug. + + * process-unix.c (unix_kill_child_process): Add snarky comment. + * process-unix.c (try_to_initialize_subtty): Oops, `=' ==> `==' + + * config.h.in: Oops, _getpt ==> _getpty + +2000-10-26 Martin Buchholz + + * config.h.in: + * regex.c: + Use void*, not char*, as return type of alloca(). + + * alloc.c (free_marker): Side effect inside assert expression! + +2000-10-16 MIYASHITA Hisashi + + * mule-charset.c (Fset_charset_ccl_program): To check + if the given ccl program is valid, use setup_ccl_program() + instead of CHECK_VECTOR(). + (Fmake_charset): Likewise. + +2000-10-20 Golubev I. N. + + * faces.c (get_extent_fragment_face_cache_index): + Fix cachel.merged_faces memory leak. + +2000-10-14 MIYASHITA Hisashi + + * mule-ccl.c (ccl_driver): + Reset MSB of octets obtained by DECODE_SJIS + because of the incompatibility with Emacs. + (ccl_driver): + Set MSB of octets before passing them to + ENCODE_SJIS because of the incompatibility + with Emacs. + +2000-10-18 Daiki Ueno + + * lrecord.h (DECLARE_TYPECHECK_LRECORD): Abolish. + (DECLARE_LRECORD): Undo the last change. + (DECLARE_EXTERNAL_LRECORD): Expand typechecking stuff. + +2000-10-17 Daiki Ueno + + * lrecord.h (INIT_EXTERNAL_LRECORD_IMPLEMENTATION): Connect + the implementation to lrecord_implementations_table. + +2000-10-14 Daiki Ueno + + * lrecord.h (MAKE_EXTERNAL_LRECORD_IMPLEMENTATION): Don't set the + initial value of `lrecord_type_##c_name' and + `lrecord_##c_name.lrecord_type_index'; discard "const" qualifier. + (INIT_EXTERNAL_LRECORD_IMPLEMENTATION): New macro. + [ERROR_CHECK_TYPECHECK] (DECLARE_TYPECHECK_LRECORD): New macro. + [ERROR_CHECK_TYPECHECK] (DECLARE_LRECORD): Use it. + [ERROR_CHECK_TYPECHECK] (DECLARE_EXTERNAL_LRECORD): Use it. + +2000-10-17 Martin Buchholz + + * miscplay.c (sndcnv8S_2mono): + (sndcnv2monounsigned): + (sndcnvULaw_2linear): + (sndcnv16swap): + Remove implementation-defined behavior. + +2000-10-12 Martin Buchholz + + * input-method-xlib.c: Warning suppression. + +2000-10-05 MIYASHITA Hisashi + + * mule-ccl.c: Sync up with Emacs 21.0.90. + (ccl_driver): Disabled. + Do nothing. + (ccl_driver): + Likewise. + (ccl_driver[WriteMultibyteChar2]): Bug fix. + Use MAX_LEADING_BYTE_OFFICIAL_2 instead of + MIN_LEADING_BYTE_OFFICIAL_2 to check whether the + leading char belongs to official 2-dimensional charset. + (CCL_WRITE_CHAR): When CCL_MODE_ENCODING, + write the given character as is. Otherwise, + if it is a multibyte char, convert it by + non_ascii_set_charptr_emchar, then write it. + (CCL_WRITE_STRING): Likewise. + (ccl_get_compiled_code): New function. + (setup_ccl_program): When ccl_prog is invalid, + return -1. + (Fregister_code_conversion_map): New function. + (syms_of_mule_ccl): defsubr Fregister_code_conversion_map. + + * mule-ccl.h: Sync up with Emacs 21.0.90. + (Fregister_ccl_program): export it. + + * redisplay-msw.c (separate_textual_runs): + If ccl program is not valid, don't do ccl conversion. + + * redisplay-x.c (separate_textual_runs): Ditto. + + * file-coding.c (Fmake_coding_system): + When type is ccl and value is vector, register it + with a proper symbol. And checks whether the + given ccl program is valid. + (mule_decode): When calling ccl_driver, if src indicates + NULL pointer, set an empty string instead. + (mule_encode): Likewise. + +2000-10-11 Martin Buchholz + + The following large batch of changes gets us back to a state of + C++ compilability. Extbyte is now a char, which means that + Extbyte * and Bufbyte * cannot be freely interchanged - a win! + + * tooltalk.c (Fset_tooltalk_message_attribute): Type correctness. + + * sound.c (Fplay_sound): Type correctness. + + * select-x.c (hack_motif_clipboard_selection): Type correctness. + (x_get_window_property): Type correctness. + (receive_incremental_selection): unsigned char ==> Extbyte + (selection_data_to_lisp_data): unsigned char ==> Extbyte + (Fx_get_cutbuffer_internal): unsigned char ==> Extbyte + (Fx_store_cutbuffer_internal): Type correctness. + + * process-unix.c (try_to_initialize_subtty): Type correctness. + + * objects-x.c (x_print_color_instance): Type correctness. + (x_print_font_instance): Type correctness. + (x_list_fonts): SExtbyte ==> Extbyte. + (valid_x_font_name_p): SExtbyte ==> Extbyte. + (x_find_charset_font): SExtbyte ==> Extbyte. + Use TO_INTERNAL_FORMAT. build_string ==> make_string. + (truename_via_XListFonts): SExtbyte ==> Extbyte. + (x_font_instance_properties): Use TO_INTERNAL_FORMAT. + Use bufbyte_strcmp. + + * mule-charset.h (LEADING_BYTE_PREFIX_P): unsigned char ==> Bufbyte + (PRIVATE_LEADING_BYTE_PREFIX): Add paranoia cast. + (BYTE_ASCII_P): Use bit ops for char-signedness safety. + (BYTE_C0_P): Use bit ops for char-signedness safety. + (BYTE_C1_P): Use bit ops for char-signedness safety. + (CHARSET_BY_LEADING_BYTE): + (CHARSET_BY_ATTRIBUTES): + Always use inline function. + Use type_checking_assert. + Hide chlook. + + * mule-charset.c (non_ascii_charptr_copy_char): + Modify to work with both ASCII and non-ASCII characters. + Improve docs and variable names. + Replace over-clever fall-through switch with a simple loop. + (Lstream_get_emchar_1): + Replace over-clever fall-through switch with a simple loop. + + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + Warning suppression. + + * lstream.h (Lstream_get_emchar): BYTE_ASCII_P cannot be used on + the return value of Lstream_getc, which could be EOF as well. + + * lstream.c (Lstream_raw_read): Now returns ssize_t, not int. + + * lisp.h: Make Extbyte a char, not unsigned char, so that external + APIs can be used on Extbytes without casts. Risky! + (SExtbyte): Remove. + (UExtbyte): Remove. + + * input-method-xlib.c (XIM_init_device): + Use Xlib.h instead of IntrinsicP.h. + Use HAVE_XREGISTERIMINSTANTIATECALLBACK instead of THIS_IS_X11R6, + which will break in X11R7. + Use XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE, + to call XRegisterIMInstantiateCallback with correct types. + + * gui-x.c (button_item_to_widget_value): Type correctness. + + * glyphs.c (bitmap_to_lisp_data): Type correctness. + + * glyphs-x.c (pixmap_from_xbm_inline): Type correctness. + (xbm_instantiate_1): Type correctness. + (BUILD_GLYPH_INST): Type correctness. + + * fileio.c (Fsubstitute_in_file_name): Type correctness. + + * file-coding.c: + (decode_coding_sjis): + (decode_coding_big5): + (decode_coding_ucs4): + (decode_coding_utf8): + (decode_coding_iso2022): + (decode_coding_no_conversion): + Make all decoding functions take an Extbyte * arg. + (encode_coding_sjis): + (encode_coding_big5): + (encode_coding_ucs4): + (encode_coding_utf8): + (encode_coding_iso2022): + (encode_coding_no_conversion): + Make all encoding functions take a Bufbyte * arg. + Use size_t instead of unsigned int for memory sizes. + Only cast to unsigned char whenever dereferencing Extbyte *. + + * doc.c (unparesseuxify_doc_string): Type correctness. + + * console-x.c (split_up_display_spec): + Rewrite without using details of internal string representation. + (x_semi_canonicalize_device_connection): Type correctness. + + * config.h.in: + (HAVE_XREGISTERIMINSTANTIATECALLBACK): New. + (XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE): New. + (HAVE_XFREE386): Removed. + + * buffer.h (DEC_CHARPTR): `const' correctness. + (bufbyte_strcmp): New. + (bufbyte_memcmp): New. + + * buffer.c (dfc_convert_to_internal_format): Extbyte ==> Bufbyte + + * buffer.h (XCHAR_OR_CHAR_INT): + Always use inline function. + Remove redundant type checking assert() - XINT will abort quite nicely. + +2000-10-03 Yoshiki Hayashi + + * search.c (Freplace_match): Set newtext to an empty string. + +2000-10-10 Martin Buchholz + + * s/decosf1-3.h: Remove #include of stropts.h + * s/ptx.h: Remove #include of stropts.h + * s/usg5-4.h: Remove #include of stropts.h + * sysproc.h: + * config.h.in: + Use stropts.h, not sys/stropts.h. + Use strtio.h, not sys/strtio.h. + 2000-10-04 Martin Buchholz * XEmacs 21.2.36 is released. +2000-09-21 Andy Piper + + * glyphs-x.c (x_redisplay_widget): make sure non-structural + changes still involve copying the widget tree. + (update_widget_face): make sure a change is register in the widget + tree. Call update_tab_widget_face appropriately. + (update_tab_widget_face): ditto. + (x_tab_control_redisplay): make sure non-structural changes still + involve copying the widget tree. + 2000-08-31 Daiki Ueno * lread.c (locate_file): Check the path element is non-nil. @@ -6190,7 +6956,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * glyphs.h: Prototyped it. * redisplay.c (add_glyph_rune): Call it. - (redisplay_window): Reset glyphs cachels when frame faces has + (redisplay_window): Reset glyphs cachels when frame faces have changed, thus forcing recomputation of built-in border glyphs. 2000-01-30 Martin Buchholz diff --git a/src/buffer.h b/src/buffer.h index 3d20fe2..e0e0cfa 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -408,7 +408,7 @@ for (mps_bufcons = Qunbound, \ #define REAL_INC_CHARPTR(ptr) \ ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))) -#define REAL_INC_CHARBYTIND(ptr,pos) \ +#define REAL_INC_CHARBYTIND(ptr, pos) \ (pos += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))) #define REAL_DEC_CHARPTR(ptr) do { \ @@ -421,9 +421,9 @@ for (mps_bufcons = Qunbound, \ REAL_INC_CHARPTR (ptr); \ } while (0) -#define INC_CHARBYTIND(ptr,pos) do { \ - ASSERT_VALID_CHARPTR (ptr); \ - REAL_INC_CHARBYTIND (ptr,pos); \ +#define INC_CHARBYTIND(ptr, pos) do { \ + ASSERT_VALID_CHARPTR (ptr); \ + REAL_INC_CHARBYTIND (ptr, pos); \ } while (0) #define DEC_CHARPTR(ptr) do { \ @@ -432,11 +432,11 @@ for (mps_bufcons = Qunbound, \ REAL_DEC_CHARPTR (dc_ptr2); \ assert (dc_ptr1 - dc_ptr2 == \ REP_BYTES_BY_FIRST_BYTE (*dc_ptr2)); \ - (ptr) = dc_ptr2; \ + (ptr) = (Bufbyte *) dc_ptr2; \ } while (0) #else /* ! ERROR_CHECK_BUFPOS */ -#define INC_CHARBYTIND(ptr,pos) REAL_INC_CHARBYTIND (ptr,pos) +#define INC_CHARBYTIND(ptr, pos) REAL_INC_CHARBYTIND (ptr, pos) #define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr) #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr) #endif /* ! ERROR_CHECK_BUFPOS */ @@ -490,7 +490,7 @@ charptr_n_addr (const Bufbyte *ptr, Charcount offset) Emchar non_ascii_charptr_emchar (const Bufbyte *ptr); Bytecount non_ascii_set_charptr_emchar (Bufbyte *ptr, Emchar c); -Bytecount non_ascii_charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); +Bytecount non_ascii_charptr_copy_char (const Bufbyte *src, Bufbyte *dst); INLINE_HEADER Emchar charptr_emchar (const Bufbyte *ptr); INLINE_HEADER Emchar @@ -510,14 +510,16 @@ set_charptr_emchar (Bufbyte *ptr, Emchar x) non_ascii_set_charptr_emchar (ptr, x); } +/* Copy the character pointed to by SRC into DST. + Return the number of bytes copied. */ INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2); +charptr_copy_char (const Bufbyte *src, Bufbyte *dst); INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *ptr, Bufbyte *ptr2) +charptr_copy_char (const Bufbyte *src, Bufbyte *dst) { - return BYTE_ASCII_P (*ptr) ? - simple_charptr_copy_char (ptr, ptr2) : - non_ascii_charptr_copy_char (ptr, ptr2); + return BYTE_ASCII_P (*src) ? + simple_charptr_copy_char (src, dst) : + non_ascii_charptr_copy_char (src, dst); } #else /* not MULE */ @@ -557,22 +559,13 @@ valid_char_p (Emchar ch) #define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x)) -#ifdef ERROR_CHECK_TYPECHECK - INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj) { - assert (CHAR_OR_CHAR_INTP (obj)); return CHARP (obj) ? XCHAR (obj) : XINT (obj); } -#else - -#define XCHAR_OR_CHAR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj)) - -#endif - #define CHECK_CHAR_COERCE_INT(x) do { \ if (CHARP (x)) \ ; \ @@ -1063,8 +1056,8 @@ Bufpos bytind_to_bufpos (struct buffer *buf, Bytind x); DATA, (ptr, len), // input data is a fixed buffer of size len ALLOCA, (ptr, len), // output data is in a alloca()ed buffer of size len MALLOC, (ptr, len), // output data is in a malloc()ed buffer of size len - C_STRING_ALLOCA, ptr, // equivalent to ALLOCA (ptr, len_ignored) on output. - C_STRING_MALLOC, ptr, // equivalent to MALLOC (ptr, len_ignored) on output. + C_STRING_ALLOCA, ptr, // equivalent to ALLOCA (ptr, len_ignored) on output + C_STRING_MALLOC, ptr, // equivalent to MALLOC (ptr, len_ignored) on output C_STRING, ptr, // equivalent to DATA, (ptr, strlen (ptr) + 1) on input LISP_STRING, string, // input or output is a Lisp_Object of type string LISP_BUFFER, buffer, // output is written to (point) in lisp buffer @@ -1787,4 +1780,60 @@ UPCASE (struct buffer *buf, Emchar ch) #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch) +/************************************************************************/ +/* Lisp string representation convenience functions */ +/************************************************************************/ +/* Because the representation of internally formatted data is subject to change, + It's bad style to do something like strcmp (XSTRING_DATA (s), "foo") + Instead, use the portable: bufbyte_strcmp (XSTRING_DATA (s), "foo") + or bufbyte_memcmp (XSTRING_DATA (s), "foo", 3) */ + +/* Like strcmp, except first arg points at internally formatted data, + while the second points at a string of only ASCII chars. */ +INLINE_HEADER int +bufbyte_strcmp (const Bufbyte *bp, const char *ascii_string); +INLINE_HEADER int +bufbyte_strcmp (const Bufbyte *bp, const char *ascii_string) +{ +#ifdef MULE + while (1) + { + int diff; + type_checking_assert (BYTE_ASCII_P (*ascii_string)); + if ((diff = charptr_emchar (bp) - *(Bufbyte *) ascii_string) != 0) + return diff; + if (*ascii_string == '\0') + return 0; + ascii_string++; + INC_CHARPTR (bp); + } +#else + return strcmp ((char *)bp, ascii_string); +#endif +} + + +/* Like memcmp, except first arg points at internally formatted data, + while the second points at a string of only ASCII chars. */ +INLINE_HEADER int +bufbyte_memcmp (const Bufbyte *bp, const char *ascii_string, size_t len); +INLINE_HEADER int +bufbyte_memcmp (const Bufbyte *bp, const char *ascii_string, size_t len) +{ +#ifdef MULE + while (len--) + { + int diff = charptr_emchar (bp) - *(Bufbyte *) ascii_string; + type_checking_assert (BYTE_ASCII_P (*ascii_string)); + if (diff != 0) + return diff; + ascii_string++; + INC_CHARPTR (bp); + } + return 0; +#else + return memcmp (bp, ascii_string, len); +#endif +} + #endif /* INCLUDED_buffer_h_ */ diff --git a/src/bytecode.c b/src/bytecode.c index 5bbb326..8a2c963 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -2264,7 +2264,7 @@ Return the constants vector of the compiled-function object FUNCTION. } DEFUN ("compiled-function-stack-depth", Fcompiled_function_stack_depth, 1, 1, 0, /* -Return the max stack depth of the compiled-function object FUNCTION. +Return the maximum stack depth of the compiled-function object FUNCTION. */ (function)) { diff --git a/src/chartab.c b/src/chartab.c index c2d1324..8743a77 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -468,12 +468,12 @@ assigned values are -- all characters -- a single character -To create a char table, use `make-char-table'. To modify a char -table, use `put-char-table' or `remove-char-table'. To retrieve the -value for a particular character, use `get-char-table'. See also -`map-char-table', `clear-char-table', `copy-char-table', -`valid-char-table-type-p', `char-table-type-list', `valid-char-table-value-p', -and `check-char-table-value'. +To create a char table, use `make-char-table'. +To modify a char table, use `put-char-table' or `remove-char-table'. +To retrieve the value for a particular character, use `get-char-table'. +See also `map-char-table', `clear-char-table', `copy-char-table', +`valid-char-table-type-p', `char-table-type-list', +`valid-char-table-value-p', and `check-char-table-value'. */ (object)) { @@ -533,13 +533,13 @@ sorts of values. The different char table types are } DEFUN ("char-table-type", Fchar_table_type, 1, 1, 0, /* -Return the type of char table TABLE. +Return the type of CHAR-TABLE. See `valid-char-table-type-p'. */ - (table)) + (char_table)) { - CHECK_CHAR_TABLE (table); - return char_table_type_to_symbol (XCHAR_TABLE (table)->type); + CHECK_CHAR_TABLE (char_table); + return char_table_type_to_symbol (XCHAR_TABLE (char_table)->type); } void @@ -559,14 +559,14 @@ fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) } DEFUN ("reset-char-table", Freset_char_table, 1, 1, 0, /* -Reset a char table to its default state. +Reset CHAR-TABLE to its default state. */ - (table)) + (char_table)) { Lisp_Char_Table *ct; - CHECK_CHAR_TABLE (table); - ct = XCHAR_TABLE (table); + CHECK_CHAR_TABLE (char_table); + ct = XCHAR_TABLE (char_table); switch (ct->type) { @@ -666,18 +666,18 @@ copy_char_table_entry (Lisp_Object entry) #endif /* MULE */ DEFUN ("copy-char-table", Fcopy_char_table, 1, 1, 0, /* -Make a new char table which is a copy of OLD-TABLE. +Return a new char table which is a copy of CHAR-TABLE. It will contain the same values for the same characters and ranges -as OLD-TABLE. The values will not themselves be copied. +as CHAR-TABLE. The values will not themselves be copied. */ - (old_table)) + (char_table)) { Lisp_Char_Table *ct, *ctnew; Lisp_Object obj; int i; - CHECK_CHAR_TABLE (old_table); - ct = XCHAR_TABLE (old_table); + CHECK_CHAR_TABLE (char_table); + ct = XCHAR_TABLE (char_table); ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); ctnew->type = ct->type; @@ -842,32 +842,29 @@ get_char_table (Emchar ch, Lisp_Char_Table *ct) DEFUN ("get-char-table", Fget_char_table, 2, 2, 0, /* -Find value for char CH in TABLE. +Find value for CHARACTER in CHAR-TABLE. */ - (ch, table)) + (character, char_table)) { - Lisp_Char_Table *ct; - - CHECK_CHAR_TABLE (table); - ct = XCHAR_TABLE (table); - CHECK_CHAR_COERCE_INT (ch); + CHECK_CHAR_TABLE (char_table); + CHECK_CHAR_COERCE_INT (character); - return get_char_table (XCHAR (ch), ct); + return get_char_table (XCHAR (character), XCHAR_TABLE (char_table)); } DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /* -Find value for a range in TABLE. +Find value for a range in CHAR-TABLE. If there is more than one value, return MULTI (defaults to nil). */ - (range, table, multi)) + (range, char_table, multi)) { Lisp_Char_Table *ct; struct chartab_range rainj; if (CHAR_OR_CHAR_INTP (range)) - return Fget_char_table (range, table); - CHECK_CHAR_TABLE (table); - ct = XCHAR_TABLE (table); + return Fget_char_table (range, char_table); + CHECK_CHAR_TABLE (char_table); + ct = XCHAR_TABLE (char_table); decode_char_table_range (range, &rainj); switch (rainj.type) @@ -1138,7 +1135,7 @@ put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, } DEFUN ("put-char-table", Fput_char_table, 3, 3, 0, /* -Set the value for chars in RANGE to be VAL in TABLE. +Set the value for chars in RANGE to be VALUE in CHAR-TABLE. RANGE specifies one or more characters to be affected and should be one of the following: @@ -1149,20 +1146,20 @@ one of the following: (only allowed when Mule support is present) -- A single character -VAL must be a value appropriate for the type of TABLE. +VALUE must be a value appropriate for the type of CHAR-TABLE. See `valid-char-table-type-p'. */ - (range, val, table)) + (range, value, char_table)) { Lisp_Char_Table *ct; struct chartab_range rainj; - CHECK_CHAR_TABLE (table); - ct = XCHAR_TABLE (table); - check_valid_char_table_value (val, ct->type, ERROR_ME); + CHECK_CHAR_TABLE (char_table); + ct = XCHAR_TABLE (char_table); + check_valid_char_table_value (value, ct->type, ERROR_ME); decode_char_table_range (range, &rainj); - val = canonicalize_char_table_value (val, ct->type); - put_char_table (ct, &rainj, val); + value = canonicalize_char_table_value (value, ct->type); + put_char_table (ct, &rainj, value); return Qnil; } @@ -1440,22 +1437,22 @@ slow_map_char_table_fun (struct chartab_range *range, } DEFUN ("map-char-table", Fmap_char_table, 2, 3, 0, /* -Map FUNCTION over entries in TABLE, calling it with two args, +Map FUNCTION over entries in CHAR-TABLE, calling it with two args, each key and value in the table. RANGE specifies a subrange to map over and is in the same format as the RANGE argument to `put-range-table'. If omitted or t, it defaults to the entire table. */ - (function, table, range)) + (function, char_table, range)) { Lisp_Char_Table *ct; struct slow_map_char_table_arg slarg; struct gcpro gcpro1, gcpro2; struct chartab_range rainj; - CHECK_CHAR_TABLE (table); - ct = XCHAR_TABLE (table); + CHECK_CHAR_TABLE (char_table); + ct = XCHAR_TABLE (char_table); if (NILP (range)) range = Qt; decode_char_table_range (range, &rainj); @@ -1572,7 +1569,7 @@ chartab_instantiate (Lisp_Object data) /************************************************************************/ DEFUN ("category-table-p", Fcategory_table_p, 1, 1, 0, /* -Return t if ARG is a category table. +Return t if OBJECT is a category table. A category table is a type of char table used for keeping track of categories. Categories are used for classifying characters for use in regexps -- you can refer to a category rather than having to use @@ -1595,21 +1592,21 @@ whether the character is in that category. Special Lisp functions are provided that abstract this, so you do not have to directly manipulate bit vectors. */ - (obj)) + (object)) { - return (CHAR_TABLEP (obj) && - XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_CATEGORY) ? + return (CHAR_TABLEP (object) && + XCHAR_TABLE_TYPE (object) == CHAR_TABLE_TYPE_CATEGORY) ? Qt : Qnil; } static Lisp_Object -check_category_table (Lisp_Object obj, Lisp_Object def) +check_category_table (Lisp_Object object, Lisp_Object default_) { - if (NILP (obj)) - obj = def; - while (NILP (Fcategory_table_p (obj))) - obj = wrong_type_argument (Qcategory_table_p, obj); - return obj; + if (NILP (object)) + object = default_; + while (NILP (Fcategory_table_p (object))) + object = wrong_type_argument (Qcategory_table_p, object); + return object; } int @@ -1632,32 +1629,33 @@ check_category_char (Emchar ch, Lisp_Object table, } DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* -Return t if category of a character at POS includes DESIGNATOR, -else return nil. Optional third arg specifies which buffer -\(defaulting to current), and fourth specifies the CATEGORY-TABLE, -\(defaulting to the buffer's category table). +Return t if category of the character at POSITION includes DESIGNATOR. +Optional third arg BUFFER specifies which buffer to use, and defaults +to the current buffer. +Optional fourth arg CATEGORY-TABLE specifies the category table to +use, and defaults to BUFFER's category table. */ - (pos, designator, buffer, category_table)) + (position, designator, buffer, category_table)) { Lisp_Object ctbl; Emchar ch; unsigned int des; struct buffer *buf = decode_buffer (buffer, 0); - CHECK_INT (pos); + CHECK_INT (position); CHECK_CATEGORY_DESIGNATOR (designator); des = XCHAR (designator); ctbl = check_category_table (category_table, Vstandard_category_table); - ch = BUF_FETCH_CHAR (buf, XINT (pos)); + ch = BUF_FETCH_CHAR (buf, XINT (position)); return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; } DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /* -Return t if category of character CHR includes DESIGNATOR, else nil. -Optional third arg specifies the CATEGORY-TABLE to use, -which defaults to the system default table. +Return t if category of CHARACTER includes DESIGNATOR, else nil. +Optional third arg CATEGORY-TABLE specifies the category table to use, +and defaults to the standard category table. */ - (chr, designator, category_table)) + (character, designator, category_table)) { Lisp_Object ctbl; Emchar ch; @@ -1665,16 +1663,15 @@ which defaults to the system default table. CHECK_CATEGORY_DESIGNATOR (designator); des = XCHAR (designator); - CHECK_CHAR (chr); - ch = XCHAR (chr); + CHECK_CHAR (character); + ch = XCHAR (character); ctbl = check_category_table (category_table, Vstandard_category_table); return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; } DEFUN ("category-table", Fcategory_table, 0, 1, 0, /* -Return the current category table. -This is the one specified by the current buffer, or by BUFFER if it -is non-nil. +Return BUFFER's current category table. +BUFFER defaults to the current buffer. */ (buffer)) { @@ -1691,48 +1688,48 @@ This is the one used for new buffers. } DEFUN ("copy-category-table", Fcopy_category_table, 0, 1, 0, /* -Construct a new category table and return it. -It is a copy of the TABLE, which defaults to the standard category table. +Return a new category table which is a copy of CATEGORY-TABLE. +CATEGORY-TABLE defaults to the standard category table. */ - (table)) + (category_table)) { if (NILP (Vstandard_category_table)) return Fmake_char_table (Qcategory); - table = check_category_table (table, Vstandard_category_table); - return Fcopy_char_table (table); + category_table = + check_category_table (category_table, Vstandard_category_table); + return Fcopy_char_table (category_table); } DEFUN ("set-category-table", Fset_category_table, 1, 2, 0, /* -Select a new category table for BUFFER. -One argument, a category table. +Select CATEGORY-TABLE as the new category table for BUFFER. BUFFER defaults to the current buffer if omitted. */ - (table, buffer)) + (category_table, buffer)) { struct buffer *buf = decode_buffer (buffer, 0); - table = check_category_table (table, Qnil); - buf->category_table = table; + category_table = check_category_table (category_table, Qnil); + buf->category_table = category_table; /* Indicate that this buffer now has a specified category table. */ buf->local_var_flags |= XINT (buffer_local_flags.category_table); - return table; + return category_table; } DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /* -Return t if ARG is a category designator (a char in the range ' ' to '~'). +Return t if OBJECT is a category designator (a char in the range ' ' to '~'). */ - (obj)) + (object)) { - return CATEGORY_DESIGNATORP (obj) ? Qt : Qnil; + return CATEGORY_DESIGNATORP (object) ? Qt : Qnil; } DEFUN ("category-table-value-p", Fcategory_table_value_p, 1, 1, 0, /* -Return t if ARG is a category table value. +Return t if OBJECT is a category table value. Valid values are nil or a bit vector of size 95. */ - (obj)) + (object)) { - return CATEGORY_TABLE_VALUEP (obj) ? Qt : Qnil; + return CATEGORY_TABLE_VALUEP (object) ? Qt : Qnil; } @@ -1882,7 +1879,7 @@ Emacs treats a sequence of word constituent characters as a single word (i.e. finds no word boundary between them) iff they belongs to the same charset. But, exceptions are allowed in the following cases. -(1) The case that characters are in different charsets is controlled +\(1) The case that characters are in different charsets is controlled by the variable `word-combining-categories'. Emacs finds no word boundary between characters of different charsets @@ -1896,7 +1893,7 @@ For instance, to tell that ASCII characters and Latin-1 characters can form a single word, the element `(?l . ?l)' should be in this list because both characters have the category `l' (Latin characters). -(2) The case that character are in the same charset is controlled by +\(2) The case that character are in the same charset is controlled by the variable `word-separating-categories'. Emacs find a word boundary between characters of the same charset diff --git a/src/console-x.h b/src/console-x.h index 85bc5a3..cf2697c 100644 --- a/src/console-x.h +++ b/src/console-x.h @@ -181,6 +181,7 @@ struct x_device unsigned int need_to_add_mask, down_mask; KeyCode last_downkey; Time release_time; + Time modifier_release_time; }; #define DEVICE_X_DATA(d) DEVICE_TYPE_DATA (d, x) diff --git a/src/data.c b/src/data.c index a0f2445..fca3e0e 100644 --- a/src/data.c +++ b/src/data.c @@ -182,9 +182,9 @@ sign_extend_lisp_int (EMACS_INT num) DEFUN ("eq", Feq, 2, 2, 0, /* Return t if the two args are the same Lisp object. */ - (obj1, obj2)) + (object1, object2)) { - return EQ_WITH_EBOLA_NOTICE (obj1, obj2) ? Qt : Qnil; + return EQ_WITH_EBOLA_NOTICE (object1, object2) ? Qt : Qnil; } DEFUN ("old-eq", Fold_eq, 2, 2, 0, /* @@ -199,10 +199,10 @@ functions with `old-foo' equivalents. Do not use this function! */ - (obj1, obj2)) + (object1, object2)) { /* #### blasphemy */ - return HACKEQ_UNSAFE (obj1, obj2) ? Qt : Qnil; + return HACKEQ_UNSAFE (object1, object2) ? Qt : Qnil; } DEFUN ("null", Fnull, 1, 1, 0, /* @@ -357,7 +357,7 @@ or nil if it takes an arbitrary number of arguments or is a special form. } DEFUN ("subr-interactive", Fsubr_interactive, 1, 1, 0, /* -Return the interactive spec of the subr object, or nil. +Return the interactive spec of the subr object SUBR, or nil. If non-nil, the return value will be a list whose first element is `interactive' and whose second element is the interactive spec. */ @@ -395,7 +395,7 @@ as `char='. } DEFUN ("char-to-int", Fchar_to_int, 1, 1, 0, /* -Convert a character into an equivalent integer. +Convert CHARACTER into an equivalent integer. The resulting integer will always be non-negative. The integers in the range 0 - 255 map to characters as follows: @@ -409,14 +409,14 @@ values. When Mule support exists, the values assigned to other characters may vary depending on the particular version of XEmacs, the order in which character sets were loaded, etc., and you should not depend on them. */ - (ch)) + (character)) { - CHECK_CHAR (ch); - return make_int (XCHAR (ch)); + CHECK_CHAR (character); + return make_int (XCHAR (character)); } DEFUN ("int-to-char", Fint_to_char, 1, 1, 0, /* -Convert an integer into the equivalent character. +Convert integer INTEGER into the equivalent character. Not all integers correspond to valid characters; use `char-int-p' to determine whether this is the case. If the integer cannot be converted, nil is returned. @@ -614,26 +614,26 @@ Return the cdr of OBJECT if it is a cons cell, else nil. } DEFUN ("setcar", Fsetcar, 2, 2, 0, /* -Set the car of CONSCELL to be NEWCAR. Return NEWCAR. +Set the car of CONS-CELL to be NEWCAR. Return NEWCAR. */ - (conscell, newcar)) + (cons_cell, newcar)) { - if (!CONSP (conscell)) - conscell = wrong_type_argument (Qconsp, conscell); + if (!CONSP (cons_cell)) + cons_cell = wrong_type_argument (Qconsp, cons_cell); - XCAR (conscell) = newcar; + XCAR (cons_cell) = newcar; return newcar; } DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /* -Set the cdr of CONSCELL to be NEWCDR. Return NEWCDR. +Set the cdr of CONS-CELL to be NEWCDR. Return NEWCDR. */ - (conscell, newcdr)) + (cons_cell, newcdr)) { - if (!CONSP (conscell)) - conscell = wrong_type_argument (Qconsp, conscell); + if (!CONSP (cons_cell)) + cons_cell = wrong_type_argument (Qconsp, cons_cell); - XCDR (conscell) = newcdr; + XCDR (cons_cell) = newcdr; return newcdr; } @@ -1002,27 +1002,27 @@ lisp_to_word (Lisp_Object item) DEFUN ("number-to-string", Fnumber_to_string, 1, 1, 0, /* -Convert NUM to a string by printing it in decimal. +Convert NUMBER to a string by printing it in decimal. Uses a minus sign if negative. -NUM may be an integer or a floating point number. +NUMBER may be an integer or a floating point number. */ - (num)) + (number)) { char buffer[VALBITS]; - CHECK_INT_OR_FLOAT (num); + CHECK_INT_OR_FLOAT (number); #ifdef LISP_FLOAT_TYPE - if (FLOATP (num)) + if (FLOATP (number)) { char pigbuf[350]; /* see comments in float_to_string */ - float_to_string (pigbuf, XFLOAT_DATA (num)); + float_to_string (pigbuf, XFLOAT_DATA (number)); return build_string (pigbuf); } #endif /* LISP_FLOAT_TYPE */ - long_to_string (buffer, XINT (num)); + long_to_string (buffer, XINT (number)); return build_string (buffer); } @@ -1039,12 +1039,12 @@ digit_to_number (int character, int base) } DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* -Convert STRING to a number by parsing it as a decimal number. +Convert STRING to a number by parsing it as a number in base BASE. This parses both integers and floating point numbers. It ignores leading spaces and tabs. -If BASE, interpret STRING as a number in that base. If BASE isn't -present, base 10 is used. BASE must be between 2 and 16 (inclusive). +If BASE is nil or omitted, base 10 is used. +BASE must be an integer between 2 and 16 (inclusive). Floating point numbers always use base 10. */ (string, base)) @@ -1088,7 +1088,7 @@ Floating point numbers always use base 10. } else { - int digit, negative = 1; + int negative = 1; EMACS_INT v = 0; if (*p == '-') @@ -1100,7 +1100,7 @@ Floating point numbers always use base 10. p++; while (1) { - digit = digit_to_number (*p++, b); + int digit = digit_to_number (*p++, b); if (digit < 0) break; v = v * b + digit; @@ -1417,10 +1417,10 @@ DEFUN ("%", Frem, 2, 2, 0, /* Return remainder of first arg divided by second. Both must be integers, characters or markers. */ - (num1, num2)) + (number1, number2)) { - EMACS_INT ival1 = integer_char_or_marker_to_int (num1); - EMACS_INT ival2 = integer_char_or_marker_to_int (num2); + EMACS_INT ival1 = integer_char_or_marker_to_int (number1); + EMACS_INT ival2 = integer_char_or_marker_to_int (number2); if (ival2 == 0) Fsignal (Qarith_error, Qnil); diff --git a/src/depend b/src/depend index 3f859dd..cc800f7 100644 --- a/src/depend +++ b/src/depend @@ -204,7 +204,7 @@ unexconvex.o: config.h getpagesize.h unexcw.o: config.h sysfile.h unexec.o: $(LISP_H) getpagesize.h unexelf.o: config.h -unexelfsgi.o: $(LISP_H) +unexelfsgi.o: config.h unexenix.o: config.h unexfreebsd.o: config.h unexhp9k3.o: config.h sysdep.h diff --git a/src/device-x.c b/src/device-x.c index a0586b6..a6fc1bc 100644 --- a/src/device-x.c +++ b/src/device-x.c @@ -1434,13 +1434,13 @@ found. If the third arg is `string', a string is returned, and if it is returned value is the list (t) for true, (nil) for false, and is nil to mean ``unspecified''. */ - (name, class, type, locale, device, no_error)) + (name, class, type, locale, device, noerror)) { char* name_string, *class_string; char *raw_result; XrmDatabase db; Display *display; - Error_behavior errb = decode_error_behavior_flag (no_error); + Error_behavior errb = decode_error_behavior_flag (noerror); CHECK_STRING (name); CHECK_STRING (class); diff --git a/src/dialog-x.c b/src/dialog-x.c index 3985761..a6dcd2d 100644 --- a/src/dialog-x.c +++ b/src/dialog-x.c @@ -128,7 +128,9 @@ dbox_descriptor_to_widget_value (Lisp_Object keys) int n = 0; int count = specpdl_depth (); Lisp_Object wv_closure, gui_item; - Lisp_Object question = Qnil, title = Qnil, buttons = Qnil; + Lisp_Object question = Qnil; + Lisp_Object title = Qnil; /* #### currently unused */ + Lisp_Object buttons = Qnil; { EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) diff --git a/src/doprnt.c b/src/doprnt.c index b224d50..6b7459c 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -651,7 +651,7 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, strcat (constructed_spec, " "); if (spec->number_flag) strcat (constructed_spec, "#"); - if (spec->precision >= 0) + if (spec->precision >= 0 && !spec->minwidth) { strcat (constructed_spec, "."); long_to_string (constructed_spec + strlen (constructed_spec), diff --git a/src/eval.c b/src/eval.c index d34ba2e..49a9efb 100644 --- a/src/eval.c +++ b/src/eval.c @@ -67,7 +67,7 @@ struct backtrace *backtrace_list; #define AV_8(av) AV_7(av), av[7] #define PRIMITIVE_FUNCALL_1(fn, av, ac) \ -(((Lisp_Object (*)(EXFUN_##ac)) (fn)) (AV_##ac (av))) + (((Lisp_Object (*)(EXFUN_##ac)) (fn)) (AV_##ac (av))) /* If subrs take more than 8 arguments, more cases need to be added to this switch. (But wait - don't do it - if you really need @@ -727,7 +727,7 @@ BODY can be zero or more expressions. If BODY is nil, return nil. } DEFUN ("cond", Fcond, 0, UNEVALLED, 0, /* -(cond CLAUSES...): try each clause until one succeeds. +\(cond CLAUSES...): try each clause until one succeeds. Each clause looks like (CONDITION BODY...). CONDITION is evaluated and, if the value is non-nil, this clause succeeds: then the expressions in BODY are evaluated and the last one's @@ -1471,12 +1471,12 @@ throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, */ DEFUN ("throw", Fthrow, 2, 2, 0, /* -\(throw TAG VALUE): throw to the catch for TAG and return VALUE from it. +Throw to the catch for TAG and return VALUE from it. Both TAG and VALUE are evalled. */ - (tag, val)) + (tag, value)) { - throw_or_bomb_out (tag, val, 0, Qnil, Qnil); /* Doesn't return */ + throw_or_bomb_out (tag, value, 0, Qnil, Qnil); /* Doesn't return */ return Qnil; } @@ -2932,7 +2932,7 @@ Optional second arg RECORD-FLAG is as in `call-interactively'. The argument KEYS specifies the value to use instead of (this-command-keys) when reading the arguments. */ - (cmd, record, keys)) + (cmd, record_flag, keys)) { /* This function can GC */ Lisp_Object prefixarg; @@ -2967,7 +2967,7 @@ when reading the arguments. backtrace.debug_on_exit = 0; PUSH_BACKTRACE (backtrace); - final = Fcall_interactively (cmd, record, keys); + final = Fcall_interactively (cmd, record_flag, keys); POP_BACKTRACE (backtrace); return final; @@ -3066,24 +3066,24 @@ and input is currently coming from the keyboard (not in keyboard macro). /************************************************************************/ DEFUN ("autoload", Fautoload, 2, 5, 0, /* -Define FUNCTION to autoload from FILE. -FUNCTION is a symbol; FILE is a file name string to pass to `load'. -Third arg DOCSTRING is documentation for the function. -Fourth arg INTERACTIVE if non-nil says function can be called interactively. -Fifth arg TYPE indicates the type of the object: +Define FUNCTION to autoload from FILENAME. +FUNCTION is a symbol; FILENAME is a file name string to pass to `load'. +The remaining optional arguments provide additional info about the +real definition. +DOCSTRING is documentation for FUNCTION. +INTERACTIVE, if non-nil, says FUNCTION can be called interactively. +TYPE indicates the type of the object: nil or omitted says FUNCTION is a function, `keymap' says FUNCTION is really a keymap, and `macro' or t says FUNCTION is really a macro. -Third through fifth args give info about the real definition. -They default to nil. -If FUNCTION is already defined other than as an autoload, -this does nothing and returns nil. +If FUNCTION already has a non-void function definition that is not an +autoload object, this function does nothing and returns nil. */ - (function, file, docstring, interactive, type)) + (function, filename, docstring, interactive, type)) { /* This function can GC */ CHECK_SYMBOL (function); - CHECK_STRING (file); + CHECK_STRING (filename); /* If function is defined and not as an autoload, don't override */ { @@ -3095,10 +3095,10 @@ this does nothing and returns nil. if (purify_flag) { /* Attempt to avoid consing identical (string=) pure strings. */ - file = Fsymbol_name (Fintern (file, Qnil)); + filename = Fsymbol_name (Fintern (filename, Qnil)); } - return Ffset (function, Fcons (Qautoload, list4 (file, + return Ffset (function, Fcons (Qautoload, list4 (filename, docstring, interactive, type))); @@ -3897,7 +3897,7 @@ called to run the hook. If the value is a function, it is called with the given arguments and its return value is returned. If it is a list of functions, those functions are called, in order, with the given arguments ARGS. -It is best not to depend on the value return by `run-hook-with-args', +It is best not to depend on the value returned by `run-hook-with-args', as that may change. To make a hook variable buffer-local, use `make-local-hook', @@ -5103,10 +5103,10 @@ backtrace_specials (int speccount, int speclimit, Lisp_Object stream) DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* Print a trace of Lisp function calls currently active. Optional arg STREAM specifies the output stream to send the backtrace to, -and defaults to the value of `standard-output'. Optional second arg -DETAILED means show places where currently active variable bindings, -catches, condition-cases, and unwind-protects were made as well as -function calls. +and defaults to the value of `standard-output'. +Optional second arg DETAILED non-nil means show places where currently +active variable bindings, catches, condition-cases, and +unwind-protects, as well as function calls, were made. */ (stream, detailed)) { @@ -5231,8 +5231,8 @@ function calls. } -DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, "", /* -Return the function and arguments N frames up from current execution point. +DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, 0, /* +Return the function and arguments NFRAMES up from current execution point. If that frame has not evaluated the arguments yet (or is a special form), the value is (nil FUNCTION ARG-FORMS...). If that frame has evaluated its arguments and called its function already, @@ -5240,7 +5240,7 @@ the value is (t FUNCTION ARG-VALUES...). A &rest arg is represented as the tail of the list ARG-VALUES. FUNCTION is whatever was supplied as car of evaluated list, or a lambda expression for macro calls. -If N is more than the number of frames, the value is nil. +If NFRAMES is more than the number of frames, the value is nil. */ (nframes)) { diff --git a/src/event-stream.c b/src/event-stream.c index 0d09051..68e6c12 100644 --- a/src/event-stream.c +++ b/src/event-stream.c @@ -52,8 +52,6 @@ Boston, MA 02111-1307, USA. */ /* TODO: This stuff is way too hard to maintain - needs rework. - C-x @ h x causes a crash. - The command builder should deal only with key and button events. Other command events should be able to come in the MIDDLE of a key sequence, without disturbing the key sequence composition, or the @@ -121,23 +119,19 @@ Lisp_Object Qpre_idle_hook, Vpre_idle_hook; /* Control gratuitous keyboard focus throwing. */ int focus_follows_mouse; +/* When true, modifier keys are sticky. */ int modifier_keys_are_sticky; +/* Modifier keys are sticky for this many milliseconds. */ +Lisp_Object Vmodifier_keys_sticky_time; -#if 0 /* FSF Emacs crap */ -/* Hook run after a command if there's no more input soon. */ -Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook; - -/* Delay time in microseconds before running post-command-idle-hook. */ -int post_command_idle_delay; - -/* List of deferred actions to be performed at a later time. - The precise format isn't relevant here; we just check whether it is nil. */ -Lisp_Object Vdeferred_action_list; +/* Here FSF Emacs 20.7 defines Vpost_command_idle_hook, + post_command_idle_delay, Vdeferred_action_list, and + Vdeferred_action_function, but we don't because that stuff is crap, + and we're smarter than them, and their momas are fat. */ -/* Function to call to handle deferred actions, when there are any. */ -Lisp_Object Vdeferred_action_function; -Lisp_Object Qdeferred_action_function; -#endif /* FSF Emacs crap */ +/* FSF Emacs 20.7 also defines Vinput_method_function, + Qinput_method_exit_on_first_char and Qinput_method_use_echo_area. + I don't know this should be imported or not. */ /* Non-nil disable property on a command means do not execute it; call disabled-command-hook's value instead. */ @@ -502,15 +496,7 @@ event_stream_next_event (Lisp_Event *event) Let's hope it doesn't. I think the code here is fairly clean and doesn't do this. */ emacs_is_blocking = 1; -#if 0 - /* Do this if the poll-for-quit timer seems to be taking too - much CPU time when idle ... */ - reset_poll_for_quit (); -#endif event_stream->next_event_cb (event); -#if 0 - init_poll_for_quit (); -#endif emacs_is_blocking = 0; #ifdef DEBUG_XEMACS @@ -798,7 +784,8 @@ maybe_kbd_translate (Lisp_Object event) keystrokes_since_auto_save is equivalent to the difference between num_nonmacro_input_chars and last_auto_save. */ -/* When an auto-save happens, record the "time", and don't do again soon. */ +/* When an auto-save happens, record the number of keystrokes, and + don't do again soon. */ void record_auto_save (void) @@ -812,10 +799,6 @@ void force_auto_save_soon (void) { keystrokes_since_auto_save = 1 + max (auto_save_interval, 20); - -#if 0 /* FSFmacs */ - record_asynch_buffer_change (); -#endif } static void @@ -1695,19 +1678,6 @@ run_select_frame_hook (void) static void run_deselect_frame_hook (void) { -#if 0 /* unclean! FSF calls this at all sorts of random places, - including a bunch of places in their mouse.el. If this - is implemented, it has to be done cleanly. */ - run_hook (Qmouse_leave_buffer_hook); /* #### Correct? It's also - called in `call-interactively'. - Does this mean it will be - called twice? Oh well, FSF - bug -- FSF calls it in - `handle-switch-frame', - which is approximately the - same as the caller of this - function. */ -#endif run_hook (Qdeselect_frame_hook); } @@ -2684,11 +2654,11 @@ Return non-nil iff we received any output before the timeout expired. } DEFUN ("sleep-for", Fsleep_for, 1, 1, 0, /* -Pause, without updating display, for ARG seconds. -ARG may be a float, meaning pause for some fractional part of a second. +Pause, without updating display, for SECONDS seconds. +SECONDS may be a float, allowing pauses for fractional parts of a second. It is recommended that you never call sleep-for from inside of a process - filter function or timer event (either synchronous or asynchronous). +filter function or timer event (either synchronous or asynchronous). */ (seconds)) { @@ -2751,9 +2721,9 @@ It is recommended that you never call sleep-for from inside of a process } DEFUN ("sit-for", Fsit_for, 1, 2, 0, /* -Perform redisplay, then wait ARG seconds or until user input is available. -ARG may be a float, meaning a fractional part of a second. -Optional second arg non-nil means don't redisplay, just wait for input. +Perform redisplay, then wait SECONDS seconds or until user input is available. +SECONDS may be a float, meaning a fractional part of a second. +Optional second arg NODISPLAY non-nil means don't redisplay; just wait. Redisplay is preempted as always if user input arrives, and does not happen if input is available before it starts. Value is t if waited the full time with no input arriving. @@ -3795,7 +3765,10 @@ execute_command_event (struct command_builder *command_builder, struct gcpro gcpro1; GCPRO1 (event); /* event may be freshly created */ - reset_current_events (command_builder); + + /* To fix C-x @ h x crash. */ + if (XEVENT (event)->event_type != misc_user_event) + reset_current_events (command_builder); switch (XEVENT (event)->event_type) { @@ -3862,17 +3835,15 @@ execute_command_event (struct command_builder *command_builder, post_command_hook (); -#if 0 /* #### here was an attempted fix that didn't work */ - if (XEVENT (event)->event_type == misc_user_event) - ; - else -#endif if (!NILP (con->prefix_arg)) { /* Commands that set the prefix arg don't update last-command, don't reset the echoing state, and don't go into keyboard macros unless - followed by another command. */ + followed by another command. Also don't quit here. */ + int speccount = specpdl_depth (); + specbind (Qinhibit_quit, Qt); maybe_echo_keys (command_builder, 0); + unbind_to (speccount, Qnil); /* If we're recording a keyboard macro, and the last command executed set a prefix argument, then decrement the pointer to @@ -3891,7 +3862,8 @@ execute_command_event (struct command_builder *command_builder, /* Emacs 18 doesn't unconditionally clear the echoed keystrokes, so we don't either */ - reset_this_command_keys (make_console (con), 0); + if (XEVENT (event)->event_type != misc_user_event) + reset_this_command_keys (make_console (con), 0); } } @@ -3955,34 +3927,6 @@ post_command_hook (void) ("Error in `post-command-hook' (setting hook to nil)", Qpost_command_hook, 1); -#if 0 /* FSF Emacs crap */ - if (!NILP (Vdeferred_action_list)) - call0 (Vdeferred_action_function); - - if (NILP (Vunread_command_events) - && NILP (Vexecuting_macro) - && !NILP (Vpost_command_idle_hook) - && !NILP (Fsit_for (make_float ((double) post_command_idle_delay - / 1000000), Qnil))) - safe_run_hook_trapping_errors - ("Error in `post-command-idle-hook' (setting hook to nil)", - Qpost_command_idle_hook, 1); -#endif /* FSF Emacs crap */ - -#if 0 /* FSF Emacs */ - if (!NILP (current_buffer->mark_active)) - { - if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) - { - current_buffer->mark_active = Qnil; - run_hook (intern ("deactivate-mark-hook")); - } - else if (current_buffer != prev_buffer || - BUF_MODIFF (current_buffer) != prev_modiff) - run_hook (intern ("activate-mark-hook")); - } -#endif /* FSF Emacs */ - /* #### Kludge!!! This is necessary to make sure that things are properly positioned even if post-command-hook moves point. #### There should be a cleaner way of handling this. */ @@ -3991,7 +3935,7 @@ post_command_hook (void) DEFUN ("dispatch-event", Fdispatch_event, 1, 1, 0, /* -Given an event object as returned by `next-event', execute it. +Given an event object EVENT as returned by `next-event', execute it. Key-press, button-press, and button-release events get accumulated until a complete key sequence (see `read-key-sequence') is reached, @@ -4161,13 +4105,6 @@ Magic events are handled as necessary. command_builder->self_insert_countdown = 0; if (NILP (XCONSOLE (console)->prefix_arg) && NILP (Vexecuting_macro) -#if 0 - /* This was done in the days when there was no undo - in the minibuffer. If we don't disable this code, - then each instance of "undo" undoes everything in - the minibuffer. */ - && !EQ (minibuf_window, Fselected_window (Qnil)) -#endif && command_builder->self_insert_countdown == 0) Fundo_boundary (); @@ -4178,13 +4115,13 @@ Magic events are handled as necessary. } execute_command_event (command_builder, - internal_equal (event, command_builder-> most_current_event, 0) + internal_equal (event, command_builder->most_current_event, 0) ? event /* Use the translated event that was most recently seen. This way, last-command-event becomes f1 instead of the P from ESC O P. But we must copy it, else we'll lose when the command-builder events are deallocated. */ - : Fcopy_event (command_builder-> most_current_event, Qnil)); + : Fcopy_event (command_builder->most_current_event, Qnil)); } break; } @@ -4239,7 +4176,7 @@ Magic events are handled as necessary. DEFUN ("read-key-sequence", Fread_key_sequence, 1, 3, 0, /* Read a sequence of keystrokes or mouse clicks. Returns a vector of the event objects read. The vector and the event -objects it contains are freshly created (and will not be side-effected +objects it contains are freshly created (and so will not be side-effected by subsequent calls to this function). The sequence read is sufficient to specify a non-prefix command starting @@ -4247,19 +4184,17 @@ from the current local and global keymaps. A C-g typed while in this function is treated like any other character, and `quit-flag' is not set. First arg PROMPT is a prompt string. If nil, do not prompt specially. -Second (optional) arg CONTINUE-ECHO, if non-nil, means this key echoes -as a continuation of the previous key. -The third (optional) arg DONT-DOWNCASE-LAST, if non-nil, means do not -convert the last event to lower case. (Normally any upper case event -is converted to lower case if the original event is undefined and the lower -case equivalent is defined.) This argument is provided mostly for -FSF compatibility; the equivalent effect can be achieved more generally -by binding `retry-undefined-key-binding-unshifted' to nil around the -call to `read-key-sequence'. +Second optional arg CONTINUE-ECHO non-nil means this key echoes as a +continuation of the previous key. -A C-g typed while in this function is treated like any other character, -and `quit-flag' is not set. +Third optional arg DONT-DOWNCASE-LAST non-nil means do not convert the +last event to lower case. (Normally any upper case event is converted +to lower case if the original event is undefined and the lower case +equivalent is defined.) This argument is provided mostly for FSF +compatibility; the equivalent effect can be achieved more generally by +binding `retry-undefined-key-binding-unshifted' to nil around the call +to `read-key-sequence'. If the user selects a menu item while we are prompting for a key-sequence, the returned value will be a vector of a single menu-selection event. @@ -4267,8 +4202,8 @@ An error will be signalled if you pass this value to `lookup-key' or a related function. `read-key-sequence' checks `function-key-map' for function key -sequences, where they wouldn't conflict with ordinary bindings. See -`function-key-map' for more details. +sequences, where they wouldn't conflict with ordinary bindings. +See `function-key-map' for more details. */ (prompt, continue_echo, dont_downcase_last)) { @@ -4404,10 +4339,10 @@ dribble_out_event (Lisp_Object event) DEFUN ("open-dribble-file", Fopen_dribble_file, 1, 1, "FOpen dribble file: ", /* -Start writing all keyboard characters to a dribble file called FILE. -If FILE is nil, close any open dribble file. +Start writing all keyboard characters to a dribble file called FILENAME. +If FILENAME is nil, close any open dribble file. */ - (file)) + (filename)) { /* This function can GC */ /* XEmacs change: always close existing dribble file. */ @@ -4417,12 +4352,12 @@ If FILE is nil, close any open dribble file. Lstream_close (XLSTREAM (Vdribble_file)); Vdribble_file = Qnil; } - if (!NILP (file)) + if (!NILP (filename)) { int fd; - file = Fexpand_file_name (file, Qnil); - fd = open ((char*) XSTRING_DATA (file), + filename = Fexpand_file_name (filename, Qnil); + fd = open ((char*) XSTRING_DATA (filename), O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, CREAT_MODE); if (fd < 0) @@ -4500,10 +4435,6 @@ syms_of_event_stream (void) defsymbol (&Qpre_idle_hook, "pre-idle-hook"); defsymbol (&Qhandle_pre_motion_command, "handle-pre-motion-command"); defsymbol (&Qhandle_post_motion_command, "handle-post-motion-command"); -#if 0 /* FSF Emacs crap */ - defsymbol (&Qpost_command_idle_hook, "post-command-idle-hook"); - defsymbol (&Qdeferred_action_function, "deferred-action-function"); -#endif defsymbol (&Qretry_undefined_key_binding_unshifted, "retry-undefined-key-binding-unshifted"); defsymbol (&Qauto_show_make_point_visible, @@ -4602,41 +4533,6 @@ used by the window manager, so it is up to the user to set it. */ ); focus_follows_mouse = 0; -#if 0 /* FSF Emacs crap */ - /* Ill-conceived because it's not run in all sorts of cases - where XEmacs is blocking. That's what `pre-idle-hook' - is designed to solve. */ - xxDEFVAR_LISP ("post-command-idle-hook", &Vpost_command_idle_hook /* -Normal hook run after each command is executed, if idle. -`post-command-idle-delay' specifies a time in microseconds that XEmacs -must be idle for in order for the functions on this hook to be called. -Errors running the hook are caught and ignored. -*/ ); - Vpost_command_idle_hook = Qnil; - - xxDEFVAR_INT ("post-command-idle-delay", &post_command_idle_delay /* -Delay time before running `post-command-idle-hook'. -This is measured in microseconds. -*/ ); - post_command_idle_delay = 5000; - - /* Random FSFmacs crap. There is absolutely nothing to gain, - and a great deal to lose, in using this in place of just - setting `post-command-hook'. */ - xxDEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list /* -List of deferred actions to be performed at a later time. -The precise format isn't relevant here; we just check whether it is nil. -*/ ); - Vdeferred_action_list = Qnil; - - xxDEFVAR_LISP ("deferred-action-function", &Vdeferred_action_function /* -Function to call to handle deferred actions, after each command. -This function is called with no arguments after each command -whenever `deferred-action-list' is non-nil. -*/ ); - Vdeferred_action_function = Qnil; -#endif /* FSF Emacs crap */ - DEFVAR_LISP ("last-command-event", &Vlast_command_event /* Last keyboard or mouse button event that was part of a command. This variable is off limits: you may not set its value or modify the event that @@ -4815,9 +4711,22 @@ This means that you can release the modifier key before pressing down the key that you wish to be modified. Although this is non-standard behavior, it is recommended because it reduces the strain on your hand, thus reducing the incidence of the dreaded Emacs-pinky syndrome. + +Modifier keys are sticky within the inverval specified by +`modifier-keys-sticky-time'. */ ); modifier_keys_are_sticky = 0; + DEFVAR_LISP ("modifier-keys-sticky-time", &Vmodifier_keys_sticky_time /* +*Modifier keys are sticky within this many milliseconds. +If you don't want modifier keys sticking to be bounded, set this to +non-integer value. + +This variable has no effect when `modifier-keys-are-sticky' is nil. +Currently only implemented under X Window System. +*/ ); + Vmodifier_keys_sticky_time = make_int (500); + #ifdef HAVE_XIM DEFVAR_LISP ("composed-character-default-binding", &Vcomposed_character_default_binding /* @@ -4936,20 +4845,23 @@ useful testcases for v18/v19 compatibility: (global-set-key "\^Q" 'foo) without the read-key-sequence: - ^Q ==> (65 17 65 [... ^Q] [^Q]) - ^U^U^Q ==> (65 17 65 [... ^U ^U ^Q] [^U ^U ^Q]) - ^U^U^U^G^Q ==> (65 17 65 [... ^U ^U ^U ^G ^Q] [^Q]) + ^Q ==> (?A ?\^Q ?A [... ^Q] [^Q]) + ^U^U^Q ==> (?A ?\^Q ?A [... ^U ^U ^Q] [^U ^U ^Q]) + ^U^U^U^G^Q ==> (?A ?\^Q ?A [... ^U ^U ^U ^G ^Q] [^Q]) with the read-key-sequence: - ^Qb ==> (65 [b] 17 98 [... ^Q b] [b]) - ^U^U^Qb ==> (65 [b] 17 98 [... ^U ^U ^Q b] [b]) - ^U^U^U^G^Qb ==> (65 [b] 17 98 [... ^U ^U ^U ^G ^Q b] [b]) + ^Qb ==> (?A [b] ?\^Q ?b [... ^Q b] [b]) + ^U^U^Qb ==> (?A [b] ?\^Q ?b [... ^U ^U ^Q b] [b]) + ^U^U^U^G^Qb ==> (?A [b] ?\^Q ?b [... ^U ^U ^U ^G ^Q b] [b]) ;the evi-mode command "4dlj.j.j.j.j.j." is also a good testcase (gag) ;(setq x (list (read-char) quit-flag))^J^G ;(let ((inhibit-quit t)) (setq x (list (read-char) quit-flag)))^J^G ;for BOTH, x should get set to (7 t), but no result should be printed. +;; #### According to the doc of quit-flag, second test should return +;; (?\^G nil). Accidentaly XEmacs returns correct value. However, +;; XEmacs 21.1.12 and 21.2.36 both fails on first test. ;also do this: make two frames, one viewing "*scratch*", the other "foo". ;in *scratch*, type (sit-for 20)^J @@ -4969,9 +4881,9 @@ with the read-key-sequence: (quit c)) (read-char))) - (tst)^Ja^G ==> ((quit) 97) with no signal - (tst)^J^Ga ==> ((quit) 97) with no signal - (tst)^Jabc^G ==> ((quit) 97) with no signal, and "bc" inserted in buffer + (tst)^Ja^G ==> ((quit) ?a) with no signal + (tst)^J^Ga ==> ((quit) ?a) with no signal + (tst)^Jabc^G ==> ((quit) ?a) with no signal, and "bc" inserted in buffer ; with sit-for only do the 2nd test. ; Do all 3 tests with (accept-process-output nil 20) diff --git a/src/events.c b/src/events.c index 1e5f9db..af1888b 100644 --- a/src/events.c +++ b/src/events.c @@ -762,11 +762,11 @@ that it is safe to do so. } DEFUN ("copy-event", Fcopy_event, 1, 2, 0, /* -Make a copy of the given event object. -If a second argument is given, the first event is copied into the second -and the second is returned. If the second argument is not supplied (or -is nil) then a new event will be made as with `make-event'. See also -the function `deallocate-event'. +Make a copy of the event object EVENT1. +If a second event argument EVENT2 is given, EVENT1 is copied into +EVENT2 and EVENT2 is returned. If EVENT2 is not supplied (or is nil) +then a new event will be made as with `make-event'. See also the +function `deallocate-event'. */ (event1, event2)) { @@ -1145,46 +1145,48 @@ Note that specifying both ALLOW-META and ALLOW-NON-ASCII is ambiguous, as } DEFUN ("character-to-event", Fcharacter_to_event, 1, 4, 0, /* -Convert keystroke CH into an event structure ,replete with bucky bits. -The keystroke is the first argument, and the event to fill -in is the second. This function contains knowledge about what the codes -``mean'' -- for example, the number 9 is converted to the character ``Tab'', -not the distinct character ``Control-I''. +Convert KEY-DESCRIPTION into an event structure, replete with bucky bits. -Note that CH (the keystroke specifier) can be an integer, a character, -a symbol such as 'clear, or a list such as '(control backspace). +KEY-DESCRIPTION is the first argument, and the event to fill in is the +second. This function contains knowledge about what various kinds of +arguments ``mean'' -- for example, the number 9 is converted to the +character ``Tab'', not the distinct character ``Control-I''. -If the optional second argument is an event, it is modified; -otherwise, a new event object is created. +KEY-DESCRIPTION can be an integer, a character, a symbol such as 'clear, +or a list such as '(control backspace). + +If the optional second argument EVENT is an event, it is modified and +returned; otherwise, a new event object is created and returned. Optional third arg CONSOLE is the console to store in the event, and defaults to the selected console. -If CH is an integer or character, the high bit may be interpreted as the -meta key. (This is done for backward compatibility in lots of places.) -If USE-CONSOLE-META-FLAG is nil, this will always be the case. If -USE-CONSOLE-META-FLAG is non-nil, the `meta' flag for CONSOLE affects -whether the high bit is interpreted as a meta key. (See `set-input-mode'.) -If you don't want this silly meta interpretation done, you should pass -in a list containing the character. +If KEY-DESCRIPTION is an integer or character, the high bit may be +interpreted as the meta key. (This is done for backward compatibility +in lots of places.) If USE-CONSOLE-META-FLAG is nil, this will always +be the case. If USE-CONSOLE-META-FLAG is non-nil, the `meta' flag for +CONSOLE affects whether the high bit is interpreted as a meta +key. (See `set-input-mode'.) If you don't want this silly meta +interpretation done, you should pass in a list containing the +character. Beware that character-to-event and event-to-character are not strictly inverse functions, since events contain much more information than the -ASCII character set can encode. +Lisp character object type can encode. */ - (ch, event, console, use_console_meta_flag)) + (keystroke, event, console, use_console_meta_flag)) { struct console *con = decode_console (console); if (NILP (event)) event = Fmake_event (Qnil, Qnil); else CHECK_LIVE_EVENT (event); - if (CONSP (ch) || SYMBOLP (ch)) - key_desc_list_to_event (ch, event, 1); + if (CONSP (keystroke) || SYMBOLP (keystroke)) + key_desc_list_to_event (keystroke, event, 1); else { - CHECK_CHAR_COERCE_INT (ch); - character_to_event (XCHAR (ch), XEVENT (event), con, + CHECK_CHAR_COERCE_INT (keystroke); + character_to_event (XCHAR (keystroke), XEVENT (event), con, !NILP (use_console_meta_flag), 1); } return event; @@ -1527,7 +1529,7 @@ This will be a character if the event is associated with one, else a symbol. } DEFUN ("event-button", Fevent_button, 1, 1, 0, /* -Return the button-number of the given button-press or button-release event. +Return the button-number of the button-press or button-release event EVENT. */ (event)) { @@ -2122,7 +2124,7 @@ If the event did not occur over a toolbar button, nil is returned. } DEFUN ("event-process", Fevent_process, 1, 1, 0, /* -Return the process of the given process-output event. +Return the process of the process-output event EVENT. */ (event)) { diff --git a/src/fns.c b/src/fns.c index 3162a1a..8cfab15 100644 --- a/src/fns.c +++ b/src/fns.c @@ -270,25 +270,25 @@ strings, but this is not the case under FSF Emacs 19. In FSF Emacs 20 `equal' is the same as in XEmacs, in that respect.) Symbols are also allowed; their print names are used instead. */ - (s1, s2)) + (string1, string2)) { Bytecount len; Lisp_String *p1, *p2; - if (SYMBOLP (s1)) - p1 = XSYMBOL (s1)->name; + if (SYMBOLP (string1)) + p1 = XSYMBOL (string1)->name; else { - CHECK_STRING (s1); - p1 = XSTRING (s1); + CHECK_STRING (string1); + p1 = XSTRING (string1); } - if (SYMBOLP (s2)) - p2 = XSYMBOL (s2)->name; + if (SYMBOLP (string2)) + p2 = XSYMBOL (string2)->name; else { - CHECK_STRING (s2); - p2 = XSTRING (s2); + CHECK_STRING (string2); + p2 = XSTRING (string2); } return (((len = string_length (p1)) == string_length (p2)) && @@ -318,26 +318,26 @@ it is quite likely that a collation table exists (or will exist) for Unicode. When Unicode support is added to XEmacs/Mule, this problem may be solved. */ - (s1, s2)) + (string1, string2)) { Lisp_String *p1, *p2; Charcount end, len2; int i; - if (SYMBOLP (s1)) - p1 = XSYMBOL (s1)->name; + if (SYMBOLP (string1)) + p1 = XSYMBOL (string1)->name; else { - CHECK_STRING (s1); - p1 = XSTRING (s1); + CHECK_STRING (string1); + p1 = XSTRING (string1); } - if (SYMBOLP (s2)) - p2 = XSYMBOL (s2)->name; + if (SYMBOLP (string2)) + p2 = XSYMBOL (string2)->name; else { - CHECK_STRING (s2); - p2 = XSTRING (s2); + CHECK_STRING (string2); + p2 = XSTRING (string2); } end = string_char_length (p1); @@ -435,40 +435,40 @@ static Lisp_Object concat (int nargs, Lisp_Object *args, int last_special); Lisp_Object -concat2 (Lisp_Object s1, Lisp_Object s2) +concat2 (Lisp_Object string1, Lisp_Object string2) { Lisp_Object args[2]; - args[0] = s1; - args[1] = s2; + args[0] = string1; + args[1] = string2; return concat (2, args, c_string, 0); } Lisp_Object -concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) +concat3 (Lisp_Object string1, Lisp_Object string2, Lisp_Object string3) { Lisp_Object args[3]; - args[0] = s1; - args[1] = s2; - args[2] = s3; + args[0] = string1; + args[1] = string2; + args[2] = string3; return concat (3, args, c_string, 0); } Lisp_Object -vconcat2 (Lisp_Object s1, Lisp_Object s2) +vconcat2 (Lisp_Object vec1, Lisp_Object vec2) { Lisp_Object args[2]; - args[0] = s1; - args[1] = s2; + args[0] = vec1; + args[1] = vec2; return concat (2, args, c_vector, 0); } Lisp_Object -vconcat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) +vconcat3 (Lisp_Object vec1, Lisp_Object vec2, Lisp_Object vec3) { Lisp_Object args[3]; - args[0] = s1; - args[1] = s2; - args[2] = s3; + args[0] = vec1; + args[1] = vec2; + args[2] = vec3; return concat (3, args, c_vector, 0); } @@ -895,26 +895,26 @@ are not copied. } DEFUN ("substring", Fsubstring, 2, 3, 0, /* -Return a substring of STRING, starting at index FROM and ending before TO. -TO may be nil or omitted; then the substring runs to the end of STRING. -If FROM or TO is negative, it counts from the end. -Relevant parts of the string-extent-data are copied in the new string. +Return the substring of STRING starting at START and ending before END. +END may be nil or omitted; then the substring runs to the end of STRING. +If START or END is negative, it counts from the end. +Relevant parts of the string-extent-data are copied to the new string. */ - (string, from, to)) + (string, start, end)) { - Charcount ccfr, ccto; - Bytecount bfr, blen; + Charcount ccstart, ccend; + Bytecount bstart, blen; Lisp_Object val; CHECK_STRING (string); - CHECK_INT (from); - get_string_range_char (string, from, to, &ccfr, &ccto, + CHECK_INT (start); + get_string_range_char (string, start, end, &ccstart, &ccend, GB_HISTORICAL_STRING_BEHAVIOR); - bfr = charcount_to_bytecount (XSTRING_DATA (string), ccfr); - blen = charcount_to_bytecount (XSTRING_DATA (string) + bfr, ccto - ccfr); - val = make_string (XSTRING_DATA (string) + bfr, blen); - /* Copy any applicable extent information into the new string: */ - copy_string_extents (val, string, 0, bfr, blen); + bstart = charcount_to_bytecount (XSTRING_DATA (string), ccstart); + blen = charcount_to_bytecount (XSTRING_DATA (string) + bstart, ccend - ccstart); + val = make_string (XSTRING_DATA (string) + bstart, blen); + /* Copy any applicable extent information into the new string. */ + copy_string_extents (val, string, 0, bstart, blen); return val; } @@ -1185,7 +1185,7 @@ If LIST has N or fewer elements, nil is returned. */ (list, n)) { - int int_n; + EMACS_INT int_n; CHECK_LIST (list); @@ -1286,13 +1286,13 @@ memq_no_quit (Lisp_Object elt, Lisp_Object list) } DEFUN ("assoc", Fassoc, 2, 2, 0, /* -Return non-nil if KEY is `equal' to the car of an element of LIST. -The value is actually the element of LIST whose car equals KEY. +Return non-nil if KEY is `equal' to the car of an element of ALIST. +The value is actually the element of ALIST whose car equals KEY. */ - (key, list)) + (key, alist)) { /* This function can GC. */ - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { if (internal_equal (key, elt_car, 0)) return elt; @@ -1301,13 +1301,13 @@ The value is actually the element of LIST whose car equals KEY. } DEFUN ("old-assoc", Fold_assoc, 2, 2, 0, /* -Return non-nil if KEY is `old-equal' to the car of an element of LIST. -The value is actually the element of LIST whose car equals KEY. +Return non-nil if KEY is `old-equal' to the car of an element of ALIST. +The value is actually the element of ALIST whose car equals KEY. */ - (key, list)) + (key, alist)) { /* This function can GC. */ - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { if (internal_old_equal (key, elt_car, 0)) return elt; @@ -1316,21 +1316,21 @@ The value is actually the element of LIST whose car equals KEY. } Lisp_Object -assoc_no_quit (Lisp_Object key, Lisp_Object list) +assoc_no_quit (Lisp_Object key, Lisp_Object alist) { int speccount = specpdl_depth (); specbind (Qinhibit_quit, Qt); - return unbind_to (speccount, Fassoc (key, list)); + return unbind_to (speccount, Fassoc (key, alist)); } DEFUN ("assq", Fassq, 2, 2, 0, /* -Return non-nil if KEY is `eq' to the car of an element of LIST. -The value is actually the element of LIST whose car is KEY. -Elements of LIST that are not conses are ignored. +Return non-nil if KEY is `eq' to the car of an element of ALIST. +The value is actually the element of ALIST whose car is KEY. +Elements of ALIST that are not conses are ignored. */ - (key, list)) + (key, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { if (EQ_WITH_EBOLA_NOTICE (key, elt_car)) return elt; @@ -1339,15 +1339,15 @@ Elements of LIST that are not conses are ignored. } DEFUN ("old-assq", Fold_assq, 2, 2, 0, /* -Return non-nil if KEY is `old-eq' to the car of an element of LIST. -The value is actually the element of LIST whose car is KEY. -Elements of LIST that are not conses are ignored. +Return non-nil if KEY is `old-eq' to the car of an element of ALIST. +The value is actually the element of ALIST whose car is KEY. +Elements of ALIST that are not conses are ignored. This function is provided only for byte-code compatibility with v19. Do not use it. */ - (key, list)) + (key, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { if (HACKEQ_UNSAFE (key, elt_car)) return elt; @@ -1359,10 +1359,10 @@ Do not use it. Use only on lists known never to be circular. */ Lisp_Object -assq_no_quit (Lisp_Object key, Lisp_Object list) +assq_no_quit (Lisp_Object key, Lisp_Object alist) { /* This cannot GC. */ - LIST_LOOP_2 (elt, list) + LIST_LOOP_2 (elt, alist) { Lisp_Object elt_car = XCAR (elt); if (EQ_WITH_EBOLA_NOTICE (key, elt_car)) @@ -1372,70 +1372,70 @@ assq_no_quit (Lisp_Object key, Lisp_Object list) } DEFUN ("rassoc", Frassoc, 2, 2, 0, /* -Return non-nil if KEY is `equal' to the cdr of an element of LIST. -The value is actually the element of LIST whose cdr equals KEY. +Return non-nil if VALUE is `equal' to the cdr of an element of ALIST. +The value is actually the element of ALIST whose cdr equals VALUE. */ - (key, list)) + (value, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { - if (internal_equal (key, elt_cdr, 0)) + if (internal_equal (value, elt_cdr, 0)) return elt; } return Qnil; } DEFUN ("old-rassoc", Fold_rassoc, 2, 2, 0, /* -Return non-nil if KEY is `old-equal' to the cdr of an element of LIST. -The value is actually the element of LIST whose cdr equals KEY. +Return non-nil if VALUE is `old-equal' to the cdr of an element of ALIST. +The value is actually the element of ALIST whose cdr equals VALUE. */ - (key, list)) + (value, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { - if (internal_old_equal (key, elt_cdr, 0)) + if (internal_old_equal (value, elt_cdr, 0)) return elt; } return Qnil; } DEFUN ("rassq", Frassq, 2, 2, 0, /* -Return non-nil if KEY is `eq' to the cdr of an element of LIST. -The value is actually the element of LIST whose cdr is KEY. +Return non-nil if VALUE is `eq' to the cdr of an element of ALIST. +The value is actually the element of ALIST whose cdr is VALUE. */ - (key, list)) + (value, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { - if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr)) + if (EQ_WITH_EBOLA_NOTICE (value, elt_cdr)) return elt; } return Qnil; } DEFUN ("old-rassq", Fold_rassq, 2, 2, 0, /* -Return non-nil if KEY is `old-eq' to the cdr of an element of LIST. -The value is actually the element of LIST whose cdr is KEY. +Return non-nil if VALUE is `old-eq' to the cdr of an element of ALIST. +The value is actually the element of ALIST whose cdr is VALUE. */ - (key, list)) + (value, alist)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list) + EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) { - if (HACKEQ_UNSAFE (key, elt_cdr)) + if (HACKEQ_UNSAFE (value, elt_cdr)) return elt; } return Qnil; } -/* Like Frassq, but caller must ensure that LIST is properly +/* Like Frassq, but caller must ensure that ALIST is properly nil-terminated and ebola-free. */ Lisp_Object -rassq_no_quit (Lisp_Object key, Lisp_Object list) +rassq_no_quit (Lisp_Object value, Lisp_Object alist) { - LIST_LOOP_2 (elt, list) + LIST_LOOP_2 (elt, alist) { Lisp_Object elt_cdr = XCDR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr)) + if (EQ_WITH_EBOLA_NOTICE (value, elt_cdr)) return elt; } return Qnil; @@ -1546,92 +1546,92 @@ delq_no_quit_and_free_cons (Lisp_Object elt, Lisp_Object list) } DEFUN ("remassoc", Fremassoc, 2, 2, 0, /* -Delete by side effect any elements of LIST whose car is `equal' to KEY. -The modified LIST is returned. If the first member of LIST has a car +Delete by side effect any elements of ALIST whose car is `equal' to KEY. +The modified ALIST is returned. If the first member of ALIST has a car that is `equal' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassoc key foo))' to be sure of changing the value of `foo'. */ - (key, list)) + (key, alist)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, + EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && internal_equal (key, XCAR (elt), 0))); - return list; + return alist; } Lisp_Object -remassoc_no_quit (Lisp_Object key, Lisp_Object list) +remassoc_no_quit (Lisp_Object key, Lisp_Object alist) { int speccount = specpdl_depth (); specbind (Qinhibit_quit, Qt); - return unbind_to (speccount, Fremassoc (key, list)); + return unbind_to (speccount, Fremassoc (key, alist)); } DEFUN ("remassq", Fremassq, 2, 2, 0, /* -Delete by side effect any elements of LIST whose car is `eq' to KEY. -The modified LIST is returned. If the first member of LIST has a car +Delete by side effect any elements of ALIST whose car is `eq' to KEY. +The modified ALIST is returned. If the first member of ALIST has a car that is `eq' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassq key foo))' to be sure of changing the value of `foo'. */ - (key, list)) + (key, alist)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, + EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); - return list; + return alist; } /* no quit, no errors; be careful */ Lisp_Object -remassq_no_quit (Lisp_Object key, Lisp_Object list) +remassq_no_quit (Lisp_Object key, Lisp_Object alist) { - LIST_LOOP_DELETE_IF (elt, list, + LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); - return list; + return alist; } DEFUN ("remrassoc", Fremrassoc, 2, 2, 0, /* -Delete by side effect any elements of LIST whose cdr is `equal' to VALUE. -The modified LIST is returned. If the first member of LIST has a car +Delete by side effect any elements of ALIST whose cdr is `equal' to VALUE. +The modified ALIST is returned. If the first member of ALIST has a car that is `equal' to VALUE, there is no way to remove it by side effect; therefore, write `(setq foo (remrassoc value foo))' to be sure of changing the value of `foo'. */ - (value, list)) + (value, alist)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, + EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && internal_equal (value, XCDR (elt), 0))); - return list; + return alist; } DEFUN ("remrassq", Fremrassq, 2, 2, 0, /* -Delete by side effect any elements of LIST whose cdr is `eq' to VALUE. -The modified LIST is returned. If the first member of LIST has a car +Delete by side effect any elements of ALIST whose cdr is `eq' to VALUE. +The modified ALIST is returned. If the first member of ALIST has a car that is `eq' to VALUE, there is no way to remove it by side effect; therefore, write `(setq foo (remrassq value foo))' to be sure of changing the value of `foo'. */ - (value, list)) + (value, alist)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, list, + EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); - return list; + return alist; } /* Like Fremrassq, fast and unsafe; be careful */ Lisp_Object -remrassq_no_quit (Lisp_Object value, Lisp_Object list) +remrassq_no_quit (Lisp_Object value, Lisp_Object alist) { - LIST_LOOP_DELETE_IF (elt, list, + LIST_LOOP_DELETE_IF (elt, alist, (CONSP (elt) && EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); - return list; + return alist; } DEFUN ("nreverse", Fnreverse, 1, 1, 0, /* @@ -1689,12 +1689,11 @@ list_sort (Lisp_Object list, Lisp_Object back, tem; Lisp_Object front = list; Lisp_Object len = Flength (list); - int length = XINT (len); - if (length < 2) + if (XINT (len) < 2) return list; - XSETINT (len, (length / 2) - 1); + len = make_int (XINT (len) / 2 - 1); tem = Fnthcdr (len, list); back = Fcdr (tem); Fsetcdr (tem, Qnil); @@ -1735,9 +1734,9 @@ Returns the sorted list. LIST is modified by side effects. PREDICATE is called with two elements of LIST, and should return T if the first element is "less" than the second. */ - (list, pred)) + (list, predicate)) { - return list_sort (list, pred, merge_pred_function); + return list_sort (list, predicate, merge_pred_function); } Lisp_Object @@ -2267,51 +2266,54 @@ external_remprop (Lisp_Object *plist, Lisp_Object property, DEFUN ("plist-get", Fplist_get, 2, 3, 0, /* Extract a value from a property list. PLIST is a property list, which is a list of the form -\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value -corresponding to the given PROP, or DEFAULT if PROP is not -one of the properties on the list. +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...). +PROPERTY is usually a symbol. +This function returns the value corresponding to the PROPERTY, +or DEFAULT if PROPERTY is not one of the properties on the list. */ - (plist, prop, default_)) + (plist, property, default_)) { - Lisp_Object val = external_plist_get (&plist, prop, 0, ERROR_ME); - return UNBOUNDP (val) ? default_ : val; + Lisp_Object value = external_plist_get (&plist, property, 0, ERROR_ME); + return UNBOUNDP (value) ? default_ : value; } DEFUN ("plist-put", Fplist_put, 3, 3, 0, /* -Change value in PLIST of PROP to VAL. -PLIST is a property list, which is a list of the form \(PROP1 VALUE1 -PROP2 VALUE2 ...). PROP is usually a symbol and VAL is any object. -If PROP is already a property on the list, its value is set to VAL, -otherwise the new PROP VAL pair is added. The new plist is returned; -use `(setq x (plist-put x prop val))' to be sure to use the new value. -The PLIST is modified by side effects. +Change value in PLIST of PROPERTY to VALUE. +PLIST is a property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2 ...). +PROPERTY is usually a symbol and VALUE is any object. +If PROPERTY is already a property on the list, its value is set to VALUE, +otherwise the new PROPERTY VALUE pair is added. +The new plist is returned; use `(setq x (plist-put x property value))' +to be sure to use the new value. PLIST is modified by side effect. */ - (plist, prop, val)) + (plist, property, value)) { - external_plist_put (&plist, prop, val, 0, ERROR_ME); + external_plist_put (&plist, property, value, 0, ERROR_ME); return plist; } DEFUN ("plist-remprop", Fplist_remprop, 2, 2, 0, /* -Remove from PLIST the property PROP and its value. -PLIST is a property list, which is a list of the form \(PROP1 VALUE1 -PROP2 VALUE2 ...). PROP is usually a symbol. The new plist is -returned; use `(setq x (plist-remprop x prop val))' to be sure to use -the new value. The PLIST is modified by side effects. +Remove from PLIST the property PROPERTY and its value. +PLIST is a property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2 ...). +PROPERTY is usually a symbol. +The new plist is returned; use `(setq x (plist-remprop x property))' +to be sure to use the new value. PLIST is modified by side effect. */ - (plist, prop)) + (plist, property)) { - external_remprop (&plist, prop, 0, ERROR_ME); + external_remprop (&plist, property, 0, ERROR_ME); return plist; } DEFUN ("plist-member", Fplist_member, 2, 2, 0, /* -Return t if PROP has a value specified in PLIST. +Return t if PROPERTY has a value specified in PLIST. */ - (plist, prop)) + (plist, property)) { - Lisp_Object val = Fplist_get (plist, prop, Qunbound); - return UNBOUNDP (val) ? Qnil : Qt; + Lisp_Object value = Fplist_get (plist, property, Qunbound); + return UNBOUNDP (value) ? Qnil : Qt; } DEFUN ("check-valid-plist", Fcheck_valid_plist, 1, 1, 0, /* @@ -2409,58 +2411,60 @@ The new plist is returned. If NIL-MEANS-NOT-PRESENT is given, the DEFUN ("lax-plist-get", Flax_plist_get, 2, 3, 0, /* Extract a value from a lax property list. - -LAX-PLIST is a lax property list, which is a list of the form \(PROP1 -VALUE1 PROP2 VALUE2...), where comparisons between properties is done -using `equal' instead of `eq'. This function returns the value -corresponding to the given PROP, or DEFAULT if PROP is not one of the -properties on the list. +LAX-PLIST is a lax property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between +properties is done using `equal' instead of `eq'. +PROPERTY is usually a symbol. +This function returns the value corresponding to PROPERTY, +or DEFAULT if PROPERTY is not one of the properties on the list. */ - (lax_plist, prop, default_)) + (lax_plist, property, default_)) { - Lisp_Object val = external_plist_get (&lax_plist, prop, 1, ERROR_ME); - return UNBOUNDP (val) ? default_ : val; + Lisp_Object value = external_plist_get (&lax_plist, property, 1, ERROR_ME); + return UNBOUNDP (value) ? default_ : value; } DEFUN ("lax-plist-put", Flax_plist_put, 3, 3, 0, /* -Change value in LAX-PLIST of PROP to VAL. -LAX-PLIST is a lax property list, which is a list of the form \(PROP1 -VALUE1 PROP2 VALUE2...), where comparisons between properties is done -using `equal' instead of `eq'. PROP is usually a symbol and VAL is -any object. If PROP is already a property on the list, its value is -set to VAL, otherwise the new PROP VAL pair is added. The new plist -is returned; use `(setq x (lax-plist-put x prop val))' to be sure to -use the new value. The LAX-PLIST is modified by side effects. -*/ - (lax_plist, prop, val)) -{ - external_plist_put (&lax_plist, prop, val, 1, ERROR_ME); +Change value in LAX-PLIST of PROPERTY to VALUE. +LAX-PLIST is a lax property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between +properties is done using `equal' instead of `eq'. +PROPERTY is usually a symbol and VALUE is any object. +If PROPERTY is already a property on the list, its value is set to +VALUE, otherwise the new PROPERTY VALUE pair is added. +The new plist is returned; use `(setq x (lax-plist-put x property value))' +to be sure to use the new value. LAX-PLIST is modified by side effect. +*/ + (lax_plist, property, value)) +{ + external_plist_put (&lax_plist, property, value, 1, ERROR_ME); return lax_plist; } DEFUN ("lax-plist-remprop", Flax_plist_remprop, 2, 2, 0, /* -Remove from LAX-PLIST the property PROP and its value. -LAX-PLIST is a lax property list, which is a list of the form \(PROP1 -VALUE1 PROP2 VALUE2...), where comparisons between properties is done -using `equal' instead of `eq'. PROP is usually a symbol. The new -plist is returned; use `(setq x (lax-plist-remprop x prop val))' to be -sure to use the new value. The LAX-PLIST is modified by side effects. +Remove from LAX-PLIST the property PROPERTY and its value. +LAX-PLIST is a lax property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between +properties is done using `equal' instead of `eq'. +PROPERTY is usually a symbol. +The new plist is returned; use `(setq x (lax-plist-remprop x property))' +to be sure to use the new value. LAX-PLIST is modified by side effect. */ - (lax_plist, prop)) + (lax_plist, property)) { - external_remprop (&lax_plist, prop, 1, ERROR_ME); + external_remprop (&lax_plist, property, 1, ERROR_ME); return lax_plist; } DEFUN ("lax-plist-member", Flax_plist_member, 2, 2, 0, /* -Return t if PROP has a value specified in LAX-PLIST. -LAX-PLIST is a lax property list, which is a list of the form \(PROP1 -VALUE1 PROP2 VALUE2...), where comparisons between properties is done -using `equal' instead of `eq'. +Return t if PROPERTY has a value specified in LAX-PLIST. +LAX-PLIST is a lax property list, which is a list of the form +\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between +properties is done using `equal' instead of `eq'. */ - (lax_plist, prop)) + (lax_plist, property)) { - return UNBOUNDP (Flax_plist_get (lax_plist, prop, Qunbound)) ? Qnil : Qt; + return UNBOUNDP (Flax_plist_get (lax_plist, property, Qunbound)) ? Qnil : Qt; } DEFUN ("canonicalize-lax-plist", Fcanonicalize_lax_plist, 1, 2, 0, /* @@ -2679,9 +2683,9 @@ Conses are compared by comparing the cars and the cdrs. Vectors and strings are compared element by element. Numbers are compared by value. Symbols must match exactly. */ - (obj1, obj2)) + (object1, object2)) { - return internal_equal (obj1, obj2, 0) ? Qt : Qnil; + return internal_equal (object1, object2, 0) ? Qt : Qnil; } DEFUN ("old-equal", Fold_equal, 2, 2, 0, /* @@ -2693,9 +2697,9 @@ this is known as the "char-int confoundance disease." See `eq' and This function is provided only for byte-code compatibility with v19. Do not use it. */ - (obj1, obj2)) + (object1, object2)) { - return internal_old_equal (obj1, obj2, 0) ? Qt : Qnil; + return internal_old_equal (object1, object2, 0) ? Qt : Qnil; } @@ -2735,7 +2739,7 @@ ARRAY is a vector, bit vector, or string. else if (VECTORP (array)) { Lisp_Object *p = XVECTOR_DATA (array); - int len = XVECTOR_LENGTH (array); + size_t len = XVECTOR_LENGTH (array); CHECK_LISP_WRITEABLE (array); while (len--) *p++ = item; @@ -2743,11 +2747,11 @@ ARRAY is a vector, bit vector, or string. else if (BIT_VECTORP (array)) { Lisp_Bit_Vector *v = XBIT_VECTOR (array); - int len = bit_vector_length (v); + size_t len = bit_vector_length (v); int bit; CHECK_BIT (item); - CHECK_LISP_WRITEABLE (array); bit = XINT (item); + CHECK_LISP_WRITEABLE (array); while (len--) set_bit_vector_bit (v, len, bit); } @@ -2782,7 +2786,7 @@ bytecode_nconc2 (Lisp_Object *args) { /* (setcdr (last args[0]) args[1]) */ Lisp_Object tortoise, hare; - int count; + size_t count; for (hare = tortoise = args[0], count = 0; CONSP (XCDR (hare)); @@ -2851,7 +2855,7 @@ changing the value of `foo'. if (CONSP (next) || argnum == nargs -1) { /* (setcdr (last val) next) */ - int count; + size_t count; for (count = 0; CONSP (XCDR (last_cons)); @@ -2905,7 +2909,6 @@ mapcar1 (size_t leni, Lisp_Object *vals, { Lisp_Object result; Lisp_Object args[2]; - int i; struct gcpro gcpro1; if (vals) @@ -2935,6 +2938,7 @@ mapcar1 (size_t leni, Lisp_Object *vals, if (vals) { Lisp_Object *val = vals; + size_t i; LIST_LOOP_2 (elt, sequence) *val++ = elt; @@ -2969,6 +2973,7 @@ mapcar1 (size_t leni, Lisp_Object *vals, else if (VECTORP (sequence)) { Lisp_Object *objs = XVECTOR_DATA (sequence); + size_t i; for (i = 0; i < leni; i++) { args[1] = *objs++; @@ -2996,6 +3001,7 @@ mapcar1 (size_t leni, Lisp_Object *vals, else if (BIT_VECTORP (sequence)) { Lisp_Bit_Vector *v = XBIT_VECTOR (sequence); + size_t i; for (i = 0; i < leni; i++) { args[1] = make_int (bit_vector_bit (v, i)); @@ -3018,10 +3024,10 @@ SEQUENCE may be a list, a vector, a bit vector, or a string. */ (function, sequence, separator)) { - size_t len = XINT (Flength (sequence)); + EMACS_INT len = XINT (Flength (sequence)); Lisp_Object *args; - int i; - int nargs = len + len - 1; + EMACS_INT i; + EMACS_INT nargs = len + len - 1; if (len == 0) return build_string (""); @@ -3312,7 +3318,7 @@ If FEATURE is not a member of the list `features', then the feature is not loaded; so load the file FILENAME. If FILENAME is omitted, the printname of FEATURE is used as the file name. */ - (feature, file_name)) + (feature, filename)) { Lisp_Object tem; CHECK_SYMBOL (feature); @@ -3328,7 +3334,7 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name. record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - call4 (Qload, NILP (file_name) ? Fsymbol_name (feature) : file_name, + call4 (Qload, NILP (filename) ? Fsymbol_name (feature) : filename, Qnil, Qt, Qnil); tem = Fmemq (feature, Vfeatures); @@ -3587,12 +3593,12 @@ free_malloced_ptr (Lisp_Object unwind_obj) } while (0) DEFUN ("base64-encode-region", Fbase64_encode_region, 2, 3, "r", /* -Base64-encode the region between BEG and END. +Base64-encode the region between START and END. Return the length of the encoded text. Optional third argument NO-LINE-BREAK means do not break long lines into shorter lines. */ - (beg, end, no_line_break)) + (start, end, no_line_break)) { Bufbyte *encoded; Bytind encoded_length; @@ -3602,7 +3608,7 @@ into shorter lines. Lisp_Object input; int speccount = specpdl_depth(); - get_buffer_range_char (buf, beg, end, &begv, &zv, 0); + get_buffer_range_char (buf, start, end, &begv, &zv, 0); barf_if_buffer_read_only (buf, begv, zv); /* We need to allocate enough room for encoding the text. @@ -3639,6 +3645,8 @@ into shorter lines. DEFUN ("base64-encode-string", Fbase64_encode_string, 1, 2, 0, /* Base64 encode STRING and return the result. +Optional argument NO-LINE-BREAK means do not break long lines +into shorter lines. */ (string, no_line_break)) { @@ -3667,12 +3675,12 @@ Base64 encode STRING and return the result. } DEFUN ("base64-decode-region", Fbase64_decode_region, 2, 2, "r", /* -Base64-decode the region between BEG and END. +Base64-decode the region between START and END. Return the length of the decoded text. If the region can't be decoded, return nil and don't modify the buffer. Characters out of the base64 alphabet are ignored. */ - (beg, end)) + (start, end)) { struct buffer *buf = current_buffer; Bufpos begv, zv, old_pt = BUF_PT (buf); @@ -3682,7 +3690,7 @@ Characters out of the base64 alphabet are ignored. Lisp_Object input; int speccount = specpdl_depth(); - get_buffer_range_char (buf, beg, end, &begv, &zv, 0); + get_buffer_range_char (buf, start, end, &begv, &zv, 0); barf_if_buffer_read_only (buf, begv, zv); length = zv - begv; diff --git a/src/frame.c b/src/frame.c index dbbaf63..37ef75a 100644 --- a/src/frame.c +++ b/src/frame.c @@ -972,7 +972,7 @@ is_surrogate_for_selected_frame (struct frame *f) } static int -frame_matches_frametype (Lisp_Object frame, Lisp_Object type) +frame_matches_frame_spec (Lisp_Object frame, Lisp_Object type) { struct frame *f = XFRAME (frame); @@ -1033,25 +1033,25 @@ frame_matches_frametype (Lisp_Object frame, Lisp_Object type) } int -device_matches_console_spec (Lisp_Object device, Lisp_Object console) +device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec) { - if (EQ (console, Qwindow_system)) + if (EQ (device_spec, Qwindow_system)) return DEVICE_WIN_P (XDEVICE (device)); - if (DEVICEP (console)) - return EQ (device, console); - if (CONSOLEP (console)) - return EQ (DEVICE_CONSOLE (XDEVICE (device)), console); - if (valid_console_type_p (console)) - return EQ (DEVICE_TYPE (XDEVICE (device)), console); + if (DEVICEP (device_spec)) + return EQ (device, device_spec); + if (CONSOLEP (device_spec)) + return EQ (DEVICE_CONSOLE (XDEVICE (device)), device_spec); + if (valid_console_type_p (device_spec)) + return EQ (DEVICE_TYPE (XDEVICE (device)), device_spec); return 1; } /* Return the next frame in the frame list after FRAME. - FRAMETYPE and CONSOLE control which frames and devices + WHICH-FRAMES and WHICH-DEVICES control which frames and devices are considered; see `next-frame'. */ Lisp_Object -next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) +next_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices) { Lisp_Object first = Qnil; Lisp_Object devcons, concons; @@ -1064,7 +1064,7 @@ next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) Lisp_Object device = XCAR (devcons); Lisp_Object frmcons; - if (!device_matches_console_spec (device, console)) + if (!device_matches_device_spec (device, which_devices)) { if (EQ (device, FRAME_DEVICE (XFRAME (frame)))) passed = 1; @@ -1077,7 +1077,7 @@ next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) if (passed) { - if (frame_matches_frametype (f, frametype)) + if (frame_matches_frame_spec (f, which_frames)) return f; } else @@ -1088,7 +1088,7 @@ next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) } else { - if (NILP (first) && frame_matches_frametype (f, frametype)) + if (NILP (first) && frame_matches_frame_spec (f, which_frames)) first = f; } } @@ -1107,11 +1107,11 @@ next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) } /* Return the previous frame in the frame list before FRAME. - FRAMETYPE and CONSOLE control which frames and devices + WHICH-FRAMES and WHICH-DEVICES control which frames and devices are considered; see `next-frame'. */ Lisp_Object -previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) +previous_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices) { Lisp_Object devcons, concons; Lisp_Object last = Qnil; @@ -1123,7 +1123,7 @@ previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) Lisp_Object device = XCAR (devcons); Lisp_Object frmcons; - if (!device_matches_console_spec (device, console)) + if (!device_matches_device_spec (device, which_devices)) { if (EQ (device, FRAME_DEVICE (XFRAME (frame))) && !NILP (last)) @@ -1142,7 +1142,7 @@ previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) } else { - if (frame_matches_frametype (f, frametype)) + if (frame_matches_frame_spec (f, which_frames)) last = f; } } @@ -1161,13 +1161,13 @@ previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /* Return the next frame of the right type in the frame list after FRAME. -FRAMETYPE controls which frames are eligible to be returned; all +WHICH-FRAMES controls which frames are eligible to be returned; all others will be skipped. Note that if there is only one eligible frame, then `next-frame' called repeatedly will always return the same frame, and if there is no eligible frame, then FRAME is returned. -Possible values for FRAMETYPE are +Possible values for WHICH-FRAMES are 'visible Consider only frames that are visible. 'iconic Consider only frames that are iconic. @@ -1185,43 +1185,44 @@ Possible values for FRAMETYPE are frames. any other value Consider all frames. -If FRAMETYPE is omitted, 'nomini is used. A FRAMETYPE of 0 (a number) -is treated like 'iconic, for backwards compatibility. +If WHICH-FRAMES is omitted, 'nomini is used. A value for WHICH-FRAMES +of 0 (a number) is treated like 'iconic, for backwards compatibility. -If FRAMETYPE is a window, include only its own frame and any frame now -using that window as the minibuffer. +If WHICH-FRAMES is a window, include only its own frame and any frame +now using that window as the minibuffer. -Optional third argument CONSOLE controls which consoles or devices the -returned frame may be on. If CONSOLE is a console, return frames only -on that console. If CONSOLE is a device, return frames only on that -device. If CONSOLE is a console type, return frames only on consoles -of that type. If CONSOLE is 'window-system, return any frames on any -window-system consoles. If CONSOLE is nil or omitted, return frames only -on the FRAME's console. Otherwise, all frames are considered. +The optional third argument WHICH-DEVICES further clarifies on which +devices to search for frames as specified by WHICH-FRAMES. +If nil or omitted, search all devices on FRAME's console. +If a device, only search that device. +If a console, search all devices on that console. +If a device type, search all devices of that type. +If `window-system', search all window-system devices. +Any other non-nil value means search all devices. */ - (frame, frametype, console)) + (frame, which_frames, which_devices)) { XSETFRAME (frame, decode_frame (frame)); - return next_frame (frame, frametype, console); + return next_frame (frame, which_frames, which_devices); } DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /* Return the next frame of the right type in the frame list after FRAME. -FRAMETYPE controls which frames are eligible to be returned; all +WHICH-FRAMES controls which frames are eligible to be returned; all others will be skipped. Note that if there is only one eligible frame, then `previous-frame' called repeatedly will always return the same frame, and if there is no eligible frame, then FRAME is returned. -See `next-frame' for an explanation of the FRAMETYPE and CONSOLE +See `next-frame' for an explanation of the WHICH-FRAMES and WHICH-DEVICES arguments. */ - (frame, frametype, console)) + (frame, which_frames, which_devices)) { XSETFRAME (frame, decode_frame (frame)); - return previous_frame (frame, frametype, console); + return previous_frame (frame, which_frames, which_devices); } /* Return any frame for which PREDICATE is non-zero, or return Qnil @@ -2405,6 +2406,7 @@ recognized for particular types of frames. DEFUN ("frame-property", Fframe_property, 2, 3, 0, /* Return FRAME's value for property PROPERTY. +Return DEFAULT if there is no such property. See `set-frame-properties' for the built-in property names. */ (frame, property, default_)) @@ -2600,21 +2602,21 @@ Specify that the frame FRAME has LINES lines. Optional third arg non-nil means that redisplay should use LINES lines but that the idea of the actual height of the frame should not be changed. */ - (frame, rows, pretend)) + (frame, lines, pretend)) { struct frame *f = decode_frame (frame); int height, width; XSETFRAME (frame, f); - CHECK_INT (rows); + CHECK_INT (lines); if (window_system_pixelated_geometry (frame)) { - char_to_real_pixel_size (f, 0, XINT (rows), 0, &height); + char_to_real_pixel_size (f, 0, XINT (lines), 0, &height); width = FRAME_PIXWIDTH (f); } else { - height = XINT (rows); + height = XINT (lines); width = FRAME_WIDTH (f); } @@ -2650,7 +2652,7 @@ but that the idea of the actual width of the frame should not be changed. } DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /* -Set the size of FRAME to COLS by ROWS. +Set the size of FRAME to COLS by ROWS, measured in characters. Optional fourth arg non-nil means that redisplay should use COLS by ROWS but that the idea of the actual size of the frame should not be changed. */ diff --git a/src/glyphs-msw.c b/src/glyphs-msw.c index 4d4a5f1..7bb3c31 100644 --- a/src/glyphs-msw.c +++ b/src/glyphs-msw.c @@ -2601,9 +2601,10 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat /* This function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HWND wnd; - int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback - only. Since we seem to want nothing beyond BN_CLICK, - the style is perhaps not necessary -- kkm */ + int flags = WS_TABSTOP | BS_NOTIFY; + /* BS_NOTIFY #### is needed to get exotic feedback only. Since we + seem to want nothing beyond BN_CLICK, the style is perhaps not + necessary -- kkm */ Lisp_Object style; Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Gui_Item* pgui = XGUI_ITEM (gui); diff --git a/src/glyphs-x.c b/src/glyphs-x.c index 9ce627b..ed706f9 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -1000,12 +1000,13 @@ int read_bitmap_data_from_file (const char *filename, unsigned int *width, static Pixmap pixmap_from_xbm_inline (Lisp_Object device, int width, int height, /* Note that data is in ext-format! */ - const Extbyte *bits) + const char *bits) { - return XCreatePixmapFromBitmapData (DEVICE_X_DISPLAY (XDEVICE(device)), - XtWindow (DEVICE_XT_APP_SHELL (XDEVICE (device))), - (char *) bits, width, height, - 1, 0, 1); + return XCreatePixmapFromBitmapData + (DEVICE_X_DISPLAY (XDEVICE (device)), + XtWindow (DEVICE_XT_APP_SHELL (XDEVICE (device))), + (char *) bits, width, height, + 1, 0, 1); } /* Given inline data for a mono pixmap, initialize the given @@ -1168,7 +1169,7 @@ xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator, mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii), XINT (XCAR (mask_data)), XINT (XCAR (XCDR (mask_data))), - (const unsigned char *) ext_data); + ext_data); } init_image_instance_from_xbm_inline (ii, width, height, bits, @@ -2209,8 +2210,8 @@ x_redisplay_widget (Lisp_Image_Instance *p) reference to the real values rather than a copy thus any changes we make to the values we get back will look like they have already been applied. If we rebuild the widget tree then - we may lose propertie. */ - wv = copy_widget_value_tree (lw_get_all_values + we may lose properties. */ + wv = copy_widget_value_tree (lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p)), NO_CHANGE); } @@ -2980,7 +2981,7 @@ complex_vars_of_glyphs_x (void) vector3 (Qxbm, Q_data, \ list3 (make_int (name##_width), \ make_int (name##_height), \ - make_ext_string (name##_bits, \ + make_ext_string ((Extbyte *) name##_bits, \ sizeof (name##_bits), \ Qbinary))), \ Qglobal, Qx, Qnil) diff --git a/src/gutter.c b/src/gutter.c index 3bde818..72fb052 100644 --- a/src/gutter.c +++ b/src/gutter.c @@ -249,6 +249,96 @@ static Lisp_Object construct_window_gutter_spec (struct window* w, return Fconcat (nargs, args); } +/* Sizing gutters is a pain so we try and help the user by determining + what height will accommodate all lines. This is useless on left and + right gutters as we always have a maximal number of lines. */ +static int +calculate_gutter_size_from_display_lines (enum gutter_pos pos, + display_line_dynarr* ddla) +{ + int size = 0; + struct display_line *dl; + + /* For top and bottom the calculation is easy. */ + if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER) + { + /* grab coordinates of last line */ + if (Dynarr_length (ddla)) + { + dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); + size = (dl->ypos + dl->descent - dl->clip) + - (Dynarr_atp (ddla, 0)->ypos - Dynarr_atp (ddla, 0)->ascent); + } + } + /* For left and right we have to do some maths. */ + else + { + int start_pos = 0, end_pos = 0, line; + for (line = 0; line < Dynarr_length (ddla); line++) + { + int block; + dl = Dynarr_atp (ddla, line); + + for (block = 0; block < Dynarr_largest (dl->display_blocks); block++) + { + struct display_block *db = Dynarr_atp (dl->display_blocks, block); + + if (db->type == TEXT) + { + start_pos = min (db->start_pos, start_pos); + end_pos = max (db->end_pos, end_pos); + } + } + } + size = end_pos - start_pos; + } + + return size; +} + +static Lisp_Object +calculate_gutter_size (struct window *w, enum gutter_pos pos) +{ + struct frame* f = XFRAME (WINDOW_FRAME (w)); + int count; + display_line_dynarr* ddla; + Lisp_Object ret = Qnil; + + /* degenerate case */ + if (NILP (RAW_WINDOW_GUTTER (w, pos)) + || + !FRAME_VISIBLE_P (f) + || + NILP (w->buffer)) + return Qnil; + + /* Redisplay code that we use relies on GC not happening. Make it + so. */ + count = specpdl_depth (); + record_unwind_protect (restore_gc_inhibit, + make_int (gc_currently_forbidden)); + gc_currently_forbidden = 1; + + ddla = Dynarr_new (display_line); + /* generate some display lines */ + generate_displayable_area (w, WINDOW_GUTTER (w, pos), + FRAME_LEFT_BORDER_END (f), + FRAME_TOP_BORDER_END (f), + FRAME_RIGHT_BORDER_START (f) + - FRAME_LEFT_BORDER_END (f), + FRAME_BOTTOM_BORDER_START (f) + - FRAME_TOP_BORDER_END (f), + ddla, 0, 0); + + /* Let GC happen again. */ + unbind_to (count, Qnil); + + ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); + free_display_lines (ddla); + + return ret; +} + static void output_gutter (struct frame *f, enum gutter_pos pos, int force) { @@ -339,7 +429,10 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force) room for, and we are allowed to resize the gutter, then make sure this happens before the next time we try and output. This can happen when face font sizes change. */ - if (dl && dl->clip > 0 && EQ (w->gutter_size[pos], Qautodetect)) + if (dl && EQ (w->gutter_size[pos], Qautodetect) + && (dl->clip > 0 || + calculate_gutter_size_from_display_lines (pos, ddla) > + WINDOW_GUTTER_SIZE_INTERNAL (w, pos))) { /* #### Ideally we would just mark the specifier as dirty and everything else would "just work". Unfortunately we have @@ -378,63 +471,6 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force) w->gutter_extent_modiff [pos] = 0; } -/* Sizing gutters is a pain so we try and help the user by determining - what height will accommodate all lines. This is useless on left and - right gutters as we always have a maximal number of lines. */ -static Lisp_Object -calculate_gutter_size (struct window *w, enum gutter_pos pos) -{ - struct frame* f = XFRAME (WINDOW_FRAME (w)); - int ypos, count; - display_line_dynarr* ddla; - struct display_line *dl; - - /* we cannot autodetect gutter sizes for the left and right as there - is no reasonable metric to use */ - assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER); - /* degenerate case */ - if (NILP (RAW_WINDOW_GUTTER (w, pos)) - || - !FRAME_VISIBLE_P (f) - || - NILP (w->buffer)) - return Qnil; - - /* Redisplay code that we use relies on GC not happening. Make it - so. */ - count = specpdl_depth (); - record_unwind_protect (restore_gc_inhibit, - make_int (gc_currently_forbidden)); - gc_currently_forbidden = 1; - - ddla = Dynarr_new (display_line); - /* generate some display lines */ - generate_displayable_area (w, WINDOW_GUTTER (w, pos), - FRAME_LEFT_BORDER_END (f), - 0, - FRAME_RIGHT_BORDER_START (f) - - FRAME_LEFT_BORDER_END (f), - 200, - ddla, 0, 0); - - /* Let GC happen again. */ - unbind_to (count, Qnil); - - /* grab coordinates of last line */ - if (Dynarr_length (ddla)) - { - dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); - ypos = dl->ypos + dl->descent - dl->clip; - free_display_lines (ddla); - return make_int (ypos); - } - else - { - free_display_lines (ddla); - return Qnil; - } -} - static void clear_gutter (struct frame *f, enum gutter_pos pos) { @@ -686,14 +722,8 @@ See `default-gutter-position'. list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vgutter_border_width[new], Vdefault_gutter_border_width); - /* We don't really want the left and right gutters to default to - visible. */ - set_specifier_fallback (Vgutter_visible_p[cur], - cur == TOP_GUTTER || cur == BOTTOM_GUTTER ? - list1 (Fcons (Qnil, Qt)) - : list1 (Fcons (Qnil, Qnil))); - set_specifier_fallback (Vgutter_visible_p[new], - Vdefault_gutter_visible_p); + set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); + set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); Vdefault_gutter_position = position; unhold_frame_size_changes (); @@ -1158,7 +1188,7 @@ before being displayed. */ ); set_specifier_caching (Vdefault_gutter, offsetof (struct window, default_gutter), default_gutter_specs_changed, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("top-gutter", &Vgutter[TOP_GUTTER] /* @@ -1170,7 +1200,7 @@ See `default-gutter' for a description of a valid gutter instantiator. set_specifier_caching (Vgutter[TOP_GUTTER], offsetof (struct window, gutter[TOP_GUTTER]), top_gutter_specs_changed, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("bottom-gutter", &Vgutter[BOTTOM_GUTTER] /* @@ -1187,7 +1217,7 @@ displayed even if you provide a value for `bottom-gutter'. set_specifier_caching (Vgutter[BOTTOM_GUTTER], offsetof (struct window, gutter[BOTTOM_GUTTER]), bottom_gutter_specs_changed, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("left-gutter", &Vgutter[LEFT_GUTTER] /* @@ -1204,7 +1234,7 @@ displayed even if you provide a value for `left-gutter'. set_specifier_caching (Vgutter[LEFT_GUTTER], offsetof (struct window, gutter[LEFT_GUTTER]), left_gutter_specs_changed, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("right-gutter", &Vgutter[RIGHT_GUTTER] /* @@ -1221,7 +1251,7 @@ displayed even if you provide a value for `right-gutter'. set_specifier_caching (Vgutter[RIGHT_GUTTER], offsetof (struct window, gutter[RIGHT_GUTTER]), right_gutter_specs_changed, - 0, 0); + 0, 0, 1); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ @@ -1261,7 +1291,7 @@ is the default. set_specifier_caching (Vdefault_gutter_height, offsetof (struct window, default_gutter_height), default_gutter_size_changed_in_window, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* *Width of the default gutter, if it's oriented vertically. @@ -1269,11 +1299,11 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vdefault_gutter_width = Fmake_specifier (Qnatnum); + Vdefault_gutter_width = Fmake_specifier (Qgutter_size); set_specifier_caching (Vdefault_gutter_width, offsetof (struct window, default_gutter_width), default_gutter_size_changed_in_window, - 0, 0); + 0, 0, 1); DEFVAR_SPECIFIER ("top-gutter-height", &Vgutter_size[TOP_GUTTER] /* @@ -1285,7 +1315,7 @@ See `default-gutter-height' for more information. Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[TOP_GUTTER], offsetof (struct window, gutter_size[TOP_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("bottom-gutter-height", &Vgutter_size[BOTTOM_GUTTER] /* @@ -1297,7 +1327,7 @@ See `default-gutter-height' for more information. Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], offsetof (struct window, gutter_size[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("left-gutter-width", &Vgutter_size[LEFT_GUTTER] /* @@ -1306,10 +1336,10 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum); + Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[LEFT_GUTTER], offsetof (struct window, gutter_size[LEFT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 1); DEFVAR_SPECIFIER ("right-gutter-width", &Vgutter_size[RIGHT_GUTTER] /* @@ -1318,10 +1348,10 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); + Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size); set_specifier_caching (Vgutter_size[RIGHT_GUTTER], offsetof (struct window, gutter_size[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 1); fb = Qnil; #ifdef HAVE_TTY @@ -1339,15 +1369,14 @@ See `default-gutter-height' for more information. fb = Qnil; #ifdef HAVE_TTY - fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); + fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); #endif #ifdef HAVE_X_WINDOWS - fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb); + fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); - fb = Fcons (Fcons (list1 (Qmswindows), - make_int (DEFAULT_GUTTER_WIDTH)), fb); + fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); + fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); #endif if (!NILP (fb)) set_specifier_fallback (Vdefault_gutter_width, fb); @@ -1376,7 +1405,7 @@ instead. set_specifier_caching (Vdefault_gutter_border_width, offsetof (struct window, default_gutter_border_width), default_gutter_border_width_changed_in_window, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("top-gutter-border-width", &Vgutter_border_width[TOP_GUTTER] /* @@ -1389,7 +1418,7 @@ See `default-gutter-height' for more information. set_specifier_caching (Vgutter_border_width[TOP_GUTTER], offsetof (struct window, gutter_border_width[TOP_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-border-width", &Vgutter_border_width[BOTTOM_GUTTER] /* @@ -1402,7 +1431,7 @@ See `default-gutter-height' for more information. set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], offsetof (struct window, gutter_border_width[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("left-gutter-border-width", &Vgutter_border_width[LEFT_GUTTER] /* @@ -1415,7 +1444,7 @@ See `default-gutter-height' for more information. set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], offsetof (struct window, gutter_border_width[LEFT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 0); DEFVAR_SPECIFIER ("right-gutter-border-width", &Vgutter_border_width[RIGHT_GUTTER] /* @@ -1428,7 +1457,7 @@ See `default-gutter-height' for more information. set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], offsetof (struct window, gutter_border_width[RIGHT_GUTTER]), - gutter_geometry_changed_in_window, 0, 0); + gutter_geometry_changed_in_window, 0, 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1470,7 +1499,7 @@ visibility specifiers have a fallback value of true. offsetof (struct window, default_gutter_visible_p), default_gutter_visible_p_changed_in_window, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("top-gutter-visible-p", &Vgutter_visible_p[TOP_GUTTER] /* @@ -1483,7 +1512,7 @@ See `default-gutter-visible-p' for more information. set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], offsetof (struct window, gutter_visible_p[TOP_GUTTER]), - top_gutter_specs_changed, 0, 0); + top_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-visible-p", &Vgutter_visible_p[BOTTOM_GUTTER] /* @@ -1496,7 +1525,7 @@ See `default-gutter-visible-p' for more information. set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], offsetof (struct window, gutter_visible_p[BOTTOM_GUTTER]), - bottom_gutter_specs_changed, 0, 0); + bottom_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("left-gutter-visible-p", &Vgutter_visible_p[LEFT_GUTTER] /* @@ -1509,7 +1538,7 @@ See `default-gutter-visible-p' for more information. set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], offsetof (struct window, gutter_visible_p[LEFT_GUTTER]), - left_gutter_specs_changed, 0, 0); + left_gutter_specs_changed, 0, 0, 0); DEFVAR_SPECIFIER ("right-gutter-visible-p", &Vgutter_visible_p[RIGHT_GUTTER] /* @@ -1522,7 +1551,7 @@ See `default-gutter-visible-p' for more information. set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], offsetof (struct window, gutter_visible_p[RIGHT_GUTTER]), - right_gutter_specs_changed, 0, 0); + right_gutter_specs_changed, 0, 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ diff --git a/src/hpplay.c b/src/hpplay.c index d0a1bce..9036452 100644 --- a/src/hpplay.c +++ b/src/hpplay.c @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ Play .au sound files on hp9000s700 BUGS I have been unable to figure out how to use the volume feature, so no - attempts has been made to honor the volume arg of play_sound_* + attempt has been made to honor the volume arg of play_sound_* This means that all sounds are played at 100%. The gain parameter can be set by using the hp-play-gain variable. diff --git a/src/indent.c b/src/indent.c index 8aebdbc..0ef743f 100644 --- a/src/indent.c +++ b/src/indent.c @@ -272,11 +272,11 @@ If BUFFER is nil, the current buffer is assumed. DEFUN ("indent-to", Findent_to, 1, 3, "NIndent to column: ", /* Indent from point with tabs and spaces until COLUMN is reached. -Optional second argument MIN says always do at least MIN spaces - even if that goes past COLUMN; by default, MIN is zero. +Optional second argument MINIMUM says always do at least MINIMUM spaces + even if that goes past COLUMN; by default, MINIMUM is zero. If BUFFER is nil, the current buffer is assumed. */ - (col, minimum, buffer)) + (column, minimum, buffer)) { /* This function can GC */ int mincol; @@ -285,7 +285,7 @@ If BUFFER is nil, the current buffer is assumed. int tab_width = XINT (buf->tab_width); Bufpos opoint = 0; - CHECK_INT (col); + CHECK_INT (column); if (NILP (minimum)) minimum = Qzero; else @@ -295,7 +295,7 @@ If BUFFER is nil, the current buffer is assumed. fromcol = current_column (buf); mincol = fromcol + XINT (minimum); - if (mincol < XINT (col)) mincol = XINT (col); + if (mincol < XINT (column)) mincol = XINT (column); if (fromcol == mincol) return make_int (mincol); diff --git a/src/intl.c b/src/intl.c index a8a14d8..befca9b 100644 --- a/src/intl.c +++ b/src/intl.c @@ -168,16 +168,18 @@ x_get_composed_input (XKeyPressedEvent *x_key_event, XIC context, Lisp_Object Qdefer_gettext; DEFUN ("ignore-defer-gettext", Fignore_defer_gettext, 1, 1, 0, /* -If OBJ is of the form (defer-gettext "string"), return the string. +If OBJECT is of the form (defer-gettext "string"), return the string. The purpose of the defer-gettext symbol is to identify strings which are translated when they are referenced instead of when they are defined. */ - (obj)) + (object)) { - if (CONSP (obj) && SYMBOLP (Fcar (obj)) && EQ (Fcar (obj), Qdefer_gettext)) - return Fcar (Fcdr (obj)); + if (CONSP (object) + && SYMBOLP (Fcar (object)) + && EQ (Fcar (object), Qdefer_gettext)) + return Fcar (Fcdr (object)); else - return obj; + return object; } DEFUN ("gettext", Fgettext, 1, 1, 0, /* diff --git a/src/keymap.c b/src/keymap.c index 9cae3ab..1d6ef6e 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -795,9 +795,9 @@ it is not used except when printing the keymap. DEFUN ("make-sparse-keymap", Fmake_sparse_keymap, 0, 1, 0, /* Construct and return a new keymap object. All entries in it are nil, meaning "command undefined". The only -difference between this function and make-keymap is that this function +difference between this function and `make-keymap' is that this function returns a "smaller" keymap (one that is expected to contain fewer -entries). As keymaps dynamically resize, the distinction is not great. +entries). As keymaps dynamically resize, this distinction is not great. Optional argument NAME specifies a name to assign to the keymap, as in `set-keymap-name'. This name is only a debugging convenience; @@ -968,7 +968,7 @@ parents nor the current global map are searched for key bindings. } DEFUN ("keymapp", Fkeymapp, 1, 1, 0, /* -Return t if ARG is a keymap object. +Return t if OBJECT is a keymap object. The keymap may be autoloaded first if necessary. */ (object)) @@ -2181,8 +2181,8 @@ Nil is returned if KEYS is unbound. See documentation of `define-key' for valid key definitions and key-sequence specifications. A number is returned if KEYS is "too long"; that is, the leading characters fail to be a valid sequence of prefix characters in KEYMAP. -The number is how many characters at the front of KEYS -it takes to reach a non-prefix command. +The number is how many key strokes at the front of KEYS it takes to +reach a non-prefix command. */ (keymap, keys, accept_default)) { @@ -2535,7 +2535,7 @@ the documentation for `lookup-key' for more information. For key-presses, the order of keymaps searched is: - the `keymap' property of any extent(s) at point; - any applicable minor-mode maps; - - the current-local-map of the current-buffer; + - the current local map of the current-buffer; - the current global map. For mouse-clicks, the order of keymaps searched is: @@ -2545,9 +2545,9 @@ For mouse-clicks, the order of keymaps searched is: (this includes modeline extents); - the modeline-map of the buffer corresponding to the modeline under the mouse (if the click happened over a modeline); - - the value of toolbar-map in the current-buffer (if the click + - the value of `toolbar-map' in the current-buffer (if the click happened over a toolbar); - - the current-local-map of the buffer under the mouse (does not + - the current local map of the buffer under the mouse (does not apply to toolbar clicks); - any applicable minor-mode maps; - the current global map. diff --git a/src/lrecord.h b/src/lrecord.h index 1a39ab5..02d9b6a 100644 --- a/src/lrecord.h +++ b/src/lrecord.h @@ -477,11 +477,11 @@ MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash #define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \ -unsigned int lrecord_type_##c_name = lrecord_type_count++; \ -const struct lrecord_implementation lrecord_##c_name = \ +unsigned int lrecord_type_##c_name; \ +struct lrecord_implementation lrecord_##c_name = \ { name, marker, printer, nuker, equal, hash, desc, \ getprop, putprop, remprop, plist, size, sizer, \ - (enum lrecord_type)lrecord_type_##c_name, basic_p } + lrecord_type_last_built_in_type, basic_p } extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); @@ -492,6 +492,12 @@ extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); lrecord_implementations_table[lrecord_type_##type]->marker; \ } while (0) +#define INIT_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ + lrecord_type_##type = lrecord_type_count++; \ + lrecord_##type.lrecord_type_index = lrecord_type_##type; \ + INIT_LRECORD_IMPLEMENTATION(type); \ +} while (0) + #define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record) #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a)) @@ -646,7 +652,16 @@ extern Lisp_Object Q##c_name##p # define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ extern unsigned int lrecord_type_##c_name; \ -DECLARE_LRECORD(c_name, structtype) +extern struct lrecord_implementation lrecord_##c_name; \ +INLINE_HEADER structtype * \ +error_check_##c_name (Lisp_Object obj); \ +INLINE_HEADER structtype * \ +error_check_##c_name (Lisp_Object obj) \ +{ \ + assert (RECORD_TYPEP (obj, lrecord_type_##c_name)); \ + return (structtype *) XPNTR (obj); \ +} \ +extern Lisp_Object Q##c_name##p # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ INLINE_HEADER structtype * \ @@ -676,7 +691,7 @@ extern const struct lrecord_implementation lrecord_##c_name # define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ extern Lisp_Object Q##c_name##p; \ extern unsigned int lrecord_type_##c_name; \ -extern const struct lrecord_implementation lrecord_##c_name +extern struct lrecord_implementation lrecord_##c_name # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ extern Lisp_Object Q##c_name##p # define XRECORD(x, c_name, structtype) ((structtype *) XPNTR (x)) diff --git a/src/lstream.c b/src/lstream.c index 29427db..878449e 100644 --- a/src/lstream.c +++ b/src/lstream.c @@ -74,20 +74,21 @@ int Lstream_putc (Lstream *stream, int c) 0 on success, -1 on error. int Lstream_getc (Lstream *stream) - Read one byte from the stream. This is a macro and so it - is very efficient. The STREAM argument is evaluated more - than once. Return value is -1 for EOF or error. + Read one byte from the stream and returns it as an unsigned + char cast to an int, or EOF on end of file or error. + This is a macro and so it is very efficient. The STREAM + argument is evaluated more than once. void Lstream_ungetc (Lstream *stream, int c) - Push one byte back onto the input queue. This will be the - next byte read from the stream. Any number of bytes can be - pushed back and will be read in the reverse order they were - pushed back -- most recent first. (This is necessary for - consistency -- if there are a number of bytes that have been - unread and I read and unread a byte, it needs to be the first - to be read again.) This is a macro and so it is very - efficient. The C argument is only evaluated once but the - STREAM argument is evaluated more than once. + Push one byte back onto the input queue, cast to unsigned char. + This will be the next byte read from the stream. Any number + of bytes can be pushed back and will be read in the reverse + order they were pushed back -- most recent first. (This is + necessary for consistency -- if there are a number of bytes + that have been unread and I read and unread a byte, it needs + to be the first to be read again.) This is a macro and so it + is very efficient. The C argument is only evaluated once but + the STREAM argument is evaluated more than once. int Lstream_fputc (Lstream *stream, int c) int Lstream_fgetc (Lstream *stream) @@ -497,7 +498,7 @@ Lstream_was_blocked_p (Lstream *lstr) return lstr->imp->was_blocked_p ? lstr->imp->was_blocked_p (lstr) : 0; } -static int +static ssize_t Lstream_raw_read (Lstream *lstr, unsigned char *buffer, size_t size) { if (! (lstr->flags & LSTREAM_FL_IS_OPEN)) diff --git a/src/m/alpha.h b/src/m/alpha.h index c209390..b04dab5 100644 --- a/src/m/alpha.h +++ b/src/m/alpha.h @@ -19,10 +19,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef LINUX -# define SYSTEM_MALLOC -#endif - #ifdef OSF1 # define ORDINARY_LINK #endif diff --git a/src/macros.c b/src/macros.c index a163241..2995eb4 100644 --- a/src/macros.c +++ b/src/macros.c @@ -257,7 +257,7 @@ Execute MACRO as string of editor command characters. If MACRO is a symbol, its function definition is used. COUNT is a repeat count, or nil for once, or 0 for infinite loop. */ - (macro, prefixarg)) + (macro, count)) { /* This function can GC */ Lisp_Object final; @@ -267,10 +267,10 @@ COUNT is a repeat count, or nil for once, or 0 for infinite loop. struct gcpro gcpro1; struct console *con = XCONSOLE (Vselected_console); - if (!NILP (prefixarg)) + if (!NILP (count)) { - prefixarg = Fprefix_numeric_value (prefixarg); - repeat = XINT (prefixarg); + count = Fprefix_numeric_value (count); + repeat = XINT (count); } final = indirect_function (macro, 1); diff --git a/src/minibuf.c b/src/minibuf.c index 0c9d560..8b59cff 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -289,11 +289,11 @@ ignore_completion_p (Lisp_Object completion_string, } -/* #### Maybe we should allow ALIST to be a hash table. It is wrong - for the use of obarrays to be better-rewarded than the use of - hash tables. By better-rewarded I mean that you can pass an obarray - to all of the completion functions, whereas you can't do anything - like that with a hash table. +/* #### Maybe we should allow COLLECTION to be a hash table. + It is wrong for the use of obarrays to be better-rewarded than the + use of hash tables. By better-rewarded I mean that you can pass an + obarray to all of the completion functions, whereas you can't do + anything like that with a hash table. To do so, there should probably be a map_obarray_or_alist_or_hash_table function which would be used by @@ -301,26 +301,29 @@ ignore_completion_p (Lisp_Object completion_string, additional funcalls slow things down? */ DEFUN ("try-completion", Ftry_completion, 2, 3, 0, /* -Return common substring of all completions of STRING in ALIST. -Each car of each element of ALIST is tested to see if it begins with STRING. +Return common substring of all completions of STRING in COLLECTION. +COLLECTION must be an alist, an obarray, or a function. +Each string in COLLECTION is tested to see if it begins with STRING. All that match are compared together; the longest initial sequence -common to all matches is returned as a string. -If there is no match at all, nil is returned. -For an exact match, t is returned. +common to all matches is returned as a string. If there is no match +at all, nil is returned. For an exact match, t is returned. -ALIST can be an obarray instead of an alist. -Then the print names of all symbols in the obarray are the possible matches. +If COLLECTION is an alist, the cars of the elements of the alist +\(which must be strings) form the set of possible completions. -ALIST can also be a function to do the completion itself. -It receives three arguments: the values STRING, PREDICATE and nil. -Whatever it returns becomes the value of `try-completion'. +If COLLECTION is an obarray, the names of all symbols in the obarray +are the possible completions. -If optional third argument PREDICATE is non-nil, -it is used to test each possible match. -The match is a candidate only if PREDICATE returns non-nil. -The argument given to PREDICATE is the alist element or the symbol from the obarray. +If COLLECTION is a function, it is called with three arguments: the +values STRING, PREDICATE and nil. Whatever it returns becomes the +value of `try-completion'. + +If optional third argument PREDICATE is non-nil, it is used to test +each possible match. The match is a candidate only if PREDICATE +returns non-nil. The argument given to PREDICATE is the alist element +or the symbol from the obarray. */ - (string, alist, pred)) + (string, collection, predicate)) { /* This function can GC */ Lisp_Object bestmatch, tail; @@ -334,31 +337,31 @@ The argument given to PREDICATE is the alist element or the symbol from the obar CHECK_STRING (string); - if (CONSP (alist)) + if (CONSP (collection)) { - Lisp_Object tem = XCAR (alist); + Lisp_Object tem = XCAR (collection); if (SYMBOLP (tem)) /* lambda, autoload, etc. Emacs-lisp sucks */ - return call3 (alist, string, pred, Qnil); + return call3 (collection, string, predicate, Qnil); else list = 1; } - else if (VECTORP (alist)) + else if (VECTORP (collection)) list = 0; - else if (NILP (alist)) + else if (NILP (collection)) list = 1; else - return call3 (alist, string, pred, Qnil); + return call3 (collection, string, predicate, Qnil); bestmatch = Qnil; blength = 0; slength = XSTRING_CHAR_LENGTH (string); - /* If ALIST is not a list, set TAIL just for gc pro. */ - tail = alist; + /* If COLLECTION is not a list, set TAIL just for gc pro. */ + tail = collection; if (!list) { - obsize = XVECTOR_LENGTH (alist); - bucket = XVECTOR_DATA (alist)[indice]; + obsize = XVECTOR_LENGTH (collection); + bucket = XVECTOR_DATA (collection)[indice]; } else /* warning suppression */ { @@ -405,7 +408,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar break; else { - bucket = XVECTOR_DATA (alist)[indice]; + bucket = XVECTOR_DATA (collection)[indice]; continue; } } @@ -424,7 +427,7 @@ The argument given to PREDICATE is the alist element or the symbol from the obar struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int loser; GCPRO4 (tail, string, eltstring, bestmatch); - loser = ignore_completion_p (eltstring, pred, elt); + loser = ignore_completion_p (eltstring, predicate, elt); UNGCPRO; if (loser) /* reject this one */ continue; @@ -509,23 +512,27 @@ The argument given to PREDICATE is the alist element or the symbol from the obar DEFUN ("all-completions", Fall_completions, 2, 3, 0, /* -Search for partial matches to STRING in ALIST. -Each car of each element of ALIST is tested to see if it begins with STRING. -The value is a list of all the strings from ALIST that match. -ALIST can be an obarray instead of an alist. -Then the print names of all symbols in the obarray are the possible matches. - -ALIST can also be a function to do the completion itself. -It receives three arguments: the values STRING, PREDICATE and t. -Whatever it returns becomes the value of `all-completions'. - -If optional third argument PREDICATE is non-nil, -it is used to test each possible match. -The match is a candidate only if PREDICATE returns non-nil. -The argument given to PREDICATE is the alist element or -the symbol from the obarray. +Search for partial matches to STRING in COLLECTION. +COLLECTION must be an alist, an obarray, or a function. +Each string in COLLECTION is tested to see if it begins with STRING. +The value is a list of all the strings from COLLECTION that match. + +If COLLECTION is an alist, the cars of the elements of the alist +\(which must be strings) form the set of possible completions. + +If COLLECTION is an obarray, the names of all symbols in the obarray +are the possible completions. + +If COLLECTION is a function, it is called with three arguments: the +values STRING, PREDICATE and t. Whatever it returns becomes the +value of `all-completions'. + +If optional third argument PREDICATE is non-nil, it is used to test +each possible match. The match is a candidate only if PREDICATE +returns non-nil. The argument given to PREDICATE is the alist element +or the symbol from the obarray. */ - (string, alist, pred)) + (string, collection, predicate)) { /* This function can GC */ Lisp_Object tail; @@ -538,30 +545,30 @@ the symbol from the obarray. CHECK_STRING (string); - if (CONSP (alist)) + if (CONSP (collection)) { - Lisp_Object tem = XCAR (alist); + Lisp_Object tem = XCAR (collection); if (SYMBOLP (tem)) /* lambda, autoload, etc. Emacs-lisp sucks */ - return call3 (alist, string, pred, Qt); + return call3 (collection, string, predicate, Qt); else list = 1; } - else if (VECTORP (alist)) + else if (VECTORP (collection)) list = 0; - else if (NILP (alist)) + else if (NILP (collection)) list = 1; else - return call3 (alist, string, pred, Qt); + return call3 (collection, string, predicate, Qt); allmatches = Qnil; slength = XSTRING_CHAR_LENGTH (string); - /* If ALIST is not a list, set TAIL just for gc pro. */ - tail = alist; + /* If COLLECTION is not a list, set TAIL just for gc pro. */ + tail = collection; if (!list) { - obsize = XVECTOR_LENGTH (alist); - bucket = XVECTOR_DATA (alist)[indice]; + obsize = XVECTOR_LENGTH (collection); + bucket = XVECTOR_DATA (collection)[indice]; } else /* warning suppression */ { @@ -602,7 +609,7 @@ the symbol from the obarray. break; else { - bucket = XVECTOR_DATA (alist)[indice]; + bucket = XVECTOR_DATA (collection)[indice]; continue; } } @@ -611,11 +618,6 @@ the symbol from the obarray. if (STRINGP (eltstring) && (slength <= XSTRING_CHAR_LENGTH (eltstring)) - /* Reject alternatives that start with space - unless the input starts with space. */ - && ((XSTRING_CHAR_LENGTH (string) > 0 && - string_char (XSTRING (string), 0) == ' ') - || string_char (XSTRING (eltstring), 0) != ' ') && (0 > scmp (XSTRING_DATA (eltstring), XSTRING_DATA (string), slength))) @@ -624,7 +626,7 @@ the symbol from the obarray. struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int loser; GCPRO4 (tail, eltstring, allmatches, string); - loser = ignore_completion_p (eltstring, pred, elt); + loser = ignore_completion_p (eltstring, predicate, elt); UNGCPRO; if (!loser) /* Ok => put it on the list. */ diff --git a/src/mule-ccl.h b/src/mule-ccl.h index 6aac558..e7c5a40 100644 --- a/src/mule-ccl.h +++ b/src/mule-ccl.h @@ -1,5 +1,5 @@ /* Header for CCL (Code Conversion Language) interpreter. - Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. + Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. This file is part of XEmacs. @@ -19,8 +19,6 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF Emacs 20.3.10 */ - #ifndef INCLUDED_mule_ccl_h_ #define INCLUDED_mule_ccl_h_ @@ -44,8 +42,8 @@ struct ccl_program { condition flag of relational operations. */ int private_state; /* CCL instruction may use this - for private use, mainly for preservation - internal states for suspending. + for private use, mainly for saving + internal states on suspending. This variable is set to 0 when ccl is set up. */ int last_block; /* Set to 1 while processing the last @@ -55,19 +53,41 @@ struct ccl_program { many times bigger the output buffer should be than the input buffer. */ int stack_idx; /* How deep the call of CCL_Call is nested. */ + int eol_type; /* When the CCL program is used for + encoding by a coding system, set to + the eol_type of the coding + system. */ + int multibyte; /* 1 if the source text is multibyte. */ }; - #define CCL_MODE_ENCODING 0 #define CCL_MODE_DECODING 1 -int ccl_driver (struct ccl_program *ccl, const unsigned char *source, - unsigned_char_dynarr *destination, int src_bytes, - int *consumed, int conversion_mode); -void setup_ccl_program (struct ccl_program *ccl, Lisp_Object val); +#define CCL_CODING_EOL_LF 0 /* Line-feed only, same as Emacs' + internal format. */ +#define CCL_CODING_EOL_CRLF 1 /* Sequence of carriage-return and + line-feed. */ +#define CCL_CODING_EOL_CR 2 /* Carriage-return only. */ /* Alist of fontname patterns vs corresponding CCL program. */ extern Lisp_Object Vfont_ccl_encoder_alist; + +/* Setup fields of the structure pointed by CCL appropriately for the + execution of ccl program CCL_PROG (symbol or vector). */ +extern int setup_ccl_program (struct ccl_program *, Lisp_Object); + +extern int ccl_driver (struct ccl_program *, const unsigned char *, + unsigned_char_dynarr *, int, int *, int); + +EXFUN (Fregister_ccl_program, 2); + extern Lisp_Object Qccl_program; +/* Vector of CCL program names vs corresponding program data. */ +extern Lisp_Object Vccl_program_table; + +/* Symbols of ccl program have this property, a value of the property + is an index for Vccl_program_table. */ +extern Lisp_Object Qccl_program_idx; + #endif /* INCLUDED_mule_ccl_h_ */ diff --git a/src/mule-charset.h b/src/mule-charset.h index f098fff..46cd3a0 100644 --- a/src/mule-charset.h +++ b/src/mule-charset.h @@ -401,19 +401,19 @@ enum LEADING_BYTE_OFFICIAL_2 /* Is this a prefix for a private leading byte? */ -INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb); +INLINE_HEADER int LEADING_BYTE_PREFIX_P (Bufbyte lb); INLINE_HEADER int -LEADING_BYTE_PREFIX_P (unsigned char lb) +LEADING_BYTE_PREFIX_P (Bufbyte lb) { return (lb == PRE_LEADING_BYTE_PRIVATE_1 || lb == PRE_LEADING_BYTE_PRIVATE_2); } /* Given a private leading byte, return the leading byte prefix stored - in a string */ + in a string. */ #define PRIVATE_LEADING_BYTE_PREFIX(lb) \ - ((lb) < MIN_LEADING_BYTE_PRIVATE_2 ? \ + ((unsigned int) (lb) < MIN_LEADING_BYTE_PRIVATE_2 ? \ PRE_LEADING_BYTE_PRIVATE_1 : \ PRE_LEADING_BYTE_PRIVATE_2) @@ -423,13 +423,12 @@ LEADING_BYTE_PREFIX_P (unsigned char lb) /* of any format */ /************************************************************************/ -/* Argument `c' should be (unsigned int) or (unsigned char). */ -/* Note that SP and DEL are not included. */ +/* These are carefully designed to work if BYTE is signed or unsigned. */ +/* Note that SPC and DEL are considered ASCII, not control. */ -#define BYTE_ASCII_P(c) ((c) < 0x80) -#define BYTE_C0_P(c) ((c) < 0x20) -/* Do some forced casting just to make *sure* things are gotten right. */ -#define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20) +#define BYTE_ASCII_P(byte) (((byte) & ~0x7f) == 0) +#define BYTE_C0_P(byte) (((byte) & ~0x1f) == 0) +#define BYTE_C1_P(byte) (((byte) & ~0x1f) == 0x80) /************************************************************************/ @@ -437,13 +436,13 @@ LEADING_BYTE_PREFIX_P (unsigned char lb) /* in a Mule-formatted string */ /************************************************************************/ -/* Does this byte represent the first byte of a character? */ +/* Does BYTE represent the first byte of a character? */ -#define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) +#define BUFBYTE_FIRST_BYTE_P(byte) ((byte) < 0xA0) -/* Does this byte represent the first byte of a multi-byte character? */ +/* Does BYTE represent the first byte of a multi-byte character? */ -#define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) +#define BUFBYTE_LEADING_BYTE_P(byte) BYTE_C1_P (byte) /************************************************************************/ @@ -561,29 +560,33 @@ struct charset_lookup { Bufbyte next_allocated_2_byte_leading_byte; }; -extern struct charset_lookup *chlook; - -#ifdef ERROR_CHECK_TYPECHECK -/* int not Bufbyte even though that is the actual type of a leading byte. - This way, out-of-range values will get caught rather than automatically - truncated. */ -INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); +INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (Bufbyte lb); INLINE_HEADER Lisp_Object -CHARSET_BY_LEADING_BYTE (int lb) +CHARSET_BY_LEADING_BYTE (Bufbyte lb) { - assert (lb >= 0x80 && lb <= 0xFF); - return chlook->charset_by_leading_byte[lb - 128]; -} - -#else - -#define CHARSET_BY_LEADING_BYTE(lb) (chlook->charset_by_leading_byte[(lb) - 128]) + extern struct charset_lookup *chlook; +#ifdef ERROR_CHECK_TYPECHECK + /* When error-checking is on, x86 GCC 2.95.2 -O3 miscompiles the + following unless we introduce `tem'. */ + int tem = lb; + type_checking_assert (tem >= 0x80 && tem <= 0xFF); #endif + return chlook->charset_by_leading_byte[lb - 128]; +} -#define CHARSET_BY_ATTRIBUTES(type, final, dir) \ - (chlook->charset_by_attributes[type][final][dir]) +INLINE_HEADER Lisp_Object +CHARSET_BY_ATTRIBUTES (unsigned int type, unsigned char final, int dir); +INLINE_HEADER Lisp_Object +CHARSET_BY_ATTRIBUTES (unsigned int type, unsigned char final, int dir) +{ + extern struct charset_lookup *chlook; + type_checking_assert (type < countof (chlook->charset_by_attributes) && + final < countof (chlook->charset_by_attributes[0]) && + dir < countof (chlook->charset_by_attributes[0][0])); + return chlook->charset_by_attributes[type][final][dir]; +} /* Table of number of bytes in the string representation of a character indexed by the first byte of that representation. @@ -594,13 +597,11 @@ CHARSET_BY_LEADING_BYTE (int lb) extern const Bytecount rep_bytes_by_first_byte[0xA0]; /* Number of bytes in the string representation of a character. */ -INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb); +INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (Bufbyte fb); INLINE_HEADER int -REP_BYTES_BY_FIRST_BYTE (int fb) +REP_BYTES_BY_FIRST_BYTE (Bufbyte fb) { -#ifdef ERROR_CHECK_TYPECHECK - assert (0 <= fb && fb < 0xA0); -#endif + type_checking_assert (fb < 0xA0); return rep_bytes_by_first_byte[fb]; } diff --git a/src/mule-wnnfns.c b/src/mule-wnnfns.c index e6d2a34..6b40300 100644 --- a/src/mule-wnnfns.c +++ b/src/mule-wnnfns.c @@ -328,7 +328,7 @@ int lb_sisheng; DEFUN ("wnn-server-open", Fwnn_open, 2, 2, 0, /* Connect to jserver of host HNAME, make an environment with login name LNAME in the server. -Return nil if error occurs +Return nil if error occurs. */ (hname, lname)) { @@ -528,7 +528,7 @@ Return information of dictionaries. DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /* Set comment to dictionary specified by DIC-NUMBER. -Comment string COMMENT +Comment string COMMENT. */ (dicno, comment)) { @@ -771,7 +771,7 @@ Get bunsetsu information specified by BUN-NUMBER. DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, 0, 0, 0, /* -do nothing +do nothing. */ ()) { @@ -862,7 +862,7 @@ Update frequency of bunsetsu specified by NUM-NUMBER. DEFUN ("wnn-server-word-add", Fwnn_word_toroku, 5, 5, 0, /* Add a word to dictionary. Arguments are -DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER +DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER. */ (dicno, kanji, yomi, comment, hinsi)) { @@ -888,7 +888,7 @@ DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, 2, 2, 0, /* -Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER +Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER. */ (no, serial)) { @@ -904,7 +904,7 @@ Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER DEFUN ("wnn-server-word-use", Fwnn_word_use, 2, 2, 0, /* -Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER +Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER. */ (no, serial)) { @@ -955,7 +955,7 @@ Return list of yomi, kanji, comment, hindo, hinshi. DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, 3, 3, 0, /* Set frequency to arbitrary value. Specified by DIC-NUMBER, -SERIAL-NUMBER, FREQUENCY +SERIAL-NUMBER, FREQUENCY. */ (no, serial, hindo)) { diff --git a/src/objects-x.c b/src/objects-x.c index c0d87cd..2868f94 100644 --- a/src/objects-x.c +++ b/src/objects-x.c @@ -284,7 +284,7 @@ x_print_color_instance (Lisp_Color_Instance *c, Lisp_Object printcharfun, int escapeflag) { - Bufbyte buf[100]; + char buf[100]; XColor color = COLOR_INSTANCE_X_COLOR (c); sprintf (buf, " %ld=(%X,%X,%X)", color.pixel, color.red, color.green, color.blue); @@ -466,7 +466,7 @@ x_print_font_instance (Lisp_Font_Instance *f, Lisp_Object printcharfun, int escapeflag) { - Bufbyte buf[200]; + char buf[200]; sprintf (buf, " 0x%lx", (unsigned long) FONT_INSTANCE_X_FONT (f)->fid); write_c_string (buf, printcharfun); } @@ -577,7 +577,7 @@ valid_x_font_name_p (Display *dpy, Extbyte *name) might be more correct. */ int nnames = 0; - SExtbyte **names = 0; + Extbyte **names = 0; if (! name) return 0; names = XListFonts (dpy, name, 1, &nnames); @@ -687,7 +687,7 @@ static Extbyte * truename_via_XListFonts (Display *dpy, Extbyte *font_name) { Extbyte *result = 0; - SExtbyte **names; + Extbyte **names; int count = 0; #ifndef XOPENFONT_SORTS @@ -799,7 +799,7 @@ x_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb) return f->name; } } - return (FONT_INSTANCE_X_TRUENAME (f)); + return FONT_INSTANCE_X_TRUENAME (f); } static Lisp_Object @@ -808,22 +808,23 @@ x_font_instance_properties (Lisp_Font_Instance *f) struct device *d = XDEVICE (f->device); int i; Lisp_Object result = Qnil; - XFontProp *props; - Display *dpy; + Display *dpy = DEVICE_X_DISPLAY (d); + XFontProp *props = FONT_INSTANCE_X_FONT (f)->properties; - dpy = DEVICE_X_DISPLAY (d); - props = FONT_INSTANCE_X_FONT (f)->properties; for (i = FONT_INSTANCE_X_FONT (f)->n_properties - 1; i >= 0; i--) { Lisp_Object name, value; Atom atom = props [i].name; Bufbyte *name_str = 0; + size_t name_len; Extbyte *namestrext = XGetAtomName (dpy, atom); if (namestrext) - EXTERNAL_TO_C_STRING (namestrext, name_str, Qx_atom_name_encoding); + TO_INTERNAL_FORMAT (C_STRING, namestrext, + ALLOCA, (name_str, name_len), + Qx_atom_name_encoding); - name = (name_str ? intern (name_str) : Qnil); + name = (name_str ? intern ((char *) name_str) : Qnil); if (name_str && (atom == XA_FONT || atom == DEVICE_XATOM_FOUNDRY (d) || @@ -835,17 +836,17 @@ x_font_instance_properties (Lisp_Font_Instance *f) atom == DEVICE_XATOM_SPACING (d) || atom == DEVICE_XATOM_CHARSET_REGISTRY (d) || atom == DEVICE_XATOM_CHARSET_ENCODING (d) || - !strcmp (name_str, "CHARSET_COLLECTIONS") || - !strcmp (name_str, "FONTNAME_REGISTRY") || - !strcmp (name_str, "CLASSIFICATION") || - !strcmp (name_str, "COPYRIGHT") || - !strcmp (name_str, "DEVICE_FONT_NAME") || - !strcmp (name_str, "FULL_NAME") || - !strcmp (name_str, "MONOSPACED") || - !strcmp (name_str, "QUALITY") || - !strcmp (name_str, "RELATIVE_SET") || - !strcmp (name_str, "RELATIVE_WEIGHT") || - !strcmp (name_str, "STYLE"))) + !bufbyte_strcmp (name_str, "CHARSET_COLLECTIONS") || + !bufbyte_strcmp (name_str, "FONTNAME_REGISTRY") || + !bufbyte_strcmp (name_str, "CLASSIFICATION") || + !bufbyte_strcmp (name_str, "COPYRIGHT") || + !bufbyte_strcmp (name_str, "DEVICE_FONT_NAME") || + !bufbyte_strcmp (name_str, "FULL_NAME") || + !bufbyte_strcmp (name_str, "MONOSPACED") || + !bufbyte_strcmp (name_str, "QUALITY") || + !bufbyte_strcmp (name_str, "RELATIVE_SET") || + !bufbyte_strcmp (name_str, "RELATIVE_WEIGHT") || + !bufbyte_strcmp (name_str, "STYLE"))) { Extbyte *val_str = XGetAtomName (dpy, props [i].card32); @@ -863,7 +864,7 @@ x_font_instance_properties (Lisp_Font_Instance *f) static Lisp_Object x_list_fonts (Lisp_Object pattern, Lisp_Object device) { - SExtbyte **names; + Extbyte **names; int count = 0; Lisp_Object result = Qnil; const Extbyte *patternext; @@ -936,7 +937,7 @@ x_font_spec_matches_charset (struct device *d, Lisp_Object charset, static Lisp_Object x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset) { - SExtbyte **names; + Extbyte **names; int count = 0; Lisp_Object result = Qnil; const Extbyte *patternext; @@ -950,12 +951,15 @@ x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset) for (i = 0; i < count; i ++) { const Bufbyte *intname; + Bytecount intlen; - EXTERNAL_TO_C_STRING (names[i], intname, Qx_font_name_encoding); + TO_INTERNAL_FORMAT (C_STRING, names[i], + ALLOCA, (intname, intlen), + Qx_font_name_encoding); if (x_font_spec_matches_charset (XDEVICE (device), charset, intname, Qnil, 0, -1)) { - result = build_string (intname); + result = make_string (intname, intlen); break; } } diff --git a/src/process.c b/src/process.c index 5812151..405dc90 100644 --- a/src/process.c +++ b/src/process.c @@ -112,50 +112,50 @@ Lisp_Object Vnull_device; static Lisp_Object -mark_process (Lisp_Object obj) -{ - Lisp_Process *proc = XPROCESS (obj); - MAYBE_PROCMETH (mark_process_data, (proc)); - mark_object (proc->name); - mark_object (proc->command); - mark_object (proc->filter); - mark_object (proc->sentinel); - mark_object (proc->buffer); - mark_object (proc->mark); - mark_object (proc->pid); - mark_object (proc->pipe_instream); - mark_object (proc->pipe_outstream); +mark_process (Lisp_Object object) +{ + Lisp_Process *process = XPROCESS (object); + MAYBE_PROCMETH (mark_process_data, (process)); + mark_object (process->name); + mark_object (process->command); + mark_object (process->filter); + mark_object (process->sentinel); + mark_object (process->buffer); + mark_object (process->mark); + mark_object (process->pid); + mark_object (process->pipe_instream); + mark_object (process->pipe_outstream); #ifdef FILE_CODING - mark_object (proc->coding_instream); - mark_object (proc->coding_outstream); + mark_object (process->coding_instream); + mark_object (process->coding_outstream); #endif - return proc->status_symbol; + return process->status_symbol; } static void -print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +print_process (Lisp_Object object, Lisp_Object printcharfun, int escapeflag) { - Lisp_Process *proc = XPROCESS (obj); + Lisp_Process *process = XPROCESS (object); if (print_readably) error ("printing unreadable object #", - XSTRING_DATA (proc->name)); + XSTRING_DATA (process->name)); if (!escapeflag) { - print_internal (proc->name, printcharfun, 0); + print_internal (process->name, printcharfun, 0); } else { - int netp = network_connection_p (obj); + int netp = network_connection_p (object); write_c_string ((netp ? GETTEXT ("#name, printcharfun, 1); + print_internal (process->name, printcharfun, 1); write_c_string ((netp ? " " : " pid "), printcharfun); - print_internal (proc->pid, printcharfun, 1); + print_internal (process->pid, printcharfun, 1); write_c_string (" state:", printcharfun); - print_internal (proc->status_symbol, printcharfun, 1); - MAYBE_PROCMETH (print_process_data, (proc, printcharfun)); + print_internal (process->status_symbol, printcharfun, 1); + MAYBE_PROCMETH (print_process_data, (process, printcharfun)); write_c_string (">", printcharfun); } } @@ -215,9 +215,9 @@ get_process_from_usid (USID usid) if (gethash ((const void*)usid, usid_to_process, &vval)) { - Lisp_Object proc; - CVOID_TO_LISP (proc, vval); - return XPROCESS (proc); + Lisp_Object process; + CVOID_TO_LISP (process, vval); + return XPROCESS (process); } else return 0; @@ -252,17 +252,18 @@ network_connection_p (Lisp_Object process) DEFUN ("processp", Fprocessp, 1, 1, 0, /* Return t if OBJECT is a process. */ - (obj)) + (object)) { - return PROCESSP (obj) ? Qt : Qnil; + return PROCESSP (object) ? Qt : Qnil; } DEFUN ("process-live-p", Fprocess_live_p, 1, 1, 0, /* Return t if OBJECT is a process that is alive. */ - (obj)) + (object)) { - return PROCESSP (obj) && PROCESS_LIVE_P (XPROCESS (obj)) ? Qt : Qnil; + return PROCESSP (object) && PROCESS_LIVE_P (XPROCESS (object)) + ? Qt : Qnil; } DEFUN ("process-list", Fprocess_list, 0, 0, 0, /* @@ -274,27 +275,24 @@ Return a list of all processes. } DEFUN ("get-process", Fget_process, 1, 1, 0, /* -Return the process named NAME, or nil if there is none. +Return the process named PROCESS-NAME (a string), or nil if there is none. +PROCESS-NAME may also be a process; if so, the value is that process. */ - (name)) + (process_name)) { - Lisp_Object tail; - - if (PROCESSP (name)) - return name; + if (PROCESSP (process_name)) + return process_name; if (!gc_in_progress) /* this only gets called during GC when emacs is going away as a result of a signal or crash. */ - CHECK_STRING (name); + CHECK_STRING (process_name); - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) - { - Lisp_Object proc = XCAR (tail); - QUIT; - if (internal_equal (name, XPROCESS (proc)->name, 0)) - return XCAR (tail); - } + { + LIST_LOOP_2 (process, Vprocess_list) + if (internal_equal (process_name, XPROCESS (process)->name, 0)) + return process; + } return Qnil; } @@ -302,24 +300,17 @@ DEFUN ("get-buffer-process", Fget_buffer_process, 1, 1, 0, /* Return the (or, a) process associated with BUFFER. BUFFER may be a buffer or the name of one. */ - (name)) + (buffer)) { - Lisp_Object buf, tail, proc; + if (NILP (buffer)) return Qnil; + buffer = Fget_buffer (buffer); + if (NILP (buffer)) return Qnil; - if (NILP (name)) return Qnil; - buf = Fget_buffer (name); - if (NILP (buf)) return Qnil; - - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) - { - /* jwz: do not quit here - it isn't necessary, as there is no way for - Vprocess_list to get circular or overwhelmingly long, and this - function is called from layout_mode_element under redisplay. */ - /* QUIT; */ - proc = XCAR (tail); - if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) - return proc; - } + { + LIST_LOOP_2 (process, Vprocess_list) + if (EQ (XPROCESS (process)->buffer, buffer)) + return process; + } return Qnil; } @@ -331,7 +322,7 @@ BUFFER may be a buffer or the name of one. static Lisp_Object get_process (Lisp_Object name) { - Lisp_Object proc, obj; + Lisp_Object buffer; #ifdef I18N3 /* #### Look more closely into translating process names. */ @@ -341,36 +332,40 @@ get_process (Lisp_Object name) kill_buffer_processes() if emacs decides to abort(). */ if (PROCESSP (name)) return name; - - if (STRINGP (name)) + else if (STRINGP (name)) { - obj = Fget_process (name); - if (NILP (obj)) - obj = Fget_buffer (name); - if (NILP (obj)) - error ("Process %s does not exist", XSTRING_DATA (name)); + Lisp_Object object = Fget_process (name); + if (PROCESSP (object)) + return object; + + buffer = Fget_buffer (name); + if (BUFFERP (buffer)) + goto have_buffer_object; + + error ("Process %s does not exist", XSTRING_DATA (name)); } else if (NILP (name)) - obj = Fcurrent_buffer (); - else - obj = name; - - /* Now obj should be either a buffer object or a process object. - */ - if (BUFFERP (obj)) { - proc = Fget_buffer_process (obj); - if (NILP (proc)) - error ("Buffer %s has no process", XSTRING_DATA (XBUFFER(obj)->name)); + buffer = Fcurrent_buffer (); + goto have_buffer_object; } - else + else if (BUFFERP (name)) { - /* #### This was commented out. Although, simple - (kill-process 7 "qqq") resulted in a fatal error. - kkm */ - CHECK_PROCESS (obj); - proc = obj; + Lisp_Object process; + buffer = name; + + have_buffer_object: + process = Fget_buffer_process (buffer); + if (PROCESSP (process)) + return process; + + error ("Buffer %s has no process", + XSTRING_DATA (XBUFFER (buffer)->name)); } - return proc; + else + return get_process (Fsignal (Qwrong_type_argument, + (list2 (build_string ("process or buffer or nil"), + name)))); } DEFUN ("process-id", Fprocess_id, 1, 1, 0, /* @@ -379,13 +374,13 @@ This is the pid of the Unix process which PROCESS uses or talks to. For a network connection, this value is a cons of (foreign-network-port . foreign-host-name). */ - (proc)) + (process)) { Lisp_Object pid; - CHECK_PROCESS (proc); + CHECK_PROCESS (process); - pid = XPROCESS (proc)->pid; - if (network_connection_p (proc)) + pid = XPROCESS (process)->pid; + if (network_connection_p (process)) /* return Qnil; */ return Fcons (Fcar (pid), Fcdr (pid)); else @@ -397,10 +392,10 @@ Return the name of PROCESS, as a string. This is the name of the program invoked in PROCESS, possibly modified to make it unique among process names. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->name; + CHECK_PROCESS (process); + return XPROCESS (process)->name; } DEFUN ("process-command", Fprocess_command, 1, 1, 0, /* @@ -408,10 +403,10 @@ Return the command that was executed to start PROCESS. This is a list of strings, the first string being the program executed and the rest of the strings being the arguments given to it. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->command; + CHECK_PROCESS (process); + return XPROCESS (process)->command; } @@ -482,9 +477,9 @@ init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags) if (usid != USID_DONTHASH) { - Lisp_Object proc = Qnil; - XSETPROCESS (proc, p); - puthash ((const void*)usid, LISP_TO_VOID (proc), usid_to_process); + Lisp_Object process = Qnil; + XSETPROCESS (process, p); + puthash ((const void*)usid, LISP_TO_VOID (process), usid_to_process); } MAYBE_PROCMETH (init_process_io_handles, (p, in, out, flags)); @@ -522,16 +517,16 @@ create_process (Lisp_Object process, Lisp_Object *argv, int nargv, } /* This function is the unwind_protect form for Fstart_process_internal. If - PROC doesn't have its pid set, then we know someone has signalled + PROCESS doesn't have its pid set, then we know someone has signalled an error and the process wasn't started successfully, so we should remove it from the process list. */ -static void remove_process (Lisp_Object proc); +static void remove_process (Lisp_Object process); static Lisp_Object -start_process_unwind (Lisp_Object proc) +start_process_unwind (Lisp_Object process) { - /* Was PROC started successfully? */ - if (EQ (XPROCESS (proc)->pid, Qnil)) - remove_process (proc); + /* Was PROCESS started successfully? */ + if (EQ (XPROCESS (process)->pid, Qnil)) + remove_process (process); return Qnil; } @@ -553,7 +548,7 @@ INCODE and OUTCODE specify the coding-system objects used in input/output { /* This function can call lisp */ /* !!#### This function has not been Mule-ized */ - Lisp_Object buffer, name, program, proc, current_dir; + Lisp_Object buffer, name, program, process, current_dir; Lisp_Object tem; int speccount = specpdl_depth (); struct gcpro gcpro1, gcpro2, gcpro3; @@ -626,27 +621,27 @@ INCODE and OUTCODE specify the coding-system objects used in input/output invalid_operation ("Specified program for new process is a directory", program); - proc = make_process_internal (name); + process = make_process_internal (name); - XPROCESS (proc)->buffer = buffer; - XPROCESS (proc)->command = Flist (nargs - 2, + XPROCESS (process)->buffer = buffer; + XPROCESS (process)->command = Flist (nargs - 2, args + 2); /* Make the process marker point into the process buffer (if any). */ if (!NILP (buffer)) - Fset_marker (XPROCESS (proc)->mark, + Fset_marker (XPROCESS (process)->mark, make_int (BUF_ZV (XBUFFER (buffer))), buffer); /* If an error occurs and we can't start the process, we want to remove it from the process list. This means that each error check in create_process doesn't need to call remove_process itself; it's all taken care of here. */ - record_unwind_protect (start_process_unwind, proc); + record_unwind_protect (start_process_unwind, process); - create_process (proc, args + 3, nargs - 3, program, current_dir); + create_process (process, args + 3, nargs - 3, program, current_dir); UNGCPRO; - return unbind_to (speccount, proc); + return unbind_to (speccount, process); } @@ -681,7 +676,7 @@ INCODE and OUTCODE specify the coding-system objects used in input/output DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5, 0, /* Open a TCP connection for a service to a host. -Return a subprocess-object to represent the connection. +Return a process object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. NAME is name for process. It is modified if necessary to make it unique. @@ -690,10 +685,11 @@ BUFFER is the buffer (or buffer-name) to associate with the process. an output stream or filter function to handle the output. BUFFER may also be nil, meaning that this process is not associated with any buffer. -Third arg is name of the host to connect to, or its IP address. -Fourth arg SERVICE is name of the service desired, or an integer - specifying a port number to connect to. -Fifth argument PROTOCOL is a network protocol. Currently 'tcp +Third arg HOST (a string) is the name of the host to connect to, + or its IP address. +Fourth arg SERVICE is the name of the service desired (a string), + or an integer specifying a port number to connect to. +Optional fifth arg PROTOCOL is a network protocol. Currently only 'tcp (Transmission Control Protocol) and 'udp (User Datagram Protocol) are supported. When omitted, 'tcp is assumed. @@ -701,14 +697,14 @@ Output via `process-send-string' and input via buffer or filter (see `set-process-filter') are stream-oriented. That means UDP datagrams are not guaranteed to be sent and received in discrete packets. (But small datagrams around 500 bytes that are not truncated by `process-send-string' -are usually fine.) Note further that UDP protocol does not guard against -lost packets. +are usually fine.) Note further that the UDP protocol does not guard +against lost packets. */ (name, buffer, host, service, protocol)) { /* !!#### This function has not been Mule-ized */ /* This function can GC */ - Lisp_Object proc = Qnil; + Lisp_Object process = Qnil; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, ngcpro1; void *inch, *outch; @@ -727,26 +723,26 @@ lost packets. if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); - proc = make_process_internal (name); - NGCPRO1 (proc); + process = make_process_internal (name); + NGCPRO1 (process); - XPROCESS (proc)->pid = Fcons (service, host); - XPROCESS (proc)->buffer = buffer; - init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, + XPROCESS (process)->pid = Fcons (service, host); + XPROCESS (process)->buffer = buffer; + init_process_io_handles (XPROCESS (process), (void*)inch, (void*)outch, STREAM_NETWORK_CONNECTION); - event_stream_select_process (XPROCESS (proc)); + event_stream_select_process (XPROCESS (process)); UNGCPRO; NUNGCPRO; - return proc; + return process; } #ifdef HAVE_MULTICAST DEFUN ("open-multicast-group-internal", Fopen_multicast_group_internal, 5, 5, 0, /* Open a multicast connection on the specified dest/port/ttl. -Return a subprocess-object to represent the connection. +Return a process object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. NAME is name for process. It is modified if necessary to make it unique. @@ -764,7 +760,7 @@ Third, fourth and fifth args are the multicast destination group, port and ttl. { /* !!#### This function has not been Mule-ized */ /* This function can GC */ - Lisp_Object proc = Qnil; + Lisp_Object process = Qnil; struct gcpro gcpro1; void *inch, *outch; @@ -778,18 +774,18 @@ Third, fourth and fifth args are the multicast destination group, port and ttl. if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); - proc = make_process_internal (name); - GCPRO1 (proc); + process = make_process_internal (name); + GCPRO1 (process); - XPROCESS (proc)->pid = Fcons (port, dest); - XPROCESS (proc)->buffer = buffer; - init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, + XPROCESS (process)->pid = Fcons (port, dest); + XPROCESS (process)->buffer = buffer; + init_process_io_handles (XPROCESS (process), (void*)inch, (void*)outch, STREAM_NETWORK_CONNECTION); - event_stream_select_process (XPROCESS (proc)); + event_stream_select_process (XPROCESS (process)); UNGCPRO; - return proc; + return process; } #endif /* HAVE_MULTICAST */ @@ -805,13 +801,14 @@ canonicalize_host_name (Lisp_Object host) DEFUN ("set-process-window-size", Fset_process_window_size, 3, 3, 0, /* Tell PROCESS that it has logical window size HEIGHT and WIDTH. */ - (proc, height, width)) + (process, height, width)) { - CHECK_PROCESS (proc); + CHECK_PROCESS (process); CHECK_NATNUM (height); CHECK_NATNUM (width); return - MAYBE_INT_PROCMETH (set_window_size, (XPROCESS (proc), XINT (height), XINT (width))) <= 0 + MAYBE_INT_PROCMETH (set_window_size, + (XPROCESS (process), XINT (height), XINT (width))) <= 0 ? Qnil : Qt; } @@ -829,13 +826,13 @@ Tell PROCESS that it has logical window size HEIGHT and WIDTH. you must call it repeatedly until it returns zero. */ Charcount -read_process_output (Lisp_Object proc) +read_process_output (Lisp_Object process) { /* This function can GC */ Bytecount nbytes, nchars; Bufbyte chars[1024]; Lisp_Object outstream; - Lisp_Process *p = XPROCESS (proc); + Lisp_Process *p = XPROCESS (process); /* If there is a lot of output from the subprocess, the loop in execute_internal_event() might call read_process_output() more @@ -856,7 +853,7 @@ read_process_output (Lisp_Object proc) Vdeactivate_mark and current_buffer->keymap */ running_asynch_code = 1; filter_result = call2_trapping_errors ("Error in process filter", - p->filter, proc, Qnil); + p->filter, process, Qnil); running_asynch_code = 0; restore_match_data (); CHECK_INT (filter_result); @@ -874,7 +871,7 @@ read_process_output (Lisp_Object proc) call2_trapping_errors() does that for us. */ running_asynch_code = 1; call2_trapping_errors ("Error in process filter", - outstream, proc, make_string (chars, nbytes)); + outstream, process, make_string (chars, nbytes)); running_asynch_code = 0; restore_match_data (); return nchars; @@ -891,7 +888,7 @@ read_process_output (Lisp_Object proc) struct gcpro gcpro1, gcpro2; struct buffer *buf = XBUFFER (p->buffer); - GCPRO2 (proc, old_read_only); + GCPRO2 (process, old_read_only); old_point = BUF_PT (buf); old_begv = BUF_BEGV (buf); @@ -970,7 +967,7 @@ read_process_output (Lisp_Object proc) /* Sending data to subprocess */ -/* send some data to process PROC. If NONRELOCATABLE is non-NULL, it +/* send some data to process PROCESS. If NONRELOCATABLE is non-NULL, it specifies the address of the data. Otherwise, the data comes from the object RELOCATABLE (either a string or a buffer). START and LEN specify the offset and length of the data to send. @@ -979,7 +976,7 @@ read_process_output (Lisp_Object proc) and in Bytecounts otherwise. */ void -send_process (Lisp_Object proc, +send_process (Lisp_Object process, Lisp_Object relocatable, const Bufbyte *nonrelocatable, int start, int len) { @@ -987,10 +984,10 @@ send_process (Lisp_Object proc, struct gcpro gcpro1, gcpro2; Lisp_Object lstream = Qnil; - GCPRO2 (proc, lstream); + GCPRO2 (process, lstream); - if (NILP (DATA_OUTSTREAM (XPROCESS (proc)))) - signal_simple_error ("Process not open for writing", proc); + if (NILP (DATA_OUTSTREAM (XPROCESS (process)))) + signal_simple_error ("Process not open for writing", process); if (nonrelocatable) lstream = @@ -1001,7 +998,7 @@ send_process (Lisp_Object proc, else lstream = make_lisp_string_input_stream (relocatable, start, len); - PROCMETH (send_process, (proc, XLSTREAM (lstream))); + PROCMETH (send_process, (process, XLSTREAM (lstream))); UNGCPRO; Lstream_delete (XLSTREAM (lstream)); @@ -1012,21 +1009,21 @@ Return the name of the terminal PROCESS uses, or nil if none. This is the terminal that the process itself reads and writes on, not the name of the pty that Emacs uses to talk with that terminal. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return MAYBE_LISP_PROCMETH (get_tty_name, (XPROCESS (proc))); + CHECK_PROCESS (process); + return MAYBE_LISP_PROCMETH (get_tty_name, (XPROCESS (process))); } DEFUN ("set-process-buffer", Fset_process_buffer, 2, 2, 0, /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). */ - (proc, buffer)) + (process, buffer)) { - CHECK_PROCESS (proc); + CHECK_PROCESS (process); if (!NILP (buffer)) CHECK_BUFFER (buffer); - XPROCESS (proc)->buffer = buffer; + XPROCESS (process)->buffer = buffer; return buffer; } @@ -1035,34 +1032,34 @@ Return the buffer PROCESS is associated with. Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->buffer; + CHECK_PROCESS (process); + return XPROCESS (process)->buffer; } DEFUN ("process-mark", Fprocess_mark, 1, 1, 0, /* Return the marker for the end of the last output from PROCESS. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->mark; + CHECK_PROCESS (process); + return XPROCESS (process)->mark; } void -set_process_filter (Lisp_Object proc, Lisp_Object filter, int filter_does_read) +set_process_filter (Lisp_Object process, Lisp_Object filter, int filter_does_read) { - CHECK_PROCESS (proc); - if (PROCESS_LIVE_P (XPROCESS (proc))) { + CHECK_PROCESS (process); + if (PROCESS_LIVE_P (XPROCESS (process))) { if (EQ (filter, Qt)) - event_stream_unselect_process (XPROCESS (proc)); + event_stream_unselect_process (XPROCESS (process)); else - event_stream_select_process (XPROCESS (proc)); + event_stream_select_process (XPROCESS (process)); } - XPROCESS (proc)->filter = filter; - XPROCESS (proc)->filter_does_read = filter_does_read; + XPROCESS (process)->filter = filter; + XPROCESS (process)->filter_does_read = filter_does_read; } DEFUN ("set-process-filter", Fset_process_filter, 2, 2, 0, /* @@ -1073,9 +1070,9 @@ the entire string of output is passed to the filter. The filter gets two arguments: the process and the string of output. If the process has a filter, its buffer is not used for output. */ - (proc, filter)) + (process, filter)) { - set_process_filter (proc, filter, 0); + set_process_filter (process, filter, 0); return filter; } @@ -1083,56 +1080,57 @@ DEFUN ("process-filter", Fprocess_filter, 1, 1, 0, /* Return the filter function of PROCESS; nil if none. See `set-process-filter' for more info on filter functions. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->filter; + CHECK_PROCESS (process); + return XPROCESS (process)->filter; } DEFUN ("process-send-region", Fprocess_send_region, 3, 4, 0, /* Send current contents of the region between START and END as input to PROCESS. -PROCESS may be a process name or an actual process. +PROCESS may be a process or the name of a process, or a buffer or the +name of a buffer, in which case the buffer's process is used. If it +is nil, the current buffer's process is used. BUFFER specifies the buffer to look in; if nil, the current buffer is used. -If the region is more than 500 or so characters long, -it is sent in several bunches. This may happen even for shorter regions. -Output from processes can arrive in between bunches. +If STRING is more than 100 or so characters long, it may be sent in +several chunks. This may happen even for shorter strings. Output +from processes can arrive in between chunks. */ (process, start, end, buffer)) { /* This function can GC */ - Lisp_Object proc = get_process (process); - Bufpos st, en; + Bufpos bstart, bend; struct buffer *buf = decode_buffer (buffer, 0); XSETBUFFER (buffer, buf); - get_buffer_range_char (buf, start, end, &st, &en, 0); + process = get_process (process); + get_buffer_range_char (buf, start, end, &bstart, &bend, 0); - send_process (proc, buffer, 0, st, en - st); + send_process (process, buffer, 0, bstart, bend - bstart); return Qnil; } DEFUN ("process-send-string", Fprocess_send_string, 2, 4, 0, /* Send PROCESS the contents of STRING as input. -PROCESS may be a process name or an actual process. -Optional arguments FROM and TO specify part of STRING, see `substring'. -If STRING is more than 500 or so characters long, -it is sent in several bunches. This may happen even for shorter strings. -Output from processes can arrive in between bunches. +PROCESS may be a process or the name of a process, or a buffer or the +name of a buffer, in which case the buffer's process is used. If it +is nil, the current buffer's process is used. +Optional arguments START and END specify part of STRING; see `substring'. +If STRING is more than 100 or so characters long, it may be sent in +several chunks. This may happen even for shorter strings. Output +from processes can arrive in between chunks. */ - (process, string, from, to)) + (process, string, start, end)) { /* This function can GC */ - Lisp_Object proc; - Bytecount len; - Bytecount bfr, bto; + Bytecount bstart, bend; - proc = get_process (process); + process = get_process (process); CHECK_STRING (string); - get_string_range_byte (string, from, to, &bfr, &bto, + get_string_range_byte (string, start, end, &bstart, &bend, GB_HISTORICAL_STRING_BEHAVIOR); - len = bto - bfr; - send_process (proc, string, 0, bfr, len); + send_process (process, string, 0, bstart, bend - bstart); return Qnil; } @@ -1234,11 +1232,11 @@ exec_sentinel_unwind (Lisp_Object datum) } static void -exec_sentinel (Lisp_Object proc, Lisp_Object reason) +exec_sentinel (Lisp_Object process, Lisp_Object reason) { /* This function can GC */ int speccount = specpdl_depth (); - Lisp_Process *p = XPROCESS (proc); + Lisp_Process *p = XPROCESS (process); Lisp_Object sentinel = p->sentinel; if (NILP (sentinel)) @@ -1250,11 +1248,11 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason) /* Zilch the sentinel while it's running, to avoid recursive invocations; assure that it gets restored no matter how the sentinel exits. */ p->sentinel = Qnil; - record_unwind_protect (exec_sentinel_unwind, noseeum_cons (proc, sentinel)); + record_unwind_protect (exec_sentinel_unwind, noseeum_cons (process, sentinel)); /* We used to bind inhibit-quit to t here, but call2_trapping_errors() does that for us. */ running_asynch_code = 1; - call2_trapping_errors ("Error in process sentinel", sentinel, proc, reason); + call2_trapping_errors ("Error in process sentinel", sentinel, process, reason); running_asynch_code = 0; restore_match_data (); unbind_to (speccount, Qnil); @@ -1265,10 +1263,10 @@ Give PROCESS the sentinel SENTINEL; nil for none. The sentinel is called as a function when the process changes state. It gets two arguments: the process, and a string describing the change. */ - (proc, sentinel)) + (process, sentinel)) { - CHECK_PROCESS (proc); - XPROCESS (proc)->sentinel = sentinel; + CHECK_PROCESS (process); + XPROCESS (process)->sentinel = sentinel; return sentinel; } @@ -1276,10 +1274,10 @@ DEFUN ("process-sentinel", Fprocess_sentinel, 1, 1, 0, /* Return the sentinel of PROCESS; nil if none. See `set-process-sentinel' for more info on sentinels. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->sentinel; + CHECK_PROCESS (process); + return XPROCESS (process)->sentinel; } @@ -1367,7 +1365,7 @@ status_notify (void) Lisp_Object msg = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; /* process_tick is volatile, so we have to remember it now. - Otherwise, we get a race condition is SIGCHLD happens during + Otherwise, we get a race condition if SIGCHLD happens during this function. (Actually, this is not the case anymore. The code to @@ -1391,8 +1389,8 @@ status_notify (void) for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) { - Lisp_Object proc = XCAR (tail); - Lisp_Process *p = XPROCESS (proc); + Lisp_Object process = XCAR (tail); + Lisp_Process *p = XPROCESS (process); /* p->tick is also volatile. Same thing as above applies. */ int this_process_tick; @@ -1409,7 +1407,7 @@ status_notify (void) /* If process is still active, read any output that remains. */ while (!EQ (p->filter, Qt) - && read_process_output (proc) > 0) + && read_process_output (process) > 0) ; /* Get the text to use for the message. */ @@ -1422,14 +1420,14 @@ status_notify (void) || EQ (symbol, Qexit)) { if (delete_exited_processes) - remove_process (proc); + remove_process (process); else - deactivate_process (proc); + deactivate_process (process); } /* Now output the message suitably. */ if (!NILP (p->sentinel)) - exec_sentinel (proc, msg); + exec_sentinel (process, msg); /* Don't bother with a message in the buffer when a process becomes runnable. */ else if (!EQ (symbol, Qrun) && !NILP (p->buffer)) @@ -1503,20 +1501,20 @@ nil -- if arg is a process name and no such process exists. PROCESS may be a process, a buffer, the name of a process or buffer, or nil, indicating the current buffer's process. */ - (proc)) + (process)) { Lisp_Object status_symbol; - if (STRINGP (proc)) - proc = Fget_process (proc); + if (STRINGP (process)) + process = Fget_process (process); else - proc = get_process (proc); + process = get_process (process); - if (NILP (proc)) + if (NILP (process)) return Qnil; - status_symbol = XPROCESS (proc)->status_symbol; - if (network_connection_p (proc)) + status_symbol = XPROCESS (process)->status_symbol; + if (network_connection_p (process)) { if (EQ (status_symbol, Qrun)) status_symbol = Qopen; @@ -1530,10 +1528,10 @@ DEFUN ("process-exit-status", Fprocess_exit_status, 1, 1, 0, /* Return the exit status of PROCESS or the signal number that killed it. If PROCESS has not yet exited or died, return 0. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return make_int (XPROCESS (proc)->exit_code); + CHECK_PROCESS (process); + return make_int (XPROCESS (process)->exit_code); } @@ -1714,14 +1712,14 @@ process_send_signal (Lisp_Object process, int signo, int current_group, int nomsg) { /* This function can GC */ - Lisp_Object proc = get_process (process); + process = get_process (process); - if (network_connection_p (proc)) + if (network_connection_p (process)) error ("Network connection %s is not a subprocess", - XSTRING_DATA (XPROCESS(proc)->name)); - CHECK_LIVE_PROCESS (proc); + XSTRING_DATA (XPROCESS(process)->name)); + CHECK_LIVE_PROCESS (process); - MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg)); + MAYBE_PROCMETH (kill_child_process, (process, signo, current_group, nomsg)); } DEFUN ("process-send-signal", Fprocess_send_signal, 1, 3, 0, /* @@ -1840,21 +1838,21 @@ text to PROCESS after you call this function. (process)) { /* This function can GC */ - Lisp_Object proc = get_process (process); + process = get_process (process); /* Make sure the process is really alive. */ - if (! EQ (XPROCESS (proc)->status_symbol, Qrun)) - error ("Process %s not running", XSTRING_DATA (XPROCESS (proc)->name)); + if (! EQ (XPROCESS (process)->status_symbol, Qrun)) + error ("Process %s not running", XSTRING_DATA (XPROCESS (process)->name)); - if (!MAYBE_INT_PROCMETH (process_send_eof, (proc))) + if (!MAYBE_INT_PROCMETH (process_send_eof, (process))) { - if (!NILP (DATA_OUTSTREAM (XPROCESS (proc)))) + if (!NILP (DATA_OUTSTREAM (XPROCESS (process)))) { - Lstream_close (XLSTREAM (DATA_OUTSTREAM (XPROCESS (proc)))); - event_stream_delete_stream_pair (Qnil, XPROCESS (proc)->pipe_outstream); - XPROCESS (proc)->pipe_outstream = Qnil; + Lstream_close (XLSTREAM (DATA_OUTSTREAM (XPROCESS (process)))); + event_stream_delete_stream_pair (Qnil, XPROCESS (process)->pipe_outstream); + XPROCESS (process)->pipe_outstream = Qnil; #ifdef FILE_CODING - XPROCESS (proc)->coding_outstream = Qnil; + XPROCESS (process)->coding_outstream = Qnil; #endif } } @@ -1868,9 +1866,9 @@ text to PROCESS after you call this function. /************************************************************************/ void -deactivate_process (Lisp_Object proc) +deactivate_process (Lisp_Object process) { - Lisp_Process *p = XPROCESS (proc); + Lisp_Process *p = XPROCESS (process); USID usid; /* It's possible that we got as far in the process-creation @@ -1908,25 +1906,25 @@ deactivate_process (Lisp_Object proc) } static void -remove_process (Lisp_Object proc) +remove_process (Lisp_Object process) { - Vprocess_list = delq_no_quit (proc, Vprocess_list); - Fset_marker (XPROCESS (proc)->mark, Qnil, Qnil); + Vprocess_list = delq_no_quit (process, Vprocess_list); + Fset_marker (XPROCESS (process)->mark, Qnil, Qnil); - deactivate_process (proc); + deactivate_process (process); } DEFUN ("delete-process", Fdelete_process, 1, 1, 0, /* Delete PROCESS: kill it and forget about it immediately. PROCESS may be a process or the name of one, or a buffer name. */ - (proc)) + (process)) { /* This function can GC */ Lisp_Process *p; - proc = get_process (proc); - p = XPROCESS (proc); - if (network_connection_p (proc)) + process = get_process (process); + p = XPROCESS (process); + if (network_connection_p (process)) { p->status_symbol = Qexit; p->exit_code = 0; @@ -1936,7 +1934,7 @@ PROCESS may be a process or the name of one, or a buffer name. } else if (PROCESS_LIVE_P (p)) { - Fkill_process (proc, Qnil); + Fkill_process (process, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ p->status_symbol = Qsignal; p->exit_code = SIGKILL; @@ -1945,7 +1943,7 @@ PROCESS may be a process or the name of one, or a buffer name. process_tick++; status_notify (); } - remove_process (proc); + remove_process (process); return Qnil; } @@ -1955,21 +1953,14 @@ PROCESS may be a process or the name of one, or a buffer name. void kill_buffer_processes (Lisp_Object buffer) { - Lisp_Object tail; - - for (tail = Vprocess_list; CONSP (tail); - tail = XCDR (tail)) - { - Lisp_Object proc = XCAR (tail); - if (PROCESSP (proc) - && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) - { - if (network_connection_p (proc)) - Fdelete_process (proc); - else if (PROCESS_LIVE_P (XPROCESS (proc))) - process_send_signal (proc, SIGHUP, 0, 1); - } - } + LIST_LOOP_2 (process, Vprocess_list) + if ((NILP (buffer) || EQ (XPROCESS (process)->buffer, buffer))) + { + if (network_connection_p (process)) + Fdelete_process (process); + else if (PROCESS_LIVE_P (XPROCESS (process))) + process_send_signal (process, SIGHUP, 0, 1); + } } DEFUN ("process-kill-without-query", Fprocess_kill_without_query, 1, 2, 0, /* @@ -1977,24 +1968,24 @@ Say no query needed if PROCESS is running when Emacs is exited. Optional second argument if non-nil says to require a query. Value is t if a query was formerly required. */ - (proc, require_query_p)) + (process, require_query_p)) { int tem; - CHECK_PROCESS (proc); - tem = XPROCESS (proc)->kill_without_query; - XPROCESS (proc)->kill_without_query = NILP (require_query_p); + CHECK_PROCESS (process); + tem = XPROCESS (process)->kill_without_query; + XPROCESS (process)->kill_without_query = NILP (require_query_p); return tem ? Qnil : Qt; } DEFUN ("process-kill-without-query-p", Fprocess_kill_without_query_p, 1, 1, 0, /* -Whether PROC will be killed without query if running when emacs is exited. +Return t if PROCESS will be killed without query when emacs is exited. */ - (proc)) + (process)) { - CHECK_PROCESS (proc); - return XPROCESS (proc)->kill_without_query ? Qt : Qnil; + CHECK_PROCESS (process); + return XPROCESS (process)->kill_without_query ? Qt : Qnil; } diff --git a/src/rangetab.c b/src/rangetab.c index afc1cc1..50a8735 100644 --- a/src/rangetab.c +++ b/src/rangetab.c @@ -241,16 +241,17 @@ You can manipulate it using `put-range-table', `get-range-table', } DEFUN ("copy-range-table", Fcopy_range_table, 1, 1, 0, /* -Make a new range table which contains the same values for the same -ranges as the given table. The values will not themselves be copied. +Return a new range table which is a copy of RANGE-TABLE. +It will contain the same values for the same ranges as RANGE-TABLE. +The values will not themselves be copied. */ - (old_table)) + (range_table)) { Lisp_Range_Table *rt, *rtnew; Lisp_Object obj; - CHECK_RANGE_TABLE (old_table); - rt = XRANGE_TABLE (old_table); + CHECK_RANGE_TABLE (range_table); + rt = XRANGE_TABLE (range_table); rtnew = alloc_lcrecord_type (Lisp_Range_Table, &lrecord_range_table); rtnew->entries = Dynarr_new (range_table_entry); @@ -262,15 +263,15 @@ ranges as the given table. The values will not themselves be copied. } DEFUN ("get-range-table", Fget_range_table, 2, 3, 0, /* -Find value for position POS in TABLE. +Find value for position POS in RANGE-TABLE. If there is no corresponding value, return DEFAULT (defaults to nil). */ - (pos, table, default_)) + (pos, range_table, default_)) { Lisp_Range_Table *rt; - CHECK_RANGE_TABLE (table); - rt = XRANGE_TABLE (table); + CHECK_RANGE_TABLE (range_table); + rt = XRANGE_TABLE (range_table); CHECK_INT_COERCE_CHAR (pos); @@ -403,13 +404,13 @@ put_range_table (Lisp_Object table, EMACS_INT first, } DEFUN ("put-range-table", Fput_range_table, 4, 4, 0, /* -Set the value for range (START, END) to be VAL in TABLE. +Set the value for range (START, END) to be VALUE in RANGE-TABLE. */ - (start, end, val, table)) + (start, end, value, range_table)) { EMACS_INT first, last; - CHECK_RANGE_TABLE (table); + CHECK_RANGE_TABLE (range_table); CHECK_INT_COERCE_CHAR (start); first = XINT (start); CHECK_INT_COERCE_CHAR (end); @@ -417,47 +418,47 @@ Set the value for range (START, END) to be VAL in TABLE. if (first > last) signal_simple_error_2 ("start must be <= end", start, end); - put_range_table (table, first, last, val); - verify_range_table (XRANGE_TABLE (table)); + put_range_table (range_table, first, last, value); + verify_range_table (XRANGE_TABLE (range_table)); return Qnil; } DEFUN ("remove-range-table", Fremove_range_table, 3, 3, 0, /* -Remove the value for range (START, END) in TABLE. +Remove the value for range (START, END) in RANGE-TABLE. */ - (start, end, table)) + (start, end, range_table)) { - return Fput_range_table (start, end, Qunbound, table); + return Fput_range_table (start, end, Qunbound, range_table); } DEFUN ("clear-range-table", Fclear_range_table, 1, 1, 0, /* -Flush TABLE. +Flush RANGE-TABLE. */ - (table)) + (range_table)) { - CHECK_RANGE_TABLE (table); - Dynarr_reset (XRANGE_TABLE (table)->entries); + CHECK_RANGE_TABLE (range_table); + Dynarr_reset (XRANGE_TABLE (range_table)->entries); return Qnil; } DEFUN ("map-range-table", Fmap_range_table, 2, 2, 0, /* -Map FUNCTION over entries in TABLE, calling it with three args, +Map FUNCTION over entries in RANGE-TABLE, calling it with three args, the beginning and end of the range and the corresponding value. Results are guaranteed to be correct (i.e. each entry processed exactly once) if FUNCTION modifies or deletes the current entry -(i.e. passes the current range to `put-range-table' or +\(i.e. passes the current range to `put-range-table' or `remove-range-table'), but not otherwise. */ - (function, table)) + (function, range_table)) { Lisp_Range_Table *rt; int i; - CHECK_RANGE_TABLE (table); + CHECK_RANGE_TABLE (range_table); CHECK_FUNCTION (function); - rt = XRANGE_TABLE (table); + rt = XRANGE_TABLE (range_table); /* Do not "optimize" by pulling out the length computation below! FUNCTION may have changed the table. */ diff --git a/src/redisplay-x.c b/src/redisplay-x.c index 98f1334..85d540a 100644 --- a/src/redisplay-x.c +++ b/src/redisplay-x.c @@ -165,9 +165,9 @@ separate_textual_runs (unsigned char *text_storage, #ifdef MULE { Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset); - need_ccl_conversion = !NILP (ccl_prog); - if (need_ccl_conversion) - setup_ccl_program (&char_converter, ccl_prog); + if ((!NILP (ccl_prog)) + && (setup_ccl_program (&char_converter, ccl_prog) >= 0)) + need_ccl_conversion = 1; } #endif } diff --git a/src/redisplay.c b/src/redisplay.c index 6604dd2..733315f 100644 --- a/src/redisplay.c +++ b/src/redisplay.c @@ -464,8 +464,7 @@ int column_number_start_at_one; Lisp_Object Qtop_bottom; -#define WINDOW_SCROLLED(w) \ -(w->hscroll > 0 || w->left_xoffset) +#define WINDOW_SCROLLED(w) ((w)->hscroll > 0 || (w)->left_xoffset) /***************************************************************************/ @@ -9286,7 +9285,7 @@ See also `overlay-arrow-string'. DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /* String or glyph to display as an arrow. See also `overlay-arrow-position'. -(Note that despite the name of this variable, it can be set to a glyph as +\(Note that despite the name of this variable, it can be set to a glyph as well as a string.) */ , redisplay_variable_changed); @@ -9451,7 +9450,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, left_margin_width), some_window_value_changed, offsetof (struct frame, left_margin_width), - margin_width_changed_in_frame); + margin_width_changed_in_frame, 0); DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /* *Width of right margin. @@ -9463,7 +9462,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, right_margin_width), some_window_value_changed, offsetof (struct frame, right_margin_width), - margin_width_changed_in_frame); + margin_width_changed_in_frame, 0); DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /* *Minimum ascent height of lines. @@ -9474,7 +9473,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vminimum_line_ascent, offsetof (struct window, minimum_line_ascent), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("minimum-line-descent", &Vminimum_line_descent /* *Minimum descent height of lines. @@ -9485,7 +9484,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vminimum_line_descent, offsetof (struct window, minimum_line_descent), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("use-left-overflow", &Vuse_left_overflow /* *Non-nil means use the left outside margin as extra whitespace when @@ -9497,7 +9496,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vuse_left_overflow, offsetof (struct window, use_left_overflow), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("use-right-overflow", &Vuse_right_overflow /* *Non-nil means use the right outside margin as extra whitespace when @@ -9509,7 +9508,7 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vuse_right_overflow, offsetof (struct window, use_right_overflow), some_window_value_changed, - 0, 0); + 0, 0, 0); DEFVAR_SPECIFIER ("text-cursor-visible-p", &Vtext_cursor_visible_p /* *Non-nil means the text cursor is visible (this is usually the case). @@ -9520,6 +9519,6 @@ This is a specifier; use `set-specifier' to change it. set_specifier_caching (Vtext_cursor_visible_p, offsetof (struct window, text_cursor_visible_p), text_cursor_visible_p_changed, - 0, 0); + 0, 0, 0); } diff --git a/src/s/decosf1-3.h b/src/s/decosf1-3.h index 94b6615..d54562e 100644 --- a/src/s/decosf1-3.h +++ b/src/s/decosf1-3.h @@ -1,10 +1,6 @@ /* Synched up with: Not in FSF. */ #include "decosf1-2.h" -/* XEmacs change: Kim Nyberg says this is needed. */ -#ifdef emacs -#include -#endif /* Supposedly gmalloc and rel_alloc will work now (grunwald@foobar.cs.colorado.edu) */ diff --git a/src/s/ptx.h b/src/s/ptx.h index daef324..c0ebe2d 100644 --- a/src/s/ptx.h +++ b/src/s/ptx.h @@ -68,7 +68,6 @@ Boston, MA 02111-1307, USA. */ #endif #ifdef emacs -#include /* Support for pty's */ #include /*#define BROKEN_SIGIO*/ /* SIGIO is already undef'd elsewhere. PTX diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h index bc789cd..e16dfeb 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4.h @@ -81,7 +81,6 @@ Boston, MA 02111-1307, USA. */ #include #include #include -#include #include #endif diff --git a/src/select-x.c b/src/select-x.c index 82470e5..25bd52a 100644 --- a/src/select-x.c +++ b/src/select-x.c @@ -84,7 +84,7 @@ static void lisp_data_to_selection_data (struct device *, unsigned int *size_ret, int *format_ret); static Lisp_Object selection_data_to_lisp_data (struct device *, - unsigned char *data, + Extbyte *data, size_t size, Atom type, int format); @@ -284,8 +284,8 @@ hack_motif_clipboard_selection (Atom selection_atom, #endif XmString fmh; String encoding = "STRING"; - const Extbyte *data = XSTRING_DATA (selection_value); - Extcount bytes = XSTRING_LENGTH (selection_value); + const Bufbyte *data = XSTRING_DATA (selection_value); + Bytecount bytes = XSTRING_LENGTH (selection_value); #ifdef MULE { @@ -948,11 +948,11 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) static void x_get_window_property (Display *display, Window window, Atom property, - unsigned char **data_ret, int *bytes_ret, + Extbyte **data_ret, int *bytes_ret, Atom *actual_type_ret, int *actual_format_ret, unsigned long *actual_size_ret, int delete_p) { - int total_size; + size_t total_size; unsigned long bytes_remaining; int offset = 0; unsigned char *tmp_data = 0; @@ -983,7 +983,7 @@ x_get_window_property (Display *display, Window window, Atom property, } total_size = bytes_remaining + 1; - *data_ret = (unsigned char *) xmalloc (total_size); + *data_ret = (Extbyte *) xmalloc (total_size); /* Now read, until we've gotten it all. */ while (bytes_remaining) @@ -1020,7 +1020,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, /* this one is for error messages only */ Lisp_Object target_type, unsigned int min_size_bytes, - unsigned char **data_ret, int *size_bytes_ret, + Extbyte **data_ret, int *size_bytes_ret, Atom *type_ret, int *format_ret, unsigned long *size_ret) { @@ -1028,7 +1028,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, int offset = 0; int prop_id; *size_bytes_ret = min_size_bytes; - *data_ret = (unsigned char *) xmalloc (*size_bytes_ret); + *data_ret = (Extbyte *) xmalloc (*size_bytes_ret); #if 0 stderr_out ("\nread INCR %d\n", min_size_bytes); #endif @@ -1044,7 +1044,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, PropertyNewValue); while (1) { - unsigned char *tmp_data; + Extbyte *tmp_data; int tmp_size_bytes; wait_for_property_change (prop_id); /* expect it again immediately, because x_get_window_property may @@ -1076,7 +1076,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, *size_bytes_ret, offset + tmp_size_bytes); #endif *size_bytes_ret = offset + tmp_size_bytes; - *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); + *data_ret = (Extbyte *) xrealloc (*data_ret, *size_bytes_ret); } memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); offset += tmp_size_bytes; @@ -1097,7 +1097,7 @@ x_get_window_property_as_lisp_data (Display *display, Atom actual_type; int actual_format; unsigned long actual_size; - unsigned char *data = NULL; + Extbyte *data = NULL; int bytes = 0; Lisp_Object val; struct device *d = get_device_from_display (display); @@ -1179,7 +1179,7 @@ x_get_window_property_as_lisp_data (Display *display, static Lisp_Object selection_data_to_lisp_data (struct device *d, - unsigned char *data, + Extbyte *data, size_t size, Atom type, int format) @@ -1544,7 +1544,7 @@ Return the value of the named CUTBUFFER (typically CUT_BUFFER0). Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - unsigned char *data; + Extbyte *data; int bytes; Atom type; int format; @@ -1586,9 +1586,9 @@ Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - const Extbyte *data = XSTRING_DATA (string); - Extcount bytes = XSTRING_LENGTH (string); - Extcount bytes_remaining; + const Bufbyte *data = XSTRING_DATA (string); + Bytecount bytes = XSTRING_LENGTH (string); + Bytecount bytes_remaining; int max_bytes = SELECTION_QUANTUM (display); #ifdef MULE const Bufbyte *ptr, *end; diff --git a/src/sgiplay.c b/src/sgiplay.c index e3ca2fa..3650ca4 100644 --- a/src/sgiplay.c +++ b/src/sgiplay.c @@ -328,7 +328,7 @@ play_internal (unsigned char *data, int length, AudioContext ac) if (ac == (AudioContext) 0) return; - data = ac->ac_data; + data = (unsigned char *) ac->ac_data; limit = data + ac->ac_size; while (data < limit) { diff --git a/src/sound.c b/src/sound.c index 1f1acc9..fe31b7b 100644 --- a/src/sound.c +++ b/src/sound.c @@ -334,7 +334,7 @@ See the variable `sound-alist'. /* #### ESD uses alarm(). But why should we also stop SIGIO? */ stop_interrupts (); - succes = esd_play_sound_data (soundext, soundextlen, vol); + succes = esd_play_sound_data ((unsigned char *) soundext, soundextlen, vol); start_interrupts (); QUIT; if(succes) diff --git a/src/specifier.c b/src/specifier.c index 7fa2e3a..9bdf57e 100644 --- a/src/specifier.c +++ b/src/specifier.c @@ -549,7 +549,7 @@ device, global), and then the instance (i.e. actual value) is retrieved in a specific domain (window, frame, device) by looking through the possible instantiators (i.e. settings). This process is called \"instantiation\". - + To put settings into a specifier, use `set-specifier', or the lower-level functions `add-spec-to-specifier' and `add-spec-list-to-specifier'. You can also temporarily bind a setting @@ -1986,8 +1986,8 @@ with the function `specifier-spec-list' or `specifier-specs'. } DEFUN ("add-spec-list-to-specifier", Fadd_spec_list_to_specifier, 2, 3, 0, /* -Add a spec-list (a list of specifications) to SPECIFIER. -The format of a spec-list is +Add SPEC-LIST (a list of specifications) to SPECIFIER. +The format of SPEC-LIST is ((LOCALE (TAG-SET . INSTANTIATOR) ...) ...) @@ -2556,11 +2556,8 @@ specifier_instance (Lisp_Object specifier, Lisp_Object matchspec, Lisp_Object window = Qnil; Lisp_Object frame = Qnil; Lisp_Object device = Qnil; - Lisp_Object tag = Qnil; - struct device *d; - Lisp_Specifier *sp; - - sp = XSPECIFIER (specifier); + Lisp_Object tag = Qnil; /* #### currently unused */ + Lisp_Specifier *sp = XSPECIFIER (specifier); /* Attempt to determine buffer, window, frame, and device from the domain. */ @@ -2582,17 +2579,16 @@ specifier_instance (Lisp_Object specifier, Lisp_Object matchspec, abort (); if (NILP (buffer) && !NILP (window)) - buffer = XWINDOW (window)->buffer; + buffer = WINDOW_BUFFER (XWINDOW (window)); if (NILP (frame) && !NILP (window)) frame = XWINDOW (window)->frame; if (NILP (device)) /* frame had better exist; if device is undeterminable, something really went wrong. */ - device = XFRAME (frame)->device; + device = FRAME_DEVICE (XFRAME (frame)); /* device had better be determined by now; abort if not. */ - d = XDEVICE (device); - tag = DEVICE_CLASS (d); + tag = DEVICE_CLASS (XDEVICE (device)); depth = make_int (1 + XINT (depth)); if (XINT (depth) > 20) @@ -2836,7 +2832,8 @@ set_specifier_caching (Lisp_Object specifier, int struct_window_offset, int struct_frame_offset, void (*value_changed_in_frame) (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval)) + Lisp_Object oldval), + int always_recompute) { Lisp_Specifier *sp = XSPECIFIER (specifier); assert (!GHOST_SPECIFIER_P (sp)); @@ -2847,6 +2844,7 @@ set_specifier_caching (Lisp_Object specifier, int struct_window_offset, sp->caching->value_changed_in_window = value_changed_in_window; sp->caching->offset_into_struct_frame = struct_frame_offset; sp->caching->value_changed_in_frame = value_changed_in_frame; + sp->caching->always_recompute = always_recompute; Vcached_specifiers = Fcons (specifier, Vcached_specifiers); if (BODILY_SPECIFIER_P (sp)) GHOST_SPECIFIER(sp)->caching = sp->caching; @@ -2858,7 +2856,7 @@ recompute_one_cached_specifier_in_window (Lisp_Object specifier, struct window *w) { Lisp_Object window; - Lisp_Object newval, *location; + Lisp_Object newval, *location, oldval; assert (!GHOST_SPECIFIER_P (XSPECIFIER (specifier))); @@ -2879,9 +2877,9 @@ recompute_one_cached_specifier_in_window (Lisp_Object specifier, calling equal is no good either as this doesn't take into account things attached to the specifier - for instance strings on extents. --andyp */ - if (!EQ (newval, *location)) + if (!EQ (newval, *location) || XSPECIFIER (specifier)->caching->always_recompute) { - Lisp_Object oldval = *location; + oldval = *location; *location = newval; (XSPECIFIER (specifier)->caching->value_changed_in_window) (specifier, w, oldval); @@ -2893,7 +2891,7 @@ recompute_one_cached_specifier_in_frame (Lisp_Object specifier, struct frame *f) { Lisp_Object frame; - Lisp_Object newval, *location; + Lisp_Object newval, *location, oldval; assert (!GHOST_SPECIFIER_P (XSPECIFIER (specifier))); @@ -2907,9 +2905,9 @@ recompute_one_cached_specifier_in_frame (Lisp_Object specifier, method. */ location = (Lisp_Object *) ((char *) f + XSPECIFIER (specifier)->caching->offset_into_struct_frame); - if (!EQ (newval, *location)) + if (!EQ (newval, *location) || XSPECIFIER (specifier)->caching->always_recompute) { - Lisp_Object oldval = *location; + oldval = *location; *location = newval; (XSPECIFIER (specifier)->caching->value_changed_in_frame) (specifier, f, oldval); diff --git a/src/specifier.h b/src/specifier.h index c925a57..8c82331 100644 --- a/src/specifier.h +++ b/src/specifier.h @@ -411,6 +411,7 @@ struct specifier_caching int offset_into_struct_frame; void (*value_changed_in_frame) (Lisp_Object specifier, struct frame *f, Lisp_Object oldval); + int always_recompute; }; /* #### get image instances out of domains! */ @@ -480,7 +481,8 @@ void set_specifier_caching (Lisp_Object specifier, int struct_frame_offset, void (*value_changed_in_frame) (Lisp_Object specifier, struct frame *f, - Lisp_Object oldval)); + Lisp_Object oldval), + int always_recompute); void set_specifier_fallback (Lisp_Object specifier, Lisp_Object fallback); void recompute_all_cached_specifiers_in_window (struct window *w); diff --git a/src/symbols.c b/src/symbols.c index 32e56dd..7599d00 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -198,8 +198,8 @@ intern (const char *str) DEFUN ("intern", Fintern, 1, 2, 0, /* Return the canonical symbol whose name is STRING. If there is none, one is created by this function and returned. -A second optional argument specifies the obarray to use; -it defaults to the value of `obarray'. +Optional second argument OBARRAY specifies the obarray to use; +it defaults to the value of the variable `obarray'. */ (string, obarray)) { @@ -245,8 +245,8 @@ DEFUN ("intern-soft", Fintern_soft, 1, 2, 0, /* Return the canonical symbol named NAME, or nil if none exists. NAME may be a string or a symbol. If it is a symbol, that exact symbol is searched for. -A second optional argument specifies the obarray to use; -it defaults to the value of `obarray'. +Optional second argument OBARRAY specifies the obarray to use; +it defaults to the value of the variable `obarray'. */ (name, obarray)) { @@ -278,7 +278,7 @@ Delete the symbol named NAME, if any, from OBARRAY. The value is t if a symbol was found and deleted, nil otherwise. NAME may be a string or a symbol. If it is a symbol, that symbol is deleted, if it belongs to OBARRAY--no other symbol is deleted. -OBARRAY defaults to the value of the variable `obarray' +OBARRAY defaults to the value of the variable `obarray'. */ (name, obarray)) { @@ -490,11 +490,9 @@ apropos_mapper (Lisp_Object symbol, void *arg) } DEFUN ("apropos-internal", Fapropos_internal, 1, 2, 0, /* -Show all symbols whose names contain match for REGEXP. -If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) - is done for each symbol and a symbol is mentioned only if that - returns non-nil. -Return list of symbols found. +Return a list of all symbols whose names contain match for REGEXP. +If optional 2nd arg PREDICATE is non-nil, only symbols for which +\(funcall PREDICATE SYMBOL) returns non-nil are returned. */ (regexp, predicate)) { @@ -1931,7 +1929,7 @@ local bindings in certain buffers. } DEFUN ("set-default", Fset_default, 2, 2, 0, /* -Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated. +Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated. The default value is seen in buffers that do not have their own values for this variable. */ @@ -2597,7 +2595,7 @@ The returned info will be a symbol, one of DEFUN ("local-variable-p", Flocal_variable_p, 2, 3, 0, /* Return t if SYMBOL's value is local to BUFFER. -If optional third arg AFTER-SET is true, return t if SYMBOL would be +If optional third arg AFTER-SET is non-nil, return t if SYMBOL would be buffer-local after it is set, regardless of whether it is so presently. A nil value for BUFFER is *not* the same as (current-buffer), but means "no buffer". Specifically: @@ -3191,7 +3189,7 @@ init_symbols_once_early (void) XSYMBOL (Qnil)->function = Qunbound; defsymbol (&Qt, "t"); - XSYMBOL (Qt)->value = Qt; /* Veritas aetera */ + XSYMBOL (Qt)->value = Qt; /* Veritas aeterna */ Vquit_flag = Qnil; pdump_wire (&Qnil); diff --git a/src/sysproc.h b/src/sysproc.h index ebb4e78..fc23d27 100644 --- a/src/sysproc.h +++ b/src/sysproc.h @@ -118,12 +118,12 @@ Boston, MA 02111-1307, USA. */ #include #endif -#ifdef HAVE_SYS_STROPTS_H -#include /* isastream(), I_PUSH */ +#ifdef HAVE_STROPTS_H +#include /* isastream(), I_PUSH */ #endif -#ifdef HAVE_SYS_STRTIO_H -#include /* TIOCSIGNAL */ +#ifdef HAVE_STRTIO_H +#include /* TIOCSIGNAL */ #endif #ifdef HAVE_PTY_H diff --git a/src/tooltalk.c b/src/tooltalk.c index 308f438..0261b5f 100644 --- a/src/tooltalk.c +++ b/src/tooltalk.c @@ -763,7 +763,7 @@ New arguments can be added to a message with add-tooltalk-message-arg. TO_EXTERNAL_FORMAT (LISP_STRING, value, ALLOCA, (value_ext, value_ext_len), Qnative); - tt_message_arg_bval_set (m, n, value_ext, value_ext_len); + tt_message_arg_bval_set (m, n, (unsigned char *) value_ext, value_ext_len); } else if (EQ (attribute, Qtt_arg_ival)) { diff --git a/src/window.h b/src/window.h index 15ce2b3..b72ec92 100644 --- a/src/window.h +++ b/src/window.h @@ -310,7 +310,7 @@ DECLARE_LRECORD (window_configuration, struct window_config); EXFUN (Fget_buffer_window, 3); EXFUN (Fmove_to_window_line, 2); EXFUN (Frecenter, 2); -EXFUN (Freplace_buffer_in_windows, 1); +EXFUN (Freplace_buffer_in_windows, 3); EXFUN (Fselect_window, 2); EXFUN (Fselected_window, 1); EXFUN (Fset_window_buffer, 3);