emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mac-link misplaced quotes?
@ 2013-12-21 17:27 Alexander Poslavsky
  2013-12-22  8:20 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Poslavsky @ 2013-12-21 17:27 UTC (permalink / raw)
  To: Org Mode


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

I regularly use org-mac-link from contrib/. It works fine, but somehow my
links are a bit mangled, I get:

[["http://orgmode.org/worg/org-contribute.html#sec-4][How to contribute to
Org?"]]

Instead of:

[[http://orgmode.org/worg/org-contribute.html#sec-4][How to contribute to
Org?]]

(Notice the quotation-marks, it's how applescript returns the string)

This small patch fixes that. I hope the patch is done correctly.

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

[-- Attachment #2: 0001-org-as-mac-chrome-get-frontmost-url-fix-to-remove-un.patch --]
[-- Type: application/octet-stream, Size: 2313 bytes --]

From c475400cfff5317231e33d1cf12bbdc36a507b03 Mon Sep 17 00:00:00 2001
From: Alex Poslavsky <alexander.poslavsky@gmail.com>
Date: Sat, 21 Dec 2013 19:08:27 +0200
Subject: [PATCH] org-as-mac-chrome-get-frontmost-url: fix to remove unneeded
 quotation-marks

* contrib/lisp/org-mac-link.el: applescript returns the link and description in
  quotes like this:

  [["http://orgmode.org/worg/org-contribute.html#sec-4][How to
  contribute to Org?"]]

  The fix changes it to this:

  [[http://orgmode.org/worg/org-contribute.html#sec-4][How to
  contribute to Org?]]

  TINYCHANGE
---
 contrib/lisp/org-mac-link.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index d348c2d..a89847f 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -3,13 +3,13 @@
 ;;
 ;; Copyright (c) 2010-2013 Free Software Foundation, Inc.
 ;;
-;; Authors: 
+;; Authors:
 ;;          Anthony Lander <anthony.lander@gmail.com>
 ;;          John Wiegley <johnw@gnu.org>
 ;;          Christopher Suckling <suckling at gmail dot com>
 ;;          Daniil Frumin <difrumin@gmail.com>
 ;;
-;;          
+;;
 ;; Version: 1.1
 ;; Keywords: org, mac, hyperlink
 ;;
@@ -201,14 +201,14 @@ applications and inserting them in org documents"
                         ("S" "kim" org-mac-skim-insert-page ,org-mac-grab-Skim-app-p)))
          (menu-string (make-string 0 ?x))
          input)
-    
+
     ;; Create the menu string for the keymap
     (mapc '(lambda (descriptor)
             (when (elt descriptor 3)
               (setf menu-string (concat menu-string "[" (elt descriptor 0) "]" (elt descriptor 1) " "))))
           descriptors)
     (setf (elt menu-string (- (length menu-string) 1)) ?:)
-    
+
     ;; Prompt the user, and grab the link
     (message menu-string)
     (setq input (read-char-exclusive))
@@ -368,7 +368,7 @@ applications and inserting them in org documents"
                      "set links to {}\n"
                      "copy theResult to the end of links\n"
                      "return links as string\n"))))
-    (car (split-string result "[\r\n]+" t))))
+    (substring (car (split-string result "[\r\n]+" t)) 1 -1)))
 
 (defun org-mac-chrome-get-frontmost-url ()
   (interactive)
-- 
1.8.5.1


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

* Re: Org-mac-link misplaced quotes?
  2013-12-21 17:27 Org-mac-link misplaced quotes? Alexander Poslavsky
@ 2013-12-22  8:20 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2013-12-22  8:20 UTC (permalink / raw)
  To: Alexander Poslavsky; +Cc: Org Mode

Hi Alexander,

Alexander Poslavsky <alexander.poslavsky@gmail.com> writes:

> I regularly use org-mac-link from contrib/. It works fine, but
> somehow my links are a bit mangled, I get:
>
> [["http://orgmode.org/worg/org-contribute.html#sec-4][How to
> contribute to Org?"]]
>
> Instead of:
>
> [[http://orgmode.org/worg/org-contribute.html#sec-4][How to
> contribute to Org?]]
>
> (Notice the quotation-marks, it's how applescript returns the string)
>
> This small patch fixes that. I hope the patch is done correctly.

Applied, thanks.

I slightly edited your commit message, please check the changes:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=22af33

-- 
 Bastien

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

end of thread, other threads:[~2013-12-22  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-21 17:27 Org-mac-link misplaced quotes? Alexander Poslavsky
2013-12-22  8:20 ` 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).