summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bookmark-conf.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/bookmark-conf.el b/bookmark-conf.el
index 7faa7c5..1b880f7 100644
--- a/bookmark-conf.el
+++ b/bookmark-conf.el
@@ -100,7 +100,8 @@
(save-match-data
(let* ((handler (bookmark-get-handler element))
(handler-name (and handler (format "%S" handler)))
- (location (bookmark-location element)))
+ (location (bookmark-location element))
+ (capitalize-p t))
;; replace repeating parts
(cond
((and handler-name
@@ -111,6 +112,14 @@
"^durand-" ""
(replace-regexp-in-string
"-bookmark$" "" (match-string 1 handler-name))))))
+ ;; Tramp bookmarks
+ (cond
+ ((and (stringp location)
+ (not (string= location ""))
+ (string-match (rx bos "/ssh:" (group (1+ (not ":"))) ":" (1+ (not ":")) eos) location))
+ (setq handler-name
+ (concat "Tramp - " (match-string 1 location)))
+ (setq capitalize-p nil)))
;; take case of file extensions
(cond
((and (null handler-name) location
@@ -120,7 +129,8 @@
(handler-name
(cond
((<= (length handler-name) 3) (upcase handler-name))
- ((capitalize handler-name))))))))
+ (capitalize-p (capitalize handler-name))
+ (handler-name)))))))
(setq blist-automatic-filter-groups #'ilist-automatic-group-durand)