]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years ago* lisp/progmodes/flymake.el (flymake-log): Simplify
Stefan Monnier [Sat, 6 Mar 2021 14:55:30 +0000 (09:55 -0500)]
* lisp/progmodes/flymake.el (flymake-log): Simplify

3 years agoRevert "Fix Makefile subshell output when run in parallel"
Eli Zaretskii [Sat, 6 Mar 2021 14:49:00 +0000 (16:49 +0200)]
Revert "Fix Makefile subshell output when run in parallel"

This reverts commit 117505454ce04c0c0ce2c2b4058823cf764fc2eb.
It breaks the build for versions of GNU Make that don't support -O.

3 years agoFix Makefile subshell output when run in parallel
Basil L. Contovounesios [Sat, 6 Mar 2021 11:40:48 +0000 (11:40 +0000)]
Fix Makefile subshell output when run in parallel

For discussion, see the following thread:
https://lists.gnu.org/r/emacs-devel/2021-03/msg00255.html

* Makefile.in (texi_misc): Avoid interspersing parallel Make output
with that from subshell.

3 years agoPacify some semantic-tag-make-plist warnings
Basil L. Contovounesios [Sat, 6 Mar 2021 13:13:40 +0000 (13:13 +0000)]
Pacify some semantic-tag-make-plist warnings

* lisp/cedet/semantic/tag.el (semantic-tag-make-plist): Define
before its first use to pacify some recent "may not be defined at
runtime" warnings after turning on lexical-binding.

3 years agoRemove mention of using defun- and defvar- as prefixes
Lars Ingebrigtsen [Sat, 6 Mar 2021 12:27:34 +0000 (13:27 +0100)]
Remove mention of using defun- and defvar- as prefixes

* doc/lispref/tips.texi (Coding Conventions): Remove mention of
using defun- and defvar- as prefixes, as this is something that we
rarely do in Emacs (bug#46899).

3 years ago; Fix last change.
Eli Zaretskii [Sat, 6 Mar 2021 10:16:37 +0000 (12:16 +0200)]
; Fix last change.

3 years agoImprove documentation of Bindat
Eli Zaretskii [Sat, 6 Mar 2021 10:12:44 +0000 (12:12 +0200)]
Improve documentation of Bindat

* doc/lispref/processes.texi (Bindat Types, Bindat Functions)
(Bindat Computed Types): Improve wording and add indexing.

* etc/NEWS: Add a pointer to the ELisp manual for "Bindat".

3 years agoPull Modus themes version 1.2.3 from upstream
Protesilaos Stavrou [Fri, 5 Mar 2021 18:31:08 +0000 (18:31 +0000)]
Pull Modus themes version 1.2.3 from upstream

This syncs with the following upstream revision:

Update to version 1.2.3
0a36239 2021-03-05 19:43:30 +0200
https://gitlab.com/protesilaos/modus-themes/-/commit/0a36239baf908585cdf32c6188eb86713d9bf6c6

For discussion, see bug#45068 and the following upstream issue:
https://gitlab.com/protesilaos/modus-themes/-/issues/162

* doc/misc/modus-themes.org:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-themes.el:
* etc/themes/modus-vivendi-theme.el: Update to version 1.2.3.

3 years agoUpdate Modus themes to their version 1.2.0
Protesilaos Stavrou [Thu, 4 Mar 2021 14:20:15 +0000 (16:20 +0200)]
Update Modus themes to their version 1.2.0

* doc/misc/modus-themes.org: Add new version of the manual, with
changes to markup and references to the latest state of the project.

* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-operandi-theme.el: Provide updated version of each
theme, which expands the contents of 'modus-themes.el' (bug#45068).

* etc/themes/modus-themes.el: Add new supportive file.  This is where
theme data, functions, and face definitions are defined.

3 years agoConditionally use macroexp-file-name in Flymake
Basil L. Contovounesios [Sat, 6 Mar 2021 09:05:49 +0000 (09:05 +0000)]
Conditionally use macroexp-file-name in Flymake

* lisp/progmodes/flymake.el (flymake-log): Reinstate Emacs 26
support by conditionally using macroexp-file-name which is new in
Emacs 28 (bug#46957).

3 years ago* * lisp/cedet/semantic: Use lexical-binding in the generated grammars
Stefan Monnier [Sat, 6 Mar 2021 04:33:21 +0000 (23:33 -0500)]
* * lisp/cedet/semantic: Use lexical-binding in the generated grammars

* admin/grammars/c.by (typesimple): Bind `semantic-c-classname` dynamically.

* lisp/cedet/semantic/bovine.el: Use lexical-binding.
(semantic-lambda): Silence warnings if the `vals` arg is not used.

* lisp/cedet/semantic/grammar-wy.el: Re-generate.

* lisp/cedet/semantic/bovine/grammar.el: Use lexical-binding.
(bovine-grammar-expand-action): Silence warnings if some of the
`vals`, `start`, or `end` args is not used.
(bovine--make-parser-1): Use lexical-binding in the generated files.

* lisp/cedet/semantic/wisent/grammar.el: Use lexical-binding.
(wisent--make-parser-1): Use lexical-binding in the generated files.

3 years ago; Fix typo.
Stefan Kangas [Sat, 6 Mar 2021 03:08:54 +0000 (04:08 +0100)]
; Fix typo.

3 years agoAdd some new tests for keymap.c
Stefan Kangas [Sat, 6 Mar 2021 02:17:23 +0000 (03:17 +0100)]
Add some new tests for keymap.c

* test/src/keymap-tests.el (keymap-define-key/undefined)
(keymap-define-key/keyboard-macro, keymap-define-key/lambda)
(keymap-define-key/keymap, keymap-define-key/menu-item)
(keymap-lookup-key/list-of-keymaps, keymap-lookup-key/too-long):
New tests.
(keymap-lookup-key): Extend test slightly.

3 years ago* lisp/cedet/srecode/*.el: Use lexical-binding
Stefan Monnier [Sat, 6 Mar 2021 02:00:00 +0000 (21:00 -0500)]
* lisp/cedet/srecode/*.el: Use lexical-binding

* lisp/cedet/srecode/compile.el (srecode-compile-inserter):
Use `make-instance` instead of the class name-as-function.

* lisp/cedet/srecode/fields.el (srecode-field-behind-hook):
Remove unused var `field`.

* lisp/cedet/srecode/find.el (srecode-load-tables-for-mode): Simplify.

* lisp/cedet/srecode/getset.el (srecode-semantic-selected-tag): Declare var.

* lisp/cedet/srecode/mode.el (srecode-minor-mode): Mark references to
non-existing `srecode-m3-items` function.

* lisp/cedet/srecode/srt-mode.el (srecode-parse-this-macro): Remove
unused var `raw`.

3 years agoBindat: new macro-expansion based data layout language
Stefan Monnier [Sat, 6 Mar 2021 00:56:31 +0000 (19:56 -0500)]
Bindat: new macro-expansion based data layout language

Thorough redesign of the Bindat system, which makes it possible
to define new Bindat type forms, define recursive types, control
the values returned when unpacking, freely mix arbitrary computations
with type definitions, as well as support for arbitrary sized
integers.

This also reverts the recent addition of the `bindat-spec` macro and
the support for 64bit integers in the old Bindat language since that
is now considered obsolete anyway.

* doc/lispref/processes.texi (Bindat Types): Rename from `Bindat Spec`
and rewrite for the new sublanguage.
(Bindat Functions): Adjust to the new terminology.
(Bindat Computed Types): New node.

* lisp/emacs-lisp/bindat.el (bindat--type): New type.
(bindat--unpack-u64, bindat--unpack-u64r): Delete functions.
(bindat--unpack-item, bindat--pack-item, bindat--fixed-length-alist):
Revert addition of support for 64bit integers.
(bindat--unpack-group, bindat--length-group, bindat--pack-group):
Handle the new `bindat--type` values.
(bindat-spec): Revert addition of this macro.
(bindat--unpack-uint, bindat--unpack-uintr, bindat--pack-uint)
(bindat--pack-uintr): New functions.
(bindat-type, bindat-defmacro, bindat--pcase): New macros.
(bindat-type): New Edebug elem.
(bindat--type): New generic function.
(bindat--primitives): New constant.
(bindat--macroenv, bindat--op): New vars.
(bindat--make-docstring, bindat--fun, bindat--makefun, bindat--toplevel):
New functions.

* test/lisp/emacs-lisp/bindat-tests.el: Use `bindat-type`.
(ip): New Bindat type.
(header-bindat-spec, data-bindat-spec, packet-bindat-spec): Adjust to
new `bindat-type` macro.
(bindat-test-unpack): Simplify now that the order of fields is preserved.
(bindat-test--int-websocket-type, bindat-test--LEB128): New consts.
(bindat-test--pack-val, bindat-test--sint, bindat-test--recursive):
New tests.

3 years agoMake lambda-lifting work again
Mattias Engdegård [Fri, 5 Mar 2021 19:21:01 +0000 (20:21 +0100)]
Make lambda-lifting work again

* lisp/emacs-lisp/cconv.el (cconv--analyze-use): Fix typo.
* test/lisp/emacs-lisp/cconv-tests.el (cconv-convert-lambda-lifted):
Add test case.

3 years agoImprove rcirc-authenticated-hook docstring
Tassilo Horn [Fri, 5 Mar 2021 19:53:18 +0000 (20:53 +0100)]
Improve rcirc-authenticated-hook docstring

* lisp/net/rcirc.el (rcirc-authenticated-hook): Improve docstring.

3 years ago* lisp/emacs-lisp/bindat.el: Minor refactoring
Stefan Monnier [Fri, 5 Mar 2021 18:31:16 +0000 (13:31 -0500)]
* lisp/emacs-lisp/bindat.el: Minor refactoring

(bindat--unpack-str, bindat--unpack-strz, bindat--unpack-bits):
New functions, extracted from `bindat--unpack-item`.
(bindat--unpack-item): Use them.
(bindat--align): New function.
(bindat--unpack-group, bindat--length-group, bindat--pack-group): Use it.
(bindat-get-field): Allow integers to index both lists (as returned by
`repeat`) and vectors (as returned by `vec`).
(bindat--pack-str, bindat--pack-bits): New functions, extracted from
`bindat--pack-item`.
(bindat--pack-item): Use them.

* test/lisp/emacs-lisp/bindat-tests.el (struct-bindat): Place the fields
in the order in which they appear in the structs.

3 years ago* src/fns.c (Frandom): Handle bignum `limit`s
Stefan Monnier [Fri, 5 Mar 2021 17:09:50 +0000 (12:09 -0500)]
* src/fns.c (Frandom): Handle bignum `limit`s

(ccall2, get_random_bignum): New functions.

3 years agoDeclare some completion predicates
Michael Albinus [Fri, 5 Mar 2021 16:51:22 +0000 (17:51 +0100)]
Declare some completion predicates

* lisp/filenotify.el (file-notify-handle-event):
* lisp/net/dbus.el (dbus-handle-event): Declare `completion-predicate'.

3 years ago* doc/misc/tramp.texi (Remote shell setup): Fix reference.
Masahiro Nakamura [Fri, 5 Mar 2021 16:46:53 +0000 (17:46 +0100)]
* doc/misc/tramp.texi (Remote shell setup): Fix reference.

3 years agoImprove the documentation of :extra in cl-defmethod
Lars Ingebrigtsen [Fri, 5 Mar 2021 13:27:08 +0000 (14:27 +0100)]
Improve the documentation of :extra in cl-defmethod

* doc/lispref/functions.texi (Generic Functions): Improve
documentation of :extra (bug#46917).

* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Ditto.

3 years agoFix qualifiers order for loadhist-unload-element in elp.el
Mauro Aranda [Fri, 5 Mar 2021 13:18:32 +0000 (14:18 +0100)]
Fix qualifiers order for loadhist-unload-element in elp.el

* lisp/emacs-lisp/elp.el (loadhist-unload-element): The :extra
qualifier is expected to come before the other qualifiers, so do
that (bug#46917).

3 years agoRestrict the version guesser to top-level headings
Stephen Berman [Fri, 5 Mar 2021 13:08:17 +0000 (14:08 +0100)]
Restrict the version guesser to top-level headings

* lisp/help-fns.el (help-fns--first-release): Restrict the version
guesser to top-level section -- looking in all headings leads to
false positives (bug#46889).

3 years agoActually fill the correct paragraph in `lisp-fill-paragraph'
Lars Ingebrigtsen [Fri, 5 Mar 2021 13:01:00 +0000 (14:01 +0100)]
Actually fill the correct paragraph in `lisp-fill-paragraph'

* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Fix previous
change here by actually filling the correct paragraph (bug#28937).

3 years agoDon't override load-path in require-theme
Basil L. Contovounesios [Fri, 5 Mar 2021 11:02:20 +0000 (11:02 +0000)]
Don't override load-path in require-theme

* lisp/custom.el (require-theme): Open-code 'require' error, because
binding load-path can prevent other libraries from loading on error,
such as debug.el, which gives a misleading error.  (Bug#45068)

3 years agoDon't ignore lexically-bound variables in a defvar (bug#46912)
Pip Cet [Thu, 4 Mar 2021 21:06:13 +0000 (21:06 +0000)]
Don't ignore lexically-bound variables in a defvar (bug#46912)

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Walk
the value form of a defvar.

3 years ago* Makefile.in: Ensure non-info forms of doc/misc have an Emacs binary.
Glenn Morris [Fri, 5 Mar 2021 04:04:50 +0000 (20:04 -0800)]
* Makefile.in: Ensure non-info forms of doc/misc have an Emacs binary.

3 years ago* lisp/emacs-lisp/cl-generic.el: Make `doc-string` prop work with qualifiers
Stefan Monnier [Thu, 4 Mar 2021 23:20:56 +0000 (18:20 -0500)]
* lisp/emacs-lisp/cl-generic.el: Make `doc-string` prop work with qualifiers

(cl--defmethod-doc-pos): New function.
(cl-defmethod): Use it.

3 years agoAdd a command in package mode for opening home pages directly
Lars Ingebrigtsen [Thu, 4 Mar 2021 20:39:40 +0000 (21:39 +0100)]
Add a command in package mode for opening home pages directly

* doc/emacs/package.texi (Package Menu): Document it.
* lisp/emacs-lisp/package.el (package-browse-url): New command and
keystroke (bug#46927).

3 years agoMake checkdoc work with qualified methods
Mauro Aranda [Thu, 4 Mar 2021 11:34:58 +0000 (08:34 -0300)]
Make checkdoc work with qualified methods

* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Handle
cl-defmethod in a case of its own.  Check for the presence of
qualifiers, and skip them accordingly until the docstring.

* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-cl-defmethod-qualified-ok)
(checkdoc-cl-defmethod-with-extra-qualifier-ok)
(checkdoc-cl-defmethod-with-extra-and-nil-args-ok): Add tests for the fix.

3 years agoAdd "of" as a keyword in js-mode
Lars Ingebrigtsen [Thu, 4 Mar 2021 20:21:21 +0000 (21:21 +0100)]
Add "of" as a keyword in js-mode

* lisp/progmodes/js.el (js--keyword-re): Add the "of" of "for
... of" in ECMAScript 2018 (bug#46924).

3 years agoCall the set_buffer_overlays_ setters
Matt Armstrong [Thu, 4 Mar 2021 20:12:00 +0000 (21:12 +0100)]
Call the set_buffer_overlays_ setters

* src/buffer.c (Fkill_buffer): Call set_buffer_overlays_before and
set_buffer_overlays_after instead of setting the fields directly
(bug#46914).

3 years agoGenerate info/dir directly from any org sources
Glenn Morris [Thu, 4 Mar 2021 18:47:09 +0000 (10:47 -0800)]
Generate info/dir directly from any org sources

* Makefile.in (texi_misc): New variable.
(srcdir_doc_info_dir_inputs): Use texi_misc.
(${srcdir}/info/dir): No longer depend on info-real.

3 years ago* doc/misc/Makefile.in (echo-sources): New phony target.
Glenn Morris [Thu, 4 Mar 2021 18:44:07 +0000 (10:44 -0800)]
* doc/misc/Makefile.in (echo-sources): New phony target.

3 years ago* build-aux/make-info-dir: Handle .org input files.
Glenn Morris [Thu, 4 Mar 2021 18:43:25 +0000 (10:43 -0800)]
* build-aux/make-info-dir: Handle .org input files.

3 years ago; Makefile.in: Update a comment.
Glenn Morris [Thu, 4 Mar 2021 18:41:00 +0000 (10:41 -0800)]
; Makefile.in: Update a comment.

3 years agoDecouple require-theme from load-theme
Basil L. Contovounesios [Tue, 2 Mar 2021 14:35:50 +0000 (14:35 +0000)]
Decouple require-theme from load-theme

* lisp/custom.el (require-theme): Refashion after 'require', as a
function for loading only named features.  Do not call
load-theme (bug#45068).
* etc/NEWS: Update its announcement accordingly.
* doc/lispref/customize.texi (Custom Themes): Document it.

* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-vivendi-theme.el: Remove redundant calls to
'provide'.

* test/lisp/custom-tests.el (custom-tests--with-temp-dir): New
macro.
(custom-theme--load-path): Use it.
(custom-tests-require-theme): New test.

3 years ago; Pacify warnings in last newsticker change.
Basil L. Contovounesios [Thu, 4 Mar 2021 15:34:19 +0000 (15:34 +0000)]
; Pacify warnings in last newsticker change.

3 years ago; * etc/NEWS: Fix wording of a recently added entry.
Eli Zaretskii [Thu, 4 Mar 2021 13:21:52 +0000 (15:21 +0200)]
; * etc/NEWS: Fix wording of a recently added entry.

3 years agoRemove copy-pasto from image-dired.el
Mauro Aranda [Thu, 4 Mar 2021 13:16:02 +0000 (10:16 -0300)]
Remove copy-pasto from image-dired.el

* lisp/image-dired.el (image-dired-dired-edit-comment-and-tags):
Remove reference to widget-example-repeat.

3 years agoRemove duplicated tests in checkdoc-tests.el
Mauro Aranda [Thu, 4 Mar 2021 13:13:26 +0000 (10:13 -0300)]
Remove duplicated tests in checkdoc-tests.el

* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-cl-defmethod-ok)
(checkdoc-cl-defmethod-with-types-ok, checkdoc-cl-defun-with-key-ok)
(checkdoc-cl-defun-with-allow-other-keys-ok)
(checkdoc-cl-defun-with-default-optional-value-ok)
(checkdoc-cl-defun-with-destructuring-ok): This tests were duplicated,
so keep one copy of them.  Checked by diffing two files with the
suspected tests, and supported by the fact that running occur with the
regexp "^(ert-deftest" reported 14 matches, while the tests being run
were 8.

3 years agoMake radio checkboxes work in eww
Lars Ingebrigtsen [Thu, 4 Mar 2021 11:11:08 +0000 (12:11 +0100)]
Make radio checkboxes work in eww

* lisp/net/eww.el (eww-toggle-checkbox): Actually update the
:checked values in the form.

3 years agoFix a doc/misc clean rule
Glenn Morris [Thu, 4 Mar 2021 03:58:47 +0000 (19:58 -0800)]
Fix a doc/misc clean rule

* doc/misc/Makefile.in (TEXI_FROM_ORG): New variable.
(orgclean): Fix rule.

3 years agoFix pcase dontcare pattern in cl--sm-macroexpand
Basil L. Contovounesios [Wed, 3 Mar 2021 12:49:31 +0000 (12:49 +0000)]
Fix pcase dontcare pattern in cl--sm-macroexpand

For discussion, see the following thread:
https://lists.gnu.org/r/emacs-devel/2021-03/msg00119.html

* lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix recently
uncovered use of old name for pcase--dontcare.

3 years ago* lisp/emacs-lisp/pcase.el (pcase-defmacro): Fix `pcase-tests-macro`
Stefan Monnier [Wed, 3 Mar 2021 23:40:03 +0000 (18:40 -0500)]
* lisp/emacs-lisp/pcase.el (pcase-defmacro): Fix `pcase-tests-macro`

* lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Simplify accordingly.

3 years agoPreserve group structure on opml import and export.
Ulf Jasper [Wed, 3 Mar 2021 20:10:34 +0000 (21:10 +0100)]
Preserve group structure on opml import and export.

* lisp/net/newst-backend.el (newsticker--raw-url-list-defaults),
  (newsticker-url-list-defaults),
  (newsticker--get-news-by-url),
  (newsticker--sentinel-work),
  (newsticker--parse-atom-0.3),
  (newsticker--decode-rfc822-date),
  (newsticker--image-download-by-wget),
  (newsticker--image-save),
  (newsticker--image-download-by-url),
  (newsticker--cache-save),
  (newsticker--stat-num-items): Fix indentation.
  (newsticker-opml-export): Preserve group structure on export.
  (newsticker--opml-insert-elt),
  (newsticker--opml-insert-group),
  (newsticker--opml-insert-feed): New.
  (newsticker--opml-import-outlines):
  (newsticker-opml-import): Preserve group structure on import. (Fixes
  fourth issue in Bug#41376.)

3 years agoNew mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings
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.

3 years agoMake inversion.el obsolete (Bug#46841)
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.

3 years agoC++ Mode: Handle "if constexpr (...)" with a simple statement correctly
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.

3 years ago* lisp/emacs-lisp/pcase.el (pcase--u1): Fix typo
Stefan Monnier [Tue, 2 Mar 2021 20:57:45 +0000 (15:57 -0500)]
* lisp/emacs-lisp/pcase.el (pcase--u1): Fix typo

3 years agoCC Mode: Fix analysis of brace lists, particularly in C++ Mode
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.

3 years ago* lisp/tab-bar.el: Minor stylistic fixes.
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.

3 years ago* lisp/emacs-lisp/trace.el (trace-values): Work outside of traced function
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

3 years ago(ruby-find-library-file): Also recognize 'gem' statements
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.

3 years agoCompile closures that modify their bound vars correctly (Bug#46834)
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.

3 years agoImprove the dired-do-kill-lines doc string
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).

3 years ago* lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patterns
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.

3 years agoFix previous completion-pcm--optimize-pattern fix
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.

3 years agoFix warning in completion-pcm--optimize-pattern
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.

3 years agoMake easymenu downcase the menu symbol for greater backwards compat
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.

3 years ago* lisp/emacs-lisp/pcase.el: Fix bug#46786
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.

3 years agoFix multiple Calc defmath errors (bug#46750)
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.

3 years agoRemove references to old bignums from Calc manual
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.

3 years ago* lisp/calc/calc-ext.el (math-equal-int): Work for bignums.
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.

3 years ago* lisp/isearch.el: Minor doc fix.
Juri Linkov [Mon, 1 Mar 2021 19:58:00 +0000 (21:58 +0200)]
* lisp/isearch.el: Minor doc fix.

3 years ago* lisp/tab-bar.el (tab-bar--define-keys): Add check for tab-bar-format-global.
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.

3 years agoAdd 'require-theme' function
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'.

3 years agoFix woman.el menu alteration code
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.

3 years agoCC Mode: Amend C-M-a/e to handle lambda function in C++ arglist
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.

3 years ago* lisp/emacs-lisp/pcase.el (pcase--split-pred): Re-fix bug#14773
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`.

3 years agoFix misuses of `byte-compile-macro-environment`
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.

3 years ago* src/eval.c (init_eval_once): Bump max_specpdl_size (bug46818)
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.

3 years ago; Auto-commit of loaddefs files.
Glenn Morris [Mon, 1 Mar 2021 14:27:02 +0000 (06:27 -0800)]
; Auto-commit of loaddefs files.

3 years agoClean up obsolete comment
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.

3 years agoFix Bootstring skew parameter in puny.el
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).

3 years agoConvert various menus to easymenu
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.

3 years agoImprove admin.el's Makefile in standalone manual tarfiles
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.

3 years agoinfo/dir needs generated texi files to exist
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.

3 years agoMake generation of texi from org overwrite output
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.

3 years ago* doc/misc/modus-themes.org: Add copying markup. (Bug#45141)
Glenn Morris [Sun, 28 Feb 2021 22:27:28 +0000 (14:27 -0800)]
* doc/misc/modus-themes.org: Add copying markup.  (Bug#45141)

3 years agoUpdate admins make-manuals for new output variable
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.

3 years agoConvert dired menus to easymenu
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.

3 years agoConvert hi-lock-menu 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.

3 years agoCombine and reconcile two conflicting entries in NEWS on goto-line-history
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.

3 years agoDeclare more string predicates as pure
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.

3 years ago; Fix process-lines-handling-status docstring.
Basil L. Contovounesios [Sun, 28 Feb 2021 16:29:05 +0000 (16:29 +0000)]
; Fix process-lines-handling-status docstring.

3 years ago; Fix dired-switches-in-mode-line defcustom tags.
Basil L. Contovounesios [Sun, 28 Feb 2021 15:44:34 +0000 (15:44 +0000)]
; Fix dired-switches-in-mode-line defcustom tags.

3 years agoConvert ibuffer menus to easymenu
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.

3 years agoAdd `completion-predicate' to some Tramp commands
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.

3 years agoEnable Python type hints and non-trivial base classes in wisent
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

3 years agoAdjust cmuscheme.el menu bar after previous scheme.el change
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).

3 years agoFix pcase 'rx' pattern match-data bug
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.

3 years ago* lisp/international/mule-cmds.el: Try and fix bug#46818
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.

3 years ago* lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)
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.

3 years agoConvert text-mode menu to easymenu
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.

3 years ago; Make function missed in previous change obsolete
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.

3 years agoConvert isearch menu to easymenu
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.

3 years agoCheckdoc fixes in 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.

3 years ago* lisp/tab-bar.el: Support displaying global-mode-string in the tab bar.
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