charlesroelli / org-board

Org mode's web archiver.
GNU General Public License v3.0
279 stars 18 forks source link

Some minor fixes #29

Open swapneils opened 1 year ago

swapneils commented 1 year ago

Fix #27 by ensuring the point is placed at the relevant bookmark entry when org-mode functions are called, using save-window-excursion and save-mark-and-excursion to keep this from affecting user experience.

Major note: As with the original code, the buffer needs to be saved manually.

Minor note: Sometimes the wget process doesn't finish by the time org-mode notices the ARCHIVED_AT link, so it initially appears dead. Waiting until the process finishes and [saving and] refreshing the buffer fixes this.

Minor note: This doesn't suppress the wget buffer, it just keeps it from appearing on-screen.

charlesroelli commented 1 year ago

Thanks a lot for taking this initiative! Please see comments above.

swapneils commented 1 year ago

Some people might be running this on old emacs versions without cl-lib required, so refactored to use dolist (escaping with a custom error when a valid browser is found) instead of (require 'cl-lib).

As for the repeating org-id-goto, sometimes the point would move to the process buffer during the property-assignment. Not sure why, but to be safe I've moved org-display-outline-path to the let bindings.

charlesroelli commented 1 year ago

Thanks for the fixes! Will merge this after some more local testing.

charlesroelli commented 1 year ago

Hm, I got an error org-id-goto: Cannot find entry with ID "B7AC258E-FE9D-402D-95A8-982A0B534D38" when running org-board-archive from this branch in a test file with contents:

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

in Emacs 28.2. Then I ran org-board-archive again and it worked! I'm not sure if the error is related specifically to this branch or if this problem already exists in the org-board master branch when running on Emacs 28.2. I need to add some tests...