* lisp/emacs-lisp/pp.el (pp-max-width, pp-use-max-width): New user
options (bug#11934).
(pp-to-string): Use it.
(pp--insert-lisp): Tweak whether to use standard-output or not.
(pp--max-width): New function.
Eli Zaretskii [Fri, 5 Nov 2021 13:47:00 +0000 (15:47 +0200)]
; Fix doc strings of a recent commit
* lisp/image-dired.el (image-dired-gallery-image-root-url)
(image-dired-gallery-thumb-image-root-url)
(image-dired-gallery-dir): Don't use "path" for file names and
URLs.
Eli Zaretskii [Fri, 5 Nov 2021 13:40:37 +0000 (15:40 +0200)]
Enhance 'highlight-confusing-reorderings'
* lisp/international/mule-cmds.el (confusingly-reordered): Make
sure the face looks distinct on displays that don't support the
"wavy" underline attribute.
(highlight-confusing-reorderings): Add a tooltip explaining why
the text was highlighted. Allow to remove the highlighting by
invoking the command with a prefix argument.
Carlos Pita [Thu, 14 Oct 2021 00:09:40 +0000 (21:09 -0300)]
Match dummy output even with non-default rl config
* lisp/progmodes/python.el
(python-shell-completion-native-get-completions): Match dummy output
even when readline is configured in non-default ways. (Bug#51010)
Fix 'diff-font-lock-prettify' breaking display of outline headers
* lisp/vc/diff-mode.el (diff-outline-level): Make hunk headers be
at level 2.
(diff-mode): Use prettified line as outline header.
(diff--outline-level): New function (bug#51016).
* lisp/vc/vc.el (vc-diff-internal): Fix diff mode being set before
content inserted (bug#51016).
Daniel Martín [Sat, 9 Oct 2021 19:10:20 +0000 (21:10 +0200)]
Fix buffer overflow in ns_compute_glyph_string_overhangs
* src/nsterm.m (ns_compute_glyph_string_overhangs): When the first
glyph of a glyph string is a composite glyph, `s->nchars' is 0, so
"s->char2b + s->nchars - 1" dereferenced a position before buffer
`s->char2b'. Instead, rewrite part of the function to distinguish
between character glyphs and composite glyphs. For character glyphs,
calculate the font metrics using the `text_extents' function, passing
it the entire glyph string; for composite glyphs, call
`composition_gstring_width'. (Bug#51105)
Stefan Kangas [Fri, 5 Nov 2021 00:06:38 +0000 (01:06 +0100)]
image-dired: Delete commented out code
* lisp/image-dired.el: Delete broken and commented out speedbar code;
it is not clear what, if anything, it is supposed to do. If anyone
wants to work on this, they are better off starting from scratch.
Stefan Kangas [Thu, 4 Nov 2021 23:47:00 +0000 (00:47 +0100)]
image-dired: New defgroup and section for gallery support
* lisp/image-dired.el: Add new section header "Gallery support" to
improve file organization. Move relevant TODO:s there.
(image-dired-gallery): New defgroup.
(image-dired-gallery-dir, image-dired-gallery-image-root-url)
(image-dired-gallery-thumb-image-root-url)
(image-dired-gallery-hidden-tags): Add options to above new defgroup.
(image-dired-add-to-file-comment-list)
(image-dired-create-gallery-lists)
(image-dired-add-to-tag-file-lists, image-dired-hidden-p): Rename to...
(image-dired--add-to-file-comment-list)
(image-dired--create-gallery-lists)
(image-dired--add-to-tag-file-lists, image-dired--hidden-p):
...this, to make it more clear that these functions are internal.
Make the old names obsolete function aliases.
(image-dired-add-to-tag-file-list): Make unused function obsolete.
New emacsclient option to either create or reuse an existing frame.
* doc/emacs/misc.texi (emacsclient Options): Document the new option.
* doc/man/emacsclient.1: Mention the new option (bug#51374).
* etc/NEWS: Mention the new option.
* lib-src/emacsclient.c (reuse_frame): New variable.
(longopts): New option.
(decode_options): Decode the new option.
(print_help_and_exit): Document the new option.
(main): Use the new option.
Eli Zaretskii [Thu, 4 Nov 2021 18:33:26 +0000 (20:33 +0200)]
Better detection of potentially malicious bidi text
* src/bidi.c (bidi_find_first_overridden): Extend to detect more
subtle effects of directional formatting controls, to include
embeddings and isolates.
* src/xdisp.c (Fbidi_find_overridden_directionality): Accept an
additional argument BASE-DIR to specify the base direction of the
paragraphs.
* lisp/international/mule-cmds.el (confusingly-reordered): New
face.
(reorder-starters, reorder-enders): New variables.
(highlight-confusing-reorderings): New command to detect and
highlight suspiciously reordered text.
* test/src/xdisp-tests.el
(xdisp-tests--find-directional-overrides): New test.
* etc/NEWS: Announce the new and improved features.
* etc/tutorials/TUTORIAL.he: Fix embeddings with incorrect
directions.
* doc/misc/gnus.texi (Article Display): Document it.
* lisp/gnus/gnus-art.el (gnus-treat-emojize-symbols): New user option.
(gnus-treatment-function-alist): Map.
(article-emojize-symbols): New command and keystroke.
Stefan Kangas [Thu, 4 Nov 2021 01:05:29 +0000 (02:05 +0100)]
Make image-dired-display-image-mode inherit from image-mode
* lisp/image-dired.el (image-dired-display-image-mode):
Inherit from 'image-mode'. (Bug#10758)
(image-dired-display-image): Don't generate a temporary image, which
is no longer needed with the above change.
(image-dired-display-thumbnail-original-image)
(image-dired-dired-display-image)
(image-dired-mouse-display-image): Simplify.
(image-dired-temp-image-file)
(image-dired-cmd-create-temp-image-program)
(image-dired-cmd-create-temp-image-options)
(image-dired-display-window-width-correction)
(image-dired-display-window-height-correction)
(image-dired-display-window-width)
(image-dired-display-window-height)
(image-dired-display-current-image-full)
(image-dired-display-current-image-sized)
(image-dired-window-height-pixels): Make obsolete.
(image-dired-create-display-image-buffer): Make into obsolete
function alias for 'ignore'.
(image-dired-display-image-mode-map): Simplify by removing things
duplicated from `image-mode-map'. Disable some commands from
`image-mode-map' that doesn't make sense for Image-Dired.
(image-dired-display-image-mode-menu): Remove menu, as it no longer
contains anything useful.
(image-dired-minor-mode):
* doc/emacs/dired.texi (Image-Dired): Update documentation for the
above change.
Stefan Kangas [Wed, 3 Nov 2021 21:34:51 +0000 (22:34 +0100)]
image-dired: Add face for flagged files
* lisp/image-dired.el (image-dired-thumb-mark): New defface.
(image-dired-thumb-update-marks): Mark flagged file with above new defface.
(image-dired-dired-file-marked-p)
(image-dired-thumb-file-marked-p): Add optional argument to be
used by 'image-dired-*-flagged-p' functions below.
(image-dired-dired-file-flagged-p)
(image-dired-thumb-file-flagged-p): New defuns.
(image-dired-thumb-mark): Improve definition with color classes.
(image-dired-thumb-visible-marks): Doc fix.
Eli Zaretskii [Wed, 3 Nov 2021 18:50:34 +0000 (20:50 +0200)]
Fix encoding issues in gitmerge.el, make it work on MS-Windows
* admin/gitmerge.el (gitmerge-emacs-version, gitmerge-show-log)
(gitmerge-show-diff, gitmerge-show-files, gitmerge-missing)
(gitmerge-setup-log-buffer, gitmerge-resolve)
(gitmerge-commit-message, gitmerge-apply)
(gitmerge-resolve-unmerged, gitmerge-repo-clean)
(gitmerge-commit): Bind coding-system-for-read/write to the
appropriate vc-git values.
(gitmerge-apply) [windows-nt]: Pass long merge log messages via a
temporary file.
(gitmerge): Clarify the description of the "R" flag.
Eli Zaretskii [Wed, 3 Nov 2021 18:26:28 +0000 (20:26 +0200)]
Merge from origin/emacs-28
3e4eb54 ; * etc/PROBLEMS: Minor copyedits of the last change. (Bug#5... 35bc211 Document a macOS error message when opening Emacs 4df9998 Fix header-line and tab-line when mode-line-compact is set 81915a9 Add manual section about how to avoid regexp problems a16e66c Clarify build environment 6ab6b2f Clarify build directory structure 9d61620 * src/pdumper.c (dump_do_dump_relocation): Add sanity check.
Eli Zaretskii [Wed, 3 Nov 2021 14:13:32 +0000 (16:13 +0200)]
A better fix for bug#51583
* src/w32.c (w32_get_resource): Move from here...
* src/w32fns.c (w32_get_resource): ...to here.
(w32_applytheme): No longer a no-op for Cygwin w32 builds.
(globals_of_w32fns): Do attempt to load dwmapi.dll and uxtheme.dll
in the Cygwin w32 build.
Eli Zaretskii [Wed, 3 Nov 2021 14:02:15 +0000 (16:02 +0200)]
Fix the Cygwin w32 build broken by adding the dark theme support
* src/w32fns.c (w32_applytheme): Make a no-op for Cygwin w32
builds.
(globals_of_w32fns): Don't attempt to load dwmapi.dll and
uxtheme.dll in the Cygwin w32 build. (Bug#51583)
Stefan Kangas [Wed, 3 Nov 2021 06:14:21 +0000 (07:14 +0100)]
image-dired: Improve marking behavior
* lisp/image-dired.el (image-dired-thumb-mark): Use DarkOrange as
background to better match the 'dired-marked' face.
(image-dired-show-all-from-dir): Disable all marks when entering a
full directory.
(image-dired-unmark-all-marks): Add mode tag.
(image-dired-thumbnail-mode-map): Bind 'image-dired-unmark-all-marks'
to "U".
Stefan Kangas [Wed, 3 Nov 2021 06:02:13 +0000 (07:02 +0100)]
image-dired: Cleanup of four commands
* lisp/image-dired.el
(image-dired--on-file-in-dired-buffer): New macro.
(image-dired-mark-thumb-original-file)
(image-dired-unmark-thumb-original-file)
(image-dired-flag-thumb-original-file)
(image-dired-toggle-mark-thumb-original-file): Rewrite using
above new macro.
(image-dired-modify-mark-on-thumb-original-file): Make obsolete in
favor of above new macro.
Stefan Kangas [Wed, 3 Nov 2021 02:34:28 +0000 (03:34 +0100)]
image-dired: Support wrap-around in display-next-thumbnail-original
* lisp/image-dired.el (image-dired-forward-image): Support negative
prefix argument. Optionally wrap-around, which means to continue from
first image after reaching the last one and vice versa.
(image-dired-backward-image): Reimplement in terms of
'image-dired-forward-image'.
(image-dired-display-next-thumbnail-original)
(image-dired-display-previous-thumbnail-original): Wrap around; when
reaching the last image, continue from the first one. Add optional
prefix argument to move more than one image at a time.
Stefan Kangas [Wed, 3 Nov 2021 01:39:00 +0000 (02:39 +0100)]
image-dired: Move menu definitions to top level
* lisp/image-dired.el (image-dired-thumbnail-mode-map)
(image-dired-display-image-mode-map, image-dired-minor-mode-map):
Move menu definitions from here...
(image-dired-thumbnail-mode-menu)
(image-dired-display-image-mode-menu)
(image-dired-minor-mode-menu): ...to these new top level
definitions.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-cond):
Optimise clause-free `cond`, which can arise from earlier
transformations. This enables further optimisations.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
Stefan Kangas [Tue, 2 Nov 2021 19:14:13 +0000 (20:14 +0100)]
Use current face foreground for SVG icons in customize
* etc/images/down.svg:
* etc/images/left.svg:
* etc/images/right.svg:
* etc/images/up.svg: Don't define foreground; this means they will use
the foreground of the currently defined face instead. (Bug#51556)
Stefan Kangas [Tue, 2 Nov 2021 16:33:35 +0000 (17:33 +0100)]
Support inserting images in tabulated-list-mode columns
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col):
Support using an image descriptor to insert an image in a column.
(tabulated-list-entries):
* doc/lispref/modes.texi (Tabulated List Mode): Update documentation
to reflect above change.
Make `C-h b' indentation more regular (and avoid continuation lines)
* lisp/help.el (help--describe-command): Don't do any indentation.
(describe-map): Store data about each section.
(describe-map--align-section): New function to do indentation on a
per-block basis.
(describe-map--fill-columns): Helper function.
* lisp/help.el (help--describe-translation): Make obsolete.
(help--describe-command): Take an optional parameter to output key
translations.
(describe-map): Make optional parameters optional.
Add buttons to definition in help--describe-command
* lisp/help-mode.el (help-make-xrefs): Don't add buttons to
keymaps, because they're pre-buttonized.
* lisp/help.el (help--describe-command): Make buttons out of the
definitions.
* doc/lispref/files.texi (File Attributes): Document it.
* lisp/files.el (file-has-changed-p): New function.
(file-has-changed-p--hash-table): Internal variable used by the
new function (bug#51523).
* lisp/emacs-lisp/shortdoc.el (file): Mention it.
* lisp/net/mailcap.el (mailcap-parse-mailcaps): Read mailcaps again
only when at least one of the mailcap files has changed. Fixes
bug#51523.