Make menu bar entries only point to named functions, not lambdas
* lisp/menu-bar.el ()
(menu-bar--display-line-numbers-mode-visual)
(menu-bar--display-line-numbers-mode-relative)
(menu-bar--display-line-numbers-mode-absolute)
(menu-bar--display-line-numbers-mode-none)
(menu-bar--visual-line-mode-enable)
(menu-bar--toggle-truncate-long-lines)
(menu-bar--wrap-long-lines-window-edge): Make lambdas into trivial
wrapper functions so that `C-h k' on the menu items work (bug#13841).
(menu-bar-showhide-line-numbers-menu)
(menu-bar-line-wrapping-menu): Use them.
Make add-face-text-property not be destructive on strings
* src/textprop.c (add_properties): Take a parameter to say whether
it's allowed to be destructive or not (bug#20153).
(add_text_properties_1): Ditto.
(Fadd_face_text_property): Use this to say that it shouldn't
modify face properties on strings destructively. This avoids
altering the face properties of one string when altering them on a
copy of the string.
Filter packages by name in list-packages. (Bug#36981)
* lisp/emacs-lisp/package.el (package-menu-filter-by-name): New
function to filter packages by name.
(package-menu-clear-filter): New function to clear applied filters.
(package-menu-filter-by-keyword): Rename function from
package-menu-filter.
(package-menu--generate): Don't change 'q' binding anymore.
(package-menu-mode-map): Bind '/ n' to package-menu-filter-by-name, '/
k' to package-menu-filter-by-keyword and '/ /' to
package-menu-clear-filter.
(package-menu-mode-menu): Update menu entries for the three functions.
* test/lisp/emacs-lisp/package-tests.el (package-test-list-filter-by-name)
(package-test-list-clear-filter): New tests.
* doc/emacs/package.texi: Document usage of
package-menu-filter-by-name, package-menu-clear-filter and update
reference to package-menu-filter-by-keyword.
* etc/NEWS: Announce changes.
Hong Xu [Tue, 8 Oct 2019 16:43:47 +0000 (18:43 +0200)]
Search upward from current dir for the default TAGS file
* doc/emacs/maintaining.texi (Select Tags Table): Update the doc
of `visit-tags-table' (bug#37518).
* lisp/progmodes/etags.el (tags--find-default-tags-dir-recursively)
(visit-tags-table): Search upward from current dir for the default
TAGS file.
Eli Zaretskii [Tue, 8 Oct 2019 13:57:23 +0000 (16:57 +0300)]
Fix crashes on TTY frames due to "C-x 6 f"
* src/xdisp.c (redisplay_internal): Revert the recent change
regarding TTY frames' garbaged flag. It is not needed.
* src/dispnew.c (adjust_frame_glyphs_for_frame_redisplay):
When returning due to mismatch between the desired and actual
dimensions of the glyph matrix, set the frame's garbaged flag
for TTY frames. This avoids crashes when we are later called
from redisplay. Reported by Ergus <spacibba@aol.com>.
* lisp/faces.el (line-number-major-tick, line-number-minor-tick):
Set default color different from `line-number' so after customizing
the tick number variables, the ticks are immediately visible.
Suggested by Juri Linkov <juri@linkov.net>.
* doc/lispref/text.texi (Commands for Insertion):
* lisp/simple.el (newline): Do not mention conditions specific to
'do-auto-fill' under documentation of 'newline' (bug#36702).
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): Use
this to allow using commands like `C-s' to search for even
truncated bits.
* lisp/international/mule-util.el (truncate-string-to-width):
Allow using text properties to truncate strings instead of
actually truncating strings (bug#17782).
* lisp/emacs-lisp/cl-seq.el: (cl-reduce): Clarify treatment of
:INITIAL-VALUE when :FROM-END is non-nil. Improve wording when SEQ
is empty and :INITIAL-VALUE is unspecified (bug#37400). Describe
behavior when SEQ comprises a single element.
Eli Zaretskii [Mon, 7 Oct 2019 16:03:04 +0000 (19:03 +0300)]
Fix infloop in redisplay caused by a recent change
* src/xdisp.c (redisplay_internal): Avoid inflooping due to a
frame's garbaged flag being set after update_frame. Reported
by Michael Heerdegen <michael_heerdegen@web.de>.
Make ido-display-buffer work interactively more like display-buffer
* lisp/ido.el (ido-display-buffer): Take an interactive parameter,
like `display-buffer' (bug#14904).
(ido-visit-buffer): Use it to emulate `C-u M-x display-buffer'.
Paul Eggert [Mon, 7 Oct 2019 06:08:34 +0000 (23:08 -0700)]
Fix port of file-acl errno checking to non-GNU
I had misinterpreted the private email from Ashish Shukla.
* src/fileio.c (Ffile_acl): Fix typo in previous change
by negating the call to acl_errno_valid.
Hong Xu [Mon, 7 Oct 2019 04:03:21 +0000 (06:03 +0200)]
Default FILE to the current buffer for list-tags
* doc/emacs/maintaining.texi (List Identifiers): Update
`list-tags' doc (bug#37611).
* lisp/progmodes/etags.el (list-tags)
(tags--get-current-buffer-name-in-tags-file): Default FILE to the
current buffer for list-tags.
Make mailcap-prefer-mailcap-viewers work as documented
* lisp/emacs-lisp/seq.el (seq-find): Autoload.
* lisp/net/mailcap.el (mailcap-parse-mailcaps): Note where all the
entries come from so that we can later distinguish between user
values and system values (bug#36771).
(mailcap-parse-mailcap): Take a source parameter.
(mailcap-possible-viewers): No need to sort wildcards/exact
matches; these are later sorted anyway.
(mailcap-add-mailcap-entry): Remove `after' parameter.
(mailcap-mime-info): Make mailcap-prefer-mailcap-viewers work as
documented.
Mauro Aranda [Mon, 7 Oct 2019 01:59:43 +0000 (03:59 +0200)]
Only complete words inside of the string widget
* lisp/wid-edit.el ('string widget): Peek the word that
ispell-complete-word will try to complete, and only offer completions
when the word is inside of the field (bug#11046).
Mauro Aranda [Mon, 7 Oct 2019 01:36:09 +0000 (03:36 +0200)]
Fix message when no completions available for editable field
* lisp/wid-edit.el (widget-completions-at-point): Detect here if point
is not in an editable field.
(widget-complete): And here say there are no completions available
(bug#11562).
Juri Linkov [Sun, 6 Oct 2019 21:08:10 +0000 (00:08 +0300)]
Use tabs in EWW (bug#37592)
* lisp/net/eww.el (eww-open-in-new-buffer): Call tab-new when tab-bar-mode
is enabled.
(eww-browse-url): Add docstring. Call tab-new when tab-bar-mode
is enabled.
* lisp/net/shr.el (shr-map): Bind [C-down-mouse-1] to
shr-mouse-browse-url-new-window.
(shr-mouse-browse-url-new-window): New command.
(shr-browse-url): Add optional arg new-window.
* doc/misc/eww.texi (Basics): Mention opening tabs on M-RET.
Stefan Monnier [Sun, 6 Oct 2019 20:00:21 +0000 (16:00 -0400)]
* eieio-core.el (eieio--full-class-object): New function.
Rather than explicitly call eieio-class-un-autoload, the autoloading is
now performed on-demand if you use eieio--full-class-object.
* lisp/emacs-lisp/eieio-core.el (eieio-class-un-autoload): Remove.
(eieio--full-class-object): New function, to replace it.
(eieio-oref, eieio--class-precedence-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object):
Use it instead of eieio-class-un-autoload.
* lisp/emacs-lisp/eieio.el (eieio-class-parents, child-of-class-p):
Load the class if needed.
Stefan Kangas [Wed, 21 Aug 2019 01:38:49 +0000 (03:38 +0200)]
Support changing font size using mouse wheel
* lisp/mwheel.el (mouse-wheel-mode): Support changing font size (text
scaling) using mouse wheel. (Bug#28182)
(mouse-wheel-scroll-amount): Bind the Ctrl modifier to text scaling.
(mwheel-installed-text-scale-bindings): New variable.
(mouse-wheel--remove-bindings): New helper function for
'mouse-wheel-mode'.
* doc/emacs/frames.texi (Mouse Commands): Document this feature.
* etc/NEWS: Announce it.
Set alternate faces for some line numbers (bug#27734)
* lisp/faces.el (line-number-major-tick, line-number-minor-tick):
New faces.
* lisp/cus-start.el (display-line-numbers-major-tick)
(display-line-numbers-minor-tick): Add customization info.
* lisp/frame.el: Add `display-line-numbers-major-tick' and
`display-line-numbers-minor-tick' to list of variables which
should trigger redisplay of the current buffer.
* src/xdisp.c (syms_of_xdisp) <display-line-numbers-major-tick>
<display-line-numbers-major-tick>: Defvar new options.
(syms_of_xdisp) <line-number-major-tick, line-number-minor-tick>:
Defsym new faces.
(maybe_produce_line_number): Use new faces for line numbers
that are multiple of `display-line-numbers-major-tick' and
`display-line-numbers-minor-tick'.
* etc/NEWS (value): Announce new feature.
* doc/emacs/display.texi (Display Custom): Describe it. Wording by
Robert Pluim <rpluim@gmail.com>
Avoid inf-recursion with dependency cycles.
Remove unused `only` arg. Prune duplicates early rather than late.
(package--removable-packages): Simplify code accordingly.
Paul Eggert [Sun, 6 Oct 2019 16:53:53 +0000 (09:53 -0700)]
Port file-acl errno checking to non-GNU
Problem reported privately for FreeBSD 12 by Ashish Shukla.
* src/fileio.c (Ffile_acl): Treat EINVAL etc. like ENOTSUP if
acl_get_file fails, to port to FreeBSD 12 and other non-GNU
platforms.
Eli Zaretskii [Sun, 6 Oct 2019 16:53:18 +0000 (19:53 +0300)]
Support mouse clicks on tab bar on TTY frames
This for now doesn't work on GPM.
* src/xdisp.c (display_tab_bar): Make the loop over tab-bar
items more efficient.
(tab_bar_item_info, tool_bar_item_info): Correct data type for
CHARPOS.
(tty_get_tab_bar_item, tty_handle_tab_bar_click): New functions.
(note_mouse_highlight): Handle help-echo of tab-bar tabs on
TTY frames.
* src/w32inevt.c (do_mouse_event): Call
tty_handle_tab_bar_click to process mouse clicks on the tab bar.
* src/termchar.h (tty_handle_tab_bar_click): Add prototype.
* src/w32console.c (w32con_set_terminal_modes): Disable Quick
Edit mode on entry, to make sure mouse events get reported to
us.
Paul Eggert [Sun, 6 Oct 2019 04:23:15 +0000 (21:23 -0700)]
Fix off-by-one bug in ISO 8601 BC years
* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601-parse-date):
Don’t bother to separate the year’s sign from the year,
as that distinction is not needed: ISO 8601 uses
astronomical year numbering with a year zero, which
is what the Emacs time functions use, so there’s no
need to treat nonpositive years specially.
(iso8601--adjust-year): Remove; no longer needed
since callers can just use string-to-number.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years):
Adjust test case to match fixed behavior.
Paul Eggert [Sun, 6 Oct 2019 04:17:48 +0000 (21:17 -0700)]
Improve documentation for year-zero issues
* doc/emacs/calendar.texi (Calendar Systems)
* doc/lispref/os.texi (Time Conversion):
Prefer "BC" to "B.C." since the documentation generally uses "BC".
* doc/misc/emacs-mime.texi (time-date):
* lisp/calendar/time-date.el (date-to-day, time-to-days):
In the doc string, state the day origin more clearly, and more
consistently with the rest of the documentation.
* src/timefns.c (Fdecode_time): State the year origin in
the doc string.
Juri Linkov [Sat, 5 Oct 2019 21:50:19 +0000 (00:50 +0300)]
* lisp/tab-bar.el: In tab switching allow absolute and relative args.
* lisp/tab-bar.el (tab-bar-tab-hints): New defcustom.
(tab-bar-make-keymap-1): Use tab-bar-tab-hints.
(tab-bar--tab, tab-bar--current-tab, tab-bar--current-tab-index)
(tab-bar--tab-index, tab-bar--tab-index-by-name): New internal functions.
(tab-bar-select-tab): Use arg as absolute position of tab to select.
(tab-bar-switch-to-next-tab, tab-bar-switch-to-prev-tab): Use arg
as offset relative to the current tab.
(tab-bar-switch-to-tab): New command.
(tab-bar-new-tab): Simplify by using cl-pushnew.
(tab-bar-close-current-tab): Remove (the current tab is closed
by nil arg of tab-bar-close-tab).
(tab-bar-close-tab): Use arg as absolute position of tab to close.
(tab-bar-close-tab-by-name): New command.
Paul Smith [Sat, 5 Oct 2019 19:29:04 +0000 (12:29 -0700)]
Support GNU make error messages in compile mode.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Match GNU make error messages.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Test GNU make error message matching.
(compile-test-error-regexps): Update count of infos found.
Eli Zaretskii [Sat, 5 Oct 2019 12:02:46 +0000 (15:02 +0300)]
Fix display of cursor in obscure use case on MS-Windows
* src/xdisp.c (redisplay_internal): Detect when the frame
becomes garbaged inside the call to update_frame, and redraw
the frame in that case. (Bug#37579)
Eli Zaretskii [Sat, 5 Oct 2019 08:59:55 +0000 (11:59 +0300)]
Fix vertical scrolling in image-mode
* lisp/image-mode.el (image-set-window-vscroll): Interpret the
argument VSCROLL value in pixel units.
(image-mode-reapply-winprops): Interpret the 'vscroll'
property value in pixel units.
(image-next-line): Scroll the image with pixel resolution.
(image-eob): Set the image vscroll in pixels. (Bug#37578)
Improve docstrings auto-generated by `define-minor-mode'
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring):
When using `easy-mmode--arg-docstring' to auto-generate a
docstring, refill it up to `emacs-lisp-docstring-fill-column'.
Eric Abrahamsen [Thu, 3 Oct 2019 23:21:02 +0000 (16:21 -0700)]
Don't manipulate gnus-newsrc-alist if it hasn't been initalized
* lisp/gnus/gnus-group.el (gnus-group-set-info): Packages that use
Gnus summary mode without actually booting Gnus might end up in this
situation. See bug#36903
Paul Eggert [Fri, 4 Oct 2019 21:38:22 +0000 (14:38 -0700)]
Fix bugs found by 2019-09-29 regexp scanner
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-09/threads.html
* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601--zone-match):
* lisp/textmodes/rst.el (rst-re-alist-def):
Put ‘-’ at the end of bracketed ranges, following the style
suggestion in the Elisp manual.
(iso8601--time-match): Use \([0-9]*\) instead of \([0-9]+\)?
to pacify the regexp scanner.
(iso8601-parse-time): Adjust accordingly.
* lisp/language/burmese.el (burmese-composable-pattern):
* lisp/language/indian.el (devanagari-composable-pattern)
(bengali-composable-pattern, gurmukhi-composable-pattern)
(gujarati-composable-pattern, oriya-composable-pattern)
(telugu-composable-pattern, kannada-composable-pattern)
(malayalam-composable-pattern):
Prefer [ab] to [a-b] when the characters differ by 1,
to pacify the regexp scanner.
* lisp/language/burmese.el (burmese-composable-pattern):
Fix missing-‘\u’ typos.
* lisp/language/indian.el (gurmukhi-composable-pattern):
Fix missing-‘\’ typo.
* lisp/language/tibetan.el (tibetan-regexp):
Quote ‘+’ in regexp to pacify the regexp scanner. Simplify.
* lisp/textmodes/rst.el (rst-re-alist-def): Fix ‘[]-'...]’
typo by putting the ‘-’ at end of the bracketed expression.
Stefan Kangas [Fri, 9 Aug 2019 07:39:16 +0000 (09:39 +0200)]
Make mouse scroll show a message instead of dinging at buffer limits
* lisp/mwheel.el (mwheel-scroll): Show a message instead of dinging at
end of buffer and beginning of buffer. This should be less intrusive,
especially when using a trackpad. (Bug#16196)
Stefan Kangas [Tue, 20 Aug 2019 17:04:16 +0000 (19:04 +0200)]
Bind Scroll_Lock to scroll-lock-mode globally
* lisp/bindings.el (global-map): Bind Scroll_Lock to
scroll-lock-mode. (Bug#6861)
* lisp/scroll-lock.el (scroll-lock-mode): Note that the binding will
not work if 'w32-scroll-lock-modifier' is non-nil.
* etc/NEWS: Announce it.
Fix error in gnu compilation-mode regexp (bug#37582)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Fix a mistake introduced when the regexp was translated to rx.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test case.
* etc/compilation.txt: Add example.
* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps):
Don't rely on compilation-num-errors (etc) all being zero, which they
aren't if the test has been run before.
(compile-tests--test-regexps-data): Change defvar to defconst.
Improve docstrings auto-generated by `define-minor-mode'
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring):
When using `easy-mmode--arg-docstring' to auto-generate a
docstring, refill it up to `emacs-lisp-docstring-fill-column'.
Dmitry Gutov [Thu, 3 Oct 2019 23:03:04 +0000 (02:03 +0300)]
Speed up project-files for Git projects
* lisp/progmodes/project.el (project-files): New method.
Implementation for VC projects that uses 'git ls-files' or 'hg
status --all' for listing. With gratitude to Tassilo Horn who has
done most of the legwork and wrote the first version of the code
(https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00069.html).
(project--vc-list-files): New function, to be used by the above.
(project--find-regexp-in-files):
Silence warnings about nonexistent files.