emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android f34d9fab892 3/3: Merge remote-tracking branch 'origin/ma


From: Po Lu
Subject: feature/android f34d9fab892 3/3: Merge remote-tracking branch 'origin/master' into feature/android
Date: Thu, 9 Mar 2023 07:01:15 -0500 (EST)

branch: feature/android
commit f34d9fab892ac06b1cd5ddbf05140502d6692754
Merge: a7f0f9498f2 26740f30469
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 etc/NEWS                  |  6 ++++++
 lisp/doc-view.el          | 19 ++++++++-----------
 lisp/image/image-dired.el | 23 +++++++++++++----------
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index f763428fe88..64cf11151b8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -226,6 +226,12 @@ bound to 'C-c C-d' in 'go-ts-mode'.
 When this is non-nil, call the 'man' program synchronously rather than
 asynchronously (which is the default behavior).
 
+** DocView
+
+---
+*** New face 'doc-view-svg-face'.
+This replaces 'doc-view-svg-foreground' and 'doc-view-svg-background'.
+
 
 * New Modes and Packages in Emacs 30.1
 
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 0303fec67a6..b14655fb274 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -236,17 +236,14 @@ showing only titles and no page number."
   :type 'boolean
   :version "29.1")
 
-(defcustom doc-view-svg-background "white"
-  "Background color for svg images.
+(defface doc-view-svg-face '((t :inherit default))
+  "Face used for SVG images.  Only background and foreground colors
+are used.
 See `doc-view-mupdf-use-svg'."
-  :type 'color
-  :version "29.1")
+  :version "30.1")
 
-(defcustom doc-view-svg-foreground "black"
-  "Foreground color for svg images.
-See `doc-view-mupdf-use-svg'."
-  :type 'color
-  :version "29.1")
+(make-obsolete 'doc-view-svg-background 'doc-view-svg-face "30.1")
+(make-obsolete 'doc-view-svg-foreground 'doc-view-svg-face "30.1")
 
 (defcustom doc-view-ghostscript-options
   '("-dSAFER" ;; Avoid security problems when rendering files from untrusted
@@ -1602,8 +1599,8 @@ ARGS is a list of image descriptors."
                           (unless (member :transform-smoothing args)
                             (setq args `(,@args :transform-smoothing t)))
                           (when (eq doc-view--image-type 'svg)
-                            (setq args `(,@args :background 
,doc-view-svg-background
-                                               :foreground 
,doc-view-svg-foreground)))
+                            (setq args `(,@args :background ,(face-background 
'doc-view-svg-face)
+                                                :foreground ,(face-foreground 
'doc-view-svg-face))))
                          (apply #'create-image file doc-view--image-type nil 
args))))
             (slice (doc-view-current-slice))
             (img-width (and image (car (image-size image))))
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 6ecb307ce12..b13b3e08ce2 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -424,11 +424,10 @@ This affects the following commands:
                          (file-name-nondirectory thumb-file)))
     thumb-file))
 
-(defun image-dired-insert-thumbnail ( file original-file-name
-                           associated-dired-buffer image-number)
+(defun image-dired-insert-thumbnail (file original-file-name
+                                          associated-dired-buffer)
   "Insert thumbnail image FILE.
-Add text properties ORIGINAL-FILE-NAME, ASSOCIATED-DIRED-BUFFER
-and IMAGE-NUMBER."
+Add text properties ORIGINAL-FILE-NAME, ASSOCIATED-DIRED-BUFFER."
   (let (beg end)
     (setq beg (point))
     (image-dired-insert-image
@@ -452,7 +451,6 @@ and IMAGE-NUMBER."
            'keymap nil
            'original-file-name original-file-name
            'associated-dired-buffer associated-dired-buffer
-           'image-number image-number
            'tags (image-dired-list-tags original-file-name)
            'mouse-face 'highlight
            'comment (image-dired-get-comment original-file-name)))))
@@ -587,8 +585,8 @@ thumbnail buffer to be selected."
         (dolist (file files)
           (when (string-match-p (image-dired--file-name-regexp) file)
             (image-dired-insert-thumbnail
-             (image-dired--get-create-thumbnail-file file) file dired-buf
-             (cl-incf image-dired--number-of-thumbnails)))))
+             (image-dired--get-create-thumbnail-file file) file dired-buf)
+            (cl-incf image-dired--number-of-thumbnails))))
       (if (> image-dired--number-of-thumbnails 0)
           (if do-not-pop
               (display-buffer buf)
@@ -789,7 +787,10 @@ comment."
     (let ((file-name (image-dired-original-file-name))
           (dired-buf (buffer-name (image-dired-associated-dired-buffer)))
           (image-count (format "%s/%s"
-                               (get-text-property (point) 'image-number)
+                               ;; Line-up adds one space between two
+                               ;; images: this formula takes this into
+                               ;; account.
+                               (1+ (/ (point) 2))
                                image-dired--number-of-thumbnails))
           (props (string-join (get-text-property (point) 'tags) ", "))
           (comment (get-text-property (point) 'comment))
@@ -1127,10 +1128,12 @@ With a negative prefix argument, prompt user for the 
delay."
   "Remove current thumbnail from thumbnail buffer and line up."
   (interactive nil image-dired-thumbnail-mode)
   (let ((inhibit-read-only t))
-    (delete-char 1))
+    (delete-char 1)
+    (cl-decf image-dired--number-of-thumbnails))
   (let ((pos (point)))
     (image-dired--line-up-with-method)
-    (goto-char pos)))
+    (goto-char pos)
+    (image-dired--update-header-line)))
 
 (defun image-dired-line-up ()
   "Line up thumbnails according to `image-dired-thumbs-per-row'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]