Stefan Kangas [Wed, 10 Feb 2021 03:48:43 +0000 (04:48 +0100)]
Make texinfmt-version variable obsolete
* lisp/textmodes/texinfmt.el (texinfmt-version): Make variable and
command obsolete in favour of 'emacs-version'.
(texinfo-format-region, texinfo-format-buffer-1): Use
'emacs-version' instead of above obsolete variable.
Stefan Kangas [Wed, 10 Feb 2021 01:07:55 +0000 (02:07 +0100)]
Convert many manual cedet tests to ert
* test/manual/cedet/cedet-utests.el
(cedet-files-utest): Move test from here...
* test/lisp/cedet/cedet-files-tests.el: ...to this new file.
* test/manual/cedet/srecode-tests.el
(srecode-document-function-comment-extract-test): Move test from
here...
* test/lisp/cedet/srecode/document-tests.el: ...to this new file.
* test/manual/cedet/cedet-utests.el
(inversion-unit-test): Move test from here...
* test/lisp/cedet/inversion-tests.el: ...to this new file.
* test/manual/cedet/semantic-tests.el
(semantic-gcc-test-output-parser): Move test from here...
* test/lisp/cedet/semantic/bovine/gcc-tests.el: ...to this new file.
* test/manual/cedet/semantic-tests.el
(semantic-test-data-cache): Move test from here...
* test/lisp/cedet/semantic/fw-tests.el: ...to this new file.
* lisp/vc/vc-dir.el (vc-default-dir-printer): Add check for the
"ignored" status and make 'vc-dir-status-edited' the default face.
Also extend condition for more states that qualify as "warnings".
(vc-dir-ignored, vc-dir-status-ignored): Rename face for consistency.
* lisp/vc/vc-git.el (vc-git-dir-printer): Use the
'vc-dir-status-edited' as the default for the Git backend. And
reference the renamed face. Also stop treating the empty stash
differently from other header values.
* lisp/international/mule-cmds.el (mule--ucs-names-sort-by-code):
Sort with car-less-than-car instead of slower lambda.
(mule--ucs-names-affixation): Just stick character into a list to
avoid trip through format and char-to-string.
(read-char-by-name): Quote function symbols as such.
* lisp/net/dictionary.el (dictionary-link-dictionary): New defcustom.
(dictionary-mark-reference): Use dictionary-link-dictionary.
(dictionary-post-buffer-hook): New defcustom.
(dictionary-post-buffer): Run dictionary-post-buffer-hook.
(dictionary-mode-map): Bind 'S-SPC' to scroll-down-command.
(dictionary-search-default): Use possibly multi-word data at point.
Stefan Monnier [Tue, 9 Feb 2021 18:27:08 +0000 (13:27 -0500)]
Use lexical-binding in a few more scattered files
* lisp/registry.el: Use lexical-binding.
(registry-reindex): Remove unused var `values`.
* lisp/cedet/pulse.el: Use lexical-binding.
* lisp/cedet/semantic/idle.el: Use lexical-binding.
(semantic-idle-core-handler): Remove unused var `safe`.
(ede-auto-add-method): Declare var.
(define-semantic-idle-service): Use `declare`. Remove unused var `setup`.
(pulse-flag): Declare var.
* lisp/net/ldap.el: Use lexical-binding.
(ldap-search-internal): Remove unused var `proc`.
* lisp/net/mairix.el: Use lexical-binding.
Remove redundant `:group` args.
(mairix-widget-create-query): Remove unnused var `allwidgets`.
Juri Linkov [Tue, 9 Feb 2021 18:12:36 +0000 (20:12 +0200)]
New options read-char-by-name-sort and read-char-by-name-group (bug#46240)
* lisp/international/mule-cmds.el (mule--ucs-names-sort-by-code)
(mule--ucs-names-group): New functions.
(read-char-by-name-sort, read-char-by-name-group): New defcustoms.
(read-char-by-name): Use them.
Stefan Monnier [Tue, 9 Feb 2021 17:52:04 +0000 (12:52 -0500)]
* lisp/cedet/{semantic/scope.el,ede/project-am.el}: Use lexical-scoping
* lisp/cedet/ede/project-am.el: Remove redundant `:group` args.
(recentf-exclude): Declare variable.
(project-am--with-makefile-current): New function extracted from
`project-am-with-makefile-current`. Use `with-current-buffer` and
`unwind-protect`.
(project-am-with-makefile-current): Use `declare` and
`project-am--with-makefile-current`.
(project-am-with-config-current): Use `declare` and `with-temp-buffer`.
(project-am-extract-shell-variable): Turn it into a `defun`; the use of
`defmacro` appears to have been a plain mistake.
Stefan Monnier [Tue, 9 Feb 2021 17:02:25 +0000 (12:02 -0500)]
* lisp/emacs-lisp/macroexp.el: Break cycle with bytecomp/byte-opt
The recent change in macroexp triggered a cyclic dependency error
during eager macroexpansion when neither `bytecomp` nor `byte-opt` had
been byte-compiled yet. This fixes it by moving the offending
function to macroexp.el.
* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Move from
byte-opt.el and rename.
(macroexp--expand-all): Use it.
* lisp/emacs-lisp/byte-opt.el (byte-compile-unfold-lambda): Move to
macroexp.el.
(byte-compile-inline-expand, byte-optimize-form-code-walker):
* lisp/emacs-lisp/bytecomp.el (byte-compile-form):
Use `macroexp--unfold-lambda` instead.
* src/lread.c (syms_of_lread): Note that it's obsolete in the doc
string (because we can't mark it as obsolete "properly" yet,
because that leads to compilation warnings when somebody
(let (values) ... values).
Alan Mackenzie [Tue, 9 Feb 2021 09:41:13 +0000 (09:41 +0000)]
Allow exit-minibuffer to be called from Lisp code. Fixes bug #46373
* lisp/minibuffer.el (exit-minibuffer): Throw the error "Not in most nested
minibuffer" only when the current buffer is a minibuffer (thus the command
came directly from a key binding).
* doc/lispref/minibuf.texi (Minibuffer Commands): Change the documentation
accordingly.
Stefan Monnier [Tue, 9 Feb 2021 00:08:14 +0000 (19:08 -0500)]
* lisp/gnus/gnus-topic.el: Fix a backward incompatibility
(gnus-topic-insert-topic-line): Make the vars used in
`gnus-topic-line-format-spec` dynamically scoped since it seems
that they're sometimes accessed from functions called by
`gnus-topic-line-format-spec` :-(
* lisp/gnus/gnus-util.el (gnus--\,@): Move macro to here...
* lisp/gnus/gnus-art.el (gnus--\,@): .. from here.
Eli Zaretskii [Mon, 8 Feb 2021 16:04:00 +0000 (18:04 +0200)]
Fix scrolling past tall images
* src/xdisp.c (try_window): Don't try checking the margins if the
window is vscrolled, as that could cause unnecessary recentering
when tall images are displayed. (Bug#46320)
Anticrisis [Mon, 8 Feb 2021 06:33:49 +0000 (07:33 +0100)]
Fix tcl-mode indentation of namespaced code
* lisp/progmodes/tcl.el (tcl-calculate-indent): Fix indentation
when using namespaces (bug#44834).
(tcl-beginning-of-defun-function): Remove. This partially reverts cd5bb4bf3dbad8941d25823f398b595b8f0edbb9.
Make `C-a' in enriched-mode behave more line in other modes
* lisp/textmodes/enriched.el (enriched-mode-map): Don't rebind
beginning-or-line, because it makes `C-S-a' not mark the region,
and it doesn't allow actually moving to the beginning of the line
if the line starts with characters in `adaptive-fill-regexp'
(bug#22554).
Eric Abrahamsen [Sun, 7 Feb 2021 21:46:50 +0000 (13:46 -0800)]
Fix namazu search result parsing in gnus-search
* lisp/gnus/gnus-search.el (gnus-search-indexed-extract): This method
is documented to leave point at the end of the extracted search
result. The namazu implementation wasn't doing that.
Tino Calancha [Sun, 7 Feb 2021 15:51:07 +0000 (16:51 +0100)]
Add command to recenter errors from Occur/Grep buffers
To scroll up/down the current displayed occurrence/error
without abandon the Occur/Grep buffer.
Add also a command 'recenter-other-window' to recenter
the other window from any kind of buffer.
* lisp/window.el (recenter-other-window): New command.
Bind recenter-other-window to S-M-C-l (Bug#46119).
* lisp/simple.el (recenter-current-error): New command.
* lisp/progmodes/grep.el (grep-mode-map):
Delete bidings for n and p.
* lisp/progmodes/compile.el (compilation-minor-mode-map):
Move here the n and p bindings.
Bind `recenter-current-error' to l.
* lisp/replace.el (occur-mode-map):
Same.
* lisp/simple.el (count-lines): Revert back to using
`forward-line', because there seems to be a disagreement on how
lines should be counted in a region...
* src/fns.c (Fline_number_at_pos): Rename from
Fline_number_at_position and adjust parameter list.
Reverse customize-changed and customize-changed-options aliasing
* lisp/cus-edit.el (customize-changed): Rename from
customize-changed-options (bug#23085), since the old name doesn't
reflect what it does: It's not just about user options, but also
faces and the like.
(customize-changed-options): Make into an obsolete alias.
Sean Whitton [Sun, 7 Feb 2021 12:30:33 +0000 (13:30 +0100)]
Move 'revert-buffer' global binding to 'C-x g g'
* lisp/bindings.el: Define ctl-x-g-map and bind 'revert-buffer' to
'C-x x g' globally.
* doc/emacs/files.texi: Replace 'C-x g' with 'C-x x g'.
* etc/NEWS: Document the change (bug#46300).
; Improved commentary in the variable constprop mechanism
* lisp/emacs-lisp/byte-opt.el (byte-optimize--lexvars)
(byte-optimize--vars-outside-condition)
(byte-optimize-form-code-walker, byte-optimize-let-form):
Clarify various aspects in the variable constant-propagation code,
as kindly pointed out by Stefan Monnier.
Fix spurious warnings from unwise condition order in inlined code
These are both conditions having the form (and A B) where A is
side-effect-free and B may be known to be nil at compile time.
The compiler will then warn about A being useless and thrown away.
The fix is to test B first.
* lisp/gnus/gnus.el (gnus-method-to-server):
Test `(not no-enter-cache)` first.
(gnus-server-get-method): Test `group` first.
Lexical variables bound to a constant value (symbol, number or string)
are substituted at their point of use and the variable then eliminated
if possible. Example:
(let ((x (+ 2 3))) (f x)) => (f 5)
This reduces code size, eliminates stack operations, and enables
further optimisations. The implementation is conservative, and is
strongly curtailed by the presence of variable mutation, conditions
and loops.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-enable-variable-constprop)
(byte-optimize-warn-eliminated-variable): New constants.
(byte-optimize--lexvars, byte-optimize--vars-outside-condition)
(byte-optimize--vars-outside-loop, byte-optimize--dynamic-vars):
New dynamic variables.
(byte-optimize--substitutable-p, byte-optimize-let-form):
New functions.
(byte-optimize-form-code-walker): Adapt clauses for variable
constprop, and add clauses for 'setq' and 'defvar'.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-var)
(bytecomp-test-get-var, bytecomp-test-identity)
(byte-opt-testsuite-arith-data): Add test cases.
Martin Rudalics [Sat, 6 Feb 2021 17:22:29 +0000 (18:22 +0100)]
Permit zero value for 'child-frame-border-width' parameter (Bug#46184)
* doc/lispref/frames.texi (Layout Parameters): Update entry on
'child-frame-border-width' parameter.
* src/frame.c (make_frame): Init child_frame_border_width to -1.
(Fframe_child_frame_border_width): Return internal border width if
child frame border width parameter is nil.
(gui_report_frame_params): Report nil as child frame border
width parameter if the frame value is negative.
* src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Return value of
child frame border width only if it is not negative.
* src/xfns.c (Fx_create_frame): Default child frame border to -1
when recording it in its frame slot via gui_default_parameter.
* src/nsfns.m (ns_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/w32fns.c (w32_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
* src/xfns.c (x_set_child_frame_border_width): Handle nil ARG.
(Fx_create_frame): Default child frame border width parameter to
nil.
Glenn Morris [Sat, 6 Feb 2021 16:10:38 +0000 (08:10 -0800)]
Merge from origin/emacs-27
8ad48a0bdd (origin/emacs-27) Improve doc string of 'text-scale-adjust' 7a25ff767d Clarify the indent-rigidly doc string 6c5ddf0e0b Fix two small tab bar issues c71e08eba9 Fix last change in syntax.texi
Glenn Morris [Sat, 6 Feb 2021 16:05:29 +0000 (08:05 -0800)]
; Merge from origin/emacs-27
The following commits were skipped:
b99848c72c Bind default-directory to the project root 19534f988c Make sure default-directory relates to the originating buffer d1455027e0 Initialize signal descriptions after pdumping 256356a36f Clarify the "Sentinels" node in the lispref manual 89f1634afc Fix problem with non-ASCII characters in nnmaildir
* lisp/subr.el (provided-mode-derived-p): Remove detail about "or
their aliases", since that seems self-evident (bug#46331) (and
derived-mode-p works the same, and doesn't have the bit in
question).
* lisp/emacs-lisp/testcover.el: Rename the symbol `1value'
throughout the file to `testcover-1value' to allow using the
variable in code that's to be tested (bug#25471).
* lisp/subr.el (provided-mode-derived-p): Allow this to work on
modes that are aliases of other modes (bug#46331). For instance:
(provided-mode-derived-p 'javascript-mode 'prog-mode)
Michael Albinus [Sat, 6 Feb 2021 10:50:55 +0000 (11:50 +0100)]
Modernize use of prompts in auth-source.el
* lisp/auth-source.el (auth-source-search): Adapt docstring
(auth-source-format-prompt): Remove trailing ": ".
(auth-source-netrc-create, auth-source-secrets-create)
(auth-source-plstore-create): Adapt prompts. Use `format-prompt'.
Do not ask interactively if `auth-source-save-behavior' is nil.