aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/org/org-protocol.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-protocol.el')
-rw-r--r--lisp/org/org-protocol.el17
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:
194 :working-suffix \".org\" 194 :working-suffix \".org\"
195 :base-url \"http://localhost/org/\" 195 :base-url \"http://localhost/org/\"
196 :working-directory \"/home/user/org/\" 196 :working-directory \"/home/user/org/\"
197 :rewrites ((\"org/?$\" . \"index.php\"))))) 197 :rewrites ((\"org/?$\" . \"index.php\")))
198 (\"Hugo based blog\"
199 :base-url \"https://www.site.com/\"
200 :working-directory \"~/site/content/post/\"
201 :online-suffix \".html\"
202 :working-suffix \".md\"
203 :rewrites ((\"\\(https://site.com/[0-9]+/[0-9]+/[0-9]+/\\)\" . \".md\")))))
204
198 205
199 The last line tells `org-protocol-open-source' to open 206 The last line tells `org-protocol-open-source' to open
200 /home/user/org/index.php, if the URL cannot be mapped to an existing 207 /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:
556 ;; Try to match a rewritten URL and map it to 563 ;; Try to match a rewritten URL and map it to
557 ;; a real file. Compare redirects without 564 ;; a real file. Compare redirects without
558 ;; suffix. 565 ;; suffix.
559 (when (string-match-p (car rewrite) f1) 566 (when (string-match (car rewrite) f1)
560 (throw 'result (concat wdir (cdr rewrite)))))))) 567 (let ((replacement
568 (concat (directory-file-name
569 (replace-match "" nil nil f1 1))
570 (cdr rewrite))))
571 (throw 'result (concat wdir replacement))))))))
561 ;; -- end of redirects -- 572 ;; -- end of redirects --
562 573
563 (if (file-readable-p the-file) 574 (if (file-readable-p the-file)