PATH_MAX is standardized, MAXPATHLEN is not.
Also, the Gnulib pathmax module fixes some rare bugs with PATH_MAX.
So prefer PATH_MAX to MAXPATHLEN unless we know the latter is
also correct (for some platform-specific code).
* admin/merge-gnulib (GNULIB_MODULES): Add pathmax.
This module was already present, as a dependency of canonicalize-lgpl,
but now Emacs is using it directly. Sort.
* lib-src/emacsclient.c: Include stdint.h, pathmax.h.
(get_current_dir_name): Sync to current src/sysdep.c.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/sysdep.c: Include pathmax.h.
(get_current_dir_name_or_unreachable):
Use PATH_MAX instead of MAXPATHLEN.
* lib-src/Makefile.in (etags_cflags): Remove.
All uses replaced by a simple ‘-o $@’.
(ebrowse${EXEEXT}, emacsclient${EXEEXT}, emacsclientw${EXEEXT}):
Omit -DVERSION= option.
* lib-src/ebrowse.c (VERSION):
* lib-src/emacsclient.c (VERSION):
* lib-src/etags.c (EMACS_NAME, VERSION): Remove.
All uses replaced by PACKAGE_NAME and PACKAGE_VERSION.
* lib-src/ebrowse.c (version):
* lib-src/etags.c (print_version):
Use fputs to output the version info, since that’s fputs_unlocked.
* lib-src/etags.c (PROGRAM_NAME): New macro.
(print_version): Use it.
* lib-src/make-fingerprint.c (main): Don't consider multiple
instances of the fingerprint to be an error, as this can
happen with clang and -flto. Instead, replace all instances
of the fingerprint. There is a tiny chance that this will
silently corrupt the Emacs executable.
This patch suggests that we should go back to fingerprinting
the inputs to the linker instead of its output, as the new
fingerprinting scheme is unnecessarily complicated and this
complexity reduces reliability. The old scheme (i.e., before
commit 2019-05-14T23:31:24Z!eggert@cs.ucla.edu) was simpler
and more portable and good enough, and it's looking like it
would be less trouble in practice than the new scheme.
* lib-src/etags.c [!DEBUG]: Do not define NDEBUG,
as that’s conf_post.h’s job now.
[NDEBUG]: Do not redefine ‘assert’, as that works around
ancient bugs (e.g., sunos4 pcc) that don’t matter any more,
as can be seen that other Emacs source files that successfully
use assert.h without this workaround.
This auxiliary executable was used by the old `profile.el` which later
inspired `elp.el`. It was made obsolete when Emacs acquired native timers.
* lib-src/Makefile.in (UTILITIES): Remove profile.
(profile${EXEEXT}): Delete rule.
Without this fix, linking emacsclient fails with ‘Undefined
symbol eaccess’ on Solaris 10 sparc.
* lib-src/Makefile.in (LIB_EACCESS): New macro.
(emacsclient${EXEEXT}, emacsclientw${EXEEXT}): Use it.
* lib-src/emacsclient.c (set_local_socket):
Use faccessat with AT_EACCESS instead of using euidaccess.
* admin/merge-gnulib, lib/gnulib.mk.in, m4/gnulib-comp.m4:
Revert previous change.
* lib-src/emacsclient.c (set_local_socket):
If there appears to be an XDG runtime directory for the user
but XDG_RUNTIME_DIR is unset, suggest setting it while warning
about potential security issues (Bug#35300).
* lib-src/make-fingerprint.c (fseeko) [WNDOWSNT]: Define to
fseeko64 for non-MinGW64 MinGW.
* lib-src/ntlib.c (stat): Fix calculation of file size.
(fstat): New function, a subset of src/w32.c:fstat. This is
needed because make-fingerprint.c now calls 'fstat', and the
MS version will fail to produce reliable results because
nt/inc/sys/stat.h redefines 'struct stat'.
* admin/merge-gnulib (GNULIB_MODULES): Add memmem-simple.
(AVOIDED_MODULES): Add memchr.
* configure.ac (HAVE_PDUMPER): AC_SUBST it, too, for use in makefiles.
* lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
* lib/fingerprint.c: New file.
* lib/memmem.c, lib/str-two-way.h, m4/memmem.m4: New files,
copied from Gnulib.
* lib/fingerprint.h: Rename from src/fingerprint.h.
* lib-src/make-fingerprint.c: Include limits.h, sys/stat.h,
fingerprint.h, intprops.h, min-max.h.
(SSIZE_MAX): New macro, if not already defined.
(main): Without -r, Replace the fingerprint in the input file
instead of generating a fingerprint.c.
* lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/Makefile.in (HAVE_PDUMPER, MAKE_PDUMPER_FINGERPRINT):
New macros.
(temacs$(EXEEXT)): Use them to replace the fingerprint instead
of precalculating it.
(mostlyclean, ctagsfiles1): Do not worry about fingerprint.c.
Instead of building a file temacs.in used only to compute a
fingerprint, compute the fingerprint directly from the .o and
.a files that go into temacs.in. This speeds up the build by
avoiding the need to link temacs twice, once with a dummy
fingerprint.
* lib-src/make-fingerprint.c (main): No need to generate
a fingerprint file that includes config.h, now that fingerprint.c
depends on all the .o files.
* src/Makefile.in ($(libsrc)/make-fingerprint$(EXEEXT)):
Use the same rule as $(libsrc)/make-docfile$(EXEEXT).
* src/fingerprint-dummy.c: Remove.
* src/Makefile.in (${charsets}, $(libsrc)/make-docfile$(EXEEXT))
($(LIBEGNU_ARCHIVE), $(lwlibdir)/liblw.a, $(oldXMenudir)/libXMenu11.a)
(../config.status, ${ETAGS}, ../lisp/TAGS, $(lwlibdir)/TAGS)
($(lispsource)/loaddefs.el):
Prefer ‘$(MAKE) -C $(dir $@)’ to ‘${MAKE} -C SOMESTRING’ when
either will do, as the former is more regular and lets us
coalesce rules better.
(EMACS_DEPS_PRE, EMACS_DEPS_POST, BUILD_EMACS_PRE)
(BUILD_EMACS_POST, temacs.in$(EXEEXT)): Remove.
(FINGERPRINTED): New macro.
(fingerprint.c): Use it instead of temacs.in$(EXEEXT), to
avoid the need to build temacs.in at all.
(temacs$(EXEEXT)): No need to depend on other .o files now;
fingerprint.o is enough, since it depends on the rest.
Spell out what used to be in BUILD_EMACS_PRE and BUILD_EMACS_POST.
(mostlyclean): No need to remove temacs.in.
C11 doesn’t guarantee the existence of types like uint64_t,
so avoid these types in portable code, as it’s easy to do so.
There’s no need to avoid the types in w32-specific code,
since w32 is guaranteed to have them.
* lib-src/make-fingerprint.c (main):
* src/fingerprint-dummy.c:
* src/fingerprint.h:
* src/pdumper.c (dump_fingerprint, struct dump_header):
Prefer unsigned char to uint8_t in portable code, as either will do.
Put an "#include <config.h>" in fingerprint.c files, so
that the corresponding .o file is rebuilt after ./configure is run.
* lib-src/make-fingerprint.c (main):
Simplify loop.
* src/Makefile.in (fingerprint.c): Update atomically.
* src/pdumper.c: Omit unnecessary check that off_t is the same
size as int32_t or int64_t, as the code does not rely on this
assumption.
(dump_off): Use int_least32_t, not int32_t.
(struct dump_reloc): Use unsigned int, not uint32_t.
(dump_anonymous_allocate_w32, dump_anonymous_allocate_posix)
(dump_anonymous_allocate, dump_map_file_w32, dump_map_file_posix)
(dump_map_file:
Do the sanity checks at compile time, not at run-time, to avoid
usage of uint64_t etc. on non-w32 platforms.
This should help future improvements where these stats can be
bignums that do not fit into intmax_t.
* src/alloc.c (struct gcstat, gcstat): New type and static var,
to package up GC statistics into one C object. It replaces ...
(total_free_intervals, total_intervals, total_strings)
(total_free_strings, total_string_bytes, total_vectors)
(total_vector_slots, total_free_vector_slots): ... these
removed static vars. All uses changed.
(garbage_collect_1): Accept a struct gcstat *, not a void *
which was not used anymore anyway. Return a bool indicating
success, instead of a Lisp object. All callers changed.
(garbage_collect): New function. All C callers of
Fgarbage_collect changed to use it, since none of them use the
return value. Now, only Lisp code uses Fgarbage_collect.
(Fgarbage_collect): No longer noinline. Cons up the return
value here, not in garbage_collect_1.
Formerly they were fixnums, which led to problems when dealing
with values that might not fit on 32-bit platforms, such as
string-chars-consed or floats_consed. 64-bit counters should
be good enough for these (for a while, anyway...).
While we’re at it, fix some unlikely integer overflow bugs
that have been in the code for a while.
* lib-src/make-docfile.c (write_globals):
* src/data.c (do_symval_forwarding, store_symval_forwarding):
* src/eval.c (restore_stack_limits, call_debugger):
* src/frame.h (struct frame.cost_calculation_baud_rate):
* src/keyboard.c (last_auto_save, bind_polling_period, read_char):
* src/lisp.h (struct Lisp_Intfwd.intvar):
* src/lread.c (defvar_int):
* src/pdumper.c (dump_fwd_int):
* src/thread.h (struct thread_state.m_lisp_eval_depth):
* src/undo.c (truncate_undo_list):
* src/xselect.c (wait_for_property_change)
(x_get_foreign_selection):
* src/xterm.c (x_emacs_to_x_modifiers):
DEFVAR_INT variables now have the C type intmax_t, not EMACS_INT.
* src/data.c (store_symval_forwarding):
* src/gnutls.c (Fgnutls_boot):
* src/keyboard.c (bind_polling_period):
* src/macros.c (pop_kbd_macro, Fexecute_kbd_macro):
* src/undo.c (truncate_undo_list):
Allow any integer that fits into intmax_t, instead of
requiring it to be a Lisp fixnum.
* src/dispnew.c (update_window):
* src/frame.c (x_figure_window_size):
* src/gnutls.c (init_gnutls_functions)
(emacs_gnutls_handle_error):
* src/keyboard.c (make_lisp_event):
* src/nsterm.m (ns_dumpglyphs_image):
* src/profiler.c (make_log):
* src/scroll.c (calculate_scrolling)
(calculate_direct_scrolling):
* src/termcap.c (tputs):
* src/xterm.c (x_draw_image_relief):
Avoid implementation-defined behavior on conversion of
out-of-range integers.
* src/eval.c (when_entered_debugger): Now intmax_t.
(max_ensure_room): New function, that avoids signed integer overflow.
(call_debugger, signal_or_quit): Use it.
* src/fileio.c (Fdo_auto_save):
* src/keyboard.c (make_lisp_event):
* src/term.c (calculate_costs):
* src/xdisp.c (build_desired_tool_bar_string)
(hscroll_window_tree, try_scrolling, decode_mode_spec)
(x_produce_glyphs):
Avoid signed integer overflow.
* src/lisp.h (clip_to_bounds): Generalize to intmax_t.
* src/pdumper.c (dump_emacs_reloc_immediate_emacs_int): Remove, ...
(dump_emacs_reloc_immediate_intmax_t): ... replacing with this
function. All uses changed.
* src/profiler.c (make_log): Omit args. All callers changed.
* src/termcap.c: Include stdlib.h, for atoi.
Include intprops.h.
* src/window.c (sanitize_next_screen_context_lines): New function.
(window_scroll_pixel_based, window_scroll_line_based):
Use it to avoid signed integer overflow.
Add a new portable dumper as an alternative to unexec. Use it by default.
* src/dmpstruct.awk: New file.
* src/doc.c (get_doc_string): use will_dump_p().
* src/editfns.c (styled_format): silence compiler warning
with UNINIT.
* src/emacs-module.c (syms_of_module): staticpro ltv_mark.
* src/emacs.c (gflags): new variable.
(init_cmdargs): unwrap
(string_starts_with_p, find_argument, dump_error_to_string)
(load_pdump): new functions.
(main): detect pdumper and --temacs invocation; actually load
portable dump when detected; set gflags as appropriate; changes to
init functions throughout to avoid passing explicit
'initialized' argument.
* src/eval.c (inhibit_lisp_code): remove unused variable.
(init_eval_once_for_pdumper): new function.
(init_eval_once): call it.
* src/filelock.c: CANNOT_DUMP -> will_dump_p()
* src/fingerprint-dummy.c: new file
* src/fingerprint.h: new file
* src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
(weak_hash_tables): remove
(hashfn_equal, hashfn_eql): un-staticify
(make_hash_table): set new 'next_weak' hash table field; drop
global weak_hash_tables logic.
(copy_hash_table): drop global weak_hash_tables logic.
(hash_table_rehash): new function.
(hash_lookup, hash_put, hash_remove_from_table, hash_clear):
rehash if needed.
(sweep_weak_table): un-staticify; explain logic; bool-ify.
(sweep_weak_hash_tables): remove function.
* src/font.c (syms_of_font): remember pdumper stuff.
* src/fontset.c (syms_of_fontset): remember pdumper stuff.
* src/frame.c (make_initial_frame): don't reset Vframe_list.
(init_frame_once_for_pdumper, init_frame_once): new functions.
(syms_of_frame): remove redundant staticpro.
* src/fringe.c (init_fringe_once_for_pdumper): new functin.
(init_fringe_once): call it.
* src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
(syms_of_ftcrfont): call it.
* src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
(syms_of_ftfont): call it.
* src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
(syms_of_ftxfont): call it.
* src/gmalloc.c: adjust for pdumper througout
(DUMPED): remove weird custom dumped indicator.
* src/gnutls.c (syms_of_gnutls): pdumper note for
gnutls_global_initialized.
* src/image.c (syms_of_image): add pdumper comment,
initializer note.
* src/insdel.c (prepare_to_modify_buffer_1): account
for buffer contents possibly being in dump image.
* src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
(syms_of_keyboard): staticpro more; call pdumper syms function.
* src/lisp.h: add comments throughout
(gflags): declare.
(will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
(dumped_with_pdumper_p, will_dump_with_unexec_p)
(dumped_with_unexec_p, definitely_will_not_unexec_p): new
functions.
(POWER_OF_2, ROUNDUP): move macros.
(PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
pointer instead of vector; constify.
(Lisp_Hash_Table): add comment about need to rehash on access; add
comment for next_weak.
(HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
(hash_table_rehash): declare.
(hash_rehash_needed_p, hash_rehash_if_needed): new functions.
(finalizers, doomed_finalizers): declare extern.
(SUBR_SECTION_ATTRIBUTE): new macro.
(staticvec, staticidx): un-static-ify.
(sweep_weak_hash_tables): remove declaration.
(sweep_weak_table): declare.
(hashfn_eql, hashfn_equal): declare.
(number_finalizers_run): new variable.
(Vdead): externify when ENABLE_CHECKING.
(gc_root_type): new enumeration.
(gc_root_visitor): new struct.
(visit_static_gc_roots): declare.
(vectorlike_nbytes): declare.
(vector_nbytes): define as trivial inline function wrapper for
vectorlike_nbytes.
(init_obarray_once): change signature.
(primary_thread): extern-ify.
(init_buffer): change signature.
(init_frame_once): declare.
* src/lread.c (readevalloop): adjust for new dumped predicates.
(init_obarray_once): new function.
(ndefsubr): new variable.
(defsubr): increment it.
(load_path_check): adjust for pdumper.
(load_path_default): use pdumper functions; adjust for
dump search.
* src/macfont.m (macfont_init_font_change_handler): avoid
shadowing global.
(syms_of_macfont_for_pdumper): new function.
(syms_of_macfont): call it.
* src/menu.c (syms_of_menu): staticpro more stuff.
* src/minibuf.c (Ftry_completion): rehash if needed.
(init_minibuf_once_for_pdumper): new function.
(init_minibuf_once): call it.
* src/nsfont.m (syms_of_nsfns): staticpro more.
* src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
(syms_of_nsfont): call it.
* src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
* src/pdumper.c: new file.
* src/pdumper.h: new file.
* src/process.c (init_process_emacs): use new pdumper functions
instead of CANNOT_DUMP.
* src/profiler.c (syms_of_profiler_for_pdumper): new function.
(syms_of_profiler_for_pdumper): call it.
* src/search.c (syms_of_search_for_pdumper): new function.
(syms_of_search_for_pdumper): call it.
* src/sheap.c (bss_sbrk_did_unexec): remove.
* src/sheap.h (bss_sbrk_did_unexec): remove.
* src/syntax.c (syms_of_syntax): don't redundantly staticpro
re_match_object.
* src/sysdep.c: use will_dump_with_unexec_p() instead of bss
hack thing.
* src/syssignals.h (init_sigsegv): declare.
* src/systime.h (init_timefns): remove bool from signature.
* src/textprop.c (syms_of_textprop): move staticpro.
* src/thread.c (main_thread_p): constify.
* src/thread.h (main_thread_p): constify.
* src/timefns.c (init_timefns): remove bool from signature.
(syms_of_timefns_for_pdumper): new function.
(syms_of_timefns): call it.
* src/w32.c: rearrange code.
* src/w32.h (w32_relocate): declare.
* src/w32fns.c (syms_of_w32fns): add pdumper note.
* src/w32font.c (syms_of_w32font_for_pdumper): new function.
(syms_of_w32font): call it.
* src/w32heap.c (using_dynamic_heap): new variable.
(init_heap): use it.
* src/w32menu.c (syms_of_w32menu): add pdumper note.
* src/w32proc.c
(ctrl_c_handler, mainCRTStartup, _start, open_input_file)
(rva_to_section, close_file_data): move here.
* src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
new function.
(syms_of_w32uniscribe): call it.
* src/window.c (init_window_once_for_pdumper): new function.
(init_window_once): call it; staticpro more stuff.
* src/xfont.c (syms_of_xfont_for_pdumper): new function.
(syms_of_xfont): call it.
* src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
(syms_of_xftfont): call it.
* src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
(syms_of_xmenu): call it.
* src/xselect.c (syms_of_xselect_for_pdumper): new function.
(syms_of_xselect): call it.
* src/xsettings.c (syms_of_xsettings): add more pdumper notes.
* src/term.c (syms_of_xterm): add pdumper note.
* src/dispnew.c (init_faces_initial): new function.
(init_display_interactive): rename from init_display; use
will_dump_p instead of !initialized. Initialize faces early for
pdumper if needed.
(init_display): new function.
(syms_of_display_for_pdumper): new function.
(syms_of_display): call it.
* src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
on pdumper load.
* src/data.c (Fdefalias): Use will_dump_p
instead of Vpurify_flag.
(Fmake_variable_buffer_local): silence compiler warning with -Og
by making valcontents UNINIT.
(arith_driver): silence compiler warning with UNINIT.
* src/conf_post.h (ATTRIBUTE_SECTION): new macro.
* src/composite.c (composition_gstring_put_cache): rehash hash
table if needed.
* src/coding.c (init_coding_once, syms_of_coding): remember
pdumper stuff.
* src/charset.h (charset_table_size, charset_table_user): declare.
* src/charset.c (charset_table_used, charset_table_size): un-static.
(init_charset_oncem, syms_of_charset): remember pdumper stuff.
* src/category.c (category_table_version): remove obsolete
variable.
* src/callint.c (syms_of_callint): staticpro 'preserved_fns'
(init_callproc): use will_dump_p instead of !CANNOT_DUMP.
* src/bytecode.c (exec_byte_code): rehash table tables if needed
* src/buffer.c (alloc_buffer_text, free_buffer_text): account for
pdumper
(init_buffer_once): add TODO; remember stuff for pdumper.
(init_buffer): don't take initialized argument; adjust
for pdumper.
* src/atimer.c (init_atimer): initialize subr only if
!initialized.
* src/alloc.c: (vector_marked_p, set_vector_marked)
(vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
(set_cons_marked, string_marked_p, set_string_marked)
(symbol_marked_p, set_symbol_marked, interval_marked_p)
(set_interval_marked): new accessor routines. Use them
instead of raw GC access throughout.
(Vdead): make non-static when ENABLE_CHECKING.
(vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
header as input instead of a vector.
(number_finalizers_run): new internal C variable.
(mark_maybe_object): check for pdumper objects.
(valid_pointer_p): don't be gratuitously inefficient under rr(1).
(make_pure_c_string): add support for size_byte = -2 mode
indicating that string data points into Emacs image rodata.
(visit_vectorlike_root): visits GC roots embedded in
vectorlike objects.
(visit_buffer_root): visits GC roots embedded in
our totally-not-a-buffer buffer global objects.
(visit_static_gc_roots): visit GC roots in the Emacs data section.
(mark_object_root_visitor): root callback used for conventional GC
marking
(weak_hash_tables): new internal variable for tracking found weak
hash tables during GC.
(mark_and_sweep_weak_table_contents): new weak hash table marking.
(garbage_collect_1): use new GC root visitor machinery.
(mark_vectorlike): accept a vectorlike_header instead of a
Lisp_Vector.
(mark_frame, mark_window, mark_hash_table): new functions.
(mark_object): initialize 'm'; check for pdumper objects and use
new mark-bit accessors throughout. Remove some object-specific
marking code and move to helper functions above.
(survives_gc_p): check for pdumper objects.
(gc-sweep): clear pdumper mark bits.
(init_alloc_once_for_pdumper): new helper function for early init
called both during normal init and pdumper load.
(init_alloc_once): pdumper integration.
* src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
invoke temacs with --temacs command line option; build dmpstruct.h
from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
intermediate files during build.
* nextstep/Makefile.in: build emacs.pdmp into NS packages
* lisp/startup.el: account for new '--temacs' and '--dump-file'
command line option.
* lisp/loadup.el: rewrite early init to account for pdumper; use
injected 'dump-mode' variable (set via the new '--temacs' option)
instead of parsing command line.
* lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
since the new 'dump-mode'
* lib-src/make-fingerprint.c: new program
* lib-src/Makefile.in: built make-fingerprint utility program
* configure.ac: Add --with-pdumper toggle to control pdumper
support; add --with-unexec toggle to control unexec support.
Add --with-dumping option to control which dumping strategy we use
by default. Adjust for pdumper throughout. Check for
posix_madvise.
* Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
* .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
dmpstruct.h, and pdumper dump files.
* lib-src/emacsclient.c (process_grouping): New function.
(act_on_signals, main): Use it.
(main): Omit "Waiting for Emacs..." and later "\n" messages
if in background, since that messes up the screen.
Problem reported by Kaushal Modi in:
https://lists.gnu.org/r/emacs-devel/2018-12/msg00083.html
The tcdrain call replaced an fdatasync call which had no
effect on the tty, so removing it entirely shouldn’t cause
problems. The fdatasync call replaced an fsync call which
also had no effect on the tty, and the fsync call seems to be
badly-merged revenant of emacsclient’s old (circa 2004) way of
communicating to and from Emacs via FILE * streams, where
fsync was apparently needed when talking to sockets.
* lib-src/emacsclient.c [!DOS_NT]: Don’t include termios.h.
(flush_stdout): Remove. All callers removed.
(main): Do not drain the tty after "Waiting for Emacs..."
message. There should be no need to drain, and draining it
might send us a SIGTTOU. Do not fflush stdout just before
exiting, as exiting does that for us.
This ports to POSIXish platforms like macOS that lack SOCK_CLOEXEC.
Fix suggested by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-12/msg00055.html
* lib-src/emacsclient.c (set_local_socket):
Don’t use SOCK_CLOEXEC; that’s cloexec_socket’s job.
Recent changes in sysdep.c and emacsclient unnecessarily
removed useful code from DOS_NT builds. This changeset
reinstates that code.
* nt/inc/ms-w32.h (tcdrain): Redirect to _commit.
(fdatasync): No need to redirect anymore.
* lib-src/emacsclient.c (flush_stdout): Don't avoid calling
tcdrain on DOS_NT platforms.
* src/sysdep.c (reset_sys_modes): Don't ifdef away the call to
tcdrain on DOS_NT platforms.
fdatasync is for storage devices, not ttys.
* admin/merge-gnulib (GNULIB_MODULES): Remove fdatasync.
* lib/fdatasync.c, m4/fdatasync.m4: Remove.
* lib-src/Makefile.in (LIB_FDATASYNC):
* src/Makefile.in (LIB_FDATASYNC):
Remove. All uses removed.
* lib-src/emacsclient.c [!DOS_NT]:
Include <termios.h>, for tcdrain.
* lib-src/emacsclient.c (flush_stdout):
* src/sysdep.c (reset_sys_modes): On ttys, use tcdrain instead
of fdatasync (except don’t use either function if DOS_NT).
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c (socket_status): New arg UID.
All uses changed.
(set_local_socket): Don’t create the unbound socket unless the
initial sanity checks on the socket file succeed; this
simplifies cleaning it up. Check socket ownership again
after connecting, to fix a race (Bug#33366).
* lib-src/emacsclient.c: Disable -Wformat-truncation=2,
to avoid false alarms about the new snprintf calls.
(local_sockname): New function.
(set_local_socket): Use it. Prefer XDG_RUNTIME_DIR (if set)
for location of socket directory. Avoid unnecessary memory
allocation by using snprintf to destination.
* lisp/server.el (server-socket-dir): Prefer XDG_RUNTIME_DIR if set.
* configure.ac (HAVE_INET_SOCKETS): Remove.
* lib-src/emacsclient.c: Simplify by assuming HAVE_SOCKETS and
HAVE_INET_SOCKETS, which are always true nowadays, except perhaps
for MS-DOS and if so this program shouldn’t be built there anyway.
Don’t bother including sys/types.h, as it’s not needed on modern
systems (and syswait.h does it for us anyway).
(main): Simplify by assuming SIGSTOP (which is always defined
if SIGCONT is), and by assuming HAVE_SOCKETS && HAVE_INET_SOCKETS.
* lib-src/emacsclient.c (SOCKETS_IN_FILE_SYSTEM): Rename from
NO_SOCKETS_IN_FILE_SYSTEM, with inverted sense. All uses changed.
All uses were of the form ‘#ifndef NO_SOCKETS_IN_FILE_SYSTEM’, and
it’s easier to read ‘#ifdef SOCKETS_IN_FILE_SYSTEM’.
Fix some longstanding race conditions due to emacsclient’s use of
‘signal’ instead of ‘sigaction’ and its use of nested signal
handlers. These races could cause premature exit or incorrect
commands sent to Emacs.
* lib-src/emacsclient.c (signal) [!WINDOWSNT]: Do not undef.
(emacs_socket): Remove this static variable. It is now a parameter.
(send_to_emacs): Do not exit merely because ‘send’ was interrupted.
Instead, act on the signal if possible, and then retry the ‘send’.
(pass_signal_to_emacs): Remove; now done by act_on_signals.
(reinstall_handler_if_needed, handle_sigttou, handle_sigwinch)
(install_handler): New functions.
(got_sigcont, got_sigtstp, got_sigttou, got_sigwinch):
New globals, used for more-portable signal handling.
(handle_sigcont, handle_sigtstp): Just set the static var; other
actions are now done later by act_on_signals.
(install_handler): New function that arranges for signals to
never be reset to default, on modern POSIX platforms.
This fixes some races.
(act_on_signals): New function. When acting on SIGCONT,
don’t bother calling getpgrp if tcgetpgrp fails.
(start_daemon_and_retry_set_socket): Return the socket
rather than setting a global variable. All uses changed.
(flush_stdout): New function that acts on signals received while
flushing.
(main): Use it. emacs_socket is now a local var.
Act on signals received during recv.
* lib-src/emacsclient.c (start_daemon_and_retry_set_socket):
If the execvp of Emacs fails exit instead of having the child
run on and do the work of the parent. Coalesce duplicate code.
* lib-src/emacsclient.c (set_tcp_socket, set_local_socket):
Close socket (instead of leaking it) when ‘connect’ fails.
(socket_status): Return errno if stat fails and -1 if we don’t own.
(set_local_socket): Simplify based on socket_status change.
* lib-src/emacsclient.c (get_server_config, set_tcp_socket)
(set_local_socket): Initialize any platform-specific extensions
of struct to zero, just in case.
(set_tcp_socket, set_local_socket): Don’t assume struct
layout details that POSIX does not specify.
Use union to sidestep some problems with strict aliasing.
Remove unnecessary casts.
* lib-src/emacsclient.c: Include <intprops.h>.
(EXTRA_SPACE): Remove; code no longer guesses this is enough.
(open_config): New function.
(get_server_config): Use it.
(set_local_socket): Compute upper bound of buffer size
instead of guessing via EXTRA_SPACE.
* lib-src/emacsclient.c (quote_argument):
Mention *DATA in comment so it’s clear DATA must be non-null.
(quote_argument, unquote_argument): Simplify.
(unquote_argument): Don’t crash if the string ends in "&".
* lib-src/emacsclient.c: Include <dosname.h>.
(file_name_absolute_p): Remove, as a code duplicate.
All uses replaced by IS_ABSOLUTE_FILE_NAME.
(set_local_socket): Don’t treat \ as a file name separator
on GNU and POSIX hosts.
* lib-src/emacsclient.c (nowait, quiet, suppress_output, eval, tty)
(decode_options, file_name_absolute_p, get_server_config)
(strprefix, find_tty, set_socket, main):
Use bool for boolean.
(create_frame): New static var, replacing the old current_frame
and with inverted sense, as this is clearer.
If the '--socket-name' argument is unspecified, the environment
variable 'EMACS_SOCKET_NAME' is now consulted with the same
semantics. This mirrors the behavior of the '--server-file' argument,
and allows for easier configuration of emacsclient when the socket is
in a location other than 'TMPDIR' or '/tmp'.
* emacsclient.c (set_socket): Add support for the
EMACS_SOCKET_NAME environment variable. (Bug#33095)
* misc.texi (emacsclient Options):
* emacsclient.1: Document the EMACS_SOCKET_NAME environment
variable.
* etc/NEWS: Announce the new feature.
Copyright-paperwork-exempt: yes
This change was motivated by the desire to remove the weird
dependency of lib-src/profile.o on src/systime.h. profile.c
included systime.h only for current_timespec, and this
inclusion required systime.h to have #ifdef emacs in multiple
places and complicated further changes I have in mind.
The current_timespec decl belongs in timespec.h anyway,
and the main effect of this change is to move it there.
* lib-src/profile.c (INLINE): Remove.
Include timespec.h, not systime.h.
* lib/gettime.c (gettime): Prefer clock_gettime to nanotime,
and don’t worry about it failing on a CLOCK_REALTIME arg.
POSIX requires it to succeed and I don’t know of any
counterexamples where the fallbacks would work.
(current_timespec): Move here from src/systime.h.
Nowadays it seems to be better to not have this function
be inline.
* lib/timespec.h: Include arg-nonnull.h.
(current_timespec): New declaration.
(gettime, settime): Declare args to be nonnull.
* lib/gettime.c, lib/timespec.h: Copy from Gnulib.
* src/systime.h: Simplify by assuming ‘emacs’ is defined,
which it always is now.
(current_timespec): Move to lib/timespec.h.
Adjust to lib/timespec.h’s renaming of TIMESPEC_RESOLUTION and
LOG10_TIMESPEC_RESOLUTION to TIMESPEC_HZ and
LOG10_TIMESPEC_HZ. The old names were misnomers.
All uses changed.
* configure.ac (GMP_OBJ): When building mini-gmp, compile
mini-gmp-emacs.c, not mini-gmp.c.
* lib-src/etags.c (NDEBUG): Don't attempt to redefine, in
case the builder compiles with -DNDEBUG.
* src/conf_post.h (NDEBUG) [!ENABLE_CHECKING && !NDEBUG]: Define.
This avoids bloat in mini-gmp-emacs.o.
* src/mini-gmp-emacs.c: New file, which pacifies --enable-gcc-warnings.
5afbf62 Fix emacsclient check for term.el buffer (Bug#21041)
5132a58 Improve documentation of 'set-fontset-font'
cd90325 Improve documentation of M-?
155a885 Reinterpret Esperanto characters in iso-transl as iso-8859-3.
a0ef733 Fix Flyspell mode when several languages are mixed in a buffer
* lib-src/emacsclient.c (find_tty): Check for any TERM value with
prefix of "eterm", not just "eterm" itself. Also check for ",term:"
in INSIDE_EMACS value.
Emacs regular expressions forked from everyone else long ago.
This makes it official and should allow simplification later.
etags.c now uses the glibc regex API, falling back on a
Gnulib-supplied substitute lib/regex.c if necessary.
Emacs proper now uses its own regular expression module.
Although this patch may look dauntingly large, most of it
was generated automatically by admin/merge-gnulib
and contains an exact copy of the glibc regex source,
and the by-hand changes do not grow the Emacs source code.
* admin/merge-gnulib (GNULIB_MODULES): Add regex.
(AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
nl_langinfo, wchar, wcrtomb, wctype-h.
* lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
(etags_deps, etags_libs): Remove regex-emacs.o.
* lib-src/etags.c: Go back to including regex.h.
(add_regex): Use unsigned char translation array,
since glibc regex requires that.
* lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
(libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
* m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
New files, copied from Gnulib.
* src/regex-emacs.h, src/conf_post.h:
(RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
Move from src/conf_post.h to src/regex-emacs.h,
so that they don’t interfere with compiling lib/regex.c.
This is in preparation for using Gnulib regex for etags,
to avoid collisions in include directives.
* src/regex-emacs.c: Rename from src/regex.c.
* src/regex-emacs.h: Rename from src/regex.h. All uses changed.
* test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2...
024d20f Fix compilation with mingw.org's MinGW 5.x headers
38b6748 Update the list of special forms in the ELisp manual
8579105 Don't fail to indent-sexp before a full sexp (Bug#31984)
d24c5f2 Fix calls to modifications hooks in replace-buffer-contents
71a9151 * src/character.c (char_width): Support glyphs with faces. (...
0feb673 Display raw bytes as belonging to 'eight-bit' charset
2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change.
00561b5 Fix inaccurate text in the user manual
5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline
6f8f358 Minor Tramp doc update
2585fcb File Shadowing is not available on MS Windows
39da592 ; Minor markup change in indent.texi
2f00ffe ; bookmark-jump: Add comment about last change.
Backport from master.
* lib-src/emacsclient.c (fail):
Do not dereference a null pointer.
* src/frame.c (delete_frame):
Add a decl with UNINIT to work around GCC bug 85563.
* src/menu.h (finish_menu_items):
Do not use attribute const.
* src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
* configure.ac: Do not use GCC 8’s new -Wcast-align flag.
* lib-src/ebrowse.c (xmalloc):
* lib-src/emacsclient.c (xmalloc, xstrdup):
* lib-src/etags.c (xmalloc):
* lib-src/make-docfile.c (xmalloc):
* lib-src/movemail.c (xmalloc):
* src/dispnew.c (new_glyph_pool):
* src/regex.c (xmalloc):
* src/term.c (tty_menu_create):
* src/tparam.h (tparam):
Use ATTRIBUTE_MALLOC. Also see GCC bug 85562.
* lib-src/emacsclient.c (fail):
Do not dereference a null pointer.
* src/frame.c (delete_frame):
Add a decl with UNINIT to work around GCC bug 85563.
* src/menu.h (finish_menu_items):
Do not use attribute const.
* src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
* lib-src/make-docfile.c: Include c-ctype.h.
(read_c_string_or_comment, write_c_args, scan_c_stream, skip_white)
(read_lisp_symbol, scan_lisp_file):
Prefer c_isspace etc. to listing characters by hand.
(read_c_string_or_comment): Simplify.
(scan_c_stream, read_lisp_symbol): Use true for boolean 1.
(scan_c_stream): Fix typo (c >= 'Z' && c <= 'Z').
Minor rewrites to avoid duplicate code.
(scan_c_stream, read_lisp_symbol, scan_lisp_file):
Avoid infloop if at EOF.
(skip_white, read_lisp_symbol): Don’t stuff getc result into
‘char’, as this mishandles EOF.
* lib-src/etags.c (Erlang_interpreters, Lua_interpreters)
(Prolog_interpreters, Python_interpreters, Ruby_interpreters): New
static variables.
(lang_names): Use them to set interpreters for Erlang, Lua,
Prolog, Python, and Ruby.
(find_entries): Support "/usr/bin/env FOO" form of specifying an
interpreter.
* test/manual/etags/perl-src/htlmify-cystic: Modify the has-bang
line to test the "env FOO" interpreter spec. (Bug#30075)
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6: Adapt to latest changes in test
files.
Use alignas and unions to specify alignments of objects needing
addresses that are at least a multiple of GCALIGNMENT. Using
these standard C facilities should be safer than relying on ad hoc
and poorly-understood features like GCC’s __attribute__
((aligned (N))), the root cause for recent porting bugs like
Bug#29040. The alignas macro was standardized by C11 and Gnulib
supports alignas for pre-C11 platforms. I have tested this on Sun
Studio 12 sparc (2007) and GCC 4.4.7 x86-64 (2012) as well as on
more recent platforms like GCC 7.2.1 (2017) on Fedora 26 (both
x86-64 and x86).
* lib-src/make-docfile.c (close_emacs_globals): lispsym is now
just an array of struct Lisp_Symbol, since struct Lisp_Symbol is
now properly aligned. All uses changed.
* src/alloc.c (NEXT_FREE_LISP_STRING): Just use the new u.next
member; this is simpler and safer than casting a pointer that
might not be aligned properly.
(aligned_Lisp_Symbol): Remove. No longer needed, now that struct
Lisp_Symbol is aligned properly. All uses replaced with struct
Lisp_Symbol.
* src/lisp.h (GCALIGNED): Remove, as it does not work as expected:
it can cause the natural alignment to be ignored. All uses
replaced by unions with a ‘char alignas (GCALIGNMENT)’ member as
described below.
(struct Lisp_Symbol, struct Lisp_Cons, struct Lisp_String):
Change definition from ‘struct TAG { MEMBERS };’ to
‘struct TAG { union { struct { MEMBERS } s; char alignas
(GCALIGNMENT) gcaligned; } u; };’. This guarantees ‘struct TAG’
to have an alignment that at least max (GCALIGNMENT, N) where N is
its old alignment. All uses like ‘PTR->MEMBER’ changed to
‘PTR->u.s.MEMBER’; these uses were supposed to be mostly private
anyway. Verify that the resulting ‘struct TAG’ is properly
aligned for Emacs.
(union vectorlike_header): New member ‘gcaligned’ to guarantee
that this type, and its containing types like ‘struct Lisp_Subr’,
‘struct buffer’ and ‘struct thread_state’, are all properly
aligned for Emacs.
(struct Lisp_String): New union member ‘next’, for the benefit
of NEXT_FREE_LISP_STRING.
(union Aligned_Cons, union Aligned_String): Remove. All uses
replaced by struct Lisp_Cons and struct Lisp_String, since they
are now properly aligned.
(USE_STACK_CONS, USE_STACK_STRING): Simplify now that we can
assume struct Lisp_Cons and struct Lisp_String are properly
aligned.
Apparently GCC requires that ‘__attribute__ ((aligned (8)))’ must
immediately follow the ‘struct’ keyword when aligning a structure.
The attribute silently does not work if it follows a tag after the
‘struct’ keyword. Who knew? Anyway, this patch is designed to
fix a SIGSEGV problem reported by John Mastro (Bug#29183).
* lib-src/make-docfile.c (close_emacs_globals):
* src/buffer.c (buffer_defaults, buffer_local_symbols):
* src/lisp.h (DEFUN):
* src/thread.c (main_thread):
Put 'GCALIGNED' immediately after 'struct'.
Do not assume that the natural alignment of Lisp objects is a
multiple of GCALIGNMENT. This improves on the portability of the
recent fix for Bug#29040.
* lib-src/make-docfile.c (close_emacs_globals):
* src/buffer.c (buffer_defaults, buffer_local_symbols):
* src/lisp.h (DEFUN):
* src/thread.c (main_thread):
Use GCALIGNED, not alignas (GCALIGNMENT).
* src/alloc.c (COMMON_MULTIPLE):
Move back here from lisp.h, since it is no longer used elsewhere.
* src/lisp.h (GCALIGNMENT): No longer a macro, since we need not
worry about MSVC. Omit no-longer-needed consistency check.
* src/thread.c (THREAD_ALIGNMENT): Remove.
This fixes some URLs I omitted from my previous pass,
notably those in lists.gnu.org. Although lists.gnu.org
does not yet support TLS 1.1, TLS 1.0 is better than nothing.
* lisp/erc/erc.el (erc-official-location):
* lisp/mail/emacsbug.el (report-emacs-bug):
Use https:, not http:.
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.
This partially reverts my 2016-05-30 patch. Apparently MinGW64
still requires pacifications that GCC 7.1.1 x86-64 (Fedora 26)
does not. Also, pacify tparam.c, which isn’t used on Fedora.
* lib-src/etags.c (process_file_name, TeX_commands):
* src/buffer.c (fix_overlays_before):
* src/data.c (Fmake_variable_buffer_local, cons_to_unsigned)
(cons_to_signed):
* src/editfns.c (Ftranslate_region_internal):
Prefer UNINIT to some stray value, as this simplifies
code-reading later.
* src/eval.c (CACHEABLE): New macro.
(internal_lisp_condition_case): Use it.
* src/tparam.c (tparam1): Use FALLTHROUGH to pacify GCC.
* lib-src/emacsclient.c (fail): Parse ALTERNATE_EDITOR, or
corresponding command-line argument, into quote- or space-separated
tokens. If a token starts with a quote, then it naturally is expected
to end with a quote; escaping is not supported. This is enough to cope
with the typical case of requiring the initial path to be quoted,
common on Windows where it may contain spaces.
* etc/NEWS: Document.
* doc/emacs/misc.texi: Likewise.
* doc/man/emacsclient.1: Tweak to remove the implication that only an
editor can be specified (the manual already mentions a “command”).
Fix a small error where “EDITOR” is referred to rather than
“ALTERNATE_EDITOR”.
* test/lib-src/emacsclient-tests.el: Add tests.
This is needed for gcc -Os -flto on x86-64; otherwise, GC misses part
of the stack when scanning for heap roots, causing Emacs to crash
later (Bug#28213). The problem is that Emacs's hack for getting an
address near the stack top does not work when link-time optimization
moves stack variables around.
* configure.ac (HAVE___BUILTIN_FRAME_ADDRESS): New macro.
* lib-src/make-docfile.c (DEFUN_noinline): New constant.
(write_globals, scan_c_stream): Support noinline.
* src/alloc.c (NEAR_STACK_TOP): New macro.
(SET_STACK_TOP_ADDRESS): Use it.
(flush_stack_call_func, Fgarbage_collect): Now noinline.
This incorporates:
2017-08-15 renameat: ensure declaration in <stdio.h> on NetBSD
2017-08-15 extensions: enable NetBSD specific extensions
2017-08-14 open: support O_CLOEXEC
2017-08-13 reallocarray: new module
* admin/merge-gnulib (AVOIDED_MODULES): Remove ‘open’, since
it now supports O_CLOEXEC and this simplifies Emacs.
* build-aux/config.guess, lib/fcntl.in.h, lib/stdio.in.h:
* lib/stdlib.in.h, m4/extensions.m4, m4/stdlib_h.m4:
Copy from Gnulib.
* lib/cloexec.c, lib/cloexec.h, lib/open.c:
* m4/mode_t.m4, m4/open-cloexec.m4, m4/open.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/etags.c (O_CLOEXEC) [WINDOWSNT]:
Remove, as Gnulib does this for us.
* src/filelock.c (create_lock_file):
* src/sysdep.c (emacs_open, emacs_pipe):
Don’t worry about O_CLOEXEC == 0, as Gnulib no longer sets it to 0.
* lib-src/ntlib.h (mkdir, open): Remove redefinitions. They are
now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (sys_mkdir, sys_open): New functions.
(mkostemp): Remove.
* src/w32.c (mkostemp): Remove.
(sys_mkdir): Accept a second (unused) argument.
* src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT
specific call to mkdir. (Bug#28023)
* nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine
to accept 2 arguments.
(open): Remove from "#ifdef emacs".
* nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove.
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp)
(OMIT_GNULIB_MODULE_tempname): Remove.
* lib-src/make-docfile.c (put_filename): Undo recent change.
The Clang false alarm occurs only with CFLAGS=-save-temps and
we needn’t worry about pacifying unusual compiler configurations.
* lib-src/emacsclient.c (main): emacsclient retrieves the current
working directory using get_current_dir_name which returns a newly
allocated string. Make sure this string is freed before exiting.
Copyright-paperwork-exempt: yes
* lib-src/emacsclient.c (main, decode_options)
(print_help_and_exit, longopts): New option '--tramp' / '-T' which
specifies how emacs should use tramp to find remote files.
* doc/emacs/misc.texi (TCP Emacs server): New subsection describing
the various knobs to tune server.el for TCP opereation.
(emacsclient Options): Reference "TCP Emacs server" from description of
--server-file. Document the new '--tramp' / '-T' options.
* doc/emacs/emacs.texi (Top): Update the top-level menu.
* etc/NEWS: Mention the new option.
This incorporates:
2017-05-16 manywarnings: update for GCC 7
2017-05-15 sys_select: Avoid "was expanded before it was required"
* configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and
-Wformat-overflow=2 options, due to too many false alarms.
* doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4:
Copy from gnulib.
* m4/gnulib-comp.m4: Regenerate.
* src/coding.c (decode_coding_iso_2022):
Fix bug uncovered by -Wimplicit-fallthrough.
* src/conf_post.h (FALLTHROUGH): New macro.
Use it to mark all switch cases that fall through.
* src/editfns.c (styled_format): Use !, not ~, on bool.
* src/gtkutil.c (xg_check_special_colors):
When using sprintf, don’t trust Gtk to output colors in [0, 1] range.
(xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool;
this bug was actually caught by Clang.
* src/search.c (boyer_moore):
Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Tell GCC that glyph->u.glyphless.ch must be a character.
* lib-src/ntlib.c (gettimeofday):
* nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused
function 'gettimeofday' and all of its supporting code.
* lib-src/make-docfile.c (scan_c_stream): Check for buffer
overflow when reading an identifier. Use a static buffer for NAME
rather than a small dynamically-allocated buffer.
Problem reported by Joseph Mingrone in:
http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00622.html
* lib-src/Makefile.in (exp_archlibdir): Don’t fail if chown or
chgrp fails with update-game-score and the game directory.
Instead, expect the installer to fix this up afterwards.
The new configure option --with-mailutils lets the builder say
that Emacs should assume that GNU Mailutils is installed, instead
of continuing to build and install its own limited and insecure
substitute for 'movemail'.
* INSTALL, etc/NEWS, etc/PROBLEMS: Mention --with-mailutils.
* configure.ac: Add --with-mailutils option.
(with_mailutils): New variable.
Do not bother configuring 'movemail' when not building it.
Warn about issues relating to --with-mailutils.
* doc/emacs/rmail.texi (Movemail): Mention --with-mailutils.
(Movemail, Remote Mailboxes): Document port numbers in
POP and IMAP URLs.
* lib-src/Makefile.in (with_mailutils): New macro.
(UTILITIES): Use it.
Most distributions do not install update-game-score properly
due to setuid/setgid complications, so install it only when
the installer specifies a user or group (Bug#25895).
* .gitattributes: Remove lib-src/update-game-score.exe.manifest.
* Makefile.in (gameuser, gamegroup, use_gamedir, PATH_GAME):
New vars.
(epaths-force): Use PATH_GAME.
(uninstall): Remove snake-scores and tetris-scores only if shared.
* configure.ac: Default --with-gameuser to 'no'.
(UPDATE_MANIFEST): Remove.
* etc/NEWS: Mention this.
* lib-src/Makefile.in (UPDATE_MANIFEST): Remove.
(use_gamedir): New macro.
(UTILITIES): Remove update-game-score unless use_gamedir.
(SCRIPTS): Remove $(UPDATE_MANIFEST).
($(DESTDIR)${archlibdir}): Install game directory program and data
only if use_gamedir.
* lib-src/update-game-score.exe.manifest: Remove, as
update-game-score is no longer installed on MS-Windows.
* lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score):
Use auxiliary program only if setuid or setgid.
* make-dist: Do not distribute update-game-score.exe.manifest.
* src/callproc.c (init_callproc):
Set Vshared_game_score_directory based on PATH_GAME, not DOS_NT.
(syms_of_callproc): Remove unnecessary initialization of
Vshared_game_score_directory.
* lib-src/etags.c (sym_type): New enumeration value st_C_enum_bf.
(hash): Regenerated values for asso_values[] array.
(in_word_set): Update values of TOTAL_KEYWORDS and
MAX_HASH_VALUE. Add "ENUM_BF" to the wordlist[] array.
(in_enum_bf): New file-global variable.
(consider_token): Skip ENUM_BF if not in a macro definition.
(C_entries): Reset the in_enum_bf flag when past its closing
parenthesis.
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/CTAGS.good: Adapt to changes in etags.
* lib-src/emacsclient.c (print_help_and_exit, longopts)
(decode_options, main): Implement new option --suppress-output / -u to
suppress printing of eval-results.
* doc/emacs/misc.texi (emacsclient Options): Document the new
"--suppress-output/-u" options.
* etc/NEWS: Mention the new options.
* lib-src/hexl.c: Include inttypes.h, for PRIxMAX etc.
Do not include ctype.h, as the code no longer uses isdigit.
(DEFAULT_GROUPING, un_flag, iso_flag, group_by): Now local to ‘main’.
(DEFAULT_BASE, endian): Remove; was not really used.
(usage): Remove; now done by ‘main’, as that’s simpler.
(progname): Now static.
(output_error, hexchar): New functions.
(main): Use them. Simplify. Remove "-oct", "-big-endian", and
"-little-endian" options, as they did not work and were not used.
Use SET_BINARY only on stdin, and fopen with "rb" otherwise.
Use SET_BINARY only once on stdout.
Do not assume file offsets fit in ‘long’.
If an I/O error occurs, report it and exit with nonzero status.
Generate correct tags names for things like "(foo)".
Previously "(foo" created.
Fix a bug where a tag for "-bar" was created when encountering things
like "create-bar".
Recognize more words from the Forth-2012 Standard.
* lib-src/etags.c (Forth_words): Check for whitespace after defining
words. Create tag with make_tag instead of get_tag to avoid notiname
which isn't appropriate for Forth.
* test/manual/etags/forth-src/test-forth.fth: Add some test cases.
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/CTAGS.good: Adapt to the changes in etags.c and
new test cases.
This does not let Emacs run, just build.
* lib-src/etags.c (main):
* lib-src/profile.c (main):
Use return, not exit.
* src/bytecode.c (BYTE_CODE_THREADED) [__CHKP__]:
Do not define, as -fcheck-pointer-bounds is incompatible with taking
addresses of labels.
* src/menu.c (Fx_popup_dialog): Use eassume, not eassert,
to pacify gcc -fcheck-pointer-bounds -Wnull-dereference.
4af5981 Add a comment in generated refcards about the source
ef880a5 ; * etc/refcards/calccard.tex: Remove obsolete comment.
4887e7c js-mode: Fix indent problem after a regexp
e992ac0 Fix sluggish display of symbols in UTF-8 language environment
1fc101b Don't confuse how Texinfo outputs @var with the input
91aa5d1 * doc/lispref/display.texi (Scroll Bars): * doc/lispref/frame...
f758fcd * doc/emacs/cmdargs.texi (Initial Options): Copyedit for --da...
5b0cddd More fixes in copyright notices in etc/refcards/
f994c20 Update copyright text in refcards
9ad2ae7 Fix Outline command names
26c3554 Send text received by bracketed paste to process
db0b58d Correct the statement about programming modes always running ...
78aece4 Improve documentation of 'occur'
eb364fd Do call debugger on failed cl-assert
3ef4ee8 Avoid infloop in python
8da810f Don't refer to obsolete FEATURE-unload-hook
4f478ca Improve documentation of dabbrevs
7272e5d * lisp/chistory.el (list-command-history): Doc fix. (Bug#24890)
89b7482 * lisp/simple.el (set-mark-command): Doc fix. (Bug#24890)
3b199f7 Improve documentation of some Help commands
93d3a0e Fix documentation of yes-or-no prompts
af04919 Fix documentation of partial completion style
ed80184 Fix documentation of the mode line on emacsclient frames
e6be855 Fix description of 'C-z' in User manual
16f7007 Improve and clarify documentation of Outline Mode
31d93aa Add Emacs version number to nt/README.W32
0b6b815 Fix python-mode hideshow regexp
dc152c5 Modernize usage of 'macOS' in doc and comments
84c5343 Prefer comments /* like this */ in C code
bb61e50 * doc/lispref/loading.texi (Autoload): Better link (Bug#24845).
3ef86fd Clarify documentation of face attribute functions
de51d59 ; * nt/README.W32: Minor copyedits.
db436e9 Don't call debug on failed cl-assert
# Conflicts:
# doc/emacs/cmdargs.texi
# etc/NEWS
# etc/PROBLEMS
# lisp/auth-source.el
# lisp/net/tramp-sh.el
* lib-src/emacsclient.c: Include <string.h>. This is needed on
platforms like FreeBSD 11 that use code involving strlen etc., and
because <config.h> no longer includes string.h.
Apple changed the spelling of its operating system again, to "macOS",
effective with macOS 10.12 Sierra (2016-09-20). Change Emacs
documentation and comments to match this. Stick with older OS
spellings ("OS X", "Mac OS X") when talking about older releases where
the older names are more correct.
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.
* lib-src/etags.c (C_entries): Tag DEFUN twice: once with its C
name, and then again with its Lisp name. This restores the
ability to find Lisp primitives by their C name, which was lost
when the etags back-end was switched to a more strict search
criteria.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to the changes in etags.c wrt
tagging DEFUN.
This fixes the following warning:
emacsclient.c: In function ‘set_local_socket’:
/usr/include/x86_64-linux-gnu/bits/string3.h:111:3: error:
‘tmpdir’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
return __builtin___stpcpy_chk (__dest, __src, __bos (__dest));
^
emacsclient.c:1197:17: note: ‘tmpdir’ was declared here
const char *tmpdir;
* lib-src/emacsclient.c (set_local_socket): Get rid of use_tmpdir
variable and instead use tmpdir being non-NULL as sign that it should
be used.
These changes are needed to conform to the C standard's rule for
allocating structs containing flexible array members. C11 says
that malloc (offsetof (struct s, m) + n) does not suffice to
allocate a struct with an n-byte tail; instead, malloc’s arg
should be rounded up to the nearest multiple of alignof (struct s).
Although this is arguably a defect in C11, gcc -O2 + valgrind
sometimes complains when this rule is violated, and when debugging
it’s better to keep valgrind happy.
For details please see the thread containing the message at:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00416.html
* lib-src/ebrowse.c, src/alloc.c, src/image.c, src/process.c:
Include flexmember.h.
* lib-src/ebrowse.c (add_sym, add_member, make_namespace)
(register_namespace_alias):
* src/alloc.c (SDATA_SIZE, allocate_string_data):
* src/image.c (xpm_cache_color, imagemagick_create_cache):
* src/process.c (Fmake_network_process):
Use FLEXSIZEOF instead of offsetof and addition.
* src/alloc.c (SDATA_SIZE, vector_alignment):
Use FLEXALIGNOF instead of sizeof (ptrdiff_t).
* src/lisp.h (ALIGNOF_STRUCT_LISP_VECTOR):
Remove, as alloc.c can now calculate this on its own.
* lib-src/etags.c (stack_entry): New struct.
(push_node, pop_node, put_entry): New functions.
(free_tree, add_node, invalidate_nodes, put_entries): Re-implement
in a non-recursive way, to avoid stack overflow. (Bug#5847)
* lib-src/pop.c: Include c-ctype.h.
(socket_connection): Pacify --enable-gcc-warnings by rewriting to
avoid 'if (v = E) ...'. Use c_tolower, instead of a combination
of the (undeclared) isupper and tolower. Fix pointer constness
problem.
* nt/inc/ms-w32.h: Include stdint.h.
(_execvp, execve): Provide prototypes.
* lib-src/emacsclient.c [WINDOWSNT]: Remove prototype for execvp,
it is now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (getppid): Avoid compiler warnings due to format
mismatch.
(sys_ctime): Remove, not used.
Inspired by a suggestion from RMS in: http://bugs.gnu.org/23640#58
* .dir-locals.el (c-mode): Adjust to macro changes.
* src/conf_post.h (NONVOLATILE, UNINIT): New macros (Bug#23640).
(IF_LINT): Remove. All uses replaced by the new macros.
Nowadays GCC is smarter, or the Emacs code has mutated, or both,
and now is as good a time as any to remove uses of IF_LINT that
now seem to be unnecessary.
* lib-src/emacsclient.c (set_local_socket):
* lib-src/movemail.c (main) [MAIL_USE_MAILLOCK && HAVE_TOUCHLOCK]:
* src/buffer.c (fix_start_end_in_overlays, fix_overlays_before):
* src/casefiddle.c (casify_region):
* src/charset.c (load_charset_map):
* src/coding.c (decode_coding_object, encode_coding_object):
* src/data.c (Fmake_variable_buffer_local, Fmake_local_variable)
(cons_to_unsigned, cons_to_signed):
* src/frame.c (make_frame, x_set_frame_parameters):
* src/keyboard.c (read_event_from_main_queue):
* src/regex.c (regex_compile):
* src/syntax.c (back_comment):
* src/window.c (Frecenter):
* src/xfaces.c (Fx_list_fonts):
Remove IF_LINT that no longer seems necessary.
* src/image.c (png_load_body, jpeg_load_body): Simplify use of IF_LINT.
* src/keyboard.c (read_char): Use IF_LINT (volatile) rather than
a pragma dance to pacify GCC -Wclobbered.
* src/xdisp.c (x_produce_glyphs): Rewrite to avoid need for IF_LINT.
* src/xterm.c (x_connection_closed): Now _Noreturn, which should
mean we do not need IF_LINT any more.
(x_io_error_quitter): Now _Noreturn. Put an 'assume (false)’
at the end, to forestall warnings from older compilers.
* configure.ac (WERROR_CFLAGS): Omit -Wunused-const-variable=2.
* lib-src/etags.c (LOOKING_AT, LOOKING_AT_NOCASE):
Omit test whether pointer plus a constant equals a null pointer.
* src/alloc.c (compact_small_strings):
Avoid pointer arithmetic on null pointers.
* src/alloc.c (mark_face_cache):
* src/fontset.c (free_realized_fontsets, Fset_fontset_font):
* src/fringe.c (draw_fringe_bitmap_1)
(Fset_fringe_bitmap_face):
* src/macfont.m (macfont_draw):
* src/msdos.c (IT_set_face, IT_clear_screen):
* src/nsfont.m (nsfont_draw):
* src/nsterm.h (FRAME_DEFAULT_FACE):
* src/nsterm.m (ns_draw_window_cursor)
(ns_draw_vertical_window_border, ns_draw_window_divider)
(ns_dumpglyphs_box_or_relief)
(ns_maybe_dumpglyphs_background, ns_dumpglyphs_image)
(ns_dumpglyphs_stretch):
* src/w32term.c (w32_draw_vertical_window_border)
(w32_draw_window_divider, x_set_mouse_face_gc):
* src/xdisp.c (estimate_mode_line_height, init_iterator)
(handle_face_prop, handle_single_display_spec, pop_it)
(CHAR_COMPOSED_P, get_next_display_element)
(next_element_from_display_vector, extend_face_to_end_of_line)
(fill_gstring_glyph_string,BUILD_COMPOSITE_GLYPH_STRING):
* src/xfaces.c (Finternal_merge_in_global_face, Fface_font)
(lookup_named_face):
* src/xterm.c (x_draw_vertical_window_border)
(x_draw_window_divider, x_set_mouse_face_gc):
Prefer FACE_OPT_FROM_ID to FACE_FROM_ID when the result might be null.
* src/xterm.c (try_window_id):
Redo loop to convince GCC 6.1 that it is null pointer safe.
(x_color_cells):
Use eassume as necessary to pacify GCC 6.1.
* src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID): Now returns non-null.
(FACE_OPT_FROM_ID, IMAGE_OPT_FROM_ID): New macro, with the old
behavior of the non-_OPT macro, to be used when the result
might be a null pointer.
* src/dispnew.c (buffer_posn_from_coords, marginal_area_string)
[HAVE_WINDOW_SYSTEM]:
* src/intervals.h (INTERVAL_WRITABLE_P):
* src/term.c (turn_off_face):
* src/xdisp.c (get_glyph_face_and_encoding, fill_image_glyph_string)
(produce_image_glyph, produce_xwidget_glyph):
* src/xfaces.c (lookup_named_face):
Remove unnecessary test for null pointer.
* src/keyboard.c (read_char): Suppress bogus -Wclobbered warning.
* src/process.c (would_block): New function.
(server_accept_connection, wait_reading_process_output, send_process):
Use it.
* src/xdisp.c (get_window_cursor_type, note_mouse_highlight):
Prefer IMAGE_OPT_FROM_ID to IMAGE_FROM_ID when the result
might be null.
POSIX marked egrep and fgrep as legacy apps in SUSv2 (1997) and
withdrew them in SUSv3 (2001), and these days grep -E and grep -F
are probably more portable.
* lib-src/etags.c (main):
* lisp/eshell/em-unix.el (eshell-grep, eshell/egrep)
(eshell/fgrep):
* lisp/cedet/semantic/symref.el (semantic-symref-find-text):
* lisp/eshell/esh-var.el (eshell-apply-indices):
* lisp/progmodes/ada-xref.el (ada-xref-search-with-egrep)
(ada-find-in-src-path):
* lisp/textmodes/ispell.el (ispell-grep-command):
(ispell-lookup-words):
Use or document grep -E and grep -F instead of egrep and fgrep.
* lisp/textmodes/ispell.el (ispell-grep-options):
Use -Ei on all platforms, not just MS-Windows.
* lib-src/etags.c (print_help): Un-undocument the --no-line-directive
option. (Bug#22306)
* doc/man/etags.1: Document the --no-line-directive option.
[This reapplies commit fee0526a18,
which was inadvertently lost by merge commit
7823745acbe9b87eea2db4ef434e379fc903ec35.]
facb5e2 Update Emacs manual section related to character folding
4efea8e ; * etc/DEBUG: Fix a typo. (Bug#22984)
f8df21b Update admin/notes/unicode
950be68 Add symref-filepattern entries for c?perl-mode
8b8a6ad Don't use XRANDR 1.3 extensions if the server doesn't support them.
985dacf ; NEWS update for the last change in etags
741a6f8 Sync with gnulib
7352c6c Rework C source files to avoid ^(
a589e9a By default, etags produces unqualified Perl tag names
72c7438 Indent methods with keyword names correctly
28532a9 Propertize character literals and special global variables
differently
a7d6f39 ; Fix last change in NEWS
83b2a20 Change how /etc/NEWS presents character folding
b417c5a Revert "Revert "Backport: * lisp/isearch.el: Turn char-folding
off by default""
711ca36 Properly handle lambda as read function (bug 22961)
1b9d616 Propertize operator symbol names with symbol syntax class
9b16bc2 Stop recognizing :#{} as symbol in ruby-mode
366ec77 Allow using the left shift operator without spaces on both sides
02bf7cc Properly handle unquoting in wdired (bug 22938)
16cf469 ; Spelling fix and tighten up comment
f50bc04 Allow splat operator before percent literal
991c801 Don't apply the return value of goto-char as syntax class
6e63b3e Guard against nested percent literals
066f3bc Recognize iuwu-mod after an escaped newline
6f7a57c Fix symbolic mode string conversion for s and t
50b9826 Update 'ucs-names' database
993b2fb Improve doc string of 'shell-command'
b71c717 Make the code in movemail_strftime more general
cc057e4 Speed up redisplay of binary files with long series of nulls
e51b27e Remove the highlighting support for quoting 'like this' inside
Lisp docstrings
b1abce1 Restore leading space in movemail pop output
98b8d44 Fix bidi-paragraph-direction in Rmail view buffer
dc9d837 Don't misindent computed property generator methods
7923112 Fix mbox files produced by movemail on MS-Windows
c45a1ca doc string file descriptor exhaustion fix
265141b Fix Bug#22814
Work around Bug#22884 by rewording comments and strings to avoid ‘(’
at the start of a line unless it starts a function. This change
is a short-term hack; in the longer run we plan to fix cc-mode’s
performance for C files that have ‘(’ at the start of a line in a
comment or string.
* lib-src/etags.c (Perl_functions): Produce unqualified names,
unless -Q was specified.
(print_help): Update the description of -Q.
* doc/man/etags.1: Update the documentation of -Q.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/CTAGS.good: Adapt the expected test results to the
changed Perl functionality.
* admin/CPP-DEFINES, configure.ac: Remove HAVE_GETADDRINFO, HAVE_H_ERRNO.
All uses removed.
* doc/lispref/processes.texi (Network, Network Processes), etc/NEWS:
Say that port numbers can be integer strings.
* lib-src/pop.c (h_errno) [!WINDOWSNT && !HAVE_H_ERRNO]: Remove decl.
(socket_connection): Assume HAVE_GETADDRINFO.
* lisp/mpc.el (mpc--proc-connect):
* lisp/net/network-stream.el (open-network-stream):
It’s now OK to use integer strings as port numbers.
* src/process.c (conv_numerical_to_lisp) [!HAVE_GETADDRINFO]: Remove.
(Fmake_network_process): Assume HAVE_GETADDRINFO.
* lib-src/movemail.c (movemail_strftime) [WINDOWSNT]: New function.
(strftime) [WINDOWSNT]: New macro.
(mbx_delimit_begin): Go back to previous version of this code,
now that there’s a special-purpose WINDOWSNT implementation
that should do the right thing. That way, the output continues
to use leading space rather than leading zero for day of month.
* lib-src/movemail.c (mbx_delimit_begin): Use portable strftime
format specifiers, as at least the MS-Windows version of strftime
doesn't support %e and %T.
See http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg01602.html
for more details.
* nt/mingw-cfg.site (ac_cv_func_getaddrinfo)
(ac_cv_func_gai_strerror): Set to "yes", as the configure script's
test program is not smart enough to auto-detect these.
* nt/inc/sys/socket.h (getaddrinfo, freeaddrinfo): Redirect to
sys_getaddrinfo and sys_freeaddrinfo. Provide prototypes for
sys_getaddrinfo and sys_freeaddrinfo.
* src/w32.c (init_winsock): Try loading getaddrinfo and
freeaddrinfo from ws2_32.dll.
(sys_getaddrinfo, sys_freeaddrinfo): New functions.
* lib-src/pop.c [WINDOWSNT]: Include winsock2.h, not winsock.h,
and also ws2tcpip.h.
(getaddrinfo, freeaddrinfo) [WINDOWSNT]: Redirect to
sys_getaddrinfo and sys_freeaddrinfo, respectively.
(load_ws2, sys_getaddrinfo, sys_freeaddrinfo) [WINDOWSNT]: New
functions.
b13cab6 Add a eww command to toggle paragraph direction
4e46128 * nextstep/WISHLIST: Merge into etc/TODO and remove.
9e078e5 Fix char signedness issue in bidi code
064adf6 * lib-src/pop.c (socket_connection): Fix format string.
14060a9 Avoid inflooping in thing-at-point-looking-at
098d47b * lisp/emacs-lisp/derived.el (define-derived-mode): Revert
indent change.
b5db8e0 etc/PROBLEMS: Mention problems with using file descriptors
ec10ef9 * lisp/apropos.el (apropos-variable): Doc fix. (Bug#22813).
d2dd614 Remove unneeded workaround in xftfont.c
9b7593c ; * etc/NEWS: Reflect latest changes in saveplace.
fde0cd1 * lisp/saveplace.el (save-place-local-mode): New minor mode
06a872b Fix redisplay on a TTY after 'make-frame'
95f5a43 Make double-click-1 work with unbalanced parens in CC Mode.
Fixes bug#5560.
7d206fc Input method polish-slash should not use keyboard translation
8be32cf Fix an assertion
040e0d6 Fix 'toggle-save-place'
5244db2 * src/keyboard.c: Don't inadvertently set immediate_echo (bug#22581)
dacde7e * etc/AUTHORS: Update the AUTHORS file
478ca5d ; fix changelog entries
2b7d006 ; make change-history-commit
851decb * lisp/dired-aux.el: Require cl-lib. (Bug#22613)
47896c8 ; Improve commentary in insdel.c
53ca1e1 Index tilde characters in names of backup files
d97f522 Document deprecation of hi-lock-mode's 'C-x w' bindings
b55f06d ; * etc/NEWS: Use double spaces to end a sentence.
28bb214 Announce that the `C-x w' bindings are deprecated
1c98f98 Suppress GNUstep hardening
d82f24b Fix redisplay after a large insertion
85a2753 Revert "Fix gnus-group-get-new-news-this-group on group with
closed server"
e8e3db0 ; Improve merge documentation in CONTRIBUTE
5be9989 * lib-src/make-docfile.c: Include stdarg.h.
c95ebbf Extend gpm-mouse-mode's doc string and doc to point out
limitations.
f5d6b9b Revert "Support integer image rotation and respect EXIF rotations"
afe7d1f Revert "Document EXIF image rotation"
c6f377c Document OS X LANG default
eb4a18c Set locale when run from OS X GUI
456c0a3 make-docfile cleanup for I/O, etc.
25ec995 Memory-management cleanup in make-docfile
02d925e Kevin Gallagher has new email address
4ef153b Improve doc strings of 'forward/backward-word-strictly'
3ad05a0 Describe Makefile test targets in test/README
* lib-src/make-docfile.c (progname, generate_globals, num_globals)
(num_globals_allocated, globals): Now static.
(generate_globals, struct rcsoc_state, read_c_string_or_comment):
(write_c_args, scan_c_stream, search_lisp_doc_at_eol, scan_lisp_file):
Use bool for boolean.
(verror): New function.
(fatal, error): Use it. API is now like printf. All callers changed.
(main): Remove err_count local that was always 0.
(main, scan_c_stream, scan_lisp_file): Check for I/O error.
(scan_file, scan_c_file, scan_c_stream, scan_lisp_file):
Return void, not 0.
(put_char, scan_keyword_or_put_char, scan_c_file): Use char for byte.
(scan_keyword_or_put_char): Check for missing ( and unexpected EOF.
(close_emacs_globals): Use ptrdiff_t for index, not int.
(scan_c_file, scan_lisp_file): Exit with failure if file cannot be
opened, rather than diagnosing but exiting with status 0.
(search_lisp_doc_at_eol): Don't worry about ungetc of EOF; it's
portable now.
I compiled it with -fsanitize=address and fixed the leaks it detected.
Also, I changed it to prefer signed to unsigned integer types,
and to check for integer overflow.
* lib-src/make-docfile.c:
Include <stddef.h>, <stdint.h>, <intprops.h>, <min-max.h>.
(memory_exhausted): New function.
(xmalloc, xrealloc): Use it.
(xmalloc, xrealloc, scan_file, struct rcsoc_state, write_c_args)
(uncompiled, scan_lisp_file):
Prefer signed integer types to unsigned.
(xstrdup): Remove. All uses removed.
(num_globals, num_globals_allocated, write_globals, scan_c_stream):
Use ptrdiff_t, not int, for indexes that in theory could exceed INT_MAX.
(add_global): Use const to pacify --enable-gcc-warnings.
Make a copy here, rather than relying on strdup calls later.
(add_global, write_globals, scan_c_stream):
Avoid integer overflow when calculating sizes.
(write_globals, scan_c_stream, scan_lisp_file): Avoid memory leak.
(scan_c_stream): Check for add_global failure.
9ffe7dd * lisp/isearch.el (isearch-define-mode-toggle): Improve logic
16140f7 * lisp/menu-bar.el (menu-bar-options-menu): New search submenu
3db6adb * lisp/isearch.el (search-default-mode)
4ea1ea7 * lisp/isearch.el: Rename search-default-regexp-mode to search-default-mode
c77ffc8 Use monitor's resolution for positioning tooltips
49e5749 Fix file-notify-test on MS-Windows
be1d874 Fix issues found by auditing w32notify code
87ae218 Extend etags Ruby support for accessors
aa35257 Update publicsuffix.txt.
6816bff Ensure that Gnus dribble handling allows removing entries
691feae Be consistent when using encoded strings in nnimap data
3ed423b Display the decoded Gnus group name
5428b5b Use completion-ignore-case instead of defining command
2c117fc * etc/NEWS: Document new mpc.el features
71a0496 * lisp/custom.el (defface): Revert indentation change. (Bug#22524)
9dfece1 Correctly fontify C++ initializations which "look like" functions.
4485222 Improve newsticker-treeview-selection-face
4236944 Minor fix in tagging Ruby accessors by etags
35fc77d Spelling fixes
3dda110 Remove 'def X' from the example
* lib-src/etags.c (Ruby_functions): Support accessors defined with
parentheses. (Bug#22563)
* test/etags/ruby-src/test1.ru (A::B): Add tests for accessors
defined with parentheses.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tests.
ee73997 Make erc work better when encountering unknown prefix chars
b99141d Make erc completion case-insensitive again
66c4620 Make complection in erc use consistent casing
8c562b2 Make /QUIT in erc more robust
d93d2c5 Make tracking faces in Emacs work more reliably
af6ab7e Make shr not bug out on images on non-graphical displays
3311f40 Fix bookmark display widths
d90ab1e Fix typo in eww-make-unique-file-name
7f81825 Make it possible to TAB to input fields
a43a1dc Insert complete alt texts when images are disabled
56ed4e1 Allow eww text fields to grow
66b315c Make erc work when subword-mode is switched on
255b68f Fix IMAP doc example
91557f5 Quoting fixes in doc strings and diagnostics
2c0dc9f Fix warning message in hack-local-variables
504696d Etags: yet another improvement in Ruby tags
8784ebf Fix x-popup-menu on TTYs without a mouse
8b87ecb * lisp/emacs-lisp/map.el: Improvements to the docstring of the
pcase macro
6191003 Use pop-to-buffer-same-window in eww
fe321fd * autogen.sh: Revert all recent changes.
74ebd4a * make-dist: Updates related to nt/.
737193a * make-dist: Add modules/.
3696bf2 * make-dist: Update for super-special file that can't live in etc/.
a4278e2 Fix failure to compile ns-win.el in parallel builds
860da4d Fix names of tags generated for Ruby accessors
f6213ce Fix file-name recognition in 'etags'
e42e662 Change Ruby file names and extensions recognized by 'etags'
58bfb6a More improvements for Ruby support in 'etags'
c04e911 Add --git-config option to autogen.sh
5713466 Fix editing undo changes in eww fields
51362d6 Allow the user more control of popping up the eww window
ee0fbd8 Make eww-browse-url with new-window parameter work again
9c3142d Clean up eww code slightly
cb035f3 Don't insert nil faces in shr
4c3fae3 ; * lisp/progmodes/prolog.el: Remove some obsolete commentary.
93f2153 Improve the custom type of some user options.
9f60d7e Mark some risky calendar variables.
1d07dcd Highlight two additional SCSS keywords
ee8b466 Recommend enabling integrity-checking in git
e639e10 Some corrections in Elisp manual
d766ca8 Chatter when autogen.sh changes Git configuration
3b734e1 * org/org-compat.el (org-font-lock-ensure): Fix bogus test (bug#22399)
43cb9f8 Omit unnecessary history from Lisp intro
2fbd1da * etc/HISTORY: Add some more history, plus git tags.
c90e1b4 Improve elisp “Security Considerations” doc
cedd7ca autogen.sh now arranges for git to check hashes
86ce76b ; Fix ChangeLog.2 commit ID.
7b1d2b1 Fix (c & 040) typo in emergency escapes
a8273da Fix display of overlay strings with 'display' and 'box' property
fc48106 Fix imap-starttls-open
cdecbed Fix return value of imap-starttls-open
20c7e34 ; * etc/NEWS: Fix renamed command name
98bdbdb Correct reference to DARWIN_OS preprocessor symbol
b250d29 Spelling fix
b920a0e Spelling fixes
93b144b Pacify GCC on C library without glibc API
* lib-src/etags.c (Ruby_functions): Don't include the leading
colon ':' in tags for Ruby accessors and aliases. (Bug#22241)
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tags.
* lib-src/etags.c (get_language_from_filename): If FILE includes a
leading directory, compare only its basename to the known file
names in lang_names[].
* test/etags/Makefile (RBSRC): Adapt to recent test1.ruby
renaming.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby file names and
to the results in Makefile due to the above etags.c fix.
* lib-src/etags.c <Ruby_filenames>: New variable, holds names
of Ruby files.
<Ruby_suffixes>: Treat .rb, .ru, and .rbw as Ruby extensions.
<lang_names>: Add Ruby_filenames to the Ruby entry.
* test/etags/ruby-src/test1.ru: Renamed from test1.ruby.
(Bug#22241)
* lib-src/etags.c (Ruby_functions): Tag Ruby accessors and
alias_method. Identify constants even if the assignment is not
followed by whitespace. (Bug#22241)
* test/etags/ruby-src/test1.ruby: Add tests for constants,
accessors, and alias_method.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to changes in Ruby tests.
* lib-src/etags.c (Ruby_functions): Tag constants. Don't tag
singleton classes. Remove class qualifiers from tags generated
for method and constant names. (Bug#22241)
* doc/emacs/maintaining.texi (Tag Syntax): Mention that constants
are tagged by etags in Ruby.
* etc/NEWS: Mention that constants are tagged by etags in Ruby.
* test/etags/ruby-src/test1.ruby: Add more tests.
* test/etags/ETAGS.good_1:
* test/etags/ETAGS.good_2:
* test/etags/ETAGS.good_3:
* test/etags/ETAGS.good_4:
* test/etags/ETAGS.good_5:
* test/etags/ETAGS.good_6:
* test/etags/CTAGS.good: Adapt to the changes in etags and in Ruby
tests.
In http://lists.gnu.org/archive/html/bug-autoconf/2015-12/msg00000.html
Pavel Raiskup reports that ${1+"$@"} runs afoul of a bug in /bin/sh
(derived from ksh 93t+ 2010-03-05). ${1+"$@"} works around an ancient
bug in long-dead shells, so remove the workaround.
* admin/check-doc-strings, configure.ac, lib-src/rcs2log:
Use plain "$@" rather than ${1+"$@"}.
* 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.
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.
* lib-src/ebrowse.c (READ_CHUNK_SIZE): Now an enum constant.
(streq, filename_eq, set_flag, has_flag): Now inline functions.
(set_flag): First arg is now an address, not an lvalue.
All callers changed.
(filename_eq, set_flag, has_flag):
Rename from FILENAME_EQ, SET_FLAG, HAS_FLAG.
All callers changed.
* lib-src/etags.c (streq, strcaseeq, strneq, strncaseeq):
Now inline functions. Remove asserts that are unnecessary these
days (and in some cases were too-generous anyway).
POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
Prefer straight quotes in random script files, as they are not converted.
Prefer grave quotes in a couple of places in the manual that were missed
earlier, as these quotes are converted.
Make --enable-gcc-warnings a bit pickier, by also using -Wswitch.
* configure.ac (WERROR_CFLAGS): Don’t add -Wno-switch.
* lib-src/etags.c (main, consider_token, C_entries):
* src/coding.c (encode_invocation_designation):
* src/data.c (Ftype_of):
* src/eval.c (Fdefvaralias, default_toplevel_binding)
(Fbacktrace__locals, mark_specpdl):
* src/lisp.h (record_xmalloc):
* src/syntax.c (scan_lists, scan_sexps_forward):
* src/window.c (window_relative_x_coord):
* src/xdisp.c (push_it, pop_it):
* src/xterm.c (xg_scroll_callback, x_check_fullscreen):
Error out or do nothing (as appropriate) if a switch statement
with an enum value does not cover all of the enum.
* src/dispextern.h (struct iterator_stack_entry.u.comp):
Remove unused member discovered by using -Wswitch.
* src/lisp.h (record_xmalloc): Add a ‘+ 0’ to pacify -Wswitch.
* src/vm-limit.c (check_memory_limits):
Simplify warning-diagnostic computation by using a table.
* lib-src/etags.c (fatal): Now printf-like. All callers changed.
Also, now static; not clear why it needed to be extern.
(verror): New function, with most of the old contents of ‘error’.
(fatal, error): Use it.
Mostly this just changes ` to ' in static text. Some exceptions:
* INSTALL.REPO: Use curved quotes, as the diagnostic in question
typically does that now.
* admin/quick-install-emacs (TRY, top level):
Use straight quoting in diagnostics.
* src/README: Fix working-directory confusion.