Stefan Monnier [Fri, 19 Feb 2021 17:08:00 +0000 (12:08 -0500)]
* test/lisp/emacs-lisp/edebug-tests.el: Adjust to new `edebug-eval-defun`.
(edebug-tests-trivial-backquote): Adjust to the way `eval-defun`
outputs its result.
(edebug-tests-cl-macrolet): Adjust to the fact that now macro expansion
takes place during the `eval-defun` even when Edebugging.
Glenn Morris [Fri, 19 Feb 2021 16:36:56 +0000 (08:36 -0800)]
Merge from origin/emacs-27
8e8b46ef81 (origin/emacs-27) More accurate documentation of the "r" i... dcb2015a5b Mention the GNU Kind Communications Guidelines in the FAQ 9882e63eea ; * CONTRIBUTE: Another wording change regarding tiny chan... 850f18ef23 Allow newlines in password prompts again in comint c977370dd7 Avoid point movement when visiting image files da64a257a4 ; * CONTRIBUTE: Yet another clarification of significant c... d03f2a6ee9 Avoid assertion violation in callproc.c dcc00bbb19 ; * CONTRIBUTE: Clarify the "15-lines" rule a bit more.
Glenn Morris [Fri, 19 Feb 2021 16:36:55 +0000 (08:36 -0800)]
Merge from origin/emacs-27
4712c75ab8 Clarify when activate-mark-hook is run abedf3a865 Fix language-environment and font selection on MS-Windows 8b8708eadd Fix example in Sequence Functions node in the manual
* lisp/net/newst-treeview.el (newsticker-treeview-jump): Change prompt
string.
(newsticker--group-shift): Move the group when a group is currently
selected. Fix error when explicitly shifting a group. (Fixes first
issue in Bug#41376.)
* lisp/progmodes/cperl-mode.el (cperl--package-regexp):
Avoid double repetition; cperl--ws-or-comment-regexp is already
repeated with 1+.
* test/lisp/textmodes/dns-mode-tests.el
(dns-mode-tests-dns-mode-soa-increment-serial): Escape literal '$'.
* test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Modify test to not
trigger a linting warning while retaining its testing power.
(edebug-all-defs, edebug-all-forms): Don't autoload since the problem
it was working around has been fixed a while back.
(edebug--eval-defun): Rename from `edebug-eval-defun` and simplify by
making it an `:around` advice.
(edebug-install-read-eval-functions)
(edebug-uninstall-read-eval-functions): Adjust accordingly.
(edebug-eval-defun): Redefine as an obsolete wrapper.
* lisp/progmodes/elisp-mode.el (elisp--eval-defun):
Use `load-read-function` so it obeys `edebug-all-(defs|forms)`.
(elisp--eval-defun): Fix recent regression introduced with
`elisp--eval-defun-result`.
Ryan Prior [Thu, 18 Feb 2021 11:48:28 +0000 (12:48 +0100)]
Allow newlines in password prompts again in comint
* lisp/comint.el (comint-password-prompt-regexp): Match all
whitespace (including newline) at the end of the passphrase, not
just space and \t (bug#46609).
(comint-watch-for-password-prompt): Remove trailing newlines from
the prompt (bug#46609).
The argument of the rx `regexp` form is assumed to evaluate to a valid
regexp, but certain kinds of deprecated but still accepted usage were
not handled correctly, such as unescaped literal (special) characters:
(rx "a" (regexp "*")) => "a*" which is wrong.
Handle these cases; there is no extra trouble.
* lisp/emacs-lisp/rx.el (rx--translate-regexp): Force bracketing
of single special characters.
* test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Add test case.
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".
* 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.
* 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'.
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.
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).
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.
* 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).
Eli Zaretskii [Tue, 16 Feb 2021 16:20:06 +0000 (18:20 +0200)]
Avoid point movement when visiting image files
* lisp/image-mode.el (image-toggle-display-image): Preserve point
around the call to exif-parse-buffer, to prevent it from moving
into the image data. (Bug#46552)
* 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).
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.
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`.
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.
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)
* 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.
* 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.
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.
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.
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.