From: Eli Zaretskii <eliz@gnu.org>
To: awrhygty@outlook.com
Cc: 65187@debbugs.gnu.org
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 [thread overview]
Message-ID: <838rajjohq.fsf@gnu.org> (raw)
In-Reply-To: <TYZPR01MB3920FD7B17127F5C2132FE39C313A@TYZPR01MB3920.apcprd01.prod.exchangelabs.com> (awrhygty@outlook.com)
> 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.
next prev parent reply other threads:[~2023-08-10 8:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 0:00 bug#65187: 29.1; right edge of wide image can not be displayed in image-mode awrhygty
2023-08-10 8:22 ` Eli Zaretskii [this message]
2023-08-11 0:23 ` Michael Heerdegen
2023-08-11 6:15 ` Eli Zaretskii
2023-08-11 6:29 ` Michael Heerdegen
2023-08-13 6:53 ` Eli Zaretskii
2023-08-14 0:37 ` Michael Heerdegen
2023-08-14 11:51 ` Eli Zaretskii
2023-08-14 23:58 ` Michael Heerdegen
2023-08-15 15:35 ` Eli Zaretskii
2023-08-15 3:54 ` awrhygty
2023-08-15 10:56 ` Eli Zaretskii
2023-08-15 13:03 ` awrhygty
2023-08-15 14:12 ` Eli Zaretskii
2023-08-15 14:27 ` awrhygty
2023-08-15 14:51 ` Eli Zaretskii
2023-08-15 16:35 ` Eli Zaretskii
2023-08-16 3:26 ` awrhygty
2023-08-16 17:43 ` Eli Zaretskii
2023-08-24 5:44 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=838rajjohq.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=65187@debbugs.gnu.org \
--cc=awrhygty@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).