Permalink
Browse files

Properly generate the keymap menu for grabbing links based on user's …

…customizations
  • Loading branch information...
1 parent 549b969 commit ad98e175227449b1a6d712a0785575dd70a12800 alander committed Apr 2, 2010
Showing with 10 additions and 11 deletions.
  1. +10 −11 lisp/org-mac-link-grabber.el
@@ -45,42 +45,42 @@ applications and inserting them in org documents"
:tag "Org Mac link grabber"
:group 'org-link)
-(defcustom org-mac-grab-Finder.app-p t
+(defcustom org-mac-grab-Finder-app-p t
"Enable menu option [F]inder to grab links from the Finder"
:tag "Grab Finder.app links"
:group 'org-mac-link-grabber
:type 'boolean)
-(defcustom org-mac-grab-Mail.app-p t
+(defcustom org-mac-grab-Mail-app-p t
"Enable menu option [m]ail to grab links from Mail.app"
:tag "Grab Mail.app links"
:group 'org-mac-link-grabber
:type 'boolean)
-(defcustom org-mac-grab-Firefox.app-p t
+(defcustom org-mac-grab-Firefox-app-p t
"Enable menu option [f]irefox to grab links from Firefox.app"
:tag "Grab Firefox.app links"
:group 'org-mac-link-grabber
:type 'boolean)
-(defcustom org-mac-grab-Together.app-p nil
+(defcustom org-mac-grab-Together-app-p nil
"Enable menu option [t]ogether to grab links from Together.app"
:tag "Grab Together.app links"
:group 'org-mac-link-grabber
:type 'boolean)
;; Define key bindings. C-g is the prefix key to grab links.
-(let* ((descriptors '(("F" "inder" org-mac-finder-insert-selected org-mac-grab-Finder.app-p)
- ("m" "ail" org-mac-message-insert-selected org-mac-grab-Mail.app-p)
- ("f" "irefox" org-mac-firefox-insert-frontmost-url org-mac-grab-Firefox.app-p)
- ("t" "ogether" org-mac-together-insert-selected org-mac-grab-Together.app-p)))
+(let* ((descriptors `(("F" "inder" org-mac-finder-insert-selected ,org-mac-grab-Finder-app-p)
+ ("m" "ail" org-mac-message-insert-selected ,org-mac-grab-Mail-app-p)
+ ("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p)
+ ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p)))
(menu-string (make-string 0 ?x)))
(mapc '(lambda (descriptor)
"Create the menu string for the keymap"
(when (elt descriptor 3)
- (setf menu-string (concat menu-string "[" (elt descriptor 0) "]" (elt descriptor 1) " "))))
+ (setf menu-string (concat menu-string "[" (elt descriptor 0) "]" (elt descriptor 1) " "))))
descriptors)
(setf menu-string (substring menu-string 0 -1)) ; Remove trailing space
@@ -97,7 +97,6 @@ applications and inserting them in org documents"
; And C-g to quit
(define-key org-mac-grab-link-keymap (kbd "C-g") 'keyboard-quit))
-
(defun org-mac-paste-applescript-links (as-link-list)
"Paste in a list of links from an applescript handler. The
@@ -272,4 +271,4 @@ applications and inserting them in org documents"
(provide 'org-mac-link-grabber)
-;;; org-mac-link-grabber.el ends here
+;;; org-mac-link-grabber.el ends here

0 comments on commit ad98e17

Please sign in to comment.