Permalink
Browse files

* helm-mode.el (helm-this-command): Fix don't use this-command and bl…

…acklist *exit-minibuffer funs..
  • Loading branch information...
1 parent 81e573c commit 396044f72271e1f288488d063749f0fd0059e62c @thierryvolpiatto thierryvolpiatto committed Dec 29, 2012
Showing with 10 additions and 10 deletions.
  1. +10 −10 helm-mode.el
View
@@ -101,16 +101,16 @@ See `helm-case-fold-search' for more info."
"Return the actual command in action.
Like `this-command' but return the real command,
not `exit-minibuffer' or unwanted functions."
- (if (commandp this-command)
- this-command
- (loop for count from 1 to 50
- for btf = (backtrace-frame count)
- for fn = (second btf)
- if (commandp fn) return fn
- else
- if (and (eq fn 'call-interactively)
- (> (length btf) 2))
- return (cadr (cdr btf)))))
+ (loop with bl = '(helm-exit-minibuffer
+ exit-minibuffer)
+ for count from 1 to 50
+ for btf = (backtrace-frame count)
+ for fn = (second btf)
+ if (and (commandp fn) (not (memq fn bl))) return fn
+ else
+ if (and (eq fn 'call-interactively)
+ (> (length btf) 2))
+ return (cadr (cdr btf))))
(defun helm-comp-read-get-candidates (collection &optional test sort-fn alistp)
"Convert COLLECTION to list removing elements that don't match TEST.

0 comments on commit 396044f

Please sign in to comment.