1. 14 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Use bool for Emacs Lisp booleans. · f5d9e83a
      Paul Eggert authored
      This is more natural, and on my platform (GCC 4.7.1 x86-64) it
      makes Emacs's text size .03% smaller and presumably a bit faster.
      * admin/merge-gnulib (GNULIB_MODULES): Add stdbool.  This documents a
      new direct dependency; stdbool was already being used indirectly
      via other gnulib modules.
      * lib-src/make-docfile.c (enum global_type): Sort values roughly in
      decreasing alignment, except put functions last.
      (compare_globals): Use this new property of enum global_type.
      (write_globals): Use bool, not int, for booleans.
      * src/lisp.h: Include <stdbool.h>.
      (struct Lisp_Boolfwd, defvar_bool):
      * src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
      * src/regex.c [!emacs]: Include <stdbool.h>.
      (false, true): Remove; <stdbool.h> does this for us now.
      f5d9e83a
  2. 11 Aug, 2012 1 commit
  3. 08 Aug, 2012 1 commit
  4. 07 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things. · c644523b
      Dmitry Antipov authored
      * src/lisp.h (struct Lisp_Symbol): Change xname to meaningful
      name since all xname users are fixed long time ago.  Do not use
      INTERNAL_FIELD.
      (set_symbol_name, set_symbol_function, set_symbol_plist):
      (set_symbol_next, set_overlay_plist): New function.
      (struct Lisp_Cons): Do not use INTERNAL_FIELD.
      (struct Lisp_Overlay): Likewise.
      (CVAR, MVAR, SVAR): Remove.
      * src/alloc.c, src/buffer.c, src/buffer.h, src/bytecode.c:
      * src/cmds.c, src/data.c, src/doc.c, src/eval.c, src/fns.c:
      * src/keyboard.c, src/lread.c, src/nsselect.m, src/xterm.c:
      Adjust users.
      * src/.gdbinit: Change to use name field of struct Lisp_Symbol
      where appropriate.
      * admin/coccinelle/overlay.cocci, admin/coccinelle/symbol.cocci:
      Remove.
      c644523b
    • Dmitry Antipov's avatar
      Basic functions to set Lisp_Object and pointer slots of intervals. · 6a3d20cc
      Dmitry Antipov authored
      * intervals.h (interval_set_parent, interval_set_object):
      (interval_set_left, interval_set_right, interval_set_plist):
      (interval_copy_parent): New function.
      (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
      (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE): Adjust
      indentation.
      (INTERVAL_SIZE): Remove.  Adjust users.
      * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
      6a3d20cc
  5. 04 Aug, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #11959 with startup warnings on MS-Windows about ../site-lisp. · 76151e2c
      Eli Zaretskii authored
       src/w32.c (init_environment): Change the default values of many
       environment variables in dflt_envvars[] to NULL, to avoid pushing
       them into environment when they were not already defined.  Remove
       the code that deletes site-lisp subdirectories from the default
       value of EMACSLOADPATH, as it is no longer needed.
       (check_windows_init_file): Now external, not static.  Use
       Vload_path as is, without adding anything, as this function is now
       called when Vload_path is already set up.
       src/w32.h (check_windows_init_file): Add prototype.
       src/emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
       directory, ignore the /*/i386/ tail in Vinvocation_directory, for
       compatibility with Posix platforms.
       (main): Move the call to check_windows_init_file to here from
       w32.c.
       (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
       any, in the DEFALT argument into the root of the Emacs build or
       installation tree, as appropriate.
       src/callproc.c (init_callproc_1): Call decode_env_path instead of
       doing its equivalent by hand.
       (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
       the code that sets Vexec_path run on MS-Windows.
       src/lread.c (init_lread): Add comments to #ifdef's.
      
       nt/paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC)
       (PATH_DATA, PATH_DOC): Replace dummy directory names with
       directories relative to %emacs_dir%.
       (PATH_EXEC): Add lib-src/oo-spd/i386 and lib-src/oo/i386, to cater
       to the use case of running un-installed Emacs.
      76151e2c
  6. 03 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Remove unnecessary casts involving pointers. · 98c6f1e3
      Paul Eggert authored
      These casts are no longer needed now that we assume C89 or later,
      since they involve casting to or from void *.
      * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
      (make_pure_float, make_pure_vector):
      * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
      * macros.c (Fstart_kbd_macro):
      * menu.c (find_and_return_menu_selection):
      * minibuf.c (read_minibuf_noninteractive):
      * sysdep.c (closedir):
      * xdisp.c (x_produce_glyphs):
      * xfaces.c (compare_fonts_by_sort_order):
      * xfns.c (x_real_positions, select_visual):
      * xselect.c (x_stop_queuing_selection_requests)
      (x_get_window_property, x_get_window_property_as_lisp_data):
      * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
      Remove unnecessary pointer casts.
      * alloc.c (record_xmalloc): New function.
      * lisp.h (record_xmalloc): New decl.
      (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
      more like a function.  This is because the pointer cast is not
      needed.  All uses changed.
      * print.c (print_string, print_error_message): Avoid length recalc.
      98c6f1e3
  7. 01 Aug, 2012 2 commits
    • Paul Eggert's avatar
      Use "ASET (a, i, v)" rather than "AREF (a, i) = v". · 4939150c
      Paul Eggert authored
      This how ASET and AREF are supposed to work, and makes
      it easier to think about future improvements.  See
      <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
      * charset.h (set_charset_attr): New function.
      All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
      * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
      (aref_addr): New function.  All uses of &AREF(...) changed.
      (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
      (set_hash_index): New functions.  All lvalue-style uses of
      HASH_KEY etc. changed.
      * keyboard.c (set_prop): New function.  All lvalue-style uses
      of PROP changed.
      4939150c
    • Dmitry Antipov's avatar
      Use INTERNAL_FIELD for symbols. · 8271d590
      Dmitry Antipov authored
      * src/lisp.h (SVAR): New macro.  Adjust users.
      * src/alloc.c, src/bytecode.c, src/cmds.c, src/data.c, src/doc.c, src/eval.c:
      * src/fns.c, src/keyboard.c, src/lread.c, src/xterm.c: Users changed.
      * admin/coccinelle/symbol.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct Lisp_Symbol to SVAR.
      8271d590
  8. 29 Jul, 2012 1 commit
  9. 12 Jul, 2012 1 commit
  10. 11 Jul, 2012 3 commits
  11. 10 Jul, 2012 5 commits
    • Paul Eggert's avatar
      EMACS_TIME simplification (Bug#11875). · e9a9ae03
      Paul Eggert authored
      This replaces macros (which typically do not work in GDB)
      with functions, typedefs and enums, making the code easier to debug.
      The functional style also makes code easier to read and maintain.
      * lib-src/profile.c (TV2): Remove no-longer-needed static var.
      * src/systime.h: Include <sys/time.h> on all hosts, not just if
      WINDOWSNT, since 'struct timeval' is needed in general.
      (EMACS_TIME): Now a typedef, not a macro.
      (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
      not macros.
      (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
      (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
      (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
      (EMACS_TIME_LE): Now functions, not macros.
      (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
      (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
      which are not functions.  All uses rewritten to use:
      (make_emacs_time): New function.
      (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
      (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
      not functions.  All uses rewritten to use the following, respectively:
      (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
      (add_emacs_time, sub_emacs_time): New functions.
      * src/atimer.c: Don't include <sys/time.h>,	as "systime.h" does this.
      * src/fileio.c (Fcopy_file):
      * src/xterm.c (XTflash): Get the current time closer to when it's used.
      * src/makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
      e9a9ae03
    • Paul Eggert's avatar
      e99a530f
    • Dmitry Antipov's avatar
      Optimize pure C strings initialization. · 2a0213a6
      Dmitry Antipov authored
      * lisp.h (make_pure_string): Fix prototype.
      (build_pure_c_string): New function, defined as static inline.  This
      provides a better opportunity to optimize away calls to strlen when
      the function is called with compile-time constant argument.
      * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
      argument, adjust users accordingly.  Use build_pure_c_string where
      appropriate.
      * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
      * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
      * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
      2a0213a6
    • Dmitry Antipov's avatar
      Avoid calls to strlen in miscellaneous functions. · cb1caeaf
      Dmitry Antipov authored
      * buffer.c (init_buffer): Use precalculated len, adjust if needed.
      * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
      * lread.c (openp): Likewise.
      cb1caeaf
    • Glenn Morris's avatar
      Stop ns builds setting the EMACSLOADPATH environment variable · 9e059e3f
      Glenn Morris authored
      Ref bugs 4309, 6401, etc.
      This is the last environment variable (ab)used by the ns port in this way.
      
      * src/nsterm.m (ns_load_path): Rename from ns_init_paths.
      Now it does not set EMACSLOADPATH, just returns the load-path string.
      * src/nsterm.h: Update accordingly.
      
      * src/lread.c [HAVE_NS]: Include nsterm.h.
      (init_lread) [HAVE_NS]: Use ns_load_path.
      
      * src/emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
      9e059e3f
  12. 07 Jul, 2012 2 commits
    • Paul Eggert's avatar
      * lread.c (load_path_check): Now static. · b3350bf9
      Paul Eggert authored
      b3350bf9
    • Glenn Morris's avatar
      Try to simplify the initialization of Vload_path · 929e7845
      Glenn Morris authored
      * src/lread.c (load_path_check): New function, split from init_lread.
      (init_lread): Reorganize.  Motivation:
      If EMACSLOADPATH is set, check/warn about that rather than the
      defaults, which we are not going to use.  Hence we can remove
      the turn_off_warning and WINDOWSNT || HAVE_NS tests.
      Don't warn if site-lisp directories are missing.
      If not installed, start from a blank load-path, since
      PATH_LOADSEARCH refers to the eventual installation directories.
      929e7845
  13. 05 Jul, 2012 2 commits
    • Paul Eggert's avatar
      More xmalloc and related cleanup. · 38182d90
      Paul Eggert authored
      * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
      * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
      * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
      * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
      * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
      * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
      * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
      * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
      * xterm.c:
      Omit needless casts involving void * pointers and allocation.
      Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
      as the former is more robust if P's type is changed.
      Prefer xzalloc to xmalloc + memset 0.
      Simplify malloc-or-realloc to realloc.
      Don't worry about xmalloc returning a null pointer.
      Prefer xstrdup to xmalloc + strcpy.
      * editfns.c (Fmessage_box): Grow message_text by at least 80 when
      growing it.
      * keyboard.c (apply_modifiers_uncached): Prefer local array to
      alloca of a constant.
      38182d90
    • Dmitry Antipov's avatar
      Cleanup xmalloc. · 23f86fce
      Dmitry Antipov authored
      * admin/coccinelle/xzalloc.cocci: Semantic patch to convert
      calls to xmalloc with following memset to xzalloc.
      * src/lisp.h (xzalloc): New prototype.  Omit needless casts.
      * src/alloc.c (xzalloc): New function.  Omit needless casts.
      * src/charset.c: Omit needless casts.  Convert all calls to
      malloc with following memset to xzalloc.
      * src/dispnew.c: Likewise.
      * src/fringe.c: Likewise.
      * src/image.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32font.c: Likewise.
      * src/w32term.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xterm.c: Likewise.
      * src/atimer.c: Omit needless casts.
      * src/buffer.c: Likewise.
      * src/callproc.c: Likewise.
      * src/ccl.c: Likewise.
      * src/coding.c: Likewise.
      * src/composite.c: Likewise.
      * src/doc.c: Likewise.
      * src/doprnt.c: Likewise.
      * src/editfns.c: Likewise.
      * src/emacs.c: Likewise.
      * src/eval.c: Likewise.
      * src/filelock.c: Likewise.
      * src/fns.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/lisp.h: Likewise.
      * src/lread.c: Likewise.
      * src/minibuf.c: Likewise.
      * src/msdos.c: Likewise.
      * src/print.c: Likewise.
      * src/process.c: Likewise.
      * src/region-cache.c: Likewise.
      * src/search.c: Likewise.
      * src/sysdep.c: Likewise.
      * src/termcap.c: Likewise.
      * src/terminal.c: Likewise.
      * src/tparam.c: Likewise.
      * src/w16select.c: Likewise.
      * src/w32.c: Likewise.
      * src/w32reg.c: Likewise.
      * src/w32select.c: Likewise.
      * src/w32uniscribe.c: Likewise.
      * src/widget.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xmenu.c: Likewise.
      * src/xrdb.c: Likewise.
      * src/xselect.c: Likewise.
      23f86fce
  14. 04 Jul, 2012 1 commit
    • Paul Eggert's avatar
      Fix bugs in file timestamp newness comparisons. · 39adff0d
      Paul Eggert authored
      * fileio.c (Ffile_newer_than_file_p):
      * lread.c (Fload): Use full timestamp resolution of files,
      not just the 1-second resolution, so that files that are only
      slightly newer still count as newer.
      * fileio.c (Ffile_newer_than_file_p): Don't assume file
      timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
      39adff0d
  15. 30 Jun, 2012 1 commit
    • Glenn Morris's avatar
      Make --no-site-lisp work for --enable-locallisppath elements · ca26824c
      Glenn Morris authored
      without "site-lisp" in the name.
      Ref http://debbugs.gnu.org/10208#25, point iii).
      
      * configure.in (standardlisppath): New output variable.
      (lisppath): Use standardlisppath.
      * Makefile.in (standardlisppath): New, set by configure.
      (epaths-force): Use standardlisppath and locallisppath rather than lisppath.
      
      * src/epaths.in (PATH_SITELOADSEARCH): New.
      * src/lread.c (init_lread): Use PATH_SITELOADSEARCH.
      
      * nt/paths.h (PATH_SITELOADSEARCH): New.
      
      Fixes: debbugs:11658
      ca26824c
  16. 24 Jun, 2012 1 commit
  17. 22 Jun, 2012 1 commit
  18. 19 Jun, 2012 1 commit
  19. 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
  20. 11 Jun, 2012 1 commit
    • Stefan Monnier's avatar
      Don't purify in Fmake_byte_code. · 3017f87f
      Stefan Monnier authored
      * src/alloc.c (make_byte_code): New function.
      (Fmake_byte_code): Use it.  Don't purify here.
      * src/lread.c (read1): Use it as well to avoid extra allocation.
      3017f87f
  21. 08 Jun, 2012 1 commit
    • Stefan Monnier's avatar
      Clean up scoping rule of predefined single-word vars. · 513749ee
      Stefan Monnier authored
      * lisp/startup.el (argv, argi): Make lexically scoped.
      * lisp/emacs-lisp/float-sup.el (pi): Use internal-make-var-non-special.
      * lisp/emacs-lisp/cl-macs.el: Use lexical-binding.
      Rename cl-bind-* to cl--bind-*.
      * lisp/files.el: Don't require `cl' since it doesn't use it.
      * lisp/emacs-lisp/pcase.el, lisp/emacs-lisp/macroexp.el: Add coding cookie.
      * src/eval.c (Fmake_var_non_special): New primitive.
      (syms_of_eval): Defsubr it.
      * src/lread.c (syms_of_lread): Mark `values' as lexically scoped.
      513749ee
  22. 30 May, 2012 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/byte-run.el (defmacro, defun): Move from C. · 61b108cc
      Stefan Monnier authored
      (macro-declaration-function): Move var from C code.
      (macro-declaration-function): Define function with defalias.
      * lisp/emacs-lisp/macroexp.el (macroexpand-all-1):
      * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form):
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't handle
      defun/defmacro any more.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature):
      Provide fallback for unknown arglist.
      (byte-compile-arglist-warn): Change calling convention.
      (byte-compile-output-file-form): Move print-vars binding.
      (byte-compile-output-docform): Simplify accordingly.
      (byte-compile-file-form-defun, byte-compile-file-form-defmacro)
      (byte-compile-defmacro-declaration): Remove.
      (byte-compile-file-form-defmumble): Generalize to defalias.
      (byte-compile-output-as-comment): Return byte-positions.
      Simplify callers accordingly.
      (byte-compile-lambda): Use `assert'.
      (byte-compile-defun, byte-compile-defmacro): Remove.
      (byte-compile-file-form-defalias):
      Use byte-compile-file-form-defmumble.
      (byte-compile-defalias-warn): Remove.
      * src/eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
      Move to byte-run.el.
      (Fautoload): Do the hash-doc more carefully.
      * src/data.c (Fdefalias): Purify definition, except for keymaps.
      (Qdefun): Move from eval.c.
      * src/lisp.h (Qdefun): Remove.
      * src/lread.c (read1): Tiny simplification.
      * lib-src/make-docfile.c: Improve comment style.
      (search_lisp_doc_at_eol): New function.
      (scan_lisp_file): Use it.
      61b108cc
  23. 26 May, 2012 1 commit
  24. 25 May, 2012 1 commit
  25. 15 May, 2012 1 commit
  26. 13 Apr, 2012 1 commit
  27. 09 Apr, 2012 1 commit
  28. 26 Jan, 2012 1 commit
  29. 11 Jan, 2012 2 commits