]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoDefault autogen.sh to 'all'
Paul Eggert [Sat, 12 Aug 2017 15:56:52 +0000 (08:56 -0700)]
Default autogen.sh to 'all'

This addresses a problem noted by RMS in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html
* autogen.sh (do_git): Set to true if this script is invoked
with no arguments and there is a .git subdirectory.

7 years agoAdjust jka-compr to recent Tramp changes.
Paul Eggert [Sat, 12 Aug 2017 15:52:25 +0000 (08:52 -0700)]
Adjust jka-compr to recent Tramp changes.

* lisp/jka-compr.el (jka-compr-write-region):
Two new args LOCKNAME and MUSTBENEW.

7 years agoImprove doc strings of 2 functions in simple.el
Eli Zaretskii [Sat, 12 Aug 2017 12:11:16 +0000 (15:11 +0300)]
Improve doc strings of 2 functions in simple.el

* lisp/simple.el (beginning-of-visual-line)
(move-beginning-of-line): Doc fix.  Reported by
Justin Burkett <justin@burkett.cc>.

7 years agoFix completion on directory names on MS-DOS/MS-Windows
Eli Zaretskii [Sat, 12 Aug 2017 11:44:20 +0000 (14:44 +0300)]
Fix completion on directory names on MS-DOS/MS-Windows

* src/msdos.c (faccessat):
* src/w32.c (faccessat): Support relative file names, and add D_OK
to 'mode' if the argument is a directory.  This unbreaks file-name
completion when the completion result is a directory.

7 years agoImplement EXCL of write-region for Tramp
Michael Albinus [Sat, 12 Aug 2017 10:30:39 +0000 (12:30 +0200)]
Implement EXCL of write-region for Tramp

* lisp/net/ange-ftp.el (ange-ftp-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region)
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region)
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
Implement MUSTBENEW.

* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-add-name-to-file)
(tramp-do-copy-or-rename-file)
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link):
Adapt error message for `file-already-exists'.

* src/lisp.h:
* src/eval.c (call8): New function.

* src/fileio.c (write_region): Pass also lockname and
mustbenew to the file name handler.

* test/lisp/net/tramp-tests.el (tramp-test10-write-region):
Add tests for MUSTBENEW.

7 years agoAdapt Proced display to display-line-numbers
Eli Zaretskii [Sat, 12 Aug 2017 10:18:13 +0000 (13:18 +0300)]
Adapt Proced display to display-line-numbers

* lisp/proced.el (proced-header-line): Account for the width taken
by display-line-numbers.  (Bug#27895)

7 years agoAdapt tabulated list when display-line-number is turned on
Eli Zaretskii [Sat, 12 Aug 2017 09:45:05 +0000 (12:45 +0300)]
Adapt tabulated list when display-line-number is turned on

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Add
a hook to revert the display when display-line-numbers is turned
on.  (Bug#27895)

7 years agoUse Gnulib 'tempname' on MS-Windows
Eli Zaretskii [Sat, 12 Aug 2017 08:29:37 +0000 (11:29 +0300)]
Use Gnulib 'tempname' on MS-Windows

* lib-src/ntlib.h (mkdir, open): Remove redefinitions.  They are
now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (sys_mkdir, sys_open): New functions.
(mkostemp): Remove.

* src/w32.c (mkostemp): Remove.
(sys_mkdir): Accept a second (unused) argument.
* src/fileio.c (Fmake_directory_internal): Remove the WINDOWSNT
specific call to mkdir.  (Bug#28023)

* nt/inc/ms-w32.h (mkdir): Remove from "#ifdef emacs" and redefine
to accept 2 arguments.
(open): Remove from "#ifdef emacs".
* nt/mingw-cfg.site (ac_cv_func_mkostemp): Remove.
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_mkostemp)
(OMIT_GNULIB_MODULE_tempname): Remove.

7 years agoAdd new face 'header-line-highlight'
Alexander Gramiak [Sat, 12 Aug 2017 07:12:36 +0000 (10:12 +0300)]
Add new face 'header-line-highlight'

* lisp/faces.el: Define the face.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
* lisp/info.el (Info-fontify-node): Use the new face.
* doc/emacs/display.texi (Standard Faces):
* etc/NEWS: Document the new face.  (Bug#28033)

7 years agoMake a case-sensitive match for strings
Arash Esbati [Fri, 11 Aug 2017 21:57:35 +0000 (23:57 +0200)]
Make a case-sensitive match for strings

* lisp/textmodes/reftex.el (reftex-typekey-check): Temporarily
let-bind `case-fold-search' to nil in order to be case-sensitive
when matching a string.  (Bug#27518)

7 years agoFix a minor todo-mode regression
Stephen Berman [Fri, 11 Aug 2017 09:28:57 +0000 (11:28 +0200)]
Fix a minor todo-mode regression

* lisp/calendar/todo-mode.el (todo-get-overlay): Wrap in
save-excursion.  This fixes a regression introduced by the fix
for bug#27609, whereby trying to raise the priority of the
first item or lower the priority of the last item, which
should be noops, moves point to the item's start.  Clarify
comment.

* test/lisp/calendar/todo-mode-tests.el
(todo-test-raise-lower-priority): Add test cases for trying to
raise first item and lower last item.
(with-todo-test): Clear abbreviated-home-dir, since we change HOME.
(todo-test-toggle-item-header02): Remove ":expected-result
:failed" and tests of point after todo-next-item, since the
effect when using Todo mode is not reproducible in the test
environment.  Add commentary about this.

7 years agoImprove performance for rename-file etc.
Paul Eggert [Fri, 11 Aug 2017 08:04:30 +0000 (01:04 -0700)]
Improve performance for rename-file etc.

Although this does not fix Bug#27986, it is a step forward.
I plan to propose a more-significant patch later.
* lisp/files.el (directory-name-p): Move from here ...
* src/fileio.c (Fdirectory_name_p): ... to here.
(directory_like, cp_like_target): New static functions.
(Fcopy_file, Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link):
Use them, to avoid directory-testing syscalls on file names that
must be directories if they exist.  Omit unnecessary
initializations and CHECK_STRING calls.
(Frename_file): Don't call file_name_case_insensitive_p
twice on the same file.  Compare both file names expanded, instead
of the old name expanded and the new one unexpanded.

7 years agoRespect buffer-local value of tags-table-list (Bug#27772)
Noam Postavsky [Mon, 7 Aug 2017 01:35:04 +0000 (21:35 -0400)]
Respect buffer-local value of tags-table-list (Bug#27772)

* lisp/progmodes/etags.el (visit-tags-table-buffer): Save the current
buffer around the `tags-table-including' calls so as to get buffer
local variables from the right buffer later.
* test/lisp/progmodes/etags-tests.el (etags-visit-tags-table-buffer):
New test.
* test/lisp/progmodes/etags-tests.el (etags-tests--test-dir): New
constant.
(etags-bug-158, etags-bug-23164): Use it so that when running the test
interactively, setting EMACS_TEST_DIRECTORY is not needed.

7 years agoFix auto-filling regression
Tom Tromey [Wed, 9 Aug 2017 22:06:23 +0000 (16:06 -0600)]
Fix auto-filling regression

Bug#28003
* lisp/newcomment.el (comment-indent-new-line): Check
comment-auto-fill-only-comments.  Reverts earlier change.
* lisp/simple.el (internal-auto-fill): Call auto-fill-function, not
do-auto-fill.

7 years agoMerge from gnulib
Paul Eggert [Wed, 9 Aug 2017 18:38:04 +0000 (11:38 -0700)]
Merge from gnulib

This incorporates:
2017-08-09 tempname: do not depend on secure_getenv
2017-08-08 extensions: add _OPENBSD_SOURCE
2017-08-06 manywarnings: Add support for C++
2017-08-06 warnings, manywarnings: Add support for multiple languages
* admin/merge-gnulib: Don't use m4/manywarnings-c++.m4.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/secure_getenv.c, m4/secure_getenv.m4: Remove.
* lib/tempname.c, m4/extensions.m4, m4/manywarnings.m4, m4/warnings.m4:
Copy from gnulib.

7 years agoFix crashing emacs-module tests on MS-Windows
Eli Zaretskii [Wed, 9 Aug 2017 17:15:46 +0000 (20:15 +0300)]
Fix crashing emacs-module tests on MS-Windows

* src/w32fns.c (syms_of_w32fns) <w32-disable-abort-dialog>: New
variable.
(emacs_abort): If w32-disable-abort-dialog is non-nil, abort right
away, without displaying the Abort dialog, which waits for the user.

* test/src/emacs-module-tests.el (module--test-assertion): Run the
inferior Emacs with the w32 abort dialog disabled.  Expect the
status of the aborted Emacs sub-process to be 3 on MS-Windows and
2 on MS-DOS.

7 years agodired-delete-file: Dont't ask for empty dirs
Tino Calancha [Wed, 9 Aug 2017 05:47:15 +0000 (14:47 +0900)]
dired-delete-file:  Dont't ask for empty dirs

* lisp/dired.el (dired--yes-no-all-quit-help): New defun.
(dired-delete-file): Use it.  Dont't ask for empty dirs (Bug#27940).

* test/lisp/dired-tests.el (dired-test-with-temp-dirs):
New auxiliar macro.
(dired-test-bug27940): Add new test.

7 years agoAsk files for deletion in buffer order: top first, botton later
Tino Calancha [Wed, 9 Aug 2017 05:37:21 +0000 (14:37 +0900)]
Ask files for deletion in buffer order: top first, botton later

* lisp/dired.el (dired-do-flagged-delete, dired-do-delete):
Call `nreverse' t invert the output of `dired-map-over-marks'.

7 years agoUse help-mode xrefs in describe-font
Alexander Gramiak [Sat, 5 Aug 2017 22:09:54 +0000 (16:09 -0600)]
Use help-mode xrefs in describe-font

* lisp/international/mule-diag.el (describe-font): Use help-setup-xref
(Bug#27890).

7 years agoDon't try to jump to non-existent part (bug#28013)
Katsumi Yamaoka [Tue, 8 Aug 2017 23:40:27 +0000 (23:40 +0000)]
Don't try to jump to non-existent part (bug#28013)

* lisp/gnus/gnus-art.el (gnus-article-edit-part): Don't try to jump to
the next part if there is the only one part in the article (bug#28013).

7 years agoReplace some uses of eval
Mark Oteiza [Tue, 8 Aug 2017 19:10:49 +0000 (15:10 -0400)]
Replace some uses of eval

There are a number of places where eval is used unnecessarily to get
or set the value of a symbol.
* lisp/calendar/calendar.el (diary-date-forms): Use default-value in
custom setter.
* lisp/desktop.el (desktop-clear): Use set-default instead.
* lisp/international/ogonek.el (ogonek-read-encoding): Use
symbol-value.

7 years agoConvert uses of looking-at in viper-ex to following-char
Mark Oteiza [Tue, 8 Aug 2017 19:00:21 +0000 (15:00 -0400)]
Convert uses of looking-at in viper-ex to following-char

* lisp/emulation/viper-ex.el (viper-get-ex-token): Bind
(following-char) and use it in the subsequent cond's clauses.
(viper-ex, ex-quit, viper-get-ex-file): Use following-char instead.
Convert single branch ifs to when

7 years agoSome cleanup in message.el
Mark Oteiza [Tue, 8 Aug 2017 18:09:38 +0000 (14:09 -0400)]
Some cleanup in message.el

* lisp/gnus/message.el (message-cross-post-insert-note):
(message-strip-forbidden-properties): Mark unused args.
(message-canlock-generate): Remove extinct variable
sha1-maximum-internal-length.
(message-make-mail-followup-to): Use loop's thereis clause.

7 years agoDocument make-temp-name magic limitations
Paul Eggert [Tue, 8 Aug 2017 16:49:40 +0000 (09:49 -0700)]
Document make-temp-name magic limitations

* doc/lispref/files.texi (Unique File Names):
* src/fileio.c (Fmake_temp_name): Document that make-temp-name
does not guarantee uniqueness on magic file names.

7 years agoShow number of errors in compilation-mode mode-line
Tom Tromey [Sun, 5 Mar 2017 17:48:41 +0000 (10:48 -0700)]
Show number of errors in compilation-mode mode-line

Bug#25354
* lisp/progmodes/compile.el (compilation-num-errors-found): Provide
default value.
(compilation-num-warnings-found, compilation-num-infos-found): New
defvars.
(compilation-mode-line-errors): New defconst.
(compilation-face): Remove.
(compilation-type, compilation--note-type): New functions.
(compilation-parse-errors): Call compilation--note-type.
(compilation-start): Include compilation-mode-line-errors in
mode-line-process.
(compilation-setup): Initialize compilation-num-* variables to 0.
(compilation-handle-exit): Include compilation-mode-line-errors in
mode-line-process.
* doc/emacs/building.texi (Compilation): Document new feature.

7 years agoDo some cleanup in mailcap.el
Mark Oteiza [Tue, 8 Aug 2017 01:50:11 +0000 (21:50 -0400)]
Do some cleanup in mailcap.el

* lisp/net/mailcap.el: Use lexical-binding.
(mailcap--set-user-mime-data, mailcap-possible-viewers): Use pcase
destructuring.
(mailcap-mime-data): Remove some entries for ancient functions.
(mailcap-parse-mailcaps, mailcap-mime-info): Nix single-branch ifs.
(mailcap-parse-mimetype-file): Just use append.
(mailcap-command-p): Remove unused function.

7 years agoquery-replace: Undo replacements performed with 'comma
Tino Calancha [Tue, 8 Aug 2017 01:25:27 +0000 (10:25 +0900)]
query-replace: Undo replacements performed with 'comma

During a `query-replace', the char ',' replaces the character
at point and doesn't move point;  right after, the char 'u'
must undo such replacement (Bug#27268).
* lisp/replace.el (replace--push-stack):
New macro extracted from `perform-replace'.
(perform-replace): Use it.
* test/lisp/replace-tests.el (query-replace--undo): Add test.

7 years ago; Merge: Fixes for macroexpansion and compilation
Noam Postavsky [Tue, 8 Aug 2017 01:09:19 +0000 (21:09 -0400)]
; Merge: Fixes for macroexpansion and compilation

7 years agoDon't define gv expanders in compiler's runtime (Bug#27016)
Noam Postavsky [Thu, 13 Jul 2017 04:42:38 +0000 (00:42 -0400)]
Don't define gv expanders in compiler's runtime (Bug#27016)

This prevents definitions being compiled from leaking into the current
Emacs doing the compilation.
* lisp/emacs-lisp/gv.el (gv-define-expander): Use function-put instead
of `put' with `eval-and-compile'.
* test/lisp/emacs-lisp/gv-tests.el: New tests.

7 years agoLet the cl-typep effects of defclass work during compilation (Bug#27718)
Noam Postavsky [Fri, 4 Aug 2017 23:50:21 +0000 (19:50 -0400)]
Let the cl-typep effects of defclass work during compilation (Bug#27718)

* lisp/emacs-lisp/eieio.el (defclass): Use `define-symbol-prop'
instead of `put'.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-tests--dummy-function): Remove.
(eieio-test-25-slot-tests, eieio-test-23-inheritance-check): Don't
expect to fail if compiled.

7 years agoLet `define-symbol-prop' take effect during compilation
Stefan Monnier [Fri, 14 Jul 2017 04:32:34 +0000 (00:32 -0400)]
Let `define-symbol-prop' take effect during compilation

* src/fns.c (syms_of_fns): New variable `overriding-plist-environment'.
(Fget): Consult it.
* lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind
it to nil.
(byte-compile-define-symbol-prop): New function, handles compilation
of top-level `define-symbol-prop' and `function-put' calls by putting
the symbol setting into `overriding-plist-environment'.

Co-authored-by: Noam Postavsky <npostavs@gmail.com>
7 years agoAdd a test of handling of circular values to testcover-tests
Gemini Lasswell [Thu, 20 Jul 2017 19:01:42 +0000 (12:01 -0700)]
Add a test of handling of circular values to testcover-tests

* test/lisp/emacs-lisp-testcover-resources/testcases.el
(testcover-testcase-cyc1): New function.
(testcover-tests-circular-lists-bug-24402): New test.

7 years agoDon't error on circular values in testcover
Noam Postavsky [Wed, 19 Jul 2017 22:48:50 +0000 (18:48 -0400)]
Don't error on circular values in testcover

* lisp/emacs-lisp/testcover.el (testcover-after, testcover-1value):
Consider circular lists to be non-equal instead of signaling error.

7 years ago; Avoid test failures when running from compiled test files
Noam Postavsky [Sun, 16 Jul 2017 23:12:10 +0000 (19:12 -0400)]
; Avoid test failures when running from compiled test files

* test/lisp/dom-tests.el: Require `subr-x' during runtime as well.
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record):
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-23-inheritance-check, eieio-test-25-slot-tests): Mark as
expected to fail when byte-compiled.

7 years agoCatch argument and macroexpansion errors in ert
Alexander Gramiak [Thu, 13 Jul 2017 20:54:35 +0000 (14:54 -0600)]
Catch argument and macroexpansion errors in ert

This kludge catches errors caused by evaluating arguments in ert's
should, should-not, and should-error macros; it also catches
macroexpansion errors inside of the above macros (Bug#24402).

* lisp/emacs-lisp/ert.el: (ert--should-signal-hook): New function.
(ert--expand-should-1): Catch macroexpansion errors.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-should-error-argument)
(ert-test-should-error-macroexpansion): Tests for argument and
expansion errors.

7 years agoRevert "Add Enchant support to ispell.el (Bug#17742)"
Reuben Thomas [Mon, 7 Aug 2017 20:59:06 +0000 (21:59 +0100)]
Revert "Add Enchant support to ispell.el (Bug#17742)"

This reverts commit 7136e6723d87b51ae3089f5ceef6b14621bfaf87.

7 years agoRevert "Add support for arguments in ALTERNATE_EDITOR to emacsclient"
Reuben Thomas [Mon, 7 Aug 2017 20:58:55 +0000 (21:58 +0100)]
Revert "Add support for arguments in ALTERNATE_EDITOR to emacsclient"

This reverts commit 28f1fe97daa13e13714e6c43c9a6fbb0c0e99a26.

7 years agoAdd support for arguments in ALTERNATE_EDITOR to emacsclient
Reuben Thomas [Thu, 1 Dec 2016 15:21:57 +0000 (15:21 +0000)]
Add support for arguments in ALTERNATE_EDITOR to emacsclient

* lib-src/emacsclient.c (fail): Parse ALTERNATE_EDITOR, or
corresponding command-line argument, into space-separated tokens.
* etc/NEWS: Document.
* test/lib-src/emacsclient-tests.el: Add a test.

7 years agoAdd Enchant support to ispell.el (Bug#17742)
Reuben Thomas [Sun, 4 Dec 2016 22:39:27 +0000 (22:39 +0000)]
Add Enchant support to ispell.el (Bug#17742)

* lisp/textmodes/ispell.el (ispell-program-name): Add “enchant”.
(ispell-really-enchant): Add variable.
(ispell-check-version): If using Enchant, check it’s new enough (at
least 1.6.1).  (Like the ispell check, this is absolute: cannot work
without.)
(ispell-enchant-dictionary-alist): Add variable.
(ispell-find-enchant-dictionaries): Add function, based on
ispell-find-aspell-dictionaries.
(ispell-set-spellchecker-params): Allow dictionary auto-detection for
Enchant, and call ispell-find-enchant-dictionaries to find them.  Use
old ispell name to locale mapping code for Enchant too.
(ispell-send-replacement): Make it work with Enchant.

7 years agoAllow async command output buffer to be shown only on output
Reuben Thomas [Wed, 28 Jun 2017 21:40:33 +0000 (22:40 +0100)]
Allow async command output buffer to be shown only on output

* lisp/simple.el (async-shell-command-display-buffer): Add
defcustom.
(shell-command): Use the new defcustom to determine whether to show
the buffer immediately, or add a process filter that shows it only
when there is some output.
* etc/NEWS: Document the new variable.
* doc/emacs/misc.texi: Likewise.

Thanks to Juri Linkov and Eli Zaretskii for advice and guidance.

7 years agoFix infinite recursion under prettify-symbols-mode and linum-mode
Eli Zaretskii [Mon, 7 Aug 2017 17:47:53 +0000 (20:47 +0300)]
Fix infinite recursion under prettify-symbols-mode and linum-mode

* src/xdisp.c (get_overlay_strings_1)
(handle_single_display_spec, push_prefix_prop): Invalidate the
composition information before starting to iterate on a string.
Otherwise we might think in set_iterator_to_next that we are
delivering characters from a composition, and do all kinds of
nonsensical things, like over-step the string end.  (Bug#27761)

7 years ago* lisp/gnus/gnus-bcklg.el (gnus-backlog-request-article): Fix thinko.
Stefan Monnier [Mon, 7 Aug 2017 16:16:02 +0000 (12:16 -0400)]
* lisp/gnus/gnus-bcklg.el (gnus-backlog-request-article): Fix thinko.

7 years agoFix doc-string of `delete-other-windows'
Martin Rudalics [Mon, 7 Aug 2017 07:51:01 +0000 (09:51 +0200)]
Fix doc-string of `delete-other-windows'

* lisp/window.el (delete-other-windows): Fix doc-string.

7 years agoFix a couple more make-temp-file races
Paul Eggert [Mon, 7 Aug 2017 06:53:40 +0000 (23:53 -0700)]
Fix a couple more make-temp-file races

* lisp/files.el (basic-save-buffer-2, move-file-to-trash):
Use make-temp-name, not make-temp-file with retry.
(basic-save-buffer-2): Use condition-case, instead of
unwind-protect with a success flag.

7 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael R. Mauger [Mon, 7 Aug 2017 00:58:08 +0000 (20:58 -0400)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

7 years agoMerge null and without-null regexp alists (Bug#27840, Bug#27873)
Noam Postavsky [Sun, 30 Jul 2017 18:47:05 +0000 (14:47 -0400)]
Merge null and without-null regexp alists (Bug#27840, Bug#27873)

* lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Allow for NUL
characters following filename in grep context lines.
(grep--regexp-alist-column, grep--regexp-alist-bin-matcher)
(grep-with-null-regexp-alist, grep-fallback-regexp-alist): Remove.
(grep-regexp-alist): Recombine their contents here.
(grep-mode):
* lisp/cedet/semantic/symref/grep.el
(semantic-symref-parse-tool-output-one-line):
* lisp/progmodes/xref.el (xref-collect-matches): Use the variable
`grep-regexp-alist' rather than the function.

7 years agoFix some crashes on self-modifying Elisp code
Paul Eggert [Sun, 6 Aug 2017 23:57:08 +0000 (16:57 -0700)]
Fix some crashes on self-modifying Elisp code

Prompted by a problem report by Alex in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html
* src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub):
Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs,
it is likely to run a bit faster with typical hardware caches.
(Fif): Use Fcdr instead of XCDR, to avoid crashing on
self-modifying S-expressions.
(Fsetq, Flet, eval_sub): Count the number of arguments as we go
instead of trusting an Flength prepass, to avoid problems when the
code is self-modifying.
(Fquote, Ffunction, Fdefvar, Fdefconst): Prefer !NILP to CONSP
where either will do.  This is mostly to document the fact that
the value must be a proper list.  It's also a tiny bit faster on
typical machines nowadays.
(Fdefconst, FletX): Prefer XCAR+XCDR to Fcar+Fcdr when either will do.
(eval_sub): Check that the args are a list as opposed to some
other object that has a length. This prevents e.g. (if . "string")
from making Emacs dump core in some cases.
* test/src/eval-tests.el (eval-tests--if-dot-string)
(eval-tests--let-with-circular-defs, eval-tests--mutating-cond):
New tests.

7 years ago* etc/tutorials/TUTORIAL.he: Update to match recent changes to TUTORIAL.
Eli Zaretskii [Sun, 6 Aug 2017 19:02:08 +0000 (22:02 +0300)]
* etc/tutorials/TUTORIAL.he: Update to match recent changes to TUTORIAL.

7 years ago; Fix previous commit
Mark Oteiza [Sun, 6 Aug 2017 14:15:17 +0000 (10:15 -0400)]
; Fix previous commit

The mailcap minibuffer completion used dynamic binding.  Locally set
a dynamic variable.
* lisp/dired-aux.el: Store list of files in
`minibuffer-completion-table'.

7 years agoMinor tweak in a dired test
Tino Calancha [Sun, 6 Aug 2017 13:16:56 +0000 (22:16 +0900)]
Minor tweak in a dired test

* test/lisp/dired-tests.el (dired-test-bug27968):
Ensure the new header has different length than the original one.

7 years agodired-delete-file: Do not TAB complete the user answer
Tino Calancha [Sun, 6 Aug 2017 12:53:07 +0000 (21:53 +0900)]
dired-delete-file: Do not TAB complete the user answer

This action might delete directories containing valuable information.
Before previous commit, we prompted users with `yes-or-no-p'
which doesn't TAB complete the user answer.  Let's play safe and
keep requiring full answers.
* emacs-master/lisp/dired.el (dired-delete-file): Use `read-string'
instead of `completing-read' to read the user answers.

7 years agodired-do-delete: Allow to delete dirs recursively without prompts
Tino Calancha [Sun, 6 Aug 2017 04:46:51 +0000 (13:46 +0900)]
dired-do-delete: Allow to delete dirs recursively without prompts

* lisp/dired.el (dired-delete-file): Accept 2 additional answers:
'all', to delete all directories recursively and no prompt anymore.
'quit', to cancel directory deletions (Bug#27940).
Show help message when user inputs 'help'.
(dired-do-flagged-delete): Bind locally dired-recursive-deletes
so that we can overwrite its global value.
Wrapp the loop within a catch '--delete-cancel to catch when
the user abort the directtry deletion.
* doc/emacs/dired.texi (Dired Deletion): Update manual.
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 26.1):
Announce this change.

7 years agoFix a couple of make-temp-file races
Paul Eggert [Sun, 6 Aug 2017 04:27:45 +0000 (21:27 -0700)]
Fix a couple of make-temp-file races

* lisp/emacs-lisp/autoload.el (autoload--save-buffer):
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Use make-temp-file, not make-temp-name, to avoid an unlikely race
that could lose data.  Remove the deletion hook as quickly as
possible after the file is renamed; though a race still remains
here, it is smaller than before.

7 years agoDired w/ eshell-ls: Handle shell wildcards in file name
Tino Calancha [Sun, 6 Aug 2017 04:23:05 +0000 (13:23 +0900)]
Dired w/ eshell-ls: Handle shell wildcards in file name

* lisp/eshell/em-ls.el (eshell-ls--insert-directory):
Use eshell-extended-glob (Bug#27844).
* test/lisp/dired-tests.el (dired-test-bug27844): Add test.

7 years agodired-revert: save line numbers instead of positions
Tino Calancha [Sun, 6 Aug 2017 04:05:16 +0000 (13:05 +0900)]
dired-revert: save line numbers instead of positions

Positions might change if the length of one dired header line
changes; this happen, for instance, if we add new files.
Instead, line numbers are invariant under shrinks/enlargements
of the file header.
https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01092.html
* lisp/dired.el (dired-save-positions): Save the line numbers at point.
(dired-restore-positions): Use forward-line to restore the original
position (Bug#27968).
* test/lisp/dired-tests.el (dired-test-bug27968): Add test.

7 years agoRespect comment-auto-fill-only-comments
Tom Tromey [Sun, 6 Aug 2017 00:30:52 +0000 (18:30 -0600)]
Respect comment-auto-fill-only-comments

Respect comment-auto-fill-only-comments when auto-filling and a
comment syntax is defined.

* lisp/newcomment.el (comment-indent-new-line): Do not check
comment-auto-fill-only-comments.
* lisp/simple.el (internal-auto-fill): New defun.
* src/cmds.c (internal_self_insert): Call Qinternal_auto_fill, not
auto_fill_function.
(syms_of_cmds): Define Qinternal_auto_fill.

7 years ago* etc/tutorials/TUTORIAL: Update.
Richard Stallman [Sat, 5 Aug 2017 21:01:59 +0000 (14:01 -0700)]
* etc/tutorials/TUTORIAL: Update.

7 years agoUnify CNS11643-15 in a way that avoids segfaults
Eli Zaretskii [Sat, 5 Aug 2017 13:47:14 +0000 (16:47 +0300)]
Unify CNS11643-15 in a way that avoids segfaults

* lisp/international/mule-conf.el: Redo unification of
cns11643-15.  (Bug#27964)
(chinese-cns11643-15): Add the missing :unify-map attribute.

7 years agoAvoid segfaults while producing Punct.el
Eli Zaretskii [Sat, 5 Aug 2017 13:28:09 +0000 (16:28 +0300)]
Avoid segfaults while producing Punct.el

* lisp/international/mule-conf.el: Undo unification of
cns11643-15, as that causes segfaults during bootstrap.
(Bug#27964)

7 years agoMake header line in some modes be sensitive to display-line-numbers
Eli Zaretskii [Sat, 5 Aug 2017 11:22:04 +0000 (14:22 +0300)]
Make header line in some modes be sensitive to display-line-numbers

* lisp/ruler-mode.el (ruler-mode-ruler, ruler-mode-window-col):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header)
(tabulated-list-print-entry): Account for the width taken by
line-number display.  (Bug#27895)

7 years agoFix a bug in 'generate-new-buffer-name'
Eli Zaretskii [Sat, 5 Aug 2017 09:52:55 +0000 (12:52 +0300)]
Fix a bug in 'generate-new-buffer-name'

* src/buffer.c (Fgenerate_new_buffer_name): Test IGNORE for being
nil before calling string-equal, since the latter will compare
"nil and 'nil' as equal.  (Bug#27966)

* test/src/buffer-tests.el
(test-generate-new-buffer-name-bug27966): New test.

7 years agoUnify CNS11643-15
Eli Zaretskii [Sat, 5 Aug 2017 09:23:08 +0000 (12:23 +0300)]
Unify CNS11643-15

* lisp/international/mule-conf.el (chinese-cns11643-15): Add a
unify-charset form for it.  (Bug#27964)

7 years agoImprove test of error message when Emacs cannot be suspended
Eli Zaretskii [Sat, 5 Aug 2017 09:00:31 +0000 (12:00 +0300)]
Improve test of error message when Emacs cannot be suspended

* lisp/term/x-win.el (x-win-suspend-error):
* lisp/term/ns-win.el (ns-suspend-error): Improve the error
message.  (Bug#27901)

7 years agoMake "C-h o" show faces as well as variables
Alexander Gramiak [Sat, 5 Aug 2017 08:51:05 +0000 (11:51 +0300)]
Make "C-h o" show faces as well as variables

* lisp/faces.el (describe-face): Return (buffer-string).  Reorder
the placement of variables/faces in describe-symbol, to put more
emphasis on the variable entry rather than the face.  (Bug#24543)

7 years agoFix files-tests.el for MS-Windows
Eli Zaretskii [Sat, 5 Aug 2017 08:38:04 +0000 (11:38 +0300)]
Fix files-tests.el for MS-Windows

* test/lisp/files-tests.el
(files-tests--file-name-non-special--subprocess): Fix this test
for MS-Windows.

7 years agoImprove documentation of 'region-extract-function'
Eli Zaretskii [Sat, 5 Aug 2017 08:03:24 +0000 (11:03 +0300)]
Improve documentation of 'region-extract-function'

* lisp/simple.el (region-extract-function): Rename the argument to
METHOD.  Doc fix.  (Bug#27927)

7 years agoMerge from gnulib
Paul Eggert [Sat, 5 Aug 2017 05:46:31 +0000 (22:46 -0700)]
Merge from gnulib

This incorporates:
2017-08-04 manywarnings: port to 64-bit GCC builds of Emacs
2017-08-01 manywarnings: port to 32-bit GCC bug
* lib/gnulib.mk.in: Regenerate.
* m4/manywarnings.m4: Copy from gnulib.

7 years agoPort recent rename changes to Ubuntu 14.04
Paul Eggert [Sat, 5 Aug 2017 05:34:45 +0000 (22:34 -0700)]
Port recent rename changes to Ubuntu 14.04

* src/sysdep.c (renameat_noreplace) [!RENAME_NOREPLACE]:
Don’t use syscall.  Problem reported by Tino Calancha (Bug#27946#10).

7 years agoinsert-directory-wildcard-in-dir-p: Tweak regexp
Tino Calancha [Sat, 5 Aug 2017 05:04:56 +0000 (14:04 +0900)]
insert-directory-wildcard-in-dir-p: Tweak regexp

This function must return non-nil for a wildcard like '/*/*.txt'.
* lisp/files.el (insert-directory-wildcard-in-dir-p): Adjust regexp.
* test/lisp/files-tests.el (files-tests--insert-directory-wildcard-in-dir-p):
Add test.

7 years ago; * lisp/emacs-lisp/re-builder.el: Fix commentary (Bug#27947).
Noam Postavsky [Fri, 4 Aug 2017 22:36:05 +0000 (18:36 -0400)]
; * lisp/emacs-lisp/re-builder.el: Fix commentary (Bug#27947).

7 years ago; Fix map-tests when compiled
Noam Postavsky [Fri, 4 Aug 2017 21:55:50 +0000 (17:55 -0400)]
; Fix map-tests when compiled

* test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn)
(test-map-put-testfn-alist): Make sure the lookup key is really non-eq
to the map's key, even if the code is compiled.

7 years agoImplement iterator generator for avl-trees.
Toby S. Cubitt [Fri, 4 Aug 2017 19:34:28 +0000 (20:34 +0100)]
Implement iterator generator for avl-trees.

* lisp/emacs-lisp/avl-tree.el (avl-tree-iter): New iter-defun.

7 years agols-lisp: Drop eshell dependencies
Tino Calancha [Fri, 4 Aug 2017 15:53:48 +0000 (00:53 +0900)]
ls-lisp: Drop eshell dependencies

Use 'file-expand-wildcards' instead of 'eshell-extended-glob' to
expand the wildcards.
Suggested by Fabrice Popineau in:
https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00108.html
* lisp/ls-lisp.el (ls-lisp--dired): Use file-expand-wildcards.

7 years ago; Improve commentary of Info-default-directory-list
Eli Zaretskii [Fri, 4 Aug 2017 13:44:02 +0000 (16:44 +0300)]
; Improve commentary of Info-default-directory-list

* lisp/info.el (Info-default-directory-list): Describe in the
commentary when it is initialized.  (Bug#27933)

7 years agoFix dired-test-bug27631 on MS-Windows
Tino Calancha [Fri, 4 Aug 2017 13:35:29 +0000 (22:35 +0900)]
Fix dired-test-bug27631 on MS-Windows

Skip the test if Dired use 'ls' emulation with lisp.  The same
bug is tested in their respective test suites: ls-lisp-tests.el
and em-ls-tests.el.
* test/lisp/dired-tests.el (dired-test-bug27631): Skip test if 'ls-lisp'
or 'eshell' features are enabled.

7 years agoFix dired-test-bug25609 on MS-Windows
Eli Zaretskii [Fri, 4 Aug 2017 13:10:06 +0000 (16:10 +0300)]
Fix dired-test-bug25609 on MS-Windows

* test/lisp/dired-tests.el (dired-test-bug25609): On MS-Windows,
pass temporary files through file-truename, to avoid bogus
failures due to file-name comparison as strings.

7 years agoFix 2 tests that fail in MS-Windows
Tino Calancha [Fri, 4 Aug 2017 05:15:51 +0000 (14:15 +0900)]
Fix 2 tests that fail in MS-Windows

https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00018.html
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
Add comments to explain the test logic.
Pass '--binary' option to 'patch' program in windows environments.
Check explicitely that a backup is created before compare file contents.

* test/lisp/dired-tests.el (dired-test-bug25609):
Declare variable 'dired-dwim-target' right before the test.
Add comments to explain the test logic.
Ensure, before test the bug condition, that we are displaying the
2 dired buffers created in this test, and no other dired buffer
is shown.

7 years ago* lisp/shell.el (explicit-shell-file-name): Mention shell-file-name
Stefan Monnier [Fri, 4 Aug 2017 04:05:00 +0000 (00:05 -0400)]
* lisp/shell.el (explicit-shell-file-name): Mention shell-file-name

* lisp/files.el (insert-directory): Don't hardcode "-c".
* lisp/term.el (term, ansi-term): Use shell-file-name.

7 years agoFix version numbers for some GnuTLS features
Paul Eggert [Fri, 4 Aug 2017 00:57:24 +0000 (17:57 -0700)]
Fix version numbers for some GnuTLS features

Problem reported by Glenn Morris (Bug#27708#58).
* src/gnutls.c (HAVE_GNUTLS_X509_SYSTEM_TRUST):
New macro.  Use it instead of low-level version number checks.
(HAVE_GNUTLS_AEAD): Move here from gnutls.h, and rename from
HAVE_GNUTLS3_AEAD.  All uses changed.  Indent preprocessor lines.
* src/gnutls.h (HAVE_GNUTLS3_CIPHER, HAVE_GNUTLS3_DIGEST)
(HAVE_GNUTLS3_HMAC): Remove, since these were available
before GnuTLS 3.0.0 and the code checks them only if HAVE_GNUTLS3
is defined.  Remove all uses; this simplifies the code a bit.

7 years agoPort recent rename changes to RHEL 7 + NFS
Paul Eggert [Thu, 3 Aug 2017 23:18:45 +0000 (16:18 -0700)]
Port recent rename changes to RHEL 7 + NFS

Problem reported by Ted Zlatanov in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html
* src/fileio.c (Frename_file): On RHEL 7 + NFS, renameat2 can fail
with errno == EINVAL when it is not supported.  So treat that case
like errno == ENOSYS.  Also, when ok_if_already_exists is neither
nil nor an integer, just call plain rename; this avoids an extra
syscall to renameat2 when the latter fails with errno == EINVAL or
ENOSYS or ENOENT.

7 years agoPort GnuTLS usage to Ubuntu 16.04.2 LTS
Paul Eggert [Thu, 3 Aug 2017 08:00:10 +0000 (01:00 -0700)]
Port GnuTLS usage to Ubuntu 16.04.2 LTS

* src/gnutls.h (HAVE_GNUTLS3_AEAD): Define only if GnuTLS 3.5.1 or
later, as opposed to the old 3.4.0 or later.

7 years agoSimplify configuration of HAVE_GNUTLS3 etc.
Paul Eggert [Thu, 3 Aug 2017 02:46:41 +0000 (19:46 -0700)]
Simplify configuration of HAVE_GNUTLS3 etc.

There's only one GnuTLS, so configuring these symbols at
'configure' time is overkill.  Simplify things by moving their
configuration to src/gnutls.h (Bug#27708).
* configure.ac (HAVE_GNUTLS3, HAVE_GNUTLS3_HMAC, HAVE_GNUTLS3_AEAD)
(HAVE_GNUTLS3_CIPHER, HAVE_GNUTLS3_DIGEST): Move these definitions
from here ...
* src/gnutls.h: ... to here, and simplify.

7 years agoDefault to --with-mailutils if it is installed
Paul Eggert [Thu, 3 Aug 2017 02:13:26 +0000 (19:13 -0700)]
Default to --with-mailutils if it is installed

* configure.ac (with_mailutils): Default to 'yes' if GNU Mailutils
is installed.  See:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html

7 years agoClarify when autogen.sh should run only autoconf
Paul Eggert [Wed, 2 Aug 2017 20:01:58 +0000 (13:01 -0700)]
Clarify when autogen.sh should run only autoconf

* Makefile.in (configure, bootstrap): Run ‘./autogen.sh autoconf’,
not plain ‘./autogen.sh’, to make it clear that only
autoconf-related tools should be run here.

7 years ago.gitlab-ci.yml: Use stretch Debian image instead of unstable
Toon Claes [Wed, 26 Jul 2017 07:19:24 +0000 (09:19 +0200)]
.gitlab-ci.yml: Use stretch Debian image instead of unstable

7 years agoAdd debugging messages to a Dired test
Stephen Berman [Wed, 2 Aug 2017 15:25:44 +0000 (17:25 +0200)]
Add debugging messages to a Dired test

* test/lisp/dired-tests.el (dired-test-bug27243-01): Log
positions saved and restored by dired-revert to try and find
out why the test fails on Hydra.

7 years agols-lisp: Autoload call instead of cookie
Tino Calancha [Wed, 2 Aug 2017 09:11:31 +0000 (18:11 +0900)]
ls-lisp: Autoload call instead of cookie

* lisp/ls-lisp.el (eshell-extended-glob): autoload call instead of cookie.

7 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Wed, 2 Aug 2017 09:01:05 +0000 (11:01 +0200)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

7 years ago; Extend traces in tramp-test36-asynchronous-requests for hydra
Michael Albinus [Wed, 2 Aug 2017 08:59:57 +0000 (10:59 +0200)]
; Extend traces in tramp-test36-asynchronous-requests for hydra

7 years agoWhen renaming a file, ask only if EEXIST or ENOSYS
Paul Eggert [Wed, 2 Aug 2017 08:53:46 +0000 (01:53 -0700)]
When renaming a file, ask only if EEXIST or ENOSYS

* src/fileio.c (Frename_file): Avoid calling Ffile_directory_p
more than once on FILE.  Use renameat_noreplace, so that we can
ask the user (and unlink and retry) only if this fails with errno
== EEXIST or ENOSYS.  This avoids the need to ask the user for
permission to do an operation that will fail anyway.  Simplify
computation of ok_if_already_exists for subsidiary functions.
* src/filelock.c (rename_lock_file): Prefer renameat_noreplace
if it works, as this avoids the need to link and unlink.
* src/lisp.h (renameat_noreplace): New decl.
* src/sysdep.c [HAVE_LINUX_FS_H]: Include linux/fs.h and sys/syscall.h.
(renameat_noreplace): New function.

7 years agoWhen creating a link, ask only if EEXIST
Paul Eggert [Wed, 2 Aug 2017 08:53:46 +0000 (01:53 -0700)]
When creating a link, ask only if EEXIST

* src/fileio.c (Fadd_name_to_file, Fmake_symbolic_link):
Ask the user (and unlink and retry) only if link creation fails
with errno == EEXIST.  This avoids the need to ask the user for
permission to do an operation that will fail anyway.

7 years agodired-align-file: Inherit text properties in inserted spaces
Tino Calancha [Wed, 2 Aug 2017 08:52:57 +0000 (17:52 +0900)]
dired-align-file: Inherit text properties in inserted spaces

* lisp/dired.el (dired-align-file): Inherit text
properties in inserted spaces (Bug#27899).
* test/lisp/dired-tests.el (dired-test-bug27899): Add test.

7 years agoDon't assume /bin/sh as the 'sh' location in the local host
Tino Calancha [Wed, 2 Aug 2017 07:50:37 +0000 (16:50 +0900)]
Don't assume /bin/sh as the 'sh' location in the local host

* lisp/dired.el (dired-insert-directory): Use executable-find in
a local host.

7 years agoMove dired tests using ls emulation to different files
Tino Calancha [Wed, 2 Aug 2017 07:39:11 +0000 (16:39 +0900)]
Move dired tests using ls emulation to different files

Suggested in:
https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00018.html
* test/lisp/dired-tests.el (dired-test-bug27693)
(dired-test-bug27762, dired-test-bug27817)
(dired-test-bug27631, dired-test-bug27843): Delete those
parts requiring either ls-lisp or eshell-ls.

* test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27762)
(ls-lisp-test-bug27631, ls-lisp-test-bug27693):
Add all dired tests using ls-lisp here.

* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631)
(em-ls-test-bug27817, em-ls-test-bug27843): New test file.  Add
all dired tests using eshell-ls here.

7 years ago* test/lisp/ls-lisp-tests.el: Rename it from ls-lisp.el
Tino Calancha [Wed, 2 Aug 2017 07:31:36 +0000 (16:31 +0900)]
* test/lisp/ls-lisp-tests.el: Rename it from ls-lisp.el

7 years ago* lisp/gnus/mm-uu.el (mm-uu-org-src-code-block-extract):
Katsumi Yamaoka [Wed, 2 Aug 2017 03:23:49 +0000 (03:23 +0000)]
* lisp/gnus/mm-uu.el (mm-uu-org-src-code-block-extract):
Say the handle is already decoded.
cf. <yw.87lgnh5cfv.fsf@alex.chromebook> in the info-gnus-english list.

7 years agoDon’t worry about unlink if errno == ENOENT
Paul Eggert [Wed, 2 Aug 2017 00:24:28 +0000 (17:24 -0700)]
Don’t worry about unlink if errno == ENOENT

* src/fileio.c (Fdelete_file):
* src/keyboard.c (Fopen_dribble_file): Do not report failure to
remove a file if unlink fails with errno == ENOENT.  This can
happen even if Emacs is the only program removing the file, in
case an NFS cache overflows.  The file does not exist if errno ==
ENOENT, so it is OK to proceed.

7 years agoFix misalignment in Dired when dired-directory is a cons
Tino Calancha [Tue, 1 Aug 2017 15:01:45 +0000 (00:01 +0900)]
Fix misalignment in Dired when dired-directory is a cons

* lisp/dired.el (dired--need-align-p, dired--align-all-files):
New defuns.
(dired-internal-noselect): Call dired--align-all-files when
dired-directory is a cons (Bug#27762).
* test/lisp/dired-tests.el (dired-test-bug27762): Test should pass.

7 years agoFix some dired-tests.el on MS-Windows
Eli Zaretskii [Tue, 1 Aug 2017 14:45:25 +0000 (17:45 +0300)]
Fix some dired-tests.el on MS-Windows

* test/lisp/dired-tests.el (dired-test-bug27243-01)
(dired-test-bug27243-02): On MS-Windows, pass test-dir through
file-truename, to avoid bogus failures due to file-name comparison
as strings.

7 years agoInsert subdir content if dir-or-list is a string w/o wildcards
Tino Calancha [Tue, 1 Aug 2017 14:31:35 +0000 (23:31 +0900)]
Insert subdir content if dir-or-list is a string w/o wildcards

* lisp/eshell/em-ls.el (eshell-ls--insert-directory):
Append '("-d") into 'eshell-ls-dired-initial-args'
if 'dired-directory' is a cons or there are wildcars (Bug#27843).
* test/lisp/dired-tests.el (dired-test-bug27843): Add test.