]> git.eshelyaron.com Git - emacs.git/log
emacs.git
6 years agoMinor type and signature fixes in jit.c feature/libjit
Eli Zaretskii [Sun, 9 Sep 2018 16:10:36 +0000 (19:10 +0300)]
Minor type and signature fixes in jit.c

* src/jit.c (get_type) [!USE_LSB_TAG]: Use jit_type_void_ptr
for 'shift'.
(compile_wrong_type_argument): Use the correct signature for
wrong_type_argument native calls.

6 years agoFix types of Lisp objects in values and function calls
Eli Zaretskii [Wed, 29 Aug 2018 16:58:20 +0000 (19:58 +0300)]
Fix types of Lisp objects in values and function calls

* src/jit.c (car_or_cdr, compile): Use lisp_object_type for
Lisp objects.
(init_jit): Define internal_catch_signature.
(compile): Use internal_catch_signature for 'internal_catch',
as ternary_signature doesn't fit.

6 years agoFix 32-bit Cygwin builds with libjit
Ken Brown [Mon, 27 Aug 2018 14:03:54 +0000 (10:03 -0400)]
Fix 32-bit Cygwin builds with libjit

* src/lisp.h (USE_STACK_LISP_OBJECTS): Define to false for
32-bit Cygwin builds with libjit.

6 years agoFix MS-Windows build with libjit
Eli Zaretskii [Thu, 23 Aug 2018 16:40:19 +0000 (19:40 +0300)]
Fix MS-Windows build with libjit

This fixes 32-bit MS-Windows build and hopefully also 64-bit
MS-Windows build (not tested).  32-bit MS-Windows build with wide ints
still doesn't work: I get invalid Lisp objects after JIT compiled code
is invoked.
* configure.ac (HAVE_LIBJIT) [mingw32]: Remove -ljit from
LIBJIT_LIBS, to avoid linking against libjit at build time and
allow loading libjit dynamically at run time.

* src/jit.c [WINDOWSNT]: Include w32.h and w32common.h.
[WINDOWSNT] (DEF_DLL_VAR, LOAD_DLL_VAR): New macros.
(init_libjit_functions) [WINDOWSNT]: New function.
(CONSTANT): A separate version for builds where EMACS_INT_MAX
is equal to INT_MAX (32-bit builds without wide ints).  Use
XLI when assigning Lisp objects to integer values.
(untag, compile_make_natnum, compile_make_number)
(unary_intmath): Handle the case of EMACS_INT_MAX > LONG_MAX.
(compile_current_thread, compile): Don't use CONSTANT for
anything that is not a Lisp object.
(emacs_jit_compile): Do nothing if jit-disable is non-nil.
Use XLP to assign and compare Lisp objects to pointers.
(syms_of_jit): New boolean variable jit-disable, by default nil.
(init_jit) [WINDOWSNT]: Call init_libjit_functions.
Define lisp_object_type separately for 64-bit Windows builds
and 32-bit builds with wide ints.  Fix some signatures to use
lisp_object_type and correct some that deviated from the
actual functions.
* src/lisp.h (USE_STACK_LISP_OBJECTS): Define to false for
32-bit MinGW builds with libjit.
* src/w32fns.c (syms_of_w32fns) <libjit>: New symbol.
* src/eval.c (Ffuncall, funcall_lambda): Use XLP to compare
Lisp_Object vs a pointer.
* src/emacs.c (main): Move the call to init_jit to before
init_buffer, as the latter calls Lisp and could use JIT.
* src/alloc.c (Fmake_byte_code): Use XPL to assign pointer to
a Lisp_Object field.

* lisp/term/w32-win.el (dynamic-library-alist): Add libjit-0.dll.

6 years agoImprove jit-disassemble-to-string
Eli Zaretskii [Sat, 18 Aug 2018 10:47:27 +0000 (13:47 +0300)]
Improve jit-disassemble-to-string

* src/jit.c (Fjit_disassemble_to_string) [!HAVE_OPEN_MEMSTREAM]:
Provide working code for systems that don't have 'open_memstream'.

6 years agoFix 32-bit compilation on MS-Windows
Eli Zaretskii [Sat, 18 Aug 2018 09:18:54 +0000 (12:18 +0300)]
Fix 32-bit compilation on MS-Windows

* src/jit.c (CONSTANT): Avoid compilation warning on 32-bit
systems about casting a pointer to an integer of a different
size.
(compile) [HAVE__SETJMP]: Use _setjmp instead of setjmp, when
the latter is a macro.  Fixes a compilation error on system
that use _setjmp.
(Fjit_disassemble_to_string): Rearrange declaration to avoid
compilation warnings on systems that don't have open_memstream.

6 years agoJIT compiler
Tom Tromey [Sun, 12 Aug 2018 21:29:43 +0000 (15:29 -0600)]
JIT compiler

* lisp/emacs-lisp/jit-support.el: New file.
* src/alloc.c (make_byte_code): Remove.
(Fmake_byte_code): Rewrite.
* src/data.c (Fsubr_arity, notify_variable_watchers): Update.
* src/emacs.c (main): Call syms_of_jit, init_jit.
* src/eval.c (eval_sub, Fapply, FUNCTIONP, Ffuncall, funcall_subr)
(funcall_lambda): Update.
* src/jit.c: New file.
* src/lisp.h (struct subr_function): New struct, extracted from
Lisp_Subr.
(SUBR_MAX_ARGS): New define.
(struct Lisp_Subr): Use struct subr_function.
(COMPILED_JIT_CODE): New constant.
(DEFUN): Update.
(make_byte_code): Don't declare.
(funcall_subr): Add error_obj argument.
(syms_of_jit, init_jit, emacs_jit_compile): Declare.
* src/lread.c (read1): Use Fmake_byte_code.
* test/src/jit-tests.el: New file.

6 years agoRemove obsolete comment
Tom Tromey [Sun, 12 Aug 2018 21:29:35 +0000 (15:29 -0600)]
Remove obsolete comment

* lisp/emacs-lisp/bytecomp.el (byte-compile-out-tag): Remove comment.

6 years agoAdd configury for JIT
Tom Tromey [Sun, 12 Aug 2018 21:29:03 +0000 (15:29 -0600)]
Add configury for JIT

* configure.ac: Add --with-libjit.  Check for open_memstream.
* src/Makefile.in (LIBJIT, LIBJIT_CFLAGS): New variables.
(EMACS_CFLAGS): Use LIBJIT_CFLAGS.
(base_obj): Add jit.o.
(LIBES): Use LIBJIT.

6 years agoCreate bytecode.h
Tom Tromey [Wed, 10 Jan 2018 23:27:39 +0000 (16:27 -0700)]
Create bytecode.h

* src/bytecode.h: New file.
* src/bytecode.c: Move bytecode definitions to bytecode.h.

6 years agoUpdate doc strings for fixnum constants
Paul Eggert [Mon, 13 Aug 2018 22:55:06 +0000 (15:55 -0700)]
Update doc strings for fixnum constants

* src/data.c (most-positive-fixnum, most-negative-fixnum):
Update doc strings in the light of fixnums.

6 years agoFix check for unsafe watch descriptor
Paul Eggert [Mon, 13 Aug 2018 22:45:17 +0000 (15:45 -0700)]
Fix check for unsafe watch descriptor

* src/lisp.h (make_pointer_integer_unsafe): New function.
(make_pointer_integer): Use it.
* src/gfilenotify.c (dir_monitor_callback): Omit redundant eassert.
(Fgfile_add_watch): Signal an error instead of failing an
assertion if the pointer does not work.

6 years agoAdd uuid as allowed thingatpt symbol (Bug#32372)
Raimon Grau [Sun, 5 Aug 2018 21:47:30 +0000 (22:47 +0100)]
Add uuid as allowed thingatpt symbol (Bug#32372)

* etc/NEWS: Mention changes in thingatpt.el.
* lisp/thingatpt.el (thing-at-point-uuid-regexp): Add regexp for uuid.
(top-level): Add 'bounds-of-thing-at-point' operation for 'uuid'.
* test/lisp/thingatpt-tests.el: Add tests for uuid at point.

6 years agoPacify gcc -Og -Wuninitialized
Paul Eggert [Mon, 13 Aug 2018 00:25:37 +0000 (17:25 -0700)]
Pacify gcc -Og -Wuninitialized

This addresses the -Og uninitialized variable warnings I ran
into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5).
It also changes some explicit initializations to UNINIT
when the variable does not actually need to be initialized.
* src/process.c (connect_network_socket):
* src/sysdep.c (system_process_attributes):
* src/xfns.c (x_real_pos_and_offsets):
* src/xterm.c (get_current_wm_state) [USE_XCB]:
Add UNINIT.
* src/editfns.c (tzlookup):
* src/fns.c (Fnconc):
* src/font.c (font_parse_fcname):
* src/frame.c (x_set_frame_parameters):
Prefer UNINIT to explicit initialization.

6 years ago* configure.ac (GMP_LIB): Set to -lgmp if --without-mini-gmp.
Paul Eggert [Mon, 13 Aug 2018 00:14:43 +0000 (17:14 -0700)]
* configure.ac (GMP_LIB): Set to -lgmp if --without-mini-gmp.

6 years agoPort better to x86 -fexcess-precision=fast
Paul Eggert [Sun, 12 Aug 2018 22:28:20 +0000 (15:28 -0700)]
Port better to x86 -fexcess-precision=fast

Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00380.html
* src/data.c (arithcompare): Work around incompatibility
between gcc -fexcess-precision=fast and the C standard on x86,
by capturing the results of floating-point comparisons before
the excess precision spontaneously decays.  Although this fix
might not work in general, it does work here and is probably
good enough for the platforms we care about.

6 years agoUpdate and improve todo-mode item insertion and editing code
Stephen Berman [Sun, 12 Aug 2018 21:25:53 +0000 (23:25 +0200)]
Update and improve todo-mode item insertion and editing code

* lisp/calendar/todo-mode.el (todo-insert-item--param-key-alist)
(todo-insert-item--keyof, todo-insert-item--this-key)
(todo-insert-item--keys-so-far, todo-insert-item--args)
(todo-insert-item--argleft. todo-insert-item--argsleft)
(todo-insert-item--newargsleft, todo-insert-item--apply-args)
(todo-edit-item--param-key-alist, todo-edit-item--prompt)
(todo-edit-item--date-param-key-alist)
(todo-edit-done-item--param-key-alist): Remove.
(todo-insert-item--next-param): Reimplement to take advantage of
lexical binding.
(todo-insert-item): Adjust to new implementation of the above.
(todo-edit-item--next-key): Incorporate now removed global
variables, adjust signature accordingly, update use of pcase.
(todo-edit-item): Adjust to changed signature of the above.

6 years agoAdjust .gdbinit to removal of misc objects
Paul Eggert [Sun, 12 Aug 2018 18:46:07 +0000 (11:46 -0700)]
Adjust .gdbinit to removal of misc objects

* src/.gdbinit (xtype, xpr): Adjust.
(xmisctype, xmiscfree): Remove.

6 years agoMake mini-gmp safe for --enable-gcc-warnings
Paul Eggert [Sun, 12 Aug 2018 18:10:11 +0000 (11:10 -0700)]
Make mini-gmp safe for --enable-gcc-warnings

* 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.

6 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sun, 12 Aug 2018 16:03:27 +0000 (19:03 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

6 years ago; Avoid compilation warnings under -Og
Eli Zaretskii [Sun, 12 Aug 2018 16:02:32 +0000 (19:02 +0300)]
; Avoid compilation warnings under -Og

* src/w32.c (w32_read_registry):
* src/font.c (font_parse_fcname):
* src/fns.c (Fnconc):
* src/editfns.c (tzlookup):
* src/frame.c (x_set_frame_parameters): Avoid compiler warnings
about maybe-uninitialized variables.

6 years agoFix typo caught by zsh
Paul Eggert [Sun, 12 Aug 2018 16:01:00 +0000 (09:01 -0700)]
Fix typo caught by zsh

* lisp/Makefile.in (compile-clean): Fix typo; missing ";" (Bug#32423).

6 years ago; Remove instrumentation for Bug#32226
Michael Albinus [Sun, 12 Aug 2018 15:38:24 +0000 (17:38 +0200)]
; Remove instrumentation for Bug#32226

6 years agojsonrpc-shutdown's cleanup also kills stderr buffer
João Távora [Sun, 12 Aug 2018 12:26:06 +0000 (13:26 +0100)]
jsonrpc-shutdown's cleanup also kills stderr buffer

* lisp/jsonrpc.el
(Version): Bump to 1.0.6
(jsonrpc-shutdown): Also kill stderr buffer

6 years agoRevert "Make jsonrpc-shutdown a noop if process isn't running"
João Távora [Sun, 12 Aug 2018 12:22:27 +0000 (13:22 +0100)]
Revert "Make jsonrpc-shutdown a noop if process isn't running"

This reverts commit c580443325a3d071625185876a8f28e04793c625.  It
leads to situations where the sentinel hasn't run yet, which brings
problems if the normal process isn't running, but the stderr
pseudo-process still is.

* lisp/jsonrpc.el (jsonrpc-shutdown): Always enter loop.

6 years agoEnsure no padding after union vectorlike_header
Andreas Schwab [Sun, 12 Aug 2018 10:05:46 +0000 (12:05 +0200)]
Ensure no padding after union vectorlike_header

Instead of increasing GCALIGNMENT align union vectorlike_header by
adding a Lisp_Object member.

* src/lisp.h (GCALIGNMENT): Revert last change.
(union vectorlike_header): Add align member.
(header_size): Verify the same as sizeof (union
vectorlike_header)

6 years agoAvoid padding after union vectorlike_header
Andreas Schwab [Sun, 12 Aug 2018 09:03:36 +0000 (11:03 +0200)]
Avoid padding after union vectorlike_header

The PSEUDOVECTORSIZE macro requires that the first member after union
vectorlike_header has the same offset in all pseudo vector structures.

* src/lisp.h (GCALIGNMENT) [!USE_LSB_TAG]: Use alignment of
Lisp_Object.

6 years agoNew 'configure' arg --with-mini-gmp
Paul Eggert [Sun, 12 Aug 2018 08:06:15 +0000 (01:06 -0700)]
New 'configure' arg --with-mini-gmp

* configure.ac: It lets the builder override default of whther
mini-gmp is used.  Use AC_SEARCH_LIBS as per Autoconf manual.

6 years agoUpdate from Gnulib
Paul Eggert [Sun, 12 Aug 2018 02:07:43 +0000 (19:07 -0700)]
Update from Gnulib

This incorporates:
2018-08-11 verify: port 'assume' to traditional tools
* build-aux/config.sub, lib/regcomp.c, lib/verify.h:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.

6 years agoRemove stray union Lisp_Misc doc (Bug#32405#35).
Paul Eggert [Thu, 9 Aug 2018 18:13:17 +0000 (11:13 -0700)]
Remove stray union Lisp_Misc doc (Bug#32405#35).

6 years agoSimplify mark_object for pseudovectors
Paul Eggert [Thu, 9 Aug 2018 07:35:47 +0000 (00:35 -0700)]
Simplify mark_object for pseudovectors

Suggested by Pip Cet (Bug#32405#14).
* src/alloc.c (mark_object): Remove unnecessary special cases for
PVEC_MARKER, PVEC_BOOL_VECTOR, PVEC_MISC_PTR, PVEC_USER_PTR, and
PVEC_FINALIZER.

change is to free up an enum Lisp_Type tag value, a scarce

6 years agoTurn misc objects into pseudovectors
Paul Eggert [Thu, 9 Aug 2018 02:46:29 +0000 (19:46 -0700)]
Turn misc objects into pseudovectors

Eliminate the category of miscellaneous objects, and turn all
such objects into pseudovectors.  The immediate motivation
for this change is to free up an enum Lisp_Type tag value, a
scarce resource that can be better used elsewhere.  However,
this change is worthwhile in its own right, as it improves
performance slightly on my platform, 0.3% faster for 'make
compile-always' on Fedora 28, and it simplifies the garbage
collector and interpreter (Bug#32405).
* doc/lispref/internals.texi (Garbage Collection):
* etc/NEWS:
Document change to garbage-collect return value.
* src/alloc.c (total_markers, total_free_markers):
(union aligned_Lisp_Misc, MARKER_BLOCK_SIZE)
(struct marker_block, marker_block, marker_block_index)
(misc_free_list, allocate_misc, live_misc_holding)
(live_misc_p, sweep_misc):
* src/lisp.h (lisp_h_MARKERP, lisp_h_MISCP, MARKERP, MISCP)
(Lisp_Misc, enum Lisp_Misc_Type, Lisp_Misc_Free)
(Lisp_Misc_Marker, Lisp_Misc_Overlay, Lisp_Misc_Finalizer)
(Lisp_Misc_Ptr, Lisp_Misc_User_Ptr, Lisp_Misc_Limit)
(Lisp_Misc_Bignum)
(XSETMISC, struct Lisp_Misc_Any, XMISCANY, XMISCTYPE)
(struct Lisp_Free, union Lisp_Misc, XMISC):
Remove.  All uses removed.
(cleanup_vector): Clean up objects that were formerly misc
and are now pseudovectors.
(make_misc_ptr, build_overlay, Fmake_marker, build_marker)
(make_bignum_str, make_number, make_pure_bignum)
(make_user_ptr, Fmake_finalizer):
Build as pseudovectors, not as misc objects.
(mark_finalizer_list, queue_doomed_finalizers)
(compact_undo_list, mark_overlay, mark_object)
(unchain_dead_markers):
Mark as vector-like objects, not as misc objects.
(mark_maybe_object, mark_maybe_pointer, valid_lisp_object_p)
(total_bytes_of_live_objects, survives_gc_p):
* src/fns.c (sxhash):
No need to worry about misc objects.
(garbage_collect_1): Do not generate a 'misc' component.
(syms_of_alloc): No need for 'misc' symbol.
* src/buffer.c (overlays_at, overlays_in, overlay_touches_p)
(overlay_strings, recenter_overlay_lists)
(fix_start_end_in_overlays, fix_overlays_before)
(Foverlay_lists, report_overlay_modification)
(evaporate_overlays):
* src/editfns.c (overlays_around):
* src/data.c (Ftype_of):
* src/fns.c (internal_equal):
* src/lisp.h (mint_ptrp, xmint_pointer, FINALIZERP)
(XFINALIZER, MARKERP, XMARKER, OVERLAYP, XOVERLAY, USER_PTRP)
(XUSER_PTR, BIGNUMP, XBIGNUM):
* src/print.c (print_vectorlike, print_object):
* src/undo.c (record_marker_adjustments):
* src/xdisp.c (load_overlay_strings):
Formerly misc objects are now pseudovectors.
* src/lisp.h (PVEC_MARKER, PVEC_OVERLAY, PVEC_FINALIZER)
(PVEC_BIGNUM, PVEC_MISC_PTR, PVEC_USER_PTR):
New constants, replacing their misc versions.  All uses changed.
(struct Lisp_Marker, struct Lisp_Overlay, struct Lisp_Misc_Ptr)
(struct Lisp_Bignum, struct Lisp_User_Ptr, struct Lisp_Finalizer):
Make usable as a pseudovector by using a pseudovector header,
replacing any DIY components, and putting Lisp_Object members
first.  All uses changed.

6 years agoPacify Oracle Studio 12.6
Paul Eggert [Sat, 11 Aug 2018 23:32:06 +0000 (16:32 -0700)]
Pacify Oracle Studio 12.6

* src/xfns.c (Fx_frame_restack):
* src/xterm.c (x_io_error_quitter): Omit unreachable code.

6 years agoReject old libgmp that lack mpz_roinit_n
Paul Eggert [Sat, 11 Aug 2018 23:27:52 +0000 (16:27 -0700)]
Reject old libgmp that lack mpz_roinit_n

* configure.ac (HAVE_GMP): Port to RHEL 6.9, which has
libgmp 3.5, which predates mpz_roinit_n.

6 years ago; * test/lisp/international/ccl-tests.el: Add license notice.
Glenn Morris [Sat, 11 Aug 2018 21:44:49 +0000 (14:44 -0700)]
; * test/lisp/international/ccl-tests.el: Add license notice.

6 years agoMerge branch 'feature/bignum'
Tom Tromey [Sat, 11 Aug 2018 19:34:17 +0000 (13:34 -0600)]
Merge branch 'feature/bignum'

6 years agoFix Bug#32226, hopefully
Michael Albinus [Sat, 11 Aug 2018 18:30:39 +0000 (20:30 +0200)]
Fix Bug#32226, hopefully

* test/lisp/shadowfile-tests.el: Set Tramp variables for hydra.

6 years agoFix blunder in last commit for lisp/jsonrpc.el
João Távora [Sat, 11 Aug 2018 16:08:13 +0000 (17:08 +0100)]
Fix blunder in last commit for lisp/jsonrpc.el

* lisp/jsonrpc.el (jsonrpc-shutdown): Use jsonrpc--process.

6 years agoAdd option to cleanup buffers to jsonrpc-shutdown
João Távora [Sat, 11 Aug 2018 15:53:26 +0000 (16:53 +0100)]
Add option to cleanup buffers to jsonrpc-shutdown

* lisp/jsonrpc.el (Version): Bump to 1.0.5
(jsonrpc-shutdown): Add an option to cleanup process buffer.

6 years ago; More instrumentation for shadowfile-tests.el and files.el
Michael Albinus [Sat, 11 Aug 2018 15:02:38 +0000 (17:02 +0200)]
; More instrumentation for shadowfile-tests.el and files.el

6 years ago* lisp/jsonrpc.el (jsonrpc-request): Clarify comment.
João Távora [Sat, 11 Aug 2018 13:19:10 +0000 (14:19 +0100)]
* lisp/jsonrpc.el (jsonrpc-request): Clarify comment.

6 years agoMake jsonrpc-shutdown a noop if process isn't running
João Távora [Sat, 11 Aug 2018 13:18:17 +0000 (14:18 +0100)]
Make jsonrpc-shutdown a noop if process isn't running

* lisp/jsonrpc.el
(Version): Bump to 1.0.4
(jsonrpc-shutdown): Noop if server isn't running.

6 years agoAvoid calling vc backend if 'vc-display-status' is nil
Andy Moreton [Fri, 20 Jul 2018 16:45:09 +0000 (17:45 +0100)]
Avoid calling vc backend if 'vc-display-status' is nil

* lisp/vc/vc-hooks.el (vc-mode-line): Avoid calling VC backend if
'vc-display-status' is nil.  (Bug#32225)

6 years agoGive auto-save-no-message a proper version attribute
Eli Zaretskii [Sat, 11 Aug 2018 09:55:52 +0000 (12:55 +0300)]
Give auto-save-no-message a proper version attribute

* lisp/cus-start.el (standard): Give 'auto-save-no-message' the
proper version attribute.  (Bug#31039)

6 years agoAdd variable auto-save-no-message
Federico Tedin [Mon, 6 Aug 2018 22:53:05 +0000 (19:53 -0300)]
Add variable auto-save-no-message

* src/keyboard.c (auto-save-no-message): New variable, allows
suppressing auto-saving message.
* lisp/cus-start.el (standard): Add 'auto-save-no-message' variable.
* doc/emacs/files.texi (Auto Save): Document 'auto-save-no-message'.
* etc/NEWS: Mention 'auto-save-no-message'.  (Bug#31039)

6 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Sat, 11 Aug 2018 08:26:20 +0000 (10:26 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

6 years ago; More instrumentation for files.el
Michael Albinus [Sat, 11 Aug 2018 08:25:55 +0000 (10:25 +0200)]
; More instrumentation for files.el

6 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 11 Aug 2018 08:19:27 +0000 (11:19 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

6 years agoReinstate the 'tis620-2533' character set
Eli Zaretskii [Sat, 11 Aug 2018 08:15:57 +0000 (11:15 +0300)]
Reinstate the 'tis620-2533' character set

This is a partial revert of "Make 'tis620-2533' character set be an
alias for 'thai-iso8859-11'" commit from Jul 28, 2018.
* lisp/international/mule-conf.el (tis620-2533): No longer an
alias for thai-iso8859-11.  Instead, reinstate the original
definition of tis620-2533, but without eight-bit-control in
the :superset attribute.  For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00117.html
and the surrounding discussions.
* lisp/international/fontset.el (font-encoding-alist)
(font-encoding-charset-alist): Reinstate tis620-2533 charset.
* lisp/language/thai.el (thai-tis620): Restore the original
:charset-list.
("Thai"): Restore the original nonascii-translation.
* lisp/w32-fns.el: Use tis620-2533 instead of thai-iso8859-11.

6 years agoEditorial changes in tramp.texi
Michael Albinus [Sat, 11 Aug 2018 07:51:27 +0000 (09:51 +0200)]
Editorial changes in tramp.texi

* doc/misc/tramp.texi (Bug Reports): Tramp buffers shall be
appended as attachments to bug reports.
(Frequently Asked Questions): New item, determining remote buffers.

6 years agoMake nnimap support IMAP namespaces
Nikolaus Rath [Mon, 23 Jul 2018 09:21:46 +0000 (10:21 +0100)]
Make nnimap support IMAP namespaces

* lisp/gnus/nnimap.el (nnimap-use-namespaces): Introduce new
server variable.
(nnimap-group-to-imap, nnimap-get-groups): Transform IMAP group
names to Gnus group name by stripping / prefixing personal
namespace prefix.
(nnimap-open-connection-1): Ask server for namespaces and store
them.

* lisp/gnus/nnimap.el (nnimap-request-group-scan)
(nnimap-request-create-group, nnimap-request-delete-group)
(nnimap-request-rename-group, nnimap-request-move-article)
(nnimap-process-expiry-targets)
(nnimap-request-update-group-status)
(nnimap-request-accept-article, nnimap-request-list)
(nnimap-retrieve-group-data-early, nnimap-change-group)
(nnimap-split-incoming-mail): Use nnimap-group-to-imap.
(nnimap-group-to-imap): New function to map Gnus group names to
IMAP folder names.  (Bug#21057)

6 years agoImprove error message when Hunspell dictionaries are misconfigured
Eli Zaretskii [Sat, 11 Aug 2018 07:34:10 +0000 (10:34 +0300)]
Improve error message when Hunspell dictionaries are misconfigured

* lisp/textmodes/ispell.el
(ispell-find-hunspell-dictionaries): Produce a meaningful
error message if Hunspell dictionaries are misconfigured.
(Bug#32319)

6 years ago; Merge from origin/emacs-26
Glenn Morris [Fri, 10 Aug 2018 18:37:11 +0000 (11:37 -0700)]
; Merge from origin/emacs-26

The following commit was skipped:

5e42c34 (origin/emacs-26) Fix bugs in `auth-source-netrc-parse-one'.

6 years agoMerge from origin/emacs-26
Glenn Morris [Fri, 10 Aug 2018 18:37:11 +0000 (11:37 -0700)]
Merge from origin/emacs-26

71c92d8 Fix copying text properties by 'format'
96be6b6 Improve error messages regarding initial-buffer-choice (Bug#2...
00fb127 * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):...

Conflicts:
lisp/startup.el

6 years ago; Merge from origin/emacs-26
Glenn Morris [Fri, 10 Aug 2018 18:28:40 +0000 (11:28 -0700)]
; Merge from origin/emacs-26

The following commit was skipped:

18588bc Make async :family 'local failures fail correctly again

6 years agoMerge from origin/emacs-26
Glenn Morris [Fri, 10 Aug 2018 18:28:40 +0000 (11:28 -0700)]
Merge from origin/emacs-26

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

6 years agoFix bugs in `auth-source-netrc-parse-one'.
Filipp Gunbin [Tue, 15 May 2018 00:02:49 +0000 (03:02 +0300)]
Fix bugs in `auth-source-netrc-parse-one'.

* lisp/auth-source.el (auth-source-netrc-parse-one): Ensure that match
  data is not overwritten in `auth-source-netrc-parse-next-interesting'.
  Ensure that blanks are skipped before and after going over comments
  and eols.
* test/lisp/auth-source-tests.el (auth-source-test-netrc-parse-one): New test.

(cherry picked from commit 60ff8101449eea3a5ca4961299501efd83d011bd)

6 years ago; More instrumentation for shadowfile-tests.el and files.el
Michael Albinus [Fri, 10 Aug 2018 11:34:10 +0000 (13:34 +0200)]
; More instrumentation for shadowfile-tests.el and files.el

* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Use `set-visited-file-name'
instead of setting the value in `buffer-file-name' directly.
(Bug#32226)

6 years agoAnother try to fix Bug#32226
Michael Albinus [Fri, 10 Aug 2018 08:58:00 +0000 (10:58 +0200)]
Another try to fix Bug#32226

* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Use `set-visited-file-name'
instead of setting the value in `buffer-file-name' directly.
(Bug#32226)

6 years ago; More instrumentation for files.el
Michael Albinus [Fri, 10 Aug 2018 07:53:37 +0000 (09:53 +0200)]
; More instrumentation for files.el

6 years agoAllow completely disabling event logging in jsonrpc.el
João Távora [Fri, 10 Aug 2018 00:15:25 +0000 (01:15 +0100)]
Allow completely disabling event logging in jsonrpc.el

Pretty printing the event sexp can be very slow when very big messages
are involved.

* lisp/jsonrpc.el (Version): Bump to 1.0.3
(jsonrpc-connection): Tweak docstring for
jsonrpc--event-buffer-scrollback-size.
(jsonrpc--log-event): Only log if max size is positive.

6 years agoFix up for bignums after merge from trunk
Tom Tromey [Fri, 10 Aug 2018 00:02:00 +0000 (18:02 -0600)]
Fix up for bignums after merge from trunk

* src/character.c (char_width): Use XFIXNUM.
* src/editfns.c (styled_format): Use XFIXNUM, XUFIXNUM.
* src/fns.c (Fproper_list_p): Use make_fixnum.

6 years agoMerge remote-tracking branch 'origin/master' into feature/bignum
Tom Tromey [Thu, 9 Aug 2018 23:56:53 +0000 (17:56 -0600)]
Merge remote-tracking branch 'origin/master' into feature/bignum

6 years agoUse mpz_sgn rather than comparisons against 0
Tom Tromey [Thu, 9 Aug 2018 19:21:45 +0000 (13:21 -0600)]
Use mpz_sgn rather than comparisons against 0

* src/data.c (Fmod): Use mpz_sgn.
* src/lisp.h (NATNUMP): Use mpz_sgn.

6 years agoDo not use GMP_NUMB_BITS
Andy Moreton [Thu, 9 Aug 2018 19:19:15 +0000 (13:19 -0600)]
Do not use GMP_NUMB_BITS

* src/alloc.c (make_number): Use mp_bits_per_limb, not GMP_NUMB_BITS.

6 years agoFix copying text properties by 'format'
Eli Zaretskii [Thu, 9 Aug 2018 15:08:35 +0000 (18:08 +0300)]
Fix copying text properties by 'format'

* src/editfns.c (styled_format): Add the spec beginning index
to the info recorded for each format spec, and use it to
detect the case that a format spec and its text property end
where the next spec with another property begins.  (Bug#32404)

* test/src/editfns-tests.el (format-properties): Add tests for
bug#32404.

6 years agoUpdate src/{ns,mac}*.m to use bignum-compatible macros
Charles A. Roelli [Thu, 9 Aug 2018 14:00:20 +0000 (16:00 +0200)]
Update src/{ns,mac}*.m to use bignum-compatible macros

* src/nsterm.m:
* src/nsselect.m:
* src/nsmenu.m:
* src/nsimage.m:
* src/nsfont.m:
* src/nsfns.m:
* src/macfont.m: Replace
"make_number" -> "make_fixnum",
"XINT" -> "XFIXNUM",
"XFASTINT" -> "XFIXNAT",
"TYPE_RANGED_INTEGERP" -> "TYPE_RANGED_FIXNUMP",
"RANGED_INTEGERP" -> "RANGED_FIXNUMP",
"CHECK_NATNUM" -> "CHECK_FIXNAT",
"CHECK_NUMBER" -> "CHECK_FIXNUM",
"INTEGERP" -> "FIXNUMP",
"NUMBERP" -> "FIXED_OR_FLOATP",
as done in the following changes:
2018-07-06 Rename integerp->fixnum, etc, in preparation
for bignums (42fe787b)
2018-08-07 More macro renamings for bignum (d1ec3a0a)

6 years ago; More instrumentation for shadowfile-tests.el and files.el
Michael Albinus [Thu, 9 Aug 2018 13:40:37 +0000 (15:40 +0200)]
; More instrumentation for shadowfile-tests.el and files.el

6 years agoImprove error messages regarding initial-buffer-choice (Bug#29098)
Alexander Gramiak [Wed, 1 Nov 2017 03:10:52 +0000 (21:10 -0600)]
Improve error messages regarding initial-buffer-choice (Bug#29098)

* lisp/startup.el (command-line-1) <initial-buffer-choice>: Make the
messages conform to Emacs conventions, and show the invalid return
value in the message.

6 years agoFix Bug#32304
Michael Albinus [Thu, 9 Aug 2018 12:08:25 +0000 (14:08 +0200)]
Fix Bug#32304

* test/lisp/net/tramp-tests.el (tramp-test45-unload):
Handle tramp-archive autoloaded objects.  Remove tag :unstable.

6 years agoTrim JSONRPC events buffer when it's too large
João Távora [Thu, 9 Aug 2018 12:04:03 +0000 (13:04 +0100)]
Trim JSONRPC events buffer when it's too large

* lisp/jsonrpc.el (Version): Bump to 1.0.2
(jsonrpc--events-buffer-scrollback-size): New
jsonrpc-connection slot.
(jsonrpc--log-event): Use it to trim buffer.

6 years agoSynchronous JSONRPC requests can be cancelled on user input
João Távora [Thu, 9 Aug 2018 09:43:41 +0000 (10:43 +0100)]
Synchronous JSONRPC requests can be cancelled on user input

This allows building more responsive interfaces, such as a snappier
completion backend.

* lisp/jsonrpc.el (Version): Bump to 1.0.1
(jsonrpc-connection-receive): Don't warn when continuation isn't
found.
(jsonrpc-request): Add parameters CANCEL-ON-INPUT and
CANCEL-ON-INPUT-RETVAL.

6 years agoMinor pseudovector allocation cleanups
Paul Eggert [Thu, 9 Aug 2018 01:51:35 +0000 (18:51 -0700)]
Minor pseudovector allocation cleanups

* src/alloc.c (VECTOR_BLOCK_SIZE, VECTOR_BLOCK_BYTES)
(VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX):
Prefer enums to macros where either will do.
(allocate_vector_from_block): Arg is ptrdiff_t, not size_t.
Use eassume instead of eassert.
(PSEUDOVEC_STRUCT): New macro, which verifies the already-existing
assumption that the vector-like objects are small.
(cleanup_vector): Use it.  Use if-then-else systematically;
this lets GCC do a bit better job.

2018-08-08  Paul Eggert  <eggert@cs.ucla.edu>

* src/alloc.c (VBLOCK_BYTES_MAX): Use vroundup_ct, not
vroundup, so that can be used in static assertions.

6 years ago* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01): Fix typo.
Glenn Morris [Wed, 8 Aug 2018 23:58:29 +0000 (19:58 -0400)]
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01): Fix typo.

6 years agoFix mod-test-sum-test for bignums
Tom Tromey [Wed, 8 Aug 2018 23:34:42 +0000 (17:34 -0600)]
Fix mod-test-sum-test for bignums

* test/src/emacs-module-tests.el (mod-test-sum-test): Update
for bignums.

6 years agoHandle leading "+" when converting string to bignum
Tom Tromey [Wed, 8 Aug 2018 23:33:24 +0000 (17:33 -0600)]
Handle leading "+" when converting string to bignum

* src/lread.c (string_to_number): Skip leading "+" when calling
make_bignum_str.

6 years agoMake async :family 'local failures fail correctly again
Lars Ingebrigtsen [Sun, 22 Jul 2018 11:39:10 +0000 (13:39 +0200)]
Make async :family 'local failures fail correctly again

* src/fileio.c (get_file_errno_data): Refactor out into its own
function so that we can reuse the error handling from an async
context (bug#31901).

* src/process.c (connect_network_socket): When an async :family
'local client fails (with a file error, for instance), mark the
process as failed.

(cherry picked from commit 92ba34d89ac4f5b5bbb818e1c39a3cc12a405790)

6 years agoFix emacsclient check for term.el buffer (Bug#21041)
Noam Postavsky [Tue, 24 Jul 2018 01:01:01 +0000 (21:01 -0400)]
Fix emacsclient check for term.el buffer (Bug#21041)

* 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.

6 years agoUse mpz_import in mpz_set_uintmax_slow
Tom Tromey [Wed, 8 Aug 2018 23:01:55 +0000 (17:01 -0600)]
Use mpz_import in mpz_set_uintmax_slow

* src/alloc.c (mpz_set_uintmax_slow): Use mpz_import.

6 years agoMake purecopy work for bignums
Tom Tromey [Wed, 8 Aug 2018 23:01:14 +0000 (17:01 -0600)]
Make purecopy work for bignums

* src/alloc.c (make_pure_bignum): New function.
(purecopy): Use it.

6 years ago; Fix typos in commentary
Charles A. Roelli [Wed, 8 Aug 2018 19:26:33 +0000 (21:26 +0200)]
; Fix typos in commentary

* src/xdisp.c (windows_or_buffers_changed, update_mode_lines)
(get_phys_cursor_geometry, display_echo_area_1)
(resize_mini_window_1):
* src/dispextern.h (struct it): Fix typos in commentary.

6 years agoFix problems in tramp-tests
Michael Albinus [Wed, 8 Aug 2018 17:57:54 +0000 (19:57 +0200)]
Fix problems in tramp-tests

* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)

* test/lisp/net/tramp-tests.el (tramp-test43-auto-load):
Add skip condition.  (Bug#32304)
(tramp-test43-unload): Tag as :unstable.

6 years agoImprove documentation of 'set-fontset-font'
Eli Zaretskii [Wed, 8 Aug 2018 15:24:45 +0000 (18:24 +0300)]
Improve documentation of 'set-fontset-font'

* doc/lispref/display.texi (Fontsets): Fix description of
'set-fontset-font'.
* src/fontset.c (Fset_fontset_font): Doc fix.  (Bug#32401)

6 years ago; More instrumentation for shadowfile-tests.el
Michael Albinus [Wed, 8 Aug 2018 14:22:23 +0000 (16:22 +0200)]
; More instrumentation for shadowfile-tests.el

6 years agoFilter out tramp-archive objects in tramp-test45-unload
Michael Albinus [Wed, 8 Aug 2018 13:38:10 +0000 (15:38 +0200)]
Filter out tramp-archive objects in tramp-test45-unload

* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)

6 years agoTag expensive tests in tramp-archive.el (Bug#30807)
Michael Albinus [Wed, 8 Aug 2018 12:59:56 +0000 (14:59 +0200)]
Tag expensive tests in tramp-archive.el  (Bug#30807)

* test/lisp/net/tramp-archive-tests.el (tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Rename.
(tramp-archive-test07-file-exists-p)
(tramp-archive-test08-file-local-copy)
(tramp-archive-test09-insert-file-contents)
(tramp-archive-test11-copy-file)
(tramp-archive-test15-copy-directory)
(tramp-archive-test16-directory-files)
(tramp-archive-test17-insert-directory)
(tramp-archive-test18-file-attributes)
(tramp-archive-test19-directory-files-and-attributes)
(tramp-archive-test20-file-modes)
(tramp-archive-test21-file-links)
(tramp-archive-test26-file-name-completion)
(tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Tag them as :expensive-test,
because they run longer than 10 seconds.  (Bug#30807)

6 years agoMore macro renamings for bignum
Tom Tromey [Wed, 8 Aug 2018 00:08:53 +0000 (18:08 -0600)]
More macro renamings for bignum

* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.

6 years agoImprove documentation of M-?
Eli Zaretskii [Tue, 7 Aug 2018 16:15:41 +0000 (19:15 +0300)]
Improve documentation of M-?

* doc/emacs/maintaining.texi (Identifier Search):
* lisp/progmodes/xref.el (xref-find-references): Improve
documentation of xref-find-references and
xref-prompt-for-identifier.  (Bug#32389)

6 years agoReinterpret Esperanto characters in iso-transl as iso-8859-3.
Ivan Shmakov [Sun, 5 Aug 2018 21:45:46 +0000 (21:45 +0000)]
Reinterpret Esperanto characters in iso-transl as iso-8859-3.

* lisp/international/iso-transl.el (iso-transl-language-alist):
Reinterpret Esperanto characters as iso-8859-3 (were: iso-8859-1).
(Bug#32371)

6 years agoFix Flyspell mode when several languages are mixed in a buffer
Eli Zaretskii [Tue, 7 Aug 2018 15:35:12 +0000 (18:35 +0300)]
Fix Flyspell mode when several languages are mixed in a buffer

* lisp/textmodes/flyspell.el (flyspell-external-point-words):
Handle "misspelled" words that actually belong to a language
unsupported by the current dictionary.  (Bug#32280)  Fix the test
for Ispell the program.

6 years agoAvoid segfaults in jason-serialize on MS-Windows
Eli Zaretskii [Tue, 7 Aug 2018 14:28:35 +0000 (17:28 +0300)]
Avoid segfaults in jason-serialize on MS-Windows

* src/json.c (Fjson_serialize): Free the string with
'json_free', not 'free', since it was allocated with
'json_malloc'.  (Bug#32381)

6 years agoFix todo-mode bug involving active region (bug#32379)
Stephen Berman [Mon, 6 Aug 2018 21:52:47 +0000 (23:52 +0200)]
Fix todo-mode bug involving active region (bug#32379)

* lisp/calendar/todo-mode.el (todo-forward-category)
(todo-jump-to-category, todo-toggle-view-done-items)
(todo-toggle-view-done-only, todo-edit-quit, todo-search)
(todo-go-to-source-item, todo-diary-goto-entry): Deactivate the
mark when the region is active.

6 years agoCorrect and improve part of previous todo-mode.el fix
Stephen Berman [Mon, 6 Aug 2018 17:59:25 +0000 (19:59 +0200)]
Correct and improve part of previous todo-mode.el fix

* lisp/calendar/todo-mode.el (todo-jump-to-category): Improve code
by using bound-and-true-p.  This leaves a byte-compiler warning
unsilenced, but ideally, there shouldn't be a warning here (see
https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00131.html).
(todo--fifiles-history): New variable.
(todo-find-filtered-items-file): Use it to fix the filtered items
files history list for completing-read.

6 years agoFix the MS-Windows build as followup to Gnulib regex import
Eli Zaretskii [Mon, 6 Aug 2018 14:50:55 +0000 (17:50 +0300)]
Fix the MS-Windows build as followup to Gnulib regex import

* lib-src/ntlib.c (nl_langinfo): New function.  (Bug#32194)

6 years agoSpruce up some regex-emacs comments
Paul Eggert [Mon, 6 Aug 2018 01:41:21 +0000 (18:41 -0700)]
Spruce up some regex-emacs comments

* src/regex-emacs.c, src/regex-emacs.h: Update comments.

6 years agoRemove always-0 struct re_pattern_buffer members
Paul Eggert [Mon, 6 Aug 2018 01:41:21 +0000 (18:41 -0700)]
Remove always-0 struct re_pattern_buffer members

* src/regex-emacs.h (struct re_pattern_buffer):
Remove no_sub, not_bol, not_eol.  They are always zero.
All uses removed, and code simplified.

6 years agoSimplify regex-emacs by assuming Emacs syntax
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Simplify regex-emacs by assuming Emacs syntax

* src/regex-emacs.c (reg_syntax_t)
(RE_BACKSLASH_ESCAPE_IN_LISTS, RE_BK_PLUS_QM)
(RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
(RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS)
(RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE)
(RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT)
(RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS)
(RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES)
(RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING)
(RE_NO_GNU_OPS, RE_FRUGAL, RE_SHY_GROUPS)
(RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS, RE_TRANSLATE_P):
Remove.  All uses removed and resulting code simplified.
(TRANSLATE): Treat nil as an absent translation table, not zero.
All uses changed.

6 years agoSimplify regex-emacs code by assuming Emacs
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Simplify regex-emacs code by assuming Emacs

* src/regex-emacs.c: Omit no-longer-needed AIX code.
Don’t ignore GCC warnings.
Include regex-emacs.h immediately after config.h,
to test that it’s independent.
Omit the "#ifndef emacs" and "#ifdef REGEX_MALLOC" and
"#if WIDE_CHAR_SUPPORT" or "#ifdef _REGEX_RE_COMP",
code, as we are no longer interested in compiling outside
Emacs (with or without debugging or native wide char support)
or in avoiding alloca.
(REGEX_EMACS_DEBUG, regex_emacs_debug): Rename from DEBUG and debug,
to avoid collision with other DEBUGS.  All uses changed.
In debugging output, change %ld and %zd to %zu when appropriate.
No need to include stddef.h, stdlib.h, sys/types.h, wchar.h,
wctype.h, locale/localeinfo.h, locale/elem-hash.h, langinfo.h,
libintl.h, unistd.h, stdbool.h, string.h, stdio.h, assert.h.
All uses of assert changed to eassert.
(RE_DUP_MAX, reg_syntax_t, RE_BACKSLASH_ESCAPE_IN_LISTS)
(RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
(RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS, RE_DOT_NEWLINE)
(RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE, RE_INTERVALS)
(RE_LIMITED_OPS, RE_NEWLINE_ALT, RE_NO_BK_BRACES)
(RE_NO_BK_PARENS, RE_NO_BK_REFS, RE_NO_BK_VBAR)
(RE_NO_EMPTY_RANGES, RE_UNMATCHED_RIGHT_PAREN_ORD)
(RE_NO_POSIX_BACKTRACKING, RE_NO_GNU_OPS, RE_FRUGAL)
(RE_SHY_GROUPS, RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS)
(REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE)
(REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN)
(REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT)
(REG_EEND, REG_ESIZE, REG_ERPAREN, REG_ERANGEX, REG_ESIZEBR)
(reg_errcode_t, REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED)
(RE_NREGS, RE_TRANSLATE, RE_TRANSLATE_P):
Move here from regex-emacs.h.
(RE_NREGS): Define unconditionally.
(boolean): Remove.  All uses replaced by bool.
(WIDE_CHAR_SUPPORT, regfree, regexec, regcomp, regerror):
(re_set_syntax, re_syntax_options, WEAK_ALIAS, gettext, gettext_noop):
Remove.  All uses removed.
(malloc, realloc, free): Do not redefine.  Adjust all callers
to use xmalloc, xrealloc, xfree instead.
(re_error_msgid): Use C99 to avoid need to keep in same order
as reg_error_t.
(REGEX_USE_SAFE_ALLOCA): Simplify by using USE_SAFE_ALLOCA.
(REGEX_ALLOCATE, REGEX_REALLOCATE, REGEX_FREE, REGEX_ALLOCATE_STACK)
(REGEX_REALLOCATE_STACK, REGEX_FREE_STACK): Remove.
All callers changed to use the non-REGEX_MALLOC version.
(REGEX_TALLOC): Remove.  All callers changed to use SAFE_ALLOCA.
(re_set_syntax): Remove; unused.
(MATCH_MAY_ALLOCATE): Remove; now always true.  All uses simplified.
(INIT_FAILURE_ALLOC): Define unconditionally.
(re_compile_fastmap): Now static.
(re_compile_pattern): Avoid unnecessary cast.
* src/regex-emacs.h (EMACS_REGEX_H): Renamed from _REGEX_H to
avoid possible collision with glibc.
Don’t include sys/types.h.  All uses of ssize_t changed to ptrdiff_t.
Don’t worry about C++ or VMS.
Assume emacs is defined and that _REGEX_RE_COMP and WIDE_CHAR_SUPPORT
are not.
Define struct re_registers before including lisp.h.
(REG_ENOSYS, RE_TRANSLATE_TYPE): Remove; all uses replaced by
Lisp_Object.
(regoff_t): Remove.  All uses replaced with ptrdiff_t.
(re_match, regcomp, regexec, regerror, regfree):
Remove decl of nonexistent functions.
(RE_DEBUG, RE_SYNTAX_AWK, RE_SYNTAX_GNU_AWK)
(RE_SYNTAX_POSIX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP)
(RE_SYNTAX_POSIX_EGREP, RE_SYNTAX_ED, RE_SYNTAX_SED)
(_RE_SYNTAX_POSIX_COMMON, RE_SYNTAX_POSIX_BASIC)
(RE_SYNTAX_POSIX_MINIMAL_BASIC, RE_SYNTAX_POSIX_EXTENDED)
(RE_SYNTAX_POSIX_MINIMAL_EXTENDED, REG_EXTENDED, REG_ICASE)
(REG_NEWLINE, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, regmatch_t):
Remove; unused.
* src/search.c (Fset_match_data): Simplify range test now that
we know it’s ptrdiff_t.

6 years agoUse Gnulib regex for lib-src
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Use Gnulib regex for lib-src

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.

6 years agoRename src/regex.c to src/regex-emacs.c.
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Rename src/regex.c to src/regex-emacs.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.