]> git.eshelyaron.com Git - emacs.git/log
emacs.git
8 years agoSimplify BYTE_CODE_SAFE checking
Paul Eggert [Tue, 9 Aug 2016 07:37:38 +0000 (00:37 -0700)]
Simplify BYTE_CODE_SAFE checking

* src/bytecode.c (BYTE_CODE_SAFE): Default to false, so that it
can be used outside #if.  All uses of ‘defined BYTE_CODE_SAFE’
changed to ‘BYTE_CODE_SAFE’.  Use BYTE_CODE_SAFE in plain
expressions instead of #if expressions when this is easy.
(struct byte_stack) [BYTE_CODE_SAFE]: Remove member ‘bottom’,
as it is no longer needed.
(exec_byte_code): Omit #if BYTE_CODE_SAFE when this is easy.
Simplify stack-overflow checking when BYTE_CODE_SAFE.

8 years agoGet BYTE_CODE_METER working again
Paul Eggert [Tue, 9 Aug 2016 07:35:13 +0000 (00:35 -0700)]
Get BYTE_CODE_METER working again

BYTE_CODE_METER hasn’t worked since 2013, and nobody seems to have
noticed.  Perhaps we should remove it?
* src/bytecode.c (METER_2) [BYTE_CODE_METER]:
Use *aref_addr instead of AREF, since it needs to be an lvalue.

8 years agoFix cursor position under scroll-conservatively and overlay strings
Eli Zaretskii [Mon, 8 Aug 2016 15:15:55 +0000 (18:15 +0300)]
Fix cursor position under scroll-conservatively and overlay strings

* src/xdisp.c (try_scrolling): Handle the case where the last
visible screen line of a window displays a before- or after-string
that takes up the whole screen line, and therefore there's no
place to display the cursor, even though the window does seem to
include the position of point.  (Bug#24179)

8 years ago* lisp/files.el (file-ownership-preserved-p): Fix docstring. (Bug#23998)
Michael Albinus [Mon, 8 Aug 2016 08:58:29 +0000 (10:58 +0200)]
* lisp/files.el (file-ownership-preserved-p): Fix docstring.  (Bug#23998)

8 years agoTune interpretation of integer arglist descriptor
Paul Eggert [Sun, 7 Aug 2016 16:58:09 +0000 (09:58 -0700)]
Tune interpretation of integer arglist descriptor

* src/bytecode.c (exec_byte_code):
Simplify and tune when INTEGERP (args_template).

8 years agoFix debugging of string-match-p errors
Noam Postavsky [Sat, 6 Aug 2016 02:11:00 +0000 (22:11 -0400)]
Fix debugging of string-match-p errors

* src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so
that debugger code that needs to do regexp match won't break
(Bug #23949, Bug #24166, Bug#16294).

8 years agoAdd `make-nearby-temp-file' and `temporary-file-directory'
Michael Albinus [Sun, 7 Aug 2016 11:57:23 +0000 (13:57 +0200)]
Add `make-nearby-temp-file' and `temporary-file-directory'

* doc/lispref/files.texi (Unique File Names):
Introduce `make-nearby-temp-file' and `temporary-file-directory'.
(Magic File Names): Mention `make-nearby-temp-file' and
`temporary-file-directory'.

* etc/NEWS (provided): Mention `make-nearby-temp-file' and
`temporary-file-directory'.

* lisp/files.el (mounted-file-systems): New defcustom.
(temporary-file-directory, make-nearby-temp-file): New defuns.
(normal-backup-enable-predicate): Fix docstring.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
<make-nearby-temp-file, temporary-file-directory>: Add handler.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Add `make-nearby-temp-file' and `temporary-file-directory'.
(tramp-get-remote-tmpdir): Remove compatibility code.
(tramp-handle-temporary-file-directory)
(tramp-handle-make-nearby-temp-file): New defuns.

* lisp/org/ob-core.el (org-babel-local-file-name):
* lisp/progmodes/gud.el (gud-common-init):
* lisp/vc/vc-hooks.el (vc-user-login-name): Use `file-remote-p'.

* lisp/vc/vc-git.el (vc-git-checkin): Handle remote log message.

* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name):
Check `tramp--test-enabled'.
(tramp-test18-file-attributes): Add tests for
`file-ownership-preserved-p'.
(tramp-test27-start-file-process, tramp-test28-shell-command):
Reduce timeouts in `accept-process-output'.
(tramp-test--shell-command-to-string-asynchronously): Add timeout.
(tramp-test29-environment-variables): Remove additional sleep calls.
(tramp-test32-make-nearby-temp-file): New test.
(tramp--test-special-characters, tramp--test-utf8): Adapt docstring.
(tramp-test33-special-characters)
(tramp-test33-special-characters-with-stat)
(tramp-test33-special-characters-with-perl)
(tramp-test33-special-characters-with-ls, tramp-test34-utf8)
(tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl)
(tramp-test34-utf8-with-ls)
(tramp-test35-asynchronous-requests)
(tramp-test36-recursive-load, tramp-test37-unload): Rename.
(tramp--test-ftp-p): Simplify check.
(tramp--test-sh-p): New defun.
(tramp-test20-file-modes, tramp-test22-file-times)
(tramp-test26-process-file, tramp-test27-start-file-process)
(tramp-test28-shell-command)
(tramp-test29-environment-variables)
(tramp-test30-vc-registered)
(tramp-test33-special-characters-with-stat)
(tramp-test33-special-characters-with-perl)
(tramp-test33-special-characters-with-ls)
(tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl)
(tramp-test34-utf8-with-ls)
(tramp-test35-asynchronous-requests): Use it.

8 years agoAdd missing dcstrings in Tramp, remove chec for obsolee methods
Michael Albinus [Sun, 7 Aug 2016 06:45:12 +0000 (08:45 +0200)]
Add missing dcstrings in Tramp, remove chec for obsolee methods

* lisp/net/tramp.el (tramp-progress-reporter-update)
(tramp-unload-file-name-handlers, tramp-get-local-uid)
(tramp-get-local-gid, tramp-get-local-locale):
* lisp/net/tramp-adb.el (tramp-adb-ls-date-regexp)
(tramp-adb-ls-toolbox-regexp, tramp-adb-get-ls-command):
* lisp/net/tramp-compat.el (tramp-compat-funcall):
* lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp):
* lisp/net/tramp-gw.el (tramp-gw-process-filter):
* lisp/net/tramp-sh.el (tramp-get-remote-path)
(tramp-get-remote-locale, tramp-get-ls-command)
(tramp-get-ls-command-with-dired)
(tramp-get-ls-command-with-quoting-style)
(tramp-get-ls-command-with-w-option)
(tramp-get-test-nt-command, tramp-get-file-exists-command)
(tramp-get-remote-ln, tramp-get-remote-perl)
(tramp-get-remote-stat, tramp-get-remote-readlink)
(tramp-get-remote-trash, tramp-get-remote-touch)
(tramp-get-remote-gvfs-monitor-dir)
(tramp-get-remote-inotifywait, tramp-get-remote-id)
(tramp-get-remote-uid-with-id)
(tramp-get-remote-uid-with-perl, tramp-get-remote-python)
(tramp-get-remote-uid-with-python, tramp-get-remote-uid)
(tramp-get-remote-gid-with-id)
(tramp-get-remote-gid-with-perl)
(tramp-get-remote-gid-with-python, tramp-get-remote-gid)
(tramp-get-env-with-u-option): Add missing docstrings.

* lisp/net/tramp.el (tramp-obsolete-methods)
(tramp-warned-obsolete-methods): Remove.
(tramp-find-method): Do not check for obsolete methods any longer.

8 years agoMake sh-mode always use p-s-lookup-properties
Noam Postavsky [Fri, 8 Jul 2016 01:14:48 +0000 (21:14 -0400)]
Make sh-mode always use p-s-lookup-properties

This lets functions which rely on syntax-propertize for parsing
work correctly even before font lock has a chance to run.

* lisp/progmodes/sh-script.el (sh-set-shell): Set
parse-sexp-lookup-properties unconditionally (Bug #4920).

8 years agoFix cl-assert with atomp FORM, non-nil SHOW-ARGS
Noam Postavsky [Mon, 4 Jul 2016 03:44:14 +0000 (23:44 -0400)]
Fix cl-assert with atomp FORM, non-nil SHOW-ARGS

* lisp/emacs-lisp/cl-macs.el (cl-assert): Don't require that FORM is a
list when showing its (non-existent) arguments (Bug #18587).

8 years agoDon't delete selection after indent-rigidly
Noam Postavsky [Sun, 3 Jul 2016 18:00:19 +0000 (14:00 -0400)]
Don't delete selection after indent-rigidly

* lisp/indent.el (indent-rigidly): Pass `deactivate-mark' as the ON-EXIT
function to `set-transient-map', this prevents `delete-selection-mode'
from deleting the text that was just indented (Bug #20408).

8 years agoFix byte-compile of interactive closures
Noam Postavsky [Mon, 1 Aug 2016 00:46:37 +0000 (20:46 -0400)]
Fix byte-compile of interactive closures

* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Put
bindings after docstring and `interactive' form, if any (Bug #24122).

8 years agoError if --eval arg has text beyond 1 expression
Noam Postavsky [Sun, 3 Jul 2016 00:26:35 +0000 (20:26 -0400)]
Error if --eval arg has text beyond 1 expression

* lisp/startup.el (command-line-1): If --eval argument has more data
than constitutes a single Lisp expression, signal an error (Bug #23159).

8 years agoFix quoted lambda warning from lexical-let
Noam Postavsky [Fri, 10 Jun 2016 01:54:13 +0000 (21:54 -0400)]
Fix quoted lambda warning from lexical-let

* lisp/emacs-lisp/cl.el (cl--function-convert): Quote the inner lambda
with `function', not `quote' (Bug #11357).

8 years agoMake emerge always use shell-quote-argument
Noam Postavsky [Sat, 6 Aug 2016 13:51:15 +0000 (09:51 -0400)]
Make emerge always use shell-quote-argument

* lisp/vc/emerge.el (emerge-metachars): Obsolete.
(emerge-protect-metachars): Delete.
(emerge-make-diff-list, emerge-make-diff3-list): Replace all calls to
`emerge-protect-metachars' with `shell-quote-argument' so that shell
quoting is done the same on all system types (Bug #6136).  Also shell
quote `emerge-diff-program' and `emerge-diff3-program'.

8 years agoFix 'dired-diff' when backup file is in another directory
Eli Zaretskii [Sat, 6 Aug 2016 10:13:57 +0000 (13:13 +0300)]
Fix 'dired-diff' when backup file is in another directory

* lisp/dired-aux.el (dired-diff): Clarify the doc string wrt how
the default for FILE is computed, especially when backup files
are involved.  Support backup files in another directory.
Don't suggest the default FILE if it doesn't exist.  (Bug#24089)

8 years agoFix the 'T' command in Dired with non_ASCII file names
Eli Zaretskii [Sat, 6 Aug 2016 09:44:38 +0000 (12:44 +0300)]
Fix the 'T' command in Dired with non_ASCII file names

* lisp/dired-aux.el (dired-do-chxxx): Bind coding-system-for-write
to correctly encode file names passed to the invoked PROGRAM.
(Bug#24162)

8 years ago* lisp/files.el (version-control): Drop :group vc (Bug #14687)
Noam Postavsky [Sat, 6 Aug 2016 00:04:17 +0000 (20:04 -0400)]
* lisp/files.el (version-control): Drop :group vc (Bug #14687)

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:10:30 +0000 (14:10 -0700)]
Merge from origin/emacs-25

d841a03 ; Spelling fix
a6ae479 Post AppDefined events from the main thread ONLY (bug#23934)
d35d398 Update to the AUTHORS file for Bob Weiner
4d2f4df Revert "Fix local printer set to left aligned string formatter."
cd1b4d6 Revert "Fix ses-delete-blanks to delete only blanks + documen...
f7ceb8e Revert "Fix English."
baa7abd Improve doc strings of 'gud-gdb' and 'gdb'
aa4271a Fix doc string of 'minibuffer-message-timeout'
b275cc7 Fix English.
3c97b0f Fix ses-delete-blanks to delete only blanks + documentation.
272391f profiler: document prefix arg for tree expansion
442cc39 Clarify usage of eshell-visual-options
b443c3c Fix comment in files-in-below-directory
8a38e94 Fix local printer set to left aligned string formatter.
0f0b191 ; Fix typos in NEWS
6bdf687 ; * etc/NEWS: Remove temporary marks

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:10:30 +0000 (14:10 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

3d981dd Bump Emacs version to 25.1 for the first RC

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:10:30 +0000 (14:10 -0700)]
Merge from origin/emacs-25

d08afa1 * etc/AUTHORS: Update the AUTHORS file
2668500 ;; * ChangeLog.2: ChangeLog update.
7acfaea ; ChangeLog fixes
97d28b4 * admin/authors.el (authors-valid-file-names): Addition.
9ab52f6 * admin/authors.el: Additions.
0e646c7 Warn about Cairo-related problems
bc4c07f Don't let completion break `declare' handling
66f95e0 Adjust match data before calling after-change-funs
52cf0d5 Do not show string-rectangle preview if minibuffer is empty
6a3d031 * etc/PROBLEMS: Add entry about selection problems under Plas...

# Conflicts:
# ChangeLog.2
# src/lisp.h

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:09:09 +0000 (14:09 -0700)]
; Merge from origin/emacs-25

The following commits were skipped:

ff3fc21 Port to glibc 2.24 (pre-release) + ppc64
eb9d461 * lisp/net/shr.el (shr-fill-line): Withdraw the last commit (...
4157159 * lisp/net/shr.el (shr-fill-line): Preserve text properties i...

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:09:09 +0000 (14:09 -0700)]
Merge from origin/emacs-25

9a41cd1 ; Fix typo
9356fe2 Expand FIXME near definition of fboundp
219b39f kill-rectangle should mention killed-rectangle
59fa4c3 Avoid assertion violations in nhexl-mode

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:09:09 +0000 (14:09 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

916abe9 Use memmove instead of memcpy on overlapping regions

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:09:08 +0000 (14:09 -0700)]
Merge from origin/emacs-25

9ba51ed Document buffer-swap-text+save-excursion interaction
452aa94 Fix eieio vs cl-generic incompatibilities found in Rudel (bug...
248d5dd Include cl-generic in package--builtin-versions (bug#22817)
8f5a8b6 Improve timing in `tramp-test29-environment-variables'
05ba7a0 Add test for handling environment variables in Tramp
e393d4f * lisp/emacs-lisp/package.el (describe-package-1) (package-st...
5e38887 ; * lisp/net/tramp.el: Fix 2010-10-04 comment typo.  (Bug#23913)
90f2169 ; Spelling fixes
069fc05 Improve documentation of search functions
0a0144a Delete environment variables in Tramp when needed
f624671 Add "New in Emacs 25" section to the FAQ
658daf9 Fix 'vertical-motion' in non-interactive sessions
686b520 Fix memory leak in imagemagick-types
4069b71 Update ELisp manual to match 'string-collate-equalp' doc string
1b2d6a6 Clarify docstring of find-feature-regexp
aac62a6 Add details to cl-lib defining macros' docstrings
d6aa4da Clarify doc string of 'save-buffer'
03bcf11 Un-confuse doc string of 'string-collate-equalp'
c53135b Clarify documentation of 'mouse-on-link-p'

# Conflicts:
# lisp/emacs-lisp/eieio-core.el

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:07:01 +0000 (14:07 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

8f9c1ed Fix missing undo-boundary on revert-buffer.

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:07:01 +0000 (14:07 -0700)]
Merge from origin/emacs-25

6f285d9 Amend last addition to etc/PROBLEMS
7067890 * etc/PROBLEMS: Mention GTK+ problem with unexpected frame wi...

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:07:01 +0000 (14:07 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

a5dcc97 Fix open-network-stream responsiveness

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:07:00 +0000 (14:07 -0700)]
Merge from origin/emacs-25

d4c6774 Fix missing point information in undo
3a9d629 Avoid crashes when buffer modification hooks clobber match data
178b2f5 Note combine-and-quote-strings doesn't shell quote
dec7567 Explain when package-initialize isn't called
113d1e2 Fix escaping in sh-indent-after-continuation docstr
80e2044 ; * etc/NEWS: Improve previous change.
5bb9e6c ; * etc/NEWS: Document how to avoid horizontal scroll bars.
38f4b8e Clarify the documentation of back-references in replacements

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:07:00 +0000 (14:07 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

d039fc4 ; Auto-commit of loaddefs files.

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:06:59 +0000 (14:06 -0700)]
Merge from origin/emacs-25

850ba44 Clarify lexical binding with symbol args behavior
f981b31 * lisp/net/tramp-sh.el (tramp-remote-path): Doc fix.
68fc964 * lisp/net/tramp-sh.el (tramp-remote-path): Doc fix.  (Bug#23...
21110af Avoid assertion violations when rendering some fonts
6192b6c Document more details of package activation
272ddc6 Fixup warning message regarding HOME a bit more
43206d6 * lisp/leim/quail/indian.el ("bengali-probhat"): Change indic...
d41f7ff Fix input method "probhat" for Bengali
c150a64 ; Fix typo in commit before last
ebf0472 Add to elisp-completion-at-point's docstring
fd9fad0 Give more helpful warning about setting HOME
ea6b01d ; * lisp/term.el (term-mode): FIXME comment about bidi reorde...

# Conflicts:
# lisp/term.el

8 years ago; Merge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:05:10 +0000 (14:05 -0700)]
; Merge from origin/emacs-25

The following commit was skipped:

7f83e7e Fix slow redisplay in term-mode

8 years agoMerge from origin/emacs-25
Paul Eggert [Fri, 5 Aug 2016 21:05:09 +0000 (14:05 -0700)]
Merge from origin/emacs-25

26d4da0 New input method "probhat" for Bengali
4f445bf ; Spelling fix
f403f03 ; Fix typo

8 years agoSpelling and minor grammar fixes
Paul Eggert [Fri, 5 Aug 2016 20:31:10 +0000 (13:31 -0700)]
Spelling and minor grammar fixes

* test/file-organization.org: Rename from test/file-organisation.org.

8 years agoWiden in certain low level CC Mode functions. This fixes bug #24148.
Alan Mackenzie [Thu, 4 Aug 2016 21:07:52 +0000 (21:07 +0000)]
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.

8 years agoFix Bug#24149
Stefan Monnier [Thu, 4 Aug 2016 15:39:28 +0000 (23:39 +0800)]
Fix Bug#24149

* lisp/subr.el (set-transient-map): Don't wait if MAP not present in
overriding-terminal-local-map.  (Bug#24149)

8 years agoUpdate from gnulib
Paul Eggert [Wed, 3 Aug 2016 22:10:58 +0000 (15:10 -0700)]
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.

8 years ago; Spelling fix
Paul Eggert [Wed, 3 Aug 2016 21:58:30 +0000 (14:58 -0700)]
; Spelling fix

8 years agoFix GnuTLS includes
Paul Eggert [Wed, 3 Aug 2016 21:20:38 +0000 (14:20 -0700)]
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

8 years agoPost AppDefined events from the main thread ONLY (bug#23934)
Alan Third [Wed, 20 Jul 2016 20:59:17 +0000 (21:59 +0100)]
Post AppDefined events from the main thread ONLY (bug#23934)

* src/nsterm.h: Make nextappdefined var not just GNUStep.
* src/nsterm.c (ns_send_appdefined, sendFromMainThread): Remove GNUStep

8 years agoFix accessing regex-resources in out-of-tree test runs in regex-tests
Michal Nazarewicz [Wed, 3 Aug 2016 02:37:29 +0000 (04:37 +0200)]
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.

8 years agoSimplify by assuming GnuTLS 2.12.2 or later
Paul Eggert [Wed, 3 Aug 2016 12:02:03 +0000 (08:02 -0400)]
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.

8 years agoPort to systems lacking GNUTLS_NONBLOCK
Paul Eggert [Wed, 3 Aug 2016 11:45:47 +0000 (07:45 -0400)]
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.

8 years agoFix non-blocking GnuTLS with slow connection
Paul Eggert [Wed, 3 Aug 2016 08:54:20 +0000 (01:54 -0700)]
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.

8 years agoRequire GnuTLS 2.12.2 or later
Paul Eggert [Wed, 3 Aug 2016 08:33:21 +0000 (04:33 -0400)]
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.

8 years ago* src/window.c (sanitize_window_sizes): Remove unused arg `frame'
Stefan Monnier [Wed, 3 Aug 2016 02:43:11 +0000 (22:43 -0400)]
* 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.

8 years agoFix (mapcar F S) crash when F alters S’s length
Paul Eggert [Wed, 3 Aug 2016 01:04:28 +0000 (21:04 -0400)]
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)

8 years agoPort window changes to --enable-gcc-warnings
Paul Eggert [Wed, 3 Aug 2016 00:46:30 +0000 (20:46 -0400)]
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.

8 years agoUpdate to the AUTHORS file for Bob Weiner
John Wiegley [Tue, 2 Aug 2016 23:55:16 +0000 (16:55 -0700)]
Update to the AUTHORS file for Bob Weiner

* etc/AUTHORS: Update the packages attributed to Bob Weiner

8 years ago* src/window.c: Fix bootstrap failure due to window.el changes
Stefan Monnier [Tue, 2 Aug 2016 23:45:30 +0000 (19:45 -0400)]
* 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.

8 years agoFix Bug#23883
Michael Albinus [Tue, 2 Aug 2016 20:38:03 +0000 (22:38 +0200)]
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)

8 years agoPort regex changes to strict ISO C
Paul Eggert [Tue, 2 Aug 2016 20:16:23 +0000 (16:16 -0400)]
Port regex changes to strict ISO C

* src/regex.c (regex_compile): Redo casts.

8 years ago* lisp/window.el: Use lexical-binding
Stefan Monnier [Tue, 2 Aug 2016 19:17:01 +0000 (15:17 -0400)]
* 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'.

8 years agoRevert "Fix local printer set to left aligned string formatter."
John Wiegley [Tue, 2 Aug 2016 18:43:08 +0000 (11:43 -0700)]
Revert "Fix local printer set to left aligned string formatter."

This reverts commit 8a38e948b039516e70176ebe20c5349e2ade6ac5.

8 years agoRevert "Fix ses-delete-blanks to delete only blanks + documentation."
John Wiegley [Tue, 2 Aug 2016 18:43:07 +0000 (11:43 -0700)]
Revert "Fix ses-delete-blanks to delete only blanks + documentation."

This reverts commit 3c97b0f7589e06aeb1ab0147f0ee32974c32926d.

8 years agoRevert "Fix English."
John Wiegley [Tue, 2 Aug 2016 18:43:05 +0000 (11:43 -0700)]
Revert "Fix English."

This reverts commit b275cc76f0c5ab49e81445fcc3420c8772aefd42.

8 years agoFix unused lexical variable
Michal Nazarewicz [Tue, 2 Aug 2016 17:44:51 +0000 (19:44 +0200)]
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.

8 years agoRemove unused STREQ macro
Michal Nazarewicz [Tue, 2 Aug 2016 17:41:00 +0000 (19:41 +0200)]
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.

8 years ago* cl-generic.el: Fix problems introduced by new load-history format
Stefan Monnier [Tue, 2 Aug 2016 17:01:26 +0000 (13:01 -0400)]
* 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.

8 years agoHardcode regex syntax to remove dead code handling different syntax
Michal Nazarewicz [Wed, 27 Jul 2016 21:13:11 +0000 (23:13 +0200)]
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.

8 years agoGet rid of re_set_whitespace_regexp
Michal Nazarewicz [Wed, 27 Jul 2016 20:53:57 +0000 (22:53 +0200)]
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.

8 years agoGet rid of re_set_syntax
Michal Nazarewicz [Wed, 27 Jul 2016 20:39:04 +0000 (22:39 +0200)]
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.

8 years agoRemove dead opcodes in regex bytecode
Michal Nazarewicz [Sat, 23 Jul 2016 14:05:12 +0000 (16:05 +0200)]
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.

8 years agoRefactor regex character class parsing in [:name:]
Michal Nazarewicz [Sun, 17 Jul 2016 01:09:38 +0000 (03:09 +0200)]
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.

8 years agoSplit regex glibc test cases into separet tests
Michal Nazarewicz [Wed, 27 Jul 2016 13:49:20 +0000 (15:49 +0200)]
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’.

8 years agoDon’t (require 'cl)
Michal Nazarewicz [Wed, 27 Jul 2016 16:38:41 +0000 (18:38 +0200)]
Don’t (require 'cl)

* test/src/regex-test.el: Don’t (require 'cl).
(regex-tests-PCRE): s/loop/cl-loop/

8 years agoFix reading of regex-resources in regex-tests
Michal Nazarewicz [Wed, 27 Jul 2016 15:25:34 +0000 (17:25 +0200)]
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.

8 years agoAdded driver for the regex tests
Dima Kogan [Sun, 28 Feb 2016 02:06:35 +0000 (18:06 -0800)]
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]

8 years agoNew regex tests imported from glibc 2.21
Dima Kogan [Sat, 12 Mar 2016 02:18:14 +0000 (18:18 -0800)]
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/*.]

8 years agoFix use-after-close in connect_network_socket
Paul Eggert [Tue, 2 Aug 2016 07:31:04 +0000 (03:31 -0400)]
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

8 years ago* lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads):
Glenn Morris [Mon, 1 Aug 2016 20:31:57 +0000 (16:31 -0400)]
* lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads):
Respect autoload-timestamps for "actual autoloads are elsewhere" case.

8 years agoImprove doc strings of 'gud-gdb' and 'gdb'
Eli Zaretskii [Mon, 1 Aug 2016 19:58:37 +0000 (22:58 +0300)]
Improve doc strings of 'gud-gdb' and 'gdb'

* lisp/progmodes/gdb-mi.el (gdb):
* lisp/progmodes/gud.el (gud-gdb): Doc fix.  (Bug#24125)

8 years agoFix doc string of 'minibuffer-message-timeout'
Eli Zaretskii [Mon, 1 Aug 2016 13:29:20 +0000 (16:29 +0300)]
Fix doc string of 'minibuffer-message-timeout'

* src/keyboard.c (syms_of_keyboard) <minibuffer-message-timeout>:
Doc fix.  (Bug#24123)

8 years ago; Auto-commit of loaddefs files.
Glenn Morris [Mon, 1 Aug 2016 10:24:24 +0000 (06:24 -0400)]
; Auto-commit of loaddefs files.

8 years ago* lisp/textmodes/rst.el: Major refactoring, minor changes, minor fixes
Stefan Merten [Sun, 31 Jul 2016 14:40:46 +0000 (16:40 +0200)]
* 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.

8 years agoFix calculation of tool bar width reported by `frame-geometry' (Bug#24107)
Martin Rudalics [Sat, 30 Jul 2016 12:11:12 +0000 (14:11 +0200)]
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.

8 years agoFix region display while dragging mouse
Eli Zaretskii [Sat, 30 Jul 2016 08:32:02 +0000 (11:32 +0300)]
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)

8 years agoCopy just non-empty strings to kill-ring
Tino Calancha [Sat, 30 Jul 2016 08:26:19 +0000 (17:26 +0900)]
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).

8 years agoAvoid warnings about undo list while decoding
Eli Zaretskii [Sat, 30 Jul 2016 08:23:10 +0000 (11:23 +0300)]
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)

8 years agoFix English.
Vincent Belaïche [Fri, 29 Jul 2016 11:47:57 +0000 (13:47 +0200)]
Fix English.

* doc/misc/ses.texi (Nonrelocatable references): Fix grammatically
  incorrect English.

8 years agoFix ses-delete-blanks to delete only blanks + documentation.
Vincent Belaïche [Fri, 29 Jul 2016 11:44:14 +0000 (13:44 +0200)]
Fix ses-delete-blanks to delete only blanks + documentation.

* doc/misc/ses.texi (Quick Tutorial): Mention the '!'
'ses-range' modifier as an alternative to 'ses+'.
(Advanced Features): Add a refernce to node 'Nonrelocatable
references' concerning function 'ses-rename-cell'.
(Standard formula functions): Mention the '!' 'ses-range'
modifier as an alternative to 'ses-delete-blanks'.
(More on cell printing): Fix fallback printer
definition.  Minor editorial formatting changes.
(Nonrelocatable references): Document the use of
'ses-rename-cell' as a better way to make cell reference
non-relocatable.
(The data area): Document the presence of local printer
definitions in the data area.

* lisp/ses.el (ses-delete-blanks): Do not remove
*error*.  Any error in an argument should propagate into the
using formula rather than being silently hidden !

8 years agoprofiler: Add mouse-1 binding for tree expansion
Noam Postavsky [Fri, 29 Jul 2016 00:06:09 +0000 (20:06 -0400)]
profiler: Add mouse-1 binding for tree expansion

(profiler-report-mode-map): Add mouse-1 binding for
profiler-report-toggle-entry (Bug #13455).

8 years agoprofiler: document prefix arg for tree expansion
Noam Postavsky [Sun, 17 Jul 2016 04:21:42 +0000 (00:21 -0400)]
profiler: document prefix arg for tree expansion

* doc/lispref/debugging.texi (Profiling):
* lisp/profiler.el (profiler-report-toggle-entry): Document use of
prefix argument to expand whole call trees.

8 years agoClarify usage of eshell-visual-options
Noam Postavsky [Mon, 4 Jul 2016 02:41:48 +0000 (22:41 -0400)]
Clarify usage of eshell-visual-options

* lisp/eshell/em-term.el (eshell-visual-options): Add second option to
example usage (Bug #19627).

8 years agoFix comment in files-in-below-directory
Noam Postavsky [Mon, 27 Jun 2016 03:29:51 +0000 (23:29 -0400)]
Fix comment in files-in-below-directory

* doc/lispintro/emacs-lisp-intro.texi (Files List): Comment should not
say append, since the code is adding to front of list (Bug #21589).

8 years agoFix local printer set to left aligned string formatter.
Vincent Belaïche [Thu, 28 Jul 2016 17:49:37 +0000 (19:49 +0200)]
Fix local printer set to left aligned string formatter.

* lisp/ses.el (ses-local-printer-compile): Add missing case
for left-aligned string formatter.

8 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Vincent Belaïche [Thu, 28 Jul 2016 16:12:50 +0000 (18:12 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

8 years agoEnable addition of local printers from a mode hook.
Vincent Belaïche [Thu, 28 Jul 2016 15:41:21 +0000 (17:41 +0200)]
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.

8 years agoPrompt to save gnus-cloud-method.
Ted Zlatanov [Wed, 27 Jul 2016 19:22:02 +0000 (15:22 -0400)]
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'.

8 years agoFix dired-test-bug22694
Ken Brown [Wed, 27 Jul 2016 16:28:14 +0000 (12:28 -0400)]
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.

8 years agoFix ‘is multibyte’ test regex.c’s mutually_exclusive_p (bug#24020)
Michal Nazarewicz [Wed, 27 Jul 2016 16:14:57 +0000 (18:14 +0200)]
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.

8 years agoRemove hook when disabling ibuffer-auto-mode
Tino Calancha [Wed, 27 Jul 2016 10:44:06 +0000 (19:44 +0900)]
Remove hook when disabling ibuffer-auto-mode

* lisp/ibuf-ext.el (ibuffer-auto-mode):
Remove 'ibuffer-auto-update-changed' from 'post-command-hook'.

8 years ago; Spelling fixes
Tino Calancha [Wed, 27 Jul 2016 10:14:37 +0000 (19:14 +0900)]
; Spelling fixes

8 years ago* lisp/subr.el (cancel-change-group): Reset cell in case of error
Stefan Monnier [Tue, 26 Jul 2016 17:14:50 +0000 (13:14 -0400)]
* 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.

8 years agoAvoid segfaults in compute_motion
Eli Zaretskii [Tue, 26 Jul 2016 15:27:21 +0000 (18:27 +0300)]
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)

8 years agoDo not sharp-quote lambdas
Nicolas Petton [Tue, 26 Jul 2016 15:08:29 +0000 (17:08 +0200)]
Do not sharp-quote lambdas

* lisp/progmodes/sql.el: Remove sharp-quotes in lambdas.

8 years ago* gnus-cloud.el (gnus-cloud-encode-data): Fix 'base64-gzip encoding.
Ted Zlatanov [Tue, 26 Jul 2016 02:07:35 +0000 (22:07 -0400)]
* gnus-cloud.el (gnus-cloud-encode-data): Fix 'base64-gzip encoding.

8 years agoAdd warning to format-alist docs.
Andrew Hyatt [Mon, 25 Jul 2016 03:58:47 +0000 (23:58 -0400)]
Add warning to format-alist docs.

*/doc/lispref/files.texi (format-alist) Change documentation for
format-alist to warn against file modifications when formatting, which
leads to incorrect results.  (Bug#5440)

Changes suggested by Eli.

8 years ago* lisp/gnus/mm-decode.el (mm-convert-shr-links):
Katsumi Yamaoka [Mon, 25 Jul 2016 23:46:58 +0000 (23:46 +0000)]
* lisp/gnus/mm-decode.el (mm-convert-shr-links):
Preserve key bindings that shr adds (bug#23964).

8 years agoFix ‘[[:cc:]]*literal’ regex failing to match ‘literal’ (bug#24020)
Michal Nazarewicz [Mon, 18 Jul 2016 13:59:26 +0000 (15:59 +0200)]
Fix ‘[[:cc:]]*literal’ regex failing to match ‘literal’ (bug#24020)

The regex engine tries to optimise Kleene star by avoiding backtracking
when it can detect that star’s operand cannot match what follows it in
the pattern.

For example, when ‘[[:alpha:]]*1’ tries to match a ‘foo’, the engine
will test the longest match for ‘[[:alpha:]]*’, namely ’foo’ which is
the entire string.  Literal digit one still present in the pattern will
however not match the remaining empty string.

Normally, backtracking would be performed trying a shorter match for the
character class (namely ‘fo’ leaving ‘o’ in the string), but since the
engine knows whatever would be put back into the string cannot possibly
match literal digit one so no backtracking will be attempted.

In the regexes of the form ‘[[:CC:]]*X’, the optimisation can be applied
if the character class CC does not match character X.  In the above
example, this holds because digit one is not in alpha character class.

This test is performed by mutually_exclusive_p function but it did not
check class bits of a charset opcode.  This resulted in an assumption
that character classes do not match multibyte characters.  For example,
it would incorrectly conclude that [[:alpha:]] doesn’t match ‘ż’.

This, in turn, led to the aforementioned Kleene star optimisation being
incorrectly applied in patterns such as ‘[[:graph:]]*☠’ (which should
match ‘☠’ but doesn’t as can be tested by executing
    (string-match-p "[[:graph:]]*☠" "☠")
which should return 0 but instead yields nil.

This issue affects any class witch matches multibyte characters, i.e.
if ‘[[:cc:]]’ matches a multibyte character X then ‘[[:cc:]]*X’ will
fail to match ‘X’.

* src/regex.c (executing_charset): A new function for executing the
charset and charset_not opcodes.  It performs check on the character
taking into consideration existing bitmap, range table and class bits.
It also advances the pointer in the regex bytecode past the parsed
opcode.
(CHARSET_LOOKUP_RANGE_TABLE_RAW, CHARSET_LOOKUP_RANGE_TABLE): Removed.
Code now included in executing_charset.
(mutually_exclusive_p, re_match_2_internal): Changed to take advantage
of executing_charset function.

* test/src/regex-tests.el: New file with tests for the character class
matching.