diff options
author | Rasmus <rasmus@gmx.us> | 2017-09-18 12:01:12 +0200 |
---|---|---|
committer | Rasmus <rasmus@gmx.us> | 2017-09-18 12:01:12 +0200 |
commit | ab351d442d7bb4d17cbb43638aaed1775d8c0344 (patch) | |
tree | 19da4c93526d3de543efe21a53ab2d098fb9f50b /lisp/org/org-protocol.el | |
parent | 5490ccc5ebf39759dfd084bbd31f464701a3e775 (diff) | |
download | emacs-ab351d442d7bb4d17cbb43638aaed1775d8c0344.tar.gz emacs-ab351d442d7bb4d17cbb43638aaed1775d8c0344.tar.bz2 emacs-ab351d442d7bb4d17cbb43638aaed1775d8c0344.zip |
Update Org to v9.1.1
Please see etc/ORG-NEWS for major changes.
Diffstat (limited to 'lisp/org/org-protocol.el')
-rw-r--r-- | lisp/org/org-protocol.el | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 6e61a8dcc34..d92bfc6a158 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -194,7 +194,14 @@ Example: :working-suffix \".org\" :base-url \"http://localhost/org/\" :working-directory \"/home/user/org/\" - :rewrites ((\"org/?$\" . \"index.php\"))))) + :rewrites ((\"org/?$\" . \"index.php\"))) + (\"Hugo based blog\" + :base-url \"https://www.site.com/\" + :working-directory \"~/site/content/post/\" + :online-suffix \".html\" + :working-suffix \".md\" + :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\" . \".md\"))))) + The last line tells `org-protocol-open-source' to open /home/user/org/index.php, if the URL cannot be mapped to an existing @@ -556,8 +563,12 @@ The location for a browser's bookmark should look like this: ;; Try to match a rewritten URL and map it to ;; a real file. Compare redirects without ;; suffix. - (when (string-match-p (car rewrite) f1) - (throw 'result (concat wdir (cdr rewrite)))))))) + (when (string-match (car rewrite) f1) + (let ((replacement + (concat (directory-file-name + (replace-match "" nil nil f1 1)) + (cdr rewrite)))) + (throw 'result (concat wdir replacement)))))))) ;; -- end of redirects -- (if (file-readable-p the-file) |