]> git.eshelyaron.com Git - emacs.git/log
emacs.git
8 years agoAdd the tamil-dvorak input method
Shakthi Kannan [Mon, 23 Nov 2015 17:40:08 +0000 (19:40 +0200)]
Add the tamil-dvorak input method

* lisp/leim/quail/tamil-dvorak.el: New file.  (Bug#21768)

* etc/NEWS: Mention the new input method.

8 years ago* /etc/NEWS (Incompatible Lisp Changes): Also `setf' needs an even # of args.
Alan Mackenzie [Mon, 23 Nov 2015 17:20:12 +0000 (17:20 +0000)]
* /etc/NEWS (Incompatible Lisp Changes): Also `setf' needs an even # of args.

8 years agoSignal an error when `setf' gets an odd number of arguments.
Alan Mackenzie [Mon, 23 Nov 2015 17:13:55 +0000 (17:13 +0000)]
Signal an error when `setf' gets an odd number of arguments.

* lisp/emacs-lisp/gv.el (setf): Amend.

8 years ago* lisp/emacs-lisp/smie.el (smie-backward-sexp): Handle BOB better.
Stefan Monnier [Mon, 23 Nov 2015 16:26:16 +0000 (11:26 -0500)]
* lisp/emacs-lisp/smie.el (smie-backward-sexp): Handle BOB better.

8 years ago* etc/NEWS (Incompatible Lisp Changes): Document new restriction on `setq'.
Alan Mackenzie [Mon, 23 Nov 2015 14:59:49 +0000 (14:59 +0000)]
* etc/NEWS (Incompatible Lisp Changes): Document new restriction on `setq'.

8 years agoExpunge occurrences of `setq' with an odd number of arguments.
Alan Mackenzie [Mon, 23 Nov 2015 14:49:23 +0000 (14:49 +0000)]
Expunge occurrences of `setq' with an odd number of arguments.

* lisp/apropos.el (apropos-documentation):
* lisp/obsolete/complete.el (PC-include-file-all-completions):
* lisp/progmodes/compile.el (compilation-goto-locus):
* lisp/vc/vc-cvs.el (vc-cvs-parse-root): (twice)
Insert missing nil at end of `setq' forms.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-autoload): Remove an
erroneous trailing variable name from a setq, thus allowing a compilation
properly to track functions not defined at runtime.

8 years agoAdd a note about a questionable use of bool in xdisp.c
John Wiegley [Mon, 23 Nov 2015 14:42:22 +0000 (06:42 -0800)]
Add a note about a questionable use of bool in xdisp.c

8 years agoIssue a warning from the byte compiler on a malformed `setq' form.
Alan Mackenzie [Mon, 23 Nov 2015 14:25:15 +0000 (14:25 +0000)]
Issue a warning from the byte compiler on a malformed `setq' form.

Partly fixes bug#20241.
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Issue a warning when a
`setq' form with an odd number of arguments is compiled.

8 years agoDon't let cconv_convert insert a nil argument into a `setq' form.
Alan Mackenzie [Mon, 23 Nov 2015 14:10:36 +0000 (14:10 +0000)]
Don't let cconv_convert insert a nil argument into a `setq' form.

Fixes bug#21983.
* lisp/emacs-lisp/cconv.el (cconv-convert): Don't silently insert a nil last
argument into a `setq' when there're an odd number of args.  This enables the
byte compiler to issue a message in this case.

8 years agoSignal an error when `setq' has an odd number of arguments. Fixes bug#20241.
Alan Mackenzie [Mon, 23 Nov 2015 13:56:37 +0000 (13:56 +0000)]
Signal an error when `setq' has an odd number of arguments.  Fixes bug#20241.

* src/eval.c (Fsetq): Signal an error on an odd number of arguments.
(syms_of_eval): Add a DEFSYM for Qsetq.

8 years ago* doc/lispref/windows.texi (Window Sizes): Fix indices and references.
Martin Rudalics [Mon, 23 Nov 2015 07:37:45 +0000 (08:37 +0100)]
* doc/lispref/windows.texi (Window Sizes): Fix indices and references.

8 years ago* src/frame.c (adjust_frame_size): Set FRAME_WINDOW_SIZES_CHANGED (Bug#21975).
Martin Rudalics [Mon, 23 Nov 2015 07:19:58 +0000 (08:19 +0100)]
* src/frame.c (adjust_frame_size): Set FRAME_WINDOW_SIZES_CHANGED (Bug#21975).

8 years agoAdd EUDC BBDB 3 entry in NEWS
Thomas Fitzsimmons [Mon, 23 Nov 2015 02:33:48 +0000 (21:33 -0500)]
Add EUDC BBDB 3 entry in NEWS

* NEWS: Mention EUDC BBDB backend support for BBDB 3.

8 years agoImprove EUDC to BBDB 3 export
Thomas Fitzsimmons [Sun, 22 Nov 2015 16:29:13 +0000 (11:29 -0500)]
Improve EUDC to BBDB 3 export

* eudc-vars.el (eudc-ldap-bbdb-conversion-alist): Change phone
entry to single item.  Add company conversion.
* eudc-export.el (eudc-bbdbify-company): New function.
(bbdb-parse-phone): Declare function.
(eudc-bbdbify-phone): Add BBDB 3 support.
(Bug#21971)

8 years agoAdd BBDB 3 support for EUDC export
Thomas Fitzsimmons [Sun, 22 Nov 2015 22:30:50 +0000 (17:30 -0500)]
Add BBDB 3 support for EUDC export

* eudc.el: Add bbdb-version defvar.
(eudc--using-bbdb-3-or-newer-p): New function.
* eudc-export.el (eudc-create-bbdb-record): Add support for
bbdb-create-internal argument list changes introduced in BBDB 3.
* eudcb-bbdb.el: Remove bbdb-version defvar.
(eudc-bbdb-field): Call eudc--using-bbdb-3-or-newer-p.
(Bug#21971)

8 years agoAllow loading modules by 'load-file'
Eli Zaretskii [Sun, 22 Nov 2015 18:38:51 +0000 (20:38 +0200)]
Allow loading modules by 'load-file'

* src/lread.c (Fload): Call 'unbind_to' with 'Fmodule_load' as the
2nd arg, to avoid the "binding stack not balanced" error.
(syms_of_lread) <module-file-suffix>: New Lisp variable.

* lisp/files.el (module-file-suffix): Declare.
(load-file): Remove 'module-file-suffix' from
'completion-ignored-extensions', to allow completion on modules.

* etc/NEWS: Mention 'module-file-suffix'.

8 years agoFix unoptimized builds
Eli Zaretskii [Sun, 22 Nov 2015 18:19:13 +0000 (20:19 +0200)]
Fix unoptimized builds

* src/lisp.h (XTYPE): Move before XSYMBOL, to fix unoptimized
builds.

8 years agoWork around the asynchronous-empty-diff problem
Dmitry Gutov [Sun, 22 Nov 2015 04:59:50 +0000 (06:59 +0200)]
Work around the asynchronous-empty-diff problem

* lisp/vc/vc-rcs.el (vc-rcs-diff):
* lisp/vc/vc-mtn.el (vc-mtn-diff):
* lisp/vc/vc-hg.el (vc-hg-diff):
* lisp/vc/vc-git.el (vc-git-diff): Ignore the ASYNC argument,
do a synchronous process call (bug#21969).

8 years agoFinish excising electric indent from `open-line'
Karl Fogel [Sun, 22 Nov 2015 04:50:05 +0000 (22:50 -0600)]
Finish excising electric indent from `open-line'

* lisp/simple.el (open-line): Remove INTERACTIVE argument.

* test/automated/simple-test.el (open-line-indent, open-line-hook):
  Adjust accordingly.

This change finishes what my commit of Thu Nov 19 17:32:37 2015 -0600
(git commit c59353896) started.  It turns out that having INTERACTIVE
cause `post-self-insert-hook' to run (via `newline') meant `open-line'
still had the electric indent behavior, as `post-self-insert-hook'
normally contains `electric-indent-post-self-insert-function' ever
since `electric-indent-mode' has been on by default.  Tracing the code
change in `open-line' is mildly twisty, because Artur Malabarba's
earliest two commits of 24 Oct 2015 first removed the `interactive'
form entirely (git commit 6939896e2) and then restored it with the new
extra "p" already added (git commit bd4f04f86), such that there is no
single-commit diff in which one sees the second "p" appear.  Thus this
change is effectively a reversion of parts of each of those commits.

This could close bug#21884, at least until further discussion.

8 years agoAdhere closer to the "implicit tag name" definition
Dmitry Gutov [Sun, 22 Nov 2015 04:33:22 +0000 (06:33 +0200)]
Adhere closer to the "implicit tag name" definition

* lisp/progmodes/etags.el (etags-tags-completion-table):
Adhere closer to the "implicit tag name" definition.  Simplify
the regexp.  Search for the explicit tag name first, and when
not found, search locally for the implicit one.  (Bug#21934)

8 years agoUnrevert most of regexp reentrancy abort patch
Stefan Monnier [Sun, 22 Nov 2015 03:05:28 +0000 (22:05 -0500)]
Unrevert most of regexp reentrancy abort patch

The problem was in:
  * src/syntax.c (update_syntax_table_forward): Propertize even when truncated
which is hence not unreverted.
The rest is:
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
(UPDATE_SYNTAX_TABLE_FAST): Re-introduce.
All callers in regex.c changed back to the _FAST versions.

* test/automated/message-mode-tests.el: Tweak the test to rely on auto
propertization in backward-sexp.

8 years agoRevert regexp reentrancy abort patch
Paul Eggert [Sat, 21 Nov 2015 22:13:56 +0000 (14:13 -0800)]
Revert regexp reentrancy abort patch

Although the patch does fix Bug#21688 and prevents a core dump,
it also makes the message-mode-propertize test fail; see:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01667.html
Perhaps someone else can come up with a better fix some day.
* src/syntax.c (update_syntax_table_forward):
Propertize even when truncated.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
(UPDATE_SYNTAX_TABLE_FAST): Remove.
All callers changed back to the non-_FAST versions.

8 years agoAdd a few safety checks when ENABLE_CHECKING
Paul Eggert [Sat, 21 Nov 2015 18:38:19 +0000 (10:38 -0800)]
Add a few safety checks when ENABLE_CHECKING

This was motivated by the recent addition of module code,
which added some ENABLE_CHECKING-enabled checks that are
useful elsewhere too.
* src/alloc.c (compact_font_cache_entry):
* src/fns.c (sweep_weak_table):
* src/lread.c (oblookup):
Use gc_asize rather than doing it by hand.
* src/emacs-module.c (module_make_global_ref)
(module_free_global_ref, module_vec_size):
Omit assertions that lisp.h now checks.
* src/lisp.h (XFASTINT, ASIZE): In functional implementations,
check that the result is nonnegative.  Use eassume, as this
info can help a bit when optimizing production code.
(XSYMBOL) [!USE_LSB_TAG]: Assert that argument is a symbol,
to be consistent with the USE_LSB_TAG case.
(gc_asize): New function, when ASIZE is needed in the gc.
(gc_aset): Use it.
(HASH_TABLE_P): Move definition up, so that it can be used ...
(XHASH_TABLE): ... here, to assert that the arg is a hash table.

8 years agoSimplify recording of main thread's ID on MS-Windows
Eli Zaretskii [Sat, 21 Nov 2015 17:44:02 +0000 (19:44 +0200)]
Simplify recording of main thread's ID on MS-Windows

* src/w32term.c (w32_initialize):
* src/w32console.c (initialize_w32_display):
* src/w32fns.c (globals_of_w32fns): Don't record the main thread
ID independently for each type of session (GUI, TTY, batch).
* src/w32term.c (w32_init_main_thread): New function, records the
main thread's thread ID.
* src/w32term.h: Add prototype for w32_init_main_thread.
* src/emacs.c (main) [WINDOWSNT]: Call w32_init_main_thread.

* src/emacs-module.c [WINDOWSNT]: Rename main_thread_id to
main_thread, for consistency with other threading libraries.  All
users changed.  Include w32term.h.
(check_main_thread) [WINDOWSNT]: Simplify the test: no need to
make sure the main thread is alive, as we hold a handle on it
opened by w32_init_main_thread.
(module_init) [WINDOWSNT]: Reuse the thread ID recorded by
w32_init_main_thread, instead of calling the requisite APIs once
more.

8 years agoBackport: Fix issue where a new tempfile was created every refresh
Mark Oteiza [Wed, 18 Nov 2015 18:42:40 +0000 (13:42 -0500)]
Backport: Fix issue where a new tempfile was created every refresh

* lisp/mpc.el (mpc-format): Leave dir as relative path

8 years ago; * src/lread.c (Fload): Fix last change.
Eli Zaretskii [Sat, 21 Nov 2015 12:01:25 +0000 (14:01 +0200)]
; * src/lread.c (Fload): Fix last change.

8 years agoCall 'window-size-change-functions' for mini-windows
Eli Zaretskii [Sat, 21 Nov 2015 11:30:30 +0000 (13:30 +0200)]
Call 'window-size-change-functions' for mini-windows

* src/window.c (grow_mini_window, shrink_mini_window): Set the
frame's 'window_sizes_changed' flag.
* src/xdisp.c (redisplay_internal): Call the hooks on
'window-size-change-functions' if the call to 'echo_area_display'
sets the frame's 'window_sizes_changed' flag.
(syms_of_xdisp) <window-size-change-functions>:
Update doc string to indicate the mini-window resizes trigger a
call to the hooks, and don't promise that will happen "before
redisplay".  (Bug#19576, Bug#21333)

* doc/lispref/windows.texi (Window Hooks): Update the description
of 'window-size-change-functions'.

8 years agoImprove documentation of dynamic modules
Eli Zaretskii [Sat, 21 Nov 2015 10:49:57 +0000 (12:49 +0200)]
Improve documentation of dynamic modules

* src/fns.c (Frequire): Doc fix to include the dynamic module
support.
* src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
dynamic module support.
(Fload): Treat the module suffix the same as '*.el' and '*.elc'
wrt the MUST-SUFFIX argument.

* etc/NEWS: Expand documentation of dynamically loaded modules.

8 years agoInitial documentation for dynamic modules
Philipp Stephani [Sat, 21 Nov 2015 09:47:32 +0000 (11:47 +0200)]
Initial documentation for dynamic modules

* etc/NEWS: Mention the new support for dynamically loaded modules.

Copyright-paperwork-exempt: yes

8 years agoAdd xref--etags-backend to xref-backing-functions using add-hook
Dmitry Gutov [Fri, 20 Nov 2015 23:57:00 +0000 (01:57 +0200)]
Add xref--etags-backend to xref-backing-functions using add-hook

* lisp/progmodes/xref.el (xref-backend-functions): Move the
default value into a separate `add-hook' call (bug#21964).

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
Don't declare the xref-backend-functions variable.
It doesn't make any difference.

8 years agoFix double-decrement bug when freeing global refs
Paul Eggert [Fri, 20 Nov 2015 21:48:54 +0000 (13:48 -0800)]
Fix double-decrement bug when freeing global refs

* src/emacs-module.c (module_free_global_ref): Add a FIXME
comment about error reporting.  Fix a recently-introduced typo
that double-decremented the refcount.

8 years agoDeclare emacs_module_init in the module API
Paul Eggert [Fri, 20 Nov 2015 20:20:26 +0000 (12:20 -0800)]
Declare emacs_module_init in the module API

* src/emacs-module.h (emacs_module_init): New decl.
Without it, GCC might complain about a module that defines
emacs_module_init without using it.  This also checks the
API better.

8 years agoFix module test to use ptrdiff_t nargs too
Paul Eggert [Fri, 20 Nov 2015 20:17:55 +0000 (12:17 -0800)]
Fix module test to use ptrdiff_t nargs too

* modules/mod-test/mod-test.c (Fmod_test_return_t)
(Fmod_test_sum, Fmod_test_signal, Fmod_test_throw)
(Fmod_test_non_local_exit_funcall, Fmod_test_globref_make)
(Fmod_test_string_a_to_b, Fmod_test_userptr_make)
(Fmod_test_userptr_get, Fmod_test_vector_fill)
(Fmod_test_vector_eq): Arg counts are ptrdiff_t, not int.
(finalizer): Remove; no longer used.

8 years agoFix reindent-introduced typo in module code
Paul Eggert [Fri, 20 Nov 2015 20:15:22 +0000 (12:15 -0800)]
Fix reindent-introduced typo in module code

* src/emacs-module.c (MODULE_SETJMP_1): Fix typo that I
introduced while reindenting the code earlier, and add a
comment explaining the unusual use of do-while here.

8 years agoFixed bug#19576: `write-file' saves wrong buffer.
Anders Lindgren [Fri, 20 Nov 2015 20:07:29 +0000 (21:07 +0100)]
Fixed bug#19576: `write-file' saves wrong buffer.

If a function on the hook `window-size-change-functions' doesn't
restore the current buffer, functions that save and restore the
current window configuration (like `y-or-no-p') could silently
change the current buffer.  When `write-file' asked the user
confirmation to overwrite a file, `y-or-no-p' changed the current
buffer, and the wrong buffer was saved to the file.

* lisp/follow.el (follow-windows-start-end): Call `select-frame'
using the `norecord' parameter.
(follow-window-size-change): Restore current buffer. Call
`select-frame' using the `norecord' parameter. Cleanup.

8 years agoCorrect a documentation error in frames.texi
John Wiegley [Fri, 20 Nov 2015 19:24:21 +0000 (11:24 -0800)]
Correct a documentation error in frames.texi

8 years ago* lisp/cedet/mode-local.el: Delete obsolete comment
Stephen Leake [Fri, 20 Nov 2015 18:27:31 +0000 (12:27 -0600)]
* lisp/cedet/mode-local.el: Delete obsolete comment

8 years agoModule function arg counts are ptrdiff_t, not int
Paul Eggert [Fri, 20 Nov 2015 16:51:13 +0000 (08:51 -0800)]
Module function arg counts are ptrdiff_t, not int

* src/emacs-module.c (struct module_fun_env)
(module_make_function, module_funcall, Fmodule_call):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
Use ptrdiff_t, not int, for arg counts.
* src/emacs-module.c (module_make_function): Don’t bother
checking arity against MOST_POSITIVE_FIXNUM, as that’s
unnecessary here.  Make the checking clearer by negating it.
(module_make_function, Fmodule_call): No need to use xzalloc
since the storage doesn’t need to be cleared.
(module_funcall): Don’t use VLA, since C11 doesn’t guarantee support
for it, and many implementations are buggy with large VLAs anyway.
Use SAFE_ALLOCA_LISP instead.
(module_vec_set): Don’t crash if i < 0.
(module_vec_get): Don’t crash if i < MOST_NEGATIVE_FIXNUM.
(module_vec_set, module_vec_get): Do fixnum checks only when
i is out of array bounds, for efficiency in the usual case.
(Fmodule_load): Simplify fixnum range check.
(Fmodule_call): Simplify arity check.  Use xnmalloc to detect
integer overflow in array allocation size.

8 years agoMinor improvements in module test
Eli Zaretskii [Fri, 20 Nov 2015 11:37:25 +0000 (13:37 +0200)]
Minor improvements in module test

* modules/mod-test/mod-test.c: Include stdlib.h, to avoid warnings
about missing prototype of malloc.
* modules/mod-test/Makefile (CFLAGS): Add -std=gnu99, to avoid
compiler warnings.

8 years agoImprove MS-Windows implementation in dynlib.c
Eli Zaretskii [Fri, 20 Nov 2015 11:34:15 +0000 (13:34 +0200)]
Improve MS-Windows implementation in dynlib.c

* src/dynlib.c [WINDOWSNT]: Include errno.h, lisp.h, and w32.h.
No need to include windows.h, as w32.h already does that.
<dynlib_last_err>: New static variable.
(dynlib_reset_last_error): New function.
(dynlib_open): Convert forward slashes to backslashes.  Convert
file names from UTF-8 to either UTF-16 or the current ANSI
codepage, and call either LoadLibraryW or LoadLibraryA.  If the
argument is NULL, return a handle to the main module, like
'dlopen' does.  Record the error, if any, for use by dynlib_error.
(dynlib_sym): Check the handle for validity. Record the error, if
any, for use by dynlib_error.
(dynlib_error): Call w32_strerror to produce the error string, and
zero out the last error code, like dlerror does.
(dynlib_close): Check the handle for validity.  Record the error,
if any, for use by dynlib_error.  Don't call FreeLibrary with a
handle for the main module.
* src/w32.c (globals_of_w32): Call dynlib_reset_last_error.

8 years ago; Update the description of Windows 10 pinned icon issue
Eli Zaretskii [Fri, 20 Nov 2015 09:08:40 +0000 (11:08 +0200)]
; Update the description of Windows 10 pinned icon issue

* etc/PROBLEMS: Mention that the issue was fixed in later
Windows 10 builds.

8 years agoInclude-file tweaks for modules
Paul Eggert [Fri, 20 Nov 2015 08:40:45 +0000 (00:40 -0800)]
Include-file tweaks for modules

* src/dynlib.c, src/emacs-module.c: Include <config.h> first.
* src/dynlib.h: Do not include config.h.
It’s every .c file’s responsibility to include config.h first.
* src/emacs-module.c: Include emacs-module.h immediately after
config.h, to test that emacs-module.h doesn’t depend on
include files other than config.h.

8 years agoSimplify push_handler and profile its malloc
Paul Eggert [Fri, 20 Nov 2015 04:09:11 +0000 (20:09 -0800)]
Simplify push_handler and profile its malloc

* src/lisp.h (PUSH_HANDLER): Remove.
All callers changed to use push_handler directly.
* src/eval.c (internal_condition_case)
(internal_condition_case_1, internal_condition_case_2)
(internal_condition_case_n):
Use same pattern as for other invokers of push_handler.
(push_handler, push_handler_nosignal): Use call-by-value
instead of call-by-reference.  All uses changed.
(push_handler): Simplify by rewriting in terms of
push_handler_nosignal.
(push_handler_nosignal): Profile any newly allocated memory.

8 years ago* src/emacs-module.h: Include stddef.h, not stdlib.h.
Paul Eggert [Fri, 20 Nov 2015 00:00:18 +0000 (16:00 -0800)]
* src/emacs-module.h: Include stddef.h, not stdlib.h.

8 years agoDiscover repository version in linked worktrees (bug#21930)
Juanma Barranquero [Thu, 19 Nov 2015 20:32:43 +0000 (21:32 +0100)]
Discover repository version in linked worktrees (bug#21930)

* lisp/version.el (emacs-repository--version-git-1): Do not assume
HEAD is at .git/HEAD, it can also be at .git/worktrees/<branch>/HEAD.
(emacs-repository-get-version): Grok linked worktrees when EXTERNAL
is nil too.

8 years ago* lisp/replace.el (occur-regexp-descr): New function.
Juri Linkov [Fri, 20 Nov 2015 00:00:48 +0000 (02:00 +0200)]
* lisp/replace.el (occur-regexp-descr): New function.
(occur-1, occur-engine): Use it.

* lisp/isearch.el (isearch-occur): Propertize regexp with
isearch-string and isearch-regexp-function-descr for
occur-regexp-descr to display the correct description
message in the header (bug#21176, bug#21180).

8 years agoRevert `open-line' electric-indent sensitivity
Karl Fogel [Thu, 19 Nov 2015 23:32:37 +0000 (17:32 -0600)]
Revert `open-line' electric-indent sensitivity

* lisp/simple.el (open-line): Remove electric indent code.
  (electric-indent-just-newline): Don't declare.

* test/automated/simple-test.el (open-line-indent): Adjust test.

This partly reverts Artur Malabarba's change that added electric
indent sensitivity to `open-line' (Oct 24 22:26:27 2015 +0100, git
commit bd4f04f86), and adjusts a new test he added right afterwards
(Sat Oct 24 23:43:06 2015 +0100, git commit 207f235e3) accordingly.
However, the new INTERACTIVE argument to `open-line', which he also
added in the first commit, is not reverted here.

See the thread "Questioning the new behavior of `open-line'." on the
Emacs Devel mailing list, and in particular this message:

  From: Artur Malabarba
  Subject: Re: Questioning the new behavior of `open-line'.
  To: Karl Fogel
Cc: David Kastrup, Pierpaolo Bernardi, emacs-devel
  Date: Wed, 18 Nov 2015 21:03:58 +0000
  Message-ID: \
    <CAAdUY-KN06pvCMy5bt3+Buk3yeKjf6n9iB2FaSTTOPpCqPwyhA@mail.gmail.com>

  https://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01707.html

8 years agoOmit unnecessary clear in Fmodule_load
Paul Eggert [Thu, 19 Nov 2015 23:24:30 +0000 (15:24 -0800)]
Omit unnecessary clear in Fmodule_load

* src/emacs-module.c (Fmodule_load):
Simplify and avoid unnecessary initialization of priv member to 0.

* src/emacs-module.c: (module_vec_set, module_vec_get, module_vec_size)

8 years agoPrefer signed integer types in module code
Paul Eggert [Thu, 19 Nov 2015 23:01:26 +0000 (15:01 -0800)]
Prefer signed integer types in module code

Generally speaking, at the C level the Emacs source code prefers
signed types like ‘ptrdiff_t’ to unsigned types like ‘size_t’,
partly to avoid the usual signedness confusion when comparing values.
Change the module API to follow this convention.
Use ‘int’ for small values that can’t exceed INT_MAX.
* modules/mod-test/mod-test.c (Fmod_test_globref_make)
(Fmod_test_string_a_to_b, Fmod_test_vector_fill)
(Fmod_test_vector_eq):
* src/emacs-module.c (struct emacs_value_frame)
(module_make_global_ref, module_free_global_ref)
(module_copy_string_contents, module_make_string)
(module_vec_set, module_vec_get, module_vec_size):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
* src/lread.c (suffix_p):
Prefer signed to unsigned integer types.

8 years agoOmit ‘const’ on locals
Paul Eggert [Thu, 19 Nov 2015 22:24:50 +0000 (14:24 -0800)]
Omit ‘const’ on locals

Remove ‘const’ qualifier from locals that were newly added.
We don’t normally bother declaring locals with ‘const’ even
though they are not modified, for the same reason we don’t
bother declaring them with ‘register’ even though their
addresses are not taken; the advantage in compile-time
checking isn’t worth the loss of readability.
* modules/mod-test/mod-test.c (Fmod_test_non_local_exit_funcall)
(Fmod_test_vector_fill, Fmod_test_vector_eq):
* src/emacs-module.c (MODULE_SETJMP_1)
(module_make_global_ref, module_free_global_ref)
(module_non_local_exit_get, module_make_function)
(module_extract_integer, module_extract_float)
(module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_get, Fmodule_call)
(module_non_local_exit_signal_1)
(module_non_local_exit_throw_1, lisp_to_value)
(finalize_storage, allocate_emacs_value, mark_modules)
(module_handle_signal, module_handle_throw)
(module_format_fun_env):
* src/eval.c (push_handler, push_handler_nosignal)
(init_handler):
* src/lread.c (suffix_p):
Omit unnecessary ‘const’.

8 years agoPrefer intmax_t to int64_t in module code
Paul Eggert [Thu, 19 Nov 2015 22:03:29 +0000 (14:03 -0800)]
Prefer intmax_t to int64_t in module code

* modules/mod-test/mod-test.c (sum, Fmod_test_sum):
* src/emacs-module.c (module_extract_integer)
(module_make_integer):
* src/emacs-module.h (struct emacs_env_25):
Prefer intmax_t to int64_t.  This doesn’t change the generated
code on any of the machines Emacs currently ports to, but it’s
at least in theory more future-proof as C99 doesn’t guarantee
that int64_t exists.

8 years agoRename module.c to emacs-module.c, etc.
Paul Eggert [Thu, 19 Nov 2015 21:50:23 +0000 (13:50 -0800)]
Rename module.c to emacs-module.c, etc.

* src/emacs-module.c: Rename from src/module.c.
* src/emacs-module.h: Rename from src/module.h.
All uses changed.

8 years agoFix minor module problems found by static checking
Paul Eggert [Thu, 19 Nov 2015 19:49:27 +0000 (11:49 -0800)]
Fix minor module problems found by static checking

* src/dynlib.c (dynlib_close): #ifdef out for now, as it’s not used.
* src/eval.c, src/lisp.h (lisp_eval_depth): Now static.
* src/module.c (Fmodule_load): Fix pointer signedness bug.
(Fmodule_call): Tell GCC that the default case is unreachable.

8 years agoStyle fixes for indenting etc. in module code
Paul Eggert [Thu, 19 Nov 2015 19:31:45 +0000 (11:31 -0800)]
Style fixes for indenting etc. in module code

This is mostly indenting and spacing changes.  Also, remove
some unnecessary static decls instead of bothering to reindent them.
* src/module.h (EMACS_EXTERN_C_BEGIN): Remove, and do this inline,
as most other Emacs files do for this sort of thing.

8 years agoMinor improvements in modules testing Makefile
Eli Zaretskii [Thu, 19 Nov 2015 17:49:29 +0000 (19:49 +0200)]
Minor improvements in modules testing Makefile

* modules/mod-test/Makefile (EMACS, SO): New variables.
(CFLAGS): When SO = dll, don't use -fPIC.
(check): New target, runs the test.

8 years ago* .gitignore: Add "*.dll".
Eli Zaretskii [Thu, 19 Nov 2015 17:21:50 +0000 (19:21 +0200)]
* .gitignore: Add "*.dll".

8 years agoMigrate modules/.gitignore into .gitignore
Paul Eggert [Thu, 19 Nov 2015 16:21:10 +0000 (08:21 -0800)]
Migrate modules/.gitignore into .gitignore

* .gitignore: Add former contents of modules/.gitignore.
* modules/.gitignore: Remove.

8 years agoAdd copyright notices to module code
Paul Eggert [Thu, 19 Nov 2015 16:14:00 +0000 (08:14 -0800)]
Add copyright notices to module code

Put them in the usual format for GNU Emacs copyright notices.

8 years agoRename emacs_module.h to module.h
Paul Eggert [Thu, 19 Nov 2015 15:53:51 +0000 (07:53 -0800)]
Rename emacs_module.h to module.h

* src/module.h: Rename from src/emacs_module.h.
All uses changed.

8 years ago* src/module.c (Fmodule_load): Remove unused vars `doc_name', `args'
Juanma Barranquero [Thu, 19 Nov 2015 10:07:10 +0000 (11:07 +0100)]
* src/module.c (Fmodule_load): Remove unused vars `doc_name', `args'

8 years ago* src/lread.c (Fload): Remove unused variable `size'
Juanma Barranquero [Thu, 19 Nov 2015 10:02:38 +0000 (11:02 +0100)]
* src/lread.c (Fload): Remove unused variable `size'

8 years agosrc/keyboard.c (pre-command-hook): Fix typo in doc string: "pre" -> "post".
Alan Mackenzie [Thu, 19 Nov 2015 09:38:48 +0000 (09:38 +0000)]
src/keyboard.c (pre-command-hook): Fix typo in doc string: "pre" -> "post".

8 years agoPrioritize looking inside vc-parent-buffer over log-view-mode fallback
Dmitry Gutov [Thu, 19 Nov 2015 01:37:55 +0000 (03:37 +0200)]
Prioritize looking inside vc-parent-buffer over log-view-mode fallback

* lisp/vc/vc.el (vc-deduce-fileset): Prioritize looking inside
vc-parent-buffer over log-view-mode fallback (bug#21955).

8 years ago* configure.ac (LIBMODULES): Don’t define on Cygwin
Ken Brown [Wed, 18 Nov 2015 20:17:58 +0000 (15:17 -0500)]
* configure.ac (LIBMODULES): Don’t define on Cygwin

8 years agoFix MS-Windows build --with-modules
Eli Zaretskii [Wed, 18 Nov 2015 20:09:08 +0000 (22:09 +0200)]
Fix MS-Windows build --with-modules

* src/module.c: Reformat copyright commentary.
(module_vec_get): Use explicit cast to size_t to avoid compiler
warning in 32-bit builds.
(check_main_thread) [WINDOWSNT]: Fix letter-case in Windows APIs.
Compare thread IDs directly, as GetThreadId is not available
before Windows Vista.
(check_main_thread) [WINDOWSNT]: Duplicate the thread handle
without using APIs and constants not available on XP and older
systems.  Obtain and store the thread ID as well.

8 years ago; * admin/release-process: Minor copyedits and additions.
Eli Zaretskii [Wed, 18 Nov 2015 19:33:12 +0000 (21:33 +0200)]
; * admin/release-process: Minor copyedits and additions.

8 years agoAdd dynamic module test and helper script
Aurélien Aptel [Mon, 16 Nov 2015 00:00:25 +0000 (01:00 +0100)]
Add dynamic module test and helper script

Add 'modhelp.py' script (python2) to automate module testing and
module generation.

To build and test all modules in the modules/ dir
  $ ./modhelp.py test

To generate a module from template code (good starting point)
  $ ./modhelp init mynewtestmodule

See the script -h option for more documentation.

* modules/modhelp.py: New module helper script.
* modules/mod-test/Makefile: New file. Makefile for the test module.
* modules/mod-test/mod-test.c: New file. Test module source file.
* modules/mod-test/test.el: New file. ert test suite for the test module.
* modules/.gitignore: New file. Local .gitignore file.

Co-authored-by: Philipp Stephani <phst@google.com>
8 years agoMake 'Fload' look for modules
Aurélien Aptel [Sun, 15 Nov 2015 23:53:15 +0000 (00:53 +0100)]
Make 'Fload' look for modules

'Fload' can now load dynamic modules. This also makes 'require' work.

* src/lread.c:
  (suffix_p): New function.
  (Fload): Use 'suffix_p'.  Call 'Fmodule_load' when we try to load a file
  with a module suffix.
  (syms_of_lread): Append module suffix to 'Vload_suffixes'.

8 years agoAdd dynamic module module support
Aurélien Aptel [Sun, 15 Nov 2015 23:47:04 +0000 (00:47 +0100)]
Add dynamic module module support

* configure.ac: Add '--with-modules' option.  Conditionally add
  dynlib.o and module.o to the list of objects.  Add any system
  specific flags to the linker flags to support dynamic libraries.
* m4/ax_gcc_var_attribute.m4: Add autoconf extension to test gcc
  attributes.
* src/Makefile.in: Conditionally add module objects and linker flags.
* src/alloc.c (garbage_collect_1): protect module local values from
  GC.
* src/lisp.h: Add 'module_init' and 'syms_of_module' prototypes.
* src/emacs_module.h: New header file included by modules.  Public
  module API.
* src/module.c: New module implementation file.

Co-authored-by: Philipp Stephani <phst@google.com>
8 years agoAdd new User Pointer (User_Ptr) type
Aurélien Aptel [Sun, 15 Nov 2015 23:42:14 +0000 (00:42 +0100)]
Add new User Pointer (User_Ptr) type

* src/lisp.h: Add new Lisp_Misc_User_Ptr type.
(XUSER_PTR): New User_Ptr accessor.
* src/alloc.c (make_user_ptr): New function.
(mark_object, sweep_misc): Handle Lisp_Misc_User_Ptr.
* src/data.c (Ftype_of): Return 'user-ptr' for user pointer.
(Fuser-ptrp): New user pointer type predicate function.
(syms_of_data): New 'user-ptrp', 'user-ptr' symbol.  New 'user-ptrp'
subr.
* src/print.c (print_object): Add printer for User_Ptr type.

8 years agoAdd portable layer for dynamic loading
Aurélien Aptel [Sun, 15 Nov 2015 23:36:35 +0000 (00:36 +0100)]
Add portable layer for dynamic loading

* src/dynlib.h: New file.
* src/dynlib.c: New file.

Co-authored-by: Philipp Stephani <phst@google.com>
8 years agoAdd catch-all & no-signal version of PUSH_HANDLER
Philipp Stephani [Sun, 15 Nov 2015 23:31:56 +0000 (00:31 +0100)]
Add catch-all & no-signal version of PUSH_HANDLER

Ground work for modules. Add a non-signaling version of PUSH_HANDLER and
a new "catch-all" handler type.

* src/eval.c (init_handler, push_handler, push_handler_nosignal): New
  functions.
* src/fns.c (hash_remove_from_table): Expose function public.
* src/lisp.h: New handler type, define macro to push_handler call.

8 years ago; * lisp/server.el (server-process-filter): Simplify last change
Ken Brown [Wed, 18 Nov 2015 19:16:40 +0000 (14:16 -0500)]
; * lisp/server.el (server-process-filter): Simplify last change

8 years agoSilence byte-compiler warning
Ken Brown [Wed, 18 Nov 2015 18:34:47 +0000 (13:34 -0500)]
Silence byte-compiler warning

* lisp/server.el (server-process-filter): Silence byte-compiler
warning.

8 years agoQuote symbols in docstrings using `'
Paul Eggert [Wed, 18 Nov 2015 17:17:20 +0000 (09:17 -0800)]
Quote symbols in docstrings using `'

Be more systematic about quoting symbols `like-this' rather than
`like-this or 'like-this' in docstrings.  This follows up Artur
Malabarba's email in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01647.html

8 years agoFix savegames in dunnet
Peder O. Klingenberg [Tue, 17 Nov 2015 20:47:27 +0000 (21:47 +0100)]
Fix savegames in dunnet

* lisp/play/dunnet.el (dun-rot13): Use the standard rot13-region instead
  of separate implementation.

8 years ago* lisp/emacs-lisp/package.el (package--with-response-buffer):
Artur Malabarba [Wed, 18 Nov 2015 10:28:02 +0000 (10:28 +0000)]
* lisp/emacs-lisp/package.el (package--with-response-buffer):

Ensure we're at the start of the buffer before searching for
the end of headers.

8 years ago* admin/release-process: Improve wording.
Xue Fuqiao [Wed, 18 Nov 2015 00:56:50 +0000 (08:56 +0800)]
* admin/release-process: Improve wording.

8 years agoBackport: * CONTRIBUTE: Remove information about feature freeze.
Xue Fuqiao [Sun, 15 Nov 2015 02:05:17 +0000 (10:05 +0800)]
Backport: * CONTRIBUTE: Remove information about feature freeze.

(cherry picked from commit ae0653b5ab9ee223751ec389b87011963e1cbbef)

8 years agoBackport: Document the release process
Xue Fuqiao [Sun, 15 Nov 2015 01:35:50 +0000 (09:35 +0800)]
Backport: Document the release process

* admin/notes/versioning: Add information about RC releases.
* admin/release-process: Document the release process.
* admin/authors.el (authors-ignored-files):
* admin/README: Change FOR-RELEASE to release-process.
* CONTRIBUTE:
* admin/notes/bugtracker: Don't mention FOR-RELEASE.

(cherry picked from commit 9a4aa0f5945a03611ae29c516025dbd353bd26ab)

8 years agoBackport: * admin/release-process: Rename from admin/FOR-RELEASE.
Xue Fuqiao [Sun, 15 Nov 2015 01:32:12 +0000 (09:32 +0800)]
Backport: * admin/release-process: Rename from admin/FOR-RELEASE.

(cherry picked from commit f8cc14b59700e51a4e31139c0a65c8154995e055)

8 years agoBackport: Mention CONTRIBUTE in README
Xue Fuqiao [Sat, 14 Nov 2015 04:49:17 +0000 (12:49 +0800)]
Backport: Mention CONTRIBUTE in README

Mention CONTRIBUTE in README, since it was moved from etc/ to root.
* etc/TODO: Remove the reference to `etc/CONTRIBUTE'.
* README: Mention CONTRIBUTE.

(cherry picked from commit ed2e7e20ae0945288c98091f308f5460c3453873)

8 years agoFix docstring quoting problems with ‘ '’
Paul Eggert [Tue, 17 Nov 2015 23:28:50 +0000 (15:28 -0800)]
Fix docstring quoting problems with ‘ '’

Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes.  The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.

8 years agoImprove configure --help text for wide ints
Eli Zaretskii [Tue, 17 Nov 2015 19:07:37 +0000 (21:07 +0200)]
Improve configure --help text for wide ints

* configure.ac (wide-int): Clarify user-level advantages and
disadvantages.

8 years agoImprove doc string
Stephen Leake [Tue, 17 Nov 2015 13:46:11 +0000 (07:46 -0600)]
Improve doc string

* lisp/progmodes/xref.el (xref-backend-references): Improve doc string.

8 years agoeval_sub followed dangling pointer when debugging
Paul Eggert [Tue, 17 Nov 2015 07:08:54 +0000 (23:08 -0800)]
eval_sub followed dangling pointer when debugging

Problem reported by Pip Cet (Bug#21245).
This bug could occur in eval_sub if the C compiler reused
storage associated with the ‘argvals’ local after ‘argvals’
went out of scope, and if the Elisp debugger stopped on Elisp
function exit and accessed ‘argvals’.  It could also occur if
a variadic function was called with so many arguments (over
2048 args on x86-64) that SAFE_ALLOCA_LISP called malloc, then
SAFE_FREE freed the arguments, then the memory manager used
the storage for other purposes, then the debugger accessed the
arguments.
* src/eval.c (eval_sub): Declare ‘argvals’ at top level of
function body. Simplify local decls.
When allocating args via SAFE_ALLOCA, call
debugger before invoking SAFE_FREE, as the debugger needs
access to the args.
(eval_sub, apply_lambda): Rework to avoid need for
set_backtrace_debug_on_exit hack.  This is cleaner,
and should work better with buggy custom debuggers.

8 years ago* lisp/image-mode.el: Support encrypted file
Daiki Ueno [Tue, 17 Nov 2015 02:27:51 +0000 (11:27 +0900)]
* lisp/image-mode.el: Support encrypted file

(image-toggle-display-image): Read content from the buffer instead
of the file, if the buffer holds a decrypted data.  (Bug#21870)

8 years agoELF unexec: align section header
Paul Eggert [Tue, 17 Nov 2015 01:48:08 +0000 (17:48 -0800)]
ELF unexec: align section header

This ports the recent unexelf.c changes to Fedora x86-64
when configured with GCC’s -fsanitize=undefined option.
* src/unexelf.c (unexec): Align new_data2_size to a multiple
of ElfW (Shdr)’s alignment, so that NEW_SECTION_H returns a
pointer aligned appropriately for its type.

8 years ago; lisp/window.el (display-buffer-at-bottom): Fix indentation
Juanma Barranquero [Tue, 17 Nov 2015 01:02:07 +0000 (02:02 +0100)]
; lisp/window.el (display-buffer-at-bottom): Fix indentation

8 years agoDo more checks on bytecode objects (Bug#21929)
Andreas Schwab [Mon, 16 Nov 2015 22:47:17 +0000 (23:47 +0100)]
Do more checks on bytecode objects (Bug#21929)

* src/eval.c (funcall_lambda): Check size of compiled function
object.
(Ffetch_bytecode): Likewise.

8 years agopcase.el: Fix edebugging of backquoted cons patterns
Johan Bockgård [Sun, 15 Nov 2015 23:07:06 +0000 (00:07 +0100)]
pcase.el: Fix edebugging of backquoted cons patterns

* lisp/emacs-lisp/pcase.el (pcase-QPAT): Fix edebugging of backquoted
cons patterns. (Bug#21920)

8 years agoImprove fix for regex reentrancy abort
Paul Eggert [Mon, 16 Nov 2015 21:09:46 +0000 (13:09 -0800)]
Improve fix for regex reentrancy abort

Suggested by Stefan Monnier (Bug#21688).
* src/syntax.c (update_syntax_table_forward):
Remove recently-added PROPERTIZE arg, and assume it is true.
All callers changed.
* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
Invoke update_syntax_table directly.

8 years ago; Fix breakage in elisp-mode-tests.el
Dmitry Gutov [Mon, 16 Nov 2015 17:15:28 +0000 (19:15 +0200)]
; Fix breakage in elisp-mode-tests.el

8 years ago* lisp/faces.el (faces--attribute-at-point): Use `face-list-p'
Artur Malabarba [Mon, 16 Nov 2015 14:35:31 +0000 (14:35 +0000)]
* lisp/faces.el (faces--attribute-at-point): Use `face-list-p'

8 years ago* lisp/emacs-lisp/package.el (package--with-response-buffer): Missing require
Artur Malabarba [Mon, 16 Nov 2015 13:53:45 +0000 (13:53 +0000)]
* lisp/emacs-lisp/package.el (package--with-response-buffer): Missing require

8 years ago* lisp/emacs-lisp/nadvice.el (add-function): Escape quote
Artur Malabarba [Mon, 16 Nov 2015 09:49:00 +0000 (09:49 +0000)]
* lisp/emacs-lisp/nadvice.el (add-function): Escape quote

8 years agoRecognize .rbw and .pyw files (bug#18753)
Vasily Korytov [Sun, 15 Nov 2015 23:32:01 +0000 (01:32 +0200)]
Recognize .rbw and .pyw files (bug#18753)

* lisp/progmodes/python.el (auto-mode-alist):
Recognize .pyw files.

* lisp/progmodes/ruby-mode.el (auto-mode-alist):
Recognize .rbw files.

8 years agoFix ruby-mode auto-mode-alist entry
Dmitry Gutov [Sun, 15 Nov 2015 23:14:54 +0000 (01:14 +0200)]
Fix ruby-mode auto-mode-alist entry

* lisp/progmodes/ruby-mode.el (auto-mode-alist): Add grouping
around the extensions (bug#21257).

8 years agoFix etags completion near eob
Dmitry Gutov [Sun, 15 Nov 2015 22:30:12 +0000 (00:30 +0200)]
Fix etags completion near eob

* lisp/progmodes/etags.el (tags-completion-at-point-function):
Use `goto-char', to avoid the end-of-buffer error (bug#20061).

8 years agoDe-pessimize detection of C++ member initialization lists.
Alan Mackenzie [Sun, 15 Nov 2015 21:59:40 +0000 (21:59 +0000)]
De-pessimize detection of C++ member initialization lists.

list/progmodes/cc-engine.el (c-back-over-list-of-member-inits): New macro.
(c-back-over-member-initializers): Reformulate such that c-at-toplevel-p
is only called when a construct "looks right" rather than continually.
(c-guess-basic-syntax, CASE 5R): Add a check for the mode being C++ Mode.