Alan Third [Sat, 21 Aug 2021 12:09:37 +0000 (13:09 +0100)]
Fix display bug on macOS (bug#50112)
* src/nsterm.m ([EmacsLayer initWithColorSpace:]): Use the colorspace
setter.
([EmacsLayer setColorSpace:]): Sometimes we seem to get null
colorspaces, so set a default in this case.
([EmacsLayer getContext]): Check whether there's been a surface or
graphics context allocation failure and log it.
The new entry appears next to "Find Definition" and like it only
appears when the context menu was invoked on an identifier.
* lisp/progmodes/prog-mode.el (prog-context-menu): New menu entry.
* lisp/progmodes/xref.el (xref-find-references-at-mouse): New
function, analogous to `xref-find-definitions-at-mouse`.
Indicate progress while searching for references in xref
* lisp/progmodes/xref.el (xref-backend-references): Add messages to
show the user that something is happening instead of silently freezing
during the frequently long synchronous searches for references.
Re-type the :location slot in `xref-match-item` to `xref-location`
* lisp/progmodes/xref.el (xref-match-item): Change type for
:location from `xref-file-location`, which was likely a mistake,
to `xref-location`. This allows `xref-make-match` to take
arguments of any subtype of `xref-location` (bug#50067).
Add xref operations to context menu unconditionally
* lisp/progmodes/prog-mode.el (prog-context-menu):
Add xref operations to the context menu even if xref hasn't been
loaded yet; the functions involved are autoloaded (bug#50067).
Eli Zaretskii [Sat, 21 Aug 2021 08:49:56 +0000 (11:49 +0300)]
Improve documentation of context menus
* doc/lispref/modes.texi (Major Mode Conventions): Add conventions
of setting menu-bar menus and context menus for a major mode.
* doc/emacs/frames.texi (Menu Mouse Clicks): Fix description of
context menu functionality.
Dmitry Gutov [Sat, 21 Aug 2021 02:26:12 +0000 (05:26 +0300)]
Speed up project--read-project-buffer in remote buffers
* lisp/progmodes/project.el (project-buffers): New generic function.
(project--read-project-buffer): Use it here (bug#49264).
(project--buffers-to-kill): And here.
(project-buffers): Specialized implementation for vc-project.
Alan Mackenzie [Fri, 20 Aug 2021 21:12:37 +0000 (21:12 +0000)]
Fix c-tentative-buffer-changes to be nestable in c-save-buffer-state
* lisp/progmodes/cc-defs.el (c-tentative-buffer-changes)
(c-tnt-chng-record-state, c-tnt-chng-cleanup): Enhance such that a
buffer-undo-list of t is handled specially, so that a nil isn't consed onto
it. Thus garbage collection can't later remove the (nil . t) from the end of
the buffer-undo-list, causing an infinite loop.
Allow preserving symlinks with file-precious-flag set
* doc/lispref/files.texi (Saving Buffers): Document it.
* lisp/files.el (file-preserve-symlinks-on-save): New user option
(bug#18125).
(basic-save-buffer-2): Use it.
* lisp/simple.el (execute-extended-command): Move finding the
short command to the timer command, too (bug#50042). This further
ensures that post-command-hook is run faster.
Remove even more waiting from execute-extended-command
* lisp/simple.el (execute-extended-command): Remove all the
waiting from the command and do it all with timers (bug#50042).
This ensures that post-command-hook is run immediately also when
the command has messaged something.
The Mac platform convention is to use control-left-click for context
menus (as a synonym to right-click).
* lisp/mouse.el (context-menu--old-bindings): Remove.
(context-menu--saved-bindings)
(context-menu--bind-mouse, context-menu--reset-bindings): New.
(context-menu-mode): Use new functions, with C-mouse-1 as extra
binding on NS.
Fix xref {prev,next}-error target buffer match highlighting extent
* lisp/progmodes/xref.el (xref--next-error-function):
Bind `xref--current-item` during the call to `xref--show-location` so
that `xref-pulse-momentarily` finds the match extent.
João Távora [Thu, 19 Aug 2021 22:54:51 +0000 (23:54 +0100)]
Make icomplete-forward-completions O(1) when icomplete-scroll is t
In particular, this makes the recently added
icomplete-vertical-goto-last (bug#49005) be O(n) instead of O(n^2).
That used to be almost unbearably slow for large n.
* lisp/icomplete.el (icomplete-forward-completions): don't call last
unless needed.
* lisp/calendar/appt.el (appt-check): Add space at the end
(bug#18164) -- all `global-mode-string' elements should have it
there to get an even space distribution.
Peter Münster [Wed, 18 Aug 2021 09:21:51 +0000 (11:21 +0200)]
Add support for history of image tags and completion in the minibuffer
* lisp/image-dired.el (image-dired-tag-history): New variable holding the
tag history.
(image-dired-tag-files, image-dired-tag-thumbnail, image-dired-delete-tag)
(image-dired-tag-thumbnail-remove): Use it for the user input.
Peter Münster [Tue, 17 Aug 2021 23:37:43 +0000 (01:37 +0200)]
New placement of newline characters in image-dired-db-file
It's more usual to have the newline at the end of the line, instead of the
beginning. This change avoids missing newline at the end of the file, an
empty line at the start and eventually a lot of empty lines when
`require-final-newline' is not nil.
* lisp/image-dired.el (image-dired-write-tags): Insert newline at the end
of the line, instead of the beginning.
(image-dired-remove-tag): Do not delete empty line at end of buffer.
Eli Zaretskii [Thu, 19 Aug 2021 12:44:55 +0000 (15:44 +0300)]
Fix inaccuracies in documentation of 'message-truncate-lines'
* doc/lispref/display.texi (Echo Area Customization):
* src/xdisp.c (syms_of_xdisp): Adjust the documentation of
message-truncate-lines to changes that fixed bug#46718.
João Távora [Wed, 18 Aug 2021 23:48:26 +0000 (00:48 +0100)]
Section by 'group-function' in Icomplete and Fido's vertical modes
Fixes: bug#48545
* lisp/icomplete.el (icomplete--augment): Rewrite from icomplete--affixate.
(icomplete--render-vertical): Rework.
(icomplete--vertical-minibuffer-setup): Separator is hardcoded "\n", no
need to set.
João Távora [Thu, 19 Aug 2021 10:04:37 +0000 (11:04 +0100)]
Improve fix of bug#49888 on no-pattern flex sorting
This version is functionally equivalent, but doesn't duplicate any
code. When nothing "flexy" is happening, it works by simply not doing
any metadata adjustments, instead of attempting to synthesize a
function to mimic the non-flex case.
Juri Linkov [Wed, 18 Aug 2021 17:01:03 +0000 (20:01 +0300)]
* lisp/mouse.el: More fixes for context-menu.
(context-menu-map): Remove menu title "Context Menu" (bug#50067).
(context-menu-minor): Reverse sub-menus to display exactly in the same order
as on the menu bar.
Disable auto compositions on the Linux console only
* lisp/term/linux.el (terminal-init-linux): Disable auto
compositions on "linux" consoles (bug#21363).
* src/composite.c (inhibit_auto_composition): New function to
implement this.
(composition_compute_stop_pos, composition_adjust_point)
(Ffind_composition_internal): Use it.
(syms_of_composite): Document it.
* src/lisp.h: Export tty_type_name.
* src/term.c (tty_type_name): Factored out.
(Ftty_type): Use it.
Peter Münster [Wed, 18 Aug 2021 12:53:25 +0000 (14:53 +0200)]
Add menu bindings to new functions in image-dired.el
* lisp/image-dired.el (image-dired--with-marked): New macro for
cycling over marked thumbnails.
(image-dired-tag-thumbnail, image-dired-tag-thumbnail-remove): Can
handle now also all marked thumbnails.
(image-dired-tag-marked-thumbnails): Remove it, because it's
obsoleted by `image-dired-tag-thumbnail' now.
(image-dired-delete-marked): Use new macro
`image-dired--with-marked', and add command to menu (bug#50000).
pillule [Wed, 18 Aug 2021 07:21:06 +0000 (09:21 +0200)]
Fix ediff3 layouts with window-combination-resize non-nil (Bug#49277)
* lisp/vc/ediff-wind.el (ediff-setup-windows-plain-compare)
(ediff-setup-windows-multiframe-compare): Fix three windows
layouts produced by ediff3 when 'window-combination-resize'
was customized to t and 'even-window-sizes' to nil.
Eli Zaretskii [Tue, 17 Aug 2021 18:29:58 +0000 (21:29 +0300)]
Another fix for quitting while displaying non-selected windows
* src/xdisp.c (handle_face_prop, extend_face_to_end_of_line):
Inhibit quitting around the call to face_at_pos, to prevent
leaking wrong value of point when the user quits while we
redisplay a non-selected window. (Bug#44448)
Eli Zaretskii [Tue, 17 Aug 2021 12:31:53 +0000 (15:31 +0300)]
Fix TTY display performance degradation due to many markers
* src/coding.c (encode_coding_object): Don't assume that
src_object == dst_object means src_object is the current buffer.
Add the missing commentary that explains the arguments.
(Bug#49127)
Michalis V [Tue, 17 Aug 2021 12:20:57 +0000 (14:20 +0200)]
Improve `forward-sexp' in *Help* buffers
* lisp/help-mode.el (help-mode-syntax-table): New variable (bug#39134).
(help-make-xrefs): Use it to make picking out symbols in curved
quotes work reliably.
(help-xref-on-pp): Ditto.
João Távora [Tue, 17 Aug 2021 11:48:37 +0000 (12:48 +0100)]
Jump to first,last completion with M-<, M-> in icomplete-vertical-mode
Fixes: bug#49005 Co-authored-by: Simon Lang <simon.lang@outlook.com>
* lisp/icomplete.el (icomplete-backward-completions): Return
non-nil iff something was stepped. Ajust docstring.
(icomplete-forward-completions): Adjust docstring.
(icomplete-vertical-goto-first, icomplete-vertical-goto-last): New commands.
(icomplete-vertical-mode-minibuffer-map): Bind new commands to M-< and M->.
* src/buffer.c (overlays_in): Treat the end of the buffer and the
end of the narrowed-to buffer the same (bug#19422).
(Foverlays_in): Adjust doc string.
Minor clarification for define-minor-mode :variable
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* doc/lispref/modes.texi (Defining Minor Modes): Clarify what the
setter function should do (bug#14875).
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Remove
prettified version of `\par'. Many fonts don't display anything for
the character it was mapped to (#x2029 PARAGRAPH SEPARATOR), so
enabling prettification makes every `\par' disappear (bug#50073).