Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot archive recursively #9

Open
JanPappert opened this issue Mar 26, 2017 · 9 comments
Open

Cannot archive recursively #9

JanPappert opened this issue Mar 26, 2017 · 9 comments

Comments

@JanPappert
Copy link

Hey,

I tried the example in the readme:

** TODO Linkers (20-part series)
:PROPERTIES:
:URL: http://a3f.at/lists/linkers
:WGET_OPTIONS: --recursive -l 1
:END:

However, I am presented with the following error:


wget: --level: Invalid number ‘--recursive’.

/usr/bin/wget --directory-prefix=/home/user/Desktop/data/fb/6116da-9306-4f66-9daf-68199290e668/2017-03-27T01:33:16Z// "-e robots=off" --page-requisites --adjust-extension --convert-links 1 -l --recursive http://a3f.at/lists/linkers exited abnormally with code 2

Archiving without the WGET_OPTIONS does work, however.
Recursively archiving with wget in the terminal works as well.

I should note that I also got the following error when running org-board-keymap:
Autoloading failed to define function org-board-keymap

Hoping to find some help here, the package itself looks promising.

Cheers

@charlesroelli
Copy link
Owner

charlesroelli commented Mar 27, 2017 via email

@JanPappert
Copy link
Author

JanPappert commented Mar 27, 2017

I just copied it so I suppose that I did not do the ol' switcheroo.
I'll just post the output of the org-board-wget-call buffer since it's not the same for all variations:

** TODO Linkers (20-part series)
:PROPERTIES:
:URL: http://a3f.at/lists/linkers
:WGET_OPTIONS: --recursive -l 1
:END:

yields

wget: --level: Invalid number ‘--recursive’.

/usr/bin/wget --directory-prefix=/home/jpappert/Desktop/data/95/f5272c-c122-4ee2-af43-4f7c4b821e92/2017-03-27T15:11:39Z// "-e robots=off" --page-requisites --adjust-extension --convert-links 1 -l --recursive http://a3f.at/lists/linkers exited abnormally with code 2

while

** TODO Linkers (20-part series)
:PROPERTIES:
:URL: http://a3f.at/lists/linkers
:WGET_OPTIONS: --recursive -layers 1
:END:

yields

wget: --level: Invalid number ‘ayers’.

/usr/bin/wget --directory-prefix=/home/jpappert/Desktop/data/25/aad3e9-9607-433c-a47d-cef3f8724f7c/2017-03-27T15:15:23Z// "-e robots=off" --page-requisites --adjust-extension --convert-links 1 -layers --recursive http://a3f.at/lists/linkers exited abnormally with code 2

I really hope we can resolve this. Archiving bookmarks like this sounds great!
It should be noted that I installed it using melpa, perhaps it would be better if I clone it from github and add it to my loadpath?

@charlesroelli
Copy link
Owner

Turns out I introduced this bug in commit 3ddccc0. I accidentally reversed the list of WGET_OPTIONS while processing it, which caused the undesirable behavior. Please do clone the latest version from here and try it out.

Also, I realized that the suggested example will not natively recurse into the list of sites given by the URL property, since I removed the behavior of `wget' spanning multiple hosts by default (it can result in unnecessarily thorough archives of certain sites). So I have added it back into the example to make it work. Please try out the new example instead.

@JanPappert
Copy link
Author

Hey,

your commit solves the issue for me, the example allows me to recursively archive websites.
Which means this package just earned a star. :)

I should note that the org-board-keymap issue remains (though it isn't a big deal for me, I just added the keybindings I value in use-package).

Another suggestion: While I suppose that some people use eww, I would guess that most users still use other browsers. Consider switching the default behaviour to org-board-default-browser 'system in order to appeal to a larger audience.

@charlesroelli
Copy link
Owner

Glad to hear that the main issue is fixed. It shows that I should really write some tests.

I've made the definition for org-board-keymap more orthodox now, and it should be picked up by the autoload generation. Could you please test the new version? It's commit 405bfd6, version 1018. Thank you.

@JanPappert
Copy link
Author

JanPappert commented Apr 3, 2017

Hey,
so I played around with the new commit:
Opening archives with eww seems really slow for some reason, it froze my emacs for like 20 seconds..
Concerning the keymap:
If I put
(global-set-key (kbd "C-c o") 'org-board-keymap)
into my dotfile I will receive the error

Wrong type argument: commandp, org-board-keymap

If I change it to
(global-set-key(kbd "C-c o") (lambda () (interactive) (org-board-keymap)))
I receive

Symbol's function definition is void: org-board-keymap

Cheers

@charlesroelli
Copy link
Owner

About org-board-keymap, it's a typo in the commentary! Sorry about that. It should be

(global-set-key (kbd "C-c o") org-board-keymap)

(i.e. org-board-keymap should be unquoted, since we want to set the key C-c o to the value of the variable naming the keymap, and not a symbol referencing the variable). I've fixed this in commit 1daf7bb.

The Emacs browser works reasonably fast for me, but what can take a while is searching the archive to find the correct file to open when you run org-board-open. The code that does this is not very smart. Could you please profile a slow run of it, using the instructions here: https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html (you can profile by CPU since memory is unlikely to be an issue for this use case). That should point to the bottleneck in the code, if it's where the problem is.

@JanPappert
Copy link
Author

Alright, I tried that but didn't really know how to share the output.
Hope this helps;
CPU-Profiler-Report.txt

@charlesroelli
Copy link
Owner

Hm, this looks more like an inefficiency in the Emacs browser, and not in org-board. Does the same slowdown occur when you load the page normally (i.e. via the web)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants