1. 25 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some strlen work, primarily via strnlen · d7c68362
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
      * lib-src/etags.c (find_entries):
      * src/emacs.c (main):
      * src/nsmenu.m (parseKeyEquiv:):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/term.c (vfatal):
      Prefer !*X to !strlen (X).
      * lib-src/etags.c (pfnote, add_regex):
      * lib-src/pop.c (pop_open):
      * lib-src/update-game-score.c (main):
      * lwlib/lwlib.c (lw_separator_p):
      * src/doprnt.c (doprnt):
      * src/emacs.c (main):
      * src/inotify.c (inotifyevent_to_event):
      * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      * src/xdisp.c (store_mode_line_string):
      Use strnlen to avoid unnecessary work with strlen.
      * lib-src/etags.c (Prolog_functions, prolog_pr)
      (Erlang_functions, erlang_func):
      Prefer ptrdiff_t to size_t when either will do.
      (prolog_pr, erlang_func): New arg LASTLEN, to avoid
      unnecessary strlen call. All callers changed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
      * lwlib/lwlib.c (lw_separator_p):
      * src/json.c (json_has_prefix):
      Use strncmp to avoid unecessary work with strlen + memcmp.
      * src/process.c (set_socket_option): Use SBYTES instead of strlen.
      d7c68362
  2. 10 Jun, 2019 1 commit
  3. 24 Apr, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Don't link libXft when using cairo · 5f4e8e2e
      YAMAMOTO Mitsuharu authored
      * configure.ac: Check cairo early.  Don't try Xft if cairo is used.
      * lwlib/lwlib-utils.h [USE_CAIRO]: Include cairo.h and fontconfig.h.
      (XftFont, XftDraw, XftColor, XGlyphInfo) [USE_CAIRO]: New typedefs.
      (XftFontOpenName, XftFontClose, XftDrawCreate, XftDrawDestroy)
      (XftDrawRect, XftDrawStringUtf8, XftTextExtentsUtf8) [USE_CAIRO]: New macros.
      (crxft_font_open_name, crxft_font_close, crxft_draw_create)
      (crxft_draw_rect, crxft_draw_string, crxft_text_extents) [USE_CAIRO]: New
      externs.
      * lwlib/lwlib-utils.c [USE_CAIRO]: Include math.h, cairo-ft.h, and
      cairo-xlib.h.
      (crxft_font_open_name, crxft_font_close, crxft_draw_create)
      (crxft_set_source_color, crxft_draw_rect, crxft_draw_string)
      (crxft_text_extents) [USE_CAIRO]: New Xft compatibility functions.
      * lwlib/xlwmenuP.h [USE_CAIRO]: Include lwlib-utils.h.
      * lwlib/xlwmenu.c (display_menu_item) [USE_CAIRO]: Call
      cairo_surface_mark_dirty and cairo_surface_flush.
      * lwlib/lwlib-Xaw.c [USE_CAIRO]: Include stdlib.h and lwlib-utils.h.
      (draw_text) [USE_CAIRO]: Call cairo_surface_flush.
      * src/xsettings.c [USE_CAIRO]: Include fontconfig.h
      (apply_xft_settings) [!HAVE_XFT]: Don't call XftDefaultSubstitute or
      XftDefaultSet.
      * lwlib/lwlib-Xaw.c:
      * lwlib/lwlib-int.h:
      * lwlib/xlwmenu.c:
      * lwlib/xlwmenuP.h:
      * src/xrdb.c:
      * src/xsettings.c:
      * src/xterm.c: Replace all #ifdef HAVE_XFT with #if defined USE_CAIRO ||
      defined HAVE_XFT.
      * src/xfns.c (x_default_font_parameter): Replace #ifdef HAVE_XFT with #if
      defined	USE_CAIRO || defined HAVE_XFT.
      5f4e8e2e
  4. 23 Apr, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Release xft_data in widget destroy callback to avoid visual distraction · 085929ca
      YAMAMOTO Mitsuharu authored
      * lwlib/lwlib-int.h (struct _widget_instance) [HAVE_XFT]: Remove nr_xft_data.
      * lwlib/lwlib-Xaw.c (find_xft_data, xaw_update_one_widget) [HAVE_XFT]: Loop
      while widget member is not NULL instead of using nr_xft_data.
      (xaw_destroy_instance) [HAVE_XFT]: Move xft_data release code from here ...
      (destroy_xft_data) [HAVE_XFT]: ... to here.
      (make_dialog) [HAVE_XFT]: Add destroy_xft_data as destroy callback for dialog.
      085929ca
  5. 21 Apr, 2019 2 commits
  6. 01 Jan, 2019 1 commit
  7. 17 Dec, 2018 1 commit
    • Paul Eggert's avatar
      More porting to GCC 8 of --enable-gcc-warnings · e8bb0420
      Paul Eggert authored
      Backport from master.
      I ran into this when building Emacs 26 with GCC 8 on Fedora 29 x86.
      * lwlib/lwlib-Xaw.h (xaw_update_one_value, xaw_popup_menu):
      * lwlib/lwlib-Xlw.h (xlw_update_one_value, xlw_pop_instance):
      * lwlib/lwlib.h (lw_allow_resizing, lw_set_main_areas) [!USE_MOTIF]:
      No longer const.
      * src/emacs-module.c: Ignore -Wcast-function-type.
      e8bb0420
  8. 24 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Fix ‘make clean’ with a file named ‘-.o’ · 36243179
      Paul Eggert authored
      Problem reported by T.V Raman in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00866.html
      * Makefile.in (clean, extraclean):
      * doc/emacs/Makefile.in (mostlyclean):
      * doc/lispintro/Makefile.in (mostlyclean):
      * doc/lispref/Makefile.in (mostlyclean):
      * doc/misc/Makefile.in (mostlyclean, clean):
      * etc/refcards/Makefile (clean):
      * lib-src/Makefile.in (mostlyclean, extraclean):
      * lib/Makefile.in (clean):
      * lwlib/Makefile.in (clean mostlyclean):
      * oldXMenu/Makefile.in (clean mostlyclean):
      * src/Makefile.in (mostlyclean, extraclean):
      * test/Makefile.in (mostlyclean):
      Say ‘rm ./*.o’ instead of ‘rm *.o’ to avoid undesirable failure
      when a file name begins with ‘-’.
      36243179
  9. 12 Jun, 2018 1 commit
  10. 03 May, 2018 1 commit
    • Paul Eggert's avatar
      More porting to GCC 8 of --enable-gcc-warnings · ef1deb48
      Paul Eggert authored
      * lwlib/lwlib-Xaw.h (xaw_update_one_value, xaw_popup_menu):
      * lwlib/lwlib-Xlw.h (xlw_update_one_value, xlw_pop_instance):
      * lwlib/lwlib.h (lw_allow_resizing, lw_set_main_areas) [!USE_MOTIF]:
      No longer const.
      * src/emacs-module.c: Ignore -Wcast-function-type.
      ef1deb48
  11. 01 Jan, 2018 1 commit
  12. 02 Oct, 2017 1 commit
    • Paul Eggert's avatar
      Merge from Gnulib · 8cdd8b92
      Paul Eggert authored
      This is mostly to change http: to https: in licenses.
      * COPYING, build-aux/config.guess, build-aux/config.sub:
      * doc/emacs/doclicense.texi, doc/emacs/gpl.texi:
      * doc/lispintro/doclicense.texi, doc/lispref/doclicense.texi:
      * doc/lispref/gpl.texi, doc/misc/doclicense.texi:
      * doc/misc/gpl.texi, etc/COPYING, leim/COPYING:
      * lib-src/COPYING, lib/COPYING, lisp/COPYING, lwlib/COPYING:
      * msdos/COPYING, nt/COPYING, src/COPYING:
      Copy from Gnulib.
      8cdd8b92
  13. 30 Sep, 2017 1 commit
  14. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  15. 21 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Streamline dependency-file generation · bf8cf95d
      Paul Eggert authored
      * configure.ac (AUTODEPEND_PARENTS): New var.
      mkdir the dependency directories here, to simplify ‘make’.
      Remove dependency files just before outputting Makefiles, so that
      they are preserved if ‘configure’ exits early due to some other problem.
      * lib/Makefile.in, lwlib/Makefile.in, oldXMenu/Makefile.in:
      * src/Makefile.in: Adjust deps strategies to be similar, as follows:
      (MKDEPDIR): Remove.  All uses removed.  This cuts down on the
      number of processes spun off by ‘make’.
      (clean mostlyclean): Remove $(DEPDIR) contents, not $(DEPDIR) itself.
      (distclean): Remove $(DEPDIR) itself.
      * lwlib/Makefile.in (all): Move to front, so that depdir includes
      do not alter default action.
      bf8cf95d
  16. 10 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Tweak X toolkit code to pacify modern GCC · ec168376
      Paul Eggert authored
      * lwlib/lwlib-Xaw.c, lwlib/lwlib-Xm.c, lwlib/lwlib.c:
      Don’t include <stdlib.h>, since this code now calls emacs_abort
      rather than abort.
      * lwlib/lwlib-Xaw.c (make_dialog, xaw_generic_callback)
      (wm_delete_window):
      * lwlib/lwlib-Xm.c (make_menu_in_widget, do_call):
      * lwlib/lwlib.c (instantiate_widget_instance, lw_make_widget):
      * lwlib/xlwmenu.c (abort_gracefully, draw_separator)
      (separator_height, XlwMenuInitialize):
      Use emacs_abort, not abort.  Without this change, some calls
      to ‘abort’ were invalid, as stdlib.h was not always included.
      * src/widget.c (resources, emacsFrameClassRec):
      * src/xfns.c (x_window) [USE_X_TOOLKIT]:
      * src/xmenu.c (create_and_show_popup_menu) [USE_X_TOOLKIT]:
      * src/xterm.c (emacs_options) [USE_X_TOOLKIT}:
      (x_term_init) [USE_X_TOOLKIT]:
      Cast string constants to char * to pacify --enable-gcc-warnings.
      ec168376
  17. 08 Jan, 2017 1 commit
  18. 01 Jan, 2017 1 commit
  19. 29 Nov, 2016 1 commit
  20. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  21. 01 Jul, 2016 1 commit
  22. 06 Jan, 2016 1 commit
    • Glenn Morris's avatar
      Build tweaks related to tags files. · c6d3c60f
      Glenn Morris authored
      * lib-src/Makefile.in (tagsfiles): New variable.
      (TAGS): Also depend on the source files.  Use our own etags program.
      * lisp/Makefile.in (ETAGS): Add EXEEXT.
      (lisptagsfiles1, lisptagsfiles2, lisptagsfiles3, lisptagsfiles4):
      Remove.
      (tagsfiles): New, replacing lisptagsfiles1 etc.
      Remove irrelevant source files here rather than in the TAGS rule.
      (${ETAGS}): New rule.
      (TAGS): Also depend on the etags executable.
      * lwlib/Makefile.in (EXEEXT): New, set by configure.
      (ETAGS): Add EXEEXT.
      (${ETAGS}): New rule.
      (ctagsfiles): Use "wildcard".
      (TAGS): Also depend on the etags executable.
      * nt/Makefile.in (ETAGS, tagsfiles): New variables.
      (${ETAGS}): New rule.
      (TAGS): Fix dependencies.
      * oldXMenu/Makefile.in (EXEEXT): New, set by configure.
      (ETAGS): New variable, replacing $TAGS.  Use our own etags program.
      Remove "-t" argument.
      (${ETAGS}): New rule.
      (tagsfiles): New variable.
      (TAGS): New rule, with proper dependencies.
      * src/Makefile.in (ETAGS): Add EXEEXT.  Add a build rule.
      (ctagsfiles1, ctagsfiles2): Use "wildcard".
      (ctagsfiles3): Remove.
      (TAGS): Depend on etags.
      (../lisp/TAGS, $(lwlibdir)/TAGS): Let the rules in the relevant
      directories decide if updates are needed.
      c6d3c60f
  23. 01 Jan, 2016 1 commit
  24. 19 Dec, 2015 1 commit
    • Paul Eggert's avatar
      Remove SunOS 4.x cruft · 7d7e742f
      Paul Eggert authored
      Support for SunOS 4.x was removed in Emacs 23 but some cruft was left behind.
      * lib-src/pop.c [sun]: Remove no-longer-needed include.
      * lwlib/xlwmenu.c (SUNSO41): Remove.
      7d7e742f
  25. 16 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Make src headers idempotent and standalone · 55ba8c02
      Paul Eggert authored
      Redo src/*.h so that each include file is idempotent (that is, can
      be included multiple times with the latter inclusions having no
      effect) and standalone (that is, can be included by itself,
      with no include file other than config.h needed as a prerequisite).
      This is standard practice in GNU programs nowadays.
      * lwlib/lwlib-widget.h, src/buffer.h, src/category.h, src/character.h:
      * src/charset.h, src/coding.h, src/commands.h, src/disptab.h:
      * src/fontset.h, src/gnutls.h, src/indent.h, src/keymap.h, src/macros.h:
      * src/regex.h [emacs]:
      * src/syntax.h, src/systty.h, src/termhooks.h:
      Include lisp.h, for Lisp_Object.
      * src/buffer.h, src/category.h, src/cm.h, src/commands.h, src/disptab.h:
      * src/indent.h, src/intervals.h, src/keyboard.h, src/macros.h:
      * src/process.h, src/puresize.h, src/region-cache.h, src/syntax.h:
      * src/syssignal.h, src/sysstdio.h, src/systty.h, src/termchar.h:
      * src/termopts.h, src/tparam.h, src/unexec.h:
      Protect against multiple inclusion.
      * src/buffer.h: Include character.h, for STRING_CHAR.
      * src/emacsgtkfixed.h (struct frame):
      * src/fontset.h (struct face):
      * src/region-cache.h (struct buffer):
      * src/termhooks.h (struct glyph):
      * src/xsettings.h (struct x_display_info):
      Add possibly-forward decl.
      * src/syntax.h: Include buffer.h, for BVAR.
      * src/sysselect.h: Include lisp.h, for eassume.
      * src/termchar.h: Include <stdio.h>, for FILE.
      * src/widget.h: Include <X11/IntrinsicP.h>, for Widget.
      * src/xsettings.h: Include <X11/Xlib.h>, for XEvent.
      55ba8c02
  26. 09 Jun, 2015 1 commit
  27. 23 May, 2015 1 commit
  28. 16 May, 2015 1 commit
    • Glenn Morris's avatar
      Replace AC_SUBST_FILE in configure with include in Makefiles. · 48e384d7
      Glenn Morris authored
      * configure.ac (DEPDIR, MKDEPDIR, deps_frag, lwlib_deps_frag)
      (oldxmenu_deps_frag, lisp_frag): Remove output variables/files.
      (AUTO_DEPEND): New output variable.
      * lwlib/Makefile.in (AUTO_DEPEND): New, set by configure.
      (DEPFLAGS, MKDEPDIR): Set directly via conditional.
      (lwlib_deps_frag): Replace by conditional include.
      * lwlib/autodeps.mk: Remove file.
      * oldXMenu/Makefile.in (AUTO_DEPEND): New, set by configure.
      (DEPFLAGS, MKDEPDIR): Set directly via conditional.
      (oldxmenu_deps_frag): Replace by conditional include.
      * oldXMenu/autodeps.mk: Remove file.
      * src/Makefile.in (AUTO_DEPEND): New, set by configure.
      (DEPFLAGS, MKDEPDIR): Set directly via conditional.
      (lisp_frag): Replace by an include.
      (deps_frag): Replace by conditional include.
      * src/autodeps.mk: Remove file.
      48e384d7
  29. 14 Apr, 2015 1 commit
  30. 07 Apr, 2015 2 commits
    • Paul Eggert's avatar
      Generate a ChangeLog file from commit logs · 23468561
      Paul Eggert authored
      * .gitignore: Add 'ChangeLog'.
      * build-aux/gitlog-to-changelog: New file, from Gnulib.
      * build-aux/gitlog-to-emacslog: New file.
      * CONTRIBUTE: Document the revised workflow.
      * Makefile.in (clean): Remove *.tmp and etc/*.tmp*
      instead of just special cases.
      (CHANGELOG_HISTORY_INDEX_MAX, CHANGELOG_N, gen_origin): New vars.
      (ChangeLog, unchanged-history-files, change-history)
      (change-history-commit): New rules.
      * admin/admin.el (make-manuals-dist--1):
      Don't worry about doc/ChangeLog.
      * admin/authors.el: Add a FIXME.
      * admin/make-tarball.txt:
      * lisp/calendar/icalendar.el:
      * lisp/gnus/deuglify.el:
      * lisp/obsolete/gulp.el:
      * lwlib/README:
      Adjust to renamed ChangeLog history files.
      * admin/merge-gnulib (GNULIB_MODULES): Add gitlog-to-changelog.
      * admin/notes/repo: Call it 'master' a la Git, not 'trunk' a la Bzr.
      Remove obsolete discussion of merging ChangeLog files.
      New section "Maintaining ChangeLog history".
      * build-aux/git-hooks/pre-commit:
      Reject attempts to commit files named 'ChangeLog'.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * make-dist: Make and distribute top-level ChangeLog if there's a
      .git directory.  Distribute the new ChangeLog history files
      instead of scattered ChangeLog files.  Distribute the new files
      gitlog-to-changelog and gitlog-to-emacslog.
      Fixes: bug#19113
      23468561
    • Paul Eggert's avatar
      Rename ChangeLogs for gitlog-to-changelog · dd1404cc
      Paul Eggert authored
      This patch was implemented via the following shell commands:
      find * -name ChangeLog |
      sed 's,.*,git mv & &.1,
      s, lisp/ChangeLog\.1$, lisp/ChangeLog.17,
      s, lisp/erc/ChangeLog\.1$, lisp/erc/ChangeLog.09,
      s, lisp/gnus/ChangeLog\.1$, lisp/gnus/ChangeLog.3,
      s, lisp/mh-e/ChangeLog\.1$, lisp/mh-e/ChangeLog.2,
      s, src/ChangeLog\.1$, src/ChangeLog.13,' |
      sh
      git commit -am"[this commit message]"
      dd1404cc
  31. 05 Apr, 2015 1 commit
  32. 03 Apr, 2015 1 commit
  33. 27 Mar, 2015 1 commit
  34. 18 Mar, 2015 1 commit
    • Stefan Monnier's avatar
      Add classes as run-time descriptors of cl-structs. · 872481d9
      Stefan Monnier authored
      * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class): New function.
      (cl--make-slot-desc): New constructor.
      (cl--plist-remove, cl--struct-register-child): New functions.
      (cl-struct-define): Rewrite.
      (cl-structure-class, cl-structure-object, cl-slot-descriptor)
      (cl--class): New structs.
      (cl--struct-default-parent): Initialize it here.
      * lisp/emacs-lisp/cl-macs.el (cl--find-class): New macro.
      (cl-defsubst, cl--defsubst-expand, cl--sublis): Move before first use.
      (cl--struct-default-parent): New var.
      (cl-defstruct): Adjust to new representation of classes; add
      default parent.  In accessors, signal `wrong-type-argument' rather than
      a generic error.
      (cl-struct-sequence-type, cl-struct-slot-info)
      (cl-struct-slot-offset): Rewrite.
      * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-specializers)
      (cl-generic-generalizers): Rewrite.
      * src/alloc.c (purecopy): Handle hash-tables.
      
      * lisp/emacs-lisp/debug.el (debug--implement-debug-on-entry):
      Bind inhibit-debug-on-entry here...
      (debug): Instead of here.
      
      * lisp/emacs-lisp/macroexp.el (macroexp--debug-eager): New var.
      (internal-macroexpand-for-load): Use it.
      
      * lwlib/xlwmenu.c (pop_up_menu): Remove debugging code.
      872481d9
  35. 28 Feb, 2015 1 commit
  36. 04 Jan, 2015 2 commits
  37. 01 Jan, 2015 1 commit