emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-toggle-inline-images bug
@ 2011-08-11  3:13 William Xu
  2011-08-24 18:41 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: William Xu @ 2011-08-11  3:13 UTC (permalink / raw)
  To: emacs-orgmode

Hi, 

M-x org-toggle-inline-images doesn't work for links like this: 
  [[./ref/diskStructures.png]]

The problem lies in `org-display-inline-images': 

  (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
    	(substring (org-image-file-name-regexp) 0 -2)
    	"\\)\\]" (if include-linked "" "\\]")))
    old file ov img)

org-image-file-name-regexp assumes the last two characters are "\\)\\'"
or "\\)\\$".  However, in its definition: 

  (defun org-image-file-name-regexp (&optional extensions)
    "Return regexp matching the file names of images.
  If EXTENSIONS is given, only match these."
    (if (and (not extensions) (fboundp 'image-file-name-regexp))
        (image-file-name-regexp)
    ;; snip 

When image-file-name-regexp is defined, (image-file-name-regexp) doesn't
ends with those two specific characters.  On my machine, it returns: 

(image-file-name-regexp)
=> 
"\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\'\\|\\.png$\\|\\.jpeg$\\|\\.jpg$\\|\\.gif$\\|\\.tiff$\\|\\.tif$\\|\\.xbm$\\|\\.xpm$\\|\\.pbm$\\|\\.pgm$\\|\\.ppm$\\|\\.pnm$"

Thus, the `re' match fails.  

Maybe we shall not depend on (image-file-name-regexp) ? 

-- 
William

http://xwl.appspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-toggle-inline-images bug
  2011-08-11  3:13 org-toggle-inline-images bug William Xu
@ 2011-08-24 18:41 ` Bastien
  2011-08-25  6:04   ` William Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2011-08-24 18:41 UTC (permalink / raw)
  To: William Xu; +Cc: emacs-orgmode

Hi William,

William Xu <william.xwl@gmail.com> writes:

> M-x org-toggle-inline-images doesn't work for links like this: 
>   [[./ref/diskStructures.png]]

It works well here on Emacs GNU Emacs 24.0.50.1 or 23.3.1 and 
Org 7.7 (latest git version.)

What version of Emacs and Org are you using?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-toggle-inline-images bug
  2011-08-24 18:41 ` Bastien
@ 2011-08-25  6:04   ` William Xu
  2011-08-25  7:45     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: William Xu @ 2011-08-25  6:04 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

2011/8/25 Bastien <bzg@altern.org>:
> Hi William,
>
> William Xu <william.xwl@gmail.com> writes:
>
>> M-x org-toggle-inline-images doesn't work for links like this:
>>   [[./ref/diskStructures.png]]
>
> It works well here on Emacs GNU Emacs 24.0.50.1 or 23.3.1 and
> Org 7.7 (latest git version.)
>
> What version of Emacs and Org are you using?

Hmm, i'm using Org bundled with Emacs.

emacs-version: GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600) of
2011-06-28 on 3249CTO
org-version: 7.4  (BTW, why such big difference from org git...)


-William

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-toggle-inline-images bug
  2011-08-25  6:04   ` William Xu
@ 2011-08-25  7:45     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2011-08-25  7:45 UTC (permalink / raw)
  To: William Xu; +Cc: emacs-orgmode

Hi William,

William Xu <william.xwl@gmail.com> writes:

>> What version of Emacs and Org are you using?
>
> Hmm, i'm using Org bundled with Emacs.

I guess it has been fixed in the meantime.  If you have the 
opportunity to use Org from git, please do so:

  http://orgmode.org/index.html#sec-3-2

> emacs-version: GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600) of
> 2011-06-28 on 3249CTO
> org-version: 7.4  (BTW, why such big difference from org git...)

Because I did not take the time to merge Org into Emacs before 
the 7.7 release of Org.  Merges should happen more often in the 
future.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-25  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11  3:13 org-toggle-inline-images bug William Xu
2011-08-24 18:41 ` Bastien
2011-08-25  6:04   ` William Xu
2011-08-25  7:45     ` Bastien

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).