bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#65187: 29.1; right edge of wide image can not be displayed in image-


From: Eli Zaretskii
Subject: bug#65187: 29.1; right edge of wide image can not be displayed in image-mode
Date: Thu, 10 Aug 2023 11:22:25 +0300

> From: awrhygty@outlook.com
> Date: Thu, 10 Aug 2023 09:00:55 +0900
> 
> 
> Evaluate the following sexp and type C-e to display the right side of
> the image.

The snippet you posted signaled an error:

  Debugger entered--Lisp error: (error "Defining as dynamic an already lexical 
var" image-auto-resize)
    internal--define-uninitialized-variable(image-auto-resize "Non-nil to 
resize the image upon first display.\nIt...")
    custom-declare-variable(image-auto-resize (funcall #'#f(compiled-function 
() #<bytecode 0x49800016a1c14>)) "Non-nil to resize the image upon first 
display.\nIt..." :type (choice (const :tag "No resizing" nil) (const :tag "Fit 
to window" fit-window) (other :tag "Scale down to fit window" t) (number :tag 
"Scale factor" 1)) :version "29.1" :group image)
    
byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313&\11\210\300\314\302\303\315DD\316\306\317\310\311\312\313&\11\210\300\320\302\303\321DD\322\306\323\310\324\312\313&\11..."
 [custom-declare-variable image-auto-resize funcall function 
#f(compiled-function () #<bytecode 0x49800016a1c14>) "Non-nil to resize the 
image upon first display.\nIt..." :type (choice (const :tag "No resizing" nil) 
(const :tag "Fit to window" fit-window) (other :tag "Scale down to fit window" 
t) (number :tag "Scale factor" 1)) :version "29.1" :group image 
image-auto-resize-max-scale-percent #f(compiled-function () #<bytecode 
0x49800016ae914>) "Max size (in percent) to scale up to when `image-a..." 
(choice (const :tag "No max" nil) natnum) image-auto-resize-on-window-resize 
#f(compiled-function () #<bytecode 0x49800016ae854>) "Non-nil to resize the 
image whenever the window's ..." (choice (const :tag "No auto-resize on window 
size change" nil) (integer :tag "Wait for number of seconds before resize" 1)) 
"27.1"] 10)
    (image-mode)
    (let ((image-auto-resize nil)) (image-mode))
    (let* ((w (+ (window-pixel-width) 100)) (h 100) (stroke-width 4) (rect-w (- 
w stroke-width)) (rect-h (- h stroke-width)) (rect-x (/ stroke-width 2)) 
(rect-y (/ stroke-width 2)) (svg (format "<svg width=\"%d\" 
height=\"%d\">\n<rect width=\"%d\" heig..." w h rect-w rect-h rect-x rect-y 
stroke-width))) (switch-to-buffer (generate-new-buffer "tmpsvg")) (insert svg) 
(let ((image-auto-resize nil)) (image-mode)))
    (progn (let* ((w (+ (window-pixel-width) 100)) (h 100) (stroke-width 4) 
(rect-w (- w stroke-width)) (rect-h (- h stroke-width)) (rect-x (/ stroke-width 
2)) (rect-y (/ stroke-width 2)) (svg (format "<svg width=\"%d\" 
height=\"%d\">\n<rect width=\"%d\" heig..." w h rect-w rect-h rect-x rect-y 
stroke-width))) (switch-to-buffer (generate-new-buffer "tmpsvg")) (insert svg) 
(let ((image-auto-resize nil)) (image-mode))))
    eval((progn (let* ((w (+ (window-pixel-width) 100)) (h 100) (stroke-width 
4) (rect-w (- w stroke-width)) (rect-h (- h stroke-width)) (rect-x (/ 
stroke-width 2)) (rect-y (/ stroke-width 2)) (svg (format "<svg width=\"%d\" 
height=\"%d\">\n<rect width=\"%d\" heig..." w h rect-w rect-h rect-x rect-y 
stroke-width))) (switch-to-buffer (generate-new-buffer "tmpsvg")) (insert svg) 
(let ((image-auto-resize nil)) (image-mode)))) t)
    elisp--eval-last-sexp(nil)
    eval-last-sexp(nil)
    funcall-interactively(eval-last-sexp nil)
    call-interactively(eval-last-sexp nil nil)
    command-execute(eval-last-sexp)

I needed to change the recipe like below to be able to run it:

  (let* ((w (+ (window-pixel-width) 100))
         (h 100)
         (stroke-width 4)
         (rect-w (- w stroke-width))
         (rect-h (- h stroke-width))
         (rect-x (/ stroke-width 2))
         (rect-y (/ stroke-width 2))
         (svg (format "\
  <svg width=\"%d\" height=\"%d\">
  <rect width=\"%d\" height=\"%d\" x=\"%d\" y=\"%d\"\
   fill=\"blue\" stroke=\"red\" stroke-width=\"%d\"/>
  </svg>\
  " w h rect-w rect-h rect-x rect-y stroke-width)))
    (switch-to-buffer (generate-new-buffer "tmpsvg"))
    (insert svg)
    (setopt image-auto-resize nil)  ; <<<<<<<<<<<<<<<<<<<<<<
    (image-mode))

> The vertical red line on the right edge should be displayed.
> But it is not displayed.

When I execute the modified version of the recipe, C-e does display
the red line on the right edge of the image.  So I cannot reproduce
the problem.





reply via email to

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