Boruch Baum [Wed, 5 May 2021 13:05:50 +0000 (15:05 +0200)]
Fix error in ses.el when setting the current row
* lisp/ses.el (ses-jump, ses-list-local-printers)
(ses-list-named-cells): Use `user-error' for user errors.
(ses-set-header-row): Function `ses-set-header-row' was
determining the current row based upon variable `ses--curcell',
but that variable is NIL until one begins an operation on a cell
(eg. keybindings '=', '"'), so navigating to a row was
insufficient to select that row, and further generated an ERROR
because the code was not expecting a NIL value for variable
`ses--curcell' (bug#47784).
Martin Rudalics [Wed, 5 May 2021 08:26:32 +0000 (10:26 +0200)]
Fix two GTK3 event handling issues
* src/xterm.c (handle_one_xevent): For GTK3 PropertyNotify and
MapNotify events explicitly request the stored frame sizes when
the frame changes from iconified to a non-hidden state
(Bug#24526). For Expose events do not change the frame's
visibility or iconified state. For FocusIn events on GTK3 do
not apply the fix for Bug#42655. The latter two changes are to
avoid that plain invisible frames get reported as iconified.
Eric Abrahamsen [Mon, 3 May 2021 16:14:24 +0000 (09:14 -0700)]
Add new defvoo nnimap-keepalive-intervals to Gnus nnimap servers
* lisp/gnus/nnimap.el (nnimap-keepalive-intervals): New per-server
config for customizing when keepalive commands are sent.
(nnimap-keepalive, nnimap-open-connection-1): Consult in these
places. Additionally, use nnimap-streaming -> t when sending the
keepalive NOOP, so we don't wait for the response.
* doc/misc/gnus.texi (Customizing the IMAP Connection): Document.
Eli Zaretskii [Tue, 4 May 2021 17:37:33 +0000 (20:37 +0300)]
Fix infloop in lsp-mode
* src/indent.c (line_number_display_width): Make sure the selected
window's buffer is current before using display code on it:
redisplay assumes that the window's buffer is current at all
times. Reported by Evgeny Kurnevsky via lsp-mode's issue 1621,
https://github.com/emacs-lsp/lsp-mode/issues/1621.
Glenn Morris [Tue, 4 May 2021 14:50:28 +0000 (07:50 -0700)]
; Merge from origin/emacs-27
The following commits were skipped:
6a46d3d809 (emacs-27) ; Auto-commit of loaddefs files. ccfd2e20a9 Fix GUD overlay arrows in M-x gdb when debugging over Tram... e61688f87d Fix setting breakpoints in M-x gdb for remote files. Don'...
Its only use was removed in the recent change of 2021-04-27 "Major
rewrite of adjust_frame_size", announced in the following thread:
https://lists.gnu.org/r/emacs-devel/2021-04/msg01162.html
Fix inconsistent behaviour in find-file-noselect when using nowarn
* lisp/files.el (after-find-file): Behave the same in when
warning/not warning (bug#47850). This fixes this test case:
(switch-to-buffer (find-file-noselect "non-existing-dir/test.el" t))
which would leave the buffer read-only.
Boruch Baum [Tue, 4 May 2021 08:58:52 +0000 (10:58 +0200)]
Fontify lines when setting a bookmark
* lisp/bookmark.el (bookmark-fontify): New user option (bug#48179).
(bookmark-face): New face.
(bookmark--fontify, bookmark--unfontify): New functions.
(bookmark-set-internal, bookmark--jump-via, bookmark-delete): Use
them.
Martin Rudalics [Tue, 4 May 2021 07:17:11 +0000 (09:17 +0200)]
Fix a problem with x_set_tab_bar_lines (Bug#46827)
* src/xfns.c (x_set_tab_bar_lines): Call
x_change_tab_bar_height only if the number of tab bar lines
changed from or to zero (Bug#46827).
* src/xterm.c (x_make_frame_visible): Make frame_size_history
update less noisy by doing it only if the frame wasn't visible
before.
* lisp/image.el (image-show-frame): Don't force an update if the
buffer with the animation isn't in a window (bug#47895). Also
just update the window in question.
* lisp/image.el (image-animate): Only compute the animation data
once -- this avoids recomputing the image on every iteration when
the image is not displayed (bug#47895).
Steve Purcell [Mon, 3 May 2021 07:41:44 +0000 (09:41 +0200)]
ruby-mode.el: puts and printf do not require args
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): puts and
printf can be called without arguments, so the font locking of
"bare" calls to either is incorrect. The fix is to font-lock them
as for other kernel methods which accepts zero or more arguments
(bug#48180).
Lele Gaifax [Mon, 3 May 2021 07:37:38 +0000 (09:37 +0200)]
Align TUTORIAL.it to the English version
* etc/tutorials/TUTORIAL.it: Reference 'describe-command' to replicate
recent change. Add also a space before '<Invio>' in several places,
mimicking the usage of <Return> in the English version (bug#48183).
Stefan Kangas [Sun, 2 May 2021 13:04:00 +0000 (15:04 +0200)]
Add new help command 'describe-command'
* lisp/help-fns.el (describe-command): New command.
(help-fns--describe-function-or-command-prompt): New helper
function to prompt for a function or function. (Bug#46627)
(describe-function): Use above new helper function.
* lisp/help.el (help-map): Bind above new command to `C-h x'.
(help-for-help): Add this new command to the help summary.
* lisp/menu-bar.el (menu-bar-describe-menu): Add the new command to
the help menu.
* doc/emacs/help.texi (Help Summary, Name Help): Document
'describe-command', and update documentation on 'describe-function'.
* etc/tutorials/TUTORIAL: Change reference from 'describe-function' to
'describe-command'.
Alan Third [Sun, 2 May 2021 10:25:40 +0000 (11:25 +0100)]
Fix crash when resizing GNUstep builds
The toolkit can send far too many resize notifications, so be more
careful when we take action after receiving one.
* src/nsfns.m (ns_set_tool_bar_lines): Remove unneeded NSTRACE.
* src/nsterm.m ([EmacsView viewDidResize:]): Don't report resizes to
Emacs when the same change has already been reported and delayed.
Martin Rudalics [Sun, 2 May 2021 08:33:22 +0000 (10:33 +0200)]
Make adjust_frame_size set up frame's new_width/_height too (Bug#17120)
The purpose of this change is to have implied frame size changes
pick up sizes requested by previous explicit size changes not
only after they have been confirmed by the WM but already when
they are initially passed to adjust_frame_size (Bug#17120).
* src/dispextern.h (delayed_size_change): Remove extern.
* src/dispnew.c (delayed_size_change): Make static again.
(do_pending_window_change): Call change_frame_size only if F's
new_size_p flag is set.
(change_frame_size_1): Set/reset F's new_size_p flag
* src/frame.c (adjust_frame_size): Remove extra
inhibit_horizontal/_vertical checks. Improve the implied
resizes check with INHIBIT equals 2. Set F's new_width and
new_height and reset F's new_size_p flag when we run
set_window_size_hook with INHIBIT 0 or 1.
* src/frame.h (struct frame): New bit slot new_size_p.
* src/gtkutil.c (xg_frame_resized): Use F's new_size_p flag
instead of delayed_size_change to decide whether to call
change_frame_size.
(xg_frame_set_char_size): Call frame_size_history_extra before
waiting for the ConfigureNotify event.
* src/xterm.c (handle_one_xevent): Use F's new_size_p flag
instead of delayed_size_change to decide whether to call
change_frame_size.
Boruch Baum [Sun, 2 May 2021 08:22:21 +0000 (10:22 +0200)]
Suppress false positives in apropos-value
* lisp/apropos.el (apropos-value): Skip more apropos-internal
variables (bug#48063).
(apropos-value-internal): Skip the first value in the history
values, which always contains the match.
Set `minibuffer-completion-*` variables buffer-locally instead of using
a global let-binding. This should also help make completion work
correctly when multiple minibuffers are simultaneously active.
Eli Zaretskii [Fri, 30 Apr 2021 11:22:29 +0000 (14:22 +0300)]
Fix the unexec build on MS-Windows
* src/buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: If dumped
with unexec, be sure to map new memory also for the " prin1"
buffer. For the reasons and discussion, see
https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg01401.html.
Eli Zaretskii [Fri, 30 Apr 2021 07:28:50 +0000 (10:28 +0300)]
Improve support for 'display-line-numbers-width-start'
* lisp/display-line-numbers.el (display-line-numbers-width-start):
Allow the value to be a number. (Bug#48095)
(display-line-numbers-mode): Handle
'display-line-numbers-width-start' whose value is a number.
* lisp/net/tramp.el: Reload `tramp-compat' when we reload
`tramp-autoloads'.
(with-tramp-file-property, with-tramp-connection-property):
Use `tramp-cache-undefined'.
(tramp-autoload-file-name-handler): Do not load tramp-compat.el.
(tramp-handle-insert-file-contents): Code cleanup.
Eli Zaretskii [Wed, 28 Apr 2021 16:36:42 +0000 (19:36 +0300)]
Doc fixes in avl-tree.el
* lisp/emacs-lisp/avl-tree.el (avl-tree--root)
(avl-tree--dir-to-sign, avl-tree--sign-to-dir)
(avl-tree--del-balance, avl-tree--enter-balance)
(avl-tree--do-copy, avl-tree--stack-repopulate, avl-tree-empty)
(avl-tree-delete, avl-tree-member, avl-tree-member-p)
(avl-tree-map, avl-tree-mapc, avl-tree-mapf, avl-tree-mapcar)
(avl-tree-copy, avl-tree-clear, avl-tree-stack)
(avl-tree-stack-first): Fix doc strings to be less verbose and to
have the first line a complete sentence.
Peter Oliver [Wed, 28 Apr 2021 02:18:40 +0000 (05:18 +0300)]
Add tests
* test/lisp/progmodes/ruby-mode-tests.el (ruby-with-temp-file): New helper.
(ruby--set-encoding-when-ascii, ruby--set-encoding-when-utf8)
(ruby--set-encoding-when-latin-15): Tests for the previous commit (bug#48043).
Don't add magic comment to Ruby files for utf-8 encoding
* lisp/progmodes/ruby-mode.el (ruby-encoding-map):
Add entry for utf-8 (bug#48043).
(ruby--detect-encoding): Don't convert to string too early, so
that returning nil is meaningful.
(ruby-mode-set-encoding): Convert to string here.
Andrea Corallo [Tue, 27 Apr 2021 20:43:12 +0000 (22:43 +0200)]
Have `comp-cstr-intersection-no-mem' intersect pos neg value sets
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
intersect pos and neg value sets
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests and fix some
test number.
Stefan Kangas [Tue, 27 Apr 2021 20:53:04 +0000 (22:53 +0200)]
Avoid missing whitespace in help-for-help
* lisp/help.el (help--for-help-make-commands): Avoid missing
whitespace before description of command.
Problem reported by Dmitry Gutov <dgutov@yandex.ru>.
Daniel Mendler [Tue, 27 Apr 2021 16:44:41 +0000 (19:44 +0300)]
(affixation-function): Allow only three-element list elements
Restrict the definition of the `affixation-function`. The function
must return a list of three element lists. Since the
`affixation-function` is part of the widely used `completing-read` API
a simplification is helpful for both authors of completion UIs and
authors of completion tables.
Calc: control digits after decimal point (bug#47302)
Calc normally displays a trailing decimal point for floats with no
fractional part, like '12.'. Some uses require at least one digit
after the point; add the governing variable calc-digit-after-point.
* lisp/calc/calc.el (calc-digit-after-point): New variable.
(math-format-number): Use it.
* test/lisp/calc/calc-tests.el (calc-display-digit-after-point):
New test.