emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alexander Vorobiev <alexander.vorobiev@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] org-compat: Support for getting data from Windows clipboard
Date: Sun, 17 Nov 2013 18:31:13 -0600	[thread overview]
Message-ID: <CAGOCFPUGkJxaxFjvyn8p1qHRh5Fg80kxVNxFfRyboq+CM7wX2g@mail.gmail.com> (raw)
In-Reply-To: <878uwn7837.fsf@bzg.ath.cx>


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

Hi Bastien,

Sorry for the mis-formatting. Here is the patch as an attachment.

Thanks,
Alex


On Sun, Nov 17, 2013 at 2:20 AM, Bastien <bzg@gnu.org> wrote:

> Hi Alexander,
>
> Alexander Vorobiev <alexander.vorobiev@gmail.com> writes:
>
> > I noticed that %x capture template doesn't work under Windows which
> > made my templates non-portable, so I made this small change to
> > org-get-x-clipboard to fix that. This is my very first patch, please
> > let me know if it is acceptable.
>
> The patch looks good but it got mangled by the HTML format of
> the email.  Can you resend it as an attachement?
>
> Thanks!
>
> --
>  Bastien
>

[-- Attachment #1.2: Type: text/html, Size: 1193 bytes --]

[-- Attachment #2: 0001-org-compat-Support-for-getting-data-from-Windows-cli.patch --]
[-- Type: application/octet-stream, Size: 1314 bytes --]

From 68fc5ea5492d9ba1e85c2ac11af34ae0f5bcefaa Mon Sep 17 00:00:00 2001
From: Alexander Vorobiev <alexander.vorobiev@gmail.com>
Date: Sun, 17 Nov 2013 18:27:14 -0600
Subject: [PATCH] org-compat: Support for getting data from Windows clipboard

* lisp/org-compat.el (org-get-x-clipboard): Use w32-get-clipboard-data
to get the clipboard data under Windows.

TINYCHANGE
---
 lisp/org-compat.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index b714f13..a3eb960 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -190,10 +190,12 @@ If DELETE is non-nil, delete all those overlays."
     found))
 
 (defun org-get-x-clipboard (value)
-  "Get the value of the x clipboard, compatible with XEmacs, and GNU Emacs 21."
-  (if (eq window-system 'x)
-      (let ((x (org-get-x-clipboard-compat value)))
-	(if x (org-no-properties x)))))
+  "Get the value of the x or Windows clipboard, compatible with XEmacs, and GNU Emacs 21."
+  (cond ((eq window-system 'x)
+	 (let ((x (org-get-x-clipboard-compat value)))
+	   (if x (org-no-properties x))))
+	((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data))
+	 (w32-get-clipboard-data))))
 
 (defsubst org-decompose-region (beg end)
   "Decompose from BEG to END."
-- 
1.8.4.msysgit.0


  reply	other threads:[~2013-11-18  0:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17  0:42 [PATCH] org-compat: Support for getting data from Windows clipboard Alexander Vorobiev
2013-11-17  8:20 ` Bastien
2013-11-18  0:31   ` Alexander Vorobiev [this message]
2013-11-18  9:25     ` Bastien
2013-11-18 11:34       ` Fabrice Popineau
2013-11-19  4:53         ` Alexander Vorobiev
2013-11-19  9:40           ` Bastien
2013-11-21 23:21             ` Alexander Vorobiev
2013-11-22  9:54               ` Bastien
2013-11-24 21:37                 ` Alexander Vorobiev

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=CAGOCFPUGkJxaxFjvyn8p1qHRh5Fg80kxVNxFfRyboq+CM7wX2g@mail.gmail.com \
    --to=alexander.vorobiev@gmail.com \
    --cc=bzg@gnu.org \
    --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).