emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automatic screenshot insertion
@ 2010-11-18 17:16 Jonathan BISSON
  2010-11-18 17:50 ` Sébastien Vauban
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Jonathan BISSON @ 2010-11-18 17:16 UTC (permalink / raw)
  To: emacs-orgmode

Here is a little function that allows a user to insert a screenshot 
easily. Only works on unix-like systems where ImageMagick is installed 
(adapt "import" to your screenshot program if needed).



(defun my-screenshot ()
"Take a screenshot into a unique-named file in the current buffer file 
directory and insert a link to this file."

  (interactive)
  (setq filename
   (concat
    (make-temp-name
     (file-name-directory (buffer-file-name))
    )
    ".jpg"
   )
  )

  (call-process "import" nil nil nil filename)
  (insert (concat "[[" filename "]]"))
  (org-display-inline-images)
)




Cheers,

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

* Re: Automatic screenshot insertion
  2010-11-18 17:16 Automatic screenshot insertion Jonathan BISSON
@ 2010-11-18 17:50 ` Sébastien Vauban
  2010-11-28 19:35 ` David Maus
  2011-02-03 13:33 ` Bastien
  2 siblings, 0 replies; 23+ messages in thread
From: Sébastien Vauban @ 2010-11-18 17:50 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Jonathan,

Jonathan BISSON wrote:
> Here is a little function that allows a user to insert a screenshot easily.
> Only works on unix-like systems where ImageMagick is installed (adapt "import"
> to your screenshot program if needed).
>
> (defun my-screenshot ()
> "Take a screenshot into a unique-named file in the current buffer file
> directory and insert a link to this file."
>
>  (interactive)
>  (setq filename
>   (concat
>    (make-temp-name
>     (file-name-directory (buffer-file-name))
>    )
>    ".jpg"
>   )
>  )
>
>  (call-process "import" nil nil nil filename)
>  (insert (concat "[[" filename "]]"))
>  (org-display-inline-images)
> )

I find this to be a very smart idea. Maybe I'll never need it, but well
thought!

BTW, ImageMagick exists for Windows as well, so it just needs =import= to be
in the path of executables...

Best regards,
  Seb

-- 
Sébastien Vauban


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

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

* Re: Automatic screenshot insertion
  2010-11-18 17:16 Automatic screenshot insertion Jonathan BISSON
  2010-11-18 17:50 ` Sébastien Vauban
@ 2010-11-28 19:35 ` David Maus
  2011-03-29 14:43   ` [Orgmode] " Russell Adams
  2011-02-03 13:33 ` Bastien
  2 siblings, 1 reply; 23+ messages in thread
From: David Maus @ 2010-11-28 19:35 UTC (permalink / raw)
  To: Jonathan BISSON; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 509 bytes --]

At Thu, 18 Nov 2010 18:16:22 +0100,
Jonathan BISSON wrote:
>
> Here is a little function that allows a user to insert a screenshot
> easily. Only works on unix-like systems where ImageMagick is installed
> (adapt "import" to your screenshot program if needed).
>

Nice.  Do you mind of I put the function on Org mode'S wiki (Worg) in
the "Org hacks" page?[1]

Best,
  -- David

[1] http://orgmode.org/worg/org-hacks.php
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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] 23+ messages in thread

* Re: Automatic screenshot insertion
  2010-11-18 17:16 Automatic screenshot insertion Jonathan BISSON
  2010-11-18 17:50 ` Sébastien Vauban
  2010-11-28 19:35 ` David Maus
@ 2011-02-03 13:33 ` Bastien
  2 siblings, 0 replies; 23+ messages in thread
From: Bastien @ 2011-02-03 13:33 UTC (permalink / raw)
  To: Jonathan BISSON; +Cc: emacs-orgmode

Hi Jonathan,

Jonathan BISSON <bissonjonathan@gmail.com> writes:

> Here is a little function that allows a user to insert a screenshot
> easily. Only works on unix-like systems where ImageMagick is installed
> (adapt "import" to your screenshot program if needed).

I added this to worg/org-hacks.org 

Thanks!

-- 
 Bastien

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

* Re: [Orgmode] Automatic screenshot insertion
  2010-11-28 19:35 ` David Maus
@ 2011-03-29 14:43   ` Russell Adams
  2011-06-06 18:59     ` David Maus
  2012-01-05  4:54     ` François Pinard
  0 siblings, 2 replies; 23+ messages in thread
From: Russell Adams @ 2011-03-29 14:43 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, Nov 28, 2010 at 08:35:23PM +0100, David Maus wrote:
> At Thu, 18 Nov 2010 18:16:22 +0100,
> Jonathan BISSON wrote:
> >
> > Here is a little function that allows a user to insert a screenshot
> > easily. Only works on unix-like systems where ImageMagick is installed
> > (adapt "import" to your screenshot program if needed).
> >
>
> Nice.  Do you mind of I put the function on Org mode'S wiki (Worg) in
> the "Org hacks" page?[1]
>
> Best,
>   -- David
>
> [1] http://orgmode.org/worg/org-hacks.php
> --
> OpenPGP... 0x99ADB83B5A4478E6
> Jabber.... dmjena@jabber.org
> Email..... dmaus@ictsoc.de

I made a minor change. File names are now generated by using the
current org buffer filename, plus the date and time, and a unique
number. This allows me to sort out the images better.

                          (defun org-screenshot ()
                            "Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file."
                            (interactive)
                            (setq filename
                                  (concat
                                   (make-temp-name
                                    (concat (buffer-file-name)
                                            "_"
                                            (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
                            (call-process "import" nil nil nil filename)
                            (insert (concat "[[" filename "]]"))
                            (org-display-inline-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] 23+ messages in thread

* Re: [Orgmode] Automatic screenshot insertion
  2011-03-29 14:43   ` [Orgmode] " Russell Adams
@ 2011-06-06 18:59     ` David Maus
  2012-01-05  4:54     ` François Pinard
  1 sibling, 0 replies; 23+ messages in thread
From: David Maus @ 2011-06-06 18:59 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

At Tue, 29 Mar 2011 09:43:27 -0500,
Russell Adams wrote:
> I made a minor change. File names are now generated by using the
> current org buffer filename, plus the date and time, and a unique
> number. This allows me to sort out the images better.
>
>                           (defun org-screenshot ()
>                             "Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file."
>                             (interactive)
>                             (setq filename
>                                   (concat
>                                    (make-temp-name
>                                     (concat (buffer-file-name)
>                                             "_"
>                                             (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
>                             (call-process "import" nil nil nil filename)
>                             (insert (concat "[[" filename "]]"))
>                             (org-display-inline-images))
>

Thanks, I update the function on Worg.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

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

* Re: [Orgmode] Automatic screenshot insertion
  2011-03-29 14:43   ` [Orgmode] " Russell Adams
  2011-06-06 18:59     ` David Maus
@ 2012-01-05  4:54     ` François Pinard
  2012-01-09 18:27       ` Eric S Fraga
  1 sibling, 1 reply; 23+ messages in thread
From: François Pinard @ 2012-01-05  4:54 UTC (permalink / raw)
  To: emacs-orgmode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
> On Sun, Nov 28, 2010 at 08:35:23PM +0100, David Maus wrote:
>> At Thu, 18 Nov 2010 18:16:22 +0100, Jonathan BISSON wrote:

>> > Here is a little function that allows a user to insert a screenshot
>> > easily. Only works on unix-like systems where ImageMagick is installed
>> > (adapt "import" to your screenshot program if needed).

>> Nice.  Do you mind of I put the function on Org mode'S wiki (Worg) in
>> the "Org hacks" page?[1]

> I made a minor change. File names are now generated by using the
> current org buffer filename, plus the date and time, and a unique
> number. This allows me to sort out the images better.

For my own usage, I modified it further, like below:


(defun fp-org-image (name)
  "Insert a link to an already existing image, or else to a screenshot.
The screenshot is either taken to the given non-existing file name,
or added into the given directory, defaulting to the current one."
  ;; FIXME: Should limit to '("pdf" "jpeg" "jpg" "png" "ps" "eps")
  ;; which is org-export-latex-inline-image-extensions.
  (interactive "GImage name? ")
  (when (file-directory-p name)
    (setq name (concat
                (make-temp-name
                 (concat (file-name-as-directory name)
                         (subst-char-in-string
                          "." "-"
                          (file-name-sans-extension (buffer-file-name)))))
                ".png")))
  (unless (file-exists-p name)
    (unless (file-writable-p name)
      (error "Cannot create image file"))
    (message "Taking screenshot...")
    (call-process "import" nil nil nil name)
    (message "Taking screenshot...done"))
  (insert (concat "[[" name "]]"))
  (org-display-inline-images))


The changes are:

* LaTeX processing fails if there is more than one period, because
  everything after the first period is considered as the extension,
  which is not recognized as a graphic one.

* Accepts a file name as an argument, defaulting to the current
  directory, so a mere Enter takes a screenshot.  The user may choose
  another directory for taking the screenshot.  Also, if he selects an
  existing file name, a screen shot is not taken and that image is
  reused instead.  That may be useful when the same few images are
  overly used as inlined icons.  Try to not call "import" if the file
  name is plain wrong (no way to create a file under that name).

* No need to have the timestamp in the generated file name, as
  make-temp-name already adds a unique suffix.  No need to have overly
  long names, and if the timestamp is needed, "ls -l" will give it
  anyway.  The prefix of make-temp-name is made absolute, so it better
  checks that the file it creates does not spuriously exist.

* The minibuffer let the user know that a screenshot is expected.

François


P.S. ImageMagick "import" is quick and easy, but has a few limitations,
in that one cannot screenshot popups and menus.  When documenting the
usage of a program with a GUI, there are more flexible tools to take
screenshots in some special circumstances.  Should be parameterizable!
But for the needs I have this week, "import" is quite sufficient. :-)

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-05  4:54     ` François Pinard
@ 2012-01-09 18:27       ` Eric S Fraga
  2012-01-09 20:22         ` François Pinard
  0 siblings, 1 reply; 23+ messages in thread
From: Eric S Fraga @ 2012-01-09 18:27 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>> On Sun, Nov 28, 2010 at 08:35:23PM +0100, David Maus wrote:
>>> At Thu, 18 Nov 2010 18:16:22 +0100, Jonathan BISSON wrote:
>
>>> > Here is a little function that allows a user to insert a screenshot
>>> > easily. Only works on unix-like systems where ImageMagick is installed
>>> > (adapt "import" to your screenshot program if needed).
>
>>> Nice.  Do you mind of I put the function on Org mode'S wiki (Worg) in
>>> the "Org hacks" page?[1]
>
>> I made a minor change. File names are now generated by using the
>> current org buffer filename, plus the date and time, and a unique
>> number. This allows me to sort out the images better.
>
> For my own usage, I modified it further, like below:
>
>
> (defun fp-org-image (name)

[...]

Thanks!  Very nice update.  I'd been using the original code for a while
but prompting for the file name is quite helpful.  However, if I give it
a directory name, the function fails with "Cannot create image file" in
the mini-buffer.  With debug (note: only function name is different):

,----
| Debugger entered--Lisp error: (error "Cannot create image file")
|   signal(error ("Cannot create image file"))
|   error("Cannot create image file")
|   (if (file-writable-p name) nil (error "Cannot create image file"))
|   (unless (file-writable-p name) (error "Cannot create image file"))
|   (if (file-exists-p name) nil (unless (file-writable-p name) (error "Cannot create image file")) (message "Taking screenshot...") (call-process "import" nil nil nil name) (message "Taking screenshot...done"))
|   (unless (file-exists-p name) (unless (file-writable-p name) (error "Cannot create image file")) (message "Taking screenshot...") (call-process "import" nil nil nil name) (message "Taking screenshot...done"))
|   esf/org-screenshot("~/s/test")
|   call-interactively(esf/org-screenshot nil nil)
`----

In summary, if I give it an existing file name, that works; if I give it
a non-existing file name, that also works.  It only fails if I give it a
directory.

thanks,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.66.g1283.dirty)

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-09 18:27       ` Eric S Fraga
@ 2012-01-09 20:22         ` François Pinard
  2012-01-10  8:57           ` Eric S Fraga
  0 siblings, 1 reply; 23+ messages in thread
From: François Pinard @ 2012-01-09 20:22 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> pinard@iro.umontreal.ca (François Pinard) writes:

> Thanks!  However, if I give it a directory name, the function fails
> with "Cannot create image file" in the mini-buffer.  [...]  In
> summary, if I give it an existing file name, that works; if I give it
> a non-existing file name, that also works.  It only fails if I give it
> a directory.

Hi, Eric.  Sorry.  Here is a quick correction for that problem.  This is
only this week that I plan to use that function for actual work; last
week was rather an exploration of the capability of various tools.  Of
course, do not hesitate if you see that I goofed elsewhere! :-).

Thanks, François



(defun fp-org-image (name)
  "Insert a link to an already existing image, or else to a screenshot.
The screenshot is either taken to the given non-existing file name,
or added into the given directory, defaulting to the current one."
  ;; FIXME: Should limit to '("pdf" "jpeg" "jpg" "png" "ps" "eps")
  ;; which is org-export-latex-inline-image-extensions.
  (interactive "GImage name? ")
  (when (file-directory-p name)
    (setq name (concat
                (make-temp-name
                 (concat (file-name-as-directory name)
                         (subst-char-in-string
                          "." "-"
                          (file-name-sans-extension
                           (file-name-nondirectory
                            (buffer-file-name))))))
                ".png")))
  (unless (file-exists-p name)
    (unless (file-writable-p name)
      (debug)
      (error "Cannot create image file"))
    (message "Taking screenshot...")
    (call-process "import" nil nil nil name)
    (message "Taking screenshot...done"))
  (insert (concat "[[" name "]]"))
  (org-display-inline-images))

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-09 20:22         ` François Pinard
@ 2012-01-10  8:57           ` Eric S Fraga
  2012-01-10 14:53             ` François Pinard
  0 siblings, 1 reply; 23+ messages in thread
From: Eric S Fraga @ 2012-01-10  8:57 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

[...]

> Hi, Eric.  Sorry.  Here is a quick correction for that problem.  This is
> only this week that I plan to use that function for actual work; last
> week was rather an exploration of the capability of various tools.  Of
> course, do not hesitate if you see that I goofed elsewhere! :-).

Thanks.  This correction did not work for me out of the box.  I had to
add a call to expand-file-name for getting a file name which worked on
my system for some reason.  I also re-arranged your second (unless ...)
to an (if ...):

#+begin_src emacs-lisp
(defun fp-org-image (name)
  "Insert a link to an already existing image, or else to a screenshot.
The screenshot is either taken to the given non-existing file name,
or added into the given directory, defaulting to the current one."
  ;; FIXME: Should limit to '("pdf" "jpeg" "jpg" "png" "ps" "eps")
  ;; which is org-export-latex-inline-image-extensions.
  (interactive "GImage name? ")
  (when (file-directory-p name)
    (setq name (concat
                (make-temp-name
                 (expand-file-name
                  (concat (file-name-as-directory name)
                          (subst-char-in-string
                           "." "-"
                           (file-name-sans-extension
                            (file-name-nondirectory
                             (buffer-file-name)))))))
                ".png")))
  (unless (file-exists-p name)
    (if (file-writable-p name)
        (progn
          (message "Taking screenshot into %s" name)
          (call-process "import" nil nil nil name)
          (message "Taking screenshot...done"))
      (error "Cannot create image file")))
  (insert (concat "[[" name "]]"))
  (org-display-inline-images))
#+end_src

This now appears to work (for me).

Thanks again,
eric
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.67.g56c73)

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10  8:57           ` Eric S Fraga
@ 2012-01-10 14:53             ` François Pinard
  2012-01-10 16:08               ` Eric S Fraga
  0 siblings, 1 reply; 23+ messages in thread
From: François Pinard @ 2012-01-10 14:53 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

Hi again, Eric.  I'll be using your corrections on the code, thanks!

> I had to add a call to expand-file-name for getting a file name which
> worked on my system for some reason.

  (make-temp-name
   (expand-file-name
    (concat (file-name-as-directory name)
            (subst-char-in-string
             "." "-"
             (file-name-sans-extension
              (file-name-nondirectory
               (buffer-file-name)))))))
  ".png")))

Not a big deal, but I wonder if it should not rather be:

  (make-temp-name
   (concat (expand-file-name
            (file-name-as-directory name))
           (subst-char-in-string
            "." "-"
            (file-name-sans-extension
             (file-name-nondirectory
              (buffer-file-name))))))

as there is nothing to expand in the base part of the file name?

> I also re-arranged your second (unless ...)  to an (if ...):

  (if (file-writable-p name)
      (progn
        (message "Taking screenshot into %s" name)
        (call-process "import" nil nil nil name)
        (message "Taking screenshot...done"))
    (error "Cannot create image file"))

I kept it, but I might likely revert it back routinely to the earlier
state, if I later happen to revisit that code.

Just to show you how maniacal I may be, let me explain.  I just do not
like "(progn ...)", and make stunts to avoid it.  I would rather write:

  (if (not (file-writable-p name))
      (error "Cannot create image file")
    (message "Taking screenshot into %s" name)
    (call-process "import" nil nil nil name)
    (message "Taking screenshot...done"))

Then, besides a few exceptions, I generally do not like else clauses
after returning or other escaping statements, so the above becomes:

  (if (not (file-writable-p name))
      (error "Cannot create image file"))
  (message "Taking screenshot into %s" name)
  (call-process "import" nil nil nil name)
  (message "Taking screenshot...done")

Finally, I avoid "(not ...)" when this is easily done.  I will always
exchange the two branches of an "if" to get rid of one (unless it would
imply re-introducing "(progn ..."), as progn is uglier than not :-).
Easier here, as "(if (not ...))" may be rewritten "(unless ...)".

By the way, "(when ...)" is always nicer than a single-branched "if".

Scheme is especially irritating.  They said it is minimalist, and yet,
they have many ways to write conditional code, forcing me to choose
constantly.  I will turn "(if ...)"  into "(cond ...)" if a "(begin
...)"  becomes necessary on either branch.  And a "(cond ...)" back to
an "(if ...)" if while simplifying a cond, I see it could written to an
if without begin.  And there is always this stretch towards tail
recursion, and so many ways to reuse or not local variables as
arguments, doing so.  Irritating I say.  And yet, I love this language.

Maniacal I am, really!

François

P.S. If you happen to grok French, you might have fun reading me (or
making fun of me reading...):

  http://icule.blogspot.com/1997/02/dieu-la-douleur-et-l.html

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 14:53             ` François Pinard
@ 2012-01-10 16:08               ` Eric S Fraga
  2012-01-10 19:27                 ` François Pinard
  0 siblings, 1 reply; 23+ messages in thread
From: Eric S Fraga @ 2012-01-10 16:08 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
> Hi again, Eric.  I'll be using your corrections on the code, thanks!

You're welcome!

>> I had to add a call to expand-file-name for getting a file name which
>> worked on my system for some reason.
>
>   (make-temp-name
>    (expand-file-name
>     (concat (file-name-as-directory name)
>             (subst-char-in-string
>              "." "-"
>              (file-name-sans-extension
>               (file-name-nondirectory
>                (buffer-file-name)))))))
>   ".png")))
>
> Not a big deal, but I wonder if it should not rather be:
>
>   (make-temp-name
>    (concat (expand-file-name
>             (file-name-as-directory name))
>            (subst-char-in-string
>             "." "-"
>             (file-name-sans-extension
>              (file-name-nondirectory
>               (buffer-file-name))))))
>
> as there is nothing to expand in the base part of the file name?

Yes, this would be equivalent in this case.  I guess I prefer the
former but only for reasons of style!

>> I also re-arranged your second (unless ...)  to an (if ...):
>
>   (if (file-writable-p name)
>       (progn
>         (message "Taking screenshot into %s" name)
>         (call-process "import" nil nil nil name)
>         (message "Taking screenshot...done"))
>     (error "Cannot create image file"))
>
> I kept it, but I might likely revert it back routinely to the earlier
> state, if I later happen to revisit that code.

> Just to show you how maniacal I may be, let me explain.  I just do not
> like "(progn ...)", and make stunts to avoid it.  I would rather
> write:

Well, the progn is only there because of the debugging messages I needed
to see what was happening... I should probably get to grips with the
debugger instead :(

[...]

> Maniacal I am, really!

No, simply differing styles!  I appreciate your reasoning in each case
I've elided but, in the end, the different versions or approaches you
mention are all essentially equivalent (computationally)... :-)

> François
>
> P.S. If you happen to grok French, you might have fun reading me (or
> making fun of me reading...):
>
>   http://icule.blogspot.com/1997/02/dieu-la-douleur-et-l.html

I grok French a little (as a Canadian, albeit one from the west...) so
will have a look at this when I am back online!

Thanks again,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.69.gfadca)

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 16:08               ` Eric S Fraga
@ 2012-01-10 19:27                 ` François Pinard
  2012-01-10 19:46                   ` Skip Collins
  2012-01-10 20:26                   ` Eric S Fraga
  0 siblings, 2 replies; 23+ messages in thread
From: François Pinard @ 2012-01-10 19:27 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I appreciate your reasoning in each case I've elided but, in the end,
> the different versions or approaches you mention are all essentially
> equivalent (computationally)... :-)

Who cares about computation! :-)

Some sad people think of me as a programmer.  While deep down, I am
fundamentally an artist.  Programming is mere mean of expression :-).

> Thanks again,

I'm the one thanking you!

François

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 19:27                 ` François Pinard
@ 2012-01-10 19:46                   ` Skip Collins
  2012-01-11  5:50                     ` Jambunathan K
  2012-01-14 21:35                     ` François Pinard
  2012-01-10 20:26                   ` Eric S Fraga
  1 sibling, 2 replies; 23+ messages in thread
From: Skip Collins @ 2012-01-10 19:46 UTC (permalink / raw)
  To: emacs-org list

2012/1/10 François Pinard <pinard@iro.umontreal.ca>:
> Some sad people think of me as a programmer.  While deep down, I am
> fundamentally an artist.  Programming is mere mean of expression :-).

You and Jambunathan K. should form a club.

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 19:27                 ` François Pinard
  2012-01-10 19:46                   ` Skip Collins
@ 2012-01-10 20:26                   ` Eric S Fraga
  1 sibling, 0 replies; 23+ messages in thread
From: Eric S Fraga @ 2012-01-10 20:26 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> Some sad people think of me as a programmer.  While deep down, I am
> fundamentally an artist.  Programming is mere mean of expression :-).

Hence:

D Knuth: The Art of computer programming
https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming

or programming for expression (well, a form of art) instead:

Prusinkiewicz & Lindenmayer (1990), The algorithmic beauty of plants
[[http://algorithmicbotany.org/papers/#abop]]

You can download the latter from the site!

Anyway, totally and utterly OT! :-)  I'm done!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.73.gd2b3d)

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 19:46                   ` Skip Collins
@ 2012-01-11  5:50                     ` Jambunathan K
  2012-01-12  5:26                       ` Skip Collins
  2012-01-14 21:35                     ` François Pinard
  1 sibling, 1 reply; 23+ messages in thread
From: Jambunathan K @ 2012-01-11  5:50 UTC (permalink / raw)
  To: Skip Collins; +Cc: emacs-org list

Skip Collins <skip.collins@gmail.com> writes:

> 2012/1/10 François Pinard <pinard@iro.umontreal.ca>:
>> Some sad people think of me as a programmer.  While deep down, I am
>> fundamentally an artist.  Programming is mere mean of expression :-).
>
> You and Jambunathan K. should form a club.

Since I am being dragged in to the conversaion, I am digging out a
reddit post that resonated with me (in a totally different setting).

The clincher is actually the last paragraph and you need to read the
first few paragraphs to enjoy the last one. 


There is also a story at the end of this post for everyone to ponder
about.

,---- From http://www.reddit.com/r/Buddhism/comments/if08k/when_did_you_first_discover_the_illusory_nature/
| At some point in my teens I'd started doing C programming. If you
| don't know, computer code is usually formatted in a systematic way to
| make it easier to read. Most languages give you a lot of freedom in
| this, so every project has its own coding conventions.
| 
| I was really into Linux and assumed Linus Torvalds was probably the
| most wonderful genius hacker of all time. He's got his own write-up
| about the Linux kernel coding style, which you can read here if you
| happen to be interested. Some quotes:
| 
|     First off, I'd suggest printing out a copy of the GNU coding
|     standards, and NOT read it. Burn them, it's a great symbolic
|     gesture.
| 
|     [...]
| 
|     Tabs are 8 characters, and thus indentations are also 8
|     characters. There are heretic movements that try to make
|     indentations 4 (or even 2! [this is the GNU standard]) characters
|     deep, and that is akin to trying to define the value of PI to be
|     3.
| 
|     [...]
| 
|     You've probably been told by your long-time Unix user helper that
|     "GNU emacs" automatically formats the C sources for you, and
|     you've noticed that yes, it does do that, but the defaults it uses
|     are less than desirable (in fact, they are worse than random
|     typing - an infinite number of monkeys typing into GNU emacs would
|     never make a good program).
| 
| So I read this at an impressionable age and it all seemed very obvious
| and plainly true. Linux kernel source code, you could tell by just the
| aesthetic impression of the code style, was fast, clean, and smart. It
| looked good. On the other hand, the source code for GNU projects had a
| weird & ugly style.
| 
| Here's some Linux-style code:
| 
| static char *concat(char *s1, char *s2)
| {
|         while (x == y) {
|                 something();
|                 somethingelse();
|          }
|          finalthing();
| }
| 
| Here's the corresponding GNU-style code:
| 
| static char *
| concat (char *s1, char *s2)
| {
|   while (x == y)
|     {
|       something ();
|       somethingelse ();
|     }
|   finalthing ();
| }
| 
| But then I started using GNU Emacs and became fascinated by the
| founder of GNU, Richard Stallman, who wrote Emacs and popularized this
| coding convention. I gradually began to think Linus was kind of
| annoying and not as profoundly creative as rms (as Mr. Stallman is
| known).
| 
| Then one day I noticed that Linux kernel code looked weird & ugly and
| GNU code looked fast, clean, and smart. This was now the obvious and
| plain truth. When I noticed myself feeling like this, it was obvious
| that something was seriously weird with the aesthetic sense.
| 
| And that's when I realized that subconscious judgments filter
| experience in a very strange way. So I couldn't really trust myself
| anymore. It was like glimpsing some uncanny fluttering in the veils of
| my ego delusion... dun dun dun!
| 
| How weird is this story?
`----

My own opinion on the matter is: 

Great hackers have *a* style and stick religiously to it. But they
remain steady and productive (even) when working with a dump (pun
intended) from a different school.

,---- From http://users.rider.edu/~suler/zenstory/concentrate.html
| After winning several archery contests, the young and rather boastful
| champion challenged a Zen master who was renowned for his skill as an
| archer. The young man demonstrated remarkable technical proficiency
| when he hit a distant bull's eye on his first try, and then split that
| arrow with his second shot. "There," he said to the old man, "see if
| you can match that!" Undisturbed, the master did not draw his bow, but
| rather motioned for the young archer to follow him up the
| mountain. Curious about the old fellow's intentions, the champion
| followed him high into the mountain until they reached a deep chasm
| spanned by a rather flimsy and shaky log. Calmly stepping out onto the
| middle of the unsteady and certainly perilous bridge, the old master
| picked a far away tree as a target, drew his bow, and fired a clean,
| direct hit. "Now it is your turn," he said as he gracefully stepped
| back onto the safe ground. Staring with terror into the seemingly
| bottomless and beckoning abyss, the young man could not force himself
| to step out onto the log, no less shoot at a target. "You have much
| skill with your bow," the master said, sensing his challenger's
| predicament, "but you have little skill with the mind that lets loose
| the shot."
`----

Jambunathan K.
-- 

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-11  5:50                     ` Jambunathan K
@ 2012-01-12  5:26                       ` Skip Collins
  2012-01-12  6:26                         ` Thomas S. Dye
  0 siblings, 1 reply; 23+ messages in thread
From: Skip Collins @ 2012-01-12  5:26 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-org list

On Wed, Jan 11, 2012 at 12:50 AM, Jambunathan K <kjambunathan@gmail.com> wrote:
>> You and Jambunathan K. should form a club.
>
> Since I am being dragged in to the conversaion,

Of course I intend no disrespect for you or François. I have noticed
that org, perhaps not surprisingly, attracts people with a certain
detail-oriented aesthetic, similar in some ways to Knuth's obsessive
perfectionism. While Francois fancies himself an artist who works in
the medium of code, I suspect that most of those afflicted with OCD
(Org Compulsive Disorder) are closer in spirit to the artisan or
craftsman than to the artist.

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-12  5:26                       ` Skip Collins
@ 2012-01-12  6:26                         ` Thomas S. Dye
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas S. Dye @ 2012-01-12  6:26 UTC (permalink / raw)
  To: Skip Collins; +Cc: emacs-org list, Jambunathan K

Hi Skip,

I love OCD!  Thanks for that one.

And, thank goodness the Org mode community is big enough for artists,
artisans, and crafts people.  

I find it fascinating to use software created by such a diverse
community.  I've often thought I'm glimpsing the future.

All the best,
Tom


Skip Collins <skip.collins@gmail.com> writes:

> On Wed, Jan 11, 2012 at 12:50 AM, Jambunathan K <kjambunathan@gmail.com> wrote:
>>> You and Jambunathan K. should form a club.
>>
>> Since I am being dragged in to the conversaion,
>
> Of course I intend no disrespect for you or François. I have noticed
> that org, perhaps not surprisingly, attracts people with a certain
> detail-oriented aesthetic, similar in some ways to Knuth's obsessive
> perfectionism. While Francois fancies himself an artist who works in
> the medium of code, I suspect that most of those afflicted with OCD
> (Org Compulsive Disorder) are closer in spirit to the artisan or
> craftsman than to the artist.
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-10 19:46                   ` Skip Collins
  2012-01-11  5:50                     ` Jambunathan K
@ 2012-01-14 21:35                     ` François Pinard
  2012-01-15  6:37                       ` Marcelo de Moraes Serpa
  1 sibling, 1 reply; 23+ messages in thread
From: François Pinard @ 2012-01-14 21:35 UTC (permalink / raw)
  To: emacs-orgmode

Skip Collins <skip.collins@gmail.com> writes:

> 2012/1/10 François Pinard <pinard@iro.umontreal.ca>:
>> Some sad people think of me as a programmer.  While deep down, I am
>> fundamentally an artist.  Programming is mere mean of expression :-).

> You and Jambunathan K. should form a club.

I do not know Jambunathan, but I'll pay attention! :-)

François

P.S. This Org mode mailing list is quite active.  I did not pay
attention in the last few days (being busy elsewhere) and messages
accumulated at a relatively fast pace!

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-14 21:35                     ` François Pinard
@ 2012-01-15  6:37                       ` Marcelo de Moraes Serpa
  2012-01-15 12:10                         ` Russell Adams
  0 siblings, 1 reply; 23+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-01-15  6:37 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

A bit OT, but related.

---
It would be *awesome* if we could somehow hook into the emacs
paste/(drag-and)drop events and automatically "paste" or "drop" the image
in an org buffer. I don't know if it's possible, but I imagine that if
hooking into those events was somehow possible, then we could get the
"event handle" with information regarding the file, and automatically
insert a link to it, and if iimage is activated, it would then render the
image. It would be freaking awesome, this is the only thing I miss from
Evernote.
---

- Marcelo.


2012/1/14 François Pinard <pinard@iro.umontreal.ca>

> Skip Collins <skip.collins@gmail.com> writes:
>
> > 2012/1/10 François Pinard <pinard@iro.umontreal.ca>:
> >> Some sad people think of me as a programmer.  While deep down, I am
> >> fundamentally an artist.  Programming is mere mean of expression :-).
>
> > You and Jambunathan K. should form a club.
>
> I do not know Jambunathan, but I'll pay attention! :-)
>
> François
>
> P.S. This Org mode mailing list is quite active.  I did not pay
> attention in the last few days (being busy elsewhere) and messages
> accumulated at a relatively fast pace!
>
>
>

[-- Attachment #2: Type: text/html, Size: 1800 bytes --]

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-15  6:37                       ` Marcelo de Moraes Serpa
@ 2012-01-15 12:10                         ` Russell Adams
  2012-01-15 19:31                           ` Marcelo de Moraes Serpa
  0 siblings, 1 reply; 23+ messages in thread
From: Russell Adams @ 2012-01-15 12:10 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, Jan 15, 2012 at 12:37:16AM -0600, Marcelo de Moraes Serpa wrote:
> A bit OT, but related.
>
> ---
> It would be *awesome* if we could somehow hook into the emacs
> paste/(drag-and)drop events and automatically "paste" or "drop" the image
> in an org buffer. I don't know if it's possible, but I imagine that if
> hooking into those events was somehow possible, then we could get the
> "event handle" with information regarding the file, and automatically
> insert a link to it, and if iimage is activated, it would then render the
> image. It would be freaking awesome, this is the only thing I miss from
> Evernote.
> ---
>
> - Marcelo.

Emacs has drag'n'drop support. In fact, I've been able to drag and
drop image files from KDE's file manager (dolphin?) into emacs and make
them custom links.

.emacs:
(defun dnd-from-kde (url action)
  (insert url)
  (select-frame-set-input-focus (selected-frame)))

(custom-set-variables
   '(dnd-protocol-alist (quote (("file:///" . dnd-from-kde)))))

This ought to give you a place to start. The URL format may need to
change to make it an Org link, I was using file:// for another text
format.



------------------------------------------------------------------
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] 23+ messages in thread

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-15 12:10                         ` Russell Adams
@ 2012-01-15 19:31                           ` Marcelo de Moraes Serpa
  2012-01-15 21:45                             ` Russell Adams
  0 siblings, 1 reply; 23+ messages in thread
From: Marcelo de Moraes Serpa @ 2012-01-15 19:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

Awesome! I will try that out.

What about hooking into the pasting event and check when it's an image (or
whatever file you want) ?

Thanks,

- Marcelo.

On Sun, Jan 15, 2012 at 6:10 AM, Russell Adams <RLAdams@adamsinfoserv.com>wrote:

> On Sun, Jan 15, 2012 at 12:37:16AM -0600, Marcelo de Moraes Serpa wrote:
> > A bit OT, but related.
> >
> > ---
> > It would be *awesome* if we could somehow hook into the emacs
> > paste/(drag-and)drop events and automatically "paste" or "drop" the image
> > in an org buffer. I don't know if it's possible, but I imagine that if
> > hooking into those events was somehow possible, then we could get the
> > "event handle" with information regarding the file, and automatically
> > insert a link to it, and if iimage is activated, it would then render the
> > image. It would be freaking awesome, this is the only thing I miss from
> > Evernote.
> > ---
> >
> > - Marcelo.
>
> Emacs has drag'n'drop support. In fact, I've been able to drag and
> drop image files from KDE's file manager (dolphin?) into emacs and make
> them custom links.
>
> .emacs:
> (defun dnd-from-kde (url action)
>  (insert url)
>  (select-frame-set-input-focus (selected-frame)))
>
> (custom-set-variables
>   '(dnd-protocol-alist (quote (("file:///" . dnd-from-kde)))))
>
> This ought to give you a place to start. The URL format may need to
> change to make it an Org link, I was using file:// for another text
> format.
>
>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
>

[-- Attachment #2: Type: text/html, Size: 2418 bytes --]

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

* Re: [Orgmode] Automatic screenshot insertion
  2012-01-15 19:31                           ` Marcelo de Moraes Serpa
@ 2012-01-15 21:45                             ` Russell Adams
  0 siblings, 0 replies; 23+ messages in thread
From: Russell Adams @ 2012-01-15 21:45 UTC (permalink / raw)
  To: emacs-orgmode

Marcelo,

You can check out the Emacs DND (drag-n-drop) help files for more
information. I'm not sure what other capabilities it has. I know that
I was subscribing my function to the files event only, there were a
few other types.

Thanks.

On Sun, Jan 15, 2012 at 01:31:02PM -0600, Marcelo de Moraes Serpa wrote:
> Awesome! I will try that out.
>
> What about hooking into the pasting event and check when it's an image (or
> whatever file you want) ?
>
> Thanks,
>
> - Marcelo.
>
> On Sun, Jan 15, 2012 at 6:10 AM, Russell Adams <RLAdams@adamsinfoserv.com>wrote:
>
> > On Sun, Jan 15, 2012 at 12:37:16AM -0600, Marcelo de Moraes Serpa wrote:
> > > A bit OT, but related.
> > >
> > > ---
> > > It would be *awesome* if we could somehow hook into the emacs
> > > paste/(drag-and)drop events and automatically "paste" or "drop" the image
> > > in an org buffer. I don't know if it's possible, but I imagine that if
> > > hooking into those events was somehow possible, then we could get the
> > > "event handle" with information regarding the file, and automatically
> > > insert a link to it, and if iimage is activated, it would then render the
> > > image. It would be freaking awesome, this is the only thing I miss from
> > > Evernote.
> > > ---
> > >
> > > - Marcelo.
> >
> > Emacs has drag'n'drop support. In fact, I've been able to drag and
> > drop image files from KDE's file manager (dolphin?) into emacs and make
> > them custom links.
> >
> > .emacs:
> > (defun dnd-from-kde (url action)
> >  (insert url)
> >  (select-frame-set-input-focus (selected-frame)))
> >
> > (custom-set-variables
> >   '(dnd-protocol-alist (quote (("file:///" . dnd-from-kde)))))
> >
> > This ought to give you a place to start. The URL format may need to
> > change to make it an Org link, I was using file:// for another text
> > format.
> >
> >
> >
> > ------------------------------------------------------------------
> > Russell Adams                            RLAdams@AdamsInfoServ.com
> >
> > PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
> >
> > Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
> >
> >


------------------------------------------------------------------
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] 23+ messages in thread

end of thread, other threads:[~2012-01-15 21:45 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 17:16 Automatic screenshot insertion Jonathan BISSON
2010-11-18 17:50 ` Sébastien Vauban
2010-11-28 19:35 ` David Maus
2011-03-29 14:43   ` [Orgmode] " Russell Adams
2011-06-06 18:59     ` David Maus
2012-01-05  4:54     ` François Pinard
2012-01-09 18:27       ` Eric S Fraga
2012-01-09 20:22         ` François Pinard
2012-01-10  8:57           ` Eric S Fraga
2012-01-10 14:53             ` François Pinard
2012-01-10 16:08               ` Eric S Fraga
2012-01-10 19:27                 ` François Pinard
2012-01-10 19:46                   ` Skip Collins
2012-01-11  5:50                     ` Jambunathan K
2012-01-12  5:26                       ` Skip Collins
2012-01-12  6:26                         ` Thomas S. Dye
2012-01-14 21:35                     ` François Pinard
2012-01-15  6:37                       ` Marcelo de Moraes Serpa
2012-01-15 12:10                         ` Russell Adams
2012-01-15 19:31                           ` Marcelo de Moraes Serpa
2012-01-15 21:45                             ` Russell Adams
2012-01-10 20:26                   ` Eric S Fraga
2011-02-03 13:33 ` 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).