[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [Bug] org-startup-with-inline-images
From: |
Daimrod |
Subject: |
Re: [O] [Bug] org-startup-with-inline-images |
Date: |
Wed, 01 May 2013 19:28:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Rick Frankel <address@hidden> writes:
Hello Rick,
> `org-startup-with-inline-images' is a customizable variable. The
> problem is that if an org file is visited in a non-graphics buffer (or
> batch), `org-display-inline-images' is called an throws an error
> ("Non-X frame used").
>
> This problem also occurs when e.g., `org-babel-after-execute-hook' is
> set to 'org-display-inline-images (which can be mitigated by not
> setting the hook in a non-x frame).
>
> Since the startup variable is a customization, and causes problems if
> not set programatically, IMHO, the best solution would be to wrap the
> `org-display-inline-images' function in a test so that is is a no-op
> on non graphic displays:
>
> (defun org-display-inline-images (&optional include-linked refresh
> beg end)
> "..."
> (interactive "P")
> (when (display-graphic-p)
> ^^^^^^^^^^^^^^^^^^^^^^^^
> [...])
Thanks for the report, I've attached a patch that fixes this problem (in
both `org-display-inline-images' and `org-preview-latex-fragment').
However I don't know if it is the right approach or if I should try to
narrow this to lower-level functions.
I know that `clear-image-cache' raise this error but I haven't tried to
see if it the only one. Should I try to look more at it and add a
`org-clear-image-cache' which will check if a graphic display is
available or is the current solution fine?
Regards,
0001-lisp-org.el-Do-not-inline-images-when-no-graphic-dis.patch
Description: Text Data
--
Daimrod/Greg
pgpRKPcIEsW2a.pgp
Description: PGP signature
- Re: [O] [Bug] org-startup-with-inline-images,
Daimrod <=