1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

146035 Commits

Author SHA1 Message Date
Lars Ingebrigtsen
e5392d38ac 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.
2021-03-01 22:12:43 +01:00
Stefan Monnier
0d827c7f52 * lisp/emacs-lisp/pcase.el: Fix bug#46786
Revert commit a218c98615, 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.
2021-03-01 15:35:51 -05:00
Mattias Engdegård
08b11a02f4 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.
2021-03-01 20:59:52 +01:00
Mattias Engdegård
5f319423c8 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.
2021-03-01 20:59:52 +01:00
Mattias Engdegård
ce7e78a2c0 * lisp/calc/calc-ext.el (math-equal-int): Work for bignums. 2021-03-01 20:59:52 +01:00
Juri Linkov
e6a4ef48fd * lisp/isearch.el: Minor doc fix. 2021-03-01 21:58:43 +02:00
Juri Linkov
6268c9ba6e * lisp/tab-bar.el (tab-bar--define-keys): Add check for tab-bar-format-global. 2021-03-01 21:58:43 +02:00
Protesilaos Stavrou
59e1867a1f 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'.
2021-03-01 19:50:02 +00:00
Lars Ingebrigtsen
ece8c1307a Fix woman.el menu alteration code
* lisp/woman.el (woman-dired-define-keys): Fix naming of menu
after dired menu changes.
2021-03-01 20:48:20 +01:00
Alan Mackenzie
4d35faa1db 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.
2021-03-01 19:23:01 +00:00
Stefan Monnier
d56b1f9e7c * lisp/emacs-lisp/pcase.el (pcase--split-pred): Re-fix bug#14773
Adjust to calling convention of `macroexp--fgrep`.
2021-03-01 14:07:05 -05:00
Stefan Monnier
a0f60293d9 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.
2021-03-01 12:18:49 -05:00
Stefan Monnier
6ad9b8d677 * 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.
2021-03-01 11:42:04 -05:00
Glenn Morris
5c26ea4cbc ; Auto-commit of loaddefs files. 2021-03-01 06:27:02 -08:00
Glenn Morris
8c93becb35 ; Auto-commit of loaddefs files. 2021-03-01 06:13:59 -08:00
Matt Armstrong
70514c6374 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.
2021-03-01 14:26:21 +01:00
F. Jason Park
eb2a1e1d6c 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).
2021-03-01 14:05:36 +01:00
Stefan Kangas
5684f7995d 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.
2021-03-01 04:38:38 +01:00
Glenn Morris
8bdaac3457 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.
2021-02-28 18:07:04 -08:00
Glenn Morris
4825ea3c5d info/dir needs generated texi files to exist
* Makefile.in (misc-info): Depend on lisp.
(${srcdir}/info/dir): Depend on info-real.
(info): Simplify.
2021-02-28 15:22:29 -08:00
Glenn Morris
18e1455c8a 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.
2021-02-28 15:13:07 -08:00
Glenn Morris
63026d8af3 * doc/misc/modus-themes.org: Add copying markup. (Bug#45141) 2021-02-28 14:28:34 -08:00
Glenn Morris
19df5e7869 Update admins make-manuals for new output variable
* admin/admin.el (make-manuals-dist-output-variables):
Add abs_top_builddir.
2021-02-28 14:28:34 -08:00
Stefan Kangas
150d06644e 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.
2021-02-28 23:23:41 +01:00
Stefan Kangas
c8f19a4af6 Convert hi-lock-menu to easymenu
* lisp/hi-lock.el (hi-lock-menu): Convert to easymenu.
2021-02-28 22:21:55 +01:00
Alan Mackenzie
56a8559076 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.
2021-02-28 21:15:34 +00:00
Mattias Engdegård
f8ab343eb9 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.
2021-02-28 20:18:43 +01:00
Basil L. Contovounesios
a286e02580 ; Fix process-lines-handling-status docstring. 2021-02-28 19:00:27 +00:00
Basil L. Contovounesios
797f0ba218 ; Fix dired-switches-in-mode-line defcustom tags. 2021-02-28 19:00:27 +00:00
Stefan Kangas
c537b6384f 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.
2021-02-28 19:26:06 +01:00
Michael Albinus
0fd206badc 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.
2021-02-28 18:23:27 +01:00
Kapuze Martin
277a254a42 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
2021-02-28 18:09:15 +01:00
Lars Ingebrigtsen
0510040754 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).
2021-02-28 18:09:15 +01:00
Mattias Engdegård
bdea1883cc 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.
2021-02-28 13:06:24 +01:00
Stefan Monnier
aad8ffafa8 * lisp/international/mule-cmds.el: Try and fix bug#46818
(update-leim-list-file): Reduce stack/pdl use.
2021-02-27 20:30:21 -05:00
Stefan Monnier
ff09851a1f * 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.
2021-02-27 20:23:15 -05:00
Stefan Kangas
9eff23573d 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.
2021-02-28 01:51:31 +01:00
Stefan Kangas
9a110cb0d9 ; Make function missed in previous change obsolete
* lisp/play/handwrite.el (menu-bar-handwrite-map): Make unused
function obsolete.
2021-02-28 00:13:24 +01:00
Stefan Kangas
697aaafca3 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.
2021-02-28 00:07:32 +01:00
Stefan Kangas
46c501e762 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.
2021-02-28 00:07:32 +01:00
Juri Linkov
3b3b16ea17 * 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
2021-02-27 22:09:33 +02:00
Juri Linkov
53f6218cdc * 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'.
2021-02-27 22:00:51 +02:00
Stefan Kangas
3a77021353 ; Fix mistake in easymenu conversion
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Use :style and
:selected instead of :button.
2021-02-27 20:22:43 +01:00
Stefan Kangas
0f91948372 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.
2021-02-27 20:17:03 +01:00
Stefan Kangas
b34d39170b 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.
2021-02-27 20:04:41 +01:00
Glenn Morris
a4d7235f1a Fix doc/misc Makefile for out-of-tree with relative path
* doc/misc/Makefile.in (org_template): Fix for relative srcdir.
2021-02-27 10:02:24 -08:00
Glenn Morris
27da93862f 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.
2021-02-27 09:40:26 -08:00
Stefan Monnier
082b431e62 * 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.
2021-02-27 12:28:17 -05:00
Stefan Kangas
2c639a35a6 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.
2021-02-27 18:23:12 +01:00
Stefan Monnier
a5ad6747c9 * lisp/emacs-lisp/cconv.el: Fix uncaught brain farts in last change
(cconv--convert-funcbody, cconv-convert): Use `macroexp--warn-wrap` properly.
2021-02-27 12:21:02 -05:00