Skip to content
Browse files

* helm.el (helm-get-candidates): Use one new attr `no-delay-on-input'…

…. prevent returning t.

* helm-bookmark.el: Use non-essential.
* helm-files.el ( helm-c-source-find-files): Use no-delay-on-input.
* helm-mode.el (helm-c-read-file-name): Same and add missing match attr.
* helm-help.el: Document no-delay-on-input.
  • Loading branch information...
1 parent f33d60e commit fc240e4fc13ffc759f487ec926e67bffaf2e5fb5 @thierryvolpiatto thierryvolpiatto committed Dec 8, 2012
Showing with 55 additions and 45 deletions.
  1. +43 −42 helm-bookmark.el
  2. +1 −0 helm-files.el
  3. +3 −0 helm-help.el
  4. +2 −0 helm-mode.el
  5. +6 −3 helm.el
View
85 helm-bookmark.el
@@ -161,48 +161,49 @@
(defun helm-c-highlight-bookmark (bookmarks source)
"Used as `candidate-transformer' to colorize bookmarks.
Work both with standard Emacs bookmarks and bookmark-extensions.el."
- (loop for i in bookmarks
- for isfile = (bookmark-get-filename i)
- for bufp = (and (fboundp 'bmkext-get-buffer-name)
- (bmkext-get-buffer-name i))
- for handlerp = (and (fboundp 'bookmark-get-handler)
- (bookmark-get-handler i))
- for isw3m = (and (fboundp 'bmkext-w3m-bookmark-p)
- (bmkext-w3m-bookmark-p i))
- for isgnus = (and (fboundp 'bmkext-gnus-bookmark-p)
- (bmkext-gnus-bookmark-p i))
- for isman = (and (fboundp 'bmkext-man-bookmark-p) ; Man
- (bmkext-man-bookmark-p i))
- for iswoman = (and (fboundp 'bmkext-woman-bookmark-p) ; Woman
- (bmkext-woman-bookmark-p i))
- for handlerp = (bookmark-get-handler i)
- for isannotation = (bookmark-get-annotation i)
- for isabook = (string= (bookmark-prop-get i 'type) "addressbook")
- for isinfo = (eq handlerp 'Info-bookmark-jump)
- ;; 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 (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)))))
+ (let ((non-essential t))
+ (loop for i in bookmarks
+ for isfile = (bookmark-get-filename i)
+ for bufp = (and (fboundp 'bmkext-get-buffer-name)
+ (bmkext-get-buffer-name i))
+ for handlerp = (and (fboundp 'bookmark-get-handler)
+ (bookmark-get-handler i))
+ for isw3m = (and (fboundp 'bmkext-w3m-bookmark-p)
+ (bmkext-w3m-bookmark-p i))
+ for isgnus = (and (fboundp 'bmkext-gnus-bookmark-p)
+ (bmkext-gnus-bookmark-p i))
+ for isman = (and (fboundp 'bmkext-man-bookmark-p) ; Man
+ (bmkext-man-bookmark-p i))
+ for iswoman = (and (fboundp 'bmkext-woman-bookmark-p) ; Woman
+ (bmkext-woman-bookmark-p i))
+ for handlerp = (bookmark-get-handler i)
+ for isannotation = (bookmark-get-annotation i)
+ for isabook = (string= (bookmark-prop-get i 'type) "addressbook")
+ for isinfo = (eq handlerp 'Info-bookmark-jump)
+ ;; 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 (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-c-bookmark-jump (candidate)
"Jump to bookmark from keyboard."
View
1 helm-files.el
@@ -369,6 +369,7 @@ Don't set it directly, use instead `helm-ff-auto-update-initial-value'.")
(persistent-help . "Hit1 Expand Candidate, Hit2 or (C-u) Find file")
(mode-line . helm-ff-mode-line-string)
(volatile)
+ (no-delay-on-input)
(nohighlight)
(candidate-number-limit . 9999)
(action-transformer . helm-find-files-action-transformer)
View
3 helm-help.el
@@ -1059,6 +1059,9 @@ For anonymous function don't add the dot, e.g:
(helm-document-attribute 'nohighlight "optional"
" Disable highlight match in this source.")
+(helm-document-attribute 'no-delay-on-input "optional"
+ " Don't use `while-no-input' when computing candidates.")
+
(helm-document-attribute 'history "optional"
" Allow passing history variable to helm from source.
It should be a quoted symbol evaluated from source.
View
2 helm-mode.el
@@ -718,6 +718,8 @@ Keys description:
(helm-find-files-get-candidates must-match)))))
(filtered-candidate-transformer
helm-c-find-files-transformer)
+ (match . helm-ff-match-fn)
+ (no-delay-on-input)
(persistent-action . ,persistent-action)
(candidate-number-limit . 9999)
(persistent-help . ,persistent-help)
View
9 helm.el
@@ -1806,10 +1806,13 @@ Helm plug-ins are realized by this function."
;; It may return a process or a list of candidates.
(if candidate-proc
(helm-interpret-value candidate-proc source)
- (if helm-force-updating-p
+ (if (or helm-force-updating-p
+ (assoc 'no-delay-on-input source))
(helm-interpret-value candidate-fn source)
- (while-no-input
- (helm-interpret-value candidate-fn source))))
+ (let ((result (while-no-input
+ (helm-interpret-value
+ candidate-fn source))))
+ (and (listp result) result))))
(error (funcall type-error)))))
(when (and (processp candidates) (not candidate-proc))
(warn "Candidates function `%s' should be called in a `candidates-process' attribute"

0 comments on commit fc240e4

Please sign in to comment.
Something went wrong with that request. Please try again.