emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Display inline images patch
@ 2010-05-31 19:30 Russell Adams
  2010-06-01 13:36 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Russell Adams @ 2010-05-31 19:30 UTC (permalink / raw)
  To: emacs-orgmode

I got irritated by my point jumping to the end of the buffer every
time I toggled inline image display, so lets save excursion. ;]

$ diff -Narub org.el~ org.el
--- org.el~   2010-05-20 10:12:45.000000000 -0500
+++ org.el    2010-05-31 14:28:21.000000000 -0500
@@ -15489,6 +15489,7 @@
 is how it will work for export.  When INCLUDE-LINKED is set, also
 links
 with a description part will be inlined."
   (interactive "P")
+  (save-excursion 
   (org-remove-inline-images)
   (goto-char (point-min))
   (let ((re (concat "\\[\\[\\(file:\\|\\./\\)\\(~?"
   "[-+./_0-9a-zA-Z]+"
@@ -15501,7 +15502,7 @@
       (setq ov (make-overlay (match-beginning 0) (match-end 0)))
       (overlay-put ov 'display (create-image file))
       (overlay-put ov 'face 'default)
-      (push ov org-inline-image-overlays)))))
+          (push ov org-inline-image-overlays))))))
 
 (defun org-remove-inline-images ()
   "Remove inline display of images."






------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: Display inline images patch
  2010-05-31 19:30 Display inline images patch Russell Adams
@ 2010-06-01 13:36 ` Carsten Dominik
  2010-06-09 14:17   ` Colin Fraizer
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2010-06-01 13:36 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

Hi Russel,

looks like you are not running the latest version, I think this is  
already fixed....


- Carsten

On May 31, 2010, at 9:30 PM, Russell Adams wrote:

> I got irritated by my point jumping to the end of the buffer every
> time I toggled inline image display, so lets save excursion. ;]
>
> $ diff -Narub org.el~ org.el
> --- org.el~   2010-05-20 10:12:45.000000000 -0500
> +++ org.el    2010-05-31 14:28:21.000000000 -0500
> @@ -15489,6 +15489,7 @@
> is how it will work for export.  When INCLUDE-LINKED is set, also
> links
> with a description part will be inlined."
>   (interactive "P")
> +  (save-excursion
>   (org-remove-inline-images)
>   (goto-char (point-min))
>   (let ((re (concat "\\[\\[\\(file:\\|\\./\\)\\(~?"
>   "[-+./_0-9a-zA-Z]+"
> @@ -15501,7 +15502,7 @@
>       (setq ov (make-overlay (match-beginning 0) (match-end 0)))
>       (overlay-put ov 'display (create-image file))
>       (overlay-put ov 'face 'default)
> -      (push ov org-inline-image-overlays)))))
> +          (push ov org-inline-image-overlays))))))
>
> (defun org-remove-inline-images ()
>   "Remove inline display of images."
>
>
>
>
>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* RE: Display inline images patch
  2010-06-01 13:36 ` Carsten Dominik
@ 2010-06-09 14:17   ` Colin Fraizer
  2010-06-10 22:59     ` Gregory J. Grubbs
  0 siblings, 1 reply; 5+ messages in thread
From: Colin Fraizer @ 2010-06-09 14:17 UTC (permalink / raw)
  To: 'Carsten Dominik', 'Russell Adams'
  Cc: 'emacs-orgmode'

I use org-mode on Windows 7. It seems that the regexp for image files
excludes the ":" (colon) character. Could it be added to this:
"[-+./_0-9a-zA-Z]+"
to make this
"[-+./:_0-9a-zA-Z]+"
?

-----Original Message-----
From: emacs-orgmode-bounces+orgmode=cfraizer.com@gnu.org
[mailto:emacs-orgmode-bounces+orgmode=cfraizer.com@gnu.org] On Behalf Of
Carsten Dominik
Sent: Tuesday, June 01, 2010 9:37 AM
To: Russell Adams
Cc: emacs-orgmode
Subject: Re: [Orgmode] Display inline images patch

Hi Russel,

looks like you are not running the latest version, I think this is  
already fixed....


- Carsten

On May 31, 2010, at 9:30 PM, Russell Adams wrote:

> I got irritated by my point jumping to the end of the buffer every
> time I toggled inline image display, so lets save excursion. ;]
>
> $ diff -Narub org.el~ org.el
> --- org.el~   2010-05-20 10:12:45.000000000 -0500
> +++ org.el    2010-05-31 14:28:21.000000000 -0500
> @@ -15489,6 +15489,7 @@
> is how it will work for export.  When INCLUDE-LINKED is set, also
> links
> with a description part will be inlined."
>   (interactive "P")
> +  (save-excursion
>   (org-remove-inline-images)
>   (goto-char (point-min))
>   (let ((re (concat "\\[\\[\\(file:\\|\\./\\)\\(~?"
>   "[-+./_0-9a-zA-Z]+"
> @@ -15501,7 +15502,7 @@
>       (setq ov (make-overlay (match-beginning 0) (match-end 0)))
>       (overlay-put ov 'display (create-image file))
>       (overlay-put ov 'face 'default)
> -      (push ov org-inline-image-overlays)))))
> +          (push ov org-inline-image-overlays))))))
>
> (defun org-remove-inline-images ()
>   "Remove inline display of images."
>
>
>
>
>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten




_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Display inline images patch
  2010-06-09 14:17   ` Colin Fraizer
@ 2010-06-10 22:59     ` Gregory J. Grubbs
  2010-06-16 14:29       ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory J. Grubbs @ 2010-06-10 22:59 UTC (permalink / raw)
  To: emacs-orgmode

"Colin Fraizer" <orgmode@cfraizer.com> writes:

> I use org-mode on Windows 7. It seems that the regexp for image files
> excludes the ":" (colon) character. Could it be added to this:
> "[-+./_0-9a-zA-Z]+"
> to make this
> "[-+./:_0-9a-zA-Z]+"
> ?
>

I use a regexp for image files that adds characters often found in
Windows paths, as shown in the following patch in function
org-toggle-inline-images:


--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org.el b/lisp/org.el
old mode 100644
new mode 100755
index ba4ea63..ef8a06c
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15923,7 +15923,7 @@ BEG and END default to the buffer boundaries."
       (widen)
       (setq beg (or beg (point-min)) end (or end (point-max)))
       (goto-char (point-min))
-      (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([-+~./_0-9a-zA-Z]+"
+      (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([-+~.:/\\_0-9a-zA-Z ]+"
 			(substring (org-image-file-name-regexp) 0 -2)
 			"\\)\\]" (if include-linked "" "\\]")))
 	    old file ov img)

--8<---------------cut here---------------end--------------->8---

It adds ':', space and backslash to the set of characters, so that things like
the following work (org-insert-link sometimes inserts mixed back and forward slashes): 

--8<---------------cut here---------------start------------->8---

  [[file:c:/cygwin/usr/share/pixmaps/xterm-color_48x48.xpm]]
  [[~/projects/appointment-soon.png]]
  [[file:c:\Documents and Settings\ggrubbs\projects/appointment-soon.png]]

--8<---------------cut here---------------end--------------->8---




> -----Original Message-----
> From: emacs-orgmode-bounces+orgmode=cfraizer.com@gnu.org
> [mailto:emacs-orgmode-bounces+orgmode=cfraizer.com@gnu.org] On Behalf Of
> Carsten Dominik
> Sent: Tuesday, June 01, 2010 9:37 AM
> To: Russell Adams
> Cc: emacs-orgmode
> Subject: Re: [Orgmode] Display inline images patch
>
> Hi Russel,
>
> looks like you are not running the latest version, I think this is  
> already fixed....
>
>
> - Carsten
>
> On May 31, 2010, at 9:30 PM, Russell Adams wrote:
>
>> I got irritated by my point jumping to the end of the buffer every
>> time I toggled inline image display, so lets save excursion. ;]
>>
>> $ diff -Narub org.el~ org.el
>> --- org.el~   2010-05-20 10:12:45.000000000 -0500
>> +++ org.el    2010-05-31 14:28:21.000000000 -0500
>> @@ -15489,6 +15489,7 @@
>> is how it will work for export.  When INCLUDE-LINKED is set, also
>> links
>> with a description part will be inlined."
>>   (interactive "P")
>> +  (save-excursion
>>   (org-remove-inline-images)
>>   (goto-char (point-min))
>>   (let ((re (concat "\\[\\[\\(file:\\|\\./\\)\\(~?"
>>   "[-+./_0-9a-zA-Z]+"
>> @@ -15501,7 +15502,7 @@
>>       (setq ov (make-overlay (match-beginning 0) (match-end 0)))
>>       (overlay-put ov 'display (create-image file))
>>       (overlay-put ov 'face 'default)
>> -      (push ov org-inline-image-overlays)))))
>> +          (push ov org-inline-image-overlays))))))
>>
>> (defun org-remove-inline-images ()
>>   "Remove inline display of images."
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------
>> Russell Adams                            RLAdams@AdamsInfoServ.com
>>
>> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>>
>> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Display inline images patch
  2010-06-10 22:59     ` Gregory J. Grubbs
@ 2010-06-16 14:29       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2010-06-16 14:29 UTC (permalink / raw)
  To: Gregory J. Grubbs; +Cc: emacs-orgmode

Applied, thanks.

gregory@dynapse.com (Gregory J. Grubbs) writes:

>> I use org-mode on Windows 7. It seems that the regexp for image files
>> excludes the ":" (colon) character. Could it be added to this:
>> "[-+./_0-9a-zA-Z]+"
>> to make this
>> "[-+./:_0-9a-zA-Z]+"
>> ?
>>
>
> I use a regexp for image files that adds characters often found in
> Windows paths, as shown in the following patch in function
> org-toggle-inline-images:

-- 
 Bastien

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

end of thread, other threads:[~2010-06-16 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-31 19:30 Display inline images patch Russell Adams
2010-06-01 13:36 ` Carsten Dominik
2010-06-09 14:17   ` Colin Fraizer
2010-06-10 22:59     ` Gregory J. Grubbs
2010-06-16 14:29       ` 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).