1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

130151 Commits

Author SHA1 Message Date
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
Eli Zaretskii
9df49cddae 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.
2017-08-05 16:47:14 +03:00
Eli Zaretskii
5840399b76 Avoid segfaults while producing Punct.el
* lisp/international/mule-conf.el: Undo unification of
cns11643-15, as that causes segfaults during bootstrap.
(Bug#27964)
2017-08-05 16:28:09 +03:00
Eli Zaretskii
c3ac93bb9f 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)
2017-08-05 14:22:04 +03:00
Eli Zaretskii
885c512603 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.
2017-08-05 12:52:55 +03:00
Eli Zaretskii
2cb9805702 Unify CNS11643-15
* lisp/international/mule-conf.el (chinese-cns11643-15): Add a
unify-charset form for it.  (Bug#27964)
2017-08-05 12:23:08 +03:00
Eli Zaretskii
a0aef7cd02 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)
2017-08-05 12:00:31 +03:00
Alexander Gramiak
8a577e9468 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)
2017-08-05 11:51:05 +03:00
Eli Zaretskii
2441d0118b 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.
2017-08-05 11:38:04 +03:00
Eli Zaretskii
19a41ce2de Improve documentation of 'region-extract-function'
* lisp/simple.el (region-extract-function): Rename the argument to
METHOD.  Doc fix.  (Bug#27927)
2017-08-05 11:03:24 +03:00
Paul Eggert
b8748dd093 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.
2017-08-04 22:47:05 -07:00
Paul Eggert
0a24f47f0e 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).
2017-08-04 22:35:11 -07:00
Tino Calancha
055e2a1906 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.
2017-08-05 14:20:28 +09:00
Noam Postavsky
12d7757a79 ; * lisp/emacs-lisp/re-builder.el: Fix commentary (Bug#27947). 2017-08-04 18:36:05 -04:00
Noam Postavsky
3a0f2dfa79 ; 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.
2017-08-04 18:22:06 -04:00