summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-04-10 11:16:07 +0800
committerJSDurand <mmemmew@gmail.com>2022-04-10 11:16:07 +0800
commit6e5a7137328a48a3ae17f654338349ea8bf67d4e (patch)
tree9bf938349f80b1d7e0c3887f6612a09cc8bcb1fe
parent97289631f0c818cd5bd40f5e60175f158e20d5e7 (diff)
bookmark-conf: handle multi-hops tramp file names
The previous regular expression cannot handle remote file names with multiple hops. This is now fixed.
-rw-r--r--bookmark-conf.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/bookmark-conf.el b/bookmark-conf.el
index 1b880f7..32a102d 100644
--- a/bookmark-conf.el
+++ b/bookmark-conf.el
@@ -116,7 +116,17 @@
(cond
((and (stringp location)
(not (string= location ""))
- (string-match (rx bos "/ssh:" (group (1+ (not ":"))) ":" (1+ (not ":")) eos) location))
+ (string-match (rx bos "/ssh:"
+ (group (1+ (not ":")))
+ (zero-or-more
+ (and "|"
+ (1+ (not ":"))
+ ":"
+ (1+ (not ":"))))
+ ":"
+ (1+ (not ":"))
+ eos)
+ location))
(setq handler-name
(concat "Tramp - " (match-string 1 location)))
(setq capitalize-p nil)))