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).
Dmitry Gutov [Mon, 16 Aug 2021 00:13:30 +0000 (03:13 +0300)]
Fix regressions in the last change
* lisp/vc/vc-git.el (vc-git-register):
Use file names verbatim with 'git update-index', as it only accepts
file names, not pathspecs (bug#39452).
* lisp/vc/vc.el (vc-print-root-log):
Expand ROOTDIR, so that vc-git-print-log doesn't receive an
abbreviated name. Literal pathspecs don't work with those.
Alan Mackenzie [Sun, 15 Aug 2021 19:43:58 +0000 (19:43 +0000)]
C++ Mode: Don't confuse the pointer operator -> with the type indicating ->
This fixes bug #47468.
* lisp/progmodes/cc-engine.el (c-looking-at-inexpr-block): While searching
backwards for "->" which is a type indicating operator, disallow also commas.
Alan Mackenzie [Sun, 15 Aug 2021 18:08:25 +0000 (18:08 +0000)]
CC Mode: Fix unstable fontification of doc strings.
Also optimize a loop over several line doc-comments.
* lisp/progmodes/cc-fonts.el (c-font-lock-doc-comments): New variable
comment-mid, used as the starting point for applying c-doc-face-name in a
line comments. In block comments, apply this face not from `comment-beg' but
from `region-beg', no earlier than the start of the fontification region.
João Távora [Sun, 15 Aug 2021 12:19:59 +0000 (13:19 +0100)]
Sort by recency in flex completion style when no flexy stuff happening
Fixes: bug#49888
* minibuffer.el (completion--flex-adjust-metadata): Fall back to usual
alphanumeric, length, recency strategy if no minibuffer input. There
is still a bug indicated by the nearby FIXMEs, though.
Run execute-extended-command key binding suggestion from a timer
* lisp/simple.el (execute-extended-command): Run the key binding
suggestion from a timer instead of in the program flow -- this
allows `post-command-hook' to be executed immediately (bug#50042).
Eli Zaretskii [Sun, 15 Aug 2021 11:11:23 +0000 (14:11 +0300)]
Fix unwarranted point movement after C-g
When the same buffer is displayed in more than one window,
redisplay temporarily moves point to the window-point when it
works on non-selected windows. If we allow C-g to quit out of
redisplay_window in this situation, point will appear to have
moved to the window-point of that non-selected window, which is
unwarranted. These changes prevent quitting in strategic places,
so that we never quit out of redisplay_window.
* src/xdisp.c (run_window_scroll_functions):
Prevent quitting while running window-scroll-functions, so that we
don't quit out of redisplay_window with temporarily moved point.
(redisplay_window): While redisplaying the mode line, prevent
quitting, to avoid exiting while point is temporarily moved.
(decode_mode_spec): Use safe_call1 instead of call1, to trap any
errors instead of letting them throw out of redisplay. (Bug#44448)
João Távora [Sun, 15 Aug 2021 08:12:23 +0000 (09:12 +0100)]
Fix bug#50063 when using icomplete-fido-kill with C-x p p
C-x p p utilizes a completion table "category" which is 'project-file'
icomplete-fido-kill only functioned for 'buffer' and 'file', and
failed with a non-informative message when something else was used.
* lisp/icomplete.el (icomplete-fido-kill): Support 'project-file'
class. Use cl-case, instead of pcase.
* lisp/emacs-lisp/map.el: Bump version to 3.1.
(map--merge): New merging subroutine that uses a hash table in place
of lists, for both efficiency and avoiding ambiguities (bug#49848).
(map-merge): Rewrite in terms of map--merge.
(map-merge-with): Ditto. This ensures that FUNCTION is called
whenever two keys are merged, even if they are not eql (which could
happen until now). It also makes map-merge-with consistent with
map-merge, thus achieving greater overall predictability.
* etc/NEWS: Announce this weakening of guarantees.
* test/lisp/emacs-lisp/map-tests.el (test-map-merge)
(test-map-merge-with): Don't depend on specific orderings. Test
that nil is correctly merged into a plist.
This face is intended for mark-up syntax and constructs inside text
using font-lock-doc-face; ie, documentation comments and strings in
programming modes.
* lisp/font-lock.el (font-lock-doc-markup-face): New face.
* lisp/cus-theme.el (custom-theme--listed-faces): Add it to the list.
* doc/lispref/modes.texi (Faces for Font Lock): Document it.
* etc/NEWS: Mention it.
Alan Mackenzie [Fri, 13 Aug 2021 20:58:30 +0000 (20:58 +0000)]
CC Mode: Fix a bug in yesterday's patch
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Check
the language has multi-line strings before calling
c-ml-string-opener-at-or-around-point.
Unknown line endings in filepos-to-bufferpos/bufferpos-to-linepos
* lisp/international/mule-util.el (filepos-to-bufferpos): Give
better errors on `exact' with unknown line endings, and guess at
Unix if `approximate' (bug#36573).
(bufferpos-to-filepos): Ditto.
(tab-bar-format-history): Don't use this recently added variable
because now it's possible to customize the option 'tab-bar-format'
to remove 'tab-bar-format-history' from it that gives the same result.
Juri Linkov [Fri, 13 Aug 2021 07:10:29 +0000 (10:10 +0300)]
Add save-some-buffers-root to save-some-buffers-default-predicate (bug#46374)
* lisp/files.el (save-some-buffers-default-predicate): Add choice
'save-some-buffers-root'.
(save-some-buffers-root): New predicate function.
(save-some-buffers): Check if 'pred' returns a lexically-bound lambda,
then use it as 'pred'.
Alan Mackenzie [Thu, 12 Aug 2021 19:04:28 +0000 (19:04 +0000)]
CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language
* lisp/progmodes/cc-defs.el (cadar, caddr, cdddr): Add defsubsts for these for
when they are missing from the host Emacs.
(c-point): Add new `position' 'boll "beginning of logical line".
(c-clear-char-properties): Return the position of the lowest removed
property.
* lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Fix for rare case where
LIMIT < START in parse-partial-sexp.
(c-old-beg-rs, c-old-end-rs, c-raw-string-end-delim-disrupted)
(c-raw-string-pos, c-raw-string-in-end-delim, c-depropertize-raw-string)
(c-depropertize-raw-strings-in-region, c-before-change-check-raw-strings)
(c-propertize-raw-string-id, c-propertize-raw-string-opener): Old functions
and variables removed or renamed "raw" -> "ml" and adapted.
(c-old-beg-ml, c-old-1-beg-ml, c-old-end-ml, c-beg-pos, c-end-pos)
(c-ml-string-end-delim-disrupted, c-depropertize-ml-string-delims)
(c-ml-string-delims-around-point,c-position-wrt-ml-delims)
(c-before-change-check-ml-strings, c-after-change-unmark-ml-strings)
(c-maybe-re-mark-ml-string, c-propertize-ml-string-id)
(c-propertize-ml-string-opener, c-depropertize-ml-string)
(c-depropertize-ml-strings-in-region): New functions and variables adapted and
possibly renamed from "raw" -> "ml".
(c-ml-string-make-closer-re, c-ml-string-make-opener-re)
(c-c++-make-ml-string-closer-re, c-c++-make-ml-string-opener-re)
(c-get-ml-closer, c-ml-string-opener-around-point)
(c-ml-string-opener-intersects-region, c-ml-string-opener-at-or-around-point)
(c-ml-string-back-to-neutral, c-ml-string-in-end-delim, c-neutralize-pos)
(c-neutralized-prop): New functions and variables.
* lisp/progmodes/cc-fonts.el (c-basic-matchers-before): Replace
c-font-lock-raw-strings with c-font-lock-ml-strings.
(c-font-lock-ml-strings): New function taking the place of the old
c-font-lock-ml-strings.
* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Move
c-depropertize-CPP to the second item of the C++ entry, and replace
c-before-change-check-raw-strings by c-before-change-check-ml-strings. Add a
new entry for Pike Mode.
(c-before-font-lock-functions): (Replace c-after-change-unmark-raw-strings by
c-after-change-unmark-ml-strings in the C++ entry, and add a new entry for
Pike Mode.
(c-ml-string-backslash-escapes, c-ml-string-non-punc-skip-chars)
(c-ml-string-opener-re, c-ml-string-max-opener-len, c-ml-string-any-closer-re)
(c-ml-string-max-closer-len, c-ml-string-max-closer-len-no-leader)
(c-ml-string-back-closer-re, c-make-ml-string-closer-re-function)
(c-make-ml-string-opener-re-function, c-ml-string-cpp-or-opener-re)
(c-cpp-or-ml-match-offset): New c-lang-defconsts and c-land-defvars.
(c-multiline-string-start-char): Remove the Pike Mode setting.
* lisp/progmodes/cc-mode.el (c-depropertize-CPP): Test for general ml strings
rather than C++ raw strings.
(c-unescaped-nls-in-string-p): Handle languages with ml strings.
(c-clear-string-fences): Fix bug with wrong parenthesisation.
(c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings, c-after-change-escape-NL-in-string):
Adapt for multi-line strings.
Michael Albinus [Thu, 12 Aug 2021 18:09:48 +0000 (20:09 +0200)]
Improve connection type `pipe' for remote processes
* doc/misc/tramp.texi (Remote processes): New subsection "Remote
process connection type".
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Use `tramp-process-connection-type' as default connection type.
Improve check for `:connection-type'.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Use `tramp-process-connection-type' as default connection type.
Improve check for `:connection-type'. Send "stty -icrnl" when
connection type is a pipe.
* lisp/net/tramp.el (tramp-process-connection-type): Allow all
possible values.
(tramp-handle-make-process): Use `tramp-process-connection-type'
as default connection type. Improve check for `:connection-type'.
* lisp/startup.el (normal-top-level): Make startup more robust --
we may not be allowed to create any directories when running under
test mode (bug#48350).
Allow using XLFD font names with dashes in the family name
* src/font.c (font_parse_xlfd_1): Rename from font_parse_xlfd to
allow calling twice from a wrapper (bug#35816).
(font_parse_xlfd): Wrapper function -- first try to parse in the
normal way, and then try to guess that the hyphenated bits are in
the family name.