diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index 568fd8022d1..c318373536a 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -1203,3 +1203,45 @@ installation within Emacs's home directory. In addition to the projects mentioned above, statically linked binaries for most Linux kernel-based systems can also be run on 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. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index b8d00b7679e..0d61a3bc76e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3830,6 +3830,16 @@ executing: $ 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 ** Configuration diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 0119ddad1d6..8f7cba580ba 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -473,6 +473,7 @@ candidates or if there are multiple matching completions and (let* ((pred (plist-get props :predicate)) (string (buffer-substring beg end)) (completion-ignore-case completion-preview-ignore-case) + (completion-extra-properties props) (md (completion-metadata string table pred)) (sort-fn (or (completion-metadata-get md 'cycle-sort-function) (completion-metadata-get md 'display-sort-function) diff --git a/test/lisp/completion-preview-tests.el b/test/lisp/completion-preview-tests.el index 411a14a87ef..8ce2a30bb27 100644 --- a/test/lisp/completion-preview-tests.el +++ b/test/lisp/completion-preview-tests.el @@ -445,4 +445,17 @@ instead." (should (string= (buffer-string) "foobar")) (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