alphapapa / alphapapa/org-protocol-capture-html

URL in buffer name, not capturing

Abierto
#27 24 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Emacs Lisp
Estrellas
461
Forks
41
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This is a similar issue to #26 "Strange emacs buffer instead of capture buffer".

Ubuntu 17.10
Emacs 25.2.2
Chrome and Firefox
emacs -Q

```

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)

(package-install 's)
(add-to-list 'load-path "~/tmp/org-protocol-capture-html")

(require 'org)
(require 'org-capture)
(require 'org-protocol)
(require 'org-protocol-capture-html)
(server-start)

(setq org-capture-templates
'(
("l" "Org-protocol link" entry (file "notes.org") (file "~/.org.d/templates/link.tpl"))
("w" "Web site" entry (file "") "* %a :website:\n\n%U %?\n\n%i")
)

```

This works for the `l` command:

```
javascript:(function () { window.location.href='org-protocol://capture://l/' +encodeURIComponent(window.location.href)+'/' +encodeURIComponent(document.title)+'/' +encodeURIComponent(window.getSelection()); })();
```

but this one does not:
```
javascript:location.href = 'org-protocol://capture-eww-readable?template=w&url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title || "[untitled page]");
```

I just get this buffer name:

```
?template=w&url=https%3A%2F%2Fgithub.com%2Falphapapa%2Forg-protocol-capture-html&title=alphapapa%2Forg-protocol-capture-html%3A%20Capture%20HTML%20from%20the%20browser%20selection%20into%20Emacs%20as%20org-mode%20content
```
Tried debugging a bit

This works, `(org-protocol-capture-html--url-html "http://github.com")`.

But not sure what I'm supposed to pass to `org-protocol-capture-html--capture-eww-readable`, if that's the right way to proceed.

Alternatively, since `org-protocol://capture:` works, I should be able to just use a `%(...)` function call in my template file, but I'm not sure what function to put there (or what its arguments should be).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.