1. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  2. 04 Jan, 2015 4 commits
    • Paul Eggert's avatar
      'temacs -nw' should not call missing functions · bf90e9ac
      Paul Eggert authored
      Without this patch, "temacs -nw" fails with the diagnostic
      "emacs: Symbol's function definition is void: frame-windows-min-size"
      and messes up the tty's state.
      * lib-src/make-docfile.c (write_globals):
      Declare Fframe_windows_min_size with ATTRIBUTE_CONST, too.  Sort.
      * src/frame.c (Fframe_windows_min_size): New placeholder function.
      (syms_of_frame): Define it.
      * src/window.c (Fwindow__sanitize_window_sizes): New placeholder.
      (syms_of_window): Define it.
      bf90e9ac
    • Glenn Morris's avatar
      # ChangeLog fixes · e82fc62b
      Glenn Morris authored
      e82fc62b
    • Paul Eggert's avatar
      Less 'make' chatter for lisp dir · ccb2d938
      Paul Eggert authored
      * lisp/Makefile.in (THEFILE): Define to be 'no-such-file' by default,
      to make it clearer that the caller must specify it.
      (compile-onefile): Remove, replacing by ...
      ($(THEFILE)c): ... new rule.  This lets us use AM_V_GEN here.
      ($(THEFILE)c, .el.elc, $(MH_E_DIR)/mh-loaddefs.el)
      ($(TRAMP_DIR)/tramp-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el)
      ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el):
      Use AM_V_GEN to lessen 'make' chatter.
      (.el.elc): Omit duplicate comment.
      * src/Makefile.in (%.elc): Adjust to compile-onefile change in
      ../lisp/Makefile.in.
      ccb2d938
    • Paul Eggert's avatar
      batch write-region no longer says "Wrote FOO" · d20f82e6
      Paul Eggert authored
      This cuts down on 'make' chatter a bit.
      * doc/lispref/files.texi (Writing to Files):
      * etc/NEWS: Document this.
      * src/fileio.c (Fwrite_region):
      Don't output "Wrote /whatever/foo.elc" if noninteractive.
      d20f82e6
  3. 03 Jan, 2015 3 commits
  4. 02 Jan, 2015 1 commit
  5. 01 Jan, 2015 2 commits
  6. 31 Dec, 2014 1 commit
    • Paul Eggert's avatar
      Simplify setfattr use by assuming GNU make · 25346768
      Paul Eggert authored
      * Makefile.in (PAXCTL_if_present, SETFATTR_if_present): New macros.
      (emacs$(EXEEXT), temacs$(EXEEXT), bootstrap-emacs$(EXEEXT)): Use them.
      Simplify by using GNU make rather than shell conditionals,
      by using ln -f rather than rm -f followed by ln,
      and by preferring $@ to spelling out the destination.
      25346768
  7. 30 Dec, 2014 3 commits
  8. 29 Dec, 2014 3 commits
    • Eli Zaretskii's avatar
      Fix the MS-Windows build. · 8ae52a77
      Eli Zaretskii authored
       src/sysdep.c [WINDOWSNT]: Include sys/socket.h, without which this
       file doesn't compile on MS-Windows.
      8ae52a77
    • Paul Eggert's avatar
      97311068
    • Paul Eggert's avatar
      system-name's returned value can vary · f9acac75
      Paul Eggert authored
      Also, the system-name variable is now obsolete.
      Fixes Bug#19438.
      * doc/lispref/os.texi (System Environment):
      * etc/NEWS: Document this.
      * doc/misc/efaq.texi:
      (Displaying the current file name in the titlebar):
      * lisp/desktop.el (desktop-save-frameset):
      * lisp/dnd.el (dnd-get-local-file-uri):
      * lisp/gnus/message.el (message-make-fqdn):
      * lisp/gnus/nnvirtual.el (nnvirtual-retrieve-headers)
      (nnvirtual-update-xref-header):
      * lisp/nxml/rng-uri.el (rng-uri-file-name-1):
      * lisp/org/org-clock.el (org-clock-save):
      * src/filelock.c (current_lock_owner):
      * src/xrdb.c (get_environ_db):
      * src/xterm.c (same_x_server):
      * src/xterm.c (x_term_init):
      Prefer (system-name) to system-name, and avoid naming
      locals 'system-name'.
      * doc/misc/smtpmail.texi (Server workarounds): Fix grammar.
      * lisp/startup.el (system-name): Now an obsolete variable.
      * src/editfns.c (cached_system_name): New static var.
      (init_and_cache_system_name): New function.
      (init_editfns, Fsystem_name): Use it.
      (syms_of_editfns): Initialize it and Vsystem_name to the same value.
      * src/sysdep.c [HAVE_SOCKETS]: Don't include <sys/socket.h>, <netdb.h>.
      (h_errno) [TRY_AGAIN && !HAVE_H_ERRNO]: Remove decl.
      (init_system_name) [HAVE_SOCKETS]: Don't canonicalize the name.
      Don't create a new string if the current value is already correct.
      f9acac75
  9. 28 Dec, 2014 5 commits
    • Paul Eggert's avatar
      Spelling fixes · b5c9c131
      Paul Eggert authored
      b5c9c131
    • Eli Zaretskii's avatar
    • Paul Eggert's avatar
      Fix produce_composite_width typo · 20791069
      Paul Eggert authored
      * term.c (produce_composite_glyph):
      Fix typo that confused number of columns for pixel width.
      20791069
    • Paul Eggert's avatar
      Wrap dll functions more simply · e092accb
      Paul Eggert authored
      * decompress.c, gnutls.c, image.c, xml.c:
      If WINDOWSNT, use '#define FOO fn_FOO' to wrap dll functions,
      rather than the inverse when not WINDOWSNT.  This isolates the
      fn_* business into the WINDOWSNT-specific section of the code,
      which makes it easier to maintain the generic code.
      * decompress.c (DEF_ZLIB_FN, LOAD_ZLIB_FN):
      * gnutls.c (DEF_GNUTLS_FN, LOAD_GNUTLS_FN):
      * image.c (DEF_IMGLIB_FN, LOAD_IMGLIB_FN):
      * xml.c (DEF_XML2_FN, LOAD_XML2_FN):
      Remove.  All uses replaced by DEF_DLL_FN.
      * w32.h (DEF_DLL_FN, LOAD_DLL_FN): New macros.
      e092accb
    • Paul Eggert's avatar
      Port memory-full checking to GnuTLS 3.3 · b54f5721
      Paul Eggert authored
      Instead of using gnutls_global_set_mem_functions, check every call
      to a GnuTLS function that might return an indication of memory
      exhaustion.  Suggested by Dmitry Antipov in:
      http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02056.html
      * src/gnutls.c (gnutls_global_set_mem_functions) [WINDOWSNT]: Remove.
      (init_gnutls_functions): Do not load gnutls_global_set_mem_functions.
      (fn_gnutls_global_set_mem_functions) [!WINDOWSNT]: Remove.
      All uses removed.
      (check_memory_full): New function.
      (emacs_gnutls_handshake, emacs_gnutls_handle_error)
      (gnutls_make_error, Fgnutls_boot): Use it.
      (emacs_gnutls_global_init): Avoid gnutls_global_set_mem_functions.
      b54f5721
  10. 27 Dec, 2014 2 commits
  11. 26 Dec, 2014 4 commits
    • Paul Eggert's avatar
      Use bool for boolean in xselect.c, xsettings.c · 7a305f8b
      Paul Eggert authored
      * xselect.c (x_get_local_selection, struct selection_data)
      (x_selection_request_lisp_error, struct prop_location)
      (x_handle_selection_request, x_convert_selection)
      (waiting_for_other_props_on_window, expect_property_change)
      (wait_for_property_change, x_handle_property_notify)
      (x_get_foreign_selection, x_get_window_property)
      (receive_incremental_selection)
      (x_get_window_property_as_lisp_data)
      (lisp_data_to_selection_data, Fx_get_selection_internal)
      (x_send_client_event):
      * xselect.c, xterm.h (x_handle_dnd_message):
      * xsettings.c (dpyinfo_valid, parse_settings, read_settings)
      (apply_xft_settings, read_and_apply_settings)
      (xft_settings_event, init_gsettings, init_xsettings)
      (syms_of_xsettings):
      Use bool for boolean.
      * xselect.c (x_get_window_property): Omit last arg, which was an
      unused boolean.
      * xsettings.c (apply_xft_settings): Remove 2nd arg, which was
      always true.  All callers changed.
      7a305f8b
    • Eli Zaretskii's avatar
      MS-Windows followup to stpcpy changes. · d6552628
      Eli Zaretskii authored
       src/w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead
       of strcat.
       src/w32menu.c (add_menu_item): Use stpcpy instead of strcat.
       src/w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of
       strcat.
      
       nt/gnulib.mk (stpcpy, string): Sync with the latest change in
       lib/gnulib.mk.
      d6552628
    • Paul Eggert's avatar
      Use bool for boolean in xsmfns.c · f7695664
      Paul Eggert authored
      * xsmfns.c, xterm.h (x_session_have_connection):
      * xsmfns.c (doing_interact, smc_interact_CB, Fhandle_save_session):
      Use bool for boolean.
      (x_session_initialize, Fhandle_save_session):
      Prefer NILP (x) to EQ (x, Qnil).
      f7695664
    • Paul Eggert's avatar
      Spelling fixes · b3946c9b
      Paul Eggert authored
      b3946c9b
  12. 25 Dec, 2014 2 commits
    • Paul Eggert's avatar
      Prefer stpcpy to strcat · 1e6879db
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add stpcpy.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib.
      * lib-src/ebrowse.c (sym_scope_1, operator_name, open_file):
      * lib-src/emacsclient.c (get_server_config, set_local_socket)
      (start_daemon_and_retry_set_socket):
      * lib-src/etags.c (main, C_entries, relative_filename):
      * lib-src/pop.c (sendline):
      * lib-src/update-game-score.c (main):
      * lwlib/xlwmenu.c (resource_widget_value):
      * src/callproc.c (child_setup):
      * src/dbusbind.c (xd_signature_cat):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/editfns.c (Fuser_full_name):
      * src/frame.c (xrdb_get_resource):
      * src/gtkutil.c (xg_get_file_with_chooser):
      * src/tparam.c (tparam1):
      * src/xfns.c (xic_create_fontsetname):
      * src/xrdb.c (gethomedir, get_user_db, get_environ_db):
      * src/xsmfns.c (smc_save_yourself_CB):
      Rewrite to avoid the need for strcat, typically by using stpcpy
      and/or lispstpcpy.  strcat tends to be part of O(N**2) algorithms.
      * src/doc.c (sibling_etc):
      * src/xrdb.c (xdefaults):
      Now a top-level static constant.
      1e6879db
    • Eli Zaretskii's avatar
      Fix rendering of composed caharacters on the mode line. (Bug#19435) · a41d07b3
      Eli Zaretskii authored
       src/xdisp.c (set_iterator_to_next) <GET_FROM_STRING>: Limit search in
       composition_compute_stop_pos to the number of characters in the
       string.
       <GET_FROM_BUFFER, GET_FROM_STRING>: Simplify code.
       src/composite.c (composition_compute_stop_pos): If no composition
       was found in a string before ENDPOS, and ENDPOS is the string end,
       no need to back up to a safe point.
       src/dispextern.h (struct it) <end_charpos>: Improve commentary.
      a41d07b3
  13. 24 Dec, 2014 5 commits
  14. 23 Dec, 2014 1 commit
  15. 22 Dec, 2014 3 commits