1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 08:51:45 -08:00
Commit graph

126670 commits

Author SHA1 Message Date
Paul Eggert
b76885f1da Merge from origin/emacs-25
26d4da0 New input method "probhat" for Bengali
4f445bf ; Spelling fix
f403f03 ; Fix typo
2016-08-05 14:05:09 -07:00
Paul Eggert
92e5b41c7c Spelling and minor grammar fixes
* test/file-organization.org: Rename from test/file-organisation.org.
2016-08-05 13:35:13 -07:00
Alan Mackenzie
6a9d967048 Widen in certain low level CC Mode functions. This fixes bug #24148.
* lisp/progmodes/cc-engine (c-state-semi-pp-to-literal)
(c-state-full-pp-to-literal): Widen around the functionality.
(c-parse-ps-state-below): Correct the order of save-excursion and
save-restriction.
2016-08-04 21:07:52 +00:00
Stefan Monnier
847140163a Fix Bug#24149
* lisp/subr.el (set-transient-map): Don't wait if MAP not present in
overriding-terminal-local-map.  (Bug#24149)
2016-08-04 23:42:07 +08:00
Paul Eggert
7f9721d399 Update from gnulib
This incorporates:
2016-07-03 mktime: call tzset as per POSIX
* doc/misc/texinfo.tex, lib/mktime.c, m4/mktime.m4:
Copy from gnulib.
2016-08-03 15:12:06 -07:00
Paul Eggert
967e2ef61d Fix GnuTLS includes
* src/gnutls.c [HAVE_GNUTLS]: Don’t include gnutls/gnutls.h
a second time; although it doesn’t hurt, it’s not needed.
* src/sysdep.c [!HAVE_GNUTLS]: Don’t include gnutls/crypto.h,
as it may not be available.  Problem reported by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00100.html
2016-08-03 14:21:21 -07:00
Michal Nazarewicz
9a68740d96 Fix accessing regex-resources in out-of-tree test runs in regex-tests
[82a487d: Fix reading of regex-resources in regex-tests] attempted to
fix regex-tests failing when run from the source tree (i.e. via make)
by hard-coding path to regex-resources directory relative to the test
directory.

This fixed runs from the tree but broke the test when run using other
methods.

Fix by trying ‘load-file-name’ or ‘buffer-file-name’, whichever is set.

* test/src/regex-tests.el (regex-tests--resources-dir): New variable
storing path to the regex-resources directory.
(regex-tests-generic-line): Use aforementioned variable.
2016-08-03 14:44:29 +02:00
Paul Eggert
f0b5d4bd3e Simplify by assuming GnuTLS 2.12.2 or later
* src/gnutls.c (gnutls_certificate_details):
* src/sysdep.c: Assume GnuTLS 2.12.2 or later.
2016-08-03 08:02:31 -04:00
Paul Eggert
744cc9fa17 Port to systems lacking GNUTLS_NONBLOCK
Problem reported by Colin Baxter in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00096.html
* src/gnutls.c (Fgnutls_boot): Don’t assume GNUTLS_NONBLOCK is defined.
2016-08-03 07:46:30 -04:00
Paul Eggert
1a8d311236 Fix non-blocking GnuTLS with slow connection
Although the problem is reported for OS X (Bug#23982), it seems to
be possible on other POSIXish platforms.
* src/gnutls.c (emacs_gnutls_nonblock_errno) [!WINDOWSNT]:
New function.
(emacs_gnutls_handshake) [!WINDOWSNT]:
Use it as the errno function, if non-blocking.
(Fgnutls_boot): Use GNUTLS_NONBLOCK if non-blocking.
2016-08-03 01:55:49 -07:00
Paul Eggert
64edd14ca9 Require GnuTLS 2.12.2 or later
* configure.ac, etc/NEWS: Require GnuTLS 2.12.2 or later,
instead of merely 2.6.6 or later (Bug#23982#20).
* src/gnutls.c (init_gnutls_functions, emacs_gnutls_handshake)
[WINDOWSNT]: Don’t bother with gnutls_check_version or
gnutls_transport_set_lowat, as they are no longer needed now that
we require gnutls 2.12.2 or later.
2016-08-03 01:55:49 -07:00
Stefan Monnier
5f0b1c307a * src/window.c (sanitize_window_sizes): Remove unused arg `frame'
* src/window.h (sanitize_window_sizes): Adjust prototype.
* src/frame.c (adjust_frame_size): Adjust calls.
2016-08-02 22:43:11 -04:00
Paul Eggert
d98f783426 Fix (mapcar F S) crash when F alters S’s length
* src/fns.c (mapcar1): Return number of elements computed,
which can be less than LENI if the function alters the list.
All callers changed.  (Bug#24118)
2016-08-02 21:06:02 -04:00
Paul Eggert
07e9281f7a Port window changes to --enable-gcc-warnings
* src/window.c (sanitize_window_sizes): Return void.
This pacifies GCC, and no caller uses the return value anyway.
2016-08-02 20:47:37 -04:00
Stefan Monnier
49e0c276b2 * src/window.c: Fix bootstrap failure due to window.el changes
(sanitize_window_sizes): Adjust to new calling convention of
window--sanitize-window-sizes and only call it if defined.
(Fwindow__sanitize_window_sizes): Remove.
(syms_of_window): Don't defsubr it.
2016-08-02 19:45:30 -04:00
Michael Albinus
5083499205 Fix Bug#23883
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
Call `process-actions' with adapted position.  The connection
buffer might have been cleaned up already.  (Bug#23883)
2016-08-02 22:38:03 +02:00
Paul Eggert
0100805af1 Port regex changes to strict ISO C
* src/regex.c (regex_compile): Redo casts.
2016-08-02 16:16:45 -04:00
Stefan Monnier
9d5cd45056 * lisp/window.el: Use lexical-binding
(window--min-size-ignore-p): Remove unused arg `horizontal'.
(window--sanitize-window-sizes): Remove unused arg `frame'.
(window-edges): Remove unused vars left-off and right-off.
(display-buffer-reuse-mode-window): Remove unused var `frame?'.
Avoid extraneous setq and do a bit of CSE.
(fit-frame-to-buffer): Remove unused vars `window', `fit-width',
and `toolbar-extra-height'.
(window-adjust-process-window-size): Remove unused arg `process'.
2016-08-02 15:17:01 -04:00
Michal Nazarewicz
c441f56498 Fix unused lexical variable
This fixes the following warning:

    In toplevel form:
    src/regex-tests.el:416:1:Warning: Unused lexical variable ‘newline’

* test/src/regex-tests.el (regex-tests-BOOST): Remove unused lexical
variable.
2016-08-02 19:53:48 +02:00
Michal Nazarewicz
edd5dd80c8 Remove unused STREQ macro
This fixes the following compilation warning:

    regex.c:516:0: warning: macro "STREQ" is not used [-Wunused-macros]
     #define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
     ^

* src/regex.c (STREQ): Remove unused macro.  It should have been removed
in a [4538a5e: Refactor regex character class parsing in [:name:]]
commit but was mistakenly left out.
2016-08-02 19:52:50 +02:00
Stefan Monnier
d0838f201a * cl-generic.el: Fix problems introduced by new load-history format
* lisp/emacs-lisp/cl-generic.el (cl--generic-load-hist-format): New function.
(cl-generic-define-method, cl--generic-describe): Use it.
(cl--generic-search-method): Adjust for new format.

* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
* test/lisp/progmodes/elisp-mode-tests.el:
Use cl--generic-load-hist-format rather than hard-coding cl-generic's
internal format.
2016-08-02 13:01:26 -04:00
Michal Nazarewicz
54a3c0c98f Hardcode regex syntax to remove dead code handling different syntax
Emacs only ever uses its own regex syntax so support for other syntaxes
is never used.  Hardcode the syntax so that the compilar can detect such
dead code and remove it from compiled code.

The only exception is RE_NO_POSIX_BACKTRACKING which can be separatelly
specified.  Handle this separatelly with a function argument (replacing
now unnecessary syntax argument).

With this patchset, size of Emacs binary on x86_64 machine is reduced by
around 60 kB:

	new-sizes:-rwx------ 3 mpn eng 30254720 Jul 27 23:31 src/emacs
	old-sizes:-rwx------ 3 mpn eng 30314828 Jul 27 23:29 src/emacs

* src/regex.h (re_pattern_buffer): Don’t define syntax field #ifdef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.

* src/regex.c (print_compiled_pattern): Don’t print syntax #ifdef emacs.
(regex_compile): #ifdef emacs, replace syntax argument with
posix_backtracking which is now used instead of testing for
RE_NO_POSIX_BACKTRACKING syntax.
(re_match_2_internal): Don’t access bufp->syntax #ifndef emacs.
(re_compile_pattern): Replace syntax with posix_backtracking argument.

* src/search.c (compile_pattern_1): Pass boolean posix_backtracking
instead of syntax to re_compile_pattern.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
da9c55ddbb Get rid of re_set_whitespace_regexp
* src/regex.h (re_set_whitespace_regexp): Delete.
(re_compile_pattern): Add whitespace_regexp argument #ifdef emacs.

* src/regex.c (re_set_whitespace_regexp, whitespace_regexp): Delete.
(regex_compile): Add whitespace_regexp argument #ifdef emacs and wrap
whitespace_regexp-related code in an #ifdef emacs so it’s compiled out
unless building Emacs.
(re_compile_pattern): Pass whitespace_regexp argument to regex_compile

* src/search.c (compile_pattern_1): Don’t use re_set_whitespace_regexp,
pass the regex as argument to re_compile_pattern instead.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
04d96eca08 Get rid of re_set_syntax
Instead of using a global variable for storing regex syntax, pass it
to re_compile_pattern.  This is only enabled when compiling Emacs (i.e.
‘#ifdef emacs’).

* src/regex.h (re_set_syntax): Declare only #ifndef emacs.
(re_compile_pattern): Now takes syntax argument #ifdef emacs.

* src/regex.c (re_syntax_options): Define only #ifndef emacs.
(re_compile_pattern): Use the new syntax argument #ifdef emacs.

* src/search.c (compile_pattern_1): Don’t use re_set_syntax and
instead pass syntax to re_compile_pattern directly.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
9a418e0f98 Remove dead opcodes in regex bytecode
There is no way to specify before_dot and after_dot opcodes in a regex
so code handling those ends up being dead.  Remove it.

* src/regex.c (print_partial_compiled_pattern, regex_compile,
analyze_first, re_match_2_internal): Remove handling and references to
before_dot and after_dot opcodes.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
4538a5e37e Refactor regex character class parsing in [:name:]
re_wctype function is used in three separate places and in all of
those places almost exact code extracting the name from [:name:]
surrounds it.  Furthermore, re_wctype requires a NUL-terminated
string, so the name of the character class is copied to a temporary
buffer.

The code duplication and unnecessary memory copying can be avoided by
pushing the responsibility of parsing the whole [:name:] sequence to
the function.

Furthermore, since now the function has access to the length of the
character class name (since it’s doing the parsing), it can take
advantage of that information in skipping some string comparisons and
using a constant-length memcmp instead of strcmp which needs to take
care of NUL bytes.

* src/regex.c (re_wctype): Delete function.  Replace it with:
(re_wctype_parse): New function which parses a whole [:name:] string
and returns a RECC_* constant or -1 if the string is not of [:name:]
format.
(regex_compile): Use re_wctype_parse.
* src/syntax.c (skip_chars): Use re_wctype_parse.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
e725706131 Split regex glibc test cases into separet tests
* test/src/regex-tests.el (regex-tests): Remove and split into multiple
tests cases.
(regex-tests-glbic-BOOST, regex-tests-glibc-PCRE,
regex-tests-glibc-PTESTS, regex-tests-glibc-TESTS): New test cases split
from ‘regex-tests’.
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
7496844e7d Don’t (require 'cl)
* test/src/regex-test.el: Don’t (require 'cl).
(regex-tests-PCRE): s/loop/cl-loop/
2016-08-02 15:39:10 +02:00
Michal Nazarewicz
82a487d522 Fix reading of regex-resources in regex-tests
* test/src/regex-tests.el (regex-tests-generic-line): Referring to
‘buffer-file-name’ does not work when running the test from command
line, i.e. via make, which results in (wrong-type-argument stringp nil)
failures.  Replace it with hard-coded path.
(regex-tests-BOOST, regex-tests-PCRE, regex-tests-PTESTS-whitelist,
regex-tests-TESTS-whitelist): ‘regex-tests-generic-line’ now  includes
the ‘regex-resources’ path component so the tests don’t need to specify
it explicitly.
2016-08-02 15:39:10 +02:00
Dima Kogan
91d5309195 Added driver for the regex tests
* test/src/regex-tests.el (regex-tests): Test executing glibc tests
cases.

[mina86@mina86.com: merged test with existing file]
2016-08-02 15:39:10 +02:00
Dima Kogan
6db72771cc New regex tests imported from glibc 2.21
* test/src/regex-resources/BOOST.tests:
* test/src/regex-resources/PCRE.tests:
* test/src/regex-resources/PTESTS:
* test/src/regex-resources/TESTS:
New test data files

[mina86@mina86.com: Moved files from test/src/regex/* to test/src/*.]
2016-08-02 15:39:10 +02:00
Paul Eggert
53917616b0 Fix use-after-close in connect_network_socket
* src/process.c (connect_network_socket):
Reverse sense of previous fix.  Problem reported by Ken Brown in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00004.html
2016-08-02 03:31:26 -04:00
Glenn Morris
573dde70a4 * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads):
Respect autoload-timestamps for "actual autoloads are elsewhere" case.
2016-08-01 16:31:57 -04:00
Glenn Morris
9eb80d93a7 ; Auto-commit of loaddefs files. 2016-08-01 06:24:24 -04:00
Stefan Merten
cafb4a391b * lisp/textmodes/rst.el: Major refactoring, minor changes, minor fixes
(rst-Ado, rst-Hdr, rst-Ttl, rst-Stn): Introduce classes
representing reStructuredText section header concepts.
(rst-mode-map, rst-new-preferred-hdr)
(rst-update-section, rst-classify-adornment)
(rst-ttl-at-point, rst-all-ttls-cache)
(rst-hdr-hierarchy-cache, rst-reset-section-caches)
(rst-all-ttls, rst-infer-hdr-hierarchy, rst-hdr-hierarchy)
(rst-all-ttls-with-level, rst-get-previous-hdr)
(rst-adornment-complete-p, rst-next-hdr, rst-adjust)
(rst-adjust-section, rst-promote-region)
(rst-display-hdr-hierarchy, rst-straighten-sections)
(rst-all-stn, rst-remaining-stn, rst-toc-insert)
(rst-toc-insert-node, rst-toc-node, rst-toc)
(rst-forward-section, rst-adornment-level)
(rst-font-lock-handle-adornment-pre-match-form)
(rst-imenu-convert-cell, rst-imenu-create-index): Refactor
using classes.
(rst-compare-adornments, rst-get-adornment-match): Remove
functions now in classes.
(rst-re-alist-def, rst-toc-mode)
(rst-font-lock-extend-region-extend): Minor improvements.
(rst-mode, rst-compile): Use `setq-local'.
(rst-cvs-header, rst-svn-rev, rst-svn-timestamp)
(rst-official-version, rst-official-cvs-rev)
(rst-package-emacs-version-alist): Maintain version tags.
2016-07-31 16:40:46 +02:00
Martin Rudalics
8cbaf34253 Fix calculation of tool bar width reported by `frame-geometry' (Bug#24107)
* src/w32fns.c (Fw32_frame_geometry): Fix calculation of tool
bar width (Bug#24107).  Reindent.
* src/xfns.c (frame_geometry): Fix calculation of tool bar
width on non-GTK builds.
2016-07-30 14:11:12 +02:00
Eli Zaretskii
7d58b02f36 Fix region display while dragging mouse
* lisp/mouse.el (mouse-drag-track): Reset deactivate-mark in the
buffer of the drag event, to allow mark to be set and the region
be shown as we drag the mouse.  (Bug#24030)
2016-07-30 11:32:02 +03:00
Tino Calancha
d81dc05258 Copy just non-empty strings to kill-ring
* lisp/dired.el (dired-copy-filename-as-kill):
Do not change the kill ring when the string is empty (Bug#24103).
2016-07-30 17:26:19 +09:00
Eli Zaretskii
9c542a23a8 Avoid warnings about undo list while decoding
* src/coding.c (coding_restore_undo_list): New function.
(decode_coding_gap, decode_coding_object): Temporarily set the
buffer's undo list to t, to avoid warnings when decoding changes
the buffer many times, e.g. due to post-read-conversion.  Use
coding_restore_undo_list to make sure the undo list is restored.
(Bug#23813)
2016-07-30 11:23:10 +03:00
Noam Postavsky
4a5b6e621c profiler: Add mouse-1 binding for tree expansion
(profiler-report-mode-map): Add mouse-1 binding for
profiler-report-toggle-entry (Bug #13455).
2016-07-28 20:13:51 -04:00
Vincent Belaïche
90ab699c4f Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2016-07-28 18:12:50 +02:00
Vincent Belaïche
41b28dea85 Enable addition of local printers from a mode hook.
* doc/misc/ses.texi (Printer functions): Split the node into 5
sub-nodes + add some extra documentation.
(Various kinds of printer functions): Make an itemisation to
disintguish better the 3 types of printers, give an example of
lambda printer definition.
(Standard printer functions): Add documentation for ses-prin1
printer function.
(Local printer functions): Add documentation for creating
local printers programmatically from a hook.
(Writing a lambda printer function): Add documentation about
anti-stackoverflow precautions to take when you call the
standard printer functions from inside a local printer.

* lisp/ses.el (ses-standard-printer-functions): Add ses-prin1
among standard printer function, and update docstring
accordingly.
(ses-call-printer, ses-export-tab): Call `ses-prin1' instead
of prin1-to-string.
(ses-define-local-printer): Add definition to arguments so
that a local printer can be defined programmatically from a
mode hook.  Make docstring more substantial.  Use completing
read for local printer name input.  Plus some minor
optimization.
(ses-define-if-new-local-printer): New defsubst.
(ses-center, ses-center-span, ses-dashfill)
(ses-dashfill-span, ses-tildefill-span): Allow to pass printer
as an optional argument to superseed column printer/default
spreadsheet printer.
(ses-prin1): New defun.
2016-07-28 17:41:21 +02:00
Ted Zlatanov
ec359399a4
Prompt to save gnus-cloud-method.
Since `gnus-cloud-method' is a defcustom, when it's set, we should
prompt the user to save it, so the customization is not lost on
restart.

* gnus-srvr.el (gnus-server-toggle-cloud-method-server): Prompt to
save the customization of `gnus-cloud-method'.
2016-07-27 15:22:02 -04:00
Ken Brown
773778e1c0 Fix dired-test-bug22694
* test/lisp/dired-tests.el (dired-test-bug22694): Delete the
"bug22694" directory, if it exists, before running the test.  It
might be left over from a previous aborted run of the test.
2016-07-27 12:30:43 -04:00
Michal Nazarewicz
74f9c1a8cd Fix ‘is multibyte’ test regex.c’s mutually_exclusive_p (bug#24020)
* src/regex.c (mutually_exclusive_p): Fix how whether character is
unibyte is tested when calling execute_charset function.  This bug has
been introduced by [6dc6b00: Fix ‘[[:cc:]]*literal’ regex failing to
match ‘literal’] which dropped a call to IS_REAL_ASCII (c) macro.
Reinstitute it.
2016-07-27 18:18:34 +02:00
Tino Calancha
e0d425976e Remove hook when disabling ibuffer-auto-mode
* lisp/ibuf-ext.el (ibuffer-auto-mode):
Remove 'ibuffer-auto-update-changed' from 'post-command-hook'.
2016-07-27 19:44:06 +09:00
Tino Calancha
404765526a ; Spelling fixes 2016-07-27 19:14:37 +09:00
Stefan Monnier
682fdae7ef * lisp/subr.el (cancel-change-group): Reset cell in case of error
Since the setcdr/setcdr is supposed to be temporary, use unwind-protect
to make sure we properly undo the temporary change even in case of error.
2016-07-26 13:14:50 -04:00
Eli Zaretskii
c54238db6a Avoid segfaults in compute_motion
* src/indent.c (compute_motion): Don't turn on and don't use the
width cache unless the buffer's width-table is non-nil.  This
avoids segfaults because code that uses the width cache assumes
the width-table exists.  (Bug#24064)
2016-07-26 18:27:21 +03:00
Nicolas Petton
ac30157b14 Do not sharp-quote lambdas
* lisp/progmodes/sql.el: Remove sharp-quotes in lambdas.
2016-07-26 17:10:56 +02:00