1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Merge from savannah/emacs-30

1b80bc67aa ; * doc/emacs/android.texi (Android Software): Minor mark...
dcfbf7d186 ; * etc/PROBLEMS: Document the same problem here.
b09bbf22af Document requirements respecting XDG MIME databases on An...
365a91622e ; (completion-preview--try-table): Propagate extra proper...

# Conflicts:
#	lisp/completion-preview.el
This commit is contained in:
Po Lu 2025-03-04 14:32:48 +08:00
commit fe7a8c92be
4 changed files with 66 additions and 0 deletions

View file

@ -1203,3 +1203,45 @@ installation within Emacs's home directory.
In addition to the projects mentioned above, statically linked In addition to the projects mentioned above, statically linked
binaries for most Linux kernel-based systems can also be run on binaries for most Linux kernel-based systems can also be run on
Android. Android.
@cindex XDG MIME database, Android
@cindex displaying SVG images with embeds, Android
Emacs can be configured with support for viewing SVG image files by
means of the @code{librsvg} library. In SVG files, there may be
references to other images on the file-system, whose format
@code{librsvg} cannot detect by default, and which will be rendered as
blank squares unless an XDG-compliant @dfn{MIME database} is installed
into the directory @file{.local/share/mime} within your home directory.
As the XDG @code{shared-mime-info} tools must be available to generate
such a database, it is recommended to produce this database in a
temporary directory on a GNU/Linux or Unix system, before transferring
the same to the recipient Android device. With the latest release of
@code{shared-mime-info} installed, create a temporary directory in which
to generate the MIME database, copy the default
@file{freedesktop.org.in} MIME catalog to a directory named
@file{packages}, and execute @code{update-mime-info} to generate the
database:
@example
$ mkdir -p my-mime-database/packages
$ cp /usr/share/mime/packages/freedesktop.org.xml my-mime-database/packages
$ update-mime-info my-mime-database
@end example
This may print a series of notices stating that the MIME database
specified is not in the search path on your host system, which are of no
consequence. Proceed by transferring the contents of the MIME database
to the recipient system, e.g., to
@file{/sdcard/Download/my-mime-database.tar.gz}:
@example
$ cd; mkdir -p .local/share
$ tar xfz /sdcard/Download/my-mime-database.tar.gz
$ mv my-mime-database .local/share/mime
$ rm /sdcard/Download/my-mime-database.tar.gz
@end example
If your Emacs session has already attempted to display an SVG image with
embeds, Emacs must be restarted before the new MIME database will enter
into effect.

View file

@ -3830,6 +3830,16 @@ executing:
$ adb shell appops set --uid org.gnu.emacs MANAGE_EXTERNAL_STORAGE allow $ adb shell appops set --uid org.gnu.emacs MANAGE_EXTERNAL_STORAGE allow
** Images embedded in SVG files are invisible.
This is a product of librsvg's failing to locate a suitable MIME
database enabling it automatically to detect image file formats. The
procedure by which to obtain such a database is documented in the node
'(emacs)Android Software' in the Emacs manual; you may also download a
pre-compiled MIME database from this SourceForge repository:
https://sourceforge.net/projects/android-ports-for-gnu-emacs/files/mime-database.tar.gz/download
* Build-time problems * Build-time problems
** Configuration ** Configuration

View file

@ -473,6 +473,7 @@ candidates or if there are multiple matching completions and
(let* ((pred (plist-get props :predicate)) (let* ((pred (plist-get props :predicate))
(string (buffer-substring beg end)) (string (buffer-substring beg end))
(completion-ignore-case completion-preview-ignore-case) (completion-ignore-case completion-preview-ignore-case)
(completion-extra-properties props)
(md (completion-metadata string table pred)) (md (completion-metadata string table pred))
(sort-fn (or (completion-metadata-get md 'cycle-sort-function) (sort-fn (or (completion-metadata-get md 'cycle-sort-function)
(completion-metadata-get md 'display-sort-function) (completion-metadata-get md 'display-sort-function)

View file

@ -445,4 +445,17 @@ instead."
(should (string= (buffer-string) "foobar")) (should (string= (buffer-string) "foobar"))
(should (eq (get-text-property 6 'prop) 'val)))) (should (eq (get-text-property 6 'prop) 'val))))
(ert-deftest completion-preview-propagates-properties ()
"Test the completion metadata handling of Completion Preview mode."
(with-temp-buffer
(setq-local
completion-preview-sort-function #'minibuffer-sort-alphabetically
completion-at-point-functions
(list (completion-preview-tests--capf '("foobaz" "foobar")
:display-sort-function #'identity)))
(insert "foo")
(let ((this-command 'self-insert-command))
(completion-preview--post-command))
(completion-preview-tests--check-preview "baz" 'completion-preview-common)))
;;; completion-preview-tests.el ends here ;;; completion-preview-tests.el ends here