* Graphic files displayed in buffer?
@ 2015-09-13 18:26 Thomas S. Dye
2015-09-13 19:14 ` Thomas S. Dye
0 siblings, 1 reply; 7+ messages in thread
From: Thomas S. Dye @ 2015-09-13 18:26 UTC (permalink / raw)
To: emacs-orgmode
Aloha all,
Links to graphic files in one section of a long-lived document now
display the graphic in the Org mode buffer. This new behavior is
surprising and unwanted.
Links to graphic files in other sections of the same document are
displayed correctly as links.
I'd like to have all the links displayed as links. Any ideas how to fix
this?
I'm using the latest Org mode from git, if that matters.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-13 18:26 Graphic files displayed in buffer? Thomas S. Dye
@ 2015-09-13 19:14 ` Thomas S. Dye
2015-09-13 20:06 ` Rasmus
0 siblings, 1 reply; 7+ messages in thread
From: Thomas S. Dye @ 2015-09-13 19:14 UTC (permalink / raw)
To: emacs-orgmode
Aloha all,
Answering myself ...
Thomas S. Dye <tsd@tsdye.com> writes:
> Aloha all,
>
> Links to graphic files in one section of a long-lived document now
> display the graphic in the Org mode buffer. This new behavior is
> surprising and unwanted.
>
> Links to graphic files in other sections of the same document are
> displayed correctly as links.
>
> I'd like to have all the links displayed as links. Any ideas how to fix
> this?
I think I've found a recently introduced bug.
The behavior I describe above can be triggered by a call to org-sbe,
which I have set up like this at the end of my Org mode file.
# Local Variables:
# org-entities-user: nil
# eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
# eval: (sbe "user-entities")
# End:
If I omit the # eval: (sbe "user-entities") line, save the file, close
it, and re-open it then all is well.
If I add the line and refresh the setup, then the problem returns.
If I then delete the line, so there are no calls to org-sbe (or its
alias, sbe), and refresh the setup, then the problem persists. If I
then save the file, kill its buffer, and re-open it, the problem is
gone.
I hope this makes sense. It seems to me that org-sbe has recently begun
hosing something. This is all code that I've been using regularly and
successfully for months or years.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-13 19:14 ` Thomas S. Dye
@ 2015-09-13 20:06 ` Rasmus
2015-09-14 1:05 ` Thomas S. Dye
0 siblings, 1 reply; 7+ messages in thread
From: Rasmus @ 2015-09-13 20:06 UTC (permalink / raw)
To: emacs-orgmode
Hi,
>> Links to graphic files in one section of a long-lived document now
>> display the graphic in the Org mode buffer. This new behavior is
>> surprising and unwanted.
>>
>> Links to graphic files in other sections of the same document are
>> displayed correctly as links.
>>
>> I'd like to have all the links displayed as links. Any ideas how to fix
>> this?
>
> I think I've found a recently introduced bug.
>
> The behavior I describe above can be triggered by a call to org-sbe,
> which I have set up like this at the end of my Org mode file.
>
> # Local Variables:
> # org-entities-user: nil
> # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
> # eval: (sbe "user-entities")
> # End:
>
> If I omit the # eval: (sbe "user-entities") line, save the file, close
> it, and re-open it then all is well.
>
> If I add the line and refresh the setup, then the problem returns.
I cannot reproduce. What is your "user-entities" code block?
This is my test file:
[[file:/tmp/test.png]]
#+name: user-entities
#+BEGIN_SRC emacs-lisp
1
#+END_SRC
# Local Variables:
# org-entities-user: nil
# eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
# eval: (sbe "user-entities")
# End:
--
With monopolies the cake is a lie!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-13 20:06 ` Rasmus
@ 2015-09-14 1:05 ` Thomas S. Dye
2015-09-15 19:55 ` Rasmus
0 siblings, 1 reply; 7+ messages in thread
From: Thomas S. Dye @ 2015-09-14 1:05 UTC (permalink / raw)
To: Rasmus; +Cc: emacs-orgmode
Hi Rasmus,
Rasmus <rasmus@gmx.us> writes:
>
> I cannot reproduce. What is your "user-entities" code block?
>
> This is my test file:
>
> [[file:/tmp/test.png]]
>
> #+name: user-entities
> #+BEGIN_SRC emacs-lisp
> 1
> #+END_SRC
>
> # Local Variables:
> # org-entities-user: nil
> # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe))
> # eval: (sbe "user-entities")
> # End:
Thanks for looking into this. Your file works here, too.
I found that loading my file somehow sets this variable:
org-inline-image-overlays is a variable defined in `org.el'.
Its value is
(#<overlay from 80946 to 80979 in anth_464_syllabus.org> #<overlay from 80254 to 80292 in anth_464_syllabus.org> #<overlay from 80060 to 80099 in anth_464_syllabus.org> #<overlay from 79977 to 80011 in anth_464_syllabus.org> #<overlay from 79840 to 79879 in anth_464_syllabus.org> #<overlay from 79720 to 79759 in anth_464_syllabus.org> #<overlay from 78291 to 78328 in anth_464_syllabus.org> #<overlay from 75204 to 75241 in anth_464_syllabus.org> #<overlay from 74778 to 74813 in anth_464_syllabus.org> #<overlay from 74224 to 74266 in anth_464_syllabus.org> #<overlay from 71381 to 71419 in anth_464_syllabus.org> #<overlay from 35207 to 35246 in anth_464_syllabus.org> #<overlay from 34346 to 34381 in anth_464_syllabus.org> #<overlay from 33565 to 33603 in anth_464_syllabus.org> #<overlay from
32615 to 32661 in anth_464_syllabus.org> #<overlay from 30451 to 30489 in anth_464_syllabus.org> #<overlay from 29134 to 29173 in anth_464_syllabus.org>)
Local in buffer anth_464_syllabus.org; global value is nil
Any idea how that might happen? It is just one part of the file, the
rest is good (even though it contains lots of images).
Running org-remove-inline-images gets rid of the overlays. If I save
after they are removed, kill the buffer, and then read it again I have
the same problem.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-14 1:05 ` Thomas S. Dye
@ 2015-09-15 19:55 ` Rasmus
2015-09-15 20:56 ` Thomas S. Dye
0 siblings, 1 reply; 7+ messages in thread
From: Rasmus @ 2015-09-15 19:55 UTC (permalink / raw)
To: tsd; +Cc: emacs-orgmode
Hi Tom,
> Thanks for looking into this. Your file works here, too.
>
> I found that loading my file somehow sets this variable:
>
> org-inline-image-overlays is a variable defined in `org.el'.
This variable is only set from org-inline-image functions in org.el (I
didn't check contrib). So your source block must directly or indirectly
be calling one of these functions.
Does it happen when you use emacs -q?
Rasmus
--
Need more coffee. . .
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-15 19:55 ` Rasmus
@ 2015-09-15 20:56 ` Thomas S. Dye
2015-09-15 22:29 ` Rasmus
0 siblings, 1 reply; 7+ messages in thread
From: Thomas S. Dye @ 2015-09-15 20:56 UTC (permalink / raw)
To: Rasmus; +Cc: emacs-orgmode
Hi Rasmus,
Rasmus <rasmus@gmx.us> writes:
> Hi Tom,
>
>> Thanks for looking into this. Your file works here, too.
>>
>> I found that loading my file somehow sets this variable:
>>
>> org-inline-image-overlays is a variable defined in `org.el'.
>
> This variable is only set from org-inline-image functions in org.el (I
> didn't check contrib). So your source block must directly or indirectly
> be calling one of these functions.
>
> Does it happen when you use emacs -q?
OK, so I made the file self-contained by transferring to it all the code
it uses in my library of Babel. Then, I opened with emacs -q, answered
"yes" to all the questions about running code, and when that was done
discovered that the images aren't displayed, which is what I want!
When I open the same file in my usual emacs, the images are displayed
inline.
So, it must be my configuration, right?
I use Eric Schulte's starter kit, so my configuration is spread out over
several *.el files in two directories. When I grep for "inline" or
"overlay" in *.el I get no hits. But grepping for "image" gets this:
custom.el: '(emms-mode-line-icon-image-cache
custom.el: (image :type xpm :ascent center :data "/* XPM */
custom.el: '(gnus-mode-line-image-cache
custom.el: (image :type xpm :ascent center :data "/* XPM */
custom.el: '(mu4e-view-show-images nil)
td.el:(setq mu4e-view-show-images t)
td.el:(when (fboundp 'imagemagick-register-types)
td.el: (imagemagick-register-types))
td.el: :base-directory "/Users/dk/org/tsdye/employees/software/images/"
None of which looks too suspicious to me, though some of it is old and
might be pruned away. Does anything look suspicious to you?
Can you suggest some other terms I might grep? I'm keen to get to the
bottom of this.
Thanks for your help.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Graphic files displayed in buffer?
2015-09-15 20:56 ` Thomas S. Dye
@ 2015-09-15 22:29 ` Rasmus
0 siblings, 0 replies; 7+ messages in thread
From: Rasmus @ 2015-09-15 22:29 UTC (permalink / raw)
To: emacs-orgmode
Hello,
> OK, so I made the file self-contained by transferring to it all the code
> it uses in my library of Babel.
At least that's nice in itself... (I now keep common config data in a git
submodule that I clone and load at export time with Make).
> Then, I opened with emacs -q, answered "yes" to all the questions about
> running code, and when that was done discovered that the images aren't
> displayed, which is what I want!
OK.
> When I open the same file in my usual emacs, the images are displayed
> inline.
Damn.
> So, it must be my configuration, right?
It would seem so. Unless if you perhaps did not load your org-git version
in the "emacs -q" setup. But at least on my system the recent Org is
loaded with "-q" (I keep org in the system-wide site-lisp).
> I use Eric Schulte's starter kit, so my configuration is spread out over
> several *.el files in two directories. When I grep for "inline" or
> "overlay" in *.el I get no hits. But grepping for "image" gets this:
> custom.el: '(emms-mode-line-icon-image-cache
> custom.el: (image :type xpm :ascent center :data "/* XPM */
> custom.el: '(gnus-mode-line-image-cache
> custom.el: (image :type xpm :ascent center :data "/* XPM */
> custom.el: '(mu4e-view-show-images nil)
This should be completely orthogonal.
> td.el:(setq mu4e-view-show-images t)
> td.el:(when (fboundp 'imagemagick-register-types)
> td.el: (imagemagick-register-types))
> td.el: :base-directory "/Users/dk/org/tsdye/employees/software/images/"
Same...
> None of which looks too suspicious to me, though some of it is old and
> might be pruned away. Does anything look suspicious to you?
Nope.
> Can you suggest some other terms I might grep? I'm keen to get to the
> bottom of this.
Hmm, I'm thinking out loud here, but perhaps you could try deploy
something like the following to detect *where* org-display-inline-images
is called.
#+BEGIN_SRC emacs-lisp
(defun a-pix-is-worth-a-1000-words (&optional &rest args)
(with-temp-file "/tmp/backtrace.txt"
(goto-char (point-max))
(insert (format-time-string "++++ %s ++++\n"))
(let ((standard-output (current-buffer))) (backtrace))))
(add-function :before (symbol-function 'org-display-inline-images)
#'a-pix-is-worth-a-1000-words)
#+END_SRC
Rasmus
--
m-mm-mmm-mmmm bacon!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-09-15 22:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-13 18:26 Graphic files displayed in buffer? Thomas S. Dye
2015-09-13 19:14 ` Thomas S. Dye
2015-09-13 20:06 ` Rasmus
2015-09-14 1:05 ` Thomas S. Dye
2015-09-15 19:55 ` Rasmus
2015-09-15 20:56 ` Thomas S. Dye
2015-09-15 22:29 ` Rasmus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.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).