]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoPresent C source files as absolute file names too when possible
Dmitry Gutov [Wed, 17 Feb 2021 23:41:03 +0000 (01:41 +0200)]
Present C source files as absolute file names too when possible

* lisp/progmodes/elisp-mode.el (xref-location-group):
Present C source files as absolute file names too when possible
(bug#46514).

3 years ago; Fix another recent typo in simple.el.
Basil L. Contovounesios [Wed, 17 Feb 2021 23:08:24 +0000 (23:08 +0000)]
; Fix another recent typo in simple.el.

3 years agoFix recent Command Modes changes in Elisp manual
Basil L. Contovounesios [Wed, 17 Feb 2021 22:49:15 +0000 (22:49 +0000)]
Fix recent Command Modes changes in Elisp manual

* doc/lispref/commands.texi (Command Modes): Fix typos and grammar.
Cross-reference the 'declare' form node.

3 years ago; Fix typo in last change to simple.el.
Basil L. Contovounesios [Wed, 17 Feb 2021 22:48:18 +0000 (22:48 +0000)]
; Fix typo in last change to simple.el.

3 years agodoc/lispref/commands.texi (Command Modes): Fix typo.
Matt Armstrong [Wed, 17 Feb 2021 22:33:21 +0000 (23:33 +0100)]
doc/lispref/commands.texi (Command Modes): Fix typo.

* doc/lispref/commands.texi (Command Modes): Fix typo.

3 years agoMake goto-line-history buffer local only when so customized
Alan Mackenzie [Wed, 17 Feb 2021 21:15:51 +0000 (21:15 +0000)]
Make goto-line-history buffer local only when so customized

* lisp/simple.el (goto-line-history-local): New customizable option.
(goto-line-history): Define this simply with defvar, not defvar-local.
(goto-line-read-args): Handle goto-line-history-local, and changes to it.

* doc/emacs/basic.texi (Moving Point): Add a paragraph about
goto-line-history-local.

* etc/NEWS: Add an item under "Editing Changes in Emacs 28.1".

3 years agoAdjust the edebug spec for `interactive'
Lars Ingebrigtsen [Wed, 17 Feb 2021 19:59:44 +0000 (20:59 +0100)]
Adjust the edebug spec for `interactive'

* lisp/emacs-lisp/edebug.el: Adjust the edebug spec for
`interactive' for the new syntax.

3 years agoMake unused `Buffer-menu-sort' alias obsolete
Lars Ingebrigtsen [Wed, 17 Feb 2021 19:14:22 +0000 (20:14 +0100)]
Make unused `Buffer-menu-sort' alias obsolete

* lisp/buff-menu.el (Buffer-menu-sort): Make unused alias obsolete.
* test/lisp/progmodes/elisp-mode-tests.el
(find-defs-defalias-defun-el): Adjust test to use an alias that's
not obsolete.

3 years agoMark up commands in buff-menu.el for modes
Lars Ingebrigtsen [Wed, 17 Feb 2021 18:54:09 +0000 (19:54 +0100)]
Mark up commands in buff-menu.el for modes

3 years ago; * admin/CPP-DEFINES: Remove unused defines.
Glenn Morris [Wed, 17 Feb 2021 19:08:27 +0000 (11:08 -0800)]
; * admin/CPP-DEFINES: Remove unused defines.

3 years agoExplicate on how to tag commands with modes
Lars Ingebrigtsen [Wed, 17 Feb 2021 18:25:08 +0000 (19:25 +0100)]
Explicate on how to tag commands with modes

* doc/lispref/commands.texi (Command Modes): New node.
(Using Interactive): Move the `modes' text to the new node.

3 years agoNew transient mode 'repeat-mode' to allow shorter key sequences (bug#46515)
Juri Linkov [Wed, 17 Feb 2021 18:04:42 +0000 (20:04 +0200)]
New transient mode 'repeat-mode' to allow shorter key sequences (bug#46515)

* doc/emacs/basic.texi (Repeating): Document repeat-mode.

* lisp/repeat.el (repeat-exit-key): New defcustom.
(repeat-mode): New global minor mode.
(repeat-post-hook): New function.

* lisp/bindings.el (undo-repeat-map): New variable.
(undo): Put 'repeat-map' property with
'undo-repeat-map'.
(next-error-repeat-map): New variable.
(next-error, previous-error): Put 'repeat-map' property with
'next-error-repeat-map'.

* lisp/window.el (other-window-repeat-map): New variable.
(other-window): Put 'repeat-map' property with
'other-window-repeat-map'.
(resize-window-repeat-map): New variable.
(enlarge-window, enlarge-window-horizontally)
(shrink-window-horizontally, shrink-window): Put 'repeat-map'
property with 'resize-window-repeat-map'.

3 years agoNew command 'tab-duplicate' like in web browsers
Juri Linkov [Wed, 17 Feb 2021 17:56:45 +0000 (19:56 +0200)]
New command 'tab-duplicate' like in web browsers

3 years agoFurther Tramp code cleanup
Michael Albinus [Wed, 17 Feb 2021 17:04:35 +0000 (18:04 +0100)]
Further Tramp code cleanup

* doc/misc/tramp.texi (Predefined connection information):
Mention "about-args".

* lisp/net/tramp-cmds.el (tramp-version): Adapt docstring.

* lisp/net/tramp.el (tramp-handle-expand-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name):
* lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name)
* lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name):
Handle local "/..".

* lisp/net/tramp-rclone.el (tramp-methods) <rclone>:
Adapt `tramp-mount-args'.
(tramp-rclone-flush-directory-cache): Remove.
(tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file)
(tramp-rclone-handle-make-directory): Don't use that function.
(tramp-rclone-maybe-open-connection): Fix use of `tramp-mount-args'.

* lisp/net/trampver.el (tramp-inside-emacs): New defun.
* lisp/net/tramp.el (tramp-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
(tramp-sh-handle-process-file, tramp-open-shell): Use it.
(tramp-get-env-with-u-option): Remove.

* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-top):
New test.

3 years ago; Fix last m-x.texi change.
Eli Zaretskii [Wed, 17 Feb 2021 16:59:01 +0000 (18:59 +0200)]
; Fix last m-x.texi change.

3 years ago; Fix last change in commands.texi.
Eli Zaretskii [Wed, 17 Feb 2021 16:57:42 +0000 (18:57 +0200)]
; Fix last change in commands.texi.

3 years agoDisable filtering of commands in M-x completion
Eli Zaretskii [Wed, 17 Feb 2021 16:53:54 +0000 (18:53 +0200)]
Disable filtering of commands in M-x completion

This makes the default behavior like it was before:
M-x completion doesn't filter out any commands.  To
have commands filtered based on their relevance to the
current buffer's modes, customize the option
'read-extended-command-predicate' to call
'command-completion-default-include-p'.
* doc/lispref/commands.texi (Interactive Call):
* doc/emacs/m-x.texi (M-x): Update the description of
'read-extended-command-predicate' and improve wording.

* etc/NEWS: Update the entry about
'read-extended-command-predicate'.

* lisp/simple.el (read-extended-command-predicate): Change default
value to nil.  Update doc string.  Add :group.
(read-extended-command): Handle nil as meaning to apply
no-filtering.

3 years agoFix recently introduced bug in `byte-compile-lambda'
Lars Ingebrigtsen [Wed, 17 Feb 2021 16:12:27 +0000 (17:12 +0100)]
Fix recently introduced bug in `byte-compile-lambda'

* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Fix recently
introduced error when compiling non-lexical commands (bug#46589).

3 years ago; Finish recent rename of completion-* predicates.
Basil L. Contovounesios [Wed, 17 Feb 2021 13:27:56 +0000 (13:27 +0000)]
; Finish recent rename of completion-* predicates.

3 years agoClarify 'read-extended-command-predicate' in NEWS
Lars Ingebrigtsen [Wed, 17 Feb 2021 11:15:07 +0000 (12:15 +0100)]
Clarify 'read-extended-command-predicate' in NEWS

3 years agoChange name for the completion-* predicates
Lars Ingebrigtsen [Wed, 17 Feb 2021 11:01:27 +0000 (12:01 +0100)]
Change name for the completion-* predicates

* lisp/simple.el (command-completion-default-include-p)
(command-completion-with-modes-p, command-completion-button-p):
Rename from completion-*.
(read-extended-command-predicate): Adjust default predicate.

* lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Adjust
predicate name.

3 years ago* configure.ac: Replace obsolete AC_CHECK_HEADER usage. (Bug#46578)
Glenn Morris [Wed, 17 Feb 2021 05:25:18 +0000 (21:25 -0800)]
* configure.ac: Replace obsolete AC_CHECK_HEADER usage.  (Bug#46578)

3 years ago* configure.ac: Replace obsolete AC_TRY_LINK with AC_LINK_IFELSE.
Glenn Morris [Wed, 17 Feb 2021 04:54:46 +0000 (20:54 -0800)]
* configure.ac: Replace obsolete AC_TRY_LINK with AC_LINK_IFELSE.

3 years agoRemove TIME_WITH_SYS_TIME, unused for a long time
Glenn Morris [Wed, 17 Feb 2021 04:34:26 +0000 (20:34 -0800)]
Remove TIME_WITH_SYS_TIME, unused for a long time

* configure.ac (AC_HEADER_TIME): Remove.  (Bug#46578)

3 years agocperl-mode: Improve detection of index entries for imenu
Harald Jörg [Tue, 16 Feb 2021 23:54:38 +0000 (00:54 +0100)]
cperl-mode: Improve detection of index entries for imenu

* lisp/progmodes/cperl-mode.el
(cperl-imenu-addback): Customization variable deleted.  This
variable has been declared obsolete in 1998.
(cperl--basic-identifier-regexp) and many other variables:
defining regular expressions for basic Perl constructs.
(cperl-imenu--create-perl-index): This function has been
completely rewritten, keeping only some parts of the output
formatting.  It now recognizes a lot more package and
subroutine declarations which came since Perl 5.14: Packages
with a version and/or a block attached, lexical subroutines,
declarations with a newline between the keyword "package" and
the package name, and several more.  This version also
correctly separates subroutine names from attributes, does no
longer support "unnamed" packages (which don't exist in Perl),
and doesn't fall for false positives like stuff that looks
like a declaration in a multiline string.
(cperl-tags-hier-init): Eliminate call to
`cperl-imenu-addback` (which actually was commented out in
1997)

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test--validate-regexp) and six other new tests for the
new regular expressions and the index creation.

* test/lisp/progmodes/cperl-mode-resources/grammar.pl: New
file showcasing different syntax variations for package and
sub declarations (bug#46574).

3 years agoDon't move point in `exif-parse-buffer'
Lars Ingebrigtsen [Tue, 16 Feb 2021 23:43:52 +0000 (00:43 +0100)]
Don't move point in `exif-parse-buffer'

* lisp/image/exif.el (exif-parse-buffer): Don't move point
(bug#46552).

3 years agoFix edebug spec for minibuffer-with-setup-hook
Lars Ingebrigtsen [Tue, 16 Feb 2021 22:32:04 +0000 (23:32 +0100)]
Fix edebug spec for minibuffer-with-setup-hook

* lisp/files.el (minibuffer-with-setup-hook): Instrument the
:append form for edebug (bug#46531).

3 years agoClarify Gnus Agent expiry quirks
Lars Ingebrigtsen [Tue, 16 Feb 2021 22:06:46 +0000 (23:06 +0100)]
Clarify Gnus Agent expiry quirks

* doc/misc/gnus.texi (Agent Expiry): Mention that the last article
won't be expired (bug#46533).

3 years agothumbs.el: avoid creating thumbs directory on loading library
Glenn Morris [Tue, 16 Feb 2021 20:11:55 +0000 (12:11 -0800)]
thumbs.el: avoid creating thumbs directory on loading library

* lisp/thumbs.el (thumbs-cleanup-thumbsdir):
Don't create the thumbs directory if it does not exist.

3 years ago* admin/cus-test.el (cus-test-load-libs): Quieten loading.
Glenn Morris [Tue, 16 Feb 2021 20:03:39 +0000 (12:03 -0800)]
* admin/cus-test.el (cus-test-load-libs): Quieten loading.

3 years ago* admin/cus-test.el (cus-test-get-lisp-files): Ignore loaddefs files.
Glenn Morris [Tue, 16 Feb 2021 20:01:25 +0000 (12:01 -0800)]
* admin/cus-test.el (cus-test-get-lisp-files): Ignore loaddefs files.

3 years ago* lisp/tab-bar.el: Fix behavior of toggle-frame-tab-bar (bug #46299)
Bastian Beranek [Tue, 16 Feb 2021 10:35:35 +0000 (11:35 +0100)]
* lisp/tab-bar.el: Fix behavior of toggle-frame-tab-bar (bug #46299)

(toggle-frame-tab-bar): Add frame parameter to protect tab bar state.
(tab-bar--update-tab-bar-lines): Check parameter.

3 years agoPacify unused function warning in xfns.c with GTK2
Basil L. Contovounesios [Sun, 14 Feb 2021 16:58:06 +0000 (16:58 +0000)]
Pacify unused function warning in xfns.c with GTK2

* src/xfns.c (x_get_net_workarea, x_get_monitor_for_frame)
(x_make_monitor_attribute_list, x_get_monitor_attributes_fallback):
[HAVE_XINERAMA] (x_get_monitor_attributes_xinerama)
[HAVE_XRANDR] (x_get_monitor_attributes_xrandr)
(x_get_monitor_attributes): Fix #ifdefs around definitions to avoid
unused function warnings regardless of GTK use (bug#46509).
[HAVE_XRANDR] (x_get_monitor_attributes_xrandr): Undefine
RANDR13_LIBRARY after it's been used.

3 years agoRevert "Fix problem of point movement in image-mode"
Lars Ingebrigtsen [Tue, 16 Feb 2021 16:42:24 +0000 (17:42 +0100)]
Revert "Fix problem of point movement in image-mode"

This reverts commit 7c7377288a125ef47f2b422cf131f044a3b418e1.

This is fixed differently in Emacs 27.

3 years agoFix problem of point movement in image-mode
Lars Ingebrigtsen [Tue, 16 Feb 2021 16:39:03 +0000 (17:39 +0100)]
Fix problem of point movement in image-mode

* lisp/image-mode.el (image-mode): Switch disable-point-adjustment
on, otherwise `C-c C-c' will move point around oddly.
(image-toggle-display): Ensure that point is on the image (bug#46552).

3 years agoDo interactive mode tagging for info.el
Lars Ingebrigtsen [Tue, 16 Feb 2021 13:21:52 +0000 (14:21 +0100)]
Do interactive mode tagging for info.el

3 years agoDon't resize images in image-mode if we have a rotation
Lars Ingebrigtsen [Tue, 16 Feb 2021 13:00:55 +0000 (14:00 +0100)]
Don't resize images in image-mode if we have a rotation

* lisp/image-mode.el (image-fit-to-window): Don't resize of we
have a manually rotated imaged (and explain the resizing logic a
bit).

3 years agomake smerge-vc-next-conflict wrap around
Konstantin Kharlamov [Tue, 16 Feb 2021 11:49:30 +0000 (12:49 +0100)]
make smerge-vc-next-conflict wrap around

* lisp/vc/smerge-mode.el:
(smerge-vc-next-conflict): While searching for conflict markers,
wrap search around if current file is the last one with conflicts
(bug#46538).

3 years agoDo `interactive' mode tagging in gomoku.el
Stefan Kangas [Tue, 16 Feb 2021 09:05:03 +0000 (10:05 +0100)]
Do `interactive' mode tagging in gomoku.el

* lisp/play/gomoku.el: Do `interactive' mode tagging.

3 years ago* lisp/play/gomoku.el: Minor doc fixes; formatting.
Stefan Kangas [Tue, 16 Feb 2021 08:56:17 +0000 (09:56 +0100)]
* lisp/play/gomoku.el: Minor doc fixes; formatting.

3 years ago* lisp/emacs-lisp/bindat.el: Add 64bit int support
Stefan Monnier [Tue, 16 Feb 2021 04:54:45 +0000 (23:54 -0500)]
* lisp/emacs-lisp/bindat.el: Add 64bit int support

(bindat--unpack-u64, bindat--unpack-u64r, bindat--pack-u64)
(bindat--pack-u64r): New functions.
(bindat--unpack-item, bindat--pack-item): Use them.
(bindat--fixed-length-alist): Add new types.

3 years agoFix admin/check-doc-strings for new DEFUN format
Stefan Kangas [Tue, 16 Feb 2021 04:26:24 +0000 (05:26 +0100)]
Fix admin/check-doc-strings for new DEFUN format

* admin/check-doc-strings: Various fixes, including for the new DEFUN
format.  The script still produces a ton of false positives, however.

3 years ago* lisp/emacs-lisp/bindat.el: Clarify when field labels are optional
Stefan Monnier [Tue, 16 Feb 2021 04:22:09 +0000 (23:22 -0500)]
* lisp/emacs-lisp/bindat.el: Clarify when field labels are optional

The fixes the doc and the Edebug spec, as well as a subtle issue in
the code where a field whose name is (eval 'fill) was mistakenly
considered as an anonymous field of type `fill`.

(bindat--unpack-item, bindat--unpack-group, bindat--length-group)
(bindat--pack-item, bindat--pack-group): Use dotimes, dolist, and pcase.
(bindat--item-aux): New edebug elem.
(bindat-item): Use it to fix the handling of optional fields.
(bindat-format-vector): Use `mapconcat`.

3 years ago* lisp/emacs-lisp/bindat.el (bindat-spec): New macro.
Stefan Monnier [Tue, 16 Feb 2021 02:25:15 +0000 (21:25 -0500)]
* lisp/emacs-lisp/bindat.el (bindat-spec): New macro.

It's basically an alias for `quote`, but it offers the advantage of
providing Edebug support and opens the possibility of compiling
the bindat spec to ELisp code.

* doc/lispref/processes.texi (Bindat Spec): Document `bindat-spec`.
(Bindat Functions): Tweak a few things to adjust to the state of the code.

* test/lisp/emacs-lisp/bindat-tests.el: Use it.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests--read): New function.
(edebug-tests--&rest-behavior): New test.

3 years ago; Fix last change in simple.el.
Basil L. Contovounesios [Mon, 15 Feb 2021 21:50:38 +0000 (21:50 +0000)]
; Fix last change in simple.el.

3 years ago* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodies
Stefan Monnier [Mon, 15 Feb 2021 17:07:52 +0000 (12:07 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodies

3 years agoDisplay yearly ical events from first year on. Fix Bug#23100.
Ulf Jasper [Mon, 15 Feb 2021 16:27:45 +0000 (17:27 +0100)]
Display yearly ical events from first year on.  Fix Bug#23100.

Convert yearly rrule starting in year x into diary-anniversary entry
for year x-1 when importing an icalendar.  Correspondingly convert
diary-anniversary for year x into yearly rrule starting in year x+1.

*
test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american:
*
test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european:
*
test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso:
*
test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american:
*
test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european:
*
test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso:
*
test/lisp/calendar/icalendar-tests.el (icalendar-convert-anniversary-to-ical):
Match new diary-anniversary/yearly-rrule behaviour.

* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate): Add
year-shift option.  (icalendar--convert-anniversary-to-ical): Shift
the year as diary-anniversary is not displayed in the initial year.
(icalendar--convert-recurring-to-diary): Shift the year as
diary-anniversary is not displayed in the initial year. (Bug#23100)

3 years ago* lisp/calc/calc-sel.el (calc-replace-sub-formula): Fix typo
Stefan Monnier [Mon, 15 Feb 2021 15:57:26 +0000 (10:57 -0500)]
* lisp/calc/calc-sel.el (calc-replace-sub-formula): Fix typo

Reported by Sébastien Miquel <sebastien.miquel@posteo.eu>

3 years ago* lisp/emacs-lisp/bindat.el: Expose the `struct` variable (bug#46534)
Stefan Monnier [Mon, 15 Feb 2021 15:50:07 +0000 (10:50 -0500)]
* lisp/emacs-lisp/bindat.el: Expose the `struct` variable (bug#46534)

(bindat--unpack-group, bindat--length-group, bindat--pack-group):
Mark it as dynamically scoped.

3 years agoAllow overriding declared predicates, too
Lars Ingebrigtsen [Mon, 15 Feb 2021 13:43:53 +0000 (14:43 +0100)]
Allow overriding declared predicates, too

* lisp/simple.el (completion-default-include-p): Rename and move
the checking for an explicit predicate down here...
(read-extended-command): ... from here.
(read-extended-command-predicate): Adjust default value.

3 years agoDo `interactive' mode tagging in the remaining lisp/gnus files
Lars Ingebrigtsen [Mon, 15 Feb 2021 12:43:27 +0000 (13:43 +0100)]
Do `interactive' mode tagging in the remaining lisp/gnus files

3 years agoAdd a new variable `global-minor-modes'
Lars Ingebrigtsen [Mon, 15 Feb 2021 12:08:15 +0000 (13:08 +0100)]
Add a new variable `global-minor-modes'

* doc/lispref/modes.texi (Minor Modes): Document it.
* lisp/simple.el (global-minor-modes): New variable.
(completion-in-mode-p): Use it.
(completion-with-modes-p): Use it.

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Support it.

3 years agoRename minor-modes to local-minor-modes
Lars Ingebrigtsen [Mon, 15 Feb 2021 11:44:57 +0000 (12:44 +0100)]
Rename minor-modes to local-minor-modes

* doc/lispref/modes.texi (Minor Modes): Update documentation.
* lisp/simple.el (completion-with-modes-p): Change usage.

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Change usage.

* src/buffer.c: Rename from minor_modes to local_minor_modes
throughout.
(syms_of_buffer): Rename minor-modes to local-minor-modes.

* src/buffer.h (struct buffer): Rename minor_modes_.

* src/pdumper.c (dump_buffer): Update hash and usage.

3 years ago* lisp/emacs-lisp/edebug.el (edebug-&optional, edebug-&rest): Remove vars
Stefan Monnier [Mon, 15 Feb 2021 04:56:42 +0000 (23:56 -0500)]
* lisp/emacs-lisp/edebug.el (edebug-&optional, edebug-&rest): Remove vars

According to my tests, `edebug-&optional` never has any effect.
And `edebug-&rest` can be replaced with a closure.

(edebug-&rest-wrapper): Remove function.
(edebug--match-&-spec-op): Use a closure to remember the `specs`.

3 years ago* lisp/emacs-lisp/byte-run.el (compiler-macro): Make it Edebuggable
Stefan Monnier [Mon, 15 Feb 2021 03:56:08 +0000 (22:56 -0500)]
* lisp/emacs-lisp/byte-run.el (compiler-macro): Make it Edebuggable

* lisp/emacs-lisp/gv.el (gc-expander, gv-setter): Reuse the spec of
`compiler-macro`.

3 years agoMake the button completion predicate be more useful
Lars Ingebrigtsen [Mon, 15 Feb 2021 03:42:32 +0000 (04:42 +0100)]
Make the button completion predicate be more useful

* lisp/simple.el (completion-button-p): Rework from
`completion-at-point-p'.

* lisp/net/shr.el (shr-show-alt-text): It should be possible to
complete to commands that aren't bound to a key.

3 years agoSpeed up completion-in-mode-p in the common case
Lars Ingebrigtsen [Mon, 15 Feb 2021 03:22:29 +0000 (04:22 +0100)]
Speed up completion-in-mode-p in the common case

* lisp/simple.el (completion-in-mode-p): Make predicate more
efficient in the common one-mode case.

3 years agoFix two syntax errors in Specification List
Lars Ingebrigtsen [Mon, 15 Feb 2021 02:44:15 +0000 (03:44 +0100)]
Fix two syntax errors in Specification List

* doc/lispref/edebug.texi (Specification List): Add a couple of
missing @s.

3 years ago* Edebug: Generalize `&lookup`, use it for `cl-macrolet` and `cl-generic`
Stefan Monnier [Mon, 15 Feb 2021 02:13:35 +0000 (21:13 -0500)]
* Edebug: Generalize `&lookup`, use it for `cl-macrolet` and `cl-generic`

This allows the use of (declare (debug ...)) in the lexical macros
defined with `cl-macrolet`.  It also fixes the names used by Edebug
for the methods of `cl-generic` so it doesn't need to use gensym
and so they don't include the formal arg names any more.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op):
Rename from `edebug--handle-&-spec-op`.
(edebug--match-&-spec-op <&interpose>): Rename from `&lookup` and
generalize so it can let-bind dynamic variables around the rest of the parse.
(edebug-lexical-macro-ctx): Rename from `edebug--cl-macrolet-defs` and
make it into an alist.
(edebug-list-form-args): Use the specs from `edebug-lexical-macro-ctx`
when available.
(edebug--current-cl-macrolet-defs): Delete var.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): Delete functions.
(def-declarations): Use new `&interpose`.
(edebug--match-declare-arg): Rename from `edebug--get-declare-spec` and
adjust to new calling convention.

* lisp/subr.el (def-edebug-elem-spec): Fix docstring.
(eval-after-load): Use `declare`.

* lisp/emacs-lisp/cl-generic.el: Fix Edebug names so we don't need
gensym any more and we only include the specializers but not the formal
arg names.
(cl--generic-edebug-name): New var.
(cl--generic-edebug-remember-name, cl--generic-edebug-make-name): New funs.
(cl-defgeneric, cl-defmethod): Use them.

* lisp/emacs-lisp/cl-macs.el: Add support for `debug` declarations in
`cl-macrolet`.
(cl-declarations-or-string):
Fix use of `lambda-doc` and allow use of `declare`.
(edebug-lexical-macro-ctx): Declare var.
(cl--edebug-macrolet-interposer): New function.
(cl-macrolet): Use it to pass the right `lexical-macro-ctx` to the body.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use new `&interpose`.
(pcase--edebug-match-pat-args): Rename from `pcase--get-edebug-spec` and
adjust to new calling convention.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method):
Adjust to the new names.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier)
(edebug-tests-cl-flet): Adjust to the new names.

* doc/lispref/edebug.texi (Specification List): Document &interpose.

3 years agoAvoid asking repeatedly about reloading bookmarks file
Stefan Kangas [Sun, 14 Feb 2021 23:43:15 +0000 (00:43 +0100)]
Avoid asking repeatedly about reloading bookmarks file

* lisp/bookmark.el (bookmark-maybe-load-default-file): Reload watched
bookmarks file only if its mtime has changed since the last query.
This avoids asking repeatedly about reloading the bookmarks file if
the user has already said "no" to a previous query.
(bookmark--watch-file-already-queried-p): New function.
(bookmark--watch-already-asked-mtime): New variable.

3 years agoMark up bookmark.el for correct modes
Stefan Kangas [Sun, 14 Feb 2021 20:37:23 +0000 (21:37 +0100)]
Mark up bookmark.el for correct modes

* lisp/bookmark.el: Mark up all commands with applicable modes.

3 years agoAdd a comment to `read-extended-command'
Lars Ingebrigtsen [Sun, 14 Feb 2021 21:57:19 +0000 (22:57 +0100)]
Add a comment to `read-extended-command'

* lisp/simple.el (read-extended-command): Add a comment.

3 years ago* src/xdisp.c (move_it_to): Fix last change. (Bug#46316)
Eli Zaretskii [Sun, 14 Feb 2021 20:11:05 +0000 (22:11 +0200)]
* src/xdisp.c (move_it_to): Fix last change.  (Bug#46316)

3 years agoAdd a possible completion predicate for buttons
Lars Ingebrigtsen [Sun, 14 Feb 2021 19:34:03 +0000 (20:34 +0100)]
Add a possible completion predicate for buttons

* lisp/simple.el (completion-at-point-p): New predicate.

* lisp/net/shr.el (shr-show-alt-text): Mark up as a button.

3 years agoMake completion-with-modes-p work with minor modes, too
Lars Ingebrigtsen [Sun, 14 Feb 2021 19:24:23 +0000 (20:24 +0100)]
Make completion-with-modes-p work with minor modes, too

* lisp/simple.el (completion-with-modes-p): Work with minor modes,
too.

3 years agoFix showing and hiding of tab-bar on new frames (bug#46299)
Bastian Beranek [Mon, 8 Feb 2021 17:12:33 +0000 (18:12 +0100)]
Fix showing and hiding of tab-bar on new frames (bug#46299)

* lisp/tab-bar.el (tab-bar--update-tab-bar-lines)
(tab-bar--tab-bar-lines-for-frame):
New functions to update value of tab-bar-lines in frames.
(tab-bar-mode, tab-bar-new-tab-to, tab-bar-close-tab)
(tab-bar-close-other-tab, tab-bar-show :set):
Use new function.
(tab-bar-select-tab-modifiers :set):
Work around visual glitch.

3 years agoDo command markup in blackbox.el
Lars Ingebrigtsen [Sun, 14 Feb 2021 17:14:36 +0000 (18:14 +0100)]
Do command markup in blackbox.el

3 years agoFix byte-run--set-modes call signature
Lars Ingebrigtsen [Sun, 14 Feb 2021 17:01:06 +0000 (18:01 +0100)]
Fix byte-run--set-modes call signature

* lisp/emacs-lisp/byte-run.el (byte-run--set-modes): We take a
list of modes, not a single one (and fix the quoting).

3 years agoFix missing ' in NEWS
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:57:05 +0000 (16:57 +0100)]
Fix missing ' in NEWS

3 years agoAlso mention `M-o M-o' removal
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:55:37 +0000 (16:55 +0100)]
Also mention `M-o M-o' removal

* lisp/loadup.el (facemenu-keymap-restore): Also restore `M-o M-o'.

3 years agoDon't update `minor-modes' in global modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:51:14 +0000 (16:51 +0100)]
Don't update `minor-modes' in global modes

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no
point in setting the buffer-local `minor-modes' in global modes.

3 years agoMark up 5x5 for interactive mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 15:18:39 +0000 (16:18 +0100)]
Mark up 5x5 for interactive mode

3 years ago; * doc/lispref/modes.texi: typo fix
Robert Pluim [Sun, 14 Feb 2021 14:05:58 +0000 (15:05 +0100)]
; * doc/lispref/modes.texi: typo fix

3 years agoFix problem with the newly introduces `minor-modes' variable
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:43:24 +0000 (14:43 +0100)]
Fix problem with the newly introduces `minor-modes' variable

* lisp/help-fns.el (describe-mode): Apparently buffer-local
variables take precedence over lexically bound variables?

3 years agoDo `interactive' mode markup in all Gnus files
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:14:48 +0000 (14:14 +0100)]
Do `interactive' mode markup in all Gnus files

3 years agoReally fix the syntax problem in define-minor-mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:13:38 +0000 (14:13 +0100)]
Really fix the syntax problem in define-minor-mode

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.

3 years agoFix previous define-minor-mode change
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:12:08 +0000 (14:12 +0100)]
Fix previous define-minor-mode change

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix
interactive extension in previous change.

3 years agoMark up eww.el for correct modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:08:56 +0000 (14:08 +0100)]
Mark up eww.el for correct modes

* lisp/net/eww.el: Mark up all commands with applicable modes.

3 years agoMake `C-h m' list unbound commands applicable for the mode
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:07:48 +0000 (14:07 +0100)]
Make `C-h m' list unbound commands applicable for the mode

* lisp/help-fns.el (help-fns--list-local-commands): New function.
(describe-mode): Use it.

3 years agoAllow define-minor-mode to take an :interactive keyword
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:06:16 +0000 (14:06 +0100)]
Allow define-minor-mode to take an :interactive keyword

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Allow
specifying the :interactive state and the modes.

3 years agoFix dumping of buffers after minor_modes was added
Lars Ingebrigtsen [Sun, 14 Feb 2021 13:00:51 +0000 (14:00 +0100)]
Fix dumping of buffers after minor_modes was added

* src/pdumper.c (dump_buffer): Set minor_modes to nil before dumping.

3 years agoRevert the bit about command_modes in previous patch set
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:57:59 +0000 (13:57 +0100)]
Revert the bit about command_modes in previous patch set

* src/data.c (Fcommand_modes): Remove the subr bit -- it's not
necessary since it can just use a predicate.
* src/lisp.h (GCALIGNED_STRUCT): Remove command_modes.

* src/lread.c (defsubr): Remove command_modes.

3 years agoAdd 'read-extended-command-predicate'
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:56:53 +0000 (13:56 +0100)]
Add 'read-extended-command-predicate'

* doc/emacs/m-x.texi (M-x): Document it.
* doc/lispref/commands.texi (Interactive Call): Document it further.

* lisp/simple.el (read-extended-command-predicate): New user option.
(read-extended-command-predicate): Use it.
(completion-in-mode-p): New function (the default predicate).

3 years agoMark easy-menu-do-define menus as "not interesting"
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:31:10 +0000 (13:31 +0100)]
Mark easy-menu-do-define menus as "not interesting"

* lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Mark menu
keymaps as "not interesting" when doing completion.

3 years agoAdd new 'declare' forms for command completion predicates
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:29:35 +0000 (13:29 +0100)]
Add new 'declare' forms for command completion predicates

* doc/lispref/functions.texi (Declare Form): Document the new
`completion' and `modes' declarations.
* lisp/simple.el (completion-with-modes-p): New helper functions.

* lisp/emacs-lisp/byte-run.el (byte-run--set-completion)
(byte-run--set-modes):
(defun-declarations-alist): New declarations for `completion' and
`modes'.

3 years agoExtend the syntax of `interactive' to list applicable modes
Lars Ingebrigtsen [Sun, 14 Feb 2021 12:21:24 +0000 (13:21 +0100)]
Extend the syntax of `interactive' to list applicable modes

* doc/lispref/commands.texi (Using Interactive): Document the
extended `interactive' form.
* doc/lispref/loading.texi (Autoload): Document list-of-modes
form.

* lisp/emacs-lisp/autoload.el (make-autoload): Pick the list of
modes from `interactive' out of the functions.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Allow for the
extended `interactive' form.

* src/callint.c (Finteractive): Document the extended form.

* src/data.c (Finteractive_form): Return the interactive form in
the old format (even when there's an extended `interactive') to
avoid having other parts of Emacs be aware of this.
(Fcommand_modes): New defun.

* src/emacs-module.c (GCALIGNED_STRUCT): Allow for modules to
return command modes.

* src/lisp.h: New function module_function_command_modes.

3 years agoFix how `shell-mode' avoids being called interactively
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:52:00 +0000 (12:52 +0100)]
Fix how `shell-mode' avoids being called interactively

* lisp/shell.el (shell-mode): Make noninteractive instead of
erroring out after being called.

3 years agoIntroduce an :interactive keyword for `defined-derived-mode'
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:50:19 +0000 (12:50 +0100)]
Introduce an :interactive keyword for `defined-derived-mode'

* doc/lispref/modes.texi (Derived Modes): Document it.
* lisp/emacs-lisp/derived.el (define-derived-mode): Introduce a
new :interactive keyword.

3 years agoRemove redundant :group args from textmodes/*.el
Stefan Kangas [Sun, 14 Feb 2021 11:54:36 +0000 (12:54 +0100)]
Remove redundant :group args from textmodes/*.el

* lisp/textmodes/enriched.el:
* lisp/textmodes/ispell.el:
* lisp/textmodes/makeinfo.el:
* lisp/textmodes/paragraphs.el:
* lisp/textmodes/picture.el:
* lisp/textmodes/refbib.el:
* lisp/textmodes/refer.el:
* lisp/textmodes/remember.el:
* lisp/textmodes/texinfo.el:
* lisp/textmodes/tildify.el:
* lisp/textmodes/two-column.el: Remove redundant :group args.

3 years agoAdd a new buffer-local variable `minor-modes'
Lars Ingebrigtsen [Sun, 14 Feb 2021 11:37:44 +0000 (12:37 +0100)]
Add a new buffer-local variable `minor-modes'

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep
`minor-modes' updated.
* src/buffer.c (bset_minor_modes, Fmake_indirect_buffer)
(reset_buffer, init_buffer_once): Initialise `minor-modes'.
(syms_of_buffer): Add `minor-modes' as a new permanently-local
variable.

* src/buffer.h (struct buffer): Add minor_modes_.

3 years ago* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.
Stefan Monnier [Sun, 14 Feb 2021 00:24:33 +0000 (19:24 -0500)]
* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.

Removed by accident.

3 years ago* lisp/emacs-lisp/edebug.el: Fix `called-interactively-p`
Stefan Monnier [Sun, 14 Feb 2021 00:22:17 +0000 (19:22 -0500)]
* lisp/emacs-lisp/edebug.el: Fix `called-interactively-p`

And get rid of the old special-case handling of `interactive-p`, which
is now redundant.

(edebug--called-interactively-skip): Fix lexical-binding case,
and adjust to some formerly missed call patterns.
(edebug-def-interactive, edebug-interactive-p): Remove vars.
(edebug-interactive-p-name, edebug-wrap-def-body)
(edebug-make-enter-wrapper): Remove functions.
(edebug-list-form): Don't special-case `interactive-p`.

3 years ago* lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function
Stefan Monnier [Sat, 13 Feb 2021 22:50:31 +0000 (17:50 -0500)]
* lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function

(lambda-expr): Define with `def-edebug-elem-spec` instead.
(edebug--handle-&-spec-op): Remove left over code.
(interactive): Re-add mistakenly removed spec elem.

* doc/lispref/edebug.texi (Specification List): Remove `function-form`.

3 years agoFix flicker when resizing NS frame programmatically (bug#46155)
Alan Third [Sun, 31 Jan 2021 20:19:53 +0000 (20:19 +0000)]
Fix flicker when resizing NS frame programmatically (bug#46155)

; Incidentally fixes bug#21326.

* src/nsterm.m ([EmacsView viewWillDraw]): New function.
([EmacsView viewDidResize:]): We now have to mark the frame for
display on resize.
([EmacsView initFrameFromEmacs:]): Retain frame contents on resize.
([EmacsView updateLayer]): Don't update the layer if the frame is
still garbaged.

3 years agoRemove aliasing on SVG images under scaled NS frames
Alan Third [Wed, 10 Feb 2021 22:12:16 +0000 (22:12 +0000)]
Remove aliasing on SVG images under scaled NS frames

* src/image.c (FRAME_SCALE_FACTOR): New #define for getting frame
scale factor.
(image_set_transform):
(svg_load_image): Use FRAME_SCALE_FACTOR.
* src/nsterm.m (ns_frame_scale_factor): Get the scale factor for an NS
frame.

3 years ago* lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op <&name>): New method
Stefan Monnier [Sat, 13 Feb 2021 21:21:53 +0000 (16:21 -0500)]
* lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op <&name>): New method

(edebug--concat-name): New function.
(edebug-match-name, edebug-match-cl-generic-method-qualifier)
(edebug-match-cl-generic-method-args): Delete functions.

* doc/lispref/edebug.texi (Specification List): Document it.

* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Use `&name`.
(cl-generic--method-qualifier-p): New predicate.
(cl-defmethod): Use it and `&name`.
* lisp/emacs-lisp/cl-macs.el (cl-defun, cl-iter-defun, cl-flet):
* lisp/emacs-lisp/eieio-compat.el (defmethod):
* lisp/emacs-lisp/gv.el (gv-define-setter):
* lisp/emacs-lisp/ert.el (ert-deftest): Use `&name`.
* lisp/erc/erc-backend.el (define-erc-response-handler): Use `declare`
and `&name`.

3 years ago* etc/NEWS: Document new JSON behavior.
Philipp Stephani [Sat, 13 Feb 2021 18:35:26 +0000 (19:35 +0100)]
* etc/NEWS: Document new JSON behavior.

3 years agoSmall correction to `isearch-lazy-highlight-buffer-update'
Augusto Stoffel [Fri, 12 Feb 2021 18:29:54 +0000 (19:29 +0100)]
Small correction to `isearch-lazy-highlight-buffer-update'

The value of point is now read after a potential change of buffer.
* lisp/isearch.el (isearch-lazy-highlight-buffer-update): Move call
to `point' after `select-window'.

Copyright-paperwork-exempt: yes

3 years ago(backtrace-goto-source-functions): Make it a normal abnormal hook
Stefan Monnier [Sat, 13 Feb 2021 15:41:45 +0000 (10:41 -0500)]
(backtrace-goto-source-functions): Make it a normal abnormal hook

* lisp/emacs-lisp/backtrace.el (backtrace-goto-source-functions):
Don't mark it as buffer-local any more.
(backtrace-goto-source): Use `run-hook-with-args-until-success`.

* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Clarify that the
hook is only intended to be modified buffer-locally.

3 years agoFix I-search at EOB when long lines are truncated
Eli Zaretskii [Sat, 13 Feb 2021 15:27:02 +0000 (17:27 +0200)]
Fix I-search at EOB when long lines are truncated

* src/xdisp.c (move_it_to): Fix logic when TO_CHARPOS is at the
end of an hscrolled line which ends at EOB.  (Bug#46316)