Commit graph

133463 commits

Author SHA1 Message Date
Michael Albinus
5583e6460c ; Fix typo 2018-06-20 20:21:48 +02:00
Eli Zaretskii
dffe02d259 Improve documentation of a recent change
* doc/lispref/processes.texi (Subprocess Creation): Improve
wording of documentation for the function 'exec-path'.

* etc/NEWS: Improve wording and formatting of recently added
entries.

* lisp/files.el (exec-path): Doc fix.
2018-06-20 18:39:41 +03:00
Michael Albinus
6f649e77b8 Implement command completion in remote shells. (Bug#31704)
* doc/lispref/files.texi (Locating Files): Describe optional
argument REMOTE of `executable-find'.
(Magic File Names): Add `exec-path'.

* doc/lispref/processes.texi (Subprocess Creation): Describe
function `exec-path'.

* doc/misc/tramp.texi (Remote programs): Explain refresh of search
paths by `tramp-cleanup-this-connection'.

* etc/NEWS: Mention 'exec-path' and 'executable-find'.

* lisp/files.el (exec-path): New defun.
(executable-find): Add optional argument REMOTE.

* lisp/shell.el (shell-completion-vars): Set `comint-file-name-prefix'.
(shell--command-completion-data): Use `(exec-path)'.  (Bug#31704)

* lisp/net/ange-ftp.el (exec-path):
* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-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)
<exec-path>: Add handler.

* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path): New defun.
(tramp-adb-maybe-open-connection): Do not set "remote-path"
connection property.

* lisp/net/tramp-compat.el (tramp-compat-exec-path): New defun.

* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): New defun.

* lisp/net/tramp.el (tramp-eshell-directory-change): Use it.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test38-make-nearby-temp-file)
(tramp-archive-test41-file-system-info)
(tramp-archive-test43-auto-load)
(tramp-archive-test43-delay-load): Rename.

* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): New test.
(tramp-test36-make-auto-save-file-name)
(tramp-test37-find-backup-file-name)
(tramp-test38-make-nearby-temp-file)
(tramp-test39-special-characters)
(tramp-test39-special-characters-with-stat)
(tramp-test39-special-characters-with-perl)
(tramp-test39-special-characters-with-ls, tramp-test40-utf8)
(tramp-test40-utf8-with-stat, tramp-test40-utf8-with-perl)
(tramp-test40-utf8-with-ls, tramp-test41-file-system-info)
(tramp-test42-asynchronous-requests, tramp-test43-auto-load)
(tramp-test43-delay-load, tramp-test43-recursive-load)
(tramp-test43-remote-load-path, tramp-test44-unload): Rename.
2018-06-20 12:13:56 +02:00
João Távora
3a47f3921b Properly ignore stderr in elisp Flymake backend
Naively passing `null-device' as stderr creates a buffer named
"/dev/null" instead.  Pass a hidden buffer name instead.  (Bug#31902).

* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Pass
hidden buffer as make-process :stderr instead of null-device.
2018-06-19 21:00:26 +01:00
Daniel Colascione
a9b720ac50 Fix theme application
Fix an inverted test.  Patch due to Andy Moreton.

* lisp/cus-face.el (custom-theme-set-faces): Correct sense of
`custom--should-apply-setting' test.
2018-06-19 07:38:47 -07:00
Daniel Colascione
e5a15ee1c2 Unbreak dabbrev
This commit partially reverts
edb1f85a27, which results in dabbev
expansion failing due to trying to switch to the null buffer.

* lisp/dabbrev.el (dabbrev--progress-reporter): Restore variable.
(dabbrev--find-expansion): Restore original code.
2018-06-19 07:34:07 -07:00
Stefan Monnier
3057260b47 lisp/obsolete/*tls.el: Note when obsolescence was decided 2018-06-18 22:19:57 -04:00
João Távora
1e2e48c13c Skip a json.c test unless functions being tested exist
* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): Skip this test
unless functions being tested exist.
2018-06-19 03:02:09 +01:00
João Távora
d37d30cef5 Mark a specific electric-pair-mode test as an expected failure
See https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00535.html

* test/lisp/electric-tests.el
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings):
Mark as failing.
2018-06-19 02:53:10 +01:00
Mark Oteiza
5b9cc1508e Change errant if to when (Bug#31840)
* lisp/emacs-lisp/subr-x.el: Expand to 'when' instead of 'if'.
2018-06-18 21:27:26 -04:00
João Távora
6353387835 Electric-pair-mode lets modes choose how to skip whitespace
cc-mode.el-based major-modes with stricter syntax for invalid
NL-terminated strings might choose to have electric-pair-mode skip
some of whitespace into non-string-syntax regions, for the sake of
letting electric-pair-mode chomp that whitespace and make the string
valid again.

* lisp/elec-pair.el (electric-pair-post-self-insert-function): Call it.
(electric-pair-skip-whitespace-function): New buffer-local variable.
2018-06-19 02:19:24 +01:00
Noam Postavsky
5498acb5a2 Stop assuming .git is a directory in gitmerge.el
* admin/gitmerge.el (gitmerge-maybe-resume): Use 'git rev-parse
--git-dir' to find the git directory rather than assuming it is
.git/ (that assumption fails for separated worktrees).
2018-06-18 20:02:04 -04:00
Noam Postavsky
91ebbbfa10 Default to splash on current frame, if none visible (Bug#31169)
* lisp/startup.el (fancy-splash-frame): Default to current frame.
2018-06-18 20:02:03 -04:00
Noam Postavsky
97d5d1a1f4 Move tls.el and starttls.el to lisp/obsolete/ (Bug#31457)
* lisp/obsolete/tls.el: Moved from lisp/net/tls.el.
* lisp/gnus/nnimap.el:
* lisp/url/url-http.el: Don't require tls, since it's obsolete.
* lisp/net/network-stream.el: Only require tls if we actually try to
use it (i.e., when (gnutls-available-p) returns nil).  Declare some
functions to fix compilation warnings.

* lisp/obsolete/starttls.el: Moved from lisp/net/starttls.el.
* lisp/net/sieve-manage.el:
* lisp/net/network-stream.el: Don't require `starttls' at the
top-level, declare the variables and functions used instead.
(network-stream-open-starttls): Only require `starttls' if
needed (i.e., gnutls-available-p fails).

* etc/NEWS: Announce obsoletion.
2018-06-18 20:01:44 -04:00
Glenn Morris
1d9d35a4e8 Merge from origin/emacs-26
3673770 (origin/emacs-26) Fix vertical-motion with 'visual' line-numb...
d8bff53 ; CONTRIBUTE: Add a couple of nits.
2018-06-18 12:14:26 -07:00
Glenn Morris
96dd452be5 ; Merge from origin/emacs-26
The following commits were skipped:

48829cb Handle NSAttributedString inputs (bug#29837)
0deab3f Allow inserting non-BMP characters
2018-06-18 12:14:26 -07:00
Glenn Morris
988b53ed2d Merge from origin/emacs-26
ebe065f Prevent errant scroll on mouse click (Bug#31546)
ffd2018 Minor documentation fix
cf4dc95 * lisp/window.el (window-toggle-side-windows): Doc fix.  (Bug...
2018-06-18 12:14:26 -07:00
Glenn Morris
2f477cbe7f ; Merge from origin/emacs-26
The following commits were skipped:

e128434 Fix byte compilation of (eq foo 'default)
4753d79 Fix Bug#31846.  Do not merge with master
2018-06-18 12:14:26 -07:00
Glenn Morris
b455a1b2a8 Merge from origin/emacs-26
63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)

Conflicts:
	etc/NEWS
2018-06-18 12:14:25 -07:00
Glenn Morris
2c335777f7 ; Merge from origin/emacs-26
The following commit was skipped:

b635c54 Don’t set EMACS=t if Bash is 4.4 or newer
2018-06-18 12:14:24 -07:00
Glenn Morris
72b20dd7a8 Merge from origin/emacs-26
a933ebe Improve commentary in info.el
94e84a9 ; Further wording fix in tramp.texi
a5a0b11 Fix wording in tramp.texi
2933242 * doc/misc/tramp.texi (Remote shell setup): Fix typo.
2018-06-18 12:14:24 -07:00
Glenn Morris
0f7c3bae44 ; Merge from origin/emacs-26
The following commits were skipped:

6d4cbe8 Finish the Bug#11728 work: hg & git
66a491f Fix Bug#11728: show files updated by git
2018-06-18 12:14:24 -07:00
Glenn Morris
ef02c9fd1a Merge from origin/emacs-26
5bdc344 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
b6b793b ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744).
1aa906f Make 'tags' targets respect --with-silent-rules (Bug#31744)

Conflicts:
	test/Makefile.in
	test/README
2018-06-18 12:14:24 -07:00
Glenn Morris
e347754df7 ; Merge from origin/emacs-26
The following commit was skipped:

642c11f soap-client: Add byte-code compatibility function (Bug#31742)
2018-06-18 12:13:51 -07:00
Glenn Morris
012338f34e Merge from origin/emacs-26
9c6f35a * doc/lispref/files.texi (Unique File Names): Fix a typo.  (B...
2018-06-18 12:13:51 -07:00
Eli Zaretskii
36737705b4 Fix vertical-motion with 'visual' line-number display
* src/indent.c (Fvertical_motion): Don't exempt 'visual' sty;e of
line-number display from X coordinate adjustments.  (Bug#31875)
2018-06-18 19:39:16 +03:00
Eli Zaretskii
d8bff5305b ; CONTRIBUTE: Add a couple of nits. 2018-06-18 19:34:55 +03:00
Eli Zaretskii
bfc1dfd459 Improve documentation of recent changes in Comint
* lisp/comint.el (comint-insert-previous-argument)
(comint-arguments, comint-insert-previous-argument-from-end):
Doc fixes.
(comint-insert-previous-argument-from-end): Add :version.

* doc/emacs/misc.texi (Shell Ring): Fix a typo in the name of
'comint-insert-previous-argument'.  Document
'comint-insert-previous-argument-from-end'.  (Bug#25271)

* etc/NEWS: Reformat and rephrase the entry for recent Comint
changes.
2018-06-18 19:21:09 +03:00
Richard Stallman
3e2215642b rmail-summary-by-senders defaults to sender
* etc/NEWS: Mention this.
* lisp/mail/rmailsum.el (rmail-summary-by-senders):
Offer From field of current message as a default argument.
2018-06-18 00:21:22 -07:00
Dima Kogan
ba2ddadb53 comint-insert-previous-argument doesn't detect and ignore trailing &
This function is invoked in shell-mode by the user, and is meant to
emulate what M-. does in zsh and bash: it inserts an argument from a
previous command.  Neither zsh nor bash treat a trailing & specially:
M-. simply inserts it if it is encountered.  Emacs DID have extra
logic to detect and discard trailing &, but this logic was buggy, and
a && anywhere in the sequence would confuse it.  This patch simply
removes that logic to fix the bug and to emulate zsh and bash more
closely

* lisp/comint.el (comint-insert-previous-argument): don't detect and
  ignore trailing &
  (Bug#25271)
* etc/NEWS: Document this.
2018-06-17 22:59:21 -07:00
Dima Kogan
74f377b395 comint-insert-previous-argument counts args from start or from end
This function is invoked in shell-mode by the user, and is meant to
emulate what M-. does in zsh and bash: it inserts an argument from a
previous command.  Without a prefix argument, it inserts the last arg
from the previous command; with an argument INDEX, it inserts the
INDEX-th argument.  bash counts from the start, while zsh counts from
the end.  This patch adds a variable
`comint-insert-previous-argument-from-end' that emulates the zsh
behavior if non-nil.

* lisp/comint.el (comint-arguments): can take in negative arguments to count
  from the end, same as indexing in python.
  (comint-insert-previous-argument): if
  comint-insert-previous-argument-from-end is non-nil, INDEX counts
  arguments from the end; if nil, from the beginning
  (Bug#25271)
* etc/NEWS: Document this.
2018-06-17 22:58:46 -07:00
Glenn Morris
2d1b774dbc * test/lisp/simple-tests.el (simple-tests-async-shell-command-30280):
Use the correct emacs executable, not first in PATH.
2018-06-17 10:22:28 -07:00
Michael Heerdegen
45ee24efed Allow floats as 'pcase' QPATS
* lisp/emacs-lisp/pcase.el (\`): Extend semantics of QPATS to all
numbers.  Add a comment explaining why we disallow some atoms as
QPATS.
* doc/lispref/control.texi (Backquote Patterns): Update the paragraph
explaining QPATS.  Remove a sentence suggesting an analogy between
QPATS to self-quoting objects.
2018-06-17 15:22:30 +02:00
João Távora
fa9679ca48 Minor Flymake docstring fixes
* lisp/progmodes/flymake.el (flymake-diagnostic-functions):
Clarify meaning of :region in docstring.
(flymake-start): Fix broken docstring.
2018-06-17 12:41:39 +01:00
Alan Third
48829cba21 Handle NSAttributedString inputs (bug#29837)
; Do not merge to master.

* src/nsterm.m (EmacsView::insertText): Handle NSAttributedString.
2018-06-17 11:50:58 +01:00
Philipp Stephani
0deab3fbd8 Allow inserting non-BMP characters
* src/coding.h (UTF_16_HIGH_SURROGATE_P, UTF_16_LOW_SURROGATE_P): Move
from coding.c and document.
(surrogates_to_codepoint): New function.

* src/nsterm.m (insertText:): Properly handle surrogate pairs.

(cherry picked from commit 703ac3ea1c)
2018-06-17 11:50:58 +01:00
Aaron Jensen
ebe065fddf Prevent errant scroll on mouse click (Bug#31546)
* src/nsterm.m (ns_mouse_position): Use correct frame when determining
  mouse position.
* lisp/mouse.el (mouse-drag-track): Only account for mode-line height
  if `mode-line-format' is non-nil.
2018-06-17 11:50:57 +01:00
Eli Zaretskii
849631c1b7 Fix last change
* etc/NEWS: Fix last added entry.

* lisp/subr.el (dotimes-with-progress-reporter)
(dolist-with-progress-reporter): Fix the advertised signature.

* doc/lispref/display.texi (Progress): Fix last change.
(Bug#31696)  (Bug#31697)
2018-06-17 13:13:52 +03:00
Tino Calancha
edb1f85a27 Add new macro dolist-with-progress-reporter
* lisp/subr.el (dolist-with-progress-reporter): New macro (Bug#31697).
* lisp/cus-edit.el (custom-group-value-create): Use it.
* lisp/dabbrev.el (dabbrev--progress-reporter): Delete variable.
(dabbrev--find-expansion): Use dotimes-with-progress-reporter.

* doc/lispref/display.texi: Document the macro.
; * etc/NEWS: Announce it.
2018-06-17 18:28:34 +09:00
Tino Calancha
5099b3abb2 dotimes-with-progress-reporter: Polymorphic 2nd argument
* lisp/subr.el (dotimes-with-progress-reporter): Allow 2nd arg to be
a string or a progress reporter (Bug#31696).
* doc/lispref/display.texi (node Progress): Update manual.
2018-06-17 18:28:34 +09:00
Michael Albinus
39ccbacf9c Cleanup secrets-tests
* test/lisp/net/secrets-tests.el (secrets-test03-items)
(secrets-test04-search): Cleanup "session" collection initially.
2018-06-17 11:19:16 +02:00
Eli Zaretskii
ffd20184ca Minor documentation fix
* doc/lispref/windows.texi (Window Start and End): Improve
documentation and indexing of window-end.
2018-06-17 11:19:59 +03:00
Eli Zaretskii
c6f992b8e3 When possible, prefer UTF-8 as the safe encoding for saving
* lisp/international/mule-cmds.el (select-safe-coding-system):
If possible, offer UTF-8 as the default encoding.  (Bug#31807)
2018-06-17 10:40:29 +03:00
Eli Zaretskii
cf4dc95f16 * lisp/window.el (window-toggle-side-windows): Doc fix. (Bug#31858) 2018-06-17 08:42:11 +03:00
Eli Zaretskii
85a1e2f927 ; * etc/NEWS: Tweak a recently-added NEWS entry. 2018-06-17 08:22:23 +03:00
Daniel Colascione
aabaa9f8c8 Apply non-user themes only when asked
Theme settings now generally aren't actually applied until a call to
`enable-theme-, either one made explicitly or implicitly through
`load-theme' with NO-ENABLE nil.  This change has the effect of not
applying theme changes just because we load a lisp file containing a
theme specification.  The previous behavior is preserved for the
special case of the `user' theme, which is frequently used for
ad-hoc customization.

* lisp/cus-face.el (custom-theme-set-faces): Call
`custom--should-apply-setting' to decide whether to apply
a setting.

* lisp/custom.el (custom--should-apply-setting): New function.
(custom--inhibit-theme-enable): Add `apply-only-user' option;
default to it.
(custom-push-theme, custom-theme-set-variables): Call
`custom--should-apply-setting' to decide whether to apply
a setting.
2018-06-16 15:44:23 -07:00
Noam Postavsky
6021e1db92 Don't forget to analyze args of lambda lifted functions (Bug#30872)
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function.
(cconv--convert-function): Extracted from here.
(cconv-convert): Also use it here, in the lambda lifted case, so that
mutated args are properly accounted for.
* test/lisp/emacs-lisp/cconv-tests.el: New test.
2018-06-16 18:34:19 -04:00
Noam Postavsky
05345babc9 Fix off by one error in python-mode assertion (Bug#30964)
* lisp/progmodes/python.el (python-nav-end-of-statement): Don't assert
that string-start is strictly greater than last-string-end, because
the string end is a position outside of the string and may therefore
be the same as the following string's start.
* test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-2):
New test.
2018-06-16 18:34:19 -04:00
Daniel Colascione
92b609c572 Restore old echo_truncate condition
* src/keyboard.c (read_key_sequence): Restore old
echo_truncate condition.
2018-06-16 14:21:54 -07:00
Daniel Colascione
938d252d1c Make regex matching reentrant; update syntax during match
* src/lisp.h (compile_pattern): Remove prototype of
now-internal function.

* src/regex.c (POS_AS_IN_BUFFER): Consult gl_state instead of
re_match_object: the latter can change in Lisp.
(re_match_2_internal): Switch back to UPDATE_SYNTAX_* FROM
UPDATE_SYNTAX_FAST*, allowing calls into Lisp.

* src/regex.h (re_match_object): Uncomment declaration.

* src/search.c (struct regexp_cache): Add `busy' field.
(thaw_buffer_relocation): Delete; rely on unbind.
(compile_pattern_1): Assert pattern isn't busy.
(shrink_regexp_cache): Don't shrink busy patterns.
(clear_regexp_cache): Don't nuke busy patterns.
(unfreeze_pattern, freeze_pattern): New functions.
(compile_pattern): Return a regexp_cache pointer instead of the
re_pattern_buffer, allowing callers to use `freeze_pattern' if
needed.  Do not consider busy patterns as cache hit candidates;
error if we run out of non-busy cache entries.
(looking_at_1, fast_looking_at): Snapshot
Vinhibit_changing_match_data; mark pattern busy while we're
matching it; unbind.
(string_match_1, fast_string_match_internal)
(fast_c_string_match_ignore_case): Adjust for compile_pattern
return type.
(search_buffer_re): Regex code from old search_buffer moved here;
snapshot Vinhibit_changing_match_data; mark pattern busy while
we're matching it; unbind.
(search_buffer_non_re): Non-regex code from old search_buffer
moved here.
(search_buffer): Split into search_buffer_re,
search_buffer_non_re.
(syms_of_search): Staticpro re_match_object, even though we really
shouldn't have to.

* src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST):
(UPDATE_SYNTAX_TABLE_FAST): Remove.

* src/thread.h (struct thread_state): Remove m_re_match_object,
which is global again.  (It never needs to be preserved across
thread switch.)
2018-06-16 13:46:38 -07:00