f31c6792ab Fix support for Zip64 zip files ba635a19fb * lisp/hi-lock.el (hi-lock-auto-select-face): Doc fix. (B... cc8fef2bdd Avoid infinite recursion with 'relative' line numbers display 395f10cb98 ; Fix more trivial typos bf4accb65e ; Fix some trivial typos
* src/fns.c (Fstring_search): Perform cheap all-ASCII checks before more
expensive ones. Use a faster loop when searching for non-ASCII
non-raw bytes.
* test/src/fns-tests.el (string-search): Add more test cases.
Eli Zaretskii [Sun, 27 Sep 2020 05:57:17 +0000 (08:57 +0300)]
Improve documentation of the 'abbrev-suggest' feature
* lisp/abbrev.el (abbrev-suggest, abbrev-suggest-hint-threshold)
(abbrev-suggest-show-report): Improve wording of the doc strings.
* doc/emacs/abbrevs.texi (Abbrevs Suggestions): Fix the typo in
the node name. Improve wording.
* doc/emacs/emacs.texi (Top): Add the new node in the @detailmenu
section.
* etc/NEWS: Improve wording of the NEWS entry for
'abbrev-suggest'.
Eli Zaretskii [Sun, 27 Sep 2020 05:26:56 +0000 (08:26 +0300)]
Improve display of raw bytes in the echo-area
* src/print.c (print_object): When printing a unibyte string,
convert non-ASCII bytes to their character code, before sending
them to 'printchar'. (Bug#43632)
* lisp/subr.el (string-replace): Rename from replace-in-string
since that clashes with XEmacs' replace-in-string which is
equivalent to the Emacs replace-regexp-in-string (bug#43598).
Abbrev suggestions helps users remember to use defined abbrevs
* lisp/abbrev.el (abbrev-suggest): New defcustom.
(abbrev-suggest-hint-threshold): New defcustom.
(abbrev--suggest-get-active-tables-including-parents): New defun.
(abbrev--suggest-get-active-abbrev-expansions): New defun.
(abbrev--suggest-count-words): New defun.
(abbrev--suggest-get-previous-words): New defun.
(abbrev--suggest-above-threshold): New defun.
(abbrev--suggest-saved-recommendations): New defvar.
(abbrev--suggest-inform-user): New defun.
(abbrev--suggest-shortest-abbrev): New defun.
(abbrev--suggest-maybe-suggest): New defun.
(abbrev--suggest-get-totals): New defun.
(abbrev-suggest-show-report): New defun.
(expand-abbrev): If the previous word was not an abbrev, maybe
suggest an abbrev to the user.
* doc/emacs/abbrevs.texi (Abbrev suggestions): New section.
* etc/NEWS: Announce abbrev suggestions.
Display some character widget values in a more user-friendly way
* lisp/wid-edit.el (widget-character--escape-sequences-alist): New
variable.
(widget-character--change-character-display): New function. Use the new
variable.
(widget-character-notify): New function, to keep track of the changes
in the character widget, and display characters like tab,
newline and spaces better.
(character widget): Use widget-character-notify as the notify
function. Use widget-character--change-character-display for the
internal representation of value (bug#15925).
* lisp/wid-edit.el (widget-button-click): Remove a
newly-introduced check that made mouse highlights no longer work
(bug#43612). It's unclear what the check was trying to fix.
Harald Jörg [Sat, 26 Sep 2020 13:51:15 +0000 (15:51 +0200)]
cperl-mode: Delete conditional code where conditions evaluate to nil
* lisp/progmodes/cperl-mode.el (cperl-force-face): This
macro's single effect is now inlined, and the macro is gone.
(cperl-problems): The reference to choose-color.el, which
is no longer available for download, is deleted.
(no function): A list of unnecessary empty variable
definitions is gone. They were needed for Emacs v19 and
below.
(cperl-init-faces-weak): This function does no longer do
anything and is therefore deleted.
(cperl-init-faces): Some bodies of conditional code is deleted
because as of today the conditions evaluate to constants. The
face cperl-nonoverridable-face is no longer available as
variable and needs to be doubly-quoted in one place (bug#43622).
Stefan Kangas [Sat, 26 Sep 2020 09:27:48 +0000 (11:27 +0200)]
Repurpose libxml test for obsolete argument
* test/src/xml-tests.el (libxml-tests): Move half this test for the
recently obsoleted fourth argument to libxml-parse-xml-region...
* test/lisp/xml-tests.el (xml-tests--remove-comments): ...to a new
test here for xml-remove-comments.
* test/src/xml-tests.el (libxml-tests--data-comments-discarded):
Move test data from here...
* test/lisp/xml-tests.el (xml-tests--data-with-comments): ...to here.
Michael Albinus [Sat, 26 Sep 2020 09:38:23 +0000 (11:38 +0200)]
Add D-Bus monitor
* lisp/net/dbus.el (dbus-interface-monitoring): New defconst.
(dbus-call-method, dbus-call-method-asynchronously)
(dbus-send-signal, dbus-method-return-internal)
(dbus-method-error-internal, dbus-check-arguments): Accept also
:system-private and :session-private.
(dbus-check-event, dbus-event-path-name)
(dbus-event-interface-name)
(dbus-event-member-name, dbus-property-handler)
(dbus-handle-bus-disconnect): Adapt according to new structure.
(dbus-handle-event): Handle also monitor events.
(dbus-event-destination-name, dbus-event-handler)
(dbus-event-arguments, dbus-register-monitor, dbus-monitor-handler):
New defuns.
* src/dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS, xd_remove_watch)
(Fdbus__init_bus): Accept also :system-private and :session-private.
(xd_read_message_1): Add destination and error_name to
dbus-event. Handle monitor events.
(syms_of_dbusbind): Declare QCsystem_private, QCsession_private
and QCmonitor.
(dbus-registered-objects-table): Fix docstring.
Paul Eggert [Thu, 9 Jul 2020 23:35:48 +0000 (16:35 -0700)]
Fix out-of-source ‘make check’ emacs-module-tests
Problem reported by Koki Fukuda in:
https://lists.gnu.org/r/emacs-devel/2020-07/msg00169.html
* test/Makefile.in (MODULE_CFLAGS):
Include from the same directories included from in ../src.
* test/src/emacs-module-tests.el (module/describe-function-1):
Strip path to source directory.
Alan Third [Fri, 25 Sep 2020 16:12:51 +0000 (17:12 +0100)]
Tidy up NS color handling
* src/nsimage.m (COLORSPACE_NAME): New macro to find the current
colorspace.
([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]):
([EmacsImage initForXPMWithDepth:width:height:]): Use the current
colorspace.
* src/nsterm.h (NSAppKitVersionNumber10_7):
(NSAppKitVersionNumber10_10): Define for macOS version checks.
* src/nsterm.m ([NSColor colorForEmacsRed:green:blue:alpha:]): Tidy up
the version checking.
([NSColor colorUsingDefaultColorSpace]): Tidy the version checking and
use [NSColor colorUsingColorSpace:] with GNUstep.
Alan Third [Wed, 23 Sep 2020 12:57:50 +0000 (13:57 +0100)]
Implement internal border colors on NS (bug#41071)
* src/nsterm.m (ns_clear_under_internal_border): New function.
(ns_after_update_window_line): Use the correct background color.
(ns_redisplay_interface): Add ns_clear_under_internal_border.
* lisp/whitespace.el (whitespace-space-after-tab-regexp)
(whitespace-indentation-regexp): The first string here isn't a
regexp, it's a string (that's expanded with format to be a regexp).
Eli Zaretskii [Fri, 25 Sep 2020 08:55:51 +0000 (11:55 +0300)]
Avoid infinite recursion with 'relative' line numbers display
* src/xdisp.c (display_count_lines_visually): Bind
'display-line-numbers' to 'relative' around 'start_display' as
well, since that can invoke 'move_it_to' internally, thus
causing infinite recursion. (Bug#43589)
(ruby-mode-map, ruby-mode-menu): Don't use ruby-for/backward-sexp any more.
(ruby-mode-variables): Always setup SMIE navigation.
Still obey `ruby-use-smie` for indentation.
(ruby-forward-sexp, ruby-backward-sexp): Mark as obsolete.
Juri Linkov [Thu, 24 Sep 2020 19:25:03 +0000 (22:25 +0300)]
Horizontal scrolling for mouse wheel with Shift modifier (bug#43568)
* lisp/mwheel.el (mouse-wheel-scroll-amount): Change 'shift' default value
from 5 to 'hscroll'. Add new option "Scroll horizontally" for 'hscroll'.
(mwheel-scroll): Handle value 'hscroll' and call mwheel-scroll-left-function
or mwheel-scroll-right-function.
* doc/emacs/frames.texi (Mouse Commands): Update for horizontal scrolling
with Shift modifier.
* lisp/mwheel.el (mouse-wheel-scroll-amount): Change default value 5 to 1
and shift default value from 1 to 5.
Default value is changed as discussed in etc/TODO.
* src/process.c (update_process_mark): Make into its own function.
(Fmake_process, Fmake_pipe_process, Fmake_serial_process)
(connect_network_socket): Use it.
Eric Abrahamsen [Wed, 23 Sep 2020 23:01:38 +0000 (16:01 -0700)]
Write Gnus active files with quotes around group names
* lisp/gnus/gnus-util.el (gnus-write-active-file): In case of group
names with spaces in them (see Bug#42823). Names are later read with
`read', so this should be quite robust.
Juri Linkov [Wed, 23 Sep 2020 19:39:32 +0000 (22:39 +0300)]
New command goto-line-relative (bug#5042, bug#9917)
* lisp/simple.el (goto-line-read-args): New function with code from goto-line.
(goto-line): New arg RELATIVE. Also use 'widen-automatically' to
leave all lines accessible in the narrowed buffer.
(goto-line-relative): New command.
* lisp/info.el (Info-mode-map): Remap 'goto-line' to 'goto-line-relative'.
Stefan Kangas [Wed, 23 Sep 2020 18:53:06 +0000 (20:53 +0200)]
Remove TODO to convert files to unit tests
* test/lisp/textmodes/css-mode-tests.el:
* test/lisp/progmodes/ruby-mode-tests.el: Remove TODO to convert test
files into unit tests. The files are still useful for debugging.
Ref: https://lists.gnu.org/r/emacs-devel/2020-09/msg01906.html
Don't signal scan-error when moving by sexp interactively
* lisp/emacs-lisp/lisp.el (forward-sexp, backward-sexp, forward-list)
(backward-list, down-list, up-list, mark-sexp, kill-sexp)
(backward-kill-sexp): Remove unsightly scan-error when running
interactively and no further movement by sexp can be made (bug#43489).
Allow the newline character in the character widget (Bug#15925)
* lisp/wid-edit.el (widget-specify-field): Extend check for adding the
boundary overlay. Plus, a minor comment indentation fix.
(character widget): Tweak the valid-regexp to allow the newline
character.
* test/lisp/wid-edit-tests.el (widget-test-character-widget-value)
(widget-test-editable-field-widget-value): New tests (bug#15925).
Andrew G Cohen [Wed, 23 Sep 2020 11:47:15 +0000 (19:47 +0800)]
Improve mark handling in gnus nnselect
* lisp/gnus/nnselect.el (numbers-by-group,
nnselect-request-update-info, nnselect-push-info): Handle all three
mark types ('tuple, 'range, 'list) and general speedups.
* lisp/net/shr.el (shr-insert): Speed up regularising spaces --
the vast majority of the spaces are already OK, so transforming
" " to " " just takes time.
Eli Zaretskii [Tue, 22 Sep 2020 13:52:18 +0000 (16:52 +0300)]
Fix cursor display in mini-window under icomplete-mode
* src/xdisp.c (resize_mini_window): When we show only part of the
mini-window's contents, make sure the window-start position is at
the beginning of a screen line. (Bug#43519)