1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00
Commit Graph

130115 Commits

Author SHA1 Message Date
Eli Zaretskii
8cc8ad02bd 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.
2017-08-12 11:29:37 +03:00
Alexander Gramiak
84288cf421 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)
2017-08-12 10:12:36 +03:00
Arash Esbati
19d2b4a3e2 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)
2017-08-12 08:11:11 +02:00
Stephen Berman
e3ed43f4ac 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.
2017-08-11 11:28:57 +02:00
Paul Eggert
a56e6e7961 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.
2017-08-11 01:07:31 -07:00
Noam Postavsky
179499cde9 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.
2017-08-10 21:30:37 -04:00
Tom Tromey
81656add81 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.
2017-08-09 16:06:23 -06:00
Paul Eggert
904be8c4cf 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.
2017-08-09 11:46:06 -07:00
Eli Zaretskii
7fc27ea70b 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.
2017-08-09 20:15:46 +03:00
Tino Calancha
da4438e14f 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.
2017-08-09 14:48:49 +09:00
Tino Calancha
9ecbdeeaa8 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'.
2017-08-09 14:37:21 +09:00
Alexander Gramiak
9723782161 Use help-mode xrefs in describe-font
* lisp/international/mule-diag.el (describe-font): Use help-setup-xref
(Bug#27890).
2017-08-08 19:57:24 -04:00
Katsumi Yamaoka
2ef880cc75 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).
2017-08-08 23:40:27 +00:00
Mark Oteiza
63b5a4a65e 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.
2017-08-08 15:10:49 -04:00
Mark Oteiza
884d43b43e 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
2017-08-08 15:00:21 -04:00
Mark Oteiza
4cb0bdd675 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.
2017-08-08 14:15:51 -04:00
Paul Eggert
7d1115e0c7 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.
2017-08-08 09:50:15 -07:00
Tom Tromey
846870e508 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.
2017-08-07 21:48:33 -06:00
Mark Oteiza
c3445aed51 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.
2017-08-07 22:06:03 -04:00
Tino Calancha
919ac3ae16 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.
2017-08-08 10:25:27 +09:00
Noam Postavsky
bec5b60259 ; Merge: Fixes for macroexpansion and compilation 2017-08-07 21:09:19 -04:00
Noam Postavsky
79a74568e9 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.
2017-08-07 18:54:49 -04:00
Noam Postavsky
b5c8e9898d 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.
2017-08-07 18:54:49 -04:00
Stefan Monnier
cc30d77ecd 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>
2017-08-07 18:54:49 -04:00
Gemini Lasswell
00f7e31110 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.
2017-08-07 18:54:48 -04:00
Noam Postavsky
0508045ed7 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.
2017-08-07 18:54:44 -04:00
Noam Postavsky
95a04fd26c ; 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.
2017-08-07 18:43:55 -04:00
Alexander Gramiak
054c198c12 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.
2017-08-07 18:43:54 -04:00
Reuben Thomas
e6fa08363d Revert "Add Enchant support to ispell.el (Bug#17742)"
This reverts commit 7136e6723d.
2017-08-07 21:59:06 +01:00
Reuben Thomas
89187e93d2 Revert "Add support for arguments in ALTERNATE_EDITOR to emacsclient"
This reverts commit 28f1fe97da.
2017-08-07 21:58:55 +01:00
Reuben Thomas
28f1fe97da 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.
2017-08-07 21:57:22 +01:00
Reuben Thomas
7136e6723d 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.
2017-08-07 21:57:22 +01:00
Reuben Thomas
85512e7521 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.
2017-08-07 21:57:22 +01:00
Eli Zaretskii
14ea76af5f 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)
2017-08-07 20:47:53 +03:00
Stefan Monnier
2d76cf9479 * lisp/gnus/gnus-bcklg.el (gnus-backlog-request-article): Fix thinko. 2017-08-07 12:16:02 -04:00
Martin Rudalics
b6b362c910 Fix doc-string of `delete-other-windows'
* lisp/window.el (delete-other-windows): Fix doc-string.
2017-08-07 09:51:01 +02:00
Paul Eggert
446e92548f 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.
2017-08-06 23:54:05 -07:00
Michael R. Mauger
6e2c0929ba Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2017-08-06 20:58:08 -04:00
Noam Postavsky
c2f1830d69 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.
2017-08-06 20:25:11 -04:00
Paul Eggert
93511e9473 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.
2017-08-06 16:58:35 -07:00
Eli Zaretskii
8a406d1185 * etc/tutorials/TUTORIAL.he: Update to match recent changes to TUTORIAL. 2017-08-06 22:02:08 +03:00
Mark Oteiza
c2a8cffe80 ; 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'.
2017-08-06 10:15:17 -04:00
Tino Calancha
b1b99edd3e 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.
2017-08-06 22:16:56 +09:00
Tino Calancha
e7aabd8b1c 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.
2017-08-06 21:53:07 +09:00
Tino Calancha
cbea38e5c4 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.
2017-08-06 13:46:51 +09:00
Paul Eggert
785a4a1d52 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.
2017-08-05 21:28:09 -07:00
Tino Calancha
c0df64db08 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.
2017-08-06 13:23:18 +09:00
Tino Calancha
7c3593f817 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.
2017-08-06 13:09:31 +09:00
Tom Tromey
9b463fa864 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.
2017-08-05 18:31:39 -06:00
Richard Stallman
0bd08c0075 * etc/tutorials/TUTORIAL: Update. 2017-08-05 14:02:29 -07:00