Juri Linkov [Wed, 3 Mar 2021 19:12:13 +0000 (21:12 +0200)]
New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings
* lisp/outline.el (outline-mode-cycle-map): New keymap from outline-mode-map.
(outline-mode-map): Inherit from outline-mode-cycle-map.
(outline-font-lock-keywords): Append keymap and face depending on
'outline-minor-mode-cycle' and 'outline-minor-mode-highlight'.
(outline-minor-mode-cycle, outline-minor-mode-highlight): New variables.
(outline-minor-mode-highlight-buffer): New function.
(outline-minor-mode): Handle 'outline-minor-mode-cycle' and
'outline-minor-mode-highlight'.
(outline-cycle-minor-mode, outline-cycle-highlight-minor-mode):
New minor modes (bug#45147).
* etc/compilation.txt:
* etc/grep.txt:
Enable outline-cycle-highlight-minor-mode.
Stefan Kangas [Wed, 3 Mar 2021 18:54:37 +0000 (19:54 +0100)]
Make inversion.el obsolete (Bug#46841)
* lisp/cedet/inversion.el:
* test/lisp/cedet/inversion-tests.el: Move from here...
* lisp/obsolete/inversion.el:
* test/lisp/obsolete/inversion-tests.el: ...to here.
* lisp/cedet/cedet.el (cedet-version): Make obsolete.
* lisp/cedet/cedet-cscope.el (cedet-cscope-version-check):
* lisp/cedet/cedet-global.el (cedet-gnu-global-version-check):
* lisp/cedet/cedet-idutils.el (cedet-idutils-version-check):
* lisp/cedet/ede/make.el (ede-make-check-version): Use 'version<'
instead of 'inversion-check-version'.
* lisp/cedet/semantic/db-file.el (semanticdb-load-database): Don't
use 'inversion-test'.
* lisp/cedet/semantic/ede-grammar.el
(ede-proj-makefile-insert-variables): Don't add inversion to
loadpath.
* lisp/speedbar.el: Remove stale comment.
Alan Mackenzie [Wed, 3 Mar 2021 11:55:51 +0000 (11:55 +0000)]
C++ Mode: Handle "if constexpr (...)" with a simple statement correctly
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): Add a check and
handling for c-block-stmt-hangon-key in the main loop.
Stefan Monnier [Tue, 2 Mar 2021 20:57:45 +0000 (15:57 -0500)]
* lisp/emacs-lisp/pcase.el (pcase--u1): Fix typo
Alan Mackenzie [Tue, 2 Mar 2021 20:31:36 +0000 (20:31 +0000)]
CC Mode: Fix analysis of brace lists, particularly in C++ Mode
Fix some alignment functionality in cc-align.el.
* lisp/progmodes/cc-align.el (c-lineup-arglist-intro-after-paren): Align the
next line under the previous entry rather than one to the right of the paren.
(c-lineup-2nd-brace-entry-in-arglist): Take the anchor point from the
brace-list-entry element, not the brace-list-intro one.
* lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Use
c-looking-at-statement-block to test whether "struct A {" begins a brace list
or a struct declaration.
(c-looking-at-or-maybe-in-bracelist): Several detailed amendments, correctly
to recognize brace lists.
(c-looking-at-statement-block): No longer search for commas, as they are not
reliable indicators of a brace list. Search now for a restricted set of
keywords, since some can appear in brace lists in C++ mode.
* lisp/progmodes/cc-langs.el (c-stmt-block-only-keywords)
(c-stmt-block-only-keywords-regexp): New lang consts/vars.
(c-pre-id-bracelist-kwds): New lang const.
(c-pre-id-bracelist-key): Derive now from the above.
(c-pre-brace-non-bracelist-key): New lang const/var.
Juri Linkov [Tue, 2 Mar 2021 19:50:49 +0000 (21:50 +0200)]
* lisp/tab-bar.el: Minor stylistic fixes.
(tab-bar-select-tab-modifiers): Use tab-bar--undefine-keys and
tab-bar--define-keys instead of turning tab-bar-mode on/off.
Stefan Monnier [Tue, 2 Mar 2021 14:13:57 +0000 (09:13 -0500)]
* lisp/emacs-lisp/trace.el (trace-values): Work outside of traced function
Dmitry Gutov [Tue, 2 Mar 2021 13:16:34 +0000 (15:16 +0200)]
(ruby-find-library-file): Also recognize 'gem' statements
* lisp/progmodes/ruby-mode.el (ruby-find-library-file):
Also recognize 'gem' statements.
Pip Cet [Sun, 28 Feb 2021 19:43:09 +0000 (19:43 +0000)]
Compile closures that modify their bound vars correctly (Bug#46834)
* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Don't
move let bindings into the lambda. Don't reverse list of
bindings. (byte-compile): Evaluate the return value if it was
previously reified.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-reify-function):
Add tests.
Lars Ingebrigtsen [Tue, 2 Mar 2021 07:07:59 +0000 (08:07 +0100)]
Improve the dired-do-kill-lines doc string
* lisp/dired-aux.el (dired-do-kill-lines): Document the FMT
parameter (bug#46867).
Stefan Monnier [Tue, 2 Mar 2021 04:57:34 +0000 (23:57 -0500)]
* lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patterns
Improve the handling of `or` patterns where not all sub-patterns bind the
same set of variables. This used to be "unsupported" and behaved in
somewhat unpredictable ways.
(pcase--expand): Rewrite.
(pcase-codegen): Delete.
* doc/lispref/control.texi (pcase Macro): Adjust accordingly.
Also remove the warning about "at least two" sub patterns.
These work fine, AFAICT, and if not we should fix it.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-or-vars): New test.
Lars Ingebrigtsen [Mon, 1 Mar 2021 21:41:42 +0000 (22:41 +0100)]
Fix previous completion-pcm--optimize-pattern fix
* lisp/minibuffer.el (completion-pcm--optimize-pattern): Re-fix
previous change.
Lars Ingebrigtsen [Mon, 1 Mar 2021 21:38:17 +0000 (22:38 +0100)]
Fix warning in completion-pcm--optimize-pattern
* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused variable.
Lars Ingebrigtsen [Mon, 1 Mar 2021 21:12:43 +0000 (22:12 +0100)]
Make easymenu downcase the menu symbol for greater backwards compat
* lisp/cmuscheme.el (map): Revert previous fix.
* lisp/woman.el (woman-dired-define-keys): Ditto.
* lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Downcase the
menu name for greater backwards compatibility.
Stefan Monnier [Mon, 1 Mar 2021 20:35:51 +0000 (15:35 -0500)]
* lisp/emacs-lisp/pcase.el: Fix bug#46786
Revert commit
a218c9861573b5ec4979ff2662f5c0343397e3ff, but in order
to avoid the spurious warnings that this commit tried to squash,
keep track of the vars used during the match so as to add
corresponding annotations to explicitly silence the spurious warnings.
To do this, we change the VARS used in `pcase-u` (and throughout
the pcase code): they used to hold elements of the form (NAME . VAL)
and now they hold elements of the form (NAME VAL . USED).
(pcase--expand): Bind all vars instead of only those found via fgrep.
(pcase-codegen): Silence "unused var" warnings for those vars that have
already been referenced during the match itself.
(pcase--funcall, pcase--eval): Record the vars that are used.
(pcase--u1): Record the vars that are used via non-linear patterns.
* lisp/textmodes/mhtml-mode.el (mhtml-forward):
* lisp/vc/diff-mode.el (diff-goto-source): Silence newly
discovered warnings.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-bug46786): New test.
Mattias Engdegård [Mon, 1 Mar 2021 19:52:39 +0000 (20:52 +0100)]
Fix multiple Calc defmath errors (bug#46750)
Fix incorrect variable scoping in `let*`, `for` and `foreach`.
Fix loop variable value in `foreach` (should be element, not tail).
Fix function quoting, as in ('cons x y) -- didn't work at all.
Reported by Stephan Neuhaus.
* lisp/calc/calc-prog.el (math-define-exp, math-handle-foreach):
* test/lisp/calc/calc-tests.el: (var-g, test1, test2, test3, test4)
(test5, test6, test7, calc-defmath): Test various defmath forms.
Mattias Engdegård [Mon, 1 Mar 2021 15:40:31 +0000 (16:40 +0100)]
Remove references to old bignums from Calc manual
* doc/misc/calc.texi: Remove references to the old Calc representation
of big integers, outdated references to fixnums, an any text and
examples that only made sense at the time.
Mattias Engdegård [Mon, 1 Mar 2021 15:38:33 +0000 (16:38 +0100)]
* lisp/calc/calc-ext.el (math-equal-int): Work for bignums.
Juri Linkov [Mon, 1 Mar 2021 19:58:00 +0000 (21:58 +0200)]
* lisp/isearch.el: Minor doc fix.
Juri Linkov [Mon, 1 Mar 2021 19:56:42 +0000 (21:56 +0200)]
* lisp/tab-bar.el (tab-bar--define-keys): Add check for tab-bar-format-global.
Protesilaos Stavrou [Mon, 1 Mar 2021 15:31:44 +0000 (17:31 +0200)]
Add 'require-theme' function
* etc/NEWS: Document new function.
* lisp/custom.el (require-theme): Add function.
This follows from the discussion on bug#45068 where it became apparent
that there was no equivalent mechanism to 'require' that read through
the 'custom-theme-load-path'.
Lars Ingebrigtsen [Mon, 1 Mar 2021 19:48:20 +0000 (20:48 +0100)]
Fix woman.el menu alteration code
* lisp/woman.el (woman-dired-define-keys): Fix naming of menu
after dired menu changes.
Alan Mackenzie [Mon, 1 Mar 2021 19:23:01 +0000 (19:23 +0000)]
CC Mode: Amend C-M-a/e to handle lambda function in C++ arglist
* lisp/progmodes/cc-cmds.el (c-where-wrt-brace-construct): Reformulate latter
part such that the least enclosing braces and parentheses are used when
determining containment in such. c-beginning-of-decl-1 has been superseded
by list movement and syntactic whitespace movement.
(c-backward-to-nth-BOF-{): Work on least enclosing parens rather than parens
at any level when moving back to an opening brace.
(c-forward-to-nth-EOF-\;-or-}): Work on least enclosing parens, as above.
Move the correction of point when in a "function trailer" to after the main
loop, correcting a minor bug.
Stefan Monnier [Mon, 1 Mar 2021 19:07:05 +0000 (14:07 -0500)]
* lisp/emacs-lisp/pcase.el (pcase--split-pred): Re-fix bug#14773
Adjust to calling convention of `macroexp--fgrep`.
Stefan Monnier [Mon, 1 Mar 2021 17:18:49 +0000 (12:18 -0500)]
Fix misuses of `byte-compile-macro-environment`
These seem to be left overs from Emacs<24 when `macroexpand-all` was
implemented in the CL library and hence the macros's evaluation
environment could come from different places depending on the
circumstance (either `byte-compile-macro-environment`, or
`cl-macro-environment`, or ...).
`byte-compile-macro-environment` contains definitions which expand to
code that is only understood by the rest of the byte-compiler,
so using it for code which isn't being byte-compiled leads to errors
such as references to non-existing function
`internal--with-suppressed-warnings`.
* lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): Remove left-over
binding from when `macroexpand-all` was implemented in the CL library.
* lisp/emacs-lisp/ert.el (ert--expand-should-1):
* lisp/emacs-lisp/cl-macs.el (cl--compile-time-too): Properly preserve the
macroexpand-all-environment.
(cl--macroexp-fboundp): Pay attention to `cl-macrolet` macros as well.
Stefan Monnier [Mon, 1 Mar 2021 16:42:04 +0000 (11:42 -0500)]
* src/eval.c (init_eval_once): Bump max_specpdl_size (bug46818)
Further testing seems to confirm my suspicion that the increase in the
specpdl comes from the recent change to `pcase--if`.
* lisp/international/mule-cmds.el (update-leim-list-file): Revert workaround.
Glenn Morris [Mon, 1 Mar 2021 14:27:02 +0000 (06:27 -0800)]
; Auto-commit of loaddefs files.
Matt Armstrong [Mon, 1 Mar 2021 13:26:21 +0000 (14:26 +0100)]
Clean up obsolete comment
* src/marker.c (unchain_marker): Clean up obsolete comment
(bug#46836).
Commit
cf3164523b (* src/alloc.c: Avoid O(N²) complexity when
unchaining markers (bug#24548)., 2018-03-23) removed the call from GC
into unchain_marker, so there is no need to warn about it.
F. Jason Park [Mon, 1 Mar 2021 13:04:39 +0000 (14:04 +0100)]
Fix Bootstring skew parameter in puny.el
* lisp/net/puny.el: change puny-skew to match value given in RFC3492.
* test/lisp/net/puny-tests.el (puny-test-encode-domain)
(puny-test-decode-domain): add regression case for popular
domain. (bug#46838).
Stefan Kangas [Mon, 1 Mar 2021 03:21:11 +0000 (04:21 +0100)]
Convert various menus to easymenu
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-map): Move menu from
here...
(lisp-mode-menu): ...to here, and convert to easymenu.
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode-map): Move
menu definition from here...
(lisp-interaction-mode-menu): ...to here, and convert to easymenu.
* lisp/replace.el (occur-menu-map): Convert to easymenu.
Glenn Morris [Mon, 1 Mar 2021 02:07:04 +0000 (18:07 -0800)]
Improve admin.el's Makefile in standalone manual tarfiles
* admin/admin.el (make-manuals-dist-output-variables):
Fix abs_top_builddir. Add EMACS.
(make-manuals-dist--1): Respect case when replacing output variables.
Glenn Morris [Sun, 28 Feb 2021 23:22:29 +0000 (15:22 -0800)]
info/dir needs generated texi files to exist
* Makefile.in (misc-info): Depend on lisp.
(${srcdir}/info/dir): Depend on info-real.
(info): Simplify.
Glenn Morris [Sun, 28 Feb 2021 23:13:07 +0000 (15:13 -0800)]
Make generation of texi from org overwrite output
* doc/misc/Makefile.in (org_template): Don't delete output.
* lisp/org/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
Overwrite existing output.
Glenn Morris [Sun, 28 Feb 2021 22:27:28 +0000 (14:27 -0800)]
* doc/misc/modus-themes.org: Add copying markup. (Bug#45141)
Glenn Morris [Sun, 28 Feb 2021 22:26:46 +0000 (14:26 -0800)]
Update admins make-manuals for new output variable
* admin/admin.el (make-manuals-dist-output-variables):
Add abs_top_builddir.
Stefan Kangas [Sun, 28 Feb 2021 22:23:41 +0000 (23:23 +0100)]
Convert dired menus to easymenu
* lisp/dired.el (dired-mode-map): Move menus from here...
(dired-mode-subdir-menu, dired-mode-immediate-menu)
(dired-mode-regexp-menu, dired-mode-mark-menu)
(dired-mode-operate-menu): ...to here, and convert to easymenu.
Stefan Kangas [Sun, 28 Feb 2021 21:21:39 +0000 (22:21 +0100)]
Convert hi-lock-menu to easymenu
* lisp/hi-lock.el (hi-lock-menu): Convert to easymenu.
Alan Mackenzie [Sun, 28 Feb 2021 21:15:34 +0000 (21:15 +0000)]
Combine and reconcile two conflicting entries in NEWS on goto-line-history
* etc/NEWS: Amend.
* doc/lispref/minibuf.texi (Minibuffer History): Amend the entry about
goto-line-history, which is now buffer local only after being so customized.
Mattias Engdegård [Sun, 28 Feb 2021 18:02:15 +0000 (19:02 +0100)]
Declare more string predicates as pure
* lisp/emacs-lisp/byte-opt.el (pure-fns): Treat string>,
string-greaterp, string-empty-p, string-blank-p, string-prefix-p and
string-suffix-p as pure functions in the compiler.
Basil L. Contovounesios [Sun, 28 Feb 2021 16:29:05 +0000 (16:29 +0000)]
; Fix process-lines-handling-status docstring.
Basil L. Contovounesios [Sun, 28 Feb 2021 15:44:34 +0000 (15:44 +0000)]
; Fix dired-switches-in-mode-line defcustom tags.
Stefan Kangas [Sun, 28 Feb 2021 18:25:17 +0000 (19:25 +0100)]
Convert ibuffer menus to easymenu
* lisp/ibuffer.el (ibuffer-mode-map): Move menu from here...
(ibuffer-mode-mark-menu, ibuffer-mode-view-menu): ...to here.
Convert to easymenu.
(ibuffer-mode--groups-menu-definition): New function. Fix bug where
"Kill filter by group named" and "Yank last killed filter group
before" was overwritten and never shown in the menu.
(ibuffer-mode-groups-popup): Convert to easymenu.
(ibuffer-mode-operate-menu): Rename from 'ibuffer-mode-operate-map'
and update uses. Convert to easymenu.
(ibuffer-mode-operate-map): Make into obsolete alias for above
renamed variable.
Michael Albinus [Sun, 28 Feb 2021 17:23:27 +0000 (18:23 +0100)]
Add `completion-predicate' to some Tramp commands
* lisp/net/tramp-cmds.el (tramp-cleanup-this-connection)
(tramp-rename-these-files): Add property `completion-predicate'.
* lisp/net/tramp.el (tramp-command-completion-p): New defun.
Kapuze Martin [Sun, 28 Feb 2021 14:21:53 +0000 (15:21 +0100)]
Enable Python type hints and non-trivial base classes in wisent
* admin/grammars/python.wy: Enable understanding Python type hints
and non-trivial base classes (bug#46817).
Copyright-paperwork-exempt: yes
Lars Ingebrigtsen [Sun, 28 Feb 2021 14:08:21 +0000 (15:08 +0100)]
Adjust cmuscheme.el menu bar after previous scheme.el change
* lisp/cmuscheme.el (map): Adjust the keymap lookup after recent
scheme.el change (bug#46820).
Mattias Engdegård [Sun, 28 Feb 2021 12:06:24 +0000 (13:06 +0100)]
Fix pcase 'rx' pattern match-data bug
The pcase 'rx' pattern would in some cases allow the match data to be
clobbered before it is read. For example:
(pcase "PQR"
((and (rx (let a nonl)) (rx ?z)) (list 'one a))
((rx (let b ?Q)) (list 'two b)))
The above returned (two "P") instead of the correct (two "Q").
This occurred because the calls to string-match and match-string were
presented as separate patterns to pcase, which would interleave them
with other patterns.
As a remedy, combine string matching and match-data extraction into a
single pcase pattern. This introduces a slight inefficiency for two
or more submatches as they are grouped into a list structure which
then has to be destructured.
Found by Stefan Monnier. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg02010.html
* lisp/emacs-lisp/rx.el (rx--reduce-right): New helper.
(rx [pcase macro]): Combine string-match and match-string calls into a
single pcase pattern.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
Stefan Monnier [Sun, 28 Feb 2021 01:30:21 +0000 (20:30 -0500)]
* lisp/international/mule-cmds.el: Try and fix bug#46818
(update-leim-list-file): Reduce stack/pdl use.
Stefan Monnier [Sun, 28 Feb 2021 01:22:58 +0000 (20:22 -0500)]
* lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)
(macroexp--expand-all): Use `pcase--dontcare` so pcase generates
slightly better code. Don't hardcode which functions takes function
arguments; rely on a new `funarg-positions` symbol property instead.
Stefan Kangas [Sun, 28 Feb 2021 00:51:31 +0000 (01:51 +0100)]
Convert text-mode menu to easymenu
* lisp/textmodes/text-mode.el (text-mode-map): Move menu
definition from here...
(text-mode-menu): ...to here, and convert to easymenu.
Stefan Kangas [Sat, 27 Feb 2021 23:13:24 +0000 (00:13 +0100)]
; Make function missed in previous change obsolete
* lisp/play/handwrite.el (menu-bar-handwrite-map): Make unused
function obsolete.
Stefan Kangas [Sat, 27 Feb 2021 22:34:33 +0000 (23:34 +0100)]
Convert isearch menu to easymenu
* lisp/isearch.el (isearch-menu-bar-yank-map)
(isearch-menu-bar-map, isearch-mode-map): Move menu definition
from here...
(isearch-menu-bar-map): ...to here, and convert to easymenu.
* lisp/loadup.el ("emacs-lisp/easymenu"): Move before isearch.el.
Stefan Kangas [Sat, 27 Feb 2021 22:26:59 +0000 (23:26 +0100)]
Checkdoc fixes in isearch.el
* lisp/isearch.el (isearch--set-state, isearch-yank-pop-only)
(isearch-search-and-update, isearch-complete-edit, isearch-search):
Minor doc fixes.
Juri Linkov [Sat, 27 Feb 2021 20:09:33 +0000 (22:09 +0200)]
* lisp/tab-bar.el: Support displaying global-mode-string in the tab bar.
* lisp/tab-bar.el (tab-bar--define-keys): Update global-mode-string
in mode-line-misc-info with condition to disable global-mode-string
in the mode line.
(tab-bar-format): New variable.
(tab-bar-format-history, tab-bar-format-add-tab)
(tab-bar-format-tabs): New functions with body from
'tab-bar-make-keymap-1'.
(tab-bar-format-align-right, tab-bar-format-global): New functions for
'tab-bar-format' list.
(tab-bar-format-list): New utility function.
(tab-bar-make-keymap-1): Just call 'tab-bar-format-list'.
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01210.html
Juri Linkov [Sat, 27 Feb 2021 20:00:51 +0000 (22:00 +0200)]
* lisp/subr.el (read-char-choice-with-read-key): New function.
* lisp/subr.el (read-char-choice): Move most of the function body to
'read-char-choice-with-read-key'.
(read-char-choice-with-read-key): New function with body from
'read-char-choice'.
Stefan Kangas [Sat, 27 Feb 2021 19:22:43 +0000 (20:22 +0100)]
; Fix mistake in easymenu conversion
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Use :style and
:selected instead of :button.
Stefan Kangas [Sat, 27 Feb 2021 19:17:03 +0000 (20:17 +0100)]
Convert Buffer-menu-mode menu to easymenu
* lisp/buff-menu.el (Buffer-menu-mode-map): Move menu
definition from here...
(Buffer-menu-mode-menu): ...to here, and convert to easymenu.
Stefan Kangas [Sat, 27 Feb 2021 17:43:20 +0000 (18:43 +0100)]
Minor fixes after preloading easymenu
* lisp/cedet/ede/dired.el:
* lisp/dired-x.el:
* lisp/filesets.el:
* lisp/follow.el:
* lisp/gnus/gnus-registry.el:
* lisp/net/eudc.el:
* lisp/printing.el:
* lisp/recentf.el:
* lisp/speedbar.el: Remove redundant require of easymenu; it is now
preloaded.
* lisp/org/org.el:
* lisp/progmodes/antlr-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/reftex.el: Don't require easymenu in Emacs 28 or
later.
* etc/NEWS: Announce that 'easymenu' is now preloaded.
Glenn Morris [Sat, 27 Feb 2021 18:02:24 +0000 (10:02 -0800)]
Fix doc/misc Makefile for out-of-tree with relative path
* doc/misc/Makefile.in (org_template): Fix for relative srcdir.
Glenn Morris [Sat, 27 Feb 2021 17:31:29 +0000 (09:31 -0800)]
Improve Makefile treatment of org sources in doc/misc
* doc/misc/Makefile.in (ORG_SETUP): New variable.
(ORG_SRC): Use wildcard rather than hard-coding.
(org_template): Adjust for input containing $srcdir and suffix.
(org_setup_template): New template.
Stefan Monnier [Sat, 27 Feb 2021 17:28:17 +0000 (12:28 -0500)]
* lisp/emacs-lisp/bytecomp.el: Fix minor regression introduced by pdump
After `rm **/*.elc; make` we'd sometimes get loads and loads of unnecessary
"Reloading ...".
(byte-compile-refresh-preloaded): Don't reload files that are more
recent than `temacs` but older than the `.pdmp` file.
Stefan Kangas [Sat, 27 Feb 2021 17:22:59 +0000 (18:22 +0100)]
Don't require overlay; that's only needed in XEmacs
* lisp/allout.el:
* lisp/net/eudc.el:
* lisp/org/org.el: Don't require overlay; that's only needed in
XEmacs.
Stefan Monnier [Sat, 27 Feb 2021 17:21:02 +0000 (12:21 -0500)]
* lisp/emacs-lisp/cconv.el: Fix uncaught brain farts in last change
(cconv--convert-funcbody, cconv-convert): Use `macroexp--warn-wrap` properly.
Lars Ingebrigtsen [Sat, 27 Feb 2021 14:58:19 +0000 (15:58 +0100)]
Add sexp navigation commands to elisp-mode
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Add some
navigation commands (bug#24774).
Stefan Kangas [Sat, 27 Feb 2021 14:15:29 +0000 (15:15 +0100)]
Convert emacs-lisp-mode menu to easy-menu-define
* lisp/loadup.el: Preload easymenu.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-map): Convert menu to
use easy-menu-define (bug#24774).
Matt Armstrong [Tue, 23 Feb 2021 00:40:05 +0000 (16:40 -0800)]
Remove unecessary unlock-buffer calls
* lisp/files.el (revert-buffer-insert-file-contents--default-function):
Remove vestigial call to `unlock-buffer'.
* lisp/simple.el (primitive-undo): Assume unlock-buffer is always
bound. (Bug#46701)
Lars Ingebrigtsen [Sat, 27 Feb 2021 05:02:17 +0000 (06:02 +0100)]
Compute grep defaults earlier
* lisp/progmodes/grep.el (grep): Always compute the defaults
(bug#46801).
(grep-highlight-matches): Clarify that it's not just used
interactively.
Lars Ingebrigtsen [Sat, 27 Feb 2021 04:43:06 +0000 (05:43 +0100)]
Change defcustom types of two non-standard hooks
* lisp/erc/erc.el (erc-before-connect, erc-after-connect): Change
type from 'hook to 'function (bug#34657).
F. Jason Park [Sat, 27 Feb 2021 04:35:40 +0000 (05:35 +0100)]
Accept string argument in erc-add-to-input-ring
* lisp/erc/erc-ring.el: (erc-add-to-input-ring)
(erc-previous-command): Use existing API to grab input.
* test/lisp/erc/erc-tests.el: (erc-ring-previous-command)
See (bug#46339).
Lars Ingebrigtsen [Sat, 27 Feb 2021 04:23:45 +0000 (05:23 +0100)]
Add generated .texi files to .gitignore
Glenn Morris [Sat, 27 Feb 2021 03:32:38 +0000 (19:32 -0800)]
Fixes for doc/misc org source files
* doc/misc/org-setup.org: Fix "version" file lookup. Add copyright.
* doc/misc/modus-themes.org: Fix up doclicense include.
* doc/misc/org.org: Remove non-working and unused "modification-time".
Fix up doclicense include. Adjust setupfile inclusion.
Glenn Morris [Sat, 27 Feb 2021 03:28:43 +0000 (19:28 -0800)]
Distribute the real source for some doc/misc manuals (bug#45143)
* doc/misc/modus-themes.texi, doc/misc/org.texi:
Remove generated files from repository.
* doc/misc/Makefile.in: Add rules for building .texi from .org.
(ORG_SRC, abs_top_builddir, EMACS, emacs):
New variables.
(org_template): New template.
(orgclean): New phony target.
* Makefile.in (info): Depend on lisp.
* lisp/org/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
New function.
* doc/misc/org.org, doc/misc/org-setup.org: New files.
Import from https://code.orgmode.org
d8e8a97a14.
Protesilaos Stavrou [Sat, 27 Feb 2021 03:27:57 +0000 (19:27 -0800)]
Import org source file for modus-themes manual
* doc/misc/modus-themes.org: New file.
Import from https://gitlab.com/protesilaos/modus-themes
515180ac.
Stefan Kangas [Sat, 27 Feb 2021 02:23:39 +0000 (03:23 +0100)]
Use lexical-binding in progmodes/icon.el
* lisp/progmodes/icon.el: Use lexical-binding.
(electric-icon-brace): Very minor cleanup.
Stefan Kangas [Sat, 27 Feb 2021 02:14:04 +0000 (03:14 +0100)]
Convert change-log-mode menu to easy-menu-define
* lisp/vc/add-log.el (change-log-mode-map): Move menu from here...
(change-log-mode-menu): ...to here; convert to easy-menu-define.
Stefan Monnier [Sat, 27 Feb 2021 01:24:52 +0000 (20:24 -0500)]
* lisp/emacs-lisp/cconv.el: Improve line-nb info of unused var warnings
Instead of warning about unused vars during the analysis phase of
closure conversion, do it in the actual closure conversion by
annotating the code with "unused" warnings, so that the warnings
get emitted later by the bytecomp phase, like all other warnings,
at which point the line-number info is a bit less imprecise.
Take advantage of this change to wrap the expressions of unused
let-bound vars inside (ignore ...) so the byte-compiler can better
optimize them away.
Finally, promote `macroexp--warn-and-return` to "official" status
by removing its "--" marker.
(cconv-captured+mutated, cconv-lambda-candidates): Remove vars.
(cconv-var-classification): New var to replace them.
(cconv-warnings-only): Delete function.
(cconv--warn-unused-msg, cconv--var-classification): New functions.
(cconv--convert-funcbody): Add warnings for unused args.
(cconv-convert): Add warnings for unused vars in `let` and `condition-case`.
(cconv--analyze-use): Don't emit an "unused var" warning any more,
but instead remember the fact in `cconv-var-classification`.
* lisp/emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings):
Remove variable.
(byte-compile-preprocess): Remove corresponding case.
* lisp/emacs-lisp/pcase.el (pcase--if): Don't throw away `test` effects.
(\`):
* lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Use `car-safe` instead
of `car`, so it can more easily be removed by the optimizer if the
result is not used.
* lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap): New function.
(macroexp-warn-and-return): Rename from `macroexp--warn-and-return`.
Stefan Monnier [Fri, 26 Feb 2021 21:51:15 +0000 (16:51 -0500)]
lisp/vc/*.el: Use lexical-bindings in all the files
Also remove some redundant `:group` arguments.
* lisp/vc/vc.el (vc-ignore): Autoload.
* lisp/vc/pcvs-util.el (cvs-every, cvs-union, cvs-map): Delete functions.
* lisp/vc/cvs-status.el: Require `cl-lib` at runtime.
(cvs-tree-tags-insert): Use `cl-mapcar` and `cl-every` instead.
* lisp/vc/pcvs.el: Require `cl-lib` at runtime.
(cvs-do-removal): Use `cl-every` instead.
* lisp/vc/ediff-init.el: Require `ediff-util` (for `ediff-cleanup-mess`
and `ediff-default-suspend-function`).
* lisp/vc/pcvs-info.el (cvs-fileinfo<): Remove unused vars `subtypea`
and `subtypeb`.
* lisp/vc/vc-git.el:
* lisp/vc/vc-bzr.el: Require `vc-dispatcher` at runtime for
`vc-do-async-command`.
Stefan Monnier [Fri, 26 Feb 2021 20:34:30 +0000 (15:34 -0500)]
* lisp/cedet/semantic/idle.el: Fix compilation warning
(eldoc-last-message): Remove var declaration.
(eldoc-message): Remove function declaration.
(semantic--eldoc-info): Rename from semantic-idle-summary-idle-function.
Make it usable on `eldoc-documentation-functions`.
(semantic-idle-summary-mode): Use `eldoc-mode`.
(semantic-idle-summary-refresh-echo-area): Delete function.
Stefan Monnier [Fri, 26 Feb 2021 20:19:31 +0000 (15:19 -0500)]
* lisp/cedet/semantic/analyze*.el: Use lexical-binding
* lisp/cedet/semantic/analyze.el: Use lexical-binding.
Rename the dynbound var `prefixtypes` to `semantic--prefixtypes`.
(semantic--prefixtypes): Declare var.
* lisp/cedet/semantic/analyze/complete.el: Use lexical-binding.
(semantic--prefixtypes): Declare var.
(semantic-analyze-possible-completions-default): Remove unused var `any`.
Rename `prefixtypes` to `semantic--prefixtypes`.
* lisp/cedet/semantic/analyze/debug.el: Use lexical-binding.
(semantic-analyzer-debug-global-symbol): Remove no-op use of `prefixtypes`.
* lisp/cedet/semantic/analyze/refs.el:
* lisp/cedet/semantic/analyze/fcn.el: Use lexical-binding.
Michael Albinus [Fri, 26 Feb 2021 17:37:14 +0000 (18:37 +0100)]
Fix Tramp manual
* doc/misc/tramp.texi (External methods): Mention "about-args".
(Remote shell setup): Use sshx.
Stefan Kangas [Fri, 26 Feb 2021 16:09:57 +0000 (17:09 +0100)]
; * test/lisp/progmodes/f90-tests.el: Remove stale comment.
Stefan Kangas [Fri, 26 Feb 2021 16:05:18 +0000 (17:05 +0100)]
* lisp/progmodes/dcl-mode.el: Minor doc fixes.
Stefan Kangas [Fri, 26 Feb 2021 15:23:45 +0000 (16:23 +0100)]
Convert some more progmode menus to easy-menu-define
* lisp/progmodes/dcl-mode.el (dcl-mode-map):
* lisp/progmodes/icon.el (icon-mode-map):
* lisp/progmodes/scheme.el (scheme-mode-map):
Move menu definitions from here...
* lisp/progmodes/dcl-mode.el (dcl-mode-menu):
* lisp/progmodes/icon.el (icon-mode-menu)
* lisp/progmodes/scheme.el (scheme-mode-menu):
...to here, and use easy-menu-define.
* lisp/progmodes/icon.el
(icon-mode-map, icon-mode-syntax-table): Simplify.
Stefan Kangas [Fri, 26 Feb 2021 15:09:14 +0000 (16:09 +0100)]
Convert simula-mode menu to easy-menu-define
* lisp/progmodes/simula.el (simula-mode-map): Move menu definition
from here...
(simula-mode-menu): ...to here, and use easy-menu-define.
(simula-popup-menu): Declare unused function obsolete.
Stefan Kangas [Fri, 26 Feb 2021 14:59:56 +0000 (15:59 +0100)]
Fix syntax highlighting of easy-menu-define docstrings
* lisp/emacs-lisp/easymenu.el (easy-menu-define): Add doc-string
declaration for correct syntax highlighting.
Stefan Kangas [Fri, 26 Feb 2021 14:50:41 +0000 (15:50 +0100)]
Remove redundant requires of easymenu
* lisp/allout.el:
* lisp/emacs-lisp/edebug.el:
* lisp/emacs-lisp/ert.el:
* lisp/erc/erc-menu.el:
* lisp/help-mode.el:
* lisp/net/dictionary.el:
* lisp/nxml/rng-nxml.el:
* lisp/progmodes/ebrowse.el:
* lisp/progmodes/meta-mode.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ps-mode.el:
* lisp/progmodes/vera-mode.el:
* lisp/wid-browse.el: Remove redundant require of easymenu. We only
use the autoloaded macro 'easy-menu-define' here.
Stefan Kangas [Fri, 26 Feb 2021 04:43:53 +0000 (05:43 +0100)]
Remove check for missing easymenu from cperl-mode.el
* lisp/progmodes/cperl-mode.el (cperl-menu): Don't wrap definition
in condition-case; easymenu always exists in Emacs.
(easymenu): Remove redundant require.
Basil L. Contovounesios [Sat, 20 Feb 2021 18:55:12 +0000 (18:55 +0000)]
Function-quote completion property of declare form
For discussion, see the following thread:
https://lists.gnu.org/r/emacs-devel/2021-02/msg01666.html
* lisp/emacs-lisp/byte-run.el (byte-run--set-completion): Quote with
'function' for syntactical consistency with other declare form
properties. This allows writing (declare (completion foo)) instead
of (declare (completion 'foo)).
* lisp/emacs-lisp/easymenu.el (easy-menu-do-define):
* lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Prefer
function-put over put for function symbols.
* lisp/subr.el (ignore, undefined): Remove #'-quoting from declare
form; it is no longer needed.
Mattias Engdegård [Fri, 26 Feb 2021 08:52:16 +0000 (09:52 +0100)]
Fix pcase rx pattern bugs
Two unrelated bugs: A missing type check caused an error in rx
patterns for non-string match targets, and rx patterns did not work at
all in pcase-let or pcase-let*.
Second bug reported by Basil Contovounesios and Ag Ibragimov; fixes
proposed by Stefan Monnier. Discussion and explanation in thread at
https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg01924.html
* lisp/emacs-lisp/rx.el (rx): Add (pred stringp) to avoid type errors,
and replace the `pred` clause for the actual match with something that
works with pcase-let(*) without being optimised away.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
Eli Zaretskii [Thu, 25 Feb 2021 18:58:44 +0000 (20:58 +0200)]
Fix documentation of a recent change
* src/fns.c (Fyes_or_no_p): Don't use braces around one-line
block.
(syms_of_fns) <use-short-answers>: Improve the wording of the doc
string.
* etc/NEWS: Improve wording of the entry about 'use-short-answers'.
Juri Linkov [Thu, 25 Feb 2021 18:45:40 +0000 (20:45 +0200)]
New variable 'use-short-answers' to use 'y-or-n-p' instead of 'yes-or-no-p'
* lisp/cus-start.el: Add use-short-answers.
* lisp/emacs-lisp/map-ynp.el (read-answer): Handle use-short-answers.
(read-answer-short): Add use-short-answers to docstring.
* src/fns.c (Fyes_or_no_p): Call y-or-n-p if use_short_answers is true.
(syms_of_fns): Add DEFVAR_BOOL use-short-answers (bug#46594).
Alan Third [Wed, 24 Feb 2021 09:52:42 +0000 (09:52 +0000)]
Fix freeze on older macOS's (bug#46687)
* src/nsterm.m ([EmacsView windowDidChangeBackingProperties:]):
([EmacsView viewWillDraw]): Only run this code when actually drawing
to an offscreen bitmap.
Robert Pluim [Thu, 25 Feb 2021 15:39:34 +0000 (16:39 +0100)]
Re-enable network-stream-tests.el :nowait t tests
After the fix for Bug#46709, these no longer fail in the absence of a
working Internet connection
* test/lisp/net/network-stream-tests.el (internet-is-working): Remove
defvar, it's no longer needed in this file.
* test/lisp/net/network-stream-tests.el
(connect-to-tls-ipv4-nowait):
(connect-to-tls-ipv6-nowait):
(open-network-stream-tls-nowait):
(open-gnutls-stream-new-api-nowait):
(open-gnutls-stream-old-api-nowait): Remove check for internet-is-working.
Robert Pluim [Thu, 25 Feb 2021 15:36:56 +0000 (16:36 +0100)]
Don't crash if gnutls_handshake fails
In some situations involving Internet access not being fully
functional, gnutls_handshake returns a fatal error, which we were
ignoring, causing us to call gnutls_handshake again. Now we check for
the error and return it to the caller.
* src/gnutls.c (gnutls_try_handshake): Return immediately if
gnutls_handshake returns a fatal error (Bug#46709).
Robert Pluim [Thu, 25 Feb 2021 15:33:47 +0000 (16:33 +0100)]
* Specify 'ipv4 when testing ipv4 in network-stream-tests.el
* test/lisp/net/network-stream-tests.el
(connect-to-tls-ipv4-nowait): Specify :family 'ipv4.
Robert Pluim [Tue, 23 Feb 2021 14:21:26 +0000 (15:21 +0100)]
; * src/xfaces.c (realize_gui_face): Correct formatting
* src/xfaces.c (realize_gui_face): Correct code formatting.
Stefan Kangas [Thu, 25 Feb 2021 11:54:58 +0000 (12:54 +0100)]
Convert epa-key-list-mode menu to easy-menu-define
* lisp/epa.el (epa-key-list-mode-map): Move menu from here...
(epa-key-list-mode-menu): ...to here, and convert to easy-menu-define.
Stefan Monnier [Thu, 25 Feb 2021 04:08:47 +0000 (23:08 -0500)]
Remove last remaining external uses of `edebug-form-spec`
* lisp/emacs-lisp/gv.el (gv-place): Use `def-edebug-elem-spec`.
* lisp/obsolete/erc-compat.el (erc-define-minor-mode): Remove redundant
`edebug-form-spec`.
Stefan Monnier [Wed, 24 Feb 2021 23:39:06 +0000 (18:39 -0500)]
* test/lisp/emacs-lisp/macroexp-tests.el (macroexp--tests-file-name): Add case
Add use of `macroexp-file-name` from a macro called from within
a function, which works thanks to eager-macroexpansion (so the macro
is expanded which the file is being loaded rather than only later
when the function is called).
* test/lisp/emacs-lisp/macroexp-resources/m1.el
(macroexp--m1-tests-file-name): New function.
Stefan Monnier [Wed, 24 Feb 2021 23:12:18 +0000 (18:12 -0500)]
* test/lisp/emacs-lisp/macroexp-tests.el (macroexp--tests-file-name): New test
* test/lisp/emacs-lisp/macroexp-resources/m1.el:
* test/lisp/emacs-lisp/macroexp-resources/m2.el: New files.
Lars Ingebrigtsen [Wed, 24 Feb 2021 22:55:05 +0000 (23:55 +0100)]
Include a "make check-maybe" in the admin/emake script