1. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  2. 16 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Prefer list1 (X) to Fcons (X, Qnil) when building lists. · 6c6f1994
      Paul Eggert authored
      This makes the code easier to read and the executable a bit smaller.
      Do not replace all calls to Fcons that happen to create lists,
      just calls that are intended to create lists.  For example, when
      creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
      rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
      Similarly for list2 through list5.
      * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
      * bytecode.c (exec_byte_code):
      * callint.c (quotify_arg, Fcall_interactively):
      * callproc.c (Fcall_process, create_temp_file):
      * charset.c (load_charset_map_from_file)
      (Fdefine_charset_internal, init_charset):
      * coding.c (get_translation_table, detect_coding_system)
      (Fcheck_coding_systems_region)
      (Fset_terminal_coding_system_internal)
      (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
      * composite.c (update_compositions, Ffind_composition_internal):
      * dired.c (directory_files_internal, file_name_completion)
      (Fsystem_users):
      * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fmessage_box):
      * emacs.c (main):
      * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
      (Feval, eval_sub, Ffuncall, apply_lambda):
      * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
      (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
      (Fset_file_times, Finsert_file_contents)
      (Fchoose_write_coding_system, Fwrite_region):
      * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
      * font.c (font_registry_charsets, font_parse_fcname)
      (font_prepare_cache, font_update_drivers, Flist_fonts):
      * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
      * frame.c (make_frame, Fmake_terminal_frame)
      (x_set_frame_parameters, x_report_frame_params)
      (x_default_parameter, Fx_parse_geometry):
      * ftfont.c (syms_of_ftfont):
      * image.c (gif_load):
      * keyboard.c (command_loop_1):
      * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
      (Fcopy_keymap, append_key, Fcurrent_active_maps)
      (Fminor_mode_key_binding, accessible_keymaps_1)
      (Faccessible_keymaps, Fwhere_is_internal):
      * lread.c (read_emacs_mule_char):
      * menu.c (find_and_return_menu_selection):
      * minibuf.c (get_minibuffer):
      * nsfns.m (Fns_perform_service):
      * nsfont.m (ns_script_to_charset):
      * nsmenu.m (ns_popup_dialog):
      * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
      (Fx_own_selection_internal):
      * nsterm.m (append2):
      * print.c (Fredirect_debugging_output)
      (print_prune_string_charset):
      * process.c (Fdelete_process, Fprocess_contact)
      (Fformat_network_address, set_socket_option)
      (read_and_dispose_of_process_output, write_queue_push)
      (send_process, exec_sentinel):
      * sound.c (Fplay_sound_internal):
      * textprop.c (validate_plist, add_properties)
      (Fput_text_property, Fadd_face_text_property)
      (copy_text_properties, text_property_list, syms_of_textprop):
      * unexaix.c (report_error):
      * unexcoff.c (report_error):
      * unexsol.c (unexec):
      * xdisp.c (redisplay_tool_bar, store_mode_line_string)
      (Fformat_mode_line, syms_of_xdisp):
      * xfaces.c (set_font_frame_param)
      (Finternal_lisp_face_attribute_values)
      (Finternal_merge_in_global_face, syms_of_xfaces):
      * xfns.c (x_default_scroll_bar_color_parameter)
      (x_default_font_parameter, x_create_tip_frame):
      * xfont.c (xfont_supported_scripts):
      * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
      (menu_help_callback, xmenu_show):
      * xml.c (make_dom):
      * xterm.c (set_wm_state):
      Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
      and similarly for list2 through list5.
      6c6f1994
  3. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  4. 16 Jun, 2012 1 commit
    • Andreas Schwab's avatar
      * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline. · e5560ff7
      Andreas Schwab authored
      (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
      * character.c (_fetch_multibyte_char_p): Remove.
      * alloc.c: Include "character.h" before "buffer.h".
      * bidi.c: Likewise.
      * buffer.c: Likewise.
      * bytecode.c: Likewise.
      * callint.c: Likewise.
      * callproc.c: Likewise.
      * casefiddle.c: Likewise.
      * casetab.c: Likewise.
      * category.c: Likewise.
      * cmds.c: Likewise.
      * coding.c: Likewise.
      * composite.c: Likewise.
      * dired.c: Likewise.
      * dispnew.c: Likewise.
      * doc.c: Likewise.
      * dosfns.c: Likewise.
      * editfns.c: Likewise.
      * emacs.c: Likewise.
      * fileio.c: Likewise.
      * filelock.c: Likewise.
      * font.c: Likewise.
      * fontset.c: Likewise.
      * fringe.c: Likewise.
      * indent.c: Likewise.
      * insdel.c: Likewise.
      * intervals.c: Likewise.
      * keyboard.c: Likewise.
      * keymap.c: Likewise.
      * lread.c: Likewise.
      * macros.c: Likewise.
      * marker.c: Likewise.
      * minibuf.c: Likewise.
      * nsfns.m: Likewise.
      * nsmenu.m: Likewise.
      * print.c: Likewise.
      * process.c: Likewise.
      * regex.c: Likewise.
      * region-cache.c: Likewise.
      * search.c: Likewise.
      * syntax.c: Likewise.
      * term.c: Likewise.
      * textprop.c: Likewise.
      * undo.c: Likewise.
      * unexsol.c: Likewise.
      * w16select.c: Likewise.
      * w32fns.c: Likewise.
      * w32menu.c: Likewise.
      * window.c: Likewise.
      * xdisp.c: Likewise.
      * xfns.c: Likewise.
      * xmenu.c: Likewise.
      * xml.c: Likewise.
      * xselect.c: Likewise.
      e5560ff7
  5. 17 Mar, 2011 1 commit
  6. 16 Mar, 2011 1 commit
    • Paul Eggert's avatar
      New file unexec.h, the (simple) interface for unexec. · ce701a33
      Paul Eggert authored
      * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
      (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
      Depend on unexec.h.
      * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
      * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
      * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
      ce701a33
  7. 15 Jan, 2011 1 commit
  8. 03 Oct, 2010 1 commit
    • Dan Nicolaescu's avatar
      Remove unused arguments for unexec. · dd5ecd6b
      Dan Nicolaescu authored
      The third one is never used, and the last two are always passed as zero.
      * src/emacs.c (unexec): Add declaration.
      (Fdump_emacs): Only pass the first two arguments to unexec.
      Simplify #ifdef.
      * src/unexw32.c (unexec):
      * src/unexsol.c (unexec):
      * src/unexhp9k800.c (unexec):
      * src/unexcw.c (unexec): Remove the last 3 arguments, unused.
      * src/unexelf.c (unexec): Remove the last 3 arguments, unused.
      (find_section): Use const.
      * src/unexmacosx.c (unexec): Remove the last 3 arguments, unused.
      (unexec_error): Declare it NO_RETURN.
      * src/unexcoff.c (make_hdr): Assume bss_start is always zero, remove
      it as an argument, remove data_start and entry_address arguments, unused.
      (unexec): Remove bss_start, data_start and
      entry_address arguments.
      * src/unexaix.c (make_hdr): Assume bss_start is always zero, remove
      it as an argument, remove data_start and entry_address arguments, unused.
      (unexec): Remove bss_start, data_start and
      entry_address arguments.
      dd5ecd6b
  9. 01 Oct, 2010 1 commit
    • Dan Nicolaescu's avatar
      Do not include stdlib.h and string.h, config.h does it. · 4cacd822
      Dan Nicolaescu authored
      * src/xfont.c:
      * src/w32term.c:
      * src/w32reg.c:
      * src/w32inevt.c:
      * src/w32heap.c:
      * src/w32console.c:
      * src/w16select.c:
      * src/unexsol.c:
      * src/term.c:
      * src/sound.c:
      * src/scroll.c (m):
      * src/gtkutil.c:
      * src/font.c:
      * src/filelock.c:
      * src/fileio.c:
      * src/dosfns.c:
      * src/dbusbind.c:
      * src/bidi.c:
      * src/callproc.c:
      * src/process.c:
      * src/msdos.c:
      * src/charset.c: Do not include stdlib.h and string.h, config.h does it.
      
      * configure.in: Include stdlib.h and string.h unconditionally.
      4cacd822
  10. 19 Oct, 2009 1 commit
    • Dan Nicolaescu's avatar
      * alloc.c: Do not define struct catchtag. · d7306fe6
      Dan Nicolaescu authored
      * eval.c: Move struct catchtag definition ...
      * lisp.h: ... here.
      
      * image.c: Move png.h #include earlier to avoid warnings.
      
      * xterm.c:
      * xsmfns.c:
      * xselect.c:
      * xrdb.c:
      * xmenu.c:
      * xftfont.c:
      * xfont.c:
      * xfns.c:
      * xfaces.c:
      * xdisp.c:
      * window.c:
      * widget.c:
      * w32xfns.c:
      * w32uniscribe.c:
      * w32term.c:
      * w32select.c:
      * w32reg.c:
      * w32proc.c:
      * w32menu.c:
      * w32inevt.c:
      * w32heap.c:
      * w32font.c:
      * w32fns.c:
      * w32console.c:
      * w32.c:
      * w16select.c:
      * vm-limit.c:
      * unexsol.c:
      * unexec.c:
      * unexcw.c:
      * unexaix.c:
      * undo.c:
      * tparam.c:
      * textprop.c:
      * terminfo.c:
      * terminal.c:
      * termcap.c:
      * term.c:
      * syntax.c:
      * sound.c:
      * sheap.c:
      * search.c:
      * scroll.c:
      * region-cache.c:
      * regex.c:
      * ralloc.c:
      * process.c:
      * print.c:
      * msdos.c:
      * minibuf.c:
      * menu.c:
      * marker.c:
      * macros.c:
      * keymap.c:
      * keyboard.c:
      * intervals.c:
      * insdel.c:
      * indent.c:
      * gtkutil.c:
      * ftxfont.c:
      * ftfont.c:
      * fringe.c:
      * frame.c:
      * fontset.c:
      * font.c:
      * fns.c:
      * floatfns.c:
      * filelock.c:
      * fileio.c:
      * emacs.c:
      * editfns.c:
      * dosfns.c:
      * doprnt.c:
      * doc.c:
      * dispnew.c:
      * dired.c:
      * dbusbind.c:
      * data.c:
      * composite.c:
      * coding.c:
      * cmds.c:
      * cm.c:
      * chartab.c:
      * charset.c:
      * character.c:
      * ccl.c:
      * category.c:
      * casetab.c:
      * casefiddle.c:
      * callproc.c:
      * callint.c:
      * bytecode.c:
      * buffer.c:
      * atimer.c: Include setjmp.h.  (Bug#4643)
      
      * xlwmenu.c:
      * lwlib.c:
      * lwlib-utils.c:
      * lwlib-Xm.c:
      * lwlib-Xlw.c:
      * lwlib-Xaw.c: Include setjmp.h.
      d7306fe6
  11. 18 Jul, 2006 1 commit
  12. 16 Apr, 2004 1 commit
  13. 08 Sep, 2003 1 commit
  14. 01 Sep, 2003 1 commit
  15. 13 Sep, 2002 1 commit
  16. 12 Sep, 2002 2 commits
  17. 01 Sep, 2002 1 commit