alphapapa/org-protocol-capture-html

Text selection doesn't work

Opened this issue · 2 comments

wpix commented

Thanks for this wonderful package, much appreciated.

I managed to set up successfully for full page capture. However, whether I select text or not, the function always captured the entire page. I am wondering if I did anything wrong.

(setq org-directory "~/org-notes")
(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cc" 'org-capture)


(defun transform-square-brackets-to-round-ones(string-to-transform)
  "Transforms [ into ( and ] into ), other chars left unchanged."
  (concat 
  (mapcar #'(lambda (c) (if (equal c ?[) ?\( (if (equal c ?]) ?\) c))) string-to-transform))
  )

(setq org-capture-templates
      '(("w" "Web site"
 entry
 (file+olp "~/org-notes/notes.org" "Web")
 "* %c :website:\n%U %?%:initial")))

(setq org-protocol-default-template-key "w")

I am using the first bookmarklet set up for Firefox.

I don't know, sorry. I haven't been using Firefox for a while, and I don't know if the bookmarklet in the readme works properly with all the changes in Firefox's JavaScript/DOM stuff since the readme was written.

If you can, I'd recommend debugging the bookmarklet in Firefox to ensure that the selection works properly. It's possible that the problem is in Emacs or Org, but I'm guessing it's the bookmarklet that needs to be updated.

You might also try simply looking up whatever the currently correct code is for getting the selection content and comparing it to the code in the bookmarklet. Maybe you could just replace the code in the bookmarklet with newer code to do that.

wpix commented

I will keep looking for a solution and will post it here if I configured it right or found the recent version.
This package is very useful. Thanks for your reply and I appreciate the work :)