Stefan Kangas [Sat, 24 Oct 2020 01:45:48 +0000 (03:45 +0200)]
Move faces.el test data to follow our conventions
* test/lisp/faces-tests.el (ert-x): Require.
(faces--test-data-dir): Remove variable.
(faces--test-extend-with-themes): Use ert-resource-directory.
* test/lisp/faces-resources/*: Moved from test/data/themes/*.
Jared Finder [Mon, 12 Oct 2020 03:16:00 +0000 (20:16 -0700)]
Fix a bug where the wrong menu would be triggered by mouse
For layouts such as the following, clicking the "l" in Tools with the
right window focused would trigger the File menu, not the Tools menu.
This is because the event would have window coordinate (1 . 0).
Similarly, clicking the "p" in Help would trigger the Edit menu.
Example Emacs frame:
+--------------------------------------------------------+
|File Edit Options Buffers Tools Help |
|;; This buffer is for text$|;; This buffer is for text $|
|;; To create a file, visit$|;; To create a file, visit $|
| | |
| | |
|-UUU:----F1 *scratch* |-UUU:----F1 *scratch* |
| |
+--------------------------------------------------------+
* lisp/menu-bar.el (menu-bar-open-mouse): Reject clicks not on
the menu bar.
*lisp/xt-mouse.el (xterm-mouse-event): Pass the current frame to
'posn-at-x-y', to make the effect consistent with other mouse-handling
features.
Jared Finder [Wed, 7 Oct 2020 03:04:12 +0000 (20:04 -0700)]
Enable TTY menus with xterm-mouse-mode
* lisp/tmm.el: No need to bind 'tmm-menubar-mouse' to mouse clicks
on the menu bar.
* lisp/menu-bar.el (global-map): Bind 'menu-bar-open-mouse' to
mouse click on menu bar. This is needed in xt-mouse.
* etc/NEWS: Announce TTY menu support in xterm-mouse-mode.
Jared Finder [Sat, 3 Oct 2020 21:46:30 +0000 (14:46 -0700)]
Make TTY menus work with xterm-mouse-mode
* src/term.c (mouse_get_xy): Call 'mouse_position' passing it the
value of 'tty-menu-calls-mouse-position-function' as the
argument.
(syms_of_term) <tty-menu-calls-mouse-position-function>: New
DEFVAR_BOOL.
* src/frame.c (mouse_position): New function, with most of the
code from Fmouse_position, but call 'mouse-position-function' only
if called with non-zero argument.
(Fmouse_position): Call 'mouse_position' to do the job.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Respect
'track-mouse'.
(xterm-mouse-mode): Set 'tty-menu-calls-mouse-position-function'
when setting 'mouse-position-function'.
(xterm-mouse-tracking-enable-sequence): Use SET_ANY_EVENT_MOUSE
(0x1003) so that mouse movement can be reported even if no buttons
are pressed. Doc fix.
* lisp/menu-bar.el (menu-bar-define-mouse-key): New function.
(tty-menu-navigation-map): Call it.
Stefan Kangas [Sat, 24 Oct 2020 00:36:33 +0000 (02:36 +0200)]
Move epg.el test data to follow our conventions
* test/lisp/epg-tests.el (ert-x): Require.
(epg-tests-data-directory): Remove variable.
(with-epg-tests): Use ert-resource-file.
* test/lisp/epg-resources/*: Moved from test/data/epg/.
Stefan Kangas [Sat, 24 Oct 2020 00:17:37 +0000 (02:17 +0200)]
Move mml-sec.el test data to follow our conventions
* test/lisp/gnus/mml-sec-tests.el (ert-x): Require.
(mml-secure-test-fixture, mml-sec-test--kill-gpg-agent):
Use ert-resource-directory.
* test/lisp/gnus/mml-sec-resources/*: Moved from test/data/mml-sec/.
* .gitignore: Update location of moved file "random_seed".
Eli Zaretskii [Fri, 23 Oct 2020 13:59:37 +0000 (16:59 +0300)]
Remove most of charset markup from etc/HELLO
For the reasons, see the discussion that started in
https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00407.html
and its conclusion in
https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00144.html.
The only markup left is in the preamble, just to show the example
of this facility.
Olivier Certner [Fri, 23 Oct 2020 12:39:04 +0000 (14:39 +0200)]
ERC: Fix ERC's IBuffer format "crash" on killed server buffer
* lisp/erc/erc-ibuffer.el (erc-server-name): Fix a crash when
displaying (or updating) an IBuffer buffer using ERC's first IBuffer
format. This happens when one ERC buffer has its associated server
buffer killed, e.g., voluntarily or automatically after server
disconnection when `erc-kill-server-buffer-on-quit' is set to t. The
culprit is the "Server" column, which returns nil in this case.
Display "(closed)" instead (bug#44156).
Copyright-paperwork-exempt: yes
Ulf Jasper [Fri, 23 Oct 2020 12:48:49 +0000 (14:48 +0200)]
Move icalendar test data to test/lisp/calendar/icalendar-resources
* test/lisp/calendar/icalendar-tests.el (ert-x): Required for
'ert-resource-file'.
(icalendar-tests--data-dir): Removed.
(icalendar-tests--get-file-contents): Use 'ert-resource-file' for
finding test data files.
* test/data/icalendar/*: Moved to test/lisp/calendar/icalendar-resources/.
* test/lisp/calendar/icalendar-resources/*: Moved from test/data/icalendar.
Alan Third [Mon, 19 Oct 2020 20:19:57 +0000 (21:19 +0100)]
Fix SVG image dimension calculations (bug#44065)
* src/image.c (svg_load_image): Calculate the image size by using the
viewBox size and applying it to the image.
* etc/PROBLEMS: Describe the problem with librsvg 2.45 and below.
Stefan Kangas [Thu, 22 Oct 2020 18:32:32 +0000 (20:32 +0200)]
Remove incorrect use of decode-coding-string
* test/lisp/emacs-lisp/bindat-tests.el
(bindat-test-pack/multibyte-string-fails)
(bindat-test-unpack/multibyte-string-fails): Don't use
decode-coding-string.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
Ulf Jasper [Thu, 22 Oct 2020 15:45:59 +0000 (17:45 +0200)]
Move test data for icalendar tests to separate files.
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--data-dir, icalendar-tests--get-file-contents):
New.
(icalendar-tests--test-import, icalendar-tests--do-test-import):
Read input and expected results from files.
(icalendar-import-non-recurring, icalendar-import-rrule)
(icalendar-import-duration, icalendar-import-bug-6766)
(icalendar-import-bug-24199, icalendar-import-bug-33277)
(icalendar-import-multiple-vcalendars, icalendar-import-with-uid)
(icalendar-import-with-timezone, icalendar-real-world): Move test
data (input and expected result) to separate files.
* test/calendar/icalendar/*
New files containing test data for icalendar tests.
Stefan Kangas [Thu, 22 Oct 2020 14:34:11 +0000 (16:34 +0200)]
Use lexical-binding in time-date.el and expand tests
* lisp/calendar/time-date.el: Use lexical-binding.
* test/lisp/calendar/time-date-tests.el
(test-obsolete-with-decoded-time-value)
(test-obsolete-encode-time-value, test-format-seconds)
(test-days-to-time, test-seconds-to-string): New tests.
(test-days-in-month, test-time-since, test-time-decoded-period):
Expand test with a few more values.
Mauro Aranda [Thu, 22 Oct 2020 14:55:03 +0000 (16:55 +0200)]
Make State button interaction less confusing
* lisp/cus-edit.el (custom-variable-current-value): New function.
(custom-variable-backup-value): Use it.
(custom-variable-set, custom-variable-mark-to-reset-standard): Check
that old value is different than the new one. If it is, make a
backup. This way, we avoid offering the Set to Backup Value
unnecesarily.
(custom-variable-reset-saved): Reset the variable-comment property for
the variable, to help custom-variable-state be more correct. Also
check if we should backup old value.
(custom-variable-state): If a variable was set to the standard value,
say its state is standard rather than set, which is more correct.
Getting the right variable state is important for menu options to be
enabled/disabled, and for displaying the right message to the user
(bug#12864).
Stefan Kangas [Thu, 22 Oct 2020 11:58:23 +0000 (13:58 +0200)]
Remove reference HP-UX 8.0 and 9.x bug from FAQ
* doc/misc/efaq.texi (Meta key does not work in xterm): Remove section
about a bug on HP-UX 8.0 and 9.x. Support for these platforms were
removed in 23.1.
Mauro Aranda [Thu, 22 Oct 2020 11:52:42 +0000 (13:52 +0200)]
Allow moving members of editable-list widget, via delete+insert
* etc/NEWS (Widget): Announce the feature (bug#6419).
* lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new
widget property, :last-deleted, the WIDGET to be deleted. Add
docstring.
(widget-editable-list-insert-before): If there is a recently deleted
child for the editable list, insert that one, instead of a new default
widget. Add docstring.
(insert-button widget): Make :help-echo a function to avoid the
help-echo string become too long.
(delete-button widget): Tweak the :help-echo string, to document this
behavior.
* test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item):
Test the feature.
unload-feature: Correct doc string to match info manual and reality
'unload-feature' doesn't try to "undo any additions the library has
made" to hooks, it tries to remove functions defined by the library
from hooks, no matter how they got there.
Stefan Kangas [Wed, 21 Oct 2020 14:09:12 +0000 (16:09 +0200)]
Use lexical-binding in bindat.el
* lisp/emacs-lisp/bindat.el: Use lexical-binding.
(bindat-raw, bindat-idx, bindat-unpack, bindat-pack): Adjust for
lexical-binding.
(bindat--unpack-group, bindat--length-group): Fix byte-compiler
warning about unused variables last and vlen.
(bindat--unpack-group, bindat--length-group, bindat--pack-group)
(bindat-format-vector): Quote function symbols as such.
Stefan Monnier [Tue, 20 Oct 2020 23:00:52 +0000 (19:00 -0400)]
* lisp/outline.el: Use lexical-binding
Remove redundant `group` arguments.
(outline-level): Move before first use.
(outline-mode): Use `setq-local`.
(outline-isearch-open-invisible-function): Give it a non-nil default.
Stefan Kangas [Tue, 20 Oct 2020 17:10:51 +0000 (19:10 +0200)]
Make more load-hooks obsolete (Bug#21563)
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-complete-structtag.el: Recommend
with-eval-after-load instead of load-hooks.
* lisp/calc/calc-ext.el (calc-ext-load-hook):
* lisp/emacs-lisp/bytecomp.el (bytecomp-load-hook):
* lisp/emacs-lisp/cl-extra.el (cl-extra-load-hook):
* lisp/emacs-lisp/cl-macs.el (cl-macs-load-hook):
* lisp/emacs-lisp/cl-seq.el (cl-seq-load-hook):
* lisp/gnus/message.el (message-load-hook):
* lisp/gnus/nnheader.el (nnheader-load-hook):
* lisp/gnus/nnmail.el (nnmail-load-hook):
* lisp/progmodes/dcl-mode.el (dcl-mode-load-hook):
* lisp/textmodes/tex-mode.el (tex-mode-load-hook):
* lisp/whitespace.el (whitespace-load-hook): Obsolete for
with-eval-after-load. Note that these variables are never declared,
but the byte-compiler will still warn about them if used.
Eli Zaretskii [Tue, 20 Oct 2020 15:27:47 +0000 (18:27 +0300)]
Avoid assertion violations in malformed Unicode escapes
* src/lread.c (read_escape): Produce better diagnostic for
malformed \u Unicode escapes, while avoiding assertion violation
when READCHAR returns -1 because the input is exhausted.
(Bug#44084)
* lisp/mpc.el (mpc-songs-jump-to): Update the status buffer.
* lisp/mpc.el (mpc-stop): M-x mpc-stop clears playlist queue. So
updating *MPC-Songs* buffer is useful.
* lisp/mpc.el (mpc-cmd-delete): I noticed M-x mpc-playlist-delete
always messages “Deleted 1 songs” even if playlist queue has more
than one songs. This is because mpc-cmd-delete’s sort modifies
songs-poss by side effect. Using copy-sequence fixes this (bug#44093).
* lisp/mpc.el (mpc-cmd-move): Ditto.
Jim Blandy [Tue, 20 Oct 2020 11:09:16 +0000 (13:09 +0200)]
Man highlighting: Don't occasionally bold entire sections.
* lisp/ansi-color.el (ansi-color-apply-on-region): Always save a
restart position in ansi-color-context-region if the region ends with
highlighting active.
Stefan Kangas [Mon, 19 Oct 2020 18:30:52 +0000 (20:30 +0200)]
Add command package-menu-filter-upgradable
* lisp/emacs-lisp/package.el (package-menu-filter-upgradable):
New command. (Bug#41436)
(package-menu-mode-map): Bind the new command.
* doc/emacs/package.texi (Package Menu): Document the new command.
Stefan Monnier [Mon, 19 Oct 2020 17:03:41 +0000 (13:03 -0400)]
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string): Fix match data error
Get (match-string 3 string) earlier, in case `mm-charset-to-coding-system`
clobbers the match data.
Also, check that `string-match` succeeded before using its match data.
* doc/misc/modus-themes.texi (Installation): Remove reference to MELPA.
(Top)
(Install from the archives, GNU Guix)
(Load at a given time or at sunset/sunrise)
(Configure options prior to loading, Command prompts)
(Headings' font, Will NOT be supported): Fix spelling, wording,
markup.
(Acknowledgements): Spell contributor's surname correctly.
Stefan Kangas [Sat, 12 Sep 2020 17:49:20 +0000 (19:49 +0200)]
Make auto-revert-mode tests run faster
* test/lisp/autorevert-tests.el (auto-revert--timeout): Make into
defun and shorten timeout by a factor 10.
(auto-revert--wait-for-revert): Cut timeouts in half.
(with-auto-revert-test): New macro to set timeout to 0.1.
(auto-revert-tests--write-file): New defun.
(auto-revert-test00-auto-revert-mode)
(auto-revert-test01-auto-revert-several-files)
(auto-revert-test02-auto-revert-deleted-file)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired)
(auto-revert-test05-global-notify)
(auto-revert-test06-write-file): Adapt test to run faster. Remove
:expensive-test marks.
This was discussed in:
https://lists.gnu.org/r/emacs-devel/2020-10/msg01233.html
When matching messages in compilation-mode, keep track of the rule
employed for each match. This facilitates debugging and allows us to
verify that each test case really exercises the rule that we expect it
to.
Naturally this uncovered several test cases that didn't check what the
author thought they did; the rules affixed to
compile-tests--test-regexps-data are those actually used, so that the
tests still pass.
* lisp/progmodes/compile.el (compilation--message): Add 'rule' slot.
(compilation-directory-properties, compilation-error-properties)
(compilation-internal-error-properties, compilation-parse-errors)
(compilation--compat-parse-errors): Set the rule slot.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-tests--grep-regexp-testcases)
(compile-tests--grep-regexp-tricky-testcases): Add rules to test cases.
(compile--test-error-line): Check that the rule matches what we expect.
(compile-test-grep-regexps): Adapt to test case format.
Remove now superfluous ert-info.
Hoist some loop-invariant variable bindings in compile.el
* lisp/progmodes/compile.el (compilation-parse-errors):
Hoist the binding of case-fold-search and a memq call out of
the loop, eliminating a minor but unnecessary quadratic term.
Stefan Kangas [Mon, 19 Oct 2020 10:12:15 +0000 (12:12 +0200)]
Improve Info-streamline-headings defaults
* lisp/info.el (Info-streamline-headings): Improve defaults. These
produce somewhat more consistent results on my system, and seems
slightly more in line with current GNU practices. For example, gcc
uses the "Software development" heading instead of "Programming".
dickmao [Mon, 19 Oct 2020 09:56:36 +0000 (11:56 +0200)]
`ffap-gopher-at-point' interminable without newlines
* lisp/ffap.el (ffap-gopher-at-point): Stop when we get to the end
of the buffer.
* test/lisp/ffap-tests.el (ffap-test-no-newlines): Ensure
termination for corner case (bug#44048).