Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Rasmus
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 (  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- bacon!




Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Rasmus
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. . .



Re: [O] Graphic files displayed in buffer?

2015-09-15 Thread Thomas S . Dye
Hi Rasmus,

Rasmus  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



[O] Graphic files displayed in buffer?

2015-09-13 Thread Thomas S . Dye
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



Re: [O] Graphic files displayed in buffer?

2015-09-13 Thread Thomas S . Dye
Aloha all,

Answering myself ...

Thomas S. Dye  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



Re: [O] Graphic files displayed in buffer?

2015-09-13 Thread Rasmus
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!




Re: [O] Graphic files displayed in buffer?

2015-09-13 Thread Thomas S . Dye
Hi Rasmus,

Rasmus  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
(# # # # 
# # # # 
# # # # 
# # # # 
#)

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