浏览代码

org-protocol.el: Bug fix and more

Carsten Dominik 16 年之前
父节点
当前提交
6719985765
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      lisp/org-protocol.el

+ 8 - 4
lisp/org-protocol.el

@@ -294,14 +294,18 @@ If replacement is string, replace the \"/dir/\" prefix with it.
 The first parameter, the one that contains the protocols, is always changed.
 Everything up to the end of the protocols is stripped.
 
-Note, that this function will not work, if you set
-`org-protocol-reverse-list-of-files' to nil!"
-(let* ((l (org-protocol-flatten param-list))
+Note, that this function will always behave as if
+`org-protocol-reverse-list-of-files' was set to t and the returned list will
+reflect that. I.e. emacsclients first parameter will be the first one in the
+returned list."
+(let* ((l (org-protocol-flatten (if org-protocol-reverse-list-of-files
+				    param-list
+				  (reverse param-list))))
       (trigger (car l))
       (len 0)
       dir
       ret)
-  (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-z0-9][-_a-zA-z0-9]*:/+\\\\(.*\\)" trigger)
+  (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-z0-9][-_a-zA-z0-9]*:/+\\)\\(.*\\)" trigger)
     (setq dir (match-string 1 trigger))
     (setq len (length dir))
     (setcar l (concat dir (match-string 3 trigger))))