emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aankhen <aankhen@gmail.com>
To: Aditya Mandayam <adityams@gmail.com>,
	Org mailing list <emacs-orgmode@gnu.org>
Subject: Re: extending automatic screenshot insertion
Date: Fri, 26 Aug 2011 12:59:01 +0530	[thread overview]
Message-ID: <CAKXcKvcp5q4gju0AsX6jycoyh7_xDGTvA1x2YtnjHobh=oBtag@mail.gmail.com> (raw)
In-Reply-To: <CABiTF5N4RRj4-VTNgHzwoyoFFycZRuhxNm9BqDs-dE8gG7OszA@mail.gmail.com>

Hi,

On Thu, Aug 25, 2011 at 15:41, Aditya Mandayam <adityams@gmail.com> wrote:
> i would like to extend the auto screenshot method described here:
> http://comments.gmane.org/gmane.emacs.orgmode/33770
>
> first: a way in which i can be prompted to enter a filename instead of
> having a random string
> second: a timestamp be appended after i have entered the filename
> third: to specify somehow, the dimensions of the bounding box of the screenshot
>
> how can this be done?

Starting from the revised version of the function,[1] here’s how I’d
implement the first two changes:

,----
| (defun org-screenshot ()
|   "Prompt for a filename, add a timestamp, take a screenshot into
that file and insert a link to this file."
|   (interactive)
|   (setq filename
|         (concat (read-string "Save screenshot as (timestamp and
extension will be appended): " (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))
`----

I don’t have the ‘import’ utility so I can’t help there.  It can
probably take arguments to denote the bounding box; have a look at the
documentation for both ‘import’ and ‘call-process’.

Aankhen

[1]: http://permalink.gmane.org/gmane.emacs.orgmode/40271

      reply	other threads:[~2011-08-26  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 10:11 extending automatic screenshot insertion Aditya Mandayam
2011-08-26  7:29 ` Aankhen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKXcKvcp5q4gju0AsX6jycoyh7_xDGTvA1x2YtnjHobh=oBtag@mail.gmail.com' \
    --to=aankhen@gmail.com \
    --cc=adityams@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).