emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-toggle-inline-images bug


From: William Xu
Subject: [O] org-toggle-inline-images bug
Date: Thu, 11 Aug 2011 11:13:51 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]