[SOLVED] Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
Eli Zaretskii writes: >> From: Ihor Radchenko >> Date: Sun, 2 Oct 2022 18:57:56 +0800 >> Cc: Eli Zaretskii , emacs-de...@gnu.org, emacs-orgmode@gnu.org >> >> 1. find an image file in your system >> 2. emacs -Q >> 3. M-: (erase-buffer) >> 4. Insert "askdjaklsdj lasasd" >> 5. M-: (require 'org) >> 6. M-x font-lock-mode >> 7. M-: (put-text-property (point-min) (point-max) 'face 'org-link) >> 8. M-: (put-text-property (point-min) (point-max) 'display (create-image >> "/path/to/image" nil nil :ascent 'center :max-height 512)) > > Thanks. > > This is because of the ":ascent 'center" part, isn't it? > > What would you want Emacs to do instead in this case? I checked out the docstring of `create-image' have not found related info about `:ascent'. Today (which is after some days) I review this problem and searched the `:ascent' in emacs info manual, found this property explanation. I set it to `:ascent 100` solved the problem. Now the baseline is at the bottom of image. Thanks a lot for pointing it out which fixed a big issue of my extension code. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
Eli Zaretskii writes: >> From: "Christopher M. Miles" >> Cc: numbch...@gmail.com, yanta...@gmail.com, emacs-de...@gnu.org, >> emacs-orgmode@gnu.org >> Date: Sun, 02 Oct 2022 18:45:41 +0800 >> >> I hate to rewrite those steps more than 3 times. > > The problem is, I've read the correspondence on the Org list, and I > still don't understand what are the steps needed, that don't require > the extra Org package. That is why I( asked for the details: so that > the bug tracker could have them clearly and unambiguously. > > I do want to look into the issue and see if there's anything that > needs to be fixed in Emacs. > >> But I also know Emacs >> contributors should not be forced to fix bug for me. Also I can't fix >> this bug by myself. So I think it's not a bug, I can tolerate this >> center line. Maybe I mastered skill for modify code in Emacs, I might >> come back to fix this bug by myself. But now, let me close it. I'm not >> hating anybody, just hate this process. Thanks for checking out. > > I'm sorry you feel like that. Perhaps Ihor or someone else could fill > in the blanks and allow us to investigate. > > Thanks. No, it's my personal character and feeling caused this behavior. Not your fault. I really don't blame anybody. In bellowing Ihor's email wrote the reproduce steps. Thanks very much Ihor. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
> > This is because of the ":ascent 'center" part, isn't it? > I guess so. The image bottom is below the text baseline and thus the underline cuts through the image. > What would you want Emacs to do instead in this case? > I do understand how Emacs renders what we get here from the perspective of glyph composition. Putting underline over the glyph does make sense in many cases. However, it is clearly not expected in this specific scenario of a bitmap image. I think that it could be useful to allow images to be drawn "on top" of the underlines, cross-lines, etc. Best, Ihor
Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
> From: Ihor Radchenko > Date: Sun, 2 Oct 2022 18:57:56 +0800 > Cc: Eli Zaretskii , emacs-de...@gnu.org, emacs-orgmode@gnu.org > > 1. find an image file in your system > 2. emacs -Q > 3. M-: (erase-buffer) > 4. Insert "askdjaklsdj lasasd" > 5. M-: (require 'org) > 6. M-x font-lock-mode > 7. M-: (put-text-property (point-min) (point-max) 'face 'org-link) > 8. M-: (put-text-property (point-min) (point-max) 'display (create-image > "/path/to/image" nil nil :ascent 'center :max-height 512)) Thanks. This is because of the ":ascent 'center" part, isn't it? What would you want Emacs to do instead in this case?
Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
> From: "Christopher M. Miles" > Cc: numbch...@gmail.com, yanta...@gmail.com, emacs-de...@gnu.org, > emacs-orgmode@gnu.org > Date: Sun, 02 Oct 2022 18:45:41 +0800 > > I hate to rewrite those steps more than 3 times. The problem is, I've read the correspondence on the Org list, and I still don't understand what are the steps needed, that don't require the extra Org package. That is why I( asked for the details: so that the bug tracker could have them clearly and unambiguously. I do want to look into the issue and see if there's anything that needs to be fixed in Emacs. > But I also know Emacs > contributors should not be forced to fix bug for me. Also I can't fix > this bug by myself. So I think it's not a bug, I can tolerate this > center line. Maybe I mastered skill for modify code in Emacs, I might > come back to fix this bug by myself. But now, let me close it. I'm not > hating anybody, just hate this process. Thanks for checking out. I'm sorry you feel like that. Perhaps Ihor or someone else could fill in the blanks and allow us to investigate. Thanks.
Re: [CLOSED] text-property displayed image has a center-line when the text face has underline attribute
On Sun, Oct 2, 2022 at 6:51 PM Christopher M. Miles wrote: > > I hate to rewrite those steps more than 3 times. But I also know Emacs > contributors should not be forced to fix bug for me. Also I can't fix > this bug by myself. So I think it's not a bug, I can tolerate this > center line. Maybe I mastered skill for modify code in Emacs, I might > come back to fix this bug by myself. But now, let me close it. I'm not > hating anybody, just hate this process. Thanks for checking out. > > Come on. 1. find an image file in your system 2. emacs -Q 3. M-: (erase-buffer) 4. Insert "askdjaklsdj lasasd" 5. M-: (require 'org) 6. M-x font-lock-mode 7. M-: (put-text-property (point-min) (point-max) 'face 'org-link) 8. M-: (put-text-property (point-min) (point-max) 'display (create-image "/path/to/image" nil nil :ascent 'center :max-height 512))
[CLOSED] text-property displayed image has a center-line when the text face has underline attribute
I hate to rewrite those steps more than 3 times. But I also know Emacs contributors should not be forced to fix bug for me. Also I can't fix this bug by myself. So I think it's not a bug, I can tolerate this center line. Maybe I mastered skill for modify code in Emacs, I might come back to fix this bug by myself. But now, let me close it. I'm not hating anybody, just hate this process. Thanks for checking out. Eli Zaretskii writes: >> From: "Christopher M. Miles" >> Cc: "Christopher M. Miles" , Org Mode >> >> Date: Sun, 02 Oct 2022 15:03:26 +0800 >> >> Ihor Radchenko writes: >> >> > "Christopher M. Miles" writes: >> > >> >> I replaced step 5 with step 6 by extracting the logic code of >> >> org-link-beautify, but I found it does not have center-line. That's >> >> really weird. >> >> ... >> >>(put-text-property >> >> start end >> >> 'display (create-image >> >> "~/Downloads/.thumbnails/3veEPJrQrV1EtpH9.png" nil nil :ascent 'center >> >> :max-height 512)) >> >>(make-local-variable 'image-map) >> >>(define-key image-map (kbd "") 'org-open-at-point)) >> >> #+end_src >> > >> > On my side, the put-text-property does have center-line. >> > But only when buffer is in Org mode. >> > Yet, it is not Org's fault. >> > >> > The reason you are seeing the horizontal line is org-link face. >> > org-link has underline. And the "center" line you are seeing is actually >> > underline coming from the face. I'd say it is emacs bug. >> >> Thanks very much for figuring out this issue, Ihor. >> >> I see, I originally post this issue on Emacs-help mailing list, Eli let >> me forward this thread to Org mode mailing list. Now I need to forward >> to Emacs-devel mailing list. >> >> In case the background info is missing, link original message here: >> >> https://list.orgmode.org/87mtae2718.fsf@localhost/T/#m35d40f37fdf80f413ddb8d40e3017a6f102651e9 > > Please report this as a bug, with "M-x report-emacs-bug", and please > include there all the details, including the recipe to reproduce the > issue. > > Thanks. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature