]> git.eshelyaron.com Git - emacs.git/log
emacs.git
5 years agoExtend electric-layout-mode to handle more complex layouts
João Távora [Fri, 21 Dec 2018 18:00:08 +0000 (18:00 +0000)]
Extend electric-layout-mode to handle more complex layouts

Also, have it play nice with electric-pair-mode.

Multiple matching entries in `electric-layout-rules' are executed in
order of appearance.  When inserting a newline in the 'after-stay
rule, ensure electric-pair-open-newline-between-pairs is nil.

Arguably the logic behind electric-pair-open-newline-between-pairs
should be moved to electric-layout-mode, but the current rule-matching
engine doesn't allow for it.  The current solution seems to be good
enough for the situations reported in bug#33794.

* lisp/electric.el (electric-layout-rules): Adjust docstring.
(electric-layout-post-self-insert-function): Loop through rules.  Bind
electric-pair-open-newline-between-pairs to nil when handling
after-stay.

5 years ago; * etc/HELLO: Remove stray x-charset. (Bug#33851)
Eli Zaretskii [Sun, 23 Dec 2018 18:27:12 +0000 (20:27 +0200)]
; * etc/HELLO: Remove stray x-charset.  (Bug#33851)

5 years ago; Add +++ to recent entry in etc/NEWS
Michael Albinus [Sun, 23 Dec 2018 08:51:22 +0000 (09:51 +0100)]
; Add +++ to recent entry in etc/NEWS

5 years ago; Fix wording in etc/NEWS
Michael Albinus [Sun, 23 Dec 2018 08:50:27 +0000 (09:50 +0100)]
; Fix wording in etc/NEWS

5 years agoHandle `make-process' in Tramp and ange-ftp
Michael Albinus [Sun, 23 Dec 2018 08:48:05 +0000 (09:48 +0100)]
Handle `make-process' in Tramp and ange-ftp

* doc/lispref/processes.texi (Asynchronous Processes):
Explain, that not all file name handlers support `make-process'.

* lisp/net/ange-ftp.el:
* 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-rclone.el (tramp-rclone-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):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
* lisp/net/tramp.el (tramp-file-name-for-operation): Add `make-process'.

* lisp/vc/ediff-util.el:
* src/process.c:
* test/src/process-tests.el: Use "file name handler" consequently.

5 years ago* lisp/simple.el (next-error-no-select): Use save-selected-window.
Juri Linkov [Sat, 22 Dec 2018 23:52:25 +0000 (01:52 +0200)]
* lisp/simple.el (next-error-no-select): Use save-selected-window.

Let-bind display alist of display-buffer-overriding-action to
`(inhibit-same-window . t)'.  (Bug#32607)

5 years agoAdd file name handler support for 'make-process' (Bug#28691)
Philipp Stephani [Mon, 17 Dec 2018 20:47:46 +0000 (21:47 +0100)]
Add file name handler support for 'make-process' (Bug#28691)

* src/process.c (Fmake_process): Add new keyword argument
':file-handler'.
(syms_of_process) <make-process, :file-handler>: Define new symbols.

* lisp/files.el (file-name-non-special): Add support for
'make-process'.

* test/src/process-tests.el (make-process/file-handler/found)
(make-process/file-handler/not-found)
(make-process/file-handler/disable): New unit tests.
(process-tests--file-handler): New helper function.

* test/lisp/files-tests.el
(files-tests-file-name-non-special-make-process): New unit test.

* doc/lispref/files.texi (Magic File Names): Document that
'make-process' can invoke file name handlers.

* doc/lispref/processes.texi (Asynchronous Processes): Document
':file-handlers' argument to 'make-process'.

* etc/NEWS (Lisp Changes in Emacs 27.1): Mention new
:file-handler argument for 'make-process'.

5 years ago* etc/HELLO: Add missing charset properties for Japanese and Korean.
Eli Zaretskii [Sat, 22 Dec 2018 20:41:53 +0000 (22:41 +0200)]
* etc/HELLO: Add missing charset properties for Japanese and Korean.

5 years agoMacroexpand before evaluating in eval-expression (bis)
Charles A. Roelli [Sat, 22 Dec 2018 16:28:35 +0000 (17:28 +0100)]
Macroexpand before evaluating in eval-expression (bis)

* lisp/simple.el (eval-expression): Macroexpand before
evaluating.  This repeats the fix made for Bug#20730 in
another branch of the code a few lines down.

5 years agoldap.el: Do not set process-connection-type
Thomas Fitzsimmons [Sat, 22 Dec 2018 14:48:27 +0000 (09:48 -0500)]
ldap.el: Do not set process-connection-type

* lisp/net/ldap.el (ldap-search-internal): Leave
process-connection-type at its default value.  (Bug#33050)

5 years ago; Cosmetic changes to etc/NEWS
Michael Albinus [Sat, 22 Dec 2018 13:07:49 +0000 (14:07 +0100)]
; Cosmetic changes to etc/NEWS

5 years agoUse "file name handler" consequently
Michael Albinus [Sat, 22 Dec 2018 12:57:54 +0000 (13:57 +0100)]
Use "file name handler" consequently

* doc/lispref/files.texi:
* doc/lispref/processes.texi:
* doc/misc/ediff.texi:
* lisp/simple.el:
* lisp/vc/ediff-ptch.el:
* src/buffer.c:
* src/dired.c:
* src/fileio.c:
* src/image.c:
* src/insdel.c:
* src/w32fns.c: Use "file name handler" consequently.

5 years agoFix Bug#33735
Michael Albinus [Fri, 21 Dec 2018 12:53:20 +0000 (13:53 +0100)]
Fix Bug#33735

* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
Delete empty lines.  (Bug#33735)
(tramp-sh-inotifywait-process-filter): Use `string-match'.
(tramp-set-remote-path): Check for PIPE_BUF but PATH_MAX.

* test/lisp/filenotify-tests.el: Handle $REMOTE_FILE_NOTIFY_LIBRARY.
(file-notify--deftest-remote): Suppress vc-handled-backends.
(file-notify-test08-backup): Do not expect failure on hydra.
(Bug#33735).

5 years ago* test/lisp/filenotify-tests.el, test/lisp/shadowfile-tests.el:
Michael Albinus [Fri, 21 Dec 2018 08:41:04 +0000 (09:41 +0100)]
* test/lisp/filenotify-tests.el, test/lisp/shadowfile-tests.el:

Don't require tramp-sh, bug#33781 is fixed.

5 years ago* lisp/emacs-lisp/debug.el (debug): Add display-buffer-below-selected
Juri Linkov [Thu, 20 Dec 2018 23:57:34 +0000 (01:57 +0200)]
* lisp/emacs-lisp/debug.el (debug): Add display-buffer-below-selected

to display actions of pop-to-buffer, and `(window-min-height . 10)'
to display alist.  (Bug#32825)

5 years ago* lisp/windmove.el (windmove-delete-in-direction): Change prefix arg C-u
Juri Linkov [Thu, 20 Dec 2018 23:41:25 +0000 (01:41 +0200)]
* lisp/windmove.el (windmove-delete-in-direction): Change prefix arg C-u

to kill the buffer.  Add prefix arg M-0 to delete the selected window.
(Bug#32790)

5 years ago* lisp/window.el (switch-to-buffer-obey-display-actions): New defcustom.
Juri Linkov [Thu, 20 Dec 2018 23:28:31 +0000 (01:28 +0200)]
* lisp/window.el (switch-to-buffer-obey-display-actions): New defcustom.

(switch-to-buffer): Use it.  (Bug#32790)
(switch-to-buffer-preserve-window-point):  Mention it in docstring.

* lisp/windmove.el (windmove-display-in-direction): Mention it in docstring.

* doc/lispref/windows.texi (Switching Buffers):
Document switch-to-buffer-obey-display-actions.

5 years ago* lisp/hi-lock.el (hi-salmon, hi-aquamarine): New faces. (Bug#33398)
Juri Linkov [Thu, 20 Dec 2018 23:00:44 +0000 (01:00 +0200)]
* lisp/hi-lock.el (hi-salmon, hi-aquamarine): New faces.  (Bug#33398)

(hi-lock-face-defaults): Add them.
(hi-green-b, hi-red-b): Tone down foreground colors.

5 years agoMerge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:17 +0000 (07:51 -0800)]
Merge from origin/emacs-26

081fb69 (origin/emacs-26) Check result from c-backward-token-2 to avo...
f4ea746 cl-make-random-state was not copying its arg

5 years ago; Merge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:17 +0000 (07:51 -0800)]
; Merge from origin/emacs-26

The following commits were skipped:

fda43a7 Skip a vc-bzr test if run as root
4370b8e ; Copyright year fix No need to merge to master
305aca0 Backport: Handle unread-command-events consistently (bug#23980)

5 years agoMerge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:16 +0000 (07:51 -0800)]
Merge from origin/emacs-26

4c6c327 Restrict downcasing in elisp xref tests (bug#25534)
ab8ed41 Avoid test failures if directory name looks like a regexp

5 years ago; Merge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:16 +0000 (07:51 -0800)]
; Merge from origin/emacs-26

The following commit was skipped:

80e9856 Fix Bug#33524

5 years agoMerge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:15 +0000 (07:51 -0800)]
Merge from origin/emacs-26

5825279 * doc/lispintro/emacs-lisp-intro.texi (Finding More): Fix xref.

5 years ago; Merge from origin/emacs-26
Glenn Morris [Thu, 20 Dec 2018 15:51:15 +0000 (07:51 -0800)]
; Merge from origin/emacs-26

The following commit was skipped:

e8bb042 More porting to GCC 8 of --enable-gcc-warnings

5 years ago* lisp/emacs-lisp/map.el: Add support for plists
Stefan Monnier [Thu, 20 Dec 2018 13:40:43 +0000 (08:40 -0500)]
* lisp/emacs-lisp/map.el: Add support for plists

(map--plist-p, map--plist-delete): New functions.
(map-elt, map-delete, map-length, map-into, map-put!, map-insert)
(map-apply, map-do): Handle the plist case.

* test/lisp/emacs-lisp/map-tests.el (with-maps-do): Add sample plist.
(test-map-put!): The behavior of map-put! is not the same for plists as
for alists.

5 years ago* test/lisp/net/tramp-tests.el (tramp-test32-environment-variables):
Michael Albinus [Thu, 20 Dec 2018 13:20:36 +0000 (14:20 +0100)]
* test/lisp/net/tramp-tests.el (tramp-test32-environment-variables):

Remove expected failure.

5 years agoCheck result from c-backward-token-2 to avoid infinite loop
Alan Mackenzie [Thu, 20 Dec 2018 12:21:16 +0000 (12:21 +0000)]
Check result from c-backward-token-2 to avoid infinite loop

This fixes bug #33784.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context): While moving back
over enclosing parentheses, check that c-backward-token-2 actually moves.

5 years agoFix Bug#33781
Michael Albinus [Thu, 20 Dec 2018 10:07:15 +0000 (11:07 +0100)]
Fix Bug#33781

* lisp/net/tramp-sh.el (tramp-set-remote-path): Use a temporary
file for setting $PATH, if it exceeds PATH_MAX on the remote system.
(tramp-send-command-and-read): Ignore errors if NOERROR.  (Bug#33781)

* test/lisp/net/tramp-tests.el (tramp-test34-remote-path): New test.

5 years agoSkip rather than fail in flymake tests
Glenn Morris [Wed, 19 Dec 2018 23:37:04 +0000 (18:37 -0500)]
Skip rather than fail in flymake tests

* test/lisp/progmodes/flymake-tests.el
(flymake-tests--wait-for-backends): Skip rather than fail if
backends are slow to respond.  This always seems like a temporary
system glitch and not something that should be reported as a failure.

5 years agoMake gnus-newsgroup-name local var available to gnus-summary-mode
Eric Abrahamsen [Wed, 19 Dec 2018 22:11:14 +0000 (14:11 -0800)]
Make gnus-newsgroup-name local var available to gnus-summary-mode

* lisp/gnus/gnus-sum.el (gnus-summary-mode-group): New defvar for
  passing gnus-newsgroup-name (a local variable) into the body of
  gnus-summary-mode, so that it's available to gnus-summary-mode-hook.

5 years ago* lisp/vc/diff-mode.el (diff-syntax-fontify-props): Use font-lock-ensure
Juri Linkov [Wed, 19 Dec 2018 21:55:32 +0000 (23:55 +0200)]
* lisp/vc/diff-mode.el (diff-syntax-fontify-props): Use font-lock-ensure

unconditionally.  (Bug#33798)

5 years agocl-make-random-state was not copying its arg
Paul Eggert [Wed, 19 Dec 2018 21:42:21 +0000 (13:42 -0800)]
cl-make-random-state was not copying its arg

Problem reported by Xu Chunyang (Bug#33731).
* lisp/emacs-lisp/cl-extra.el (cl-make-random-state):
Use copy-sequence, not copy-tree, so that the record is copied.
* test/lisp/emacs-lisp/cl-extra-tests.el:
(cl-extra-test-cl-make-random-state): New test.

5 years agoMinor fixes/simplifications to time functions
Paul Eggert [Wed, 19 Dec 2018 20:57:25 +0000 (12:57 -0800)]
Minor fixes/simplifications to time functions

* doc/lispintro/emacs-lisp-intro.texi (Files List): Simplify.
* doc/lispref/os.texi (Time of Day): Mention format-time-string
as an alternative to current-time-string.
* lisp/arc-mode.el (archive-unixdate, archive-unixtime):
Port better to future versions of Emacs where (COUNT . HZ)
will take precedence to (HI . LO).
* lisp/arc-mode.el (archive-unixtime):
* lisp/calendar/todo-mode.el (todo-insert-item--basic)
(todo-item-done, todo-read-time):
Prefer format-time-string to substringing current-time-string.
* lisp/calc/calc-forms.el (calc-time, calcFunc-now):
Prefer decode-time to parsing the output of current-time-string.
* lisp/emacs-lisp/cl-extra.el (cl--random-time):
Prefer encode-time to hashing the output of current-time-string.
* lisp/gnus/gnus-score.el (gnus-score-headers)
(gnus-score-adaptive):
Avoid stringifying and then reparsing timestamp.
* src/timefns.c (Fencode_time): Omit redundant assignment.

5 years agoSkip a vc-bzr test if run as root
Glenn Morris [Wed, 19 Dec 2018 20:06:18 +0000 (15:06 -0500)]
Skip a vc-bzr test if run as root

* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-faulty-bzr-autoloads):
Skip this test when run as root.  This works around a race
condition in root-specific code in vc-mode-line when deleting a file.

; Do not merge to master, instead fix vc-mode-line there.

5 years ago* lisp/net/tramp-sh.el (tramp-set-remote-path): Send a warning, if
Michael Albinus [Wed, 19 Dec 2018 19:29:29 +0000 (20:29 +0100)]
* lisp/net/tramp-sh.el (tramp-set-remote-path): Send a warning, if

$PATH exceeds PATH_MAX on the remote system.

5 years ago* src/editfns.c (Finsert_char): Skip unnecessary fixnum check.
Nicholas Drozd [Wed, 19 Dec 2018 16:55:54 +0000 (08:55 -0800)]
* src/editfns.c (Finsert_char): Skip unnecessary fixnum check.

5 years ago; Copyright year fix
Glenn Morris [Wed, 19 Dec 2018 16:29:21 +0000 (08:29 -0800)]
; Copyright year fix
No need to merge to master

5 years agoBackport: Handle unread-command-events consistently (bug#23980)
Chris Feng [Tue, 7 Nov 2017 16:39:43 +0000 (00:39 +0800)]
Backport: Handle unread-command-events consistently (bug#23980)

* src/keyboard.c (read_char): Events put into `unread-command-events'
with the form (t . EVENT) should always have the t stripped when read
out.
* test/src/keyboard-tests.el: New tests for `unread-command-events'.

(cherry picked from commit 1f3f4b1296613b8cdc0632a68fde86e86ddad866)

5 years agoSkip a remote filenotify test on hydra
Glenn Morris [Wed, 19 Dec 2018 07:21:37 +0000 (23:21 -0800)]
Skip a remote filenotify test on hydra

* test/lisp/filenotify-tests.el (file-notify--deftest-remote):
Add optional argument to skip test.
(file-notify-test07-many-events-remote): Skip on hydra.nixos.org.

5 years ago* lisp/font-lock.el: Use lexical-binding
Stefan Monnier [Wed, 19 Dec 2018 04:26:49 +0000 (23:26 -0500)]
* lisp/font-lock.el: Use lexical-binding

(font-lock-initial-fontify, font-lock-compile-keywords):
Silence compiler warning.
(font-lock-ensure-function): Fix some problems in last commit.

5 years ago* lisp/font-lock.el (font-lock-ensure-function): Fix bug#33798
Stefan Monnier [Wed, 19 Dec 2018 04:05:36 +0000 (23:05 -0500)]
* lisp/font-lock.el (font-lock-ensure-function): Fix bug#33798

5 years agoRestrict downcasing in elisp xref tests (bug#25534)
Glenn Morris [Wed, 19 Dec 2018 02:18:31 +0000 (21:18 -0500)]
Restrict downcasing in elisp xref tests (bug#25534)

The tests happen to not fail at the moment because find-library-name
now has an extra feature, find-library--from-load-history, which
happens to do a case-insensitive regexp match; but still it seems
better not to rely on this.

* test/lisp/progmodes/elisp-mode-tests.el (xref--case-insensitive):
New variable.
(xref-elisp-test-run, emacs-test-dir): Only downcase if the
filesystem seems to be case-insensitive.

5 years agoMore font-lock improvements for diff-mode
Juri Linkov [Tue, 18 Dec 2018 23:10:09 +0000 (01:10 +0200)]
More font-lock improvements for diff-mode

* lisp/vc/diff-mode.el (diff-font-lock-keywords): Use diff-header face
for git index lines (like already used for bzr index lines).
Use diff-file-header face for binary file headers.
(diff-find-source-location): Use expand-file-name for vc-find-revision.
(diff--font-lock-prettify): Use diff-indicator-* faces for
left-fringe indicators.
(diff-syntax-fontify-props): Optimize to not use text-property-not-all
for font-lock-ensure.

* lisp/replace.el (occur-engine-line): Simplify to use font-lock-ensure
without text-property-not-all.

5 years agoFontify one-line diffs without the final newline (bug#33567)
Juri Linkov [Tue, 18 Dec 2018 22:55:15 +0000 (00:55 +0200)]
Fontify one-line diffs without the final newline (bug#33567)

* lisp/vc/diff-mode.el (diff-hunk-text, diff-syntax-fontify-hunk):
Skip lines beginning with backslash like "\ No newline at end of file".
(diff-syntax-fontify-hunk): Use string-trim-right.
For one-line diffs use 1 explicitly in the list of line numbers.

5 years agoAvoid test failures if directory name looks like a regexp
Rob Browning [Tue, 18 Dec 2018 20:34:01 +0000 (15:34 -0500)]
Avoid test failures if directory name looks like a regexp

Taken from <https://sources.debian.org/patches/emacs/1:26.1+1-1>
* test/lisp/ibuffer-tests.el (ibuffer-filter-inclusion-3):
* test/lisp/net/tramp-tests.el (tramp-test42-remote-load-path):
Regexp-quote file names to avoid failures with directory names
of the form "build/emacs-i87jK3/emacs-26.1+1/...".

5 years agoSupport (ash INTEGER BIGNUM)
Paul Eggert [Tue, 18 Dec 2018 20:21:27 +0000 (12:21 -0800)]
Support (ash INTEGER BIGNUM)

* src/data.c (emacs_mpz_mul_2exp): 2nd arg is now a
nonnegative EMACS_INT not mp_bitcnt_t, to simplify checking.
(Fash): Support COUNT values that are bignums or that
exceed mp_bitcnt_t range.
* test/src/data-tests.el (data-tests-ash-lsh): Test this.

5 years agoFix Bug#33524
Michael Albinus [Mon, 17 Dec 2018 10:56:05 +0000 (11:56 +0100)]
Fix Bug#33524

* lisp/progmodes/flymake-proc.el
(flymake-proc-create-temp-with-folder-structure):
Unquote file-name.  (Bug#33524)

5 years agoExpect tramp environment test to fail on hydra
Glenn Morris [Tue, 18 Dec 2018 16:29:05 +0000 (08:29 -0800)]
Expect tramp environment test to fail on hydra

* test/lisp/net/tramp-tests.el (tramp-test32-environment-variables):
Expect failure on hydra.nixos.org.

5 years agoA filenotify test now passes on hydra
Glenn Morris [Tue, 18 Dec 2018 16:25:55 +0000 (08:25 -0800)]
A filenotify test now passes on hydra

* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Remote test now passes on hydra.nixos.org, since PATH
workaround for bug#33781.

5 years agoFix Bug#33781
Michael Albinus [Tue, 18 Dec 2018 12:58:00 +0000 (13:58 +0100)]
Fix Bug#33781

* lisp/net/tramp-cache.el (tramp-connection-properties):
* lisp/net/tramp-sh.el (tramp-remote-path)
(tramp-remote-process-environment, tramp-sh-extra-args):
Reinsert autoload cookie.  (Bug#33781)

* test/lisp/net/tramp-tests.el: Do not require tramp-sh before
changing tramp-remote-path.

5 years agoNew convenience functions in seq.el
Nicolas Petton [Tue, 18 Dec 2018 08:42:50 +0000 (09:42 +0100)]
New convenience functions in seq.el

Functions to access the first or all but the first elements of
sequences have been repeatedly asked for (the last occurrence being
https://github.com/NicolasPetton/seq.el/issues/9).

* lisp/emacs-lisp/seq.el (seq-first, seq-rest): New functions.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-first, test-seq-rest):
New tests for seq-first and seq-rest.

5 years agoTiny ert-summarize-tests-batch-and-exit improvement
Glenn Morris [Tue, 18 Dec 2018 06:52:34 +0000 (22:52 -0800)]
Tiny ert-summarize-tests-batch-and-exit improvement

* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit):
Report the details of unexpected passes as well as failures.

5 years agoSyntactic fontification of diff hunks (bug#33567)
Juri Linkov [Mon, 17 Dec 2018 23:11:15 +0000 (01:11 +0200)]
Syntactic fontification of diff hunks (bug#33567)

* lisp/vc/diff-mode.el (diff-font-lock-syntax): New defcustom.
(diff-default-directory): New buffer-local variable.
(diff-indicator-removed, diff-indicator-added)
(diff-indicator-changed): Set foreground to distinctive colors.
(diff-context): Remove colors to make room for syntax highlighting.
(diff-font-lock-keywords): Add diff--font-lock-syntax.
(diff--font-lock-cleanup): Remove diff-mode syntax overlays.
(diff--font-lock-syntax, diff--font-lock-syntax--refresh)
(diff-syntax-fontify-revisions, diff-syntax-fontify-hunk)
(diff-syntax-fontify-props): New functions.

* lisp/vc/diff.el (diff-no-select): Set diff-default-directory to
default-directory.

* doc/emacs/files.texi (Diff Mode): Document diff-font-lock-syntax.

5 years ago* doc/lispintro/emacs-lisp-intro.texi (Finding More): Fix xref.
Glenn Morris [Mon, 17 Dec 2018 22:46:48 +0000 (17:46 -0500)]
* doc/lispintro/emacs-lisp-intro.texi (Finding More): Fix xref.

5 years agoMake org-protocol-flatten always an alias
Paul Eggert [Mon, 17 Dec 2018 21:26:42 +0000 (13:26 -0800)]
Make org-protocol-flatten always an alias

* lisp/org/org-protocol.el (org-protocol-flatten):
Rewrite as top-level alias, as per Stefan’s suggestion,
to avoid compiler warnings.

5 years ago* lisp/emacs-lisp/map.el: Avoid special casing lists.
Stefan Monnier [Mon, 17 Dec 2018 19:51:01 +0000 (14:51 -0500)]
* lisp/emacs-lisp/map.el: Avoid special casing lists.

(map-not-inplace, map-inplace): New errors.
(map-insert): New generic function.
(map-put!): Signal map-not-inplace rather than a generic 'error'.
(map-elt): Use map-not-inplace and map-insert to avoid hardcoding
a special case for lists.

* test/lisp/emacs-lisp/map-tests.el (test-map-put!): Rename from
test-map-put.  Also test the errors signaled.

5 years agoAvoid tests failures on hydra due to Tramp autoload changes
Glenn Morris [Mon, 17 Dec 2018 18:52:46 +0000 (13:52 -0500)]
Avoid tests failures on hydra due to Tramp autoload changes

* test/lisp/filenotify-tests.el, test/lisp/shadowfile-tests.el:
* test/lisp/net/tramp-tests.el: Require tramp-sh before changing
tramp-remote-path.

5 years agoOne more flatten-tree test
Paul Eggert [Mon, 17 Dec 2018 18:19:48 +0000 (10:19 -0800)]
One more flatten-tree test

* test/lisp/subr-tests.el (subr-tests-flatten-tree):
Add a test for lots of nothing.

5 years agoSome more flatten-tree aliases
Paul Eggert [Mon, 17 Dec 2018 18:19:23 +0000 (10:19 -0800)]
Some more flatten-tree aliases

* lisp/allout.el (allout-flatten):
* lisp/progmodes/hideif.el (hif-flatten):
Now an obsolete alias for flatten-tree.  All callers changed.
* lisp/org/org-protocol.el (org-protocol-flatten):
Make it an alias for flatten-tree if available.
* lisp/progmodes/js.el (js--flatten-list):
Remove alias.  We shouldn’t need obsolete function aliases for
private functions.

5 years agoImprove flatten-tree documentation
Paul Eggert [Mon, 17 Dec 2018 17:55:06 +0000 (09:55 -0800)]
Improve flatten-tree documentation

* doc/lispref/lists.texi (Building Lists):
* lisp/subr.el (flatten-tree):
Don’t imply that flatten-tree modifies its argument.
Clarify wording.

5 years agoImprove flatten-tree performance
Paul Eggert [Mon, 17 Dec 2018 17:54:14 +0000 (09:54 -0800)]
Improve flatten-tree performance

* lisp/subr.el (flatten-tree): Improve performance by calling
‘cons’ once rather than twice when a cons cell is popped.

5 years agoAssume ‘emacs’ is defined in Emacs-only code
Paul Eggert [Mon, 17 Dec 2018 17:31:08 +0000 (09:31 -0800)]
Assume ‘emacs’ is defined in Emacs-only code

* src/charset.c, src/coding.c, src/coding.h, src/gmalloc.c:
* src/ralloc.c, src/regex-emacs.c: Simplify slightly by
assuming that ‘emacs’ is defined.  These modules have long
been specific to Emacs, and are not used elsewhere.

5 years agoMore porting to GCC 8 of --enable-gcc-warnings
Paul Eggert [Mon, 17 Dec 2018 16:11:55 +0000 (08:11 -0800)]
More porting to GCC 8 of --enable-gcc-warnings

Backport from master.
I ran into this when building Emacs 26 with GCC 8 on Fedora 29 x86.
* lwlib/lwlib-Xaw.h (xaw_update_one_value, xaw_popup_menu):
* lwlib/lwlib-Xlw.h (xlw_update_one_value, xlw_pop_instance):
* lwlib/lwlib.h (lw_allow_resizing, lw_set_main_areas) [!USE_MOTIF]:
No longer const.
* src/emacs-module.c: Ignore -Wcast-function-type.

5 years agoUse `flatten-tree' in Tramp
Michael Albinus [Mon, 17 Dec 2018 11:26:58 +0000 (12:26 +0100)]
Use `flatten-tree' in Tramp

* lisp/net/tramp-compat.el (tramp-compat-flatten-tree): New defun.
(tramp-compat-flatten-list): Remove.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command): Use it.

5 years agoNew function flatten-tree
Alex Branham [Mon, 17 Dec 2018 11:15:09 +0000 (12:15 +0100)]
New function flatten-tree

Co-authored-by: Basil L. Contovounesios <contovob@tcd.ie>
* doc/lispref/lists.texi: Document `flatten-tree'.

* lisp/progmodes/js.el (js--maybe-join):
* lisp/printing.el (pr-switches):
* lisp/lpr.el (lpr-print-region):
* lisp/gnus/nnimap.el (nnimap-find-wanted-parts):
* lisp/gnus/message.el (message-talkative-question):
* lisp/gnus/gnus-sum.el (gnus-remove-thread)
(gnus-thread-highest-number, gnus-thread-latest-date):
* lisp/eshell/esh-util.el (eshell-flatten-and-stringify):
* lisp/eshell/esh-opt.el (eshell-eval-using-options):
* lisp/eshell/esh-ext.el (eshell-external-command):
* lisp/eshell/em-xtra.el (eshell/expr):
* lisp/eshell/em-unix.el (eshell/rm, eshell-mvcpln-template)
(eshell/cat, eshell/make, eshell-poor-mans-grep, eshell-grep)
(eshell/du, eshell/time, eshell/diff, eshell/locate):
* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo):
* lisp/eshell/em-term.el (eshell-exec-visual):
* lisp/eshell/em-dirs.el (eshell-dirs-substitute-cd, eshell/cd):
* lisp/eshell/em-basic.el (eshell/printnl):
Use new flatten-tree.

* lisp/progmodes/js.el (js--flatten-list):
* lisp/lpr.el (lpr-flatten-list):
* lisp/gnus/message.el (message-flatten-list):
* lisp/eshell/esh-util.el (eshell-flatten-list):
Obsolete in favor of Emacs-wide `flatten-tree'.

* lisp/subr.el (flatten-list): Alias to `flatten-tree' for
discoverability.

* lisp/subr.el (flatten-tree): New defun.

* test/lisp/subr-tests.el (subr-tests-flatten-tree): New test.

5 years agoFix Bug#33524
Michael Albinus [Mon, 17 Dec 2018 10:56:05 +0000 (11:56 +0100)]
Fix Bug#33524

* lisp/progmodes/flymake-proc.el
(flymake-proc-create-temp-with-folder-structure):
Unquote file-name.  (Bug#33524)

5 years agoReduce autoloaded objects in Tramp
Michael Albinus [Mon, 17 Dec 2018 10:50:06 +0000 (11:50 +0100)]
Reduce autoloaded objects in Tramp

* lisp/net/tramp-adb.el (tramp-adb-program)
(tramp-adb-connect-if-not-connected, tramp-adb-prompt):
Remove autoload cookie.

* lisp/net/tramp-cache.el (tramp-connection-properties)
(tramp-persistency-file-name): Remove autoload cookie.

* lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp):
Use `tramp-autoload' cookie.

* lisp/net/tramp-gvfs.el (tramp-gvfs-zeroconf-domain):
Remove autoload cookie.

* lisp/net/tramp-rclone.el (tramp-rclone-program): Remove autoload
cookie.
(tramp-set-completion-function): Use `tramp--with-startup'.

* lisp/net/tramp-sh.el (tramp-inline-compress-start-size)
(tramp-copy-size-limit, tramp-histfile-override)
(tramp-use-ssh-controlmaster-options, tramp-remote-path)
(tramp-remote-process-environment, tramp-sh-extra-args):
Remove autoload cookie.
(tramp-stat-marker, tramp-stat-quoted-marker): Move to tramp.el.

* lisp/net/tramp-smb.el (tramp-smb-program)
(tramp-smb-acl-program, tramp-smb-conf)
(tramp-smb-winexe-program, tramp-smb-winexe-shell-command)
(tramp-smb-winexe-shell-command-switch): Remove autoload cookie.

* lisp/net/tramp-sudoedit.el (server, tramp-sh): Do not require.

* lisp/net/tramp.el (tramp--startup-hook): Define.
(tramp-stat-marker, tramp-stat-quoted-marker): New defconsts,
taken from tramp-sh.el.

* test/lisp/net/tramp-archive-tests.el (tramp-copy-size-limit)
(tramp-persistency-file-name): Declare.

* test/lisp/net/tramp-tests.el (tramp-connection-properties)
(tramp-display-escape-sequence-regexp)
(tramp-inline-compress-start-size, tramp-remote-path): Declare.

5 years ago* lisp/emacs-lisp/macroexp.el: Don't hide backtrace
Stefan Monnier [Mon, 17 Dec 2018 04:39:51 +0000 (23:39 -0500)]
* lisp/emacs-lisp/macroexp.el: Don't hide backtrace

(macroexp--compiler-macro): Use condition-case-unless-debug.

5 years agoJsonrpc error handlers can now safely call jsonrpc-shutdown
João Távora [Sun, 16 Dec 2018 16:55:09 +0000 (16:55 +0000)]
Jsonrpc error handlers can now safely call jsonrpc-shutdown

Previously, if an error handler called jsonrpc-shutdown, and if that
error handler was being called from the process sentinel,
jsonrpc-shutdown would infloop waiting for jsonrpc-sentinel-done to be
set.

Rename the process property jsonrpc-sentinel-done to
jsonrpc-sentinel-cleanup-started, arrange for it to be set earlier
in the sentinel, and also check for it earlier in jsonrpc-shutdown.

* lisp/jsonrpc.el (Version): Bump to 1.0.7.
(jsonrpc--process-sentinel): Set jsonrpc-sentinel-cleanup-started
a bit earlier than previous jsonrpc-sentinel-done.
(jsonrpc-shutdown): Query jsonrpc-sentinel-cleanup-started

5 years agoUpdate from Gnulib
Paul Eggert [Sun, 16 Dec 2018 16:11:35 +0000 (08:11 -0800)]
Update from Gnulib

This incorporates:
2018-12-16 regex: propagate fix for glibc bug 18040
2018-12-16 obstack, libc-config: Support HP-UX cc in C99 mode
2018-12-15 regex: work around a bug in glibc-2.27 and prior
2018-12-13 localtime-buffer: Avoid endless recursion
* build-aux/config.guess, build-aux/config.sub, lib/cdefs.h:
* lib/gettext.h, lib/localtime-buffer.c, lib/regexec.c, m4/regex.m4:
Copy from Gnulib.

5 years ago* lisp/net/tramp: Rework mutual dependencies
Stefan Monnier [Sun, 16 Dec 2018 15:32:53 +0000 (10:32 -0500)]
* lisp/net/tramp: Rework mutual dependencies

Functionally split tramp-loaddefs.el into two parts: one part run
while loading it at the very beginning of loading tramp.el (holding plain
autoloads and declarations), and another run at the very end of loading
tramp.el (holding setup code).
This should reduce infinite-recursion problems while loading.

* lisp/net/tramp.el: Require tramp-loaddefs at beginning.
Run (new and internal) tramp--startup-hook at the end.
Remove all tramp-autoloads.  Prefer tramp--with-startup over
eval-after-load.
(tramp--with-startup): New macro.
(tramp-set-syntax): Show the new value rather than the old value in the
error message.
(tramp-syntax-values): Explicitly return 'values'.
(tramp-prefix-format, tramp-prefix-regexp, tramp-method-regexp)
(tramp-postfix-method-format, tramp-postfix-method-regexp)
(tramp-prefix-ipv6-format, tramp-prefix-ipv6-regexp)
(tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp)
(tramp-postfix-host-format, tramp-postfix-host-regexp)
(tramp-remote-file-name-spec-regexp, tramp-file-name-structure)
(tramp-completion-file-name-regexp): Don't initialize in the declaration,
since it's recomputed at the end anyway.
(tramp-time-dont-know, tramp-time-doesnt-exist): Move before first use.

* lisp/net/tramp-compat.el: Don't require tramp-loaddefs any more.
(tramp-compat-tramp-syntax): Declare tramp-syntax.

* lisp/net/tramp-smb.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-adb.el: Wrap all autoloaded setup operations within
tramp--with-startup.

* lisp/net/tramp-sh.el: Wrap all autoloaded setup operations within
tramp--with-startup.
(tramp-display-escape-sequence-regexp)
(tramp-device-escape-sequence-regexp): Don't tramp-autoload any more.
(tramp-stat-marker): Use eval-and-compile rather than tramp-autoload.

* lisp/net/tramp-sudoedit.el: Wrap all autoloaded setup operations within
tramp--with-startup.
Require tramp-sh at compile-time to precompute some regexps based on
tramp-stat-marker.

5 years agoAdd Tramp sudoedit method
Michael Albinus [Sun, 16 Dec 2018 14:49:07 +0000 (15:49 +0100)]
Add Tramp sudoedit method

* doc/misc/tramp.texi (Quick Start Guide): New section "Using sudoedit".
(External methods) <sudoedit>: Describe.

* 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-rclone.el (tramp-rclone-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):
Add handler.

* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-uid-gid): Rename from
`tramp-sh-handle-set-file-uid-gid'.  Handle only remote file names.

* lisp/net/tramp-sudoedit.el: New file.

* lisp/net/tramp.el (tramp-file-name-for-operation): Handle also
`tramp-set-file-uid-gid'.
(tramp-set-file-uid-gid): New defun.
(tramp-get-local-uid, tramp-get-local-gid): Cache result.

* test/lisp/net/tramp-tests.el (tramp--test-sudoedit-p): New defun.
(tramp-test20-file-modes, tramp-test22-file-times)
(tramp--test-sudoedit-p): Use it.

5 years agoRephrase a confusing sentence in the jsonrpc.el manual
João Távora [Sun, 16 Dec 2018 11:45:27 +0000 (11:45 +0000)]
Rephrase a confusing sentence in the jsonrpc.el manual

* doc/lispref/text.texi (JSONRPC Overview): Rephrase first
sentence on building JSONRPC applications.

5 years agoExpect two epg tests to fail on hydra
Glenn Morris [Sun, 16 Dec 2018 02:17:01 +0000 (18:17 -0800)]
Expect two epg tests to fail on hydra

* test/lisp/epg-tests.el (epg-decrypt-1, epg-roundtrip-1):
These currently fail for unknown reasons on hydra.nixos.org.

5 years ago; * src/macuvs.h: Regenerate with new header.
Glenn Morris [Sat, 15 Dec 2018 23:23:58 +0000 (15:23 -0800)]
; * src/macuvs.h: Regenerate with new header.

5 years agoMerge from origin/emacs-26
Glenn Morris [Sat, 15 Dec 2018 23:19:25 +0000 (15:19 -0800)]
Merge from origin/emacs-26

fa953b5 (origin/emacs-26) Fix an epg test for recent GnuPG versions (...
3015636 Document font structure layout constraints
f14d574 Document font structure layout constraints
f519aa1 Fix display of line numbers in empty lines beyond EOB
24b5026 Fix redisplay when a window's scroll bar or fringes are changed
5d1b158 Tiny markup fix in Elisp manual

5 years agoEnsure flymake tests use gcc rather than $CC
Glenn Morris [Sat, 15 Dec 2018 23:08:28 +0000 (15:08 -0800)]
Ensure flymake tests use gcc rather than $CC

* test/lisp/progmodes/flymake-resources/Makefile: Force use of gcc.
This seems to be what the tests expect.  (Bug#33735)

5 years agoSuppress filenotify remote test failures on hydra.nixos.org
Glenn Morris [Sat, 15 Dec 2018 23:04:24 +0000 (15:04 -0800)]
Suppress filenotify remote test failures on hydra.nixos.org

* test/lisp/filenotify-tests.el (file-notify--deftest-remote):
Add optional argument to pass expected-result.
(file-notify-test04-autorevert-remote)
(file-notify-test08-backup-remote): Expect failure on hydra (bug#33735).

5 years agoFix an eshell ls dired test for non-recent files
Glenn Morris [Sat, 15 Dec 2018 22:49:46 +0000 (14:49 -0800)]
Fix an eshell ls dired test for non-recent files

* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844):
Work around an eshell issue with non-recent files.  (Bug#33734)

5 years agoFix an epg test for recent GnuPG versions (bug#33439)
Glenn Morris [Sat, 15 Dec 2018 01:09:02 +0000 (20:09 -0500)]
Fix an epg test for recent GnuPG versions (bug#33439)

* test/lisp/epg-tests.el (epg-decrypt-1):
Tell recent GnuPG (e.g. 2.2.11) not to worry about missing MDC.

5 years ago* make-dist: Improve no-byte-compile check.
Glenn Morris [Fri, 14 Dec 2018 20:41:17 +0000 (15:41 -0500)]
* make-dist: Improve no-byte-compile check.

5 years ago* make-dist: Improve tempfile handling.
Glenn Morris [Fri, 14 Dec 2018 20:40:15 +0000 (15:40 -0500)]
* make-dist: Improve tempfile handling.

Prompted by /tmp/out existing and being owned by another user.

5 years ago* make-dist: Silence test of tar functionality.
Glenn Morris [Fri, 14 Dec 2018 19:57:11 +0000 (14:57 -0500)]
* make-dist: Silence test of tar functionality.

5 years ago* lisp/emacs-lisp/map.el: Fix recent changes
Basil L. Contovounesios [Fri, 14 Dec 2018 14:46:47 +0000 (14:46 +0000)]
* lisp/emacs-lisp/map.el: Fix recent changes

(map-empty-p): Add method for lists which avoids computing their
entire length.
(map-contains-key): Check for alist membership by comparing against
DEFAULT argument returned by alist-get.
(map-put!): Reconcile argument name with that used in docstring.

5 years agoDocument font structure layout constraints
Robert Pluim [Fri, 14 Dec 2018 15:07:47 +0000 (16:07 +0100)]
Document font structure layout constraints

This has to be the same as in src/ftcrfont.c and src/ftfont.c

* src/xftfont.c (struct xftfont_info): Document layout constraints.

5 years agoDocument font structure layout constraints
Robert Pluim [Fri, 14 Dec 2018 14:04:14 +0000 (15:04 +0100)]
Document font structure layout constraints

The layout of the initial members of ftcrfont_info must match
ftfont_info

* src/ftcrfont.c (struct ftcrfont_info): Likewise.

* src/ftfont.c (struct ftfont_info): Document layout constraints.

5 years agoFix display of line numbers in empty lines beyond EOB
Eli Zaretskii [Fri, 14 Dec 2018 08:43:37 +0000 (10:43 +0200)]
Fix display of line numbers in empty lines beyond EOB

* src/xdisp.c (maybe_produce_line_number): When the current
line is at EOB, use the 'line-number-current-line' face only
on that single line, but not on the rest of empty lines beyond
EOB.  (Bug#33732)

5 years ago* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Remove debug.
Glenn Morris [Fri, 14 Dec 2018 02:02:15 +0000 (21:02 -0500)]
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Remove debug.

5 years agoGet long package description for installed packages from installed files
Stephen Leake [Thu, 13 Dec 2018 22:45:05 +0000 (14:45 -0800)]
Get long package description for installed packages from installed files

* doc/lispref/package.texi (Archive Web Server): New; document web
server interface.

* lisp/emacs-lisp/package.el (package--get-description): New; get long
description from installed files.
(describe-package-1): Use it, improve comments. No longer writing
NAME-readme.txt.

* test/lisp/emacs-lisp/package-tests.el:
(package-test-describe-package): There is now a description for an
installed package.
(package-test-describe-installed-multi-file-package): New test.

5 years agoMerge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
Stephen Leake [Thu, 13 Dec 2018 22:39:02 +0000 (14:39 -0800)]
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'

5 years agoFix stray CHECK_FIXNUM_COERCE_MARKER
Paul Eggert [Thu, 13 Dec 2018 21:03:54 +0000 (13:03 -0800)]
Fix stray CHECK_FIXNUM_COERCE_MARKER

* src/xdisp.c (Fbidi_resolved_levels): Don’t allow a marker arg;
markers are character positions not vertical positions.

5 years ago* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Add debug.
Glenn Morris [Thu, 13 Dec 2018 18:41:19 +0000 (13:41 -0500)]
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844): Add debug.

5 years ago* doc/misc/tramp.texi (Ad-hoc multi-hops): Reinsert lost line.
Michael Albinus [Thu, 13 Dec 2018 13:19:22 +0000 (14:19 +0100)]
* doc/misc/tramp.texi (Ad-hoc multi-hops): Reinsert lost line.

5 years agoAllow per-diagnostic overlay properties in Flymake
João Távora [Thu, 13 Dec 2018 00:09:01 +0000 (00:09 +0000)]
Allow per-diagnostic overlay properties in Flymake

* lisp/progmodes/flymake.el (Version): Bump to 1.0.3.
(flymake--diag): Add new field overlay-properties.
(flymake-make-diagnostic): New optional arg overlay-properties.
(flymake--highlight-line): Use it.

5 years ago* lisp/vc/vc.el (vc-find-revision-no-save): Use decode-coding-inserted-region
Juri Linkov [Wed, 12 Dec 2018 23:17:05 +0000 (01:17 +0200)]
* lisp/vc/vc.el (vc-find-revision-no-save): Use decode-coding-inserted-region

and after-insert-file-set-coding.  Don't let-bind coding-system-for-read
and coding-system-for-write.  For non-interactive use, let-bind
enable-local-variables to :safe and ignore errors from set-auto-mode call.
(Bug#33567)

5 years agoImprove em-ls-test-bug27844
Glenn Morris [Wed, 12 Dec 2018 22:01:06 +0000 (17:01 -0500)]
Improve em-ls-test-bug27844

* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844):
Skip if source-directory absent.

5 years agoSimplify validate_interval_range and callers
Paul Eggert [Wed, 12 Dec 2018 17:54:42 +0000 (09:54 -0800)]
Simplify validate_interval_range and callers

* src/textprop.c (validate_interval_range):
Remove useless code.  Fix comment to match current behavior.
(set_text_properties, copy_text_properties): Simplify, as
validate_interval_range has not incremented START or END for
quite some time.
(copy_text_properties): Assume C99.  Fix an unlikely
integer overflow bug if WIDE_EMACS_INT.

5 years agoset_text_properties_1 can assume START <= END
Paul Eggert [Wed, 12 Dec 2018 17:54:42 +0000 (09:54 -0800)]
set_text_properties_1 can assume START <= END

* src/textprop.c (set_text_properties_1):
Do not swap START and END.  All callers do that already,
and the test for swapping here is redundant.

5 years agoFix regression in expand-file-name with drive-relative HOME
Eli Zaretskii [Wed, 12 Dec 2018 16:27:05 +0000 (18:27 +0200)]
Fix regression in expand-file-name with drive-relative HOME

* src/fileio.c (get_homedir) [DOS_NT]: Expand drive-relative
$HOME to begin with "X:/".

* test/src/fileio-tests.el (fileio-tests--relative-HOME): Add
testing of drive-relative value of $HOME on MS-Windows and
MS-DOS.

5 years agoFix Bug#33568
Michael Albinus [Wed, 12 Dec 2018 09:49:59 +0000 (10:49 +0100)]
Fix Bug#33568

* test/lisp/net/secrets-tests.el (secrets-test02-collections)
(secrets-test03-items): Do not expect "login" collection to
exist.  (Bug#33568)