Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #233 from emacs-helm/bookmark-show-fname

Issue #232 Implement bookmark show filename
  • Loading branch information...
commit 0ddef7a277a865ada119ed450427fb00ff611979 2 parents a2ecf8c + 2fbaccc
@thierryvolpiatto thierryvolpiatto authored
Showing with 167 additions and 183 deletions.
  1. +0 −12 helm-aliases.el
  2. +44 −70 helm-bmkext.el
  3. +121 −99 helm-bookmark.el
  4. +2 −2 helm-config.el
View
12 helm-aliases.el
@@ -267,8 +267,6 @@
(make-obsolete 'helm-c-bookmark-info-setup-alist 'helm-bookmark-info-setup-alist "1.5.1")
(defalias 'helm-c-ratpoison-commands-execute 'helm-ratpoison-commands-execute)
(make-obsolete 'helm-c-ratpoison-commands-execute 'helm-ratpoison-commands-execute "1.5.1")
-(defalias 'helm-c-collect-bookmarks 'helm-collect-bookmarks)
-(make-obsolete 'helm-c-collect-bookmarks 'helm-collect-bookmarks "1.5.1")
(defalias 'helm-c-ucs-persistent-backward 'helm-ucs-persistent-backward)
(make-obsolete 'helm-c-ucs-persistent-backward 'helm-ucs-persistent-backward "1.5.1")
(defalias 'helm-c-info-pages-init 'helm-info-pages-init)
@@ -331,8 +329,6 @@
(make-obsolete 'helm-c-top-sh 'helm-top-sh "1.5.1")
(defalias 'helm-c-bbdb-get-record 'helm-bbdb-get-record)
(make-obsolete 'helm-c-bbdb-get-record 'helm-bbdb-get-record "1.5.1")
-(defalias 'helm-c-bookmark-root-logged-p 'helm-bookmark-root-logged-p)
-(make-obsolete 'helm-c-bookmark-root-logged-p 'helm-bookmark-root-logged-p "1.5.1")
(defalias 'helm-c-persistent-xfont-action 'helm-persistent-xfont-action)
(make-obsolete 'helm-c-persistent-xfont-action 'helm-persistent-xfont-action "1.5.1")
(defalias 'helm-c-latex-math-candidates 'helm-latex-math-candidates)
@@ -497,8 +493,6 @@
(make-obsolete 'helm-c-find-file-or-marked 'helm-find-file-or-marked "1.5.1")
(defalias 'helm-c-query-replace-regexp 'helm-query-replace-regexp)
(make-obsolete 'helm-c-query-replace-regexp 'helm-query-replace-regexp "1.5.1")
-(defalias 'helm-c-bookmark-ssh-files-setup-alist 'helm-bookmark-ssh-files-setup-alist)
-(make-obsolete 'helm-c-bookmark-ssh-files-setup-alist 'helm-bookmark-ssh-files-setup-alist "1.5.1")
(defalias 'helm-c-describe-variable 'helm-describe-variable)
(make-obsolete 'helm-c-describe-variable 'helm-describe-variable "1.5.1")
(defalias 'helm-c-advice-persistent-action 'helm-advice-persistent-action)
@@ -547,8 +541,6 @@
(make-obsolete 'helm-c-xrandr-info 'helm-xrandr-info "1.5.1")
(defalias 'helm-c-stringify 'helm-stringify)
(make-obsolete 'helm-c-stringify 'helm-stringify "1.5.1")
-(defalias 'helm-c-bookmark-su-files-setup-alist 'helm-bookmark-su-files-setup-alist)
-(make-obsolete 'helm-c-bookmark-su-files-setup-alist 'helm-bookmark-su-files-setup-alist "1.5.1")
(defalias 'helm-c-goto-precedent-file 'helm-goto-precedent-file)
(make-obsolete 'helm-c-goto-precedent-file 'helm-goto-precedent-file "1.5.1")
(defalias 'helm-c-apt-cache-show 'helm-apt-cache-show)
@@ -732,8 +724,6 @@
(make-obsolete-variable 'helm-c-eldoc-in-minibuffer-show-fn 'helm-eldoc-in-minibuffer-show-fn "1.5.1")
(defvaralias 'helm-c-google-suggest-search-url 'helm-google-suggest-search-url)
(make-obsolete-variable 'helm-c-google-suggest-search-url 'helm-google-suggest-search-url "1.5.1")
-(defvaralias 'helm-c-source-bookmark-su-files&dirs 'helm-source-bookmark-su-files&dirs)
-(make-obsolete-variable 'helm-c-source-bookmark-su-files&dirs 'helm-source-bookmark-su-files&dirs "1.5.1")
(defvaralias 'helm-c-source-bmkext-addressbook 'helm-source-bmkext-addressbook)
(make-obsolete-variable 'helm-c-source-bmkext-addressbook 'helm-source-bmkext-addressbook "1.5.1")
(defvaralias 'helm-c-source-ctags 'helm-source-ctags)
@@ -778,8 +768,6 @@
(make-obsolete-variable 'helm-c-grep-use-ioccur-style-keys 'helm-grep-use-ioccur-style-keys "1.5.1")
(defvaralias 'helm-c-ctags-modes 'helm-ctags-modes)
(make-obsolete-variable 'helm-c-ctags-modes 'helm-ctags-modes "1.5.1")
-(defvaralias 'helm-c-source-bookmark-ssh-files&dirs 'helm-source-bookmark-ssh-files&dirs)
-(make-obsolete-variable 'helm-c-source-bookmark-ssh-files&dirs 'helm-source-bookmark-ssh-files&dirs "1.5.1")
(defvaralias 'helm-c-source-moccur 'helm-source-moccur)
(make-obsolete-variable 'helm-c-source-moccur 'helm-source-moccur "1.5.1")
(defvaralias 'helm-c-source-w3m-bookmarks 'helm-source-w3m-bookmarks)
View
114 helm-bmkext.el
@@ -15,6 +15,11 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+;; Dependency: https://github.com/thierryvolpiatto/emacs-bmk-ext
+;; If you want to enable google-maps in addressbook you will need
+;; Julien Danjou google-maps-el package available here:
+;; http://julien.danjou.info/google-maps-el.html
+
;;; Code:
(eval-when-compile (require 'cl))
(require 'helm)
@@ -23,11 +28,9 @@
(declare-function bookmark-get-filename "bookmark" (bookmark-name-or-record))
-;; Dependency: https://github.com/thierryvolpiatto/emacs-bmk-ext
-;; If you want to enable google-maps in addressbook you will need
-;; Julien Danjou google-maps-el package available here:
-;; http://julien.danjou.info/google-maps-el.html
-
+
+;;; Filter functions
+;;
(defun helm-bmkext-filter-setup-alist (fn &rest args)
"Return a filtered `bookmark-alist' sorted alphabetically."
(loop
@@ -36,7 +39,7 @@
(funcall fn))
for i in alist
for b = (car i)
- collect b into sa
+ collect (propertize b 'location (bookmark-location b)) into sa
finally return (sort sa 'string-lessp)))
;;;###autoload
@@ -45,6 +48,7 @@
(interactive)
(helm-quit-and-execute-action 'bmkext-edit-bookmark))
+
;;; Addressbook.
;;
;;
@@ -57,6 +61,8 @@
'global
(helm-bmkext-addressbook-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(persistent-action
. (lambda (candidate)
(let ((bmk (helm-bookmark-get-bookmark-from-name
@@ -131,7 +137,9 @@
"Specialized filter function for bookmarks w3m."
(helm-bmkext-filter-setup-alist 'bmkext-addressbook-alist-only))
-;; W3m bookmarks from bookmark-extensions.
+
+;;; W3m bookmarks from bookmark-extensions.
+;;
(defvar helm-source-bookmark-w3m
'((name . "Bookmark W3m")
(init . (lambda ()
@@ -140,6 +148,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-w3m-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -149,7 +159,9 @@
"Specialized filter function for bookmarks w3m."
(helm-bmkext-filter-setup-alist 'bmkext-w3m-alist-only))
-;; Images
+
+;;; Images
+;;
(defvar helm-source-bookmark-images
'((name . "Bookmark Images")
(init . (lambda ()
@@ -158,6 +170,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-images-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -167,7 +181,9 @@
"Specialized filter function for images bookmarks."
(helm-bmkext-filter-setup-alist 'bmkext-image-file-alist-only))
-;; Woman Man
+
+;;; Woman Man
+;;
(defvar helm-source-bookmark-man
'((name . "Bookmark Woman&Man")
(init . (lambda ()
@@ -176,6 +192,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-man-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -186,7 +204,9 @@
(append (helm-bmkext-filter-setup-alist 'bmkext-man-alist-only)
(helm-bmkext-filter-setup-alist 'bmkext-woman-alist-only)))
-;; Gnus
+
+;;; Gnus
+;;
(defvar helm-source-bookmark-gnus
'((name . "Bookmark Gnus")
(init . (lambda ()
@@ -195,6 +215,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-gnus-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -204,7 +226,9 @@
"Specialized filter function for bookmarks gnus."
(helm-bmkext-filter-setup-alist 'bmkext-gnus-alist-only))
-;; Info
+
+;;; Info
+;;
(defvar helm-source-bookmark-info
'((name . "Bookmark Info")
(init . (lambda ()
@@ -213,6 +237,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-info-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -222,7 +248,9 @@
"Specialized filter function for bookmarks info."
(helm-bmkext-filter-setup-alist 'bmkext-info-alist-only))
-;; Local Files&directories
+
+;;; Files and directories
+;;
(defvar helm-source-bookmark-files&dirs
'((name . "Bookmark Files&Directories")
(init . (lambda ()
@@ -231,6 +259,8 @@
(helm-init-candidates-in-buffer
'global (helm-bookmark-local-files-setup-alist))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -238,63 +268,9 @@
(defun helm-bookmark-local-files-setup-alist ()
"Specialized filter function for bookmarks locals files."
- (helm-bmkext-filter-setup-alist 'bmkext-local-file-alist-only))
-
-;; Su Files&directories
-(defvar helm-source-bookmark-su-files&dirs
- '((name . "Bookmark Root-Files&Directories")
- (init . (lambda ()
- (require 'bookmark-extensions)
- (bookmark-maybe-load-default-file)
- (helm-init-candidates-in-buffer
- 'global (helm-bookmark-su-files-setup-alist))))
- (candidates-in-buffer)
- (filtered-candidate-transformer
- helm-adaptive-sort
- helm-highlight-bookmark-su)
- (type . bookmark)))
-
-(defun helm-bookmark-su-files-setup-alist ()
- "Specialized filter function for bookmarks su/sudo files."
- (declare (special bmkext-su-or-sudo-regexp))
- (loop
- with l = (helm-bmkext-filter-setup-alist 'bmkext-remote-file-alist-only)
- for i in l
- for isfile = (bookmark-get-filename i)
- for istramp = (and isfile (boundp 'tramp-file-name-regexp)
- (save-match-data
- (string-match tramp-file-name-regexp isfile)))
- for issu = (and istramp
- (string-match bmkext-su-or-sudo-regexp isfile))
- if issu
- collect i))
-
-;; Ssh Files&directories
-(defvar helm-source-bookmark-ssh-files&dirs
- '((name . "Bookmark Ssh-Files&Directories")
- (init . (lambda ()
- (require 'bookmark-extensions)
- (bookmark-maybe-load-default-file)
- (helm-init-candidates-in-buffer
- 'global (helm-bookmark-ssh-files-setup-alist))))
- (candidates-in-buffer)
- (filtered-candidate-transformer . helm-adaptive-sort)
- (type . bookmark)))
-
-(defun helm-bookmark-ssh-files-setup-alist ()
- "Specialized filter function for bookmarks ssh files."
- (loop
- with l = (helm-bmkext-filter-setup-alist 'bmkext-remote-file-alist-only)
- for i in l
- for isfile = (bookmark-get-filename i)
- for istramp = (and isfile (boundp 'tramp-file-name-regexp)
- (save-match-data
- (string-match tramp-file-name-regexp isfile)))
- for isssh = (and istramp
- (string-match "/ssh:" isfile))
- if isssh
- collect i))
+ (helm-bmkext-filter-setup-alist 'bmkext-file-alist-only))
+
;;;###autoload
(defun helm-bookmark-ext ()
"Preconfigured `helm' for bookmark-extensions sources.
@@ -312,8 +288,6 @@ Contain also `helm-source-google-suggest'."
helm-source-bookmark-info
helm-source-bookmark-man
helm-source-bookmark-images
- helm-source-bookmark-su-files&dirs
- helm-source-bookmark-ssh-files&dirs
helm-source-bookmark-set)
:prompt "SearchBookmark: "
:buffer "*helm bmkext*"
View
220 helm-bookmark.el
@@ -28,6 +28,12 @@
"Predefined configurations for `helm.el'."
:group 'helm)
+(defcustom helm-bookmark-show-location nil
+ "Show location of bookmark on display."
+ :group 'helm-bookmark
+ :type 'boolean)
+
+
(defface helm-bookmarks-su
'((t (:foreground "red")))
"Face for su/sudo bookmarks."
@@ -69,24 +75,64 @@
(set-keymap-parent map helm-map)
(define-key map (kbd "C-c o") 'helm-bookmark-run-jump-other-window)
(define-key map (kbd "C-d") 'helm-bookmark-run-delete)
+ (define-key map (kbd "M-t") 'helm-bookmark-toggle-filename)
(when (locate-library "bookmark-extensions")
(define-key map (kbd "M-e") 'helm-bmkext-run-edit))
(define-key map (kbd "C-c ?") 'helm-bookmark-help)
(delq nil map))
"Generic Keymap for emacs bookmark sources.")
+(defvar helm-bookmarks-cache nil)
(defvar helm-source-bookmarks
`((name . "Bookmarks")
(init . (lambda ()
(require 'bookmark)
- (helm-init-candidates-in-buffer
- 'global (bookmark-all-names))))
- (no-delay-on-input)
- (candidates-in-buffer)
+ (setq helm-bookmarks-cache
+ (bookmark-all-names))))
+ (no-delay-on-input) ; needed for helm-for-files.
+ (candidates . helm-bookmarks-cache)
+ (filtered-candidate-transformer . helm-bookmark-transformer)
+ (match . helm-bookmark-match-fn)
(type . bookmark))
"See (info \"(emacs)Bookmarks\").")
+(defun helm-bookmark-transformer (candidates source)
+ (loop for i in candidates
+ for loc = (bookmark-location i)
+ for len = (length i)
+ for trunc = (if (> len bookmark-bmenu-file-column)
+ (substring i 0 bookmark-bmenu-file-column)
+ i)
+ for sep = (make-string (- (+ bookmark-bmenu-file-column 2)
+ (length trunc)) ? )
+ if helm-bookmark-show-location
+ collect (cons (concat trunc
+ (make-string (- 32 (length trunc)) ? ) loc) i)
+ else collect i))
+
+(defun helm-bookmark-match-fn (candidate)
+ "Match function for bookmark sources using `candidates'."
+ (if helm-bookmark-show-location
+ ;; match only location, match-plugin will match also name.
+ (string-match helm-pattern (bookmark-location candidate))
+ (string-match helm-pattern candidate)))
+
+;;;###autoload
+(defun helm-bookmark-toggle-filename ()
+ (interactive)
+ (let ((real (helm-get-selection helm-buffer)))
+ (setq helm-bookmark-show-location (not helm-bookmark-show-location))
+ (helm-update (if helm-bookmark-show-location
+ (bookmark-location real) real))))
+
+(defun helm-bookmark-jump (candidate)
+ "Jump to bookmark from keyboard."
+ (let ((current-prefix-arg helm-current-prefix-arg))
+ (bookmark-jump candidate)))
+
+
;;; bookmark-set
+;;
(defvar helm-source-bookmark-set
'((name . "Set Bookmark")
(dummy)
@@ -94,37 +140,19 @@
(action . bookmark-set))
"See (info \"(emacs)Bookmarks\").")
-;;; Special bookmarks
-(defvar helm-source-bookmarks-ssh
- '((name . "Bookmarks-ssh")
- (init . (lambda ()
- (require 'bookmark)
- (helm-init-candidates-in-buffer
- 'global (helm-collect-bookmarks :ssh t))))
- (candidates-in-buffer)
- (no-delay-on-input)
- (type . bookmark))
- "See (info \"(emacs)Bookmarks\").")
-
-(defvar helm-source-bookmarks-su
- '((name . "Bookmarks-root")
- (init . (lambda ()
- (require 'bookmark)
- (helm-init-candidates-in-buffer
- 'global (helm-collect-bookmarks :su t))))
- (candidates-in-buffer)
- (no-delay-on-input)
- (filtered-candidate-transformer . helm-highlight-bookmark-su)
- (type . bookmark))
- "See (info \"(emacs)Bookmarks\").")
-
-(defvar helm-source-bookmarks-local
- '((name . "Bookmarks-Local")
+
+;;; Colorize bookmarks by category
+;;
+(defvar helm-source-pp-bookmarks
+ '((name . "PP-Bookmarks")
(init . (lambda ()
(require 'bookmark)
(helm-init-candidates-in-buffer
- 'global (helm-collect-bookmarks :local t))))
+ 'global (loop for b in (bookmark-all-names) collect
+ (propertize b 'location (bookmark-location b))))))
(candidates-in-buffer)
+ (search helm-bookmark-search-fn)
+ (match-part . helm-pp-bookmark-match-fn)
(filtered-candidate-transformer
helm-adaptive-sort
helm-highlight-bookmark)
@@ -132,36 +160,21 @@
(type . bookmark))
"See (info \"(emacs)Bookmarks\").")
-(defun* helm-collect-bookmarks (&key local su sudo ssh)
- (let* ((lis-all (bookmark-all-names))
- (lis-loc (cond (local (loop for i in lis-all
- unless (string-match "^(ssh)\\|^(su)" i)
- collect i))
- (su (loop for i in lis-all
- when (string-match "^(su)" i)
- collect i))
- (sudo (loop for i in lis-all
- when (string-match "^(sudo)" i)
- collect i))
- (ssh (loop for i in lis-all
- when (string-match "^(ssh)" i)
- collect i)))))
- (sort lis-loc 'string-lessp)))
-
-(defun helm-bookmark-root-logged-p ()
- (catch 'break
- (dolist (i (mapcar #'buffer-name (buffer-list)))
- (when (string-match (format "*tramp/%s ." helm-su-or-sudo) i)
- (throw 'break t)))))
-
-(defun helm-highlight-bookmark-su (files source)
- (if (helm-bookmark-root-logged-p)
- (helm-highlight-bookmark files source)
- (helm-highlight-not-logged files source)))
-
-(defun helm-highlight-not-logged (files source)
- (loop for i in files
- collect (propertize i 'face 'helm-bookmarks-su)))
+(defun helm-bookmark-search-fn (pattern)
+ "Search function for bookmark sources using `candidates-in-buffer'.
+Should be used with `helm-pp-bookmark-match-fn' as `match-part' function."
+ (if helm-bookmark-show-location
+ (helm-aif (next-single-property-change (point) 'location)
+ (goto-char it))
+ (re-search-forward pattern nil t)))
+
+(defun helm-pp-bookmark-match-fn (candidate)
+ "Search function for bookmark sources using `candidates-in-buffer'.
+Should be used with `helm-bookmark-search-fn' as `search' function."
+ (helm-aif (and helm-bookmark-show-location
+ (bookmark-location candidate))
+ it ; match only location, match-plugin will match also name.
+ candidate))
(defun helm-highlight-bookmark (bookmarks source)
"Used as `candidate-transformer' to colorize bookmarks.
@@ -185,44 +198,54 @@ Work both with standard Emacs bookmarks and bookmark-extensions.el."
for isannotation = (bookmark-get-annotation i)
for isabook = (string= (bookmark-prop-get i 'type) "addressbook")
for isinfo = (eq handlerp 'Info-bookmark-jump)
+ for loc = (bookmark-location i)
+ for len = (length i)
+ for trunc = (if (and helm-bookmark-show-location
+ (> len bookmark-bmenu-file-column))
+ (substring i 0 bookmark-bmenu-file-column)
+ i)
+ for sep = (and helm-bookmark-show-location
+ (make-string (- (+ bookmark-bmenu-file-column 2)
+ (length trunc)) ? ))
;; Add a * if bookmark have annotation
if (and isannotation (not (string-equal isannotation "")))
- do (setq i (concat "*" i))
- collect (cond ( ;; info buffers
- isinfo
- (propertize i 'face 'helm-bookmark-info 'help-echo isfile))
- ( ;; w3m buffers
- isw3m
- (propertize i 'face 'helm-bookmark-w3m 'help-echo isfile))
- ( ;; gnus buffers
- isgnus
- (propertize i 'face 'helm-bookmark-gnus 'help-echo isfile))
- ( ;; Man Woman
- (or iswoman isman)
- (propertize i 'face 'helm-bookmark-man 'help-echo isfile))
- ( ;; Addressbook
- isabook
- (propertize i 'face '((:foreground "Tomato"))))
- ( ;; directories
- (and isfile
- ;; This is needed because `non-essential'
- ;; is not working on Emacs-24.2 and the behavior
- ;; of tramp seems to have changed since previous
- ;; versions (Need to reenter password even if a first
- ;; connection have been established, probably when host
- ;; is named differently i.e machine/localhost)
- (not (file-remote-p isfile))
- (file-directory-p isfile))
- (propertize i 'face 'helm-bookmark-directory 'help-echo isfile))
- ( ;; regular files
- t
- (propertize i 'face 'helm-bookmark-file 'help-echo isfile))))))
-
-(defun helm-bookmark-jump (candidate)
- "Jump to bookmark from keyboard."
- (let ((current-prefix-arg helm-current-prefix-arg))
- (bookmark-jump candidate)))
+ do (setq trunc (concat "*" (if helm-bookmark-show-location trunc i)))
+ collect (let ((bmk (cond ( ;; info buffers
+ isinfo
+ (propertize trunc 'face 'helm-bookmark-info 'help-echo isfile))
+ ( ;; w3m buffers
+ isw3m
+ (propertize trunc 'face 'helm-bookmark-w3m 'help-echo isfile))
+ ( ;; gnus buffers
+ isgnus
+ (propertize trunc 'face 'helm-bookmark-gnus 'help-echo isfile))
+ ( ;; Man Woman
+ (or iswoman isman)
+ (propertize trunc 'face 'helm-bookmark-man 'help-echo isfile))
+ ( ;; Addressbook
+ isabook
+ (propertize trunc 'face '((:foreground "Tomato"))))
+ ( ;; directories
+ (and isfile
+ ;; This is needed because `non-essential'
+ ;; is not working on Emacs-24.2 and the behavior
+ ;; of tramp seems to have changed since previous
+ ;; versions (Need to reenter password even if a first
+ ;; connection have been established, probably when host
+ ;; is named differently i.e machine/localhost)
+ (not (file-remote-p isfile))
+ (file-directory-p isfile))
+ (propertize trunc 'face 'helm-bookmark-directory 'help-echo isfile))
+ ( ;; regular files
+ t
+ (propertize trunc 'face 'helm-bookmark-file 'help-echo isfile)))))
+ (if helm-bookmark-show-location
+ (cons (concat bmk sep loc) i)
+ (cons bmk i))))))
+
+;;; Bookmarks attributes
+;;
(define-helm-type-attribute 'bookmark
`((coerce . helm-bookmark-get-bookmark-from-name)
(action
@@ -239,6 +262,7 @@ Work both with standard Emacs bookmarks and bookmark-extensions.el."
(mode-line . helm-bookmark-mode-line-string))
"Bookmark name.")
+
;;;###autoload
(defun helm-bookmark-run-jump-other-window ()
"Jump to bookmark from keyboard."
@@ -282,9 +306,7 @@ Return nil if bmk is not a valid bookmark."
(defun helm-pp-bookmarks ()
"Preconfigured `helm' for bookmarks (pretty-printed)."
(interactive)
- (helm :sources '(helm-source-bookmarks-local
- helm-source-bookmarks-su
- helm-source-bookmarks-ssh
+ (helm :sources '(helm-source-pp-bookmarks
helm-source-bookmark-set)
:buffer "*helm pp bookmarks*"
:default (buffer-name helm-current-buffer)))
View
4 helm-config.el
@@ -85,7 +85,7 @@
(define-key map (kbd "i") 'helm-imenu)
(define-key map (kbd "<tab>") 'helm-lisp-completion-at-point)
(define-key map (kbd "p") 'helm-list-emacs-process)
- (define-key map (kbd "C-x r b") 'helm-pp-bookmarks)
+ (define-key map (kbd "C-x r b") 'helm-bookmarks)
(define-key map (kbd "M-y") 'helm-show-kill-ring)
(define-key map (kbd "C-c <SPC>") 'helm-all-mark-rings)
(define-key map (kbd "C-x C-f") 'helm-find-files)
@@ -133,7 +133,7 @@
["Recent Files" helm-recentf t]
["Locate" helm-locate t]
["Search Files with find" helm-find t]
- ["Bookmarks" helm-pp-bookmarks t])
+ ["Bookmarks" helm-bookmarks t])
("Buffers"
["Find buffers" helm-buffers-list t])
("Commands"
Please sign in to comment.
Something went wrong with that request. Please try again.