From 4a373f5f60a5681735d801a9f01b9a5d084f2b87 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 6 Jan 2016 11:44:55 +0100 Subject: [PATCH] update helm and helm-c-yasnippet --- bba.org | 2 +- elpa/helm-20150704.1247/helm-aliases.el | 776 ---------- elpa/helm-20150704.1247/helm-match-plugin.el | 331 ----- elpa/helm-20150704.1247/helm-org.el | 152 -- .../emacs-helm.sh | 4 +- .../helm-adaptive.el | 0 .../helm-apt.el | 40 +- .../helm-autoloads.el | 545 ++----- .../helm-bookmark.el | 214 ++- .../helm-buffers.el | 169 +-- .../helm-color.el | 12 +- .../helm-command.el | 64 +- .../helm-config.el | 5 +- .../helm-dabbrev.el | 7 +- .../helm-easymenu.el | 8 +- .../helm-elisp-package.el | 39 +- .../helm-elisp.el | 213 ++- .../helm-elscreen.el | 69 +- .../helm-eshell.el | 64 +- .../helm-eval.el | 15 +- .../helm-external.el | 3 +- .../helm-files.el | 841 ++++++----- .../helm-font.el | 108 +- .../helm-grep.el | 415 ++++-- .../helm-help.el | 1293 ++++++---------- .../helm-id-utils.el | 18 +- .../helm-imenu.el | 24 +- .../helm-info.el | 0 .../helm-locate.el | 80 +- .../helm-man.el | 1 + .../helm-misc.el | 45 +- .../helm-mode.el | 149 +- elpa/helm-20160105.2046/helm-multi-match.el | 373 +++++ .../helm-net.el | 219 ++- elpa/helm-20160105.2046/helm-org.el | 221 +++ .../helm-pkg.el | 5 +- .../helm-plugin.el | 0 .../helm-regexp.el | 79 +- .../helm-ring.el | 83 +- .../helm-semantic.el | 4 +- .../helm-sys.el | 4 +- .../helm-tags.el | 136 +- elpa/helm-20160105.2046/helm-types.el | 274 ++++ .../helm-utils.el | 335 +---- .../helm-c-yasnippet-pkg.el | 1 - .../helm-c-yasnippet-autoloads.el | 14 +- .../helm-c-yasnippet-pkg.el | 1 + .../helm-c-yasnippet.el | 162 +- .../helm-core-autoloads.el | 202 +++ elpa/helm-core-20160105.2046/helm-core-pkg.el | 8 + elpa/helm-core-20160105.2046/helm-lib.el | 674 +++++++++ .../helm-multi-match.el | 373 +++++ .../helm-source.el | 395 ++--- .../helm.el | 1301 +++++++++-------- 54 files changed, 5477 insertions(+), 5093 deletions(-) delete mode 100644 elpa/helm-20150704.1247/helm-aliases.el delete mode 100644 elpa/helm-20150704.1247/helm-match-plugin.el delete mode 100644 elpa/helm-20150704.1247/helm-org.el rename elpa/{helm-20150704.1247 => helm-20160105.2046}/emacs-helm.sh (97%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-adaptive.el (100%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-apt.el (91%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-autoloads.el (55%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-bookmark.el (81%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-buffers.el (87%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-color.el (93%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-command.el (82%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-config.el (97%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-dabbrev.el (99%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-easymenu.el (90%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-elisp-package.el (91%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-elisp.el (80%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-elscreen.el (53%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-eshell.el (85%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-eval.el (91%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-external.el (99%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-files.el (84%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-font.el (59%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-grep.el (79%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-help.el (54%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-id-utils.el (88%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-imenu.el (93%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-info.el (100%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-locate.el (83%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-man.el (99%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-misc.el (89%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-mode.el (90%) create mode 100644 elpa/helm-20160105.2046/helm-multi-match.el rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-net.el (78%) create mode 100644 elpa/helm-20160105.2046/helm-org.el rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-pkg.el (60%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-plugin.el (100%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-regexp.el (92%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-ring.el (87%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-semantic.el (98%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-sys.el (99%) rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-tags.el (72%) create mode 100644 elpa/helm-20160105.2046/helm-types.el rename elpa/{helm-20150704.1247 => helm-20160105.2046}/helm-utils.el (64%) delete mode 100644 elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-pkg.el rename elpa/{helm-c-yasnippet-20140131.226 => helm-c-yasnippet-20151231.10}/helm-c-yasnippet-autoloads.el (66%) create mode 100644 elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-pkg.el rename elpa/{helm-c-yasnippet-20140131.226 => helm-c-yasnippet-20151231.10}/helm-c-yasnippet.el (74%) create mode 100644 elpa/helm-core-20160105.2046/helm-core-autoloads.el create mode 100644 elpa/helm-core-20160105.2046/helm-core-pkg.el create mode 100644 elpa/helm-core-20160105.2046/helm-lib.el create mode 100644 elpa/helm-core-20160105.2046/helm-multi-match.el rename elpa/{helm-20150704.1247 => helm-core-20160105.2046}/helm-source.el (75%) rename elpa/{helm-20150704.1247 => helm-core-20160105.2046}/helm.el (86%) diff --git a/bba.org b/bba.org index 25550a82..80ae933c 100644 --- a/bba.org +++ b/bba.org @@ -1928,7 +1928,7 @@ Some links you might check out: (if (>= emacs-major-version 24) (progn (add-to-list 'load-path - "~/.emacs.d/elpa/helm-20150704.1247") + "~/.emacs.d/elpa/helm-20160105.2046") (require 'helm) (helm-mode 1) (global-set-key (kbd "M-y") 'helm-show-kill-ring) diff --git a/elpa/helm-20150704.1247/helm-aliases.el b/elpa/helm-20150704.1247/helm-aliases.el deleted file mode 100644 index eb3d3727..00000000 --- a/elpa/helm-20150704.1247/helm-aliases.el +++ /dev/null @@ -1,776 +0,0 @@ -;;; helm-aliases.el --- Helm aliases for helm obsoletes functions. -*- lexical-binding: t -*- - -;; Copyright (C) 2012 ~ 2015 Thierry Volpiatto - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Code: - -(require 'cl-lib) - - -;;; Helper functions to create aliases with old helm definitions -;; prefixed with "helm-c-" -;; -(defun helm-alias-p (sym) - (cond ((boundp sym) - (not (eq (indirect-variable sym) sym))) - ((fboundp sym) - (symbolp (symbol-function sym))) - (t nil))) - -(defun helm-check-conflicting-prefixes () - (cl-loop for s in (all-completions "helm-c-" obarray) - for rep = (replace-regexp-in-string "helm-c-" "helm-" s) - when (or (and (not (helm-alias-p (intern s))) (fboundp (intern rep))) - (and (not (helm-alias-p (intern s))) (boundp (intern rep)))) - collect rep)) - -(defun helm-collect-functions-with-bad-prefix () - (cl-loop for s in (all-completions "helm-c-" obarray) - for sym = (intern s) - when (and (not (helm-alias-p sym)) (fboundp sym)) - collect s)) - -(defun helm-collect-vars-with-bad-prefix () - (cl-loop for s in (all-completions "helm-c-" obarray) - for sym = (intern s) - when (and (not (helm-alias-p sym)) (boundp sym)) - collect s)) - -(defun helm-insert-fn-aliases () - (cl-loop for s in (helm-collect-functions-with-bad-prefix) - for rep = (replace-regexp-in-string "helm-c-" "helm-" s) - do (insert (format "(defalias '%s '%s)\n(make-obsolete '%s '%s \"1.5.1\")\n" s rep s rep)))) - -(defun helm-insert-var-aliases () - (cl-loop for s in (helm-collect-vars-with-bad-prefix) - for rep = (replace-regexp-in-string "helm-c-" "helm-" s) - do (insert (format "(defvaralias '%s '%s)\n(make-obsolete-variable '%s '%s \"1.5.1\")\n" s rep s rep)))) - - -;;; Alias old functions prefixed with "helm-c-" -;; -;; -(defalias 'helm-c-etags-default-action 'helm-etags-default-action) -(make-obsolete 'helm-c-etags-default-action 'helm-etags-default-action "1.5.1") -(defalias 'helm-c-show-info-in-mode-line 'helm-show-info-in-mode-line) -(make-obsolete 'helm-c-show-info-in-mode-line 'helm-show-info-in-mode-line "1.5.1") -(defalias 'helm-c-grep-highlight-match 'helm-grep-highlight-match) -(make-obsolete 'helm-c-grep-highlight-match 'helm-grep-highlight-match "1.5.1") -(defalias 'helm-c-apropos 'helm-apropos) -(make-obsolete 'helm-c-apropos 'helm-apropos "1.5.1") -(defalias 'helm-c-grep-guess-extensions 'helm-grep-guess-extensions) -(make-obsolete 'helm-c-grep-guess-extensions 'helm-grep-guess-extensions "1.5.1") -(defalias 'helm-c-apt-reinstall 'helm-apt-reinstall) -(make-obsolete 'helm-c-apt-reinstall 'helm-apt-reinstall "1.5.1") -(defalias 'helm-c-reset-adaptive-history 'helm-reset-adaptive-history) -(make-obsolete 'helm-c-reset-adaptive-history 'helm-reset-adaptive-history "1.5.1") -(defalias 'helm-adaptative-mode 'helm-adaptive-mode) -(make-obsolete 'helm-adaptative-mode 'helm-adaptive-mode "1.6.2") -(defalias 'helm-c-highlight-bookmark 'helm-highlight-bookmark) -(make-obsolete 'helm-c-highlight-bookmark 'helm-highlight-bookmark "1.5.1") -(defalias 'helm-c-locate-init 'helm-locate-init) -(make-obsolete 'helm-c-locate-init 'helm-locate-init "1.5.1") -(defalias 'helm-c-delete-file 'helm-delete-file) -(make-obsolete 'helm-c-delete-file 'helm-delete-file "1.5.1") -(defalias 'helm-c-regexp-persistent-action 'helm-regexp-persistent-action) -(make-obsolete 'helm-c-regexp-persistent-action 'helm-regexp-persistent-action "1.5.1") -(defalias 'helm-c-grep-split-line 'helm-grep-split-line) -(make-obsolete 'helm-c-grep-split-line 'helm-grep-split-line "1.5.1") -(defalias 'helm-c-info-display-to-real 'helm-info-display-to-real) -(make-obsolete 'helm-c-info-display-to-real 'helm-info-display-to-real "1.5.1") -(defalias 'helm-c-symbolify 'helm-symbolify) -(make-obsolete 'helm-c-symbolify 'helm-symbolify "1.5.1") -(defalias 'helm-c-zgrep-buffers 'helm-zgrep-buffers) -(make-obsolete 'helm-c-zgrep-buffers 'helm-zgrep-buffers "1.5.1") -(defalias 'helm-c-apt-persistent-action 'helm-apt-persistent-action) -(make-obsolete 'helm-c-apt-persistent-action 'helm-apt-persistent-action "1.5.1") -(defalias 'helm-c-pdfgrep-init 'helm-pdfgrep-init) -(make-obsolete 'helm-c-pdfgrep-init 'helm-pdfgrep-init "1.5.1") -(defalias 'helm-c-walk-directory 'helm-walk-directory) -(make-obsolete 'helm-c-walk-directory 'helm-walk-directory "1.5.1") -(defalias 'helm-c-grep-init 'helm-grep-init) -(make-obsolete 'helm-c-grep-init 'helm-grep-init "1.5.1") -(defalias 'helm-c-ucs-forward-char 'helm-ucs-forward-char) -(make-obsolete 'helm-c-ucs-forward-char 'helm-ucs-forward-char "1.5.1") -(defalias 'helm-c-complete-file-name-at-point 'helm-complete-file-name-at-point) -(make-obsolete 'helm-c-complete-file-name-at-point 'helm-complete-file-name-at-point "1.5.1") -(defalias 'helm-c-timer-real-to-display 'helm-timer-real-to-display) -(make-obsolete 'helm-c-timer-real-to-display 'helm-timer-real-to-display "1.5.1") -(defalias 'helm-c-ucs-init 'helm-ucs-init) -(make-obsolete 'helm-c-ucs-init 'helm-ucs-init "1.5.1") -(defalias 'helm-c-bookmark-run-delete 'helm-bookmark-run-delete) -(make-obsolete 'helm-c-bookmark-run-delete 'helm-bookmark-run-delete "1.5.1") -(defalias 'helm-c-uniq-list 'helm-uniq-list) -(make-obsolete 'helm-c-uniq-list 'helm-uniq-list "1.5.1") -(defalias 'helm-c-pp-bookmarks 'helm-pp-bookmarks) -(make-obsolete 'helm-c-pp-bookmarks 'helm-pp-bookmarks "1.5.1") -(defalias 'helm-c-top-sh-persistent-action 'helm-top-sh-persistent-action) -(make-obsolete 'helm-c-top-sh-persistent-action 'helm-top-sh-persistent-action "1.5.1") -(defalias 'helm-c-grep-action 'helm-grep-action) -(make-obsolete 'helm-c-grep-action 'helm-grep-action "1.5.1") -(defalias 'helm-c-file-buffers 'helm-file-buffers) -(make-obsolete 'helm-c-file-buffers 'helm-file-buffers "1.5.1") -(defalias 'helm-c-google-suggest-fetch 'helm-google-suggest-fetch) -(make-obsolete 'helm-c-google-suggest-fetch 'helm-google-suggest-fetch "1.5.1") -(defalias 'helm-c-arrange-type-attribute 'helm-arrange-type-attribute) -(make-obsolete 'helm-c-arrange-type-attribute 'helm-arrange-type-attribute "1.5.1") -(defalias 'helm-c-yahoo-suggest-action 'helm-yahoo-suggest-action) -(make-obsolete 'helm-c-yahoo-suggest-action 'helm-yahoo-suggest-action "1.5.1") -(defalias 'helm-c-buffer-query-replace-1 'helm-buffer-query-replace-1) -(make-obsolete 'helm-c-buffer-query-replace-1 'helm-buffer-query-replace-1 "1.5.1") -(defalias 'helm-c-make-info-source 'helm-make-info-source) -(make-obsolete 'helm-c-make-info-source 'helm-make-info-source "1.5.1") -(defalias 'helm-c-open-dired 'helm-open-dired) -(make-obsolete 'helm-c-open-dired 'helm-open-dired "1.5.1") -(defalias 'helm-c-kill-ring-transformer 'helm-kill-ring-transformer) -(make-obsolete 'helm-c-kill-ring-transformer 'helm-kill-ring-transformer "1.5.1") -(defalias 'helm-c-etags-init 'helm-etags-init) -(make-obsolete 'helm-c-etags-init 'helm-etags-init "1.5.1") -(defalias 'helm-c-advice-update-current-display-string 'helm-advice-update-current-display-string) -(make-obsolete 'helm-c-advice-update-current-display-string 'helm-advice-update-current-display-string "1.5.1") -(defalias 'helm-c-regexp-get-line 'helm-regexp-get-line) -(make-obsolete 'helm-c-regexp-get-line 'helm-regexp-get-line "1.5.1") -(defalias 'helm-c-grep-run-other-window-action 'helm-grep-run-other-window-action) -(make-obsolete 'helm-c-grep-run-other-window-action 'helm-grep-run-other-window-action "1.5.1") -(defalias 'helm-c-regexp-kill-new 'helm-regexp-kill-new) -(make-obsolete 'helm-c-regexp-kill-new 'helm-regexp-kill-new "1.5.1") -(defalias 'helm-c-grep-run-default-action 'helm-grep-run-default-action) -(make-obsolete 'helm-c-grep-run-default-action 'helm-grep-run-default-action "1.5.1") -(defalias 'helm-c-define-info-index-sources 'helm-define-info-index-sources) -(make-obsolete 'helm-c-define-info-index-sources 'helm-define-info-index-sources "1.5.1") -(defalias 'helm-c-transform-file-browse-url 'helm-transform-file-browse-url) -(make-obsolete 'helm-c-transform-file-browse-url 'helm-transform-file-browse-url "1.5.1") -(defalias 'helm-c-shell-command-if-needed 'helm-shell-command-if-needed) -(make-obsolete 'helm-c-shell-command-if-needed 'helm-shell-command-if-needed "1.5.1") -(defalias 'helm-c-kill-regexp-as-sexp 'helm-kill-regexp-as-sexp) -(make-obsolete 'helm-c-kill-regexp-as-sexp 'helm-kill-regexp-as-sexp "1.5.1") -(defalias 'helm-c-goto-next-or-prec-file 'helm-goto-next-or-prec-file) -(make-obsolete 'helm-c-goto-next-or-prec-file 'helm-goto-next-or-prec-file "1.5.1") -(defalias 'helm-c-insert-file-name-completion-at-point 'helm-insert-file-name-completion-at-point) -(make-obsolete 'helm-c-insert-file-name-completion-at-point 'helm-insert-file-name-completion-at-point "1.5.1") -(defalias 'helm-c-point-file-in-dired 'helm-point-file-in-dired) -(make-obsolete 'helm-c-point-file-in-dired 'helm-point-file-in-dired "1.5.1") -(defalias 'helm-c-info-goto 'helm-info-goto) -(make-obsolete 'helm-c-info-goto 'helm-info-goto "1.5.1") -(defalias 'helm-c-apt-install 'helm-apt-install) -(make-obsolete 'helm-c-apt-install 'helm-apt-install "1.5.1") -(defalias 'helm-c-skip-boring-buffers 'helm-skip-boring-buffers) -(make-obsolete 'helm-c-skip-boring-buffers 'helm-skip-boring-buffers "1.5.1") -(defalias 'helm-c-register-candidates 'helm-register-candidates) -(make-obsolete 'helm-c-register-candidates 'helm-register-candidates "1.5.1") -(defalias 'helm-c-find-function 'helm-find-function) -(make-obsolete 'helm-c-find-function 'helm-find-function "1.5.1") -(defalias 'helm-c-apt-display-to-real 'helm-apt-display-to-real) -(make-obsolete 'helm-c-apt-display-to-real 'helm-apt-display-to-real "1.5.1") -(defalias 'helm-c-org-keywords-init 'helm-org-keywords-init) -(make-obsolete 'helm-c-org-keywords-init 'helm-org-keywords-init "1.5.1") -(defalias 'helm-c-xrandr-screen 'helm-xrandr-screen) -(make-obsolete 'helm-c-xrandr-screen 'helm-xrandr-screen "1.5.1") -(defalias 'helm-c-position 'helm-position) -(make-obsolete 'helm-c-position 'helm-position "1.5.1") -(defalias 'helm-c-imenu-candidates 'helm-imenu-candidates) -(make-obsolete 'helm-c-imenu-candidates 'helm-imenu-candidates "1.5.1") -(defalias 'helm-c-ucs-persistent-forward 'helm-ucs-persistent-forward) -(make-obsolete 'helm-c-ucs-persistent-forward 'helm-ucs-persistent-forward "1.5.1") -(defalias 'helm-c-basename 'helm-basename) -(make-obsolete 'helm-c-basename 'helm-basename "1.5.1") -(defalias 'helm-c-files-in-all-dired-candidates 'helm-files-in-all-dired-candidates) -(make-obsolete 'helm-c-files-in-all-dired-candidates 'helm-files-in-all-dired-candidates "1.5.1") -(defalias 'helm-c-grep-other-window 'helm-grep-other-window) -(make-obsolete 'helm-c-grep-other-window 'helm-grep-other-window "1.5.1") -(defalias 'helm-c-yahoo-suggest-fetch 'helm-yahoo-suggest-fetch) -(make-obsolete 'helm-c-yahoo-suggest-fetch 'helm-yahoo-suggest-fetch "1.5.1") -(defalias 'helm-c-external-commands-list-1 'helm-external-commands-list-1) -(make-obsolete 'helm-c-external-commands-list-1 'helm-external-commands-list-1 "1.5.1") -(defalias 'helm-c-buffers-list-persistent-action 'helm-buffers-list-persistent-action) -(make-obsolete 'helm-c-buffers-list-persistent-action 'helm-buffers-list-persistent-action "1.5.1") -(defalias 'helm-c-show-completion-init-overlay 'helm-show-completion-init-overlay) -(make-obsolete 'helm-c-show-completion-init-overlay 'helm-show-completion-init-overlay "1.5.1") -(defalias 'helm-c-shadow-boring-files 'helm-shadow-boring-files) -(make-obsolete 'helm-c-shadow-boring-files 'helm-shadow-boring-files "1.5.1") -(defalias 'helm-c-bookmark-local-files-setup-alist 'helm-bookmark-local-files-setup-alist) -(make-obsolete 'helm-c-bookmark-local-files-setup-alist 'helm-bookmark-local-files-setup-alist "1.5.1") -(defalias 'helm-c-highlight-local-use 'helm-highlight-local-use) -(make-obsolete 'helm-c-highlight-local-use 'helm-highlight-local-use "1.5.1") -(defalias 'helm-c-skip-current-file 'helm-skip-current-file) -(make-obsolete 'helm-c-skip-current-file 'helm-skip-current-file "1.5.1") -(defalias 'helm-c-goto-next-file 'helm-goto-next-file) -(make-obsolete 'helm-c-goto-next-file 'helm-goto-next-file "1.5.1") -(defalias 'helm-c-info-init 'helm-info-init) -(make-obsolete 'helm-c-info-init 'helm-info-init "1.5.1") -(defalias 'helm-c-query-replace-args 'helm-query-replace-args) -(make-obsolete 'helm-c-query-replace-args 'helm-query-replace-args "1.5.1") -(defalias 'helm-c-bookmark-info-setup-alist 'helm-bookmark-info-setup-alist) -(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-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) -(make-obsolete 'helm-c-info-pages-init 'helm-info-pages-init "1.5.1") -(defalias 'helm-c-grep-save-results 'helm-grep-save-results) -(make-obsolete 'helm-c-grep-save-results 'helm-grep-save-results "1.5.1") -(defalias 'helm-c-read-file-name 'helm-read-file-name) -(make-obsolete 'helm-c-read-file-name 'helm-read-file-name "1.5.1") -(defalias 'helm-c-org-keywords-insert 'helm-org-keywords-insert) -(make-obsolete 'helm-c-org-keywords-insert 'helm-org-keywords-insert "1.5.1") -(defalias 'helm-c-call-interactively 'helm-call-interactively) -(make-obsolete 'helm-c-call-interactively 'helm-call-interactively "1.5.1") -(defalias 'helm-c-adaptative-compare 'helm-adaptive-compare) -(make-obsolete 'helm-c-adaptative-compare 'helm-adaptive-compare "1.5.1") -(defalias 'helm-c-buffer-list 'helm-buffer-list) -(make-obsolete 'helm-c-buffer-list 'helm-buffer-list "1.5.1") -(defalias 'helm-c-thing-before-point 'helm-thing-before-point) -(make-obsolete 'helm-c-thing-before-point 'helm-thing-before-point "1.5.1") -(defalias 'helm-c-ratpoison-commands-display-to-real 'helm-ratpoison-commands-display-to-real) -(make-obsolete 'helm-c-ratpoison-commands-display-to-real 'helm-ratpoison-commands-display-to-real "1.5.1") -(defalias 'helm-c-imenu-default-action 'helm-imenu-default-action) -(make-obsolete 'helm-c-imenu-default-action 'helm-imenu-default-action "1.5.1") -(defalias 'helm-c-describe-function 'helm-describe-function) -(make-obsolete 'helm-c-describe-function 'helm-describe-function "1.5.1") -(defalias 'helm-c-colors-get-name 'helm-colors-get-name) -(make-obsolete 'helm-c-colors-get-name 'helm-colors-get-name "1.5.1") -(defalias 'helm-c-bookmark-help 'helm-bookmark-help) -(make-obsolete 'helm-c-bookmark-help 'helm-bookmark-help "1.5.1") -(defalias 'helm-c-ucs-persistent-delete 'helm-ucs-persistent-delete) -(make-obsolete 'helm-c-ucs-persistent-delete 'helm-ucs-persistent-delete "1.5.1") -(defalias 'helm-c-set-variable 'helm-set-variable) -(make-obsolete 'helm-c-set-variable 'helm-set-variable "1.5.1") -(defalias 'helm-c-grep-save-results-1 'helm-grep-save-results-1) -(make-obsolete 'helm-c-grep-save-results-1 'helm-grep-save-results-1 "1.5.1") -(defalias 'helm-c-adaptative-maybe-load-history 'helm-adaptive-maybe-load-history) -(make-obsolete 'helm-c-adaptative-maybe-load-history 'helm-adaptive-maybe-load-history "1.5.1") -(defalias 'helm-c-w32-pathname-transformer 'helm-w32-pathname-transformer) -(make-obsolete 'helm-c-w32-pathname-transformer 'helm-w32-pathname-transformer "1.5.1") -(defalias 'helm-c-top-display-to-real 'helm-top-display-to-real) -(make-obsolete 'helm-c-top-display-to-real 'helm-top-display-to-real "1.5.1") -(defalias 'helm-c-open-file-externally 'helm-open-file-externally) -(make-obsolete 'helm-c-open-file-externally 'helm-open-file-externally "1.5.1") -(defalias 'helm-c-colors-get-rgb 'helm-colors-get-rgb) -(make-obsolete 'helm-c-colors-get-rgb 'helm-colors-get-rgb "1.5.1") -(defalias 'helm-c-stumpwm-commands-init 'helm-stumpwm-commands-init) -(make-obsolete 'helm-c-stumpwm-commands-init 'helm-stumpwm-commands-init "1.5.1") -(defalias 'helm-c-highlight-world 'helm-highlight-world) -(make-obsolete 'helm-c-highlight-world 'helm-highlight-world "1.5.1") -(defalias 'helm-c-top-sh 'helm-top-sh) -(make-obsolete 'helm-c-top-sh 'helm-top-sh "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) -(make-obsolete 'helm-c-latex-math-candidates 'helm-latex-math-candidates "1.5.1") -(defalias 'helm-c-ucs-backward-char 'helm-ucs-backward-char) -(make-obsolete 'helm-c-ucs-backward-char 'helm-ucs-backward-char "1.5.1") -(defalias 'helm-c-calculate-ucs-max-len 'helm-calculate-ucs-max-len) -(make-obsolete 'helm-c-calculate-ucs-max-len 'helm-calculate-ucs-max-len "1.5.1") -(defalias 'helm-c-etags-mtime 'helm-etags-mtime) -(make-obsolete 'helm-c-etags-mtime 'helm-etags-mtime "1.5.1") -(defalias 'helm-c-google-suggest-action 'helm-google-suggest-action) -(make-obsolete 'helm-c-google-suggest-action 'helm-google-suggest-action "1.5.1") -(defalias 'helm-c-elisp-library-scan-init 'helm-elisp-library-scan-init) -(make-obsolete 'helm-c-elisp-library-scan-init 'helm-elisp-library-scan-init "1.5.1") -(defalias 'helm-c-apt-refresh 'helm-apt-refresh) -(make-obsolete 'helm-c-apt-refresh 'helm-apt-refresh "1.5.1") -(defalias 'helm-c-kill-regexp 'helm-kill-regexp) -(make-obsolete 'helm-c-kill-regexp 'helm-kill-regexp "1.5.1") -(defalias 'helm-c-grep-buffers-1 'helm-grep-buffers-1) -(make-obsolete 'helm-c-grep-buffers-1 'helm-grep-buffers-1 "1.5.1") -(defalias 'helm-c-adaptative-store-selection 'helm-adaptive-store-selection) -(make-obsolete 'helm-c-adaptative-store-selection 'helm-adaptive-store-selection "1.5.1") -(defalias 'helm-c-browse-url 'helm-browse-url) -(make-obsolete 'helm-c-browse-url 'helm-browse-url "1.5.1") -(defalias 'helm-c-google-suggest-emacs-lisp 'helm-google-suggest-emacs-lisp) -(make-obsolete 'helm-c-google-suggest-emacs-lisp 'helm-google-suggest-emacs-lisp "1.5.1") -(defalias 'helm-c-ucs-persistent-insert 'helm-ucs-persistent-insert) -(make-obsolete 'helm-c-ucs-persistent-insert 'helm-ucs-persistent-insert "1.5.1") -(defalias 'helm-c-xrandr-output 'helm-xrandr-output) -(make-obsolete 'helm-c-xrandr-output 'helm-xrandr-output "1.5.1") -(defalias 'helm-c-kill-ring-action 'helm-kill-ring-action) -(make-obsolete 'helm-c-kill-ring-action 'helm-kill-ring-action "1.5.1") -(defalias 'helm-c-org-keywords-candidates 'helm-org-keywords-candidates) -(make-obsolete 'helm-c-org-keywords-candidates 'helm-org-keywords-candidates "1.5.1") -(defalias 'helm-c-bookmark-jump 'helm-bookmark-jump) -(make-obsolete 'helm-c-bookmark-jump 'helm-bookmark-jump "1.5.1") -(defalias 'helm-c-shadow-boring-buffers 'helm-shadow-boring-buffers) -(make-obsolete 'helm-c-shadow-boring-buffers 'helm-shadow-boring-buffers "1.5.1") -(defalias 'helm-c-buffer-match-major-mode 'helm-buffer-match-major-mode) -(make-obsolete 'helm-c-buffer-match-major-mode 'helm-buffer-match-major-mode "1.5.1") -(defalias 'helm-c-highlight-bookmark-su 'helm-highlight-bookmark-su) -(make-obsolete 'helm-c-highlight-bookmark-su 'helm-highlight-bookmark-su "1.5.1") -(defalias 'helm-c-grep-other-frame 'helm-grep-other-frame) -(make-obsolete 'helm-c-grep-other-frame 'helm-grep-other-frame "1.5.1") -(defalias 'helm-c-jabber-online-contacts 'helm-jabber-online-contacts) -(make-obsolete 'helm-c-jabber-online-contacts 'helm-jabber-online-contacts "1.5.1") -(defalias 'helm-c-apt-purge 'helm-apt-purge) -(make-obsolete 'helm-c-apt-purge 'helm-apt-purge "1.5.1") -(defalias 'helm-c-adaptative-sort 'helm-adaptive-sort) -(make-obsolete 'helm-c-adaptative-sort 'helm-adaptive-sort "1.5.1") -(defalias 'helm-c-bmkext-addressbook-setup-alist 'helm-bmkext-addressbook-setup-alist) -(make-obsolete 'helm-c-bmkext-addressbook-setup-alist 'helm-bmkext-addressbook-setup-alist "1.5.1") -(defalias 'helm-c-bmkext-filter-setup-alist 'helm-bmkext-filter-setup-alist) -(make-obsolete 'helm-c-bmkext-filter-setup-alist 'helm-bmkext-filter-setup-alist "1.5.1") -(defalias 'helm-c-grep-buffers 'helm-grep-buffers) -(make-obsolete 'helm-c-grep-buffers 'helm-grep-buffers "1.5.1") -(defalias 'helm-c-apt-init 'helm-apt-init) -(make-obsolete 'helm-c-apt-init 'helm-apt-init "1.5.1") -(defalias 'helm-c-grep-run-save-buffer 'helm-grep-run-save-buffer) -(make-obsolete 'helm-c-grep-run-save-buffer 'helm-grep-run-save-buffer "1.5.1") -(defalias 'helm-c-ggs-set-number-result 'helm-ggs-set-number-result) -(make-obsolete 'helm-c-ggs-set-number-result 'helm-ggs-set-number-result "1.5.1") -(defalias 'helm-c-grep-prepare-candidates 'helm-grep-prepare-candidates) -(make-obsolete 'helm-c-grep-prepare-candidates 'helm-grep-prepare-candidates "1.5.1") -(defalias 'helm-c-grep-jump-elscreen 'helm-grep-jump-elscreen) -(make-obsolete 'helm-c-grep-jump-elscreen 'helm-grep-jump-elscreen "1.5.1") -(defalias 'helm-c-show-completion-display-function 'helm-show-completion-display-function) -(make-obsolete 'helm-c-show-completion-display-function 'helm-show-completion-display-function "1.5.1") -(defalias 'helm-c-find-variable 'helm-find-variable) -(make-obsolete 'helm-c-find-variable 'helm-find-variable "1.5.1") -(defalias 'helm-c-build-elvi-list 'helm-build-elvi-list) -(make-obsolete 'helm-c-build-elvi-list 'helm-build-elvi-list "1.5.1") -(defalias 'helm-c-advice-toggle 'helm-advice-toggle) -(make-obsolete 'helm-c-advice-toggle 'helm-advice-toggle "1.5.1") -(defalias 'helm-c-buffers-persistent-kill 'helm-buffers-persistent-kill) -(make-obsolete 'helm-c-buffers-persistent-kill 'helm-buffers-persistent-kill "1.5.1") -(defalias 'helm-c-register-action-transformer 'helm-register-action-transformer) -(make-obsolete 'helm-c-register-action-transformer 'helm-register-action-transformer "1.5.1") -(defalias 'helm-c-kill-ring-candidates 'helm-kill-ring-candidates) -(make-obsolete 'helm-c-kill-ring-candidates 'helm-kill-ring-candidates "1.5.1") -(defalias 'helm-c-generic-browser 'helm-generic-browser) -(make-obsolete 'helm-c-generic-browser 'helm-generic-browser "1.5.1") -(defalias 'helm-c-top-init 'helm-top-init) -(make-obsolete 'helm-c-top-init 'helm-top-init "1.5.1") -(defalias 'helm-c-ucs-delete-backward 'helm-ucs-delete-backward) -(make-obsolete 'helm-c-ucs-delete-backward 'helm-ucs-delete-backward "1.5.1") -(defalias 'helm-c-apt-generic-action 'helm-apt-generic-action) -(make-obsolete 'helm-c-apt-generic-action 'helm-apt-generic-action "1.5.1") -(defalias 'helm-c-pdfgrep-action-1 'helm-pdfgrep-action-1) -(make-obsolete 'helm-c-pdfgrep-action-1 'helm-pdfgrep-action-1 "1.5.1") -(defalias 'helm-c-buffer-query-replace-regexp 'helm-buffer-query-replace-regexp) -(make-obsolete 'helm-c-buffer-query-replace-regexp 'helm-buffer-query-replace-regexp "1.5.1") -(defalias 'helm-c-apropos-init 'helm-apropos-init) -(make-obsolete 'helm-c-apropos-init 'helm-apropos-init "1.5.1") -(defalias 'helm-c-kill-new 'helm-kill-new) -(make-obsolete 'helm-c-kill-new 'helm-kill-new "1.5.1") -(defalias 'helm-c-bookmark-gnus-setup-alist 'helm-bookmark-gnus-setup-alist) -(make-obsolete 'helm-c-bookmark-gnus-setup-alist 'helm-bookmark-gnus-setup-alist "1.5.1") -(defalias 'helm-c-quit-and-execute-action 'helm-quit-and-execute-action) -(make-obsolete 'helm-c-quit-and-execute-action 'helm-quit-and-execute-action "1.5.1") -(defalias 'helm-c-build-info-index-command 'helm-build-info-index-command) -(make-obsolete 'helm-c-build-info-index-command 'helm-build-info-index-command "1.5.1") -(defalias 'helm-c-ratpoison-commands-init 'helm-ratpoison-commands-init) -(make-obsolete 'helm-c-ratpoison-commands-init 'helm-ratpoison-commands-init "1.5.1") -(defalias 'helm-c-etags-select 'helm-etags-select) -(make-obsolete 'helm-c-etags-select 'helm-etags-select "1.5.1") -(defalias 'helm-c-etags-create-buffer 'helm-etags-create-buffer) -(make-obsolete 'helm-c-etags-create-buffer 'helm-etags-create-buffer "1.5.1") -(defalias 'helm-c-yahoo-suggest-set-candidates 'helm-yahoo-suggest-set-candidates) -(make-obsolete 'helm-c-yahoo-suggest-set-candidates 'helm-yahoo-suggest-set-candidates "1.5.1") -(defalias 'helm-c-org-keywords-show-help 'helm-org-keywords-show-help) -(make-obsolete 'helm-c-org-keywords-show-help 'helm-org-keywords-show-help "1.5.1") -(defalias 'helm-c-highlight-files 'helm-highlight-files) -(make-obsolete 'helm-c-highlight-files 'helm-highlight-files "1.5.1") -(defalias 'helm-c-get-pid-from-process-name 'helm-get-pid-from-process-name) -(make-obsolete 'helm-c-get-pid-from-process-name 'helm-get-pid-from-process-name "1.5.1") -(defalias 'helm-c-insert-latex-math 'helm-insert-latex-math) -(make-obsolete 'helm-c-insert-latex-math 'helm-insert-latex-math "1.5.1") -(defalias 'helm-c-buffer-query-replace 'helm-buffer-query-replace) -(make-obsolete 'helm-c-buffer-query-replace 'helm-buffer-query-replace "1.5.1") -(defalias 'helm-c-bmkext-run-edit 'helm-bmkext-run-edit) -(make-obsolete 'helm-c-bmkext-run-edit 'helm-bmkext-run-edit "1.5.1") -(defalias 'helm-c-skip-boring-files 'helm-skip-boring-files) -(make-obsolete 'helm-c-skip-boring-files 'helm-skip-boring-files "1.5.1") -(defalias 'helm-c-transform-file-load-el 'helm-transform-file-load-el) -(make-obsolete 'helm-c-transform-file-load-el 'helm-transform-file-load-el "1.5.1") -(defalias 'helm-c-ucs-insert-char 'helm-ucs-insert-char) -(make-obsolete 'helm-c-ucs-insert-char 'helm-ucs-insert-char "1.5.1") -(defalias 'helm-c-buffer-help 'helm-buffer-help) -(make-obsolete 'helm-c-buffer-help 'helm-buffer-help "1.5.1") -(defalias 'helm-c-current-directory 'helm-current-directory) -(make-obsolete 'helm-c-current-directory 'helm-current-directory "1.5.1") -(defalias 'helm-c-find-file-or-marked 'helm-find-file-or-marked) -(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-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) -(make-obsolete 'helm-c-advice-persistent-action 'helm-advice-persistent-action "1.5.1") -(defalias 'helm-c-show-completion 'helm-show-completion) -(make-obsolete 'helm-c-show-completion 'helm-show-completion "1.5.1") -(defalias 'helm-c-google-suggest-set-candidates 'helm-google-suggest-set-candidates) -(make-obsolete 'helm-c-google-suggest-set-candidates 'helm-google-suggest-set-candidates "1.5.1") -(defalias 'helm-c-grep-persistent-action 'helm-grep-persistent-action) -(make-obsolete 'helm-c-grep-persistent-action 'helm-grep-persistent-action "1.5.1") -(defalias 'helm-c-open-file-with-default-tool 'helm-open-file-with-default-tool) -(make-obsolete 'helm-c-open-file-with-default-tool 'helm-open-file-with-default-tool "1.5.1") -(defalias 'helm-c-run-external-command 'helm-run-external-command) -(make-obsolete 'helm-c-run-external-command 'helm-run-external-command "1.5.1") -(defalias 'helm-c-bookmark-images-setup-alist 'helm-bookmark-images-setup-alist) -(make-obsolete 'helm-c-bookmark-images-setup-alist 'helm-bookmark-images-setup-alist "1.5.1") -(defalias 'helm-c-apt-candidate-transformer 'helm-apt-candidate-transformer) -(make-obsolete 'helm-c-apt-candidate-transformer 'helm-apt-candidate-transformer "1.5.1") -(defalias 'helm-c-grep-run-persistent-action 'helm-grep-run-persistent-action) -(make-obsolete 'helm-c-grep-run-persistent-action 'helm-grep-run-persistent-action "1.5.1") -(defalias 'helm-c-highlight-buffers 'helm-highlight-buffers) -(make-obsolete 'helm-c-highlight-buffers 'helm-highlight-buffers "1.5.1") -(defalias 'helm-c-man-default-action 'helm-man-default-action) -(make-obsolete 'helm-c-man-default-action 'helm-man-default-action "1.5.1") -(defalias 'helm-c-advice-candidates 'helm-advice-candidates) -(make-obsolete 'helm-c-advice-candidates 'helm-advice-candidates "1.5.1") -(defalias 'helm-c-stumpwm-commands-execute 'helm-stumpwm-commands-execute) -(make-obsolete 'helm-c-stumpwm-commands-execute 'helm-stumpwm-commands-execute "1.5.1") -(defalias 'helm-c-ucs-help 'helm-ucs-help) -(make-obsolete 'helm-c-ucs-help 'helm-ucs-help "1.5.1") -(defalias 'helm-c-apt-uninstall 'helm-apt-uninstall) -(make-obsolete 'helm-c-apt-uninstall 'helm-apt-uninstall "1.5.1") -(defalias 'helm-c-bookmark-run-jump-other-window 'helm-bookmark-run-jump-other-window) -(make-obsolete 'helm-c-bookmark-run-jump-other-window 'helm-bookmark-run-jump-other-window "1.5.1") -(defalias 'helm-c-elisp-library-scan-list 'helm-elisp-library-scan-list) -(make-obsolete 'helm-c-elisp-library-scan-list 'helm-elisp-library-scan-list "1.5.1") -(defalias 'helm-c-bookmark-man-setup-alist 'helm-bookmark-man-setup-alist) -(make-obsolete 'helm-c-bookmark-man-setup-alist 'helm-bookmark-man-setup-alist "1.5.1") -(defalias 'helm-c-etags-find-tag-file-directory 'helm-etags-find-tag-file-directory) -(make-obsolete 'helm-c-etags-find-tag-file-directory 'helm-etags-find-tag-file-directory "1.5.1") -(defalias 'helm-c-xrandr-info 'helm-xrandr-info) -(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-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) -(make-obsolete 'helm-c-apt-cache-show 'helm-apt-cache-show "1.5.1") -(defalias 'helm-c-etags-file-modified-p 'helm-etags-file-modified-p) -(make-obsolete 'helm-c-etags-file-modified-p 'helm-etags-file-modified-p "1.5.1") -(defalias 'helm-c-etags-get-tag-file 'helm-etags-get-tag-file) -(make-obsolete 'helm-c-etags-get-tag-file 'helm-etags-get-tag-file "1.5.1") -(defalias 'helm-c-highlight-not-logged 'helm-highlight-not-logged) -(make-obsolete 'helm-c-highlight-not-logged 'helm-highlight-not-logged "1.5.1") -(defalias 'helm-c-pdfgrep-action 'helm-pdfgrep-action) -(make-obsolete 'helm-c-pdfgrep-action 'helm-pdfgrep-action "1.5.1") -(defalias 'helm-c-adaptative-save-history 'helm-adaptive-save-history) -(make-obsolete 'helm-c-adaptative-save-history 'helm-adaptive-save-history "1.5.1") -(defalias 'helm-c-get-first-line-documentation 'helm-get-first-line-documentation) -(make-obsolete 'helm-c-get-first-line-documentation 'helm-get-first-line-documentation "1.5.1") -(defalias 'helm-approximate-candidate-number 'helm-get-candidate-number) -(make-obsolete 'helm-approximate-candidate-number 'helm-get-candidate-number "1.5.5") -(defalias 'helm-org-headlines 'helm-org-in-buffer-headings) -(make-obsolete 'helm-org-headlines 'helm-org-in-buffer-headings "1.6.5") - - -;;; variables -;; -;; - - -(defvaralias 'helm-c-pdfgrep-default-command 'helm-pdfgrep-default-command) -(make-obsolete-variable 'helm-c-pdfgrep-default-command 'helm-pdfgrep-default-command "1.5.1") -(defvaralias 'helm-c-source-time-world 'helm-source-time-world) -(make-obsolete-variable 'helm-c-source-time-world 'helm-source-time-world "1.5.1") -(defvaralias 'helm-c-grep-default-command 'helm-grep-default-command) -(make-obsolete-variable 'helm-c-grep-default-command 'helm-grep-default-command "1.5.1") -(defvaralias 'helm-c-default-info-index-list 'helm-default-info-index-list) -(make-obsolete-variable 'helm-c-default-info-index-list 'helm-default-info-index-list "1.5.1") -(defvaralias 'helm-c-etags-tag-file-dir 'helm-etags-tag-file-dir) -(make-obsolete-variable 'helm-c-etags-tag-file-dir 'helm-etags-tag-file-dir "1.5.1") -(defvaralias 'helm-c-source-man-pages 'helm-source-man-pages) -(make-obsolete-variable 'helm-c-source-man-pages 'helm-source-man-pages "1.5.1") -(defvaralias 'helm-c-source-bookmark-info 'helm-source-bookmark-info) -(make-obsolete-variable 'helm-c-source-bookmark-info 'helm-source-bookmark-info "1.5.1") -(defvaralias 'helm-c-file-cache-files 'helm-file-cache-files) -(make-obsolete-variable 'helm-c-file-cache-files 'helm-file-cache-files "1.5.1") -(defvaralias 'helm-c-ucs-map 'helm-ucs-map) -(make-obsolete-variable 'helm-c-ucs-map 'helm-ucs-map "1.5.1") -(defvaralias 'helm-c-show-completion-min-window-height 'helm-show-completion-min-window-height) -(make-obsolete-variable 'helm-c-show-completion-min-window-height 'helm-show-completion-min-window-height "1.5.1") -(defvaralias 'helm-c-adaptative-history 'helm-adaptive-history) -(make-obsolete-variable 'helm-c-adaptative-history 'helm-adaptive-history "1.5.1") -(defvaralias 'helm-c-source-bookmarks-local 'helm-source-bookmarks-local) -(make-obsolete-variable 'helm-c-source-bookmarks-local 'helm-source-bookmarks-local "1.5.1") -(defvaralias 'helm-c-grep-map 'helm-grep-map) -(make-obsolete-variable 'helm-c-grep-map 'helm-grep-map "1.5.1") -(defvaralias 'helm-c-source-session 'helm-source-session) -(make-obsolete-variable 'helm-c-source-session 'helm-source-session "1.5.1") -(defvaralias 'helm-c-source-minibuffer-history 'helm-source-minibuffer-history) -(make-obsolete-variable 'helm-c-source-minibuffer-history 'helm-source-minibuffer-history "1.5.1") -(defvaralias 'helm-c-source-files-in-current-dir 'helm-source-files-in-current-dir) -(make-obsolete-variable 'helm-c-source-files-in-current-dir 'helm-source-files-in-current-dir "1.5.1") -(defvaralias 'helm-c-source-etags-select 'helm-source-etags-select) -(make-obsolete-variable 'helm-c-source-etags-select 'helm-source-etags-select "1.5.1") -(defvaralias 'helm-c-show-completion-overlay 'helm-show-completion-overlay) -(make-obsolete-variable 'helm-c-show-completion-overlay 'helm-show-completion-overlay "1.5.1") -(defvaralias 'helm-c-buffer-help-message 'helm-buffer-help-message) -(make-obsolete-variable 'helm-c-buffer-help-message 'helm-buffer-help-message "1.5.1") -(defvaralias 'helm-c-ucs-max-len 'helm-ucs-max-len) -(make-obsolete-variable 'helm-c-ucs-max-len 'helm-ucs-max-len "1.5.1") -(defvaralias 'helm-c-imenu-index-filter 'helm-imenu-index-filter) -(make-obsolete-variable 'helm-c-imenu-index-filter 'helm-imenu-index-filter "1.5.1") -(defvaralias 'helm-c-org-keywords-info-location 'helm-org-keywords-info-location) -(make-obsolete-variable 'helm-c-org-keywords-info-location 'helm-org-keywords-info-location "1.5.1") -(defvaralias 'helm-c-kill-ring-max-lines-number 'helm-kill-ring-max-lines-number) -(make-obsolete-variable 'helm-c-kill-ring-max-lines-number 'helm-kill-ring-max-lines-number "1.5.1") -(defvaralias 'helm-c-source-apt 'helm-source-apt) -(make-obsolete-variable 'helm-c-source-apt 'helm-source-apt "1.5.1") -(defvaralias 'helm-c-bookmark-map 'helm-bookmark-map) -(make-obsolete-variable 'helm-c-bookmark-map 'helm-bookmark-map "1.5.1") -(defvaralias 'helm-c-source-xfonts 'helm-source-xfonts) -(make-obsolete-variable 'helm-c-source-xfonts 'helm-source-xfonts "1.5.1") -(defvaralias 'helm-c-source-kill-ring 'helm-source-kill-ring) -(make-obsolete-variable 'helm-c-source-kill-ring 'helm-source-kill-ring "1.5.1") -(defvaralias 'helm-c-home-url 'helm-home-url) -(make-obsolete-variable 'helm-c-home-url 'helm-home-url "1.5.1") -(defvaralias 'helm-c-etags-cache 'helm-etags-cache) -(make-obsolete-variable 'helm-c-etags-cache 'helm-etags-cache "1.5.1") -(defvaralias 'helm-c-source-latex-math 'helm-source-latex-math) -(make-obsolete-variable 'helm-c-source-latex-math 'helm-source-latex-math "1.5.1") -(defvaralias 'helm-c-source-bookmark-files&dirs 'helm-source-bookmark-files&dirs) -(make-obsolete-variable 'helm-c-source-bookmark-files&dirs 'helm-source-bookmark-files&dirs "1.5.1") -(defvaralias 'helm-c-source-ratpoison-commands 'helm-source-ratpoison-commands) -(make-obsolete-variable 'helm-c-source-ratpoison-commands 'helm-source-ratpoison-commands "1.5.1") -(defvaralias 'helm-c-apt-show-command 'helm-apt-show-command) -(make-obsolete-variable 'helm-c-apt-show-command 'helm-apt-show-command "1.5.1") -(defvaralias 'helm-c-pdfgrep-default-function 'helm-pdfgrep-default-function) -(make-obsolete-variable 'helm-c-pdfgrep-default-function 'helm-pdfgrep-default-function "1.5.1") -(defvaralias 'helm-c-source-register 'helm-source-register) -(make-obsolete-variable 'helm-c-source-register 'helm-source-register "1.5.1") -(defvaralias 'helm-c-boring-buffer-regexp-list 'helm-boring-buffer-regexp-list) -(make-obsolete-variable 'helm-c-boring-buffer-regexp-list 'helm-boring-buffer-regexp-list "1.5.1") -(defvaralias 'helm-c-source-locate 'helm-source-locate) -(make-obsolete-variable 'helm-c-source-locate 'helm-source-locate "1.5.1") -(defvaralias 'helm-c-source-advice 'helm-source-advice) -(make-obsolete-variable 'helm-c-source-advice 'helm-source-advice "1.5.1") -(defvaralias 'helm-c-source-yaoddmuse-emacswiki-edit-or-view 'helm-source-yaoddmuse-emacswiki-edit-or-view) -(defvaralias 'helm-c-ucs-mode-line-string 'helm-ucs-mode-line-string) -(make-obsolete-variable 'helm-c-ucs-mode-line-string 'helm-ucs-mode-line-string "1.5.1") -(defvaralias 'helm-c-xfonts-cache 'helm-xfonts-cache) -(make-obsolete-variable 'helm-c-xfonts-cache 'helm-xfonts-cache "1.5.1") -(defvaralias 'helm-c-source-yahoo-suggest 'helm-source-yahoo-suggest) -(make-obsolete-variable 'helm-c-source-yahoo-suggest 'helm-source-yahoo-suggest "1.5.1") -(defvaralias 'helm-c-rzgrep-cache 'helm-rzgrep-cache) -(make-obsolete-variable 'helm-c-rzgrep-cache 'helm-rzgrep-cache "1.5.1") -(defvaralias 'helm-c-source-org-keywords 'helm-source-org-keywords) -(make-obsolete-variable 'helm-c-source-org-keywords 'helm-source-org-keywords "1.5.1") -(defvaralias 'helm-c-pdfgrep-map 'helm-pdfgrep-map) -(make-obsolete-variable 'helm-c-pdfgrep-map 'helm-pdfgrep-map "1.5.1") -(defvaralias 'helm-c-source-lacarte 'helm-source-lacarte) -(make-obsolete-variable 'helm-c-source-lacarte 'helm-source-lacarte "1.5.1") -(defvaralias 'helm-c-apt-search-command 'helm-apt-search-command) -(make-obsolete-variable 'helm-c-apt-search-command 'helm-apt-search-command "1.5.1") -(defvaralias 'helm-c-default-external-file-browser 'helm-default-external-file-browser) -(make-obsolete-variable 'helm-c-default-external-file-browser 'helm-default-external-file-browser "1.5.1") -(defvaralias 'helm-c-source-evaluation-result 'helm-source-evaluation-result) -(make-obsolete-variable 'helm-c-source-evaluation-result 'helm-source-evaluation-result "1.5.1") -(defvaralias 'helm-c-yahoo-suggest-search-url 'helm-yahoo-suggest-search-url) -(make-obsolete-variable 'helm-c-yahoo-suggest-search-url 'helm-yahoo-suggest-search-url "1.5.1") -(defvaralias 'helm-c-source-occur 'helm-source-occur) -(make-obsolete-variable 'helm-c-source-occur 'helm-source-occur "1.5.1") -(defvaralias 'helm-c-source-calculation-result 'helm-source-calculation-result) -(make-obsolete-variable 'helm-c-source-calculation-result 'helm-source-calculation-result "1.5.1") -(defvaralias 'helm-c-default-zgrep-command 'helm-default-zgrep-command) -(make-obsolete-variable 'helm-c-default-zgrep-command 'helm-default-zgrep-command "1.5.1") -(defvaralias 'helm-c-show-info-in-mode-line-delay 'helm-show-info-in-mode-line-delay) -(make-obsolete-variable 'helm-c-show-info-in-mode-line-delay 'helm-show-info-in-mode-line-delay "1.5.1") -(defvaralias 'helm-c-source-ido-virtual-buffers 'helm-source-ido-virtual-buffers) -(make-obsolete-variable 'helm-c-source-ido-virtual-buffers 'helm-source-ido-virtual-buffers "1.5.1") -(defvaralias 'helm-c-source-top 'helm-source-top) -(make-obsolete-variable 'helm-c-source-top 'helm-source-top "1.5.1") -(defvaralias 'helm-c-source-colors 'helm-source-colors) -(make-obsolete-variable 'helm-c-source-colors 'helm-source-colors "1.5.1") -(defvaralias 'helm-c-read-file-map 'helm-read-file-map) -(make-obsolete-variable 'helm-c-read-file-map 'helm-read-file-map "1.5.1") -(defvaralias 'helm-c-source-file-cache 'helm-source-file-cache) -(make-obsolete-variable 'helm-c-source-file-cache 'helm-source-file-cache "1.5.1") -(defvaralias 'helm-c-google-suggest-default-browser-function 'helm-google-suggest-default-browser-function) -(make-obsolete-variable 'helm-c-google-suggest-default-browser-function 'helm-google-suggest-default-browser-function "1.5.1") -(defvaralias 'helm-c-external-programs-associations 'helm-external-programs-associations) -(make-obsolete-variable 'helm-c-external-programs-associations 'helm-external-programs-associations "1.5.1") -(defvaralias 'helm-c-source-complex-command-history 'helm-source-complex-command-history) -(make-obsolete-variable 'helm-c-source-complex-command-history 'helm-source-complex-command-history "1.5.1") -(defvaralias 'helm-c-cached-imenu-candidates 'helm-cached-imenu-candidates) -(make-obsolete-variable 'helm-c-cached-imenu-candidates 'helm-cached-imenu-candidates "1.5.1") -(defvaralias 'helm-c-external-commands-list 'helm-external-commands-list) -(make-obsolete-variable 'helm-c-external-commands-list 'helm-external-commands-list "1.5.1") -(defvaralias 'helm-c-source-ucs 'helm-source-ucs) -(make-obsolete-variable 'helm-c-source-ucs 'helm-source-ucs "1.5.1") -(defvaralias 'helm-c-adaptative-history-length 'helm-adaptive-history-length) -(make-obsolete-variable 'helm-c-adaptative-history-length 'helm-adaptive-history-length "1.5.1") -(defvaralias 'helm-c-source-customize-face 'helm-source-customize-face) -(make-obsolete-variable 'helm-c-source-customize-face 'helm-source-customize-face "1.5.1") -(defvaralias 'helm-c-source-bookmarks-ssh 'helm-source-bookmarks-ssh) -(make-obsolete-variable 'helm-c-source-bookmarks-ssh 'helm-source-bookmarks-ssh "1.5.1") -(defvaralias 'helm-c-eldoc-in-minibuffer-show-fn 'helm-eldoc-in-minibuffer-show-fn) -(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-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) -(make-obsolete-variable 'helm-c-source-ctags 'helm-source-ctags "1.5.1") -(defvaralias 'helm-c-apt-installed-packages 'helm-apt-installed-packages) -(make-obsolete-variable 'helm-c-apt-installed-packages 'helm-apt-installed-packages "1.5.1") -(defvaralias 'helm-c-apt-all-packages 'helm-apt-all-packages) -(make-obsolete-variable 'helm-c-apt-all-packages 'helm-apt-all-packages "1.5.1") -(defvaralias 'helm-c-find-files-doc-header 'helm-find-files-doc-header) -(make-obsolete-variable 'helm-c-find-files-doc-header 'helm-find-files-doc-header "1.5.1") -(defvaralias 'helm-c-source-imenu 'helm-source-imenu) -(make-obsolete-variable 'helm-c-source-imenu 'helm-source-imenu "1.5.1") -(defvaralias 'helm-c-grep-default-function 'helm-grep-default-function) -(make-obsolete-variable 'helm-c-grep-default-function 'helm-grep-default-function "1.5.1") -(defvaralias 'helm-c-top-command 'helm-top-command) -(make-obsolete-variable 'helm-c-top-command 'helm-top-command "1.5.1") -(defvaralias 'helm-c-source-bookmark-man 'helm-source-bookmark-man) -(make-obsolete-variable 'helm-c-source-bookmark-man 'helm-source-bookmark-man "1.5.1") -(defvaralias 'helm-c-source-stumpwm-commands 'helm-source-stumpwm-commands) -(make-obsolete-variable 'helm-c-source-stumpwm-commands 'helm-source-stumpwm-commands "1.5.1") -(defvaralias 'helm-c-source-idle-time-timers 'helm-source-idle-time-timers) -(make-obsolete-variable 'helm-c-source-idle-time-timers 'helm-source-idle-time-timers "1.5.1") -(defvaralias 'helm-c-turn-on-show-completion 'helm-turn-on-show-completion) -(make-obsolete-variable 'helm-c-turn-on-show-completion 'helm-turn-on-show-completion "1.5.1") -(defvaralias 'helm-c-esh-help-message 'helm-esh-help-message) -(make-obsolete-variable 'helm-c-esh-help-message 'helm-esh-help-message "1.5.1") -(defvaralias 'helm-c-register-max-offset 'helm-register-max-offset) -(make-obsolete-variable 'helm-c-register-max-offset 'helm-register-max-offset "1.5.1") -(defvaralias 'helm-c-source-bookmark-set 'helm-source-bookmark-set) -(make-obsolete-variable 'helm-c-source-bookmark-set 'helm-source-bookmark-set "1.5.1") -(defvaralias 'helm-c-source-file-name-history 'helm-source-file-name-history) -(make-obsolete-variable 'helm-c-source-file-name-history 'helm-source-file-name-history "1.5.1") -(defvaralias 'helm-c-file-cache-initialized-p 'helm-file-cache-initialized-p) -(make-obsolete-variable 'helm-c-file-cache-initialized-p 'helm-file-cache-initialized-p "1.5.1") -(defvaralias 'helm-c-grep-max-length-history 'helm-grep-max-length-history) -(make-obsolete-variable 'helm-c-grep-max-length-history 'helm-grep-max-length-history "1.5.1") -(defvaralias 'helm-c-source-jabber-contacts 'helm-source-jabber-contacts) -(make-obsolete-variable 'helm-c-source-jabber-contacts 'helm-source-jabber-contacts "1.5.1") -(defvaralias 'helm-c-grep-use-ioccur-style-keys 'helm-grep-use-ioccur-style-keys) -(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-moccur 'helm-source-moccur) -(make-obsolete-variable 'helm-c-source-moccur 'helm-source-moccur "1.5.1") -(defvaralias 'helm-c-locate-command 'helm-locate-command) -(make-obsolete-variable 'helm-c-locate-command 'helm-locate-command "1.5.1") -(defvaralias 'helm-c-etags-tag-file-name 'helm-etags-tag-file-name) -(make-obsolete-variable 'helm-c-etags-tag-file-name 'helm-etags-tag-file-name "1.5.1") -(defvaralias 'helm-c-source-bookmarks-su 'helm-source-bookmarks-su) -(make-obsolete-variable 'helm-c-source-bookmarks-su 'helm-source-bookmarks-su "1.5.1") -(defvaralias 'helm-c-buffer-map 'helm-buffer-map) -(make-obsolete-variable 'helm-c-buffer-map 'helm-buffer-map "1.5.1") -(defvaralias 'helm-c-source-files-in-all-dired 'helm-source-files-in-all-dired) -(make-obsolete-variable 'helm-c-source-files-in-all-dired 'helm-source-files-in-all-dired "1.5.1") -(defvaralias 'helm-c-source-eshell-history 'helm-source-eshell-history) -(make-obsolete-variable 'helm-c-source-eshell-history 'helm-source-eshell-history "1.5.1") -(defvaralias 'helm-c-source-absolute-time-timers 'helm-source-absolute-time-timers) -(make-obsolete-variable 'helm-c-source-absolute-time-timers 'helm-source-absolute-time-timers "1.5.1") -(defvaralias 'helm-c-source-findutils 'helm-source-findutils) -(make-obsolete-variable 'helm-c-source-findutils 'helm-source-findutils "1.5.1") -(defvaralias 'helm-c-ucs-help-message 'helm-ucs-help-message) -(make-obsolete-variable 'helm-c-ucs-help-message 'helm-ucs-help-message "1.5.1") -(defvaralias 'helm-c-source-find-files 'helm-source-find-files) -(make-obsolete-variable 'helm-c-source-find-files 'helm-source-find-files "1.5.1") -(defvaralias 'helm-c-source-recentf 'helm-source-recentf) -(make-obsolete-variable 'helm-c-source-recentf 'helm-source-recentf "1.5.1") -(defvaralias 'helm-c-cache-world 'helm-cache-world) -(make-obsolete-variable 'helm-c-cache-world 'helm-cache-world "1.5.1") -(defvaralias 'helm-c-source-picklist 'helm-source-picklist) -(make-obsolete-variable 'helm-c-source-picklist 'helm-source-picklist "1.5.1") -(defvaralias 'helm-c-source-buffer-not-found 'helm-source-buffer-not-found) -(make-obsolete-variable 'helm-c-source-buffer-not-found 'helm-source-buffer-not-found "1.5.1") -(defvaralias 'helm-c-source-xrandr-change-resolution 'helm-source-xrandr-change-resolution) -(make-obsolete-variable 'helm-c-source-xrandr-change-resolution 'helm-source-xrandr-change-resolution "1.5.1") -(defvaralias 'helm-c-google-suggest-url 'helm-google-suggest-url) -(make-obsolete-variable 'helm-c-google-suggest-url 'helm-google-suggest-url "1.5.1") -(defvaralias 'helm-c-source-semantic 'helm-source-semantic) -(make-obsolete-variable 'helm-c-source-semantic 'helm-source-semantic "1.5.1") -(defvaralias 'helm-c-source-mark-ring 'helm-source-mark-ring) -(make-obsolete-variable 'helm-c-source-mark-ring 'helm-source-mark-ring "1.5.1") -(defvaralias 'helm-c-grep-preferred-ext 'helm-grep-preferred-ext) -(make-obsolete-variable 'helm-c-grep-preferred-ext 'helm-grep-preferred-ext "1.5.1") -(defvaralias 'helm-c-source-bookmarks 'helm-source-bookmarks) -(make-obsolete-variable 'helm-c-source-bookmarks 'helm-source-bookmarks "1.5.1") -(defvaralias 'helm-c-source-elisp-library-scan 'helm-source-elisp-library-scan) -(make-obsolete-variable 'helm-c-source-elisp-library-scan 'helm-source-elisp-library-scan "1.5.1") -(defvaralias 'helm-c-source-info-pages 'helm-source-info-pages) -(make-obsolete-variable 'helm-c-source-info-pages 'helm-source-info-pages "1.5.1") -(defvaralias 'helm-c-source-bookmark-gnus 'helm-source-bookmark-gnus) -(make-obsolete-variable 'helm-c-source-bookmark-gnus 'helm-source-bookmark-gnus "1.5.1") -(defvaralias 'helm-c-source-elscreen 'helm-source-elscreen) -(make-obsolete-variable 'helm-c-source-elscreen 'helm-source-elscreen "1.5.1") -(defvaralias 'helm-c-etags-mtime-alist 'helm-etags-mtime-alist) -(make-obsolete-variable 'helm-c-etags-mtime-alist 'helm-etags-mtime-alist "1.5.1") -(defvaralias 'helm-c-grep-default-recurse-command 'helm-grep-default-recurse-command) -(make-obsolete-variable 'helm-c-grep-default-recurse-command 'helm-grep-default-recurse-command "1.5.1") -(defvaralias 'helm-c-source-google-suggest 'helm-source-google-suggest) -(make-obsolete-variable 'helm-c-source-google-suggest 'helm-source-google-suggest "1.5.1") -(defvaralias 'helm-c-etags-tag-file-search-limit 'helm-etags-tag-file-search-limit) -(make-obsolete-variable 'helm-c-etags-tag-file-search-limit 'helm-etags-tag-file-search-limit "1.5.1") -(defvaralias 'helm-c-source-ff-file-name-history 'helm-source-ff-file-name-history) -(make-obsolete-variable 'helm-c-source-ff-file-name-history 'helm-source-ff-file-name-history "1.5.1") -(defvaralias 'helm-c-source-buffers-list 'helm-source-buffers-list) -(make-obsolete-variable 'helm-c-source-buffers-list 'helm-source-buffers-list "1.5.1") -(defvaralias 'helm-c-cached-imenu-alist 'helm-cached-imenu-alist) -(make-obsolete-variable 'helm-c-cached-imenu-alist 'helm-cached-imenu-alist "1.5.1") -(defvaralias 'helm-c-source-tracker-search 'helm-source-tracker-search) -(make-obsolete-variable 'helm-c-source-tracker-search 'helm-source-tracker-search "1.5.1") -(defvaralias 'helm-c-google-suggest-default-function 'helm-google-suggest-default-function) -(make-obsolete-variable 'helm-c-google-suggest-default-function 'helm-google-suggest-default-function "1.5.1") -(defvaralias 'helm-c-imenu-delimiter 'helm-imenu-delimiter) -(make-obsolete-variable 'helm-c-imenu-delimiter 'helm-imenu-delimiter "1.5.1") -(defvaralias 'helm-c-source-emacs-process 'helm-source-emacs-process) -(make-obsolete-variable 'helm-c-source-emacs-process 'helm-source-emacs-process "1.5.1") -(defvaralias 'helm-c-etags-map 'helm-etags-map) -(make-obsolete-variable 'helm-c-etags-map 'helm-etags-map "1.5.1") -(defvaralias 'helm-c-grep-history 'helm-grep-history) -(make-obsolete-variable 'helm-c-grep-history 'helm-grep-history "1.5.1") -(defvaralias 'helm-c-cached-imenu-tick 'helm-cached-imenu-tick) -(make-obsolete-variable 'helm-c-cached-imenu-tick 'helm-cached-imenu-tick "1.5.1") -(defvaralias 'helm-c-source-esh 'helm-source-esh) -(make-obsolete-variable 'helm-c-source-esh 'helm-source-esh "1.5.1") -(defvaralias 'helm-c-source-global-mark-ring 'helm-source-global-mark-ring) -(make-obsolete-variable 'helm-c-source-global-mark-ring 'helm-source-global-mark-ring "1.5.1") -(defvaralias 'helm-c-man-pages 'helm-man-pages) -(make-obsolete-variable 'helm-c-man-pages 'helm-man-pages "1.5.1") -(defvaralias 'helm-c-adaptative-done 'helm-adaptive-done) -(make-obsolete-variable 'helm-c-adaptative-done 'helm-adaptive-done "1.5.1") -(defvaralias 'helm-c-source-regexp 'helm-source-regexp) -(make-obsolete-variable 'helm-c-source-regexp 'helm-source-regexp "1.5.1") -(defvaralias 'helm-c-boring-file-regexp-list 'helm-boring-file-regexp-list) -(make-obsolete-variable 'helm-c-boring-file-regexp-list 'helm-boring-file-regexp-list "1.5.1") -(defvaralias 'helm-c-show-completion-use-special-display 'helm-show-completion-use-special-display) -(make-obsolete-variable 'helm-c-show-completion-use-special-display 'helm-show-completion-use-special-display "1.5.1") -(defvaralias 'helm-c-apt-query 'helm-apt-query) -(make-obsolete-variable 'helm-c-apt-query 'helm-apt-query "1.5.1") -(defvaralias 'helm-c-pdfgrep-default-read-command 'helm-pdfgrep-default-read-command) -(make-obsolete-variable 'helm-c-pdfgrep-default-read-command 'helm-pdfgrep-default-read-command "1.5.1") -(defvaralias 'helm-c-source-bookmark-images 'helm-source-bookmark-images) -(make-obsolete-variable 'helm-c-source-bookmark-images 'helm-source-bookmark-images "1.5.1") -(defvaralias 'helm-c-source-mac-spotlight 'helm-source-mac-spotlight) -(make-obsolete-variable 'helm-c-source-mac-spotlight 'helm-source-mac-spotlight "1.5.1") -(defvaralias 'helm-c-yahoo-suggest-url 'helm-yahoo-suggest-url) -(make-obsolete-variable 'helm-c-yahoo-suggest-url 'helm-yahoo-suggest-url "1.5.1") -(defvaralias 'helm-c-zgrep-recurse-flag 'helm-zgrep-recurse-flag) -(make-obsolete-variable 'helm-c-zgrep-recurse-flag 'helm-zgrep-recurse-flag "1.5.1") -(defvaralias 'helm-c-source-use-flags 'helm-source-use-flags) -(make-obsolete-variable 'helm-c-source-use-flags 'helm-source-use-flags "1.5.1") -(defvaralias 'helm-c-moccur-map 'helm-moccur-map) -(make-obsolete-variable 'helm-c-moccur-map 'helm-moccur-map "1.5.1") -(defvaralias 'helm-c-adaptative-history-file 'helm-adaptive-history-file) -(make-obsolete-variable 'helm-c-adaptative-history-file 'helm-adaptive-history-file "1.5.1") -(defvaralias 'helm-c-grep-default-directory-fn 'helm-grep-default-directory-fn) -(make-obsolete-variable 'helm-c-grep-default-directory-fn 'helm-grep-default-directory-fn "1.5.1") -(defvaralias 'helm-c-apt-input-history 'helm-apt-input-history) -(make-obsolete-variable 'helm-c-apt-input-history 'helm-apt-input-history "1.5.1") - - -(provide 'helm-aliases) - -;;; helm-aliases.el ends here diff --git a/elpa/helm-20150704.1247/helm-match-plugin.el b/elpa/helm-20150704.1247/helm-match-plugin.el deleted file mode 100644 index c95bfb50..00000000 --- a/elpa/helm-20150704.1247/helm-match-plugin.el +++ /dev/null @@ -1,331 +0,0 @@ -;;; helm-match-plugin.el --- Multiple regexp matching methods for helm -*- lexical-binding: t -*- - -;; Original Author: rubikitch - -;; Copyright (C) 2008 ~ 2011 rubikitch -;; Copyright (C) 2011 ~ 2015 Thierry Volpiatto - -;; Author: Thierry Volpiatto -;; URL: http://github.com/emacs-helm/helm - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Code: - -(require 'helm) -(require 'cl-lib) - - -(defgroup helm-match-plugin nil - "Helm match plugin." - :group 'helm) - -(defcustom helm-mp-matching-method 'multi3 - "Matching method for helm match plugin. -You can set here different methods to match candidates in helm. -Here are the possible value of this symbol and their meaning: -- multi1: Respect order, prefix of pattern must match. -- multi2: Same but with partial match. -- multi3: The best, multiple regexp match, allow negation. -- multi3p: Same but prefix must match. -Default is multi3." - :type '(radio :tag "Matching methods for helm" - (const :tag "Multiple regexp 1 ordered with prefix match" multi1) - (const :tag "Multiple regexp 2 ordered with partial match" multi2) - (const :tag "Multiple regexp 3 matching no order, partial, best." multi3) - (const :tag "Multiple regexp 3p matching with prefix match" multi3p)) - :group 'helm-match-plugin) - - -;; Internal -(defconst helm-mp-default-match-functions - '(helm-mp-exact-match helm-mp-match)) -(defconst helm-mp-default-search-functions - '(helm-mp-exact-search helm-mp-search)) - - -;;; Build regexps -;; -;; -(defvar helm-mp-space-regexp "[\\ ] " - "Regexp to represent space itself in multiple regexp match.") - -(defun helm-mp-split-pattern (pattern) - "Split PATTERN if it contain spaces and return resulting list. -If spaces in PATTERN are escaped, don't split at this place. -i.e \"foo bar\"=> (\"foo\" \"bar\") -but \"foo\ bar\"=> (\"foobar\")." - (if (string= pattern "") - '("") - (cl-loop for s in (split-string - (replace-regexp-in-string helm-mp-space-regexp - "\000\000" pattern) - " " t) - collect (replace-regexp-in-string "\000\000" " " s)))) - -(defun helm-mp-1-make-regexp (pattern) - "Replace spaces in PATTERN with \"\.*\"." - (mapconcat 'identity (helm-mp-split-pattern pattern) ".*")) - - -;;; Exact match. -;; -;; -;; Internal. -(defvar helm-mp-exact-pattern-str nil) -(defvar helm-mp-exact-pattern-real nil) - -(defun helm-mp-exact-get-pattern (pattern) - (unless (equal pattern helm-mp-exact-pattern-str) - (setq helm-mp-exact-pattern-str pattern - helm-mp-exact-pattern-real (concat "\n" pattern "\n"))) - helm-mp-exact-pattern-real) - - -(defun helm-mp-exact-match (str &optional pattern) - (string= str (or pattern helm-pattern))) - -(defun helm-mp-exact-search (pattern &rest _ignore) - (and (search-forward (helm-mp-exact-get-pattern pattern) nil t) - (forward-line -1))) - - -;;; Prefix match -;; -;; -;; Internal -(defvar helm-mp-prefix-pattern-str nil) -(defvar helm-mp-prefix-pattern-real nil) - -(defun helm-mp-prefix-get-pattern (pattern) - (unless (equal pattern helm-mp-prefix-pattern-str) - (setq helm-mp-prefix-pattern-str pattern - helm-mp-prefix-pattern-real (concat "\n" pattern))) - helm-mp-prefix-pattern-real) - -(defun helm-mp-prefix-match (str &optional pattern) - (setq pattern (or pattern helm-pattern)) - (let ((len (length pattern))) - (and (<= len (length str)) - (string= (substring str 0 len) pattern )))) - -(defun helm-mp-prefix-search (pattern &rest _ignore) - (search-forward (helm-mp-prefix-get-pattern pattern) nil t)) - - -;;; Multiple regexp patterns 1 (order is preserved / prefix). -;; -;; -;; Internal -(defvar helm-mp-1-pattern-str nil) -(defvar helm-mp-1-pattern-real nil) - -(defun helm-mp-1-get-pattern (pattern) - (unless (equal pattern helm-mp-1-pattern-str) - (setq helm-mp-1-pattern-str pattern - helm-mp-1-pattern-real - (concat "^" (helm-mp-1-make-regexp pattern)))) - helm-mp-1-pattern-real) - -(cl-defun helm-mp-1-match (str &optional (pattern helm-pattern)) - (string-match (helm-mp-1-get-pattern pattern) str)) - -(defun helm-mp-1-search (pattern &rest _ignore) - (re-search-forward (helm-mp-1-get-pattern pattern) nil t)) - - -;;; Multiple regexp patterns 2 (order is preserved / partial). -;; -;; -;; Internal -(defvar helm-mp-2-pattern-str nil) -(defvar helm-mp-2-pattern-real nil) - -(defun helm-mp-2-get-pattern (pattern) - (unless (equal pattern helm-mp-2-pattern-str) - (setq helm-mp-2-pattern-str pattern - helm-mp-2-pattern-real - (concat "^.*" (helm-mp-1-make-regexp pattern)))) - helm-mp-2-pattern-real) - -(cl-defun helm-mp-2-match (str &optional (pattern helm-pattern)) - (string-match (helm-mp-2-get-pattern pattern) str)) - -(defun helm-mp-2-search (pattern &rest _ignore) - (re-search-forward (helm-mp-2-get-pattern pattern) nil t)) - - -;;; Multiple regexp patterns 3 (permutation). -;; -;; -;; Internal -(defvar helm-mp-3-pattern-str nil) -(defvar helm-mp-3-pattern-list nil) - -(defun helm-mp-3-get-patterns (pattern) - "Return `helm-mp-3-pattern-list', a list of predicate/regexp cons cells. -e.g ((identity . \"foo\") (identity . \"bar\")). -This is done only if `helm-mp-3-pattern-str' is same as PATTERN." - (unless (equal pattern helm-mp-3-pattern-str) - (setq helm-mp-3-pattern-str pattern - helm-mp-3-pattern-list - (helm-mp-3-get-patterns-internal pattern))) - helm-mp-3-pattern-list) - -(defun helm-mp-3-get-patterns-internal (pattern) - "Return a list of predicate/regexp cons cells. -e.g ((identity . \"foo\") (identity . \"bar\"))." - (unless (string= pattern "") - (cl-loop for pat in (helm-mp-split-pattern pattern) - collect (if (string= "!" (substring pat 0 1)) - (cons 'not (substring pat 1)) - (cons 'identity pat))))) - -(cl-defun helm-mp-3-match (str &optional (pattern helm-pattern)) - "Check if PATTERN match STR. -When PATTERN contain a space, it is splitted and matching is done -with the several resulting regexps against STR. -e.g \"bar foo\" will match \"foobar\" and \"barfoo\". -Argument PATTERN, a string, is transformed in a list of -cons cell with `helm-mp-3-get-patterns' if it contain a space. -e.g \"foo bar\"=>((identity . \"foo\") (identity . \"bar\")). -Then each predicate of cons cell(s) is called with regexp of same -cons cell against STR (a candidate). -i.e (identity (string-match \"foo\" \"foo bar\")) => t." - (let ((pat (helm-mp-3-get-patterns pattern))) - (cl-loop for (predicate . regexp) in pat - always (funcall predicate - (condition-case _err - ;; FIXME: Probably do nothing when - ;; using fuzzy leaving the job - ;; to the fuzzy fn. - (string-match regexp str) - (invalid-regexp nil)))))) - -(defun helm-mp-3-search-base (pattern searchfn1 searchfn2) - "Try to find PATTERN in `helm-buffer' with SEARCHFN1 and SEARCHFN2. -This is the search function for `candidates-in-buffer' enabled sources. -Use the same method as `helm-mp-3-match' except it search in buffer -instead of matching on a string. -i.e (identity (re-search-forward \"foo\" (point-at-eol) t)) => t." - (cl-loop with pat = (if (stringp pattern) - (helm-mp-3-get-patterns pattern) - pattern) - when (eq (caar pat) 'not) return - ;; Pass the job to `helm-search-match-part'. - (prog1 (list (point-at-bol) (point-at-eol)) - (forward-line 1)) - while (condition-case _err - (funcall searchfn1 (or (cdar pat) "") nil t) - (invalid-regexp nil)) - for bol = (point-at-bol) - for eol = (point-at-eol) - if (cl-loop for (pred . str) in (cdr pat) always - (progn (goto-char bol) - (funcall pred (condition-case _err - (funcall searchfn2 str eol t) - (invalid-regexp nil))))) - do (goto-char eol) and return t - else do (goto-char eol) - finally return nil)) - -(defun helm-mp-3-search (pattern &rest _ignore) - (when (stringp pattern) - (setq pattern (helm-mp-3-get-patterns pattern))) - (helm-mp-3-search-base - pattern 're-search-forward 're-search-forward)) - - -;;; mp-3p- (multiple regexp pattern 3 with prefix search) -;; -;; -(defun helm-mp-3p-match (str &optional pattern) - "Check if PATTERN match STR. -Same as `helm-mp-3-match' but more strict, matching against prefix also. -e.g \"bar foo\" will match \"barfoo\" but not \"foobar\" contrarily to -`helm-mp-3-match'." - (let* ((pat (helm-mp-3-get-patterns (or pattern helm-pattern))) - (first (car pat))) - (and (funcall (car first) (helm-mp-prefix-match str (cdr first))) - (cl-loop for (predicate . regexp) in (cdr pat) - always (funcall predicate (string-match regexp str)))))) - -(defun helm-mp-3p-search (pattern &rest _ignore) - (when (stringp pattern) - (setq pattern (helm-mp-3-get-patterns pattern))) - (helm-mp-3-search-base - pattern 'helm-mp-prefix-search 're-search-forward)) - - -;;; Generic multi-match/search functions -;; -;; -(cl-defun helm-mp-match (str &optional (pattern helm-pattern)) - (let ((fun (cl-ecase helm-mp-matching-method - (multi1 #'helm-mp-1-match) - (multi2 #'helm-mp-2-match) - (multi3 #'helm-mp-3-match) - (multi3p #'helm-mp-3p-match)))) - (funcall fun str pattern))) - -(defun helm-mp-search (pattern &rest _ignore) - (let ((fun (cl-ecase helm-mp-matching-method - (multi1 #'helm-mp-1-search) - (multi2 #'helm-mp-2-search) - (multi3 #'helm-mp-3-search) - (multi3p #'helm-mp-3p-search)))) - (funcall fun pattern))) - - -;;; source compiler -;; This is used only in old sources defined without helm-source. -;; -(defun helm-compile-source--match-plugin (source) - (if (assoc 'no-matchplugin source) - source - (let* ((searchers helm-mp-default-search-functions) - (defmatch (helm-aif (assoc-default 'match source) - (helm-mklist it))) - (defmatch-strict (helm-aif (assoc-default 'match-strict source) - (helm-mklist it))) - (defsearch (helm-aif (assoc-default 'search source) - (helm-mklist it))) - (defsearch-strict (helm-aif (assoc-default 'search-strict source) - (helm-mklist it))) - (matchfns (cond (defmatch-strict) - (defmatch - (append helm-mp-default-match-functions defmatch)) - (t helm-mp-default-match-functions))) - (searchfns (cond (defsearch-strict) - (defsearch - (append searchers defsearch)) - (t searchers)))) - `(,(if (assoc 'candidates-in-buffer source) - `(search ,@searchfns) `(match ,@matchfns)) - ,@source)))) - - -;; Enable match-plugin by default in old sources. -(add-to-list 'helm-compile-source-functions 'helm-compile-source--match-plugin) - -(provide 'helm-match-plugin) - - -;; Local Variables: -;; byte-compile-warnings: (not cl-functions obsolete) -;; coding: utf-8 -;; indent-tabs-mode: nil -;; End: - -;;; helm-match-plugin.el ends here diff --git a/elpa/helm-20150704.1247/helm-org.el b/elpa/helm-20150704.1247/helm-org.el deleted file mode 100644 index 73062c07..00000000 --- a/elpa/helm-20150704.1247/helm-org.el +++ /dev/null @@ -1,152 +0,0 @@ -;;; helm-org.el --- Helm for org headlines and keywords completion -*- lexical-binding: t -*- - -;; Copyright (C) 2012 ~ 2015 Thierry Volpiatto - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Code: -(require 'cl-lib) -(require 'helm) -(require 'helm-utils) -(require 'org) - -(defgroup helm-org nil - "Org related functions for helm." - :group 'helm) - -(defcustom helm-org-headings-fontify nil - "Fontify org buffers before parsing them. -This reflect fontification in helm-buffer when non--nil. -NOTE: This will be slow on large org buffers." - :group 'helm-org - :type 'boolean) - -;; Internal -(defvar helm-org-headings--nofilename nil) - -;;; Org capture templates -;; -;; -(defvar org-capture-templates) -(defun helm-source-org-capture-templates () - (helm-build-sync-source "Org Capture Templates:" - :candidates (cl-loop for template in org-capture-templates - collect `(,(nth 1 template) . ,(nth 0 template))) - :action '(("Do capture" . (lambda (template-shortcut) - (org-capture nil template-shortcut)))))) - -;;; Org headings -;; -;; -(defun helm-org-goto-marker (marker) - (switch-to-buffer (marker-buffer marker)) - (goto-char (marker-position marker)) - (org-show-context) - (org-show-entry)) - -(cl-defun helm-source-org-headings-for-files (filenames - &optional (min-depth 1) (max-depth 8)) - (helm-build-sync-source "Org Headings" - :candidates (helm-org-get-candidates filenames min-depth max-depth) - :action '(("Go to line" . helm-org-goto-marker) - ("Refile to this heading" . helm-org-heading-refile) - ("Insert link to this heading" - . helm-org-insert-link-to-heading-at-marker)))) - -(defun helm-org-insert-link-to-heading-at-marker (marker) - (with-current-buffer (marker-buffer marker) - (let ((heading-name (save-excursion (goto-char (marker-position marker)) - (nth 4 (org-heading-components)))) - (file-name (buffer-file-name))) - (with-helm-current-buffer - (org-insert-link - file-name (concat "file:" file-name "::*" heading-name)))))) - -(defun helm-org-heading-refile (marker) - (with-helm-current-buffer - (org-cut-subtree)) - (let ((target-level (with-current-buffer (marker-buffer marker) - (goto-char (marker-position marker)) - (org-current-level)))) - (helm-org-goto-marker marker) - (org-end-of-subtree t t) - (org-paste-subtree (+ target-level 1)))) - -(defun helm-org-get-candidates (filenames min-depth max-depth) - (apply #'append - (mapcar (lambda (filename) - (helm-get-org-candidates-in-file - filename min-depth max-depth - helm-org-headings-fontify - helm-org-headings--nofilename)) - filenames))) - -(defun helm-get-org-candidates-in-file (filename min-depth max-depth - &optional fontify nofname) - (with-current-buffer (pcase filename - ((pred bufferp) filename) - ((pred stringp) (find-file-noselect filename))) - (and fontify (jit-lock-fontify-now)) - (let ((match-fn (if fontify 'match-string 'match-string-no-properties))) - (save-excursion - (goto-char (point-min)) - (cl-loop with width = (window-width) - while (re-search-forward org-complex-heading-regexp nil t) - if (let ((num-stars (length (match-string-no-properties 1)))) - (and (>= num-stars min-depth) (<= num-stars max-depth))) - collect `(,(let ((heading (funcall match-fn 4)) - (file (unless nofname - (concat (helm-basename filename) ":"))) - (level (length (match-string-no-properties 1)))) - (org-format-outline-path - (append (org-get-outline-path t level heading) - (list heading)) width file)) - . ,(point-marker))))))) - -;;;###autoload -(defun helm-org-agenda-files-headings () - "Preconfigured helm for org files headings." - (interactive) - (helm :sources (helm-source-org-headings-for-files (org-agenda-files)) - :candidate-number-limit 99999 - :buffer "*helm org headings*")) - -;;;###autoload -(defun helm-org-in-buffer-headings () - "Preconfigured helm for org buffer headings." - (interactive) - (let ((helm-org-headings--nofilename t)) - (helm :sources (helm-source-org-headings-for-files - (list (current-buffer))) - :candidate-number-limit 99999 - :buffer "*helm org inbuffer*"))) - -;;;###autoload -(defun helm-org-capture-templates () - "Preconfigured helm for org templates." - (interactive) - (helm :sources (helm-source-org-capture-templates) - :candidate-number-limit 99999 - :buffer "*helm org capture templates*")) - - -(provide 'helm-org) - -;; Local Variables: -;; byte-compile-warnings: (not cl-functions obsolete) -;; coding: utf-8 -;; indent-tabs-mode: nil -;; End: - -;;; helm-org.el ends here diff --git a/elpa/helm-20150704.1247/emacs-helm.sh b/elpa/helm-20160105.2046/emacs-helm.sh similarity index 97% rename from elpa/helm-20150704.1247/emacs-helm.sh rename to elpa/helm-20160105.2046/emacs-helm.sh index f3e45a7a..a5938134 100755 --- a/elpa/helm-20150704.1247/emacs-helm.sh +++ b/elpa/helm-20160105.2046/emacs-helm.sh @@ -76,12 +76,14 @@ cat > $CONF_FILE < q\" '(foo bar baz) 2) - -Each time \" q\" is pressed the next function is executed, if you wait -More than 2 seconds, next hit will run again the first function and so on. - -\(fn KEYMAP KEY FUNCTIONS &optional DELAY)" nil nil) - -(autoload 'helm-multi-key-defun "helm" "\ -Define NAME as a multi-key command running FUNS. -After DELAY seconds the FUNS list is reinitialised. -See `helm-define-multi-key'. - -\(fn NAME DOCSTRING FUNS &optional DELAY)" nil t) - -(put 'helm-multi-key-defun 'lisp-indent-function '2) - -(autoload 'helm-define-key-with-subkeys "helm" "\ -Allow defining in MAP a KEY and SUBKEY to COMMAND. - -This allow typing KEY to call COMMAND the first time and -type only SUBKEY on subsequent calls. - -Arg MAP is the keymap to use, SUBKEY is the initial short keybinding to -call COMMAND. - -Arg OTHER-SUBKEYS is an alist specifying other short keybindings -to use once started. -e.g: - -\(helm-define-key-with-subkeys global-map - (kbd \"C-x v n\") ?n 'git-gutter:next-hunk '((?p . git-gutter:previous-hunk))) - - -In this example, `C-x v n' will run `git-gutter:next-hunk' -subsequent hits on \"n\" will run this command again -and subsequent hits on \"p\" will run `git-gutter:previous-hunk'. - -Arg MENU is a string to display in minibuffer -to describe SUBKEY and OTHER-SUBKEYS. -Arg EXIT-FN specify a function to run on exit. - -Any other keys pressed run their assigned command defined in MAP -and exit the loop running EXIT-FN if specified. - -NOTE: SUBKEY and OTHER-SUBKEYS bindings support -only char syntax actually (e.g ?n) -so don't use strings, vectors or whatever to define them. - -\(fn MAP KEY SUBKEY COMMAND &optional OTHER-SUBKEYS MENU EXIT-FN)" nil nil) - -(put 'helm-define-key-with-subkeys 'lisp-indent-function '1) - -(autoload 'helm-debug-open-last-log "helm" "\ -Open helm log file of last helm session. -If `helm-last-log-file' is nil, switch to `helm-debug-buffer' . - -\(fn)" t nil) - -(autoload 'helm "helm" "\ -Main function to execute helm sources. - -Keywords supported: -:sources :input :prompt :resume :preselect -:buffer :keymap :default :history :allow-nest - -Extra LOCAL-VARS keywords are supported, see below. - -PLIST is a list like (:key1 val1 :key2 val2 ...) or -\(&optional sources input prompt resume - preselect buffer keymap default history). - -Basic keywords are the following: - -:sources - -A list of sources used for this session. It also accepts a -symbol, interpreted as a variable of a helm source -i.e (a symbol can be passed instead of a list of sources). -It also accepts an alist representing a helm source, which is -detected by (assq 'name ANY-SOURCES). -NOTE: In this case the source is embedded in the helm command and -have no symbol name, so it is not reachable from outside. -It will be referenced in `helm-sources' as a whole alist. - -:input - -Temporary value of `helm-pattern', ie. initial input of minibuffer. - -:prompt - -Prompt other than \"pattern: \". - -:resume - -If t, Resurrect previously instance of `helm'. Skip the initialization. -If 'noresume, this instance of `helm' cannot be resumed. - -:preselect - -Initially selected candidate. Specified by exact candidate or a regexp. - -:buffer - -`helm-buffer' instead of *helm*. - -:keymap - -`helm-map' for current `helm' session. - -:default - -A default argument that will be inserted in minibuffer with \\\\[next-history-element]. -When nil or not present `thing-at-point' will be used instead. -If `helm--maybe-use-default-as-input' is non--nil display will be -updated using :default arg as input unless :input is specified, -which in this case will take precedence on :default -This is a string or a list, in this case the car of the list will -be used as initial default input, but you will be able to cycle in this -list with \\\\[next-history-element]. - -:history - -By default all minibuffer input is pushed to `minibuffer-history', -if an argument HISTORY is provided, input will be pushed to HISTORY. -History element should be a symbol. - -:allow-nest - -Allow running this helm command within a running helm session. - -Of course, conventional arguments are supported, the two are same. - -\(helm :sources sources :input input :prompt prompt :resume resume - :preselect preselect :buffer buffer :keymap keymap :default default - :history history) - -and - -\(helm sources input prompt resume preselect buffer keymap default history) - -are the same. - -However the use of non keyword args is deprecated and should not be used. - -Other keywords are interpreted as local variables of this helm session. -The `helm-' prefix can be omitted. For example, - -\(helm :sources 'helm-source-buffers-list - :buffer \"*buffers*\" :candidate-number-limit 10) - -means starting helm session with `helm-source-buffers' -source in *buffers* buffer and set variable `helm-candidate-number-limit' -to 10 as session local variable. - -\(fn &key SOURCES INPUT PROMPT RESUME PRESELECT BUFFER KEYMAP DEFAULT HISTORY ALLOW-NEST OTHER-LOCAL-VARS)" nil nil) - -(autoload 'helm-other-buffer "helm" "\ -Simplified interface of `helm' with other `helm-buffer'. -Call `helm' with only ANY-SOURCES and ANY-BUFFER as args. - -\(fn ANY-SOURCES ANY-BUFFER)" nil nil) - -;;;*** - -;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (21913 4104 +;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-adaptive.el @@ -210,7 +29,7 @@ Useful when you have a old or corrupted `helm-adaptive-history-file'. ;;;*** -;;;### (autoloads nil "helm-apt" "helm-apt.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-apt" "helm-apt.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-apt.el (autoload 'helm-apt "helm-apt" "\ @@ -221,7 +40,7 @@ With a prefix arg reload cache. ;;;*** -;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (21913 4104 +;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-bookmark.el @@ -230,11 +49,6 @@ Preconfigured `helm' for bookmarks. \(fn)" t nil) -(autoload 'helm-pp-bookmarks "helm-bookmark" "\ -Preconfigured `helm' for bookmarks (pretty-printed). - -\(fn)" t nil) - (autoload 'helm-filtered-bookmarks "helm-bookmark" "\ Preconfigured helm for bookmarks (filtered by category). Optional source `helm-source-bookmark-addressbook' is loaded @@ -244,7 +58,7 @@ only if external library addressbook-bookmark.el is available. ;;;*** -;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (21913 4104 +;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-buffers.el @@ -260,7 +74,7 @@ Preconfigured `helm' lightweight version (buffer -> recentf). ;;;*** -;;;### (autoloads nil "helm-color" "helm-color.el" (21913 4104 0 +;;;### (autoloads nil "helm-color" "helm-color.el" (22156 56359 0 ;;;;;; 0)) ;;; Generated autoloads from helm-color.el @@ -271,7 +85,7 @@ Preconfigured `helm' for color. ;;;*** -;;;### (autoloads nil "helm-command" "helm-command.el" (21913 4103 +;;;### (autoloads nil "helm-command" "helm-command.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-command.el @@ -288,7 +102,7 @@ You can get help on each command by persistent action. ;;;*** -;;;### (autoloads nil "helm-config" "helm-config.el" (21913 4104 +;;;### (autoloads nil "helm-config" "helm-config.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-config.el @@ -299,7 +113,7 @@ Customize `helm'. ;;;*** -;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (21913 4104 +;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-dabbrev.el @@ -310,7 +124,7 @@ Preconfigured helm for dynamic abbreviations. ;;;*** -;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (21913 4104 0 +;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (22156 56359 0 ;;;;;; 0)) ;;; Generated autoloads from helm-elisp.el @@ -363,7 +177,7 @@ Preconfigured helm for complex command history. ;;;*** ;;;### (autoloads nil "helm-elisp-package" "helm-elisp-package.el" -;;;;;; (21913 4104 0 0)) +;;;;;; (22156 56359 0 0)) ;;; Generated autoloads from helm-elisp-package.el (autoload 'helm-list-elisp-packages "helm-elisp-package" "\ @@ -379,7 +193,7 @@ Same as `helm-list-elisp-packages' but don't fetch packages on remote. ;;;*** -;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (21913 4103 +;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-elscreen.el @@ -388,9 +202,14 @@ Preconfigured helm to list elscreen. \(fn)" t nil) +(autoload 'helm-elscreen-history "helm-elscreen" "\ +Preconfigured helm to list elscreen in history order. + +\(fn)" t nil) + ;;;*** -;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (21913 4104 +;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-eshell.el @@ -406,7 +225,7 @@ Preconfigured helm for eshell history. ;;;*** -;;;### (autoloads nil "helm-eval" "helm-eval.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-eval" "helm-eval.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-eval.el (autoload 'helm-eval-expression "helm-eval" "\ @@ -426,7 +245,7 @@ Preconfigured helm for `helm-source-calculation-result'. ;;;*** -;;;### (autoloads nil "helm-external" "helm-external.el" (21913 4103 +;;;### (autoloads nil "helm-external" "helm-external.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-external.el @@ -440,7 +259,7 @@ You can set your own list of commands with ;;;*** -;;;### (autoloads nil "helm-files" "helm-files.el" (21913 4104 0 +;;;### (autoloads nil "helm-files" "helm-files.el" (22156 56359 0 ;;;;;; 0)) ;;; Generated autoloads from helm-files.el @@ -499,7 +318,7 @@ Preconfigured `helm' for `recentf'. ;;;*** -;;;### (autoloads nil "helm-font" "helm-font.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-font" "helm-font.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-font.el (autoload 'helm-select-xfont "helm-font" "\ @@ -514,7 +333,7 @@ Preconfigured helm for `ucs-names' math symbols. ;;;*** -;;;### (autoloads nil "helm-grep" "helm-grep.el" (21913 4105 0 0)) +;;;### (autoloads nil "helm-grep" "helm-grep.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-grep.el (autoload 'helm-goto-precedent-file "helm-grep" "\ @@ -535,33 +354,20 @@ Special commands: \(fn)" t nil) -(autoload 'helm-do-grep "helm-grep" "\ -Preconfigured helm for grep. -Contrarily to Emacs `grep', no default directory is given, but -the full path of candidates in ONLY. -That allow to grep different files not only in `default-directory' but anywhere -by marking them (C-). If one or more directory is selected -grep will search in all files of these directories. -You can also use wildcard in the base name of candidate. -If a prefix arg is given use the -r option of grep (recurse). -The prefix arg can be passed before or after start file selection. -See also `helm-do-grep-1'. - -\(fn)" t nil) - -(autoload 'helm-do-zgrep "helm-grep" "\ -Preconfigured helm for zgrep. +(autoload 'helm-do-grep-ag "helm-grep" "\ +Preconfigured helm for grepping with AG in `default-directory'. \(fn)" t nil) -(autoload 'helm-do-pdfgrep "helm-grep" "\ -Preconfigured helm for pdfgrep. +(autoload 'helm-grep-do-git-grep "helm-grep" "\ +Preconfigured helm for git-grepping `default-directory'. +With a prefix arg ARG git-grep the whole repository. -\(fn)" t nil) +\(fn ARG)" t nil) ;;;*** -;;;### (autoloads nil "helm-help" "helm-help.el" (21913 4103 0 0)) +;;;### (autoloads nil "helm-help" "helm-help.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-help.el (autoload 'helm-documentation "helm-help" "\ @@ -572,158 +378,12 @@ Find here the documentation of all sources actually documented. \(fn ARG)" t nil) -(autoload 'helm-help "helm-help" "\ -Help of `helm'. - -\(fn)" t nil) - -(autoload 'helm-buffer-help "helm-help" "\ -Help command for helm buffers. - -\(fn)" t nil) - -(autoload 'helm-ff-help "helm-help" "\ -Help command for `helm-find-files'. - -\(fn)" t nil) - -(autoload 'helm-read-file-name-help "helm-help" "\ -Help command for `read-file-name'. - -\(fn)" t nil) - -(autoload 'helm-generic-file-help "helm-help" "\ -Global help for helm. - -\(fn)" t nil) - -(autoload 'helm-grep-help "helm-help" "\ -Help command for helm grep. - -\(fn)" t nil) - -(autoload 'helm-pdfgrep-help "helm-help" "\ -Help command for pdfgrep. - -\(fn)" t nil) - -(autoload 'helm-etags-help "helm-help" "\ -The help function for etags. - -\(fn)" t nil) - -(autoload 'helm-ucs-help "helm-help" "\ -Help command for `helm-ucs'. +(defvar helm-comp-read-mode-line "\\C/\\[helm-cr-empty-string]:Empty \\\\[helm-help]:Help \\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") -\(fn)" t nil) - -(autoload 'helm-bookmark-help "helm-help" "\ -Help command for bookmarks. - -\(fn)" t nil) - -(autoload 'helm-esh-help "helm-help" "\ -Help command for `helm-find-files-eshell-command-on-file'. - -\(fn)" t nil) - -(autoload 'helm-buffers-ido-virtual-help "helm-help" "\ -Help command for ido virtual buffers. - -\(fn)" t nil) - -(autoload 'helm-moccur-help "helm-help" "\ -Help command for (m)occur. - -\(fn)" t nil) - -(autoload 'helm-top-help "helm-help" "\ -Help command for top. - -\(fn)" t nil) - -(autoload 'helm-apt-help "helm-help" "\ -Help command for helm apt. - -\(fn)" t nil) - -(autoload 'helm-el-package-help "helm-help" "\ -Help command for emacs packages. - -\(fn)" t nil) - -(autoload 'helm-M-x-help "helm-help" "\ -Help command for `helm-M-x'. - -\(fn)" t nil) - -(autoload 'helm-imenu-help "helm-help" "\ -Help command for imenu. - -\(fn)" t nil) - -(autoload 'helm-color-help "helm-help" "\ -Help command for color. - -\(fn)" t nil) - -(autoload 'helm-semantic-help "helm-help" "\ -Help command for semantic. - -\(fn)" t nil) - -(autoload 'helm-kmacro-help "helm-help" "\ -Help command for kmacro. - -\(fn)" t nil) - -(defvar helm-buffer-mode-line-string '("Buffer(s)" "\\\\[helm-buffer-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "String displayed in mode-line in `helm-source-buffers-list'")) - -(defvar helm-color-mode-line-string '("Colors" "\\\\[helm-color-help]:Help/\\[helm-color-run-insert-name]:Insert name/\\[helm-color-run-insert-rgb]:Insert RGB/with shift: Kill")) - -(defvar helm-buffers-ido-virtual-mode-line-string '("Killed Buffer(s)" "\\\\[helm-buffers-ido-virtual-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "String displayed in mode-line in `helm-source-buffers-list'")) - -(defvar helm-ff-mode-line-string "\\\\[helm-ff-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "\ -String displayed in mode-line in `helm-source-find-files'") - -(defvar helm-read-file-name-mode-line-string "\\\\[helm-read-file-name-help]:Help C/\\[helm-cr-empty-string]:Empty \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "\ +(defvar helm-read-file-name-mode-line-string "\\\\[helm-help]:Help C/\\[helm-cr-empty-string]:Empty \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend" "\ String displayed in mode-line in `helm-source-find-files'.") -(defvar helm-generic-file-mode-line-string "\\\\[helm-generic-file-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend" "\ -String displayed in mode-line in Locate.") - -(defvar helm-grep-mode-line-string "\\\\[helm-grep-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend" "\ -String displayed in mode-line in `helm-do-grep'.") - -(defvar helm-pdfgrep-mode-line-string "\\\\[helm-pdfgrep-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend" "\ -String displayed in mode-line in `helm-do-pdfgrep'.") - -(defvar helm-etags-mode-line-string "\\\\[helm-etags-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "\ -String displayed in mode-line in `helm-etags-select'.") - -(defvar helm-ucs-mode-line-string "\\\\[helm-ucs-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct" "\ -String displayed in mode-line in `helm-ucs'.") - -(defvar helm-bookmark-mode-line-string '("Bookmark(s)" "\\\\[helm-bookmark-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct") "\ -String displayed in mode-line in `helm-source-buffers-list'") - -(defvar helm-occur-mode-line "\\\\[helm-help]:Help \\\\[helm-occur-run-query-replace-regexp]:Query replace regexp \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-moccur-mode-line "\\\\[helm-moccur-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-comp-read-mode-line "\\C/\\[helm-cr-empty-string]:Empty \\\\[helm-help]:Help \\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct") - -(defvar helm-top-mode-line "\\\\[helm-top-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-apt-mode-line "\\\\[helm-apt-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-el-package-mode-line "\\\\[helm-el-package-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-M-x-mode-line "\\\\[helm-M-x-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-imenu-mode-line "\\\\[helm-imenu-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") - -(defvar helm-semantic-mode-line "\\\\[helm-semantic-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") +(defvar helm-top-mode-line "\\\\[helm-help]:Help \\\\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1/f2/f-n:NthAct \\[helm-toggle-suspend-update]:Tog.suspend") (autoload 'helm-describe-helm-attribute "helm-help" "\ Display the full documentation of HELM-ATTRIBUTE. @@ -733,7 +393,7 @@ HELM-ATTRIBUTE should be a symbol. ;;;*** -;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (21913 4104 +;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-id-utils.el @@ -748,7 +408,7 @@ See . ;;;*** -;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (21913 4104 0 +;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (22156 56359 0 ;;;;;; 0)) ;;; Generated autoloads from helm-imenu.el @@ -764,7 +424,7 @@ Preconfigured helm for fetching imenu entries of all buffers. ;;;*** -;;;### (autoloads nil "helm-info" "helm-info.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-info" "helm-info.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-info.el (autoload 'helm-info-at-point "helm-info" "\ @@ -775,10 +435,16 @@ With a prefix-arg insert symbol at point. ;;;*** -;;;### (autoloads nil "helm-locate" "helm-locate.el" (21913 4103 +;;;### (autoloads nil "helm-locate" "helm-locate.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-locate.el +(autoload 'helm-projects-find-files "helm-locate" "\ +Find files with locate in `helm-locate-project-list'. +With a prefix arg refresh the database in each project. + +\(fn UPDATE)" t nil) + (autoload 'helm-locate-read-file-name "helm-locate" "\ @@ -792,8 +458,6 @@ See 'man locate' for valid options and also `helm-locate-command'. You can specify a local database with prefix argument ARG. With two prefix arg, refresh the current local db or create it if it doesn't exists. -Many databases can be used: navigate and mark them. -See also `helm-locate-with-db'. To create a user specific db, use \"updatedb -l 0 -o db_path -U directory\". @@ -804,7 +468,7 @@ Where db_path is a filename matched by ;;;*** -;;;### (autoloads nil "helm-man" "helm-man.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-man" "helm-man.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-man.el (autoload 'helm-man-woman "helm-man" "\ @@ -815,7 +479,7 @@ With a prefix arg reinitialize the cache. ;;;*** -;;;### (autoloads nil "helm-misc" "helm-misc.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-misc" "helm-misc.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-misc.el (autoload 'helm-browse-menubar "helm-misc" "\ @@ -825,6 +489,7 @@ Preconfigured helm to the menubar using lacarte.el. (autoload 'helm-world-time "helm-misc" "\ Preconfigured `helm' to show world time. +Default action change TZ environment variable locally to emacs. \(fn)" t nil) @@ -855,7 +520,7 @@ Preconfigured `helm' that provide completion of `comint' history. ;;;*** -;;;### (autoloads nil "helm-mode" "helm-mode.el" (21913 4103 0 0)) +;;;### (autoloads nil "helm-mode" "helm-mode.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-mode.el (autoload 'helm-comp-read "helm-mode" "\ @@ -884,6 +549,8 @@ Keys description: - MUST-MATCH: Candidate selected must be one of COLLECTION. +- FUZZY: Enable fuzzy matching. + - REVERSE-HISTORY: When non--nil display history source after current source completion. @@ -919,9 +586,14 @@ Keys description: - VOLATILE: Use volatile attribute (enabled by default). -- SORT: A predicate to give to `sort' e.g `string-lessp'. +- SORT: A predicate to give to `sort' e.g `string-lessp' + Use this only on small data as it is ineficient. + If you want to sort faster add a sort function to + FC-TRANSFORMER. + Note that FUZZY when enabled is already providing a sort function. -- FC-TRANSFORMER: A `filtered-candidate-transformer' function. +- FC-TRANSFORMER: A `filtered-candidate-transformer' function + or a list of functions. - HIST-FC-TRANSFORMER: A `filtered-candidate-transformer' function for the history source. @@ -933,7 +605,7 @@ Keys description: - ALISTP: (default is non--nil) See `helm-comp-read-get-candidates'. - CANDIDATES-IN-BUFFER: when non--nil use a source build with - `helm-candidates-in-buffer' which is much faster. + `helm-source-in-buffer' which is much faster. Argument VOLATILE have no effect when CANDIDATES-IN-BUFFER is non--nil. Any prefix args passed during `helm-comp-read' invocation will be recorded @@ -942,7 +614,45 @@ in `helm-current-prefix-arg', otherwise if prefix args were given before That's mean you can pass prefix args before or after calling a command that use `helm-comp-read' See `helm-M-x' for example. -\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (buffer \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (requires-pattern 0) HISTORY INPUT-HISTORY (case-fold helm-comp-read-case-fold-search) (del-input t) (persistent-action nil) (persistent-help \"DoNothing\") (mode-line helm-comp-read-mode-line) (keymap helm-comp-read-map) (name \"Helm Completions\") CANDIDATES-IN-BUFFER EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (volatile t) SORT (fc-transformer (quote helm-cr-default-transformer)) HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (alistp t))" nil nil) +\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (buffer \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (requires-pattern 0) HISTORY INPUT-HISTORY (case-fold helm-comp-read-case-fold-search) (del-input t) (persistent-action nil) (persistent-help \"DoNothing\") (mode-line helm-comp-read-mode-line) HELP-MESSAGE (keymap helm-comp-read-map) (name \"Helm Completions\") CANDIDATES-IN-BUFFER EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (volatile t) SORT (fc-transformer (quote helm-cr-default-transformer)) HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (alistp t) (candidate-number-limit helm-candidate-number-limit))" nil nil) + +(autoload 'helm-read-file-name "helm-mode" "\ +Read a file name with helm completion. +It is helm `read-file-name' emulation. + +Argument PROMPT is the default prompt to use. + +Keys description: + +- NAME: Source name, default to \"Read File Name\". + +- INITIAL-INPUT: Where to start read file name, default to `default-directory'. + +- BUFFER: `helm-buffer' name default to \"*Helm Completions*\". + +- TEST: A predicate called with one arg 'candidate'. + +- CASE-FOLD: Same as `helm-case-fold-search'. + +- PRESELECT: helm preselection. + +- HISTORY: Display HISTORY in a special source. + +- MUST-MATCH: Can be 'confirm, nil, or t. + +- MARKED-CANDIDATES: When non--nil return a list of marked candidates. + +- NOMARK: When non--nil don't allow marking candidates. + +- ALISTP: Don't use `all-completions' in history (take effect only on history). + +- PERSISTENT-ACTION: a persistent action function. + +- PERSISTENT-HELP: persistent help message. + +- MODE-LINE: A mode line message, default is `helm-read-file-name-mode-line-string'. + +\(fn PROMPT &key (name \"Read File Name\") (initial-input default-directory) (buffer \"*Helm file completions*\") TEST (case-fold helm-file-name-case-fold-search) PRESELECT HISTORY MUST-MATCH DEFAULT MARKED-CANDIDATES (candidate-number-limit helm-ff-candidate-number-limit) NOMARK (alistp t) (persistent-action (quote helm-find-files-persistent-action)) (persistent-help \"Hit1 Expand Candidate, Hit2 or (C-u) Find file\") (mode-line helm-read-file-name-mode-line-string))" nil nil) (defvar helm-mode nil "\ Non-nil if Helm mode is enabled. @@ -977,7 +687,7 @@ Note: This mode is incompatible with Emacs23. ;;;*** -;;;### (autoloads nil "helm-net" "helm-net.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-net" "helm-net.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-net.el (autoload 'helm-surfraw "helm-net" "\ @@ -990,11 +700,6 @@ Preconfigured `helm' for google search with google suggest. \(fn)" t nil) -(autoload 'helm-yahoo-suggest "helm-net" "\ -Preconfigured `helm' for Yahoo searching with Yahoo suggest. - -\(fn)" t nil) - (autoload 'helm-wikipedia-suggest "helm-net" "\ Preconfigured `helm' for Wikipedia lookup with Wikipedia suggest. @@ -1002,7 +707,7 @@ Preconfigured `helm' for Wikipedia lookup with Wikipedia suggest. ;;;*** -;;;### (autoloads nil "helm-org" "helm-org.el" (21913 4105 0 0)) +;;;### (autoloads nil "helm-org" "helm-org.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-org.el (autoload 'helm-org-agenda-files-headings "helm-org" "\ @@ -1015,6 +720,12 @@ Preconfigured helm for org buffer headings. \(fn)" t nil) +(autoload 'helm-org-parent-headings "helm-org" "\ +Preconfigured helm for org headings that are parents of the +current heading. + +\(fn)" t nil) + (autoload 'helm-org-capture-templates "helm-org" "\ Preconfigured helm for org templates. @@ -1022,7 +733,7 @@ Preconfigured helm for org templates. ;;;*** -;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (21913 4104 +;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-regexp.el @@ -1050,17 +761,6 @@ Invoke `helm-occur' from isearch. \(fn)" t nil) -(autoload 'helm-multi-occur "helm-regexp" "\ -Preconfigured helm for multi occur. - - BUFFERS is a list of buffers to search through. -With a prefix arg, reverse the behavior of -`helm-moccur-always-search-in-current'. -The prefix arg can be set before calling `helm-multi-occur' -or during the buffer selection. - -\(fn BUFFERS)" t nil) - (autoload 'helm-multi-occur-from-isearch "helm-regexp" "\ Invoke `helm-multi-occur' from isearch. @@ -1073,7 +773,7 @@ The prefix arg can be set before calling ;;;*** -;;;### (autoloads nil "helm-ring" "helm-ring.el" (21913 4103 0 0)) +;;;### (autoloads nil "helm-ring" "helm-ring.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-ring.el (defvar helm-push-mark-mode nil "\ @@ -1130,7 +830,7 @@ This command is useful when used with persistent action. ;;;*** -;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (21913 4104 +;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (22156 56359 ;;;;;; 0 0)) ;;; Generated autoloads from helm-semantic.el @@ -1153,7 +853,7 @@ Fill in the symbol at point by default. ;;;*** -;;;### (autoloads nil "helm-sys" "helm-sys.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-sys" "helm-sys.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-sys.el (autoload 'helm-top "helm-sys" "\ @@ -1173,25 +873,26 @@ Preconfigured helm for xrandr. ;;;*** -;;;### (autoloads nil "helm-tags" "helm-tags.el" (21913 4104 0 0)) +;;;### (autoloads nil "helm-tags" "helm-tags.el" (22156 56359 0 0)) ;;; Generated autoloads from helm-tags.el (autoload 'helm-etags-select "helm-tags" "\ Preconfigured helm for etags. -If called with a prefix argument or if any of the tag files have -been modified, reinitialize cache. +If called with a prefix argument REINIT +or if any of the tag files have been modified, reinitialize cache. This function aggregates three sources of tag files: - 1) An automatically located file in the parent directories, by `helm-etags-get-tag-file'. + 1) An automatically located file in the parent directories, + by `helm-etags-get-tag-file'. 2) `tags-file-name', which is commonly set by `find-tag' command. 3) `tags-table-list' which is commonly set by `visit-tags-table' command. -\(fn ARG)" t nil) +\(fn REINIT)" t nil) ;;;*** -;;;### (autoloads nil "helm-utils" "helm-utils.el" (21913 4103 0 +;;;### (autoloads nil "helm-utils" "helm-utils.el" (22156 56359 0 ;;;;;; 0)) ;;; Generated autoloads from helm-utils.el @@ -1213,23 +914,11 @@ from its directory. \(fn)" t nil) -(autoload 'helm-w32-shell-execute-open-file "helm-utils" "\ - - -\(fn FILE)" t nil) - -(autoload 'helm-yank-text-at-point "helm-utils" "\ -Yank text at point in `helm-current-buffer' into minibuffer. -If `helm-yank-symbol-first' is non--nil the first yank -grabs the entire symbol. - -\(fn)" t nil) - ;;;*** -;;;### (autoloads nil nil ("helm-aliases.el" "helm-easymenu.el" "helm-match-plugin.el" -;;;;;; "helm-pkg.el" "helm-plugin.el" "helm-source.el") (21913 4105 -;;;;;; 112748 0)) +;;;### (autoloads nil nil ("helm-easymenu.el" "helm-multi-match.el" +;;;;;; "helm-pkg.el" "helm-plugin.el" "helm-types.el") (22156 56359 +;;;;;; 459434 0)) ;;;*** diff --git a/elpa/helm-20150704.1247/helm-bookmark.el b/elpa/helm-20160105.2046/helm-bookmark.el similarity index 81% rename from elpa/helm-20150704.1247/helm-bookmark.el rename to elpa/helm-20160105.2046/helm-bookmark.el index 5b5efe2b..8ca6fdcc 100644 --- a/elpa/helm-20150704.1247/helm-bookmark.el +++ b/elpa/helm-20160105.2046/helm-bookmark.el @@ -19,6 +19,8 @@ (require 'cl-lib) (require 'bookmark) (require 'helm) +(require 'helm-help) +(require 'helm-types) (require 'helm-utils) (require 'helm-info) (require 'helm-adaptive) @@ -55,6 +57,63 @@ :group 'helm-bookmark :type '(repeat (choice symbol))) +(defcustom helm-bookmark-addressbook-actions + '(("Show Contact(s)" + . (lambda (candidate) + (let* ((contacts (helm-marked-candidates)) + (current-prefix-arg helm-current-prefix-arg)) + (bookmark-jump + (helm-bookmark-get-bookmark-from-name (car contacts))) + (helm-aif (cdr contacts) + (let ((current-prefix-arg '(4))) + (cl-loop for bmk in it do + (bookmark-jump + (helm-bookmark-get-bookmark-from-name bmk)))))))) + ("Mail To" . helm-bookmark-addressbook-send-mail-1) + ("Mail Cc" . (lambda (_candidate) + (helm-bookmark-addressbook-send-mail-1 nil 'cc))) + ("Mail Bcc" . (lambda (_candidate) + (helm-bookmark-addressbook-send-mail-1 nil 'bcc))) + ("Edit Bookmark" + . (lambda (candidate) + (let ((bmk (helm-bookmark-get-bookmark-from-name + candidate))) + (addressbook-bookmark-edit + (assoc bmk bookmark-alist))))) + ("Delete bookmark(s)" . helm-delete-marked-bookmarks) + ("Insert Email at point" + . (lambda (candidate) + (let* ((bmk (helm-bookmark-get-bookmark-from-name + candidate)) + (mlist (split-string + (assoc-default + 'email (assoc bmk bookmark-alist)) + ", "))) + (insert + (if (> (length mlist) 1) + (helm-comp-read + "Insert Mail Address: " mlist :must-match t) + (car mlist)))))) + ("Show annotation" + . (lambda (candidate) + (let ((bmk (helm-bookmark-get-bookmark-from-name + candidate))) + (bookmark-show-annotation bmk)))) + ("Edit annotation" + . (lambda (candidate) + (let ((bmk (helm-bookmark-get-bookmark-from-name + candidate))) + (bookmark-edit-annotation bmk)))) + ("Show Google map" + . (lambda (candidate) + (let* ((bmk (helm-bookmark-get-bookmark-from-name + candidate)) + (full-bmk (assoc bmk bookmark-alist))) + (addressbook-google-map full-bmk))))) + "Actions for addressbook bookmarks." + :group 'helm-bookmark + :type '(alist :key-type string :value-type function)) + (defface helm-bookmark-info '((t (:foreground "green"))) @@ -99,7 +158,6 @@ (define-key map (kbd "C-d") 'helm-bookmark-run-delete) (define-key map (kbd "C-]") 'helm-bookmark-toggle-filename) (define-key map (kbd "M-e") 'helm-bookmark-run-edit) - (define-key map (kbd "C-c ?") 'helm-bookmark-help) map) "Generic Keymap for emacs bookmark sources.") @@ -130,13 +188,6 @@ collect (cons (concat trunc sep (if (listp loc) (car loc) 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))) - (defun helm-bookmark-toggle-filename-1 (_candidate) (let* ((real (helm-get-selection helm-buffer)) (trunc (if (> (string-width real) bookmark-bmenu-file-column) @@ -173,41 +224,30 @@ ;;; bookmark-set ;; (defvar helm-source-bookmark-set - '((name . "Set Bookmark") - (dummy) - (action . bookmark-set)) + (helm-build-dummy-source "Set Bookmark" + :filtered-candidate-transformer + (lambda (_candidates _source) + (list (or (and (not (string= helm-pattern "")) + helm-pattern) + "Enter a bookmark name to record"))) + :action '(("Set bookmark" . (lambda (candidate) + (if (string= helm-pattern "") + (message "No bookmark name given for record") + (bookmark-set candidate)))))) "See (info \"(emacs)Bookmarks\").") -;;; Colorize bookmarks by category +;;; Search and match-part fns. ;; -(defvar helm-source-pp-bookmarks - '((name . "PP-Bookmarks") - (init . (lambda () - (bookmark-maybe-load-default-file) - (helm-init-candidates-in-buffer - 'global (cl-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) - (type . bookmark)) - "See (info \"(emacs)Bookmarks\").") - (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." + "Search function for bookmark sources using `helm-source-in-buffer'." (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." +(defun helm-bookmark-match-part-fn (candidate) + "Match part function for bookmark sources using `helm-source-in-buffer'." (helm-aif (and helm-bookmark-show-location (bookmark-location candidate)) ;; Match against bookmark-name and location. @@ -302,12 +342,10 @@ BOOKMARK is a bookmark name or a bookmark record." (defun helm-bookmark-filter-setup-alist (fn) "Return a filtered `bookmark-alist' sorted alphabetically." - (cl-loop with alist = (cl-loop for b in bookmark-alist - when (funcall fn b) collect b) - for bmk in alist - for name = (car bmk) - collect (propertize name 'location (bookmark-location name)))) - + (cl-loop for b in bookmark-alist + for name = (car b) + when (funcall fn b) collect + (propertize name 'location (bookmark-location name)))) ;;; Bookmark handlers ;; @@ -350,7 +388,7 @@ than `w3m-browse-url' use it." ;; (defclass helm-source-filtered-bookmarks (helm-source-in-buffer helm-type-bookmark) ((search :initform #'helm-bookmark-search-fn) - (match-part :initform #'helm-pp-bookmark-match-fn) + (match-part :initform #'helm-bookmark-match-part-fn) (filtered-candidate-transformer :initform '(helm-adaptive-sort helm-highlight-bookmark)))) @@ -444,7 +482,9 @@ than `w3m-browse-url' use it." :init (lambda () (bookmark-maybe-load-default-file) (helm-init-candidates-in-buffer - 'global (helm-bookmark-helm-find-files-setup-alist))))) + 'global (helm-bookmark-helm-find-files-setup-alist))) + :persistent-action (lambda (_candidate) (ignore)) + :persistent-help "Do nothing")) ;;; Uncategorized bookmarks ;; @@ -470,7 +510,7 @@ than `w3m-browse-url' use it." 'global (helm-bookmark-addressbook-setup-alist)))) (search :initform #'helm-bookmark-search-fn) - (match-part :initform #'helm-pp-bookmark-match-fn) + (match-part :initform #'helm-bookmark-match-part-fn) (persistent-action :initform (lambda (candidate) (let ((bmk (helm-bookmark-get-bookmark-from-name @@ -480,58 +520,7 @@ than `w3m-browse-url' use it." (filtered-candidate-transformer :initform '(helm-adaptive-sort helm-highlight-bookmark)) - (action :initform (("Show Contact(s)" - . (lambda (candidate) - (let* ((contacts (helm-marked-candidates)) - (current-prefix-arg helm-current-prefix-arg)) - (bookmark-jump - (helm-bookmark-get-bookmark-from-name (car contacts))) - (helm-aif (cdr contacts) - (let ((current-prefix-arg '(4))) - (cl-loop for bmk in it do - (bookmark-jump - (helm-bookmark-get-bookmark-from-name bmk)))))))) - ("Mail To" . helm-bookmark-addressbook-send-mail-1) - ("Mail Cc" . (lambda (_candidate) - (helm-bookmark-addressbook-send-mail-1 nil 'cc))) - ("Mail Bcc" . (lambda (_candidate) - (helm-bookmark-addressbook-send-mail-1 nil 'bcc))) - ("Edit Bookmark" - . (lambda (candidate) - (let ((bmk (helm-bookmark-get-bookmark-from-name - candidate))) - (addressbook-bookmark-edit - (assoc bmk bookmark-alist))))) - ("Delete bookmark(s)" . helm-delete-marked-bookmarks) - ("Insert Email at point" - . (lambda (candidate) - (let* ((bmk (helm-bookmark-get-bookmark-from-name - candidate)) - (mlist (split-string - (assoc-default - 'email (assoc bmk bookmark-alist)) - ", "))) - (insert - (if (> (length mlist) 1) - (helm-comp-read - "Insert Mail Address: " mlist :must-match t) - (car mlist)))))) - ("Show annotation" - . (lambda (candidate) - (let ((bmk (helm-bookmark-get-bookmark-from-name - candidate))) - (bookmark-show-annotation bmk)))) - ("Edit annotation" - . (lambda (candidate) - (let ((bmk (helm-bookmark-get-bookmark-from-name - candidate))) - (bookmark-edit-annotation bmk)))) - ("Show Google map" - . (lambda (candidate) - (let* ((bmk (helm-bookmark-get-bookmark-from-name - candidate)) - (full-bmk (assoc bmk bookmark-alist))) - (addressbook-google-map full-bmk)))))))) + (action :initform 'helm-bookmark-addressbook-actions))) (defun helm-bookmark-addressbook-send-mail-1 (_candidate &optional cc) (let* ((contacts (helm-marked-candidates)) @@ -633,6 +622,10 @@ Work both with standard Emacs bookmarks and bookmark-extensions.el." i) (cons bmk i))))) + +;;; Edit/rename/save bookmarks. +;; +;; (defun helm-bookmark-edit-bookmark (bookmark-name) "Edit bookmark's name and file name, and maybe save them. BOOKMARK-NAME is the current (old) name of the bookmark to be renamed." @@ -705,39 +698,21 @@ words from the buffer into the new bookmark name." "Run `helm-bookmark-edit-bookmark' from keyboard." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-bookmark-edit-bookmark))) - - -;;; Bookmarks attributes -;; -(define-helm-type-attribute 'bookmark - `((coerce . helm-bookmark-get-bookmark-from-name) - (action . ,(helm-make-actions - "Jump to bookmark" 'helm-bookmark-jump - "Jump to BM other window" 'helm-bookmark-jump-other-window - "Bookmark edit annotation" 'bookmark-edit-annotation - "Bookmark show annotation" 'bookmark-show-annotation - "Delete bookmark(s)" 'helm-delete-marked-bookmarks - "Edit Bookmark" 'helm-bookmark-edit-bookmark - "Rename bookmark" 'helm-bookmark-rename - "Relocate bookmark" 'bookmark-relocate)) - (keymap . ,helm-bookmark-map) - (mode-line . helm-bookmark-mode-line-string)) - "Bookmark name.") + (helm-exit-and-execute-action 'helm-bookmark-edit-bookmark))) (defun helm-bookmark-run-jump-other-window () "Jump to bookmark from keyboard." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'bookmark-jump-other-window))) + (helm-exit-and-execute-action 'bookmark-jump-other-window))) (defun helm-bookmark-run-delete () "Delete bookmark from keyboard." (interactive) (with-helm-alive-p (when (y-or-n-p "Delete bookmark(s)?") - (helm-quit-and-execute-action 'helm-delete-marked-bookmarks)))) + (helm-exit-and-execute-action 'helm-delete-marked-bookmarks)))) (defun helm-bookmark-get-bookmark-from-name (bmk) "Return bookmark name even if it is a bookmark with annotation. @@ -761,15 +736,6 @@ e.g prepended with *." :buffer "*helm bookmarks*" :default (buffer-name helm-current-buffer))) -;;;###autoload -(defun helm-pp-bookmarks () - "Preconfigured `helm' for bookmarks (pretty-printed)." - (interactive) - (helm :sources '(helm-source-pp-bookmarks - helm-source-bookmark-set) - :buffer "*helm pp bookmarks*" - :default (buffer-name helm-current-buffer))) - ;;;###autoload (defun helm-filtered-bookmarks () "Preconfigured helm for bookmarks (filtered by category). diff --git a/elpa/helm-20150704.1247/helm-buffers.el b/elpa/helm-20160105.2046/helm-buffers.el similarity index 87% rename from elpa/helm-20150704.1247/helm-buffers.el rename to elpa/helm-20160105.2046/helm-buffers.el index 60a65057..f1c1009d 100644 --- a/elpa/helm-20150704.1247/helm-buffers.el +++ b/elpa/helm-20160105.2046/helm-buffers.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-types) (require 'helm-utils) (require 'helm-elscreen) (require 'helm-grep) @@ -44,6 +45,13 @@ filtered from the list of candidates if the :type '(repeat (choice regexp)) :group 'helm-buffers) +(defcustom helm-white-buffer-regexp-list nil + "The regexp list of not boring buffers. +These buffers will be displayed even if they match one of +`helm-boring-buffer-regexp-list'." + :type '(repeat (choice regexp)) + :group 'helm-buffers) + (defcustom helm-buffers-favorite-modes '(lisp-interaction-mode emacs-lisp-mode text-mode @@ -85,9 +93,14 @@ Only buffer names are fuzzy matched when this is enabled, helm-source-recentf helm-source-buffer-not-found) "Default sources list used in `helm-mini'." - :group 'helm-misc + :group 'helm-buffers :type '(repeat (choice symbol))) +(defcustom helm-buffers-end-truncated-string "..." + "The string to display at end of truncated buffer names." + :type 'string + :group 'helm-buffers) + ;;; Faces ;; @@ -135,7 +148,6 @@ Only buffer names are fuzzy matched when this is enabled, (defvar helm-buffer-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-buffer-help) ;; No need to have separate command for grep and zgrep ;; as we don't use recursivity for buffers. ;; So use zgrep for both as it is capable to handle non--compressed files. @@ -163,7 +175,6 @@ Only buffer names are fuzzy matched when this is enabled, (defvar helm-buffers-ido-virtual-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-buffers-ido-virtual-help) (define-key map (kbd "C-c o") 'helm-ff-run-switch-other-window) (define-key map (kbd "C-c C-o") 'helm-ff-run-switch-other-frame) (define-key map (kbd "M-g s") 'helm-ff-run-grep) @@ -182,7 +193,7 @@ Only buffer names are fuzzy matched when this is enabled, (let ((result (cl-loop for b in helm-buffers-list-cache maximize (length b) into len-buf maximize (length (with-current-buffer b - (symbol-name major-mode))) + (format-mode-line mode-name))) into len-mode finally return (cons len-buf len-mode)))) (unless (default-value 'helm-buffer-max-length) @@ -208,8 +219,9 @@ Only buffer names are fuzzy matched when this is enabled, (with-helm-buffer (helm-force-update)))))) (keymap :initform helm-buffer-map) + (migemo :initform 'nomultimatch) (volatile :initform t) - (mode-line :initform helm-buffer-mode-line-string) + (help-message :initform 'helm-buffer-help-message) (persistent-help :initform "Show this buffer / C-u \\[helm-execute-persistent-action]: Kill this buffer"))) @@ -252,7 +264,7 @@ Only buffer names are fuzzy matched when this is enabled, ido-virtual-buffers))) :fuzzy-match helm-buffers-fuzzy-matching :keymap helm-buffers-ido-virtual-map - :mode-line helm-buffers-ido-virtual-mode-line-string + :help-message 'helm-buffers-ido-virtual-help-message :action '(("Find file" . helm-find-many-files) ("Find file other window" . find-file-other-window) ("Find file other frame" . find-file-other-frame) @@ -266,6 +278,7 @@ Only buffer names are fuzzy matched when this is enabled, (defvar ido-use-virtual-buffers) +(defvar ido-ignore-buffers) (defun helm-buffer-list () "Return the current list of buffers. Currently visible buffers are put at the end of the list. @@ -273,6 +286,7 @@ See `ido-make-buffer-list' for more infos." (require 'ido) (let ((ido-process-ignore-lists t) ido-ignored-list + ido-ignore-buffers ido-use-virtual-buffers) (ido-make-buffer-list nil))) @@ -363,9 +377,12 @@ Should be called after others transformers i.e (boring buffers)." (helm-buffer--details i)) for truncbuf = (if (> (string-width name) helm-buffer-max-length) (helm-substring-by-width - name helm-buffer-max-length) - (concat name (make-string - (- (+ helm-buffer-max-length 3) + name helm-buffer-max-length + helm-buffers-end-truncated-string) + (concat name + (make-string + (- (+ helm-buffer-max-length + (length helm-buffers-end-truncated-string)) (string-width name)) ? ))) for len = (length mode) when (> len helm-buffer-max-len-mode) @@ -391,7 +408,8 @@ Should be called after others transformers i.e (boring buffers)." helm-buffer-max-length)) (regexp-quote (helm-substring-by-width - bufname helm-buffer-max-length)) + bufname helm-buffer-max-length + helm-buffers-end-truncated-string)) (concat (regexp-quote bufname) (if helm-buffer-details-flag "$" "[[:blank:]]+")))))) @@ -408,7 +426,7 @@ Should be called after others transformers i.e (boring buffers)." (if (string= helm-pattern "") candidates (sort candidates - #'(lambda (s1 s2) + (lambda (s1 s2) (< (string-width s1) (string-width s2)))))) (defun helm-buffers-mark-similar-buffers-1 () @@ -433,6 +451,7 @@ Should be called after others transformers i.e (boring buffers)." (helm-make-visible-mark))) (forward-line 1) (end-of-line)))) (helm-mark-current-line) + (helm-display-mode-line (helm-get-current-source) t) (message "%s candidates marked" (length helm-marked-candidates))))) (defun helm-buffers-mark-similar-buffers () @@ -464,14 +483,17 @@ i.e same color." (and neg neg-test (not neg-test))))))) (defun helm-buffer--match-pattern (pattern candidate) - (let ((fun (if (and helm-buffers-fuzzy-matching + (let ((bfn (if (and helm-buffers-fuzzy-matching + (not helm-migemo-mode) (not (string-match "\\`\\^" pattern))) #'helm--mapconcat-pattern - #'identity))) + #'identity)) + (mfn (if helm-migemo-mode + #'helm-mm-migemo-string-match #'string-match))) (if (string-match "\\`!" pattern) - (not (string-match (funcall fun (substring pattern 1)) - candidate)) - (string-match (funcall fun pattern) candidate)))) + (not (funcall mfn (funcall bfn (substring pattern 1)) + candidate)) + (funcall mfn (funcall bfn pattern) candidate)))) (defun helm-buffers--match-from-mjm (candidate) (let* ((cand (replace-regexp-in-string "^\\s-\\{1\\}" "" candidate)) @@ -505,11 +527,13 @@ i.e same color." for p in (split-string pattern) when (string-match "\\`@\\(.*\\)" p) return (match-string 1 p)))) - (if regexp + (if (and buf regexp) (with-current-buffer buf (save-excursion (goto-char (point-min)) - (re-search-forward regexp nil t))) + (if helm-migemo-mode + (helm-mm-migemo-forward regexp nil t) + (re-search-forward regexp nil t)))) t))) (defun helm-buffers--match-from-directory (candidate) @@ -539,24 +563,21 @@ i.e same color." (defun helm-buffer-query-replace-1 (&optional regexp-flag buffers) "Query replace in marked buffers. If REGEXP-FLAG is given use `query-replace-regexp'." - (let ((fn (if regexp-flag 'query-replace-regexp 'query-replace)) - (prompt (if regexp-flag "Query replace regexp" "Query replace")) + (let ((prompt (if regexp-flag "Query replace regexp" "Query replace")) (bufs (or buffers (helm-marked-candidates))) (helm--reading-passwd-or-string t)) - (cl-loop with replace = (query-replace-read-from prompt regexp-flag) - with tostring = (unless (consp replace) - (query-replace-read-to - replace prompt regexp-flag)) - for buf in bufs - do - (save-window-excursion - (switch-to-buffer buf) - (save-excursion - (let ((case-fold-search t)) - (goto-char (point-min)) - (if (consp replace) - (apply fn (list (car replace) (cdr replace))) - (apply fn (list replace tostring))))))))) + (cl-loop with args = (query-replace-read-args prompt regexp-flag t) + for buf in bufs + do + (save-window-excursion + (switch-to-buffer buf) + (save-excursion + (let ((case-fold-search t)) + (goto-char (point-min)) + (apply #'perform-replace + (list (nth 0 args) (nth 1 args) + t regexp-flag (nth 2 args) nil + multi-query-replace-map)))))))) (defun helm-buffer-query-replace-regexp (_candidate) (helm-buffer-query-replace-1 'regexp)) @@ -627,70 +648,72 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (helm-execute-persistent-action 'kill-action))) (defun helm-kill-marked-buffers (_ignore) - (mapc 'kill-buffer (helm-marked-candidates)) - (with-helm-buffer - (setq helm-marked-candidates nil - helm-visible-mark-overlays nil))) + (let* ((bufs (helm-marked-candidates)) + (killed-bufs (cl-count-if 'kill-buffer bufs))) + (with-helm-buffer + (setq helm-marked-candidates nil + helm-visible-mark-overlays nil)) + (message "Killed %s buffer(s)" killed-bufs))) (defun helm-buffer-run-kill-buffers () "Run kill buffer action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-kill-marked-buffers))) + (helm-exit-and-execute-action 'helm-kill-marked-buffers))) (defun helm-buffer-run-grep () "Run Grep action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-grep-buffers))) + (helm-exit-and-execute-action 'helm-grep-buffers))) (defun helm-buffer-run-zgrep () "Run Grep action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-zgrep-buffers))) + (helm-exit-and-execute-action 'helm-zgrep-buffers))) (defun helm-buffer-run-query-replace-regexp () "Run Query replace regexp action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-buffer-query-replace-regexp))) + (helm-exit-and-execute-action 'helm-buffer-query-replace-regexp))) (defun helm-buffer-run-query-replace () "Run Query replace action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-buffer-query-replace))) + (helm-exit-and-execute-action 'helm-buffer-query-replace))) (defun helm-buffer-switch-other-window () "Run switch to other window action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-switch-to-buffers-other-window))) + (helm-exit-and-execute-action 'helm-switch-to-buffers-other-window))) (defun helm-buffer-switch-other-frame () "Run switch to other frame action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'switch-to-buffer-other-frame))) + (helm-exit-and-execute-action 'switch-to-buffer-other-frame))) (defun helm-buffer-switch-to-elscreen () "Run switch to elscreen action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-buffer-on-elscreen))) + (helm-exit-and-execute-action 'helm-find-buffer-on-elscreen))) (defun helm-buffer-run-ediff () "Run ediff action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ediff-marked-buffers))) + (helm-exit-and-execute-action 'helm-ediff-marked-buffers))) (defun helm-buffer-run-ediff-merge () "Run ediff action from `helm-source-buffers-list'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ediff-marked-buffers-merge))) + (helm-exit-and-execute-action 'helm-ediff-marked-buffers-merge))) (defun helm-buffers-persistent-kill-1 (buffer) "Persistent action to kill buffer." @@ -699,12 +722,7 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (message "Can't kill `helm-current-buffer' without quitting session") (sit-for 1)) (with-current-buffer (get-buffer buffer) - (if (and (buffer-modified-p) - (buffer-file-name (current-buffer))) - (progn - (save-buffer) - (kill-buffer buffer)) - (kill-buffer buffer))) + (kill-buffer buffer)) (helm-delete-current-selection) (with-helm-temp-hook 'helm-after-persistent-action-hook (helm-force-update (regexp-quote (helm-get-selection nil t)))))) @@ -737,9 +755,11 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (helm-get-selection)))))) (defun helm-buffers-list-persistent-action (candidate) - (if current-prefix-arg - (helm-buffers-persistent-kill candidate) - (switch-to-buffer candidate))) + (let ((current (window-buffer helm-persistent-action-display-window))) + (if (or (eql current (get-buffer helm-current-buffer)) + (not (eql current (get-buffer candidate)))) + (switch-to-buffer candidate) + (switch-to-buffer helm-current-buffer)))) (defun helm-ediff-marked-buffers (_candidate &optional merge) "Ediff 2 marked buffers or CANDIDATE and `helm-current-buffer'. @@ -783,7 +803,7 @@ Can be used by any source that list buffers." "Run `helm-multi-occur-as-action' by key." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-multi-occur-as-action))) + (helm-exit-and-execute-action 'helm-multi-occur-as-action))) (defun helm-buffers-toggle-show-hidden-buffers () (interactive) @@ -808,7 +828,9 @@ Can be used by any source that list buffers." ;; ;; (defun helm-skip-boring-buffers (buffers _source) - (helm-skip-entries buffers helm-boring-buffer-regexp-list)) + (helm-skip-entries buffers + helm-boring-buffer-regexp-list + helm-white-buffer-regexp-list)) (defun helm-shadow-boring-buffers (buffers _source) "Buffers matching `helm-boring-buffer-regexp' will be @@ -816,35 +838,6 @@ displayed with the `file-name-shadow' face if available." (helm-shadow-entries buffers helm-boring-buffer-regexp-list)) -(define-helm-type-attribute 'buffer - `((action - . ,(helm-make-actions - "Switch to buffer" 'switch-to-buffer - (lambda () (and (locate-library "popwin") "Switch to buffer in popup window")) - 'popwin:popup-buffer - "Switch to buffer other window `C-c o'" 'switch-to-buffer-other-window - "Switch to buffer other frame `C-c C-o'" 'switch-to-buffer-other-frame - (lambda () (and (locate-library "elscreen") "Display buffer in Elscreen")) - 'helm-find-buffer-on-elscreen - "Query replace regexp `C-M-%'" 'helm-buffer-query-replace-regexp - "Query replace `M-%'" 'helm-buffer-query-replace - "View buffer" 'view-buffer - "Display buffer" 'display-buffer - "Grep buffers `M-g s' (C-u grep all buffers)" 'helm-zgrep-buffers - "Multi occur buffer(s) `C-s'" 'helm-multi-occur-as-action - "Revert buffer(s) `M-U'" 'helm-revert-marked-buffers - "Insert buffer" 'insert-buffer - "Kill buffer(s) `M-D'" 'helm-kill-marked-buffers - "Diff with file" 'diff-buffer-with-file - "Ediff Marked buffers `C-c ='" 'helm-ediff-marked-buffers - "Ediff Merge marked buffers `M-='" (lambda (candidate) - (helm-ediff-marked-buffers candidate t)))) - (persistent-help . "Show this buffer") - (filtered-candidate-transformer helm-skip-boring-buffers - helm-buffers-sort-transformer - helm-highlight-buffers)) - "Buffer or buffer name.") - ;;;###autoload (defun helm-buffers-list () "Preconfigured `helm' to list buffers." diff --git a/elpa/helm-20150704.1247/helm-color.el b/elpa/helm-20160105.2046/helm-color.el similarity index 93% rename from elpa/helm-20150704.1247/helm-color.el rename to elpa/helm-20160105.2046/helm-color.el index 7707c5d0..d87a55ce 100644 --- a/elpa/helm-20150704.1247/helm-color.el +++ b/elpa/helm-20160105.2046/helm-color.el @@ -18,6 +18,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-help) ;;; Customize Face ;; @@ -79,22 +80,22 @@ (defun helm-color-run-insert-name () "Insert name of color from `helm-source-colors'" (interactive) - (with-helm-alive-p (helm-quit-and-execute-action 'helm-color-insert-name))) + (with-helm-alive-p (helm-exit-and-execute-action 'helm-color-insert-name))) (defun helm-color-run-kill-name () "Kill name of color from `helm-source-colors'" (interactive) - (with-helm-alive-p (helm-quit-and-execute-action 'helm-color-kill-name))) + (with-helm-alive-p (helm-exit-and-execute-action 'helm-color-kill-name))) (defun helm-color-run-insert-rgb () "Insert RGB of color from `helm-source-colors'" (interactive) - (with-helm-alive-p (helm-quit-and-execute-action 'helm-color-insert-rgb))) + (with-helm-alive-p (helm-exit-and-execute-action 'helm-color-insert-rgb))) (defun helm-color-run-kill-rgb () "Kill RGB of color from `helm-source-colors'" (interactive) - (with-helm-alive-p (helm-quit-and-execute-action 'helm-color-kill-rgb))) + (with-helm-alive-p (helm-exit-and-execute-action 'helm-color-kill-rgb))) (defvar helm-color-map (let ((map (make-sparse-keymap))) @@ -103,7 +104,6 @@ (define-key map (kbd "C-c N") 'helm-color-run-kill-name) (define-key map (kbd "C-c r") 'helm-color-run-insert-rgb) (define-key map (kbd "C-c R") 'helm-color-run-kill-rgb) - (define-key map (kbd "C-c ?") 'helm-color-help) map)) (defvar helm-source-colors @@ -113,7 +113,7 @@ :keymap helm-color-map :persistent-help "Kill entry in RGB format." :persistent-action 'helm-color-kill-rgb - :mode-line 'helm-color-mode-line-string + :help-message 'helm-colors-help-message :action '(("Copy Name (C-c N)" . helm-color-kill-name) ("Copy RGB (C-c R)" . helm-color-kill-rgb) diff --git a/elpa/helm-20150704.1247/helm-command.el b/elpa/helm-20160105.2046/helm-command.el similarity index 82% rename from elpa/helm-20150704.1247/helm-command.el rename to elpa/helm-20160105.2046/helm-command.el index 4a98e11d..8dacc4ae 100644 --- a/elpa/helm-20150704.1247/helm-command.el +++ b/elpa/helm-20160105.2046/helm-command.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'helm-mode) (require 'helm-elisp) @@ -63,20 +64,14 @@ Show all candidates on startup when 0 (default)." (defvar helm-M-x-input-history nil) -(defvar helm-M-x-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-M-x-help) - map) - "Keymap for `helm-M-x'.") - (cl-defun helm-M-x-get-major-mode-command-alist (mode-map) "Return alist of MODE-MAP." - (cl-loop for key being the key-seqs of mode-map using (key-bindings com) - for str-key = (key-description key) - for ismenu = (string-match "" str-key) - unless ismenu collect (cons str-key com))) + (when mode-map + (cl-loop for key being the key-seqs of mode-map using (key-bindings com) + for str-key = (key-description key) + for ismenu = (string-match "" str-key) + unless ismenu collect (cons str-key com)))) (defun helm-get-mode-map-from-mode (mode) "Guess the mode-map name according to MODE. @@ -97,9 +92,9 @@ Return nil if no mode-map found." (defun helm-M-x-current-mode-map-alist () "Return mode-map alist of current `major-mode'." - (let ((map (helm-get-mode-map-from-mode major-mode))) - (when (and map (boundp map)) - (helm-M-x-get-major-mode-command-alist (symbol-value map))))) + (let ((map-sym (helm-get-mode-map-from-mode major-mode))) + (when (and map-sym (boundp map-sym)) + (helm-M-x-get-major-mode-command-alist (symbol-value map-sym))))) (defun helm-M-x-transformer-1 (candidates &optional sort) @@ -174,35 +169,20 @@ than the default which is OBARRAY." (read-extended-command)) (helm-mode 1)) (read-extended-command)) - (let* (in-help - help-cand - (orig-fuzzy-sort-fn helm-fuzzy-sort-fn) + (let* ((orig-fuzzy-sort-fn helm-fuzzy-sort-fn) (helm-fuzzy-sort-fn (lambda (candidates source) (funcall orig-fuzzy-sort-fn candidates source 'real))) (helm--mode-line-display-prefarg t) - (pers-help - #'(lambda (candidate) - (let ((hbuf (get-buffer (help-buffer)))) - (if (and in-help (string= candidate help-cand) - (null helm-persistent-action-use-special-display)) - (progn - ;; When M-x is started from a help buffer, - ;; Don't kill it as it is helm-current-buffer. - (unless (equal hbuf helm-current-buffer) - (kill-buffer hbuf) - (set-window-buffer (get-buffer-window hbuf) - helm-current-buffer)) - (setq in-help nil)) - (helm-describe-function candidate) - (setq in-help t)) - (setq help-cand candidate)))) - (tm (run-at-time 1 0.1 'helm-M-x--notify-prefix-arg))) + (tm (run-at-time 1 0.1 'helm-M-x--notify-prefix-arg)) + (helm-move-selection-after-hook + (cons (lambda () (setq current-prefix-arg nil)) + helm-move-selection-after-hook))) (setq extended-command-history - (cl-loop for i in extended-command-history - when (commandp (intern i)) - do (set-text-properties 0 (length i) nil i) - and collect i)) + (cl-loop for c in extended-command-history + when (and c (commandp (intern c))) + do (set-text-properties 0 (length c) nil c) + and collect c)) (unwind-protect (let ((msg "Error: Specifying a prefix arg before calling `helm-M-x'")) (when current-prefix-arg @@ -218,16 +198,18 @@ than the default which is OBARRAY." :requires-pattern helm-M-x-requires-pattern :name "Emacs Commands" :buffer "*helm M-x*" - :persistent-action pers-help + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) :persistent-help "Describe this command" :history (or history extended-command-history) :reverse-history helm-M-x-reverse-history + :input-history 'helm-M-x-input-history :del-input nil - :mode-line helm-M-x-mode-line + :help-message 'helm-M-x-help-message :must-match t :fuzzy helm-M-x-fuzzy-match :nomark t - :keymap helm-M-x-map :candidates-in-buffer t :fc-transformer 'helm-M-x-transformer :hist-fc-transformer 'helm-M-x-transformer-hist)) diff --git a/elpa/helm-20150704.1247/helm-config.el b/elpa/helm-20160105.2046/helm-config.el similarity index 97% rename from elpa/helm-20150704.1247/helm-config.el rename to elpa/helm-20160105.2046/helm-config.el index 58e29e21..c1b978ff 100644 --- a/elpa/helm-20150704.1247/helm-config.el +++ b/elpa/helm-20160105.2046/helm-config.el @@ -21,7 +21,6 @@ ;;; Require ;; ;; -(require 'helm-aliases) (declare-function async-bytecomp-package-mode "ext:async-bytecomp.el") (when (require 'async-bytecomp nil t) (and (fboundp 'async-bytecomp-package-mode) @@ -96,6 +95,7 @@ (define-key map (kbd "M-x") 'helm-M-x) (define-key map (kbd "M-s o") 'helm-occur) (define-key map (kbd "M-g s") 'helm-do-grep) + (define-key map (kbd "M-g a") 'helm-do-grep-ag) (define-key map (kbd "c") 'helm-colors) (define-key map (kbd "F") 'helm-select-xfont) (define-key map (kbd "8") 'helm-ucs) @@ -104,11 +104,12 @@ (define-key map (kbd "h i") 'helm-info-at-point) (define-key map (kbd "h r") 'helm-info-emacs) (define-key map (kbd "h g") 'helm-info-gnus) + (define-key map (kbd "h h") 'helm-documentation) (define-key map (kbd "C-x C-b") 'helm-buffers-list) (define-key map (kbd "C-x r i") 'helm-register) (define-key map (kbd "C-c C-x") 'helm-run-external-command) (define-key map (kbd "b") 'helm-resume) - (define-key map (kbd "M-n") 'helm-gid) + (define-key map (kbd "C-c g") 'helm-gid) (define-key map (kbd "@") 'helm-list-elisp-packages) map)) diff --git a/elpa/helm-20150704.1247/helm-dabbrev.el b/elpa/helm-20160105.2046/helm-dabbrev.el similarity index 99% rename from elpa/helm-20150704.1247/helm-dabbrev.el rename to elpa/helm-20160105.2046/helm-dabbrev.el index 08b525b9..7e768d93 100644 --- a/elpa/helm-20150704.1247/helm-dabbrev.el +++ b/elpa/helm-20160105.2046/helm-dabbrev.el @@ -18,6 +18,7 @@ ;;; Code: (require 'helm) +(require 'helm-help) (require 'helm-elisp) ; For show-completion. (defgroup helm-dabbrev nil @@ -157,7 +158,7 @@ but the initial search for all candidates in buffer(s)." (minibuf (minibufferp buffer1)) result pos-before pos-after (search-and-store - #'(lambda (pattern direction) + (lambda (pattern direction) (while (cl-case direction (1 (search-forward pattern nil t)) (-1 (search-backward pattern nil t)) @@ -229,7 +230,7 @@ but the initial search for all candidates in buffer(s)." (defun helm-dabbrev--get-candidates (abbrev) (cl-assert abbrev nil "[No Match]") (with-current-buffer (current-buffer) - (let* ((dabbrev-get #'(lambda (str all-bufs) + (let* ((dabbrev-get (lambda (str all-bufs) (helm-dabbrev--collect str helm-candidate-number-limit (cl-case helm-dabbrev-case-fold-search @@ -266,7 +267,7 @@ but the initial search for all candidates in buffer(s)." (zerop helm-dabbrev-cycle-threshold))) (helm-execute-action-at-once-if-one t) (helm-quit-if-no-candidate - #'(lambda () + (lambda () (message "[Helm-dabbrev: No expansion found]")))) (cl-assert (and (stringp dabbrev) (not (string= dabbrev ""))) nil "[Helm-dabbrev: Nothing found before point]") diff --git a/elpa/helm-20150704.1247/helm-easymenu.el b/elpa/helm-20160105.2046/helm-easymenu.el similarity index 90% rename from elpa/helm-20150704.1247/helm-easymenu.el rename to elpa/helm-20160105.2046/helm-easymenu.el index 23f263bb..1cbca12e 100644 --- a/elpa/helm-20150704.1247/helm-easymenu.el +++ b/elpa/helm-20160105.2046/helm-easymenu.el @@ -42,16 +42,18 @@ ("Info" ["Info at point" helm-info-at-point t] ["Emacs Manual index" helm-info-emacs t] - ["Gnus Manual index" helm-info-gnus t]) + ["Gnus Manual index" helm-info-gnus t] + ["Helm documentation" helm-documentation t]) ("Org" - ["Org keywords" helm-org-keywords t] - ["Org headlines" helm-org-headlines t]) + ["Org headlines in org agenda files" helm-org-agenda-files-headings t] + ["Org headlines in buffer" helm-org-in-buffer-headings t]) ("Elpa" ["Elisp packages" helm-list-elisp-packages t] ["Elisp packages no fetch" helm-list-elisp-packages-no-fetch t]) ("Tools" ["Occur" helm-occur t] ["Grep" helm-do-grep t] + ["Grep current directory with AG" helm-do-grep-ag t] ["Gid" helm-gid t] ["Etags" helm-etags-select t] ["Lisp complete at point" helm-lisp-completion-at-point t] diff --git a/elpa/helm-20150704.1247/helm-elisp-package.el b/elpa/helm-20160105.2046/helm-elisp-package.el similarity index 91% rename from elpa/helm-20150704.1247/helm-elisp-package.el rename to elpa/helm-20160105.2046/helm-elisp-package.el index 32d95140..55d6b323 100644 --- a/elpa/helm-20150704.1247/helm-elisp-package.el +++ b/elpa/helm-20160105.2046/helm-elisp-package.el @@ -18,6 +18,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'package) (defgroup helm-el-package nil @@ -30,6 +31,7 @@ :type '(radio :tag "Initial filter for elisp packages" (const :tag "Show all packages" all) (const :tag "Show installed packages" installed) + (const :tag "Show not installed packages" uninstalled) (const :tag "Show upgradable packages" upgrade))) ;; internals vars @@ -56,8 +58,13 @@ (buffer-string))) (setq helm-el-package--upgrades (helm-el-package-menu--find-upgrades)) (if helm-force-updating-p - (message "Refreshing packages list done") - (setq helm-el-package--show-only helm-el-package-initial-filter)) + (if helm-el-package--upgrades + (message "%d package(s) can be upgraded, Refreshing packages list done" + (length helm-el-package--upgrades)) + (message "Refreshing packages list done, no upgrades available")) + (setq helm-el-package--show-only (if helm-el-package--upgrades + 'upgrade + helm-el-package-initial-filter))) (kill-buffer "*Packages*")) (defun helm-el-package-describe (candidate) @@ -82,7 +89,7 @@ (defun helm-el-run-visit-homepage () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-visit-homepage))) + (helm-exit-and-execute-action 'helm-el-package-visit-homepage))) (defun helm-el-package-install-1 (pkg-list) (cl-loop with mkd = pkg-list @@ -117,7 +124,7 @@ (defun helm-el-run-package-install () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-install))) + (helm-exit-and-execute-action 'helm-el-package-install))) (defun helm-el-package-uninstall-1 (pkg-list) (cl-loop with mkd = pkg-list @@ -165,7 +172,7 @@ (defun helm-el-run-package-uninstall () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-uninstall))) + (helm-exit-and-execute-action 'helm-el-package-uninstall))) (defun helm-el-package-menu--find-upgrades () (cl-loop for entry in helm-el-package--tabulated-list @@ -215,7 +222,7 @@ (defun helm-el-run-package-upgrade () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-upgrade))) + (helm-exit-and-execute-action 'helm-el-package-upgrade))) (defun helm-el-package-upgrade-all () (if helm-el-package--upgrades @@ -226,13 +233,13 @@ (helm-el-package-upgrade-1 helm-el-package--tabulated-list))) (message "No packages to upgrade actually!"))) +(defun helm-el-package-upgrade-all-action (_candidate) + (helm-el-package-upgrade-all)) + (defun helm-el-run-package-upgrade-all () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-upgrade-all))) - -(defun helm-el-package-upgrade-all-action (_candidate) - (helm-el-package-upgrade-all)) + (helm-exit-and-execute-action 'helm-el-package-upgrade-all-action))) (defun helm-el-package--transformer (candidates _source) (cl-loop for c in candidates @@ -297,7 +304,6 @@ (define-key map (kbd "C-c u") 'helm-el-run-package-upgrade) (define-key map (kbd "C-c U") 'helm-el-run-package-upgrade-all) (define-key map (kbd "C-c @") 'helm-el-run-visit-homepage) - (define-key map (kbd "C-c ?") 'helm-el-package-help) map)) (defvar helm-source-list-el-package nil) @@ -314,14 +320,19 @@ (append actions '(("Upgrade all packages" . helm-el-package-upgrade-all-action))) actions))) - (cond ((cdr (assq (package-desc-name pkg-desc) + (cond ((and (package-installed-p (package-desc-name pkg-desc)) + (cdr (assq (package-desc-name pkg-desc) + helm-el-package--upgrades))) + (append '(("Upgrade package(s)" . helm-el-package-upgrade) + ("Uninstall package(s)" . helm-el-package-uninstall)) acts)) + ((cdr (assq (package-desc-name pkg-desc) helm-el-package--upgrades)) (append '(("Upgrade package(s)" . helm-el-package-upgrade)) acts)) ((package-installed-p (package-desc-name pkg-desc)) (append acts '(("Reinstall package(s)" . helm-el-package-reinstall) ("Uninstall package(s)" . helm-el-package-uninstall)))) (t (append acts '(("Install packages(s)" . helm-el-package-install)))))))) - (mode-line :initform helm-el-package-mode-line) + (help-message :initform 'helm-el-package-help-message) (keymap :initform helm-el-package-map) (update :initform 'helm-el-package--update) (candidate-number-limit :initform 9999) @@ -343,7 +354,7 @@ (defun helm-el-run-package-reinstall () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-el-package-reinstall))) + (helm-exit-and-execute-action 'helm-el-package-reinstall))) ;;;###autoload (defun helm-list-elisp-packages (arg) diff --git a/elpa/helm-20150704.1247/helm-elisp.el b/elpa/helm-20160105.2046/helm-elisp.el similarity index 80% rename from elpa/helm-20150704.1247/helm-elisp.el rename to elpa/helm-20160105.2046/helm-elisp.el index 156b879f..b2f40b43 100644 --- a/elpa/helm-20150704.1247/helm-elisp.el +++ b/elpa/helm-20160105.2046/helm-elisp.el @@ -18,13 +18,21 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-help) +(require 'helm-types) (require 'helm-utils) (require 'helm-info) (require 'helm-eval) (require 'helm-files) (require 'advice) +(declare-function 'helm-describe-function "helm-lib") +(declare-function 'helm-describe-variable "helm-lib") +(declare-function 'helm-describe-face "helm-lib") + +;;; Customizable values + (defgroup helm-elisp nil "Elisp related Applications and libraries for Helm." :group 'helm) @@ -35,7 +43,7 @@ :type 'boolean) (defcustom helm-show-completion-use-special-display t - "A special display will be used in lisp completion if non--nil. + "A special display will be used in Lisp completion if non--nil. All functions that are wrapped in macro `with-helm-show-completion' will be affected." :group 'helm-elisp @@ -108,8 +116,8 @@ fuzzy completion is not available in `completion-at-point'." :group 'helm-elisp-faces) (defcustom helm-elisp-help-function - 'helm-elisp-show-doc-modeline - "Function for displaying help for lisp symbols." + 'helm-elisp-show-help + "Function for displaying help for Lisp symbols." :group 'helm-elisp :type '(choice (function :tag "Open help for the symbol." helm-elisp-show-help) @@ -293,7 +301,7 @@ Return a cons \(beg . end\)." :persistent-action 'helm-lisp-completion-persistent-action :nomark t :fuzzy-match helm-lisp-fuzzy-completion - :persistent-help "Show brief doc in mode-line" + :persistent-help (helm-lisp-completion-persistent-help) :filtered-candidate-transformer 'helm-lisp-completion-transformer :action `(lambda (candidate) @@ -309,28 +317,46 @@ Return a cons \(beg . end\)." :allow-nest t)) (message "[No Match]")))) -(defun helm-lisp-completion-persistent-action (candidate) +(defun helm-lisp-completion-persistent-action (candidate &optional name) "Show documentation for the function. Documentation is shown briefly in mode-line or completely in other window according to the value of `helm-elisp-help-function'." - (funcall helm-elisp-help-function candidate)) + (funcall helm-elisp-help-function candidate name)) + +(defun helm-lisp-completion-persistent-help () + "Return persistent-help according to the value of `helm-elisp-help-function'" + (cl-ecase helm-elisp-help-function + (helm-elisp-show-doc-modeline "Show brief doc in mode-line") + (helm-elisp-show-help "Toggle show help for the symbol"))) -(defun helm-elisp-show-help (candidate) - "Show full help for the function." +(defun helm-elisp--show-help-1 (candidate &optional name) (let ((sym (intern-soft candidate))) (cl-typecase sym - (fbound (describe-function sym)) - (bound (describe-variable sym)) - (face (describe-face sym))))) - -(defun helm-elisp-show-doc-modeline (candidate) + ((and fboundp boundp) + (if (member name '("describe-function" "describe-variable")) + (funcall (intern (format "helm-%s" name)) sym) + ;; When there is no way to know what to describe + ;; prefer describe-function. + (helm-describe-function sym))) + (fboundp (helm-describe-function sym)) + (bound (helm-describe-variable sym)) + (face (helm-describe-face sym))))) + +(defun helm-elisp-show-help (candidate &optional name) + "Show full help for the function CANDIDATE. +Arg NAME specify the name of the top level function +calling helm generic completion (e.g \"describe-function\")." + (helm-elisp--persistent-help + candidate 'helm-elisp--show-help-1 name)) + +(defun helm-elisp-show-doc-modeline (candidate &optional name) "Show brief documentation for the function in modeline." (let ((cursor-in-echo-area t) mode-line-in-non-selected-windows) (helm-show-info-in-mode-line (propertize (helm-get-first-line-documentation - (intern candidate)) + (intern candidate) name) 'face 'helm-lisp-completion-info)))) (defun helm-lisp-completion-transformer (candidates _source) @@ -348,13 +374,19 @@ in other window according to the value of `helm-elisp-help-function'." collect (cons (concat c spaces annot) c) into lst finally return (sort lst #'helm-generic-sort-fn))) -(defun helm-get-first-line-documentation (sym) +(defun helm-get-first-line-documentation (sym &optional name) "Return first line documentation of symbol SYM. If SYM is not documented, return \"Not documented\"." (let ((doc (cl-typecase sym - (fbound (documentation sym t)) - (bound (documentation-property sym 'variable-documentation t)) - (face (face-documentation sym))))) + ((and fboundp boundp) + (cond ((string= name "describe-function") + (documentation sym t)) + ((string= name "describe-variable") + (documentation-property sym 'variable-documentation t)) + (t (documentation sym t)))) + (fbound (documentation sym t)) + (bound (documentation-property sym 'variable-documentation t)) + (face (face-documentation sym))))) (if (and doc (not (string= doc "")) ;; `documentation' return "\n\n(args...)" ;; for CL-style functions. @@ -463,12 +495,34 @@ Filename completion happen if string start after or between a double quote." :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) 'helm-apropos-default-sort-fn) :nomark t - :action '(("Describe Variable" . helm-describe-variable) - ("Find Variable" . helm-find-variable) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-variable)) + :persistent-help "Describe variable" + :action '(("Describe variable" . helm-describe-variable) + ("Find variable" . helm-find-variable) ("Info lookup" . helm-info-lookup-symbol) - ("Set variable" . helm-set-variable)))) + ("Set variable" . helm-set-variable)) + :action-transformer + (lambda (actions candidate) + (let ((sym (helm-symbolify candidate))) + (if (custom-variable-p sym) + (append + actions + (let ((standard-value (eval (car (get sym 'standard-value))))) + (unless (equal standard-value (symbol-value sym)) + `(("Reset Variable to default value" . + ,(lambda (candidate) + (let ((sym (helm-symbolify candidate))) + (set sym standard-value))))))) + '(("Customize variable" . + (lambda (candidate) + (customize-option (helm-symbolify candidate)))))) + actions))))) (defun helm-def-source--emacs-faces (&optional default) + "Create `helm' source for faces to be displayed with +`helm-apropos'." (helm-build-in-buffer-source "Faces" :init (lambda () (helm-apropos-init-faces default)) :fuzzy-match helm-apropos-fuzzy-match @@ -479,22 +533,33 @@ Filename completion happen if string start after or between a double quote." (lambda (candidates _source) (cl-loop for c in candidates collect (propertize c 'face (intern c)))))) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-face)) + :persistent-help "Describe face" :nomark t - :action (lambda (candidate) - (describe-face (intern candidate))))) + :action '(("Describe face" . helm-describe-face) + ("Find face" . helm-find-face-definition) + ("Customize face" . (lambda (candidate) + (customize-face (helm-symbolify candidate))))))) (defun helm-def-source--helm-attributes (&optional _default) - (helm-build-sync-source "Helm attributes" - :candidates (lambda () - (mapcar 'symbol-name helm-attributes)) - :fuzzy-match helm-apropos-fuzzy-match - :nomark t - :action (lambda (candidate) - (let (special-display-buffer-names - special-display-regexps - helm-persistent-action-use-special-display) - (with-output-to-temp-buffer "*Help*" - (princ (get (intern candidate) 'helm-attrdoc))))))) + (let ((def-act (lambda (candidate) + (let (special-display-buffer-names + special-display-regexps + helm-persistent-action-use-special-display) + (with-output-to-temp-buffer "*Help*" + (princ (get (intern candidate) 'helm-attrdoc))))))) + (helm-build-sync-source "Helm attributes" + :candidates (lambda () + (mapcar 'symbol-name helm-attributes)) + :fuzzy-match helm-apropos-fuzzy-match + :nomark t + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate def-act)) + :persistent-help "Describe helm attribute" + :action def-act))) (defun helm-def-source--emacs-commands (&optional default) (helm-build-in-buffer-source "Commands" @@ -504,14 +569,18 @@ Filename completion happen if string start after or between a double quote." :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) 'helm-apropos-default-sort-fn) :nomark t - :action '(("Describe Function" . helm-describe-function) - ("Find Function" . helm-find-function) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) + :persistent-help "Describe command" + :action '(("Describe function" . helm-describe-function) + ("Find function" . helm-find-function) ("Info lookup" . helm-info-lookup-symbol)))) (defun helm-def-source--emacs-functions (&optional default) (helm-build-in-buffer-source "Functions" :init `(lambda () - (helm-apropos-init #'(lambda (x) + (helm-apropos-init (lambda (x) (and (fboundp x) (not (commandp x)) (not (generic-p x)) @@ -520,37 +589,49 @@ Filename completion happen if string start after or between a double quote." :fuzzy-match helm-apropos-fuzzy-match :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) 'helm-apropos-default-sort-fn) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) + :persistent-help "Describe function" :nomark t - :action '(("Describe Function" . helm-describe-function) - ("Find Function" . helm-find-function) + :action '(("Describe function" . helm-describe-function) + ("Find function" . helm-find-function) ("Info lookup" . helm-info-lookup-symbol)))) (defun helm-def-source--eieio-classes (&optional default) (helm-build-in-buffer-source "Classes" :init `(lambda () - (helm-apropos-init #'(lambda (x) + (helm-apropos-init (lambda (x) (class-p x)) ,default)) :fuzzy-match helm-apropos-fuzzy-match :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) 'helm-apropos-default-sort-fn) :nomark t - :action '(("Describe Function" . helm-describe-function) - ("Find Function" . helm-find-function) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) + :persistent-help "Describe class" + :action '(("Describe function" . helm-describe-function) + ("Find function" . helm-find-function) ("Info lookup" . helm-info-lookup-symbol)))) (defun helm-def-source--eieio-generic (&optional default) (helm-build-in-buffer-source "Generic functions" :init `(lambda () - (helm-apropos-init #'(lambda (x) - (generic-p x)) + (helm-apropos-init (lambda (x) + (generic-p x)) ,default)) :fuzzy-match helm-apropos-fuzzy-match :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) 'helm-apropos-default-sort-fn) :nomark t - :action '(("Describe Function" . helm-describe-function) - ("Find Function" . helm-find-function) + :persistent-action (lambda (candidate) + (helm-elisp--persistent-help + candidate 'helm-describe-function)) + :persistent-help "Describe generic function" + :action '(("Describe function" . helm-describe-function) + ("Find function" . helm-find-function) ("Info lookup" . helm-info-lookup-symbol)))) (defun helm-info-lookup-symbol-1 (c) @@ -568,6 +649,23 @@ Filename completion happen if string start after or between a double quote." (defun helm-info-lookup-symbol (candidate) (run-with-timer 0.01 nil #'helm-info-lookup-symbol-1 candidate)) +(defun helm-elisp--persistent-help (candidate fun &optional name) + (let ((hbuf (get-buffer (help-buffer)))) + (if (and (helm-attr 'help-running-p) + (string= candidate (helm-attr 'help-current-symbol)) + (null helm-persistent-action-use-special-display)) + (progn + ;; When started from a help buffer, + ;; Don't kill this buffer as it is helm-current-buffer. + (unless (equal hbuf helm-current-buffer) + (kill-buffer hbuf) + (set-window-buffer (get-buffer-window hbuf) + helm-current-buffer)) + (helm-attrset 'help-running-p nil)) + (if name (funcall fun candidate name) (funcall fun candidate)) + (helm-attrset 'help-running-p t)) + (helm-attrset 'help-current-symbol candidate))) + ;;;###autoload (defun helm-apropos () "Preconfigured helm to describe commands, functions, variables and faces." @@ -683,13 +781,12 @@ Filename completion happen if string start after or between a double quote." ;; (defclass helm-absolute-time-timers-class (helm-source-sync helm-type-timers) ((candidates :initform timer-list) - (filtered-candidate-transformer + (allow-dups :initform t) + (candidate-transformer :initform - (lambda (candidates _source) + (lambda (candidates) (cl-loop for timer in candidates - collect (cons (helm-elisp--format-timer timer) timer)))) - (allow-dups :initform t) - (volatile :initform t))) + collect (cons (helm-elisp--format-timer timer) timer)))))) (defvar helm-source-absolute-time-timers (helm-make-source "Absolute Time Timers" 'helm-absolute-time-timers-class)) @@ -697,10 +794,9 @@ Filename completion happen if string start after or between a double quote." (defclass helm-idle-time-timers-class (helm-source-sync helm-type-timers) ((candidates :initform timer-idle-list) (allow-dups :initform t) - (volatile :initform t) - (filtered-candidate-transformer + (candidate-transformer :initform - (lambda (candidates _source) + (lambda (candidates) (cl-loop for timer in candidates collect (cons (helm-elisp--format-timer timer) timer)))))) @@ -734,7 +830,7 @@ Filename completion happen if string start after or between a double quote." (defun helm-btf--usable-p () "Return t if current version of `backtrace-frame' accept 2 arguments." (condition-case nil - (and (backtrace-frame 1 'condition-case) t) + (progn (backtrace-frame 1 'condition-case) t) (wrong-number-of-arguments nil))) (if (helm-btf--usable-p) ; Check if BTF accept more than one arg. @@ -785,11 +881,8 @@ Filename completion happen if string start after or between a double quote." (and (boundp 'helm-sexp--last-sexp) (setq helm-sexp--last-sexp candidate)) (run-with-timer 0.1 nil #'helm-sexp-eval candidate)) - "Edit and eval" - (lambda (cand) - (minibuffer-with-setup-hook - (lambda () (insert cand)) - (call-interactively #'eval-expression)))) + "Edit and eval" (lambda (candidate) + (edit-and-eval-command "Eval: " (read candidate)))) :persistent-action #'helm-sexp-eval)) ;;;###autoload diff --git a/elpa/helm-20150704.1247/helm-elscreen.el b/elpa/helm-20160105.2046/helm-elscreen.el similarity index 53% rename from elpa/helm-20150704.1247/helm-elscreen.el rename to elpa/helm-20160105.2046/helm-elscreen.el index 178d37fe..ea16b0df 100644 --- a/elpa/helm-20150704.1247/helm-elscreen.el +++ b/elpa/helm-20160105.2046/helm-elscreen.el @@ -22,6 +22,7 @@ (declare-function elscreen-find-screen-by-buffer "ext:elscreen.el" (buffer &optional create)) (declare-function elscreen-find-file "ext:elscreen.el" (filename)) (declare-function elscreen-goto "ext:elscreen.el" (screen)) +(declare-function elscreen-get-conf-list "ext:elscreen.el" (type)) (defun helm-find-buffer-on-elscreen (candidate) "Open buffer in new screen, if marked buffers open all in elscreens." @@ -39,34 +40,56 @@ (helm-require-or-error 'elscreen 'helm-elscreen-find-file) (elscreen-find-file file)) -(defvar helm-source-elscreen - '((name . "Elscreen") - (candidates - . (lambda () - (if (cdr (elscreen-get-screen-to-name-alist)) - (sort - (cl-loop for sname in (elscreen-get-screen-to-name-alist) - append (list (format "[%d] %s" (car sname) (cdr sname)))) - #'(lambda (a b) (compare-strings a nil nil b nil nil)))))) - (action - . (("Change Screen" . - (lambda (candidate) - (elscreen-goto (- (aref candidate 1) (aref "0" 0))))) - ("Kill Screen(s)" . - (lambda (candidate) - (cl-dolist (i (helm-marked-candidates)) - (elscreen-goto (- (aref i 1) (aref "0" 0))) - (elscreen-kill)))) - ("Only Screen" . - (lambda (candidate) - (elscreen-goto (- (aref candidate 1) (aref "0" 0))) - (elscreen-kill-others))))))) +(defclass helm-source-elscreen (helm-source-sync) + ((candidates + :initform + (lambda () + (when (cdr (elscreen-get-screen-to-name-alist)) + (cl-sort (cl-loop for (screen . name) in (elscreen-get-screen-to-name-alist) + collect (cons (format "[%d] %s" screen name) screen)) + #'< :key #'cdr)))) + (action :initform + '(("Change Screen" . + (lambda (candidate) + (elscreen-goto candidate))) + ("Kill Screen(s)" . + (lambda (_) + (cl-dolist (i (helm-marked-candidates)) + (elscreen-goto i) + (elscreen-kill)))) + ("Only Screen" . + (lambda (candidate) + (elscreen-goto candidate) + (elscreen-kill-others))))) + (migemo :initform t))) + +(defclass helm-source-elscreen-history (helm-source-elscreen) + ((candidates + :initform + (lambda () + (let ((sname (elscreen-get-screen-to-name-alist))) + (when (cdr sname) + (cl-loop for screen in (cdr (elscreen-get-conf-list 'screen-history)) + collect (cons (format "[%d] %s" screen (cdr (assq screen sname))) + screen)))))))) + +(defvar helm-source-elscreen-list + (helm-make-source "ElScreen" 'helm-source-elscreen)) + +(defvar helm-source-elscreen-history-list + (helm-make-source "ElScreen History" 'helm-source-elscreen-history)) ;;;###autoload (defun helm-elscreen () "Preconfigured helm to list elscreen." (interactive) - (helm-other-buffer 'helm-source-elscreen "*Helm Elscreen*")) + (helm-other-buffer 'helm-source-elscreen-list "*Helm ElScreen*")) + +;;;###autoload +(defun helm-elscreen-history () + "Preconfigured helm to list elscreen in history order." + (interactive) + (helm-other-buffer 'helm-source-elscreen-history-list "*Helm ElScreen*")) (provide 'helm-elscreen) diff --git a/elpa/helm-20150704.1247/helm-eshell.el b/elpa/helm-20160105.2046/helm-eshell.el similarity index 85% rename from elpa/helm-20150704.1247/helm-eshell.el rename to elpa/helm-20160105.2046/helm-eshell.el index 2b0deed9..aa613294 100644 --- a/elpa/helm-20150704.1247/helm-eshell.el +++ b/elpa/helm-20160105.2046/helm-eshell.el @@ -15,25 +15,41 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -;; Enable like this in .emacs: +;;; Commentary: ;; +;; Enable like this in .emacs: ;; (add-hook 'eshell-mode-hook -;; #'(lambda () -;; (define-key eshell-mode-map [remap pcomplete] 'helm-esh-pcomplete))) -;; +;; (lambda () +;; (eshell-cmpl-initialize) +;; (define-key eshell-mode-map [remap pcomplete] 'helm-esh-pcomplete) +;; (define-key eshell-mode-map (kbd "M-p") 'helm-eshell-history))) + ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-lib) +(require 'helm-help) (require 'helm-elisp) -(require 'helm-regexp) (declare-function eshell-read-aliases-list "em-alias") (declare-function eshell-send-input "esh-mode" (&optional use-region queue-p no-newline)) (declare-function eshell-bol "esh-mode") (declare-function eshell-parse-arguments "esh-arg" (beg end)) (declare-function eshell-backward-argument "esh-mode" (&optional arg)) +(declare-function helm-quote-whitespace "helm-lib") + + +(defgroup helm-eshell nil + "Helm eshell completion and history." + :group 'helm) +(defcustom helm-eshell-hist-ignoredups nil + "Same as `eshell-hist-ignoredups' which see but for helm." + :group 'helm-eshell + :type 'boolean) + + (defvar helm-eshell-history-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) @@ -48,6 +64,7 @@ map) "Keymap for `helm-esh-pcomplete'.") + (defclass helm-esh-source (helm-source-sync) ((init :initform (lambda () (setq pcomplete-current-completions nil @@ -145,18 +162,19 @@ The function that call this should set `helm-ec-target' to thing at point." ;; Entry should not be here now but double check. (remove entry ls)) ls)))))) - + ;;; Eshell history. ;; ;; (defclass helm-eshell-history-source (helm-source-in-buffer) - ((init :initform (lambda () - (let (eshell-hist-ignoredups) - (eshell-write-history eshell-history-file-name t) - (with-current-buffer (helm-candidate-buffer 'global) - (insert-file-contents eshell-history-file-name))) - ;; Same comment as in `helm-source-esh' - (remove-hook 'minibuffer-setup-hook 'eshell-mode))) + ((init :initform + (lambda () + (let ((eshell-hist-ignoredups helm-eshell-hist-ignoredups)) + (eshell-write-history eshell-history-file-name t) + (with-current-buffer (helm-candidate-buffer 'global) + (insert-file-contents eshell-history-file-name))) + ;; Same comment as in `helm-source-esh' + (remove-hook 'minibuffer-setup-hook 'eshell-mode))) (nomark :initform t) (keymap :initform helm-eshell-history-map) (filtered-candidate-transformer :initform (lambda (candidates sources) @@ -167,6 +185,7 @@ The function that call this should set `helm-ec-target' to thing at point." (insert candidate)))) "Helm class to define source for Eshell history.") + ;;;###autoload (defun helm-esh-pcomplete () "Preconfigured helm to provide helm completion in eshell." @@ -184,14 +203,15 @@ The function that call this should set `helm-ec-target' to thing at point." (eshell-backward-argument 1) (point)) end))) (first (car args)) ; Maybe lisp delimiter "(". - last) ; Will be the last but parsed by pcomplete. + last ; Will be the last but parsed by pcomplete. + del-space) (setq helm-ec-target (or target " ") end (point) ;; Reset beg for `with-helm-show-completion'. beg (or (and target (not (string= target " ")) (- end (length target))) ;; Nothing at point. - (progn (insert " ") (point)))) + (progn (insert " ") (setq del-space t) (point)))) (cond ((eq first ?\() (helm-lisp-completion-or-file-name-at-point)) ;; In eshell `pcomplete-parse-arguments' is called @@ -205,12 +225,14 @@ The function that call this should set `helm-ec-target' to thing at point." (car (last (ignore-errors (pcomplete-parse-arguments)))))) (with-helm-show-completion beg end - (helm :sources (helm-make-source "Eshell completions" 'helm-esh-source) - :buffer "*helm pcomplete*" - :keymap helm-esh-completion-map - :resume 'noresume - :input (and (stringp last) - (helm-ff-set-pattern last)))))))) + (or (helm :sources (helm-make-source "Eshell completions" 'helm-esh-source) + :buffer "*helm pcomplete*" + :keymap helm-esh-completion-map + :resume 'noresume + :input (and (stringp last) + (helm-ff-set-pattern last))) + (and del-space (looking-back "\\s-" (1- (point))) + (delete-char -1)))))))) ;;;###autoload (defun helm-eshell-history () diff --git a/elpa/helm-20150704.1247/helm-eval.el b/elpa/helm-20160105.2046/helm-eval.el similarity index 91% rename from elpa/helm-20150704.1247/helm-eval.el rename to elpa/helm-20160105.2046/helm-eval.el index 175a2673..6f30435a 100644 --- a/elpa/helm-20150704.1247/helm-eval.el +++ b/elpa/helm-20160105.2046/helm-eval.el @@ -18,6 +18,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'eldoc) (require 'edebug) @@ -98,9 +99,11 @@ Should take one arg: the string to display." :action '(("Copy result to kill-ring" . (lambda (candidate) (kill-new (replace-regexp-in-string - "\n" "" candidate)))) + "\n" "" candidate)) + (message "Result copied to kill-ring"))) ("copy sexp to kill-ring" . (lambda (_candidate) - (kill-new helm-input)))))) + (kill-new helm-input) + (message "Sexp copied to kill-ring")))))) (defun helm-eval-new-line-and-indent () (interactive) @@ -148,7 +151,13 @@ Should take one arg: the string to display." (calc-eval helm-pattern) (error "error")))) :nohighlight t - :action '(("Copy result to kill-ring" . kill-new)))) + :action '(("Copy result to kill-ring" . (lambda (candidate) + (kill-new candidate) + (message "Result \"%s\" copied to kill-ring" + candidate))) + ("Copy operation to kill-ring" . (lambda (_candidate) + (kill-new helm-input) + (message "Calculation copied to kill-ring")))))) ;;;###autoload (defun helm-eval-expression (arg) diff --git a/elpa/helm-20150704.1247/helm-external.el b/elpa/helm-20160105.2046/helm-external.el similarity index 99% rename from elpa/helm-20150704.1247/helm-external.el rename to elpa/helm-20160105.2046/helm-external.el index 28298e3a..693e1c45 100644 --- a/elpa/helm-20150704.1247/helm-external.el +++ b/elpa/helm-20160105.2046/helm-external.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'helm-net) @@ -104,7 +105,7 @@ In this case EXE must be provided as \"EXE %s\"." (start-process-shell-command proc nil real-com)) (set-process-sentinel (get-process proc) - #'(lambda (process event) + (lambda (process event) (when (and (string= event "finished\n") helm-raise-command (not (helm-get-pid-from-process-name real-com))) diff --git a/elpa/helm-20150704.1247/helm-files.el b/elpa/helm-20160105.2046/helm-files.el similarity index 84% rename from elpa/helm-20150704.1247/helm-files.el rename to elpa/helm-20160105.2046/helm-files.el index 71ba3180..48f38117 100644 --- a/elpa/helm-20150704.1247/helm-files.el +++ b/elpa/helm-20160105.2046/helm-files.el @@ -19,10 +19,10 @@ (require 'cl-lib) (require 'helm) +(require 'helm-types) (require 'helm-utils) (require 'helm-external) (require 'helm-grep) -(require 'helm-match-plugin) (require 'helm-help) (require 'helm-locate) (require 'helm-bookmark) @@ -51,15 +51,7 @@ (declare-function helm-ls-svn-ls "ext:helm-ls-svn") (defvar recentf-list) - - -;;; Type attributes -;; -;; -(define-helm-type-attribute 'file - (helm-build-type-file) - "File name.") - +(defvar helm-mm-matching-method) (defgroup helm-files nil @@ -117,8 +109,8 @@ and `helm-read-file-map' for this take effect." :group 'helm-files :type 'integer) -(defcustom helm-ff-smart-completion t - "Try to complete filenames smarter when non--nil. +(defcustom helm-ff-fuzzy-matching t + "Enable fuzzy matching for `helm-find-files' when non--nil. See `helm-ff--transform-pattern-for-completion' for more info." :group 'helm-files :type 'boolean) @@ -203,6 +195,11 @@ i.e `helm-read-file-name'." :group 'helm-files :type 'boolean) +(defcustom helm-ff-candidate-number-limit 5000 + "The `helm-candidate-number-limit' for `helm-find-files', `read-file-name' and friends." + :group 'helm-files + :type 'integer) + (defcustom helm-findutils-skip-boring-files t "Ignore files matching regexps in `completion-ignored-extensions'." :group 'helm-files @@ -240,6 +237,20 @@ I.e use the -path/ipath arguments of find instead of -name/iname." "bookmark name prefix of `helm-find-files' sessions." :group 'helm-files :type 'string) + +(defcustom helm-ff-guess-ffap-filenames nil + "Use ffap to guess local filenames at point in `helm-find-files'. +This doesn't disable url or mail at point, see +`helm-ff-guess-ffap-urls' for this." + :group 'helm-files + :type 'boolean) + +(defcustom helm-ff-guess-ffap-urls t + "Use ffap to guess local urls at point in `helm-find-files'. +This doesn't disable guessing filenames at point, +see `helm-ff-guess-ffap-filenames' for this." + :group 'helm-files + :type 'boolean) ;;; Faces ;; @@ -270,6 +281,11 @@ I.e use the -path/ipath arguments of find instead of -name/iname." "Face used for dotted directories in `helm-find-files'." :group 'helm-files-faces) +(defface helm-ff-dotted-symlink-directory + '((t (:foreground "DarkOrange" :background "DimGray"))) + "Face used for dotted symlinked directories in `helm-find-files'." + :group 'helm-files-faces) + (defface helm-ff-symlink '((t (:foreground "DarkOrange"))) "Face used for symlinks in `helm-find-files'." @@ -311,6 +327,8 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (define-key map (kbd "M-g s") 'helm-ff-run-grep) (define-key map (kbd "M-g p") 'helm-ff-run-pdfgrep) (define-key map (kbd "M-g z") 'helm-ff-run-zgrep) + (define-key map (kbd "M-g a") 'helm-ff-run-grep-ag) + (define-key map (kbd "M-g g") 'helm-ff-run-git-grep) (define-key map (kbd "C-c g") 'helm-ff-run-gid) (define-key map (kbd "M-.") 'helm-ff-run-etags) (define-key map (kbd "M-R") 'helm-ff-run-rename-file) @@ -335,7 +353,6 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (define-key map (kbd "M-p") 'helm-ff-run-switch-to-history) (define-key map (kbd "C-c h") 'helm-ff-file-name-history) (define-key map (kbd "M-i") 'helm-ff-properties-persistent) - (define-key map (kbd "C-c ?") 'helm-ff-help) (define-key map (kbd "C-}") 'helm-narrow-window) (define-key map (kbd "C-{") 'helm-enlarge-window) (define-key map (kbd "C-") 'helm-ff-run-toggle-auto-update) @@ -347,7 +364,9 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (define-key map (kbd "M-l") 'helm-ff-rotate-left-persistent) (define-key map (kbd "M-r") 'helm-ff-rotate-right-persistent) (define-key map (kbd "C-l") 'helm-find-files-up-one-level) + (define-key map (kbd "C-r") 'helm-find-files-down-last-level) (define-key map (kbd "C-c r") 'helm-ff-run-find-file-as-root) + (define-key map (kbd "C-x C-v") 'helm-ff-run-find-alternate-file) (define-key map (kbd "C-c @") 'helm-ff-run-insert-org-link) (helm-define-key-with-subkeys map (kbd "DEL") ?\d 'helm-ff-delete-char-backward nil nil 'helm-ff-delete-char-backward--exit-fn) @@ -365,10 +384,10 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (define-key map (kbd "C-]") 'helm-ff-run-toggle-basename) (define-key map (kbd "C-.") 'helm-find-files-up-one-level) (define-key map (kbd "C-l") 'helm-find-files-up-one-level) + (define-key map (kbd "C-r") 'helm-find-files-down-last-level) (define-key map (kbd "C-c h") 'helm-ff-file-name-history) (define-key map (kbd "C-") 'helm-ff-run-toggle-auto-update) (define-key map (kbd "C-c ") 'helm-ff-run-toggle-auto-update) - (define-key map (kbd "C-c ?") 'helm-read-file-name-help) (helm-define-key-with-subkeys map (kbd "DEL") ?\d 'helm-ff-delete-char-backward nil nil 'helm-ff-delete-char-backward--exit-fn) (when helm-ff-lynx-style-map @@ -379,16 +398,9 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (delq nil map)) "Keymap for `helm-read-file-name'.") -(defvar helm-esh-on-file-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-esh-help) - map) - "Keymap for `helm-find-files-eshell-command-on-file'.") - ;; Internal. -(defvar helm-find-files-doc-header " (`C-l': Go up one level)" +(defvar helm-find-files-doc-header " (\\\\[helm-find-files-up-one-level]: Go up one level)" "*The doc that is inserted in the Name header of a find-files or dired source.") (defvar helm-ff-auto-update-flag nil "Internal, flag to turn on/off auto-update in `helm-find-files'. @@ -413,6 +425,56 @@ Don't set it directly, use instead `helm-ff-auto-update-initial-value'.") ;;; Helm-find-files ;; ;; +(defcustom helm-find-files-actions + (helm-make-actions + "Find File" 'helm-find-file-or-marked + "Find file in Dired" 'helm-point-file-in-dired + (lambda () (and (locate-library "elscreen") "Find file in Elscreen")) + 'helm-elscreen-find-file + "View file" 'view-file + "Checksum File" 'helm-ff-checksum + "Query replace fnames on marked" 'helm-ff-query-replace-on-marked + "Query replace contents on marked" 'helm-ff-query-replace + "Query replace regexp contents on marked" 'helm-ff-query-replace-regexp + "Serial rename files" 'helm-ff-serial-rename + "Serial rename by symlinking files" 'helm-ff-serial-rename-by-symlink + "Serial rename by copying files" 'helm-ff-serial-rename-by-copying + "Open file with default tool" 'helm-open-file-with-default-tool + "Find file in hex dump" 'hexl-find-file + "Browse project" 'helm-ff-browse-project + "Complete at point `C-c i'" 'helm-insert-file-name-completion-at-point + "Insert as org link `C-c @'" 'helm-files-insert-as-org-link + "Find shell command `C-c /'" 'helm-ff-find-sh-command + "Add marked files to file-cache" 'helm-ff-cache-add-file + "Open file externally `C-c C-x, C-u to choose'" 'helm-open-file-externally + "Grep File(s) `C-s, C-u Recurse'" 'helm-find-files-grep + "Grep current directory with AG" 'helm-find-files-ag + "Git grep" 'helm-ff-git-grep + "Zgrep File(s) `M-g z, C-u Recurse'" 'helm-ff-zgrep + "Gid" 'helm-ff-gid + "Switch to Eshell `M-e'" 'helm-ff-switch-to-eshell + "Etags `M-., C-u reload tag file'" 'helm-ff-etags-select + "Eshell command on file(s) `M-!, C-u take all marked as arguments.'" + 'helm-find-files-eshell-command-on-file + "Find file as root `C-c r'" 'helm-find-file-as-root + "Find alternate file" 'find-alternate-file + "Ediff File `C-='" 'helm-find-files-ediff-files + "Ediff Merge File `C-c ='" 'helm-find-files-ediff-merge-files + "Delete File(s) `M-D'" 'helm-delete-marked-files + "Copy file(s) `M-C, C-u to follow'" 'helm-find-files-copy + "Rename file(s) `M-R, C-u to follow'" 'helm-find-files-rename + "Symlink files(s) `M-S, C-u to follow'" 'helm-find-files-symlink + "Relsymlink file(s) `C-u to follow'" 'helm-find-files-relsymlink + "Hardlink file(s) `M-H, C-u to follow'" 'helm-find-files-hardlink + "Find file other window `C-c o'" 'helm-find-files-other-window + "Switch to history `M-p'" 'helm-find-files-switch-to-hist + "Find file other frame `C-c C-o'" 'find-file-other-frame + "Print File `C-c p, C-u to refresh'" 'helm-ff-print + "Locate `C-x C-f, C-u to specify locate db'" 'helm-ff-locate) + "Actions for `helm-find-files'." + :group 'helm-files + :type '(alist :key-type string :value-type function)) + (defvar helm-source-find-files nil "The main source to browse files. Should not be used among other sources.") @@ -420,7 +482,8 @@ Should not be used among other sources.") (defclass helm-source-ffiles (helm-source-sync) ((header-name :initform (lambda (name) - (concat name helm-find-files-doc-header))) + (concat name (substitute-command-keys + helm-find-files-doc-header)))) (init :initform (lambda () (setq helm-ff-auto-update-flag @@ -434,58 +497,15 @@ Should not be used among other sources.") (filter-one-by-one :initform 'helm-ff-filter-candidate-one-by-one) (persistent-action :initform 'helm-find-files-persistent-action) (persistent-help :initform "Hit1 Expand Candidate, Hit2 or (C-u) Find file") - (mode-line :initform helm-ff-mode-line-string) + (help-message :initform 'helm-ff-help-message) (volatile :initform t) + (migemo :initform t) (nohighlight :initform t) (keymap :initform helm-find-files-map) - (candidate-number-limit - :initform 9999) + (candidate-number-limit :initform 'helm-ff-candidate-number-limit) (action-transformer :initform 'helm-find-files-action-transformer) - (action - :initform - (helm-make-actions - "Find File" 'helm-find-file-or-marked - "Find file in Dired" 'helm-point-file-in-dired - (lambda () (and (locate-library "elscreen") "Find file in Elscreen")) - 'helm-elscreen-find-file - "View file" 'view-file - "Checksum File" 'helm-ff-checksum - "Query replace fnames on marked" 'helm-ff-query-replace-on-marked - "Query replace contents on marked" 'helm-ff-query-replace - "Query replace regexp contents on marked" 'helm-ff-query-replace-regexp - "Serial rename files" 'helm-ff-serial-rename - "Serial rename by symlinking files" 'helm-ff-serial-rename-by-symlink - "Serial rename by copying files" 'helm-ff-serial-rename-by-copying - "Open file with default tool" 'helm-open-file-with-default-tool - "Find file in hex dump" 'hexl-find-file - "Browse project" 'helm-ff-browse-project - "Complete at point `C-c i'" 'helm-insert-file-name-completion-at-point - "Insert as org link `C-c @'" 'helm-files-insert-as-org-link - "Find shell command `C-c /'" 'helm-ff-find-sh-command - "Add marked files to file-cache" 'helm-ff-cache-add-file - "Open file externally `C-c C-x, C-u to choose'" 'helm-open-file-externally - "Grep File(s) `C-s, C-u Recurse'" 'helm-find-files-grep - "Zgrep File(s) `M-g z, C-u Recurse'" 'helm-ff-zgrep - "Gid" 'helm-ff-gid - "Switch to Eshell `M-e'" 'helm-ff-switch-to-eshell - "Etags `M-., C-u reload tag file'" 'helm-ff-etags-select - "Eshell command on file(s) `M-!, C-u take all marked as arguments.'" - 'helm-find-files-eshell-command-on-file - "Find file as root `C-c r'" 'helm-find-file-as-root - "Ediff File `C-='" 'helm-find-files-ediff-files - "Ediff Merge File `C-c ='" 'helm-find-files-ediff-merge-files - "Delete File(s) `M-D'" 'helm-delete-marked-files - "Copy file(s) `M-C, C-u to follow'" 'helm-find-files-copy - "Rename file(s) `M-R, C-u to follow'" 'helm-find-files-rename - "Symlink files(s) `M-S, C-u to follow'" 'helm-find-files-symlink - "Relsymlink file(s) `C-u to follow'" 'helm-find-files-relsymlink - "Hardlink file(s) `M-H, C-u to follow'" 'helm-find-files-hardlink - "Find file other window `C-c o'" 'find-file-other-window - "Switch to history `M-p'" 'helm-find-files-switch-to-hist - "Find file other frame `C-c C-o'" 'find-file-other-frame - "Print File `C-c p, C-u to refresh'" 'helm-ff-print - "Locate `C-x C-f, C-u to specify locate db'" 'helm-ff-locate)) + (action :initform 'helm-find-files-actions) (before-init-hook :initform 'helm-find-files-before-init-hook) (after-init-hook :initform 'helm-find-files-after-init-hook))) @@ -551,7 +571,7 @@ ACTION must be an action supported by `helm-dired-action'." helm-ff-auto-update-initial-value (dest (with-helm-display-marked-candidates helm-marked-buffer-name - (mapcar #'(lambda (f) + (mapcar (lambda (f) (if (file-directory-p f) (concat (helm-basename f) "/") (helm-basename f))) @@ -587,6 +607,18 @@ ACTION must be an action supported by `helm-dired-action'." "Hardlink files from `helm-find-files'." (helm-find-files-do-action 'hardlink)) +(defun helm-find-files-other-window (_candidate) + "Keep current-buffer and open files in separate windows." + (let* ((files (helm-marked-candidates)) + (buffers (mapcar 'find-file-noselect files))) + (switch-to-buffer-other-window (car buffers)) + (helm-aif (cdr buffers) + (save-selected-window + (cl-loop for buffer in it + do (progn + (select-window (split-window)) + (switch-to-buffer buffer))))))) + (defun helm-find-files-byte-compile (_candidate) "Byte compile elisp files from `helm-find-files'." (let ((files (helm-marked-candidates :with-wildcard t)) @@ -628,10 +660,15 @@ ACTION must be an action supported by `helm-dired-action'." (defun helm-find-files-grep (_candidate) "Default action to grep files from `helm-find-files'." - (apply 'run-with-timer 0.01 nil - #'helm-do-grep-1 - (helm-marked-candidates :with-wildcard t) - helm-current-prefix-arg)) + (helm-do-grep-1 (helm-marked-candidates :with-wildcard t) + helm-current-prefix-arg)) + +(defun helm-ff-git-grep (_candidate) + "Default action to git-grep `helm-ff-default-directory'." + (helm-grep-git-1 helm-ff-default-directory helm-current-prefix-arg)) + +(defun helm-find-files-ag (_candidate) + (helm-grep-ag-1 helm-ff-default-directory)) (defun helm-ff-zgrep (_candidate) "Default action to zgrep files from `helm-find-files'." @@ -708,10 +745,10 @@ will not be loaded first time you use this." finally return (sort ls 'string<)) :buffer "*helm eshell on file*" :name "Eshell command" - :keymap helm-esh-on-file-map :mode-line '("Eshell alias" - "C-c ?: Help, \\[universal-argument]: Insert output at point") + "C-h m: Help, \\[universal-argument]: Insert output at point") + :help-message 'helm-esh-help-message :input-history 'helm-eshell-command-on-file-input-history)) (alias-value (car (assoc-default command eshell-command-aliases-list))) @@ -773,7 +810,7 @@ See `helm-find-files-eshell-command-on-file-1' for more info." (defun helm-ff-switch-to-eshell (_candidate) "Switch to eshell and cd to `helm-ff-default-directory'." - (let ((cd-eshell #'(lambda () + (let ((cd-eshell (lambda () (eshell-kill-input) (goto-char (point-max)) (insert @@ -900,6 +937,8 @@ See `helm-ff-serial-rename-1'." (helm-ff-serial-rename-action 'copy)) (defun helm-ff-query-replace-on-marked-1 (candidates) + "Query replace on filenames of CANDIDATES. +This doesn't replace inside the files, only modify filenames." (with-helm-display-marked-candidates helm-marked-buffer-name (mapcar 'helm-basename candidates) @@ -944,30 +983,33 @@ See `helm-ff-serial-rename-1'." ;; The action. (defun helm-ff-query-replace-on-marked (_candidate) (let ((marked (helm-marked-candidates))) - (helm-run-after-quit #'helm-ff-query-replace-on-marked-1 marked))) + (helm-ff-query-replace-on-marked-1 marked))) ;; The command for `helm-find-files-map'. (defun helm-ff-run-query-replace-on-marked () (interactive) - (helm-ff-query-replace-on-marked nil)) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-ff-query-replace-on-marked))) (defun helm-ff-query-replace (_candidate) (let ((bufs (cl-loop for f in (helm-marked-candidates) collect (buffer-name (find-file-noselect f))))) - (helm-run-after-quit #'helm-buffer-query-replace-1 nil bufs))) + (helm-buffer-query-replace-1 nil bufs))) (defun helm-ff-query-replace-regexp (_candidate) (let ((bufs (cl-loop for f in (helm-marked-candidates) collect (buffer-name (find-file-noselect f))))) - (helm-run-after-quit #'helm-buffer-query-replace-1 'regexp bufs))) + (helm-buffer-query-replace-1 'regexp bufs))) (defun helm-ff-run-query-replace () (interactive) - (helm-ff-query-replace nil)) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-ff-query-replace))) (defun helm-ff-run-query-replace-regexp () (interactive) - (helm-ff-query-replace-regexp nil)) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-ff-query-replace-regexp))) (defun helm-ff-toggle-auto-update (_candidate) (setq helm-ff-auto-update-flag (not helm-ff-auto-update-flag)) @@ -999,124 +1041,135 @@ See `helm-ff-serial-rename-1'." (interactive) (with-helm-alive-p (when (helm-file-completion-source-p) - (helm-quit-and-execute-action 'helm-find-files-switch-to-hist)))) + (helm-exit-and-execute-action 'helm-find-files-switch-to-hist)))) (defun helm-ff-run-grep () "Run Grep action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-grep))) + (helm-exit-and-execute-action 'helm-find-files-grep))) + +(defun helm-ff-run-git-grep () + "Run git-grep action from `helm-source-find-files'." + (interactive) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-ff-git-grep))) + +(defun helm-ff-run-grep-ag () + (interactive) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-find-files-ag))) (defun helm-ff-run-pdfgrep () "Run Pdfgrep action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-pdfgrep))) + (helm-exit-and-execute-action 'helm-ff-pdfgrep))) (defun helm-ff-run-zgrep () "Run Grep action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-zgrep))) + (helm-exit-and-execute-action 'helm-ff-zgrep))) (defun helm-ff-run-copy-file () "Run Copy file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-copy))) + (helm-exit-and-execute-action 'helm-find-files-copy))) (defun helm-ff-run-rename-file () "Run Rename file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-rename))) + (helm-exit-and-execute-action 'helm-find-files-rename))) (defun helm-ff-run-byte-compile-file () "Run Byte compile file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-byte-compile))) + (helm-exit-and-execute-action 'helm-find-files-byte-compile))) (defun helm-ff-run-load-file () "Run Load file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-load-files))) + (helm-exit-and-execute-action 'helm-find-files-load-files))) (defun helm-ff-run-eshell-command-on-file () "Run eshell command on file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action + (helm-exit-and-execute-action 'helm-find-files-eshell-command-on-file))) (defun helm-ff-run-ediff-file () "Run Ediff file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-ediff-files))) + (helm-exit-and-execute-action 'helm-find-files-ediff-files))) (defun helm-ff-run-ediff-merge-file () "Run Ediff merge file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action + (helm-exit-and-execute-action 'helm-find-files-ediff-merge-files))) (defun helm-ff-run-symlink-file () "Run Symlink file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-symlink))) + (helm-exit-and-execute-action 'helm-find-files-symlink))) (defun helm-ff-run-hardlink-file () "Run Hardlink file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-files-hardlink))) + (helm-exit-and-execute-action 'helm-find-files-hardlink))) (defun helm-ff-run-delete-file () "Run Delete file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-delete-marked-files))) + (helm-exit-and-execute-action 'helm-delete-marked-files))) (defun helm-ff-run-complete-fn-at-point () "Run complete file name action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action + (helm-exit-and-execute-action 'helm-insert-file-name-completion-at-point))) (defun helm-ff-run-switch-to-eshell () "Run switch to eshell action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-switch-to-eshell))) + (helm-exit-and-execute-action 'helm-ff-switch-to-eshell))) (defun helm-ff-run-switch-other-window () "Run switch to other window action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'find-file-other-window))) + (helm-exit-and-execute-action 'helm-find-files-other-window))) (defun helm-ff-run-switch-other-frame () "Run switch to other frame action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'find-file-other-frame))) + (helm-exit-and-execute-action 'find-file-other-frame))) (defun helm-ff-run-open-file-externally () "Run open file externally command action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-open-file-externally))) + (helm-exit-and-execute-action 'helm-open-file-externally))) (defun helm-ff-run-open-file-with-default-tool () "Run open file externally command action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-open-file-with-default-tool))) + (helm-exit-and-execute-action 'helm-open-file-with-default-tool))) (defun helm-ff-locate (candidate) "Locate action function for `helm-find-files'." @@ -1136,7 +1189,7 @@ See `helm-ff-serial-rename-1'." "Run locate action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-locate))) + (helm-exit-and-execute-action 'helm-ff-locate))) (defun helm-files-insert-as-org-link (candidate) (insert (format "[[%s][]]" candidate)) @@ -1145,24 +1198,29 @@ See `helm-ff-serial-rename-1'." (defun helm-ff-run-insert-org-link () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-files-insert-as-org-link))) + (helm-exit-and-execute-action 'helm-files-insert-as-org-link))) (defun helm-ff-run-find-file-as-root () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-find-file-as-root))) + (helm-exit-and-execute-action 'helm-find-file-as-root))) + +(defun helm-ff-run-find-alternate-file () + (interactive) + (with-helm-alive-p + (helm-exit-and-execute-action 'find-alternate-file))) (defun helm-ff-run-gnus-attach-files () "Run gnus attach files command action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-gnus-attach-files))) + (helm-exit-and-execute-action 'helm-ff-gnus-attach-files))) (defun helm-ff-run-etags () "Run Etags command action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-etags-select))) + (helm-exit-and-execute-action 'helm-ff-etags-select))) (defvar lpr-printer-switch) (defun helm-ff-print (_candidate) @@ -1207,7 +1265,7 @@ Same as `dired-do-print' but for helm." (list lpr-switches) lpr-switches)) " ")))) - (file-args (mapconcat #'(lambda (x) + (file-args (mapconcat (lambda (x) (format "'%s'" x)) file-list " ")) (cmd-line (concat command " " file-args))) @@ -1219,7 +1277,7 @@ Same as `dired-do-print' but for helm." "Run Print file action from `helm-source-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-print))) + (helm-exit-and-execute-action 'helm-ff-print))) (defun helm-ff-checksum (file) "Calculate the checksum of FILE. @@ -1273,22 +1331,8 @@ If EXPAND is non--nil expand-file-name." (t (concat "/" result))))))) -;; Internal -(defvar helm--file-completion-sources - '("Find Files" "Read File Name" "Read File Name History" - "Files from Current Directory") - "Sources that use the *find-files mechanism can be added here. -Sources generated by `helm-mode' don't need to be added here, it will -be done automatically. -You should not modify this yourself unless you know what you do.") - -(defun helm-file-completion-source-p () - "Return non--nil if current source is a file completion source." - (or minibuffer-completing-file-name - (let ((cur-source (cdr (assoc 'name (helm-get-current-source))))) - (cl-loop for i in helm--file-completion-sources - thereis (string= cur-source i))))) - +(defvar helm-find-files--level-tree nil) +(defvar helm-find-files--level-tree-iterator nil) (defun helm-find-files-up-one-level (arg) "Go up one level like unix command `cd ..'. If prefix numeric arg is given go ARG level up." @@ -1311,9 +1355,37 @@ If prefix numeric arg is given go ARG level up." (setq helm-ff-last-expanded helm-pattern)) ((and cur-cand (file-exists-p cur-cand)) (setq helm-ff-last-expanded cur-cand))) + (unless helm-find-files--level-tree + (setq helm-find-files--level-tree + (cons helm-ff-default-directory + helm-find-files--level-tree))) + (setq helm-find-files--level-tree-iterator nil) + (push new-pattern helm-find-files--level-tree) (helm-set-pattern new-pattern helm-suspend-update-flag) (with-helm-after-update-hook (helm-ff-retrieve-last-expanded)))))) +(defun helm-find-files-down-last-level () + "Retrieve previous paths reached by `C-l' in helm-find-files." + (interactive) + (with-helm-alive-p + (when (and (helm-file-completion-source-p) + (not (helm-ff-invalid-tramp-name-p))) + (unless helm-find-files--level-tree-iterator + (setq helm-find-files--level-tree-iterator + (helm-iter-list (cdr helm-find-files--level-tree)))) + (setq helm-find-files--level-tree nil) + (helm-aif (helm-iter-next helm-find-files--level-tree-iterator) + (helm-set-pattern it) + (setq helm-find-files--level-tree-iterator nil))))) + +(defun helm-find-files--reset-level-tree () + (setq helm-find-files--level-tree-iterator nil + helm-find-files--level-tree nil)) + +(add-hook 'helm-cleanup-hook 'helm-find-files--reset-level-tree) +(add-hook 'post-self-insert-hook 'helm-find-files--reset-level-tree) +(add-hook 'helm-after-persistent-action-hook 'helm-find-files--reset-level-tree) + (defun helm-ff-retrieve-last-expanded () "Move overlay to last visited directory `helm-ff-last-expanded'. This happen after using `helm-find-files-up-one-level', @@ -1334,7 +1406,7 @@ or hitting C-j on \"..\"." (helm-aif (and (helm-file-completion-source-p) (not (helm-empty-source-p)) (not (string-match - "\\`[Dd]ired" + "\\`[Dd]ired-" (assoc-default 'name (helm-get-current-source)))) helm-ff--move-to-first-real-candidate (helm-get-selection)) @@ -1354,68 +1426,81 @@ When only one candidate is remaining and it is a directory, expand to this directory. This happen only when `helm-ff-auto-update-flag' is non--nil or when `helm-pattern' is equal to \"~/\"." - (when (or (and helm-ff-auto-update-flag - (null helm-ff--deleting-char-backward) - (helm-file-completion-source-p) - ;; Issue #295 - ;; File predicates are returning t - ;; with paths like //home/foo. - ;; So check it is not the case by regexp - ;; to allow user to do C-a / to start e.g - ;; entering a tramp method e.g /sudo::. - (not (string-match "\\`//" helm-pattern)) - (not (helm-ff-invalid-tramp-name-p)) - (not (eq last-command 'helm-yank-text-at-point))) - ;; Fix issue #542. - (string= helm-pattern "~/")) - (let* ((history-p (string= (assoc-default - 'name (helm-get-current-source)) - "Read File Name History")) - (pat (if (string-match helm-tramp-file-name-regexp - helm-pattern) - (helm-create-tramp-name helm-pattern) - helm-pattern)) - (completed-p (string= (file-name-as-directory - (expand-file-name - (substitute-in-file-name pat))) - helm-ff-default-directory)) - (candnum (helm-get-candidate-number))) - (when (and (or - ;; Only one candidate remaining - ;; and at least 2 char in basename. - (and (<= candnum 2) - (>= (string-width (helm-basename helm-pattern)) 2)) - ;; Already completed. - completed-p) - (not history-p)) ; Don't try to auto complete in history. - (with-helm-window - (let ((cur-cand (prog2 - (unless (or completed-p (file-exists-p pat)) - ;; Only one non--existing candidate - ;; and one directory candidate, move to it. - (helm-next-line)) - (helm-get-selection)))) - (when (and (stringp cur-cand) - (file-accessible-directory-p cur-cand)) - (if (and (not (helm-dir-is-dot cur-cand)) ; [1] - ;; Maybe we are here because completed-p is true - ;; but check this again to be sure. (Windows fix) - (<= candnum 2)) ; [2] - ;; If after going to next line the candidate - ;; is not one of "." or ".." [1] - ;; and only one candidate is remaining [2], - ;; assume candidate is a new directory to expand, and do it. - (helm-set-pattern (file-name-as-directory cur-cand)) - ;; The candidate is one of "." or ".." - ;; that mean we have entered the last letter of the directory name - ;; in prompt, so expansion is already done, just add the "/" at end - ;; of name unless helm-pattern ends with "." - ;; (i.e we are writing something starting with ".") - (unless (string-match "\\`.*[.]\\{1\\}\\'" helm-pattern) - (helm-set-pattern - ;; Need to expand-file-name to avoid e.g /ssh:host:./ in prompt. - (expand-file-name (file-name-as-directory helm-pattern))))) - (helm-check-minibuffer-input)))))))) + (when (and (helm-file-completion-source-p) + (not (helm-ff-invalid-tramp-name-p))) + (with-helm-window + (let* ((history-p (string= (assoc-default + 'name (helm-get-current-source)) + "Read File Name History")) + (pat (if (string-match helm-tramp-file-name-regexp + helm-pattern) + (helm-create-tramp-name helm-pattern) + helm-pattern)) + (completed-p (string= (file-name-as-directory + (expand-file-name + (substitute-in-file-name pat))) + helm-ff-default-directory)) + (candnum (helm-get-candidate-number)) + (lt2-p (and (<= candnum 2) + (>= (string-width (helm-basename helm-pattern)) 2))) + (cur-cand (prog2 + (unless (or completed-p + (file-exists-p pat) + history-p (null lt2-p)) + ;; Only one non--existing candidate + ;; and one directory candidate, move to it, + ;; but not when renaming, copying etc..., + ;; so for this use + ;; `helm-ff-move-to-first-real-candidate' + ;; instead of `helm-next-line' (Issue #910). + (helm-ff-move-to-first-real-candidate)) + (helm-get-selection)))) + (when (and (or (and helm-ff-auto-update-flag + (null helm-ff--deleting-char-backward) + (not (get-buffer-window helm-action-buffer 'visible)) + ;; Issue #295 + ;; File predicates are returning t + ;; with paths like //home/foo. + ;; So check it is not the case by regexp + ;; to allow user to do C-a / to start e.g + ;; entering a tramp method e.g /sudo::. + (not (string-match "\\`//" helm-pattern)) + (not (eq last-command 'helm-yank-text-at-point))) + ;; Fix issue #542. + (string= helm-pattern "~/") + ;; Only one remaining directory, expand it. + (and (= candnum 1) + helm-ff--auto-update-state + (file-accessible-directory-p pat) + (null helm-ff--deleting-char-backward))) + (or + ;; Only one candidate remaining + ;; and at least 2 char in basename. + lt2-p + ;; Already completed. + completed-p) + (not history-p) ; Don't try to auto complete in history. + (stringp cur-cand) + (file-accessible-directory-p cur-cand)) + (if (and (not (helm-dir-is-dot cur-cand)) ; [1] + ;; Maybe we are here because completed-p is true + ;; but check this again to be sure. (Windows fix) + (<= candnum 2)) ; [2] + ;; If after going to next line the candidate + ;; is not one of "." or ".." [1] + ;; and only one candidate is remaining [2], + ;; assume candidate is a new directory to expand, and do it. + (helm-set-pattern (file-name-as-directory cur-cand)) + ;; The candidate is one of "." or ".." + ;; that mean we have entered the last letter of the directory name + ;; in prompt, so expansion is already done, just add the "/" at end + ;; of name unless helm-pattern ends with "." + ;; (i.e we are writing something starting with ".") + (unless (string-match "\\`.*[.]\\{1\\}\\'" helm-pattern) + (helm-set-pattern + ;; Need to expand-file-name to avoid e.g /ssh:host:./ in prompt. + (expand-file-name (file-name-as-directory helm-pattern))))) + (helm-check-minibuffer-input)))))) (defun helm-ff-auto-expand-to-home-or-root () "Allow expanding to home/user directory or root or text yanked after pattern." @@ -1566,16 +1651,6 @@ purpose." (string-match helm-tramp-file-name-regexp pattern) (member (match-string 1 pattern) methods)) "Invalid tramp file name") ; Write in helm-buffer. - ;; PATTERN is a directory, end it with "/". - ;; This will make PATTERN not ending yet with "/" - ;; candidate for `helm-ff-default-directory', - ;; allowing `helm-ff-retrieve-last-expanded' to retrieve it - ;; when descending level. - ;; However, we don't add automatically the "/" when - ;; `helm-ff-auto-update-flag' is enabled to avoid quick expansion. - ((and (file-accessible-directory-p pattern) - helm-ff-auto-update-flag) - (file-name-as-directory (expand-file-name pattern))) ;; Return PATTERN unchanged. (t pattern)))) @@ -1615,7 +1690,8 @@ purpose." (null helm-ff--auto-update-state) ;; But don't enable auto update when ;; deleting backward. - helm-ff--deleting-char-backward) + helm-ff--deleting-char-backward + (and dir-p (not (string-match-p "/\\'" path)))) (or (>= (length (helm-basename path)) 3) dir-p))) (setq helm-pattern (helm-ff--transform-pattern-for-completion path)) ;; This have to be set after [1] to allow deleting char backward. @@ -1706,18 +1782,18 @@ systems." if isbad concat (cdr isbad) else concat (string i))) -(defun helm-ff-smart-completion-p () - (and helm-ff-smart-completion - (not (memq helm-mp-matching-method '(multi1 multi3p))))) +(defun helm-ff-fuzzy-matching-p () + (and helm-ff-fuzzy-matching + (not (memq helm-mm-matching-method '(multi1 multi3p))))) (defun helm-ff--transform-pattern-for-completion (pattern) "Maybe return PATTERN with it's basename modified as a regexp. -This happen only when `helm-ff-smart-completion' is enabled. +This happen only when `helm-ff-fuzzy-matching' is enabled. This provide a similar behavior as `ido-enable-flex-matching'. See also `helm--mapconcat-pattern'. If PATTERN is an url returns it unmodified. -When PATTERN contain a space fallback to match-plugin. -If basename contain one or more space fallback to match-plugin. +When PATTERN contain a space fallback to multi-match. +If basename contain one or more space fallback to multi-match. If PATTERN is a valid directory name,return PATTERN unchanged." ;; handle bad filenames containing a backslash. (setq pattern (helm-ff-handle-backslash pattern)) @@ -1738,12 +1814,12 @@ If PATTERN is a valid directory name,return PATTERN unchanged." (and dir-p (string-match (regexp-quote bn) bd))) ;; Use full PATTERN on e.g "/ssh:host:". (regexp-quote pattern)) - ;; Prefixing BN with a space call match-plugin completion. + ;; Prefixing BN with a space call multi-match completion. ;; This allow showing all files/dirs matching BN (Issue #518). - ;; FIXME: some match-plugin methods may not work here. + ;; FIXME: some multi-match methods may not work here. (dir-p (concat (regexp-quote bd) " " (regexp-quote bn))) - ((or (not (helm-ff-smart-completion-p)) - (string-match "\\s-" bn)) ; Fall back to match-plugin. + ((or (not (helm-ff-fuzzy-matching-p)) + (string-match "\\s-" bn)) ; Fall back to multi-match. (concat (regexp-quote bd) bn)) ((or (string-match "[*][.]?.*" bn) ; Allow entering wilcard. (string-match "/$" pattern) ; Allow mkdir. @@ -1753,11 +1829,10 @@ If PATTERN is a valid directory name,return PATTERN unchanged." ;; (e.g ./foo/*.el => ./foo/[*].el) (concat (regexp-quote bd) (replace-regexp-in-string "[*]" "[*]" bn))) - (t - (setq bn (if (>= (length bn) 2) ; wait 2nd char before concating. - (helm--mapconcat-pattern bn) - (concat ".*" (regexp-quote bn)))) - (concat (regexp-quote bd) bn))))) + (t (concat (regexp-quote bd) + (if (>= (length bn) 2) ; wait 2nd char before concating. + (helm--mapconcat-pattern bn) + (concat ".*" (regexp-quote bn)))))))) (defun helm-dir-is-dot (dir) (string-match "\\(?:/\\|\\`\\)\\.\\{1,2\\}\\'" dir)) @@ -1873,12 +1948,14 @@ Note that only existing directories are saved here." (unwind-protect (save-selected-window (cl-loop for c in marked do - (progn (helm-preselect (if (and helm-ff-transformer-show-only-basename - (not (helm-ff-dot-file-p c))) - (helm-basename c) c)) - (when (y-or-n-p (format "Really Delete file `%s'? " c)) - (helm-delete-file c helm-ff-signal-error-on-dot-files - 'synchro) + (progn (helm-preselect + (if (and helm-ff-transformer-show-only-basename + (not (helm-ff-dot-file-p c))) + (helm-basename c) c)) + (when (y-or-n-p + (format "Really Delete file `%s'? " c)) + (helm-delete-file + c helm-ff-signal-error-on-dot-files 'synchro) (helm-delete-current-selection) (message nil))))) (with-helm-buffer @@ -1891,11 +1968,13 @@ Note that only existing directories are saved here." (helm-basename presel) presel))))))) (defun helm-ff-kill-buffer-fname (candidate) - (let ((buf (get-file-buffer candidate))) - (if buf - (progn - (kill-buffer buf) (message "Buffer `%s' killed" buf)) - (message "No buffer to kill")))) + (let* ((buf (get-file-buffer candidate)) + (buf-name (buffer-name buf))) + (cond ((and buf (eq buf (get-buffer helm-current-buffer))) + (user-error + "Can't kill `helm-current-buffer' without quitting session")) + (buf (kill-buffer buf) (message "Buffer `%s' killed" buf-name)) + (t (message "No buffer to kill"))))) (defun helm-ff-kill-or-find-buffer-fname (candidate) "Find file CANDIDATE or kill it's buffer if it is visible. @@ -1908,17 +1987,19 @@ in `helm-find-files-persistent-action'." (buf-name (buffer-name buf)) (win (get-buffer-window buf)) (helm--reading-passwd-or-string t)) - (if (and buf win - (not (eq buf (get-buffer helm-current-buffer))) - (not (buffer-modified-p buf))) - (progn - (kill-buffer buf) - (set-window-buffer win helm-current-buffer) - (message "Buffer `%s' killed" buf-name)) - (find-file candidate)))) + (cond ((and buf win (eq buf (get-buffer helm-current-buffer))) + (user-error + "Can't kill `helm-current-buffer' without quitting session")) + ((and buf win (buffer-modified-p buf)) + (message "Can't kill modified buffer, please save it before")) + ((and buf win) + (kill-buffer buf) + (set-window-buffer win helm-current-buffer) + (message "Buffer `%s' killed" buf-name)) + (t (find-file candidate))))) (defun helm-ff-run-kill-buffer-persistent () - "Execute `helm-ff-kill-buffer-fname' whitout quitting." + "Execute `helm-ff-kill-buffer-fname' without quitting." (interactive) (with-helm-alive-p (helm-attrset 'kill-buffer-fname 'helm-ff-kill-buffer-fname) @@ -1936,12 +2017,11 @@ return FNAME prefixed with [?]." (prefix-url (propertize " " 'display (propertize "[@]" 'face 'helm-ff-prefix)))) - (cond ((or file-or-symlinkp (file-exists-p fname)) fname) + (cond (file-or-symlinkp fname) ((or (string-match helm-ff-url-regexp fname) (and ffap-url-regexp (string-match ffap-url-regexp fname))) (concat prefix-url " " fname)) - ((or new-file (not (file-exists-p fname))) - (concat prefix-new " " fname))))) + (new-file (concat prefix-new " " fname))))) (defun helm-ff-score-candidate-for-pattern (str pattern) (if (member str '("." "..")) @@ -1962,7 +2042,7 @@ Return candidates prefixed with basename of `helm-input' first." (rest-cand (if cand1 (cdr candidates) candidates)) (memo-src (make-hash-table :test 'equal)) (all (sort rest-cand - #'(lambda (s1 s2) + (lambda (s1 s2) (let* ((score (lambda (str) (helm-ff-score-candidate-for-pattern str (helm-basename helm-input)))) @@ -2016,16 +2096,21 @@ Return candidates prefixed with basename of `helm-input' first." (cons (helm-ff-prefix-filename (propertize disp 'face 'helm-ff-invalid-symlink) t) file)) - ;; A symlink. - ((stringp type) + ;; A dotted directory symlinked. + ((and (helm-ff-dot-file-p file) (stringp type)) (cons (helm-ff-prefix-filename - (propertize disp 'face 'helm-ff-symlink) t) + (propertize disp 'face 'helm-ff-dotted-symlink-directory) t) file)) ;; A dotted directory. - ((and (eq t type) (helm-ff-dot-file-p file)) + ((helm-ff-dot-file-p file) (cons (helm-ff-prefix-filename (propertize disp 'face 'helm-ff-dotted-directory) t) file)) + ;; A symlink. + ((stringp type) + (cons (helm-ff-prefix-filename + (propertize disp 'face 'helm-ff-symlink) t) + file)) ;; A directory. ((eq t type) (cons (helm-ff-prefix-filename @@ -2051,17 +2136,16 @@ Return candidates prefixed with basename of `helm-input' first." "Action transformer for `helm-source-find-files'." (let ((str-at-point (with-helm-current-buffer (buffer-substring-no-properties - (point-at-bol) (point-at-eol)))) - (fname-at-point (with-helm-current-buffer (ffap-guesser)))) + (point-at-bol) (point-at-eol))))) (cond ((with-helm-current-buffer (eq major-mode 'message-mode)) (append actions '(("Gnus attach file(s)" . helm-ff-gnus-attach-files)))) ((save-match-data - (and (not (string-match-p ffap-url-regexp str-at-point)) - (string-match (concat "\\(" fname-at-point "\\):\\([0-9]+:?\\)") - str-at-point) - (file-equal-p (match-string 1 str-at-point) candidate))) + (and ffap-url-regexp + (not (string-match-p ffap-url-regexp str-at-point)) + (string-match ":\\([0-9]+:?\\)" str-at-point) + )) (append '(("Find file to line number" . helm-ff-goto-linum)) actions)) ((string-match (image-file-name-regexp) candidate) @@ -2088,13 +2172,11 @@ Return candidates prefixed with basename of `helm-input' first." "Find file CANDIDATE and maybe jump to line number found in fname at point. line number should be added at end of fname preceded with \":\". e.g \"foo:12\"." - (let ((linum (let ((str (with-helm-current-buffer - (buffer-substring-no-properties + (let ((linum (with-helm-current-buffer + (let ((str (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) - (fname (with-helm-current-buffer (ffap-guesser)))) - (when (string-match - (concat "\\(" fname "\\):\\([0-9]+:?\\)") str) - (match-string 2 str))))) + (when (string-match ":\\([0-9]+:?\\)" str) + (match-string 1 str)))))) (find-file candidate) (and linum (not (string= linum "")) (helm-goto-line (string-to-number linum) t)))) @@ -2173,7 +2255,7 @@ If a prefix arg is given or `helm-follow-mode' is on open file." (new-pattern (helm-get-selection)) (num-lines-buf (with-current-buffer helm-buffer (count-lines (point-min) (point-max)))) - (insert-in-minibuffer #'(lambda (fname) + (insert-in-minibuffer (lambda (fname) (with-selected-window (minibuffer-window) (unless follow (delete-minibuffer-contents) @@ -2186,12 +2268,15 @@ If a prefix arg is given or `helm-follow-mode' is on open file." ;; second hit insert ":" and expand. (if (string= candidate helm-pattern) (funcall insert-in-minibuffer (concat candidate ":")) - (funcall insert-in-minibuffer candidate))) - ( ;; A symlink directory, expand it's truename. + (funcall insert-in-minibuffer candidate))) + (;; A symlink directory, expand it but not to its truename + ;; unless a prefix arg is given. (and (file-directory-p candidate) (file-symlink-p candidate)) - (funcall insert-in-minibuffer (file-name-as-directory - (file-truename - (expand-file-name candidate))))) + (funcall insert-in-minibuffer + (file-name-as-directory + (if current-prefix-arg + (file-truename (expand-file-name candidate)) + (expand-file-name candidate))))) ;; A directory, open it. ((file-directory-p candidate) (when (string= (helm-basename candidate) "..") @@ -2203,7 +2288,7 @@ If a prefix arg is given or `helm-follow-mode' is on open file." (funcall insert-in-minibuffer (file-truename candidate))) ;; A regular file, expand it, (first hit) ((and (>= num-lines-buf 3) (not current-prefix-arg) (not follow)) - (setq helm-pattern "") ; Force update. + (setq helm-pattern "") ; Force update. (funcall insert-in-minibuffer new-pattern)) ;; An image file and it is the second hit on C-j, ;; show the file in `image-dired'. @@ -2309,15 +2394,17 @@ Use it for non--interactive calls of `helm-find-files'." (unless helm-source-find-files (setq helm-source-find-files (helm-make-source "Find Files" 'helm-source-ffiles))) - (helm :sources 'helm-source-find-files - :input fname - :case-fold-search helm-file-name-case-fold-search - :preselect preselect - :ff-transformer-show-only-basename - helm-ff-transformer-show-only-basename - :default def - :prompt "Find Files or Url: " - :buffer "*Helm Find Files*"))) + (unwind-protect + (helm :sources 'helm-source-find-files + :input fname + :case-fold-search helm-file-name-case-fold-search + :preselect preselect + :ff-transformer-show-only-basename + helm-ff-transformer-show-only-basename + :default def + :prompt "Find Files or Url: " + :buffer "*Helm Find Files*") + (setq helm-ff-default-directory nil)))) (defun helm-find-files-toggle-to-bookmark () "Toggle helm-bookmark for `helm-find-files' and `helm-find-files.'" @@ -2335,7 +2422,9 @@ Use it for non--interactive calls of `helm-find-files'." (defun helm-find-files-initial-input (&optional input) "Return INPUT if present, otherwise try to guess it." - (let ((ffap-machine-p-known 'reject)) + (let ((ffap-machine-p-known 'reject) + (ffap-alist (and helm-ff-guess-ffap-filenames ffap-alist)) + (ffap-url-regexp (and helm-ff-guess-ffap-urls ffap-url-regexp))) (unless (eq major-mode 'image-mode) (or (and input (or (and (file-remote-p input) input) (expand-file-name input))) @@ -2415,6 +2504,13 @@ Find inside `require' and `declare-function' sexp." ;;; Handle copy, rename, symlink, relsymlink and hardlink from helm. ;; ;; +(defun helm-ff--valid-default-directory () + (with-helm-current-buffer + (cl-loop for b in (buffer-list) + for cd = (with-current-buffer b default-directory) + when (eq (car (file-attributes cd)) t) + return cd))) + (defvar dired-async-mode) (cl-defun helm-dired-action (candidate &key action follow (files (dired-get-marked-files))) @@ -2424,7 +2520,12 @@ Where ACTION is a symbol that can be one of: Argument FOLLOW when non--nil specify to follow FILES to destination for the actions copy and rename." (when (get-buffer dired-log-buffer) (kill-buffer dired-log-buffer)) - (let ((fn (cl-case action + ;; When default-directory in current-buffer is an invalid directory, + ;; (e.g buffer-file directory have been renamed somewhere else) + ;; be sure to use a valid value to give to dired-create-file. + ;; i.e start-process is creating a process buffer based on default-directory. + (let ((default-directory (helm-ff--valid-default-directory)) + (fn (cl-case action (copy 'dired-copy-file) (rename 'dired-rename-file) (symlink 'make-symbolic-link) @@ -2449,9 +2550,9 @@ copy and rename." (if (file-directory-p candidate) ;; When CANDIDATE is a directory, build file-name in this directory. ;; Else we use CANDIDATE. - #'(lambda (from) + (lambda (from) (expand-file-name (file-name-nondirectory from) candidate)) - #'(lambda (_from) candidate)) + (lambda (_from) candidate)) marker) (and (fboundp 'dired-async-mode) (dired-async-mode dired-async-state))) @@ -2560,7 +2661,7 @@ Ask to kill buffers associated with that file, too." (len (length files))) (with-helm-display-marked-candidates helm-marked-buffer-name - (mapcar #'(lambda (f) + (mapcar (lambda (f) (if (file-directory-p f) (concat (helm-basename f) "/") (helm-basename f))) @@ -2581,8 +2682,9 @@ Called with a prefix arg open files in background without selecting them." (ffap-newfile-prompt helm-ff-newfile-prompt-p) (find-file-wildcards nil) (make-dir-fn - #'(lambda (dir &optional helm-ff) - (when (y-or-n-p (format "Create directory `%s'? " dir)) + (lambda (dir &optional helm-ff) + (when (or (not confirm-nonexistent-file-or-buffer) + (y-or-n-p (format "Create directory `%s'? " dir))) (let ((dirfname (directory-file-name dir))) (if (file-exists-p dirfname) (error @@ -2613,12 +2715,11 @@ Called with a prefix arg open files in background without selecting them." ;; an existing filename, create or jump to it. ;; If the basedir of candidate doesn't exists, ;; ask for creating it. - (let ((dir (file-name-directory candidate))) + (let ((dir (and (not url-p) (helm-basedir candidate)))) (find-file-at-point (cond ((and dir (file-directory-p dir)) - (substitute-in-file-name (car marked))) - ;; FIXME Why do we use this on urls ? - (url-p (helm-substitute-in-filename (car marked))) + (substitute-in-file-name candidate)) + (url-p candidate) ((funcall make-dir-fn dir) candidate)))))))) (defun helm-shadow-boring-files (files) @@ -2692,10 +2793,11 @@ Else return ACTIONS unmodified." ;; (dired '("~/" "~/.emacs.d/.emacs-custom.el" "~/.emacs.d/.emacs.bmk")) +(defclass helm-files-dired-source (helm-source-sync helm-type-file) + ((candidates :initform #'helm-files-in-all-dired-candidates))) + (defvar helm-source-files-in-all-dired - '((name . "Files in all dired buffer.") - (candidates . helm-files-in-all-dired-candidates) - (type . file))) + (helm-make-source "Files in all dired buffer." 'helm-files-dired-source)) ;;; File Cache @@ -2706,8 +2808,7 @@ Else return ACTIONS unmodified." (defclass helm-file-cache (helm-source-in-buffer helm-type-file) ((init :initform (lambda () (require 'filecache))) (keymap :initform helm-generic-files-map) - (help-message :initform helm-generic-file-help-message) - (mode-line :initform helm-generic-file-mode-line-string))) + (help-message :initform helm-generic-file-help-message))) (defun helm-file-cache-get-candidates () (cl-loop for item in file-cache-alist append @@ -2773,11 +2874,11 @@ Else return ACTIONS unmodified." ;; ;; (defvar helm-source-file-name-history - `((name . "File Name History") - (candidates . file-name-history) - (persistent-action . ignore) - (filtered-candidate-transformer . helm-file-name-history-transformer) - (action . ,(helm-actions-from-type-file)))) + (helm-build-sync-source "File Name History" + :candidates 'file-name-history + :persistent-action #'ignore + :filtered-candidate-transformer #'helm-file-name-history-transformer + :action 'helm-type-file-actions)) (defvar helm-source--ff-file-name-history nil "[Internal] This source is build to be used with `helm-find-files'. @@ -2808,15 +2909,16 @@ Don't use it in your own code unless you know what you are doing.") file-name-history)) :fuzzy-match t :persistent-action 'ignore + :migemo t :filtered-candidate-transformer 'helm-file-name-history-transformer :action (helm-make-actions "Find file" (lambda (candidate) (helm-set-pattern (expand-file-name candidate)) (with-helm-after-update-hook (helm-exit-minibuffer))) - "Find file in helm" (lambda (candidate) - (helm-set-pattern - (expand-file-name candidate))))))) + "Find file in helm" (lambda (candidate) + (helm-set-pattern + (expand-file-name candidate))))))) (with-helm-alive-p (helm :sources 'helm-source--ff-file-name-history :buffer "*helm-file-name-history*" @@ -2840,7 +2942,7 @@ Don't use it in your own code unless you know what you are doing.") (t (setq helm-recentf--basename-flag nil) pattern)))) -(defclass helm-recentf-source (helm-source-sync) +(defclass helm-recentf-source (helm-source-sync helm-type-file) ((init :initform (lambda () (require 'recentf) (recentf-mode 1))) @@ -2850,15 +2952,18 @@ Don't use it in your own code unless you know what you are doing.") (if (or helm-ff-transformer-show-only-basename helm-recentf--basename-flag) (helm-basename candidate) candidate))) - (filter-one-by-one :initform (lambda (c) - (if (and helm-ff-transformer-show-only-basename - (not (consp c))) - (cons (helm-basename c) c) - c))) + (migemo :initform t) (keymap :initform helm-generic-files-map) - (help-message :initform helm-generic-file-help-message) - (mode-line :initform helm-generic-file-mode-line-string) - (action :initform (helm-actions-from-type-file)))) + (help-message :initform helm-generic-file-help-message))) + +(defmethod helm--setup-source :after ((source helm-recentf-source)) + (set-slot-value + source 'action + (append (symbol-value (helm-actions-from-type-file)) + '(("Delete file(s) from recentf" . + (lambda (_candidate) + (cl-loop for file in (helm-marked-candidates) + do (setq recentf-list (delq file recentf-list))))))))) (defvar helm-source-recentf nil "See (info \"(emacs)File Conveniences\"). @@ -2883,8 +2988,13 @@ Set `recentf-max-saved-items' to a bigger value if default is too small.") (defun helm-browse-project-get-buffers (root-directory) (cl-loop for b in (helm-buffer-list) - for bf = (buffer-file-name (get-buffer b)) - when (and bf (file-in-directory-p bf root-directory)) + ;; FIXME: Why default-directory is root-directory + ;; for current-buffer when coming from helm-quit-and-find-file. + for cd = (with-current-buffer b default-directory) + for bn = (buffer-file-name (get-buffer b)) + if (or (and bn (file-in-directory-p bn root-directory)) + (and (null bn) + (file-in-directory-p cd root-directory))) collect b)) (defun helm-browse-project-build-buffers-source (directory) @@ -2919,9 +3029,8 @@ Set `recentf-max-saved-items' to a bigger value if default is too small.") 'face 'helm-ff-file) c) (propertize c 'face 'helm-ff-file))) - :mode-line helm-generic-file-mode-line-string :keymap helm-generic-files-map - :action (helm-actions-from-type-file))) + :action 'helm-type-file-actions)) :buffer "*helm browse project*")) ;;;###autoload @@ -2980,7 +3089,7 @@ See `helm-browse-project'." (defun helm-ff-run-browse-project () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-browse-project))) + (helm-exit-and-execute-action 'helm-ff-browse-project))) (defun helm-ff-gid (_candidate) (with-helm-default-directory helm-ff-default-directory @@ -2989,23 +3098,23 @@ See `helm-browse-project'." (defun helm-ff-run-gid () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-gid))) + (helm-exit-and-execute-action 'helm-ff-gid))) ;;; session.el files ;; ;; session (http://emacs-session.sourceforge.net/) is an alternative to ;; recentf that saves recent file history and much more. +(defvar session-file-alist) (defvar helm-source-session - `((name . "Session") - (candidates . (lambda () - (cl-delete-if-not #'(lambda (f) - (or (string-match helm-tramp-file-name-regexp f) - (file-exists-p f))) - (mapcar 'car session-file-alist)))) - (keymap . ,helm-generic-files-map) - (help-message . helm-generic-file-help-message) - (mode-line . helm-generic-file-mode-line-string) - (action . ,(helm-actions-from-type-file))) + (helm-build-sync-source "Session" + :candidates (lambda () + (cl-delete-if-not (lambda (f) + (or (string-match helm-tramp-file-name-regexp f) + (file-exists-p f))) + (mapcar 'car session-file-alist))) + :keymap helm-generic-files-map + :help-message helm-generic-file-help-message + :action 'helm-type-file-actions) "File list from emacs-session.") @@ -3055,9 +3164,9 @@ Colorize only symlinks, directories and files." helm-recentf--basename-flag) (helm-basename candidate) candidate))) (fuzzy-match :initform t) + (migemo :initform t) (keymap :initform helm-generic-files-map) - (help-message :initform helm-generic-file-help-message) - (mode-line :initform helm-generic-file-mode-line-string))) + (help-message :initform helm-generic-file-help-message))) (defvar helm-source-files-in-current-dir (helm-make-source "Files from Current Directory" @@ -3093,32 +3202,34 @@ Colorize only symlinks, directories and files." collect built)) (defvar helm-source-tracker-search - `((name . "Tracker Search") - (candidates-process - . (lambda () - (start-process "tracker-search-process" nil - "tracker-search" - "--disable-color" - "--limit=512" - helm-pattern))) - (filtered-candidate-transformer . helm-source-tracker-transformer) + (helm-build-async-source "Tracker Search" + :candidates-process + (lambda () + (start-process "tracker-search-process" nil + "tracker-search" + "--disable-color" + "--limit=512" + helm-pattern)) + :filtered-candidate-transformer #'helm-source-tracker-transformer ;;(multiline) ; https://github.com/emacs-helm/helm/issues/529 - (keymap . ,helm-generic-files-map) - (action . ,(cdr (helm-get-attribute-from-type 'action 'file))) - (action-transformer - helm-transform-file-load-el - helm-transform-file-browse-url) - (requires-pattern . 3)) + :keymap helm-generic-files-map + :action 'helm-type-file-actions + :action-transformer '(helm-transform-file-load-el + helm-transform-file-browse-url) + :requires-pattern 3) "Source for retrieving files matching the current input pattern with the tracker desktop search.") ;; Spotlight (MacOS X desktop search) +(defclass helm-mac-spotlight-source (helm-source-async helm-type-file) + ((candidates-process :initform + (lambda () + (start-process + "mdfind-process" nil "mdfind" helm-pattern))) + (requires-pattern :initform 3))) + (defvar helm-source-mac-spotlight - '((name . "mdfind") - (candidates-process - . (lambda () (start-process "mdfind-process" nil "mdfind" helm-pattern))) - (type . file) - (requires-pattern . 3)) + (helm-make-source "mdfind" helm-mac-spotlight-source) "Source for retrieving files via Spotlight's command line utility mdfind.") @@ -3133,8 +3244,8 @@ utility mdfind.") :candidates-process 'helm-find-shell-command-fn :filtered-candidate-transformer 'helm-findutils-transformer :action-transformer 'helm-transform-file-load-el - :action (helm-actions-from-type-file) - :mode-line helm-generic-file-mode-line-string + :persistent-action 'helm-ff-kill-or-find-buffer-fname + :action 'helm-type-file-actions :keymap helm-generic-files-map :candidate-number-limit 9999 :requires-pattern 3)) @@ -3201,7 +3312,7 @@ separator." (prog1 proc (set-process-sentinel proc - #'(lambda (process event) + (lambda (process event) (helm-process-deferred-sentinel-hook process event (helm-default-directory)) (if (string= event "finished\n") @@ -3235,7 +3346,7 @@ separator." "Run find shell command action with key from `helm-find-files'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-ff-find-sh-command))) + (helm-exit-and-execute-action 'helm-ff-find-sh-command))) ;;; Preconfigured commands @@ -3260,23 +3371,25 @@ Called with a prefix arg show history if some. Don't call it from programs, use `helm-find-files-1' instead. This is the starting point for nearly all actions you can do on files." (interactive "P") - (let* ((hist (and arg helm-ff-history (helm-find-files-history))) - (default-input (or hist (helm-find-files-initial-input))) - (input (cond ((and (eq major-mode 'org-agenda-mode) - org-directory - (not default-input)) - (expand-file-name org-directory)) - ((and (eq major-mode 'dired-mode) default-input) - (file-name-directory default-input)) - ((and (not (string= default-input "")) - default-input)) - (t (expand-file-name (helm-current-directory))))) - (presel (helm-aif (or hist - (buffer-file-name (current-buffer)) - (and (eq major-mode 'dired-mode) - default-input)) - (if helm-ff-transformer-show-only-basename - (helm-basename it) it)))) + (let* ((hist (and arg helm-ff-history (helm-find-files-history))) + (default-input (or hist (helm-find-files-initial-input))) + (input (cond ((and (eq major-mode 'org-agenda-mode) + org-directory + (not default-input)) + (expand-file-name org-directory)) + ((and (eq major-mode 'dired-mode) default-input) + (file-name-directory default-input)) + ((and (not (string= default-input "")) + default-input)) + (t (expand-file-name (helm-current-directory))))) + (input-as-presel (null (nth 0 (file-attributes input)))) + (presel (helm-aif (or hist + (and input-as-presel input) + (buffer-file-name (current-buffer)) + (and (eq major-mode 'dired-mode) + default-input)) + (if helm-ff-transformer-show-only-basename + (helm-basename it) it)))) (set-text-properties 0 (length input) nil input) (helm-find-files-1 input (and presel (concat "^" (regexp-quote presel)))))) diff --git a/elpa/helm-20150704.1247/helm-font.el b/elpa/helm-20160105.2046/helm-font.el similarity index 59% rename from elpa/helm-20150704.1247/helm-font.el rename to elpa/helm-20160105.2046/helm-font.el index e7a7d240..732f6ff5 100644 --- a/elpa/helm-20150704.1247/helm-font.el +++ b/elpa/helm-20160105.2046/helm-font.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (defvar helm-ucs-map (let ((map (make-sparse-keymap))) @@ -27,7 +28,6 @@ (define-key map (kbd "") 'helm-ucs-persistent-backward) (define-key map (kbd "") 'helm-ucs-persistent-forward) (define-key map (kbd "") 'helm-ucs-persistent-insert) - (define-key map (kbd "C-c ?") 'helm-ucs-help) map) "Keymap for `helm-ucs'.") @@ -35,35 +35,36 @@ ;;; Xfont selection ;; ;; -(defun helm-persistent-xfont-action (elm) - "Show current font temporarily" - (let ((current-font (cdr (assoc 'font (frame-parameters)))) - (default-font elm)) - (unwind-protect - (progn (set-frame-font default-font 'keep-size) (sit-for 2)) - (set-frame-font current-font)))) - (defvar helm-xfonts-cache nil) +(defvar helm-previous-font nil) (defvar helm-source-xfonts - '((name . "X Fonts") - (init . (lambda () - (unless helm-xfonts-cache - (setq helm-xfonts-cache - (x-list-fonts "*"))))) - (candidates . helm-xfonts-cache) - (action . (("Copy to kill ring" . (lambda (elm) - (kill-new elm))) - ("Set Font" . (lambda (elm) - (kill-new elm) - (set-frame-font elm 'keep-size) - (message "New font have been copied to kill ring"))))) - (persistent-action . helm-persistent-xfont-action) - (persistent-help . "Switch to this font temporarily"))) + (helm-build-sync-source "X Fonts" + :init (lambda () + (unless helm-xfonts-cache + (setq helm-xfonts-cache + (x-list-fonts "*"))) + ;; Save current font so it can be restored in cleanup + (setq helm-previous-font (cdr (assoc 'font (frame-parameters))))) + :candidates 'helm-xfonts-cache + :action '(("Copy font to kill ring" . (lambda (elm) + (kill-new elm))) + ("Set font" . (lambda (elm) + (kill-new elm) + (set-frame-font elm 'keep-size) + (message "Font copied to kill ring")))) + :cleanup (lambda () + ;; Restore previous font + (set-frame-font helm-previous-font 'keep-size)) + :persistent-action (lambda (new-font) + (set-frame-font new-font 'keep-size) + (kill-new new-font)) + :persistent-help "Preview font and copy to kill-ring")) ;;; 𝕌𝕔𝕤 𝕊𝕪𝕞𝕓𝕠𝕝 𝕔𝕠𝕞𝕡𝕝𝕖𝕥𝕚𝕠𝕟 ;; ;; -(defvar helm-ucs-max-len 0) +(defvar helm-ucs--max-len 0) +(defvar helm-ucs--names nil) (defun helm-calculate-ucs-max-len () "Calculate the length of longest `ucs-names' candidate." (cl-loop with count = 0 @@ -76,28 +77,17 @@ (defun helm-ucs-init () "Initialize an helm buffer with ucs symbols. Only math* symbols are collected." - (unless (> helm-ucs-max-len 0) - (setq helm-ucs-max-len + (unless (> helm-ucs--max-len 0) + (setq helm-ucs--max-len (helm-calculate-ucs-max-len))) - (with-current-buffer (helm-candidate-buffer - (get-buffer-create "*helm ucs*")) - ;; `ucs-names' fn will not run again, data is cached in - ;; var `ucs-names'. - (cl-loop for (n . v) in (ucs-names) - for len = (length n) - for diff = (+ (- helm-ucs-max-len len) 2) - unless (string= "" n) - do (progn (insert (concat - n ":" - (make-string - diff ? ))) - (if (fboundp 'ucs-insert) - (ucs-insert v) - ;; call `insert-char' with nil nil - ;; to shutup byte compiler in 24.1. - (insert-char v nil nil)) - (insert (format " #x%x" v)) - (insert "\n"))))) + (or helm-ucs--names + (setq helm-ucs--names + (cl-loop for (n . v) in (ucs-names) + for len = (length n) + for diff = (+ (- helm-ucs--max-len len) 2) + unless (string= "" n) + collect (format "%s:%s%c #x%x" + n (make-string diff ? ) v v))))) (defun helm-ucs-forward-char (_candidate) (with-helm-current-buffer @@ -113,7 +103,7 @@ Only math* symbols are collected." (defun helm-ucs-insert (candidate n) (with-helm-current-buffer - (string-match "^\\([^:]+\\): +\\(.\\) #x\\([a-f0-9]+\\)$" candidate) + (string-match "^\\([^:]+\\): +\\(.\\) \\(#x[a-f0-9]+\\)$" candidate) (insert (match-string n candidate)))) (defun helm-ucs-insert-name (candidate) @@ -150,24 +140,26 @@ Only math* symbols are collected." (helm-execute-persistent-action 'action-delete))) (defvar helm-source-ucs - '((name . "Ucs names") - (init . helm-ucs-init) - (candidate-number-limit . 9999) - (candidates-in-buffer) - (mode-line . helm-ucs-mode-line-string) - (action . (("Insert character" . helm-ucs-insert-char) - ("Insert character name" . helm-ucs-insert-name) - ("Insert character code in hex" . helm-ucs-insert-code) - ("Forward char" . helm-ucs-forward-char) - ("Backward char" . helm-ucs-backward-char) - ("Delete char backward" . helm-ucs-delete-backward)))) + (helm-build-in-buffer-source "Ucs names" + :data #'helm-ucs-init + :help-message 'helm-ucs-help-message + :match-part (lambda (candidate) (car (split-string candidate ":"))) + :filtered-candidate-transformer + (lambda (candidates _source) (sort candidates #'helm-generic-sort-fn)) + :action '(("Insert character" . helm-ucs-insert-char) + ("Insert character name" . helm-ucs-insert-name) + ("Insert character code in hex" . helm-ucs-insert-code) + ("Forward char" . helm-ucs-forward-char) + ("Backward char" . helm-ucs-backward-char) + ("Delete char backward" . helm-ucs-delete-backward))) "Source for collecting `ucs-names' math symbols.") ;;;###autoload (defun helm-select-xfont () "Preconfigured `helm' to select Xfont." (interactive) - (helm-other-buffer 'helm-source-xfonts "*helm select* xfont")) + (helm :sources 'helm-source-xfonts + :buffer "*helm select xfont*")) ;;;###autoload (defun helm-ucs () diff --git a/elpa/helm-20150704.1247/helm-grep.el b/elpa/helm-20160105.2046/helm-grep.el similarity index 79% rename from elpa/helm-20150704.1247/helm-grep.el rename to elpa/helm-20160105.2046/helm-grep.el index f1ab0972..a2134bd9 100644 --- a/elpa/helm-20150704.1247/helm-grep.el +++ b/elpa/helm-20160105.2046/helm-grep.el @@ -18,7 +18,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) -(require 'grep) +(require 'helm-help) (require 'helm-regexp) ;;; load wgrep proxy if it's available @@ -28,6 +28,9 @@ (declare-function helm-elscreen-find-file "helm-elscreen" (file)) (declare-function View-quit "view") (declare-function doc-view-goto-page "doc-view" (page)) +(declare-function helm-mm-split-pattern "helm-multi-match") +(declare-function helm--ansi-color-apply "helm-lib") +(defvar helm--ansi-color-regexp) (defgroup helm-grep nil @@ -35,7 +38,7 @@ :group 'helm) (defcustom helm-grep-default-command - "grep --color=never -a -d skip %e -n%cH -e %p %f" + "grep --color=always -a -d skip %e -n%cH -e %p %f" "Default grep format command for `helm-do-grep-1'. Where: '%e' format spec is for --exclude or --include grep options or @@ -62,25 +65,24 @@ don't specify the '%e' format spec. Helm also support ack-grep and git-grep , here a default command example for ack-grep: -\(setq helm-grep-default-command \"ack-grep -Hn --no-group --no-color %e %p %f\" - helm-grep-default-recurse-command \"ack-grep -H --no-group --no-color %e %p %f\") +\(setq helm-grep-default-command \"ack-grep -Hn --smart-case --no-group %e %p %f\" + helm-grep-default-recurse-command \"ack-grep -H --smart-case --no-group %e %p %f\") You can ommit the %e spec if you don't want to be prompted for types. NOTE: Helm for ack-grep support ANSI sequences, so you can remove the \"--no-color\" option safely (recommended). -To enable ANSI in grep it is a little more difficult: - 1) Modify env var - \(setenv \"GREP_COLORS\" \"ms=01;31:mc=01;31:sl=01;37:cx=:fn=35:ln=32:bn=32:se=36\") - 2) Add the option \"--color=always\". +Same for grep you can use safely the option \"--color=always\" (default). +You can customize the color of matches using GREP_COLORS env var. +e.g: \(setenv \"GREP_COLORS\" \"ms=30;43:mc=30;43:sl=01;37:cx=:fn=35:ln=32:bn=32:se=36\") To enable ANSI color in git-grep just add \"--color=always\". To customize the ANSI color in git-grep, GREP_COLORS have no effect, you will have to setup this in your .gitconfig: [color \"grep\"] - match = black yellow + match = black yellow where \"black\" is the foreground and \"yellow\" the background. See the git documentation for more infos. @@ -97,14 +99,14 @@ NOTE: Remote grepping is not available with ack-grep, :type 'string) (defcustom helm-grep-default-recurse-command - "grep --color=never -a -d recurse %e -n%cH -e %p %f" + "grep --color=always -a -d recurse %e -n%cH -e %p %f" "Default recursive grep format command for `helm-do-grep-1'. See `helm-grep-default-command' for format specs and infos about ack-grep." :group 'helm-grep :type 'string) (defcustom helm-default-zgrep-command - "zgrep -a -n%cH -e %p %f" + "zgrep --color=always -a -n%cH -e %p %f" "Default command for Zgrep. See `helm-grep-default-command' for infos on format specs. Option --color=always is supported and can be used safely @@ -114,10 +116,10 @@ see `helm-grep-default-command' for more infos." :type 'string) (defcustom helm-pdfgrep-default-command - "pdfgrep --color never -niH %s %s" + "pdfgrep --color always -niH %s %s" "Default command for pdfgrep. -Option --color always is not supported, expect -errors when executing actions." +Option \"--color always\" is supported starting helm version 1.7.8, +when used matchs will be highlighted according to GREP_COLORS env var." :group 'helm-grep :type 'string) @@ -148,16 +150,47 @@ If set to nil `doc-view-mode' will be used instead of an external command." :group 'helm-grep :type 'string) -(defcustom helm-do-grep-preselect-candidate nil - "When non--nil the file name of current buffer will be selected." - :group 'helm-grep - :type 'boolean) - (defcustom helm-grep-preferred-ext nil "This file extension will be preselected for grep." :group 'helm-grep :type 'string) +(defcustom helm-grep-save-buffer-name-no-confirm nil + "when *hgrep* already exists,auto append suffix." + :group 'helm-grep + :type 'boolean) + +(defcustom helm-grep-ignored-files + (cons ".#*" (delq nil (mapcar (lambda (s) + (unless (string-match-p "/\\'" s) + (concat "*" s))) + completion-ignored-extensions))) + "List of file names which `helm-grep' shall exclude." + :group 'helm-grep + :type '(repeat string)) + +(defcustom helm-grep-ignored-directories + helm-walk-ignore-directories + "List of names of sub-directories which `helm-grep' shall not recurse into." + :group 'helm-grep + :type '(repeat string)) + +(defcustom helm-grep-truncate-lines t + "When nil the grep line that appears will not be truncated." + :group 'helm-grep + :type 'boolean) + +(defcustom helm-grep-file-path-style 'basename + "File path display style when grep results are displayed. +Possible value are: + basename: displays only the filename, none of the directory path + absolute: displays absolute path + relative: displays relative path from root grep directory." + :group 'helm-grep + :type '(choice (const :tag "Basename" basename) + (const :tag "Absolute" absolute) + (const :tag "Relative" relative))) + ;;; Faces ;; @@ -185,11 +218,6 @@ If set to nil `doc-view-mode' will be used instead of an external command." "Face used to highlight grep number lines." :group 'helm-grep-faces) -(defface helm-grep-running - '((t (:foreground "Red"))) - "Face used in mode line when grep is running." - :group 'helm-grep-faces) - (defface helm-grep-finish '((t (:foreground "Green"))) "Face used in mode line when grep is finish." @@ -216,7 +244,6 @@ If set to nil `doc-view-mode' will be used instead of an external command." (when helm-grep-use-ioccur-style-keys (define-key map (kbd "") 'helm-execute-persistent-action) (define-key map (kbd "") 'helm-grep-run-default-action)) - (define-key map (kbd "C-c ?") 'helm-grep-help) (delq nil map)) "Keymap used in Grep sources.") @@ -226,7 +253,6 @@ If set to nil `doc-view-mode' will be used instead of an external command." (define-key map (kbd "M-") 'helm-goto-next-file) (define-key map (kbd "M-") 'helm-goto-precedent-file) (define-key map (kbd "C-w") 'helm-yank-text-at-point) - (define-key map (kbd "C-c ?") 'helm-pdfgrep-help) map) "Keymap used in pdfgrep.") @@ -315,7 +341,7 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") (let ((files (if (file-remote-p in-directory) ;; Grep don't understand tramp filenames ;; use the local name. - (mapcar #'(lambda (x) + (mapcar (lambda (x) (file-remote-p x 'localname)) all-files) all-files))) @@ -350,18 +376,18 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") only-files default-directory)) (ignored-files (unless (helm-grep-use-ack-p) (mapconcat - #'(lambda (x) + (lambda (x) (concat "--exclude=" (shell-quote-argument x))) - grep-find-ignored-files " "))) + helm-grep-ignored-files " "))) (ignored-dirs (unless (helm-grep-use-ack-p) (mapconcat ;; Need grep version >=2.5.4 ;; of Gnuwin32 on windoze. - #'(lambda (x) + (lambda (x) (concat "--exclude-dir=" (shell-quote-argument x))) - grep-find-ignored-directories " "))) + helm-grep-ignored-directories " "))) (exclude (unless (helm-grep-use-ack-p) (if helm-grep-in-recurse (concat (or include ignored-files) @@ -407,17 +433,18 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") ;; Init sentinel. (set-process-sentinel (get-buffer-process helm-buffer) - #'(lambda (process event) - (let ((noresult (= (process-exit-status process) 1))) - (unless noresult + (lambda (process event) + (let* ((err (process-exit-status process)) + (noresult (= err 1))) + (unless err (helm-process-deferred-sentinel-hook - process event helm-ff-default-directory)) + process event (helm-default-directory))) (cond ((and noresult ;; [FIXME] This is a workaround for zgrep ;; that exit with code 1 ;; after a certain amount of results. (not (with-helm-buffer helm-grep-use-zgrep))) - (with-current-buffer helm-buffer + (with-helm-buffer (insert (concat "* Exit with code 1, no result found," " Command line was:\n\n " (propertize helm-grep-last-cmd-line @@ -538,7 +565,7 @@ With a prefix arg record CANDIDATE in `mark-ring'." "Jump to result in elscreen from helm grep." (helm-grep-action candidate 'elscreen)) -(defun helm-goto-next-or-prec-file (n &optional type) +(defun helm-goto-next-or-prec-file (n) "Go to next or precedent candidate file in helm grep/etags buffers. If N is positive go forward otherwise go backward." (let* ((allow-mode (or (eq major-mode 'helm-grep-mode) @@ -546,12 +573,10 @@ If N is positive go forward otherwise go backward." (sel (if allow-mode (buffer-substring (point-at-bol) (point-at-eol)) (helm-get-selection nil t))) - (current-line-list (if (eq type 'etags) - (split-string sel ": +" t) - (helm-grep-split-line sel))) + (current-line-list (helm-grep-split-line sel)) (current-fname (nth 0 current-line-list)) (bob-or-eof (if (eq n 1) 'eobp 'bobp)) - (mark-maybe #'(lambda () + (mark-maybe (lambda () (if allow-mode (ignore) (helm-mark-current-line))))) @@ -562,9 +587,7 @@ If N is positive go forward otherwise go backward." ;; the line is not a grep line i.e 'fname:num:tag'. (setq sel (buffer-substring (point-at-bol) (point-at-eol))) (unless (or (string= current-fname - (car (if (eq type 'etags) - (split-string sel ": +" t) - (helm-grep-split-line sel)))) + (car (helm-grep-split-line sel))) (and (eq major-mode 'helm-grep-mode) (not (get-text-property (point-at-bol) 'help-echo)))) (funcall mark-maybe) @@ -577,53 +600,47 @@ If N is positive go forward otherwise go backward." (helm-aif (next-single-property-change (point-at-bol) 'help-echo) (goto-char it) (forward-line 1)) - (funcall mark-maybe))))) + (funcall mark-maybe))) + (helm-log-run-hook 'helm-move-selection-after-hook))) ;;;###autoload (defun helm-goto-precedent-file () "Go to precedent file in helm grep/etags buffers." (interactive) (with-helm-alive-p - (let ((etagp (when (string= (assoc-default - 'name (helm-get-current-source)) "Etags") - 'etags))) - (with-helm-window - (helm-goto-next-or-prec-file -1 etagp))))) + (with-helm-window + (helm-goto-next-or-prec-file -1)))) ;;;###autoload (defun helm-goto-next-file () "Go to precedent file in helm grep/etags buffers." (interactive) - (with-helm-alive-p - (let ((etagp (when (string= (assoc-default - 'name (helm-get-current-source)) "Etags") - 'etags))) - (with-helm-window - (helm-goto-next-or-prec-file 1 etagp))))) + (with-helm-window + (helm-goto-next-or-prec-file 1))) (defun helm-grep-run-default-action () "Run grep default action from `helm-do-grep-1'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-grep-action))) + (helm-exit-and-execute-action 'helm-grep-action))) (defun helm-grep-run-other-window-action () "Run grep goto other window action from `helm-do-grep-1'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-grep-other-window))) + (helm-exit-and-execute-action 'helm-grep-other-window))) (defun helm-grep-run-other-frame-action () "Run grep goto other frame action from `helm-do-grep-1'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-grep-other-frame))) + (helm-exit-and-execute-action 'helm-grep-other-frame))) (defun helm-grep-run-save-buffer () "Run grep save results action from `helm-do-grep-1'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-grep-save-results))) + (helm-exit-and-execute-action 'helm-grep-save-results))) ;;; helm-grep-mode @@ -637,13 +654,16 @@ If N is positive go forward otherwise go backward." (let ((buf "*hgrep*") new-buf) (when (get-buffer buf) - (setq new-buf (helm-read-string "GrepBufferName: " buf)) - (cl-loop for b in (helm-buffer-list) - when (and (string= new-buf b) - (not (y-or-n-p - (format "Buffer `%s' already exists overwrite? " - new-buf)))) - do (setq new-buf (helm-read-string "GrepBufferName: " "*hgrep "))) + (if helm-grep-save-buffer-name-no-confirm + (setq new-buf (format "*hgrep|%s|-%s" helm-pattern + (format-time-string "%H-%M-%S*"))) + (setq new-buf (helm-read-string "GrepBufferName: " buf)) + (cl-loop for b in (helm-buffer-list) + when (and (string= new-buf b) + (not (y-or-n-p + (format "Buffer `%s' already exists overwrite? " + new-buf)))) + do (setq new-buf (helm-read-string "GrepBufferName: " "*hgrep ")))) (setq buf new-buf)) (with-current-buffer (get-buffer-create buf) (setq buffer-read-only t) @@ -781,7 +801,7 @@ Special commands: :fc-transformer '(helm-adaptive-sort helm-grep-ack-types-transformer) :buffer "*helm ack-types*"))) - (mapconcat #'(lambda (type) (concat "--type=" type)) types " "))) + (mapconcat (lambda (type) (concat "--type=" type)) types " "))) ;;; grep extensions @@ -803,7 +823,7 @@ These extensions will be added to command line with --include arg of grep." unless (or (not glob) (and glob-list (member glob glob-list)) (and glob-list (member glob ext-list)) - (and glob-list (member glob grep-find-ignored-files))) + (and glob-list (member glob helm-grep-ignored-files))) collect glob into glob-list finally return (delq nil (append ext-list glob-list)))) @@ -838,7 +858,7 @@ e.g *.el *.py *.tex. From lisp use the EXTS argument as a list of extensions as above. If you are using ack-grep, you will be prompted for --type instead and EXTS will be ignored. -If prompt is empty `grep-find-ignored-files' are added to --exclude. +If prompt is empty `helm-grep-ignored-files' are added to --exclude. Argument DEFAULT-INPUT is use as `default' arg of `helm' and INPUT is used as `input' arg of `helm', See `helm' docstring. ZGREP when non--nil use zgrep instead, without prompting for a choice @@ -855,7 +875,7 @@ in recurse, and ignoring EXTS, search being made on (not (helm-grep-use-ack-p :where 'recursive)) (or exts (helm-grep-get-file-extensions targets)))) (include-files (and exts - (mapconcat #'(lambda (x) + (mapconcat (lambda (x) (concat "--include=" (shell-quote-argument x))) (if (> (length exts) 1) @@ -899,13 +919,13 @@ in recurse, and ignoring EXTS, search being made on (if zgrep "Zgrep" (capitalize (if recurse (helm-grep-command t) (helm-grep-command)))) - :header-name (lambda (name) - (concat name "(C-c ? Help)")) :candidates-process 'helm-grep-collect-candidates :filter-one-by-one 'helm-grep-filter-one-by-one + :keymap helm-grep-map :nohighlight t + :nomark t :candidate-number-limit 9999 - :mode-line helm-grep-mode-line-string + :help-message 'helm-grep-help-message :history 'helm-grep-history :action (helm-make-actions "Find File" 'helm-grep-action @@ -926,7 +946,7 @@ in recurse, and ignoring EXTS, search being made on :input input :keymap helm-grep-map :history 'helm-grep-history - :truncate-lines t))) + :truncate-lines helm-grep-truncate-lines))) @@ -969,24 +989,29 @@ in recurse, and ignoring EXTS, search being made on (defun helm-grep--filter-candidate-1 (candidate &optional dir) (let* ((root (or dir (and helm-grep-default-directory-fn (funcall helm-grep-default-directory-fn)))) - ansi-color-context ; seems this avoid non--translated fname entries. - (ansi-p (string-match-p ansi-color-regexp candidate)) - (line (if ansi-p (ansi-color-apply candidate) candidate)) + (ansi-p (string-match-p helm--ansi-color-regexp candidate)) + (line (if ansi-p (helm--ansi-color-apply candidate) candidate)) (split (helm-grep-split-line line)) (fname (if (and root split) (expand-file-name (car split) root) (car-safe split))) (lineno (nth 1 split)) - (str (nth 2 split))) - (when (and fname lineno str) - (cons (concat (propertize (file-name-nondirectory fname) - 'face 'helm-grep-file - 'help-echo fname) - ":" - (propertize lineno 'face 'helm-grep-lineno) - ":" - (if ansi-p str (helm-grep-highlight-match str))) - line)))) + (str (nth 2 split)) + (display-fname (cl-ecase helm-grep-file-path-style + (basename (and fname (file-name-nondirectory fname))) + (absolute fname) + (relative (and fname root + (file-relative-name fname root)))))) + (if (and display-fname lineno str) + (cons (concat (propertize display-fname + 'face 'helm-grep-file + 'help-echo fname) + ":" + (propertize lineno 'face 'helm-grep-lineno) + ":" + (if ansi-p str (helm-grep-highlight-match str))) + line) + ""))) (defun helm-grep-filter-one-by-one (candidate) "`filter-one-by-one' transformer function for `helm-do-grep'." @@ -996,25 +1021,30 @@ in recurse, and ignoring EXTS, search being made on (helm-default-directory) default-directory))))) (if (consp candidate) - (helm-grep--filter-candidate-1 (cdr candidate)) - (helm-grep--filter-candidate-1 candidate)))) + ;; Already computed do nothing (default as input). + candidate + (and (stringp candidate) + (helm-grep--filter-candidate-1 candidate))))) (defun helm-grep-highlight-match (str &optional multi-match) "Highlight in string STR all occurences matching `helm-pattern'." - (require 'helm-match-plugin) (let (beg end) (condition-case-unless-debug nil (with-temp-buffer - (insert str) + (insert (propertize str 'read-only nil)) ; Fix (#1176) (goto-char (point-min)) - (cl-loop for reg in (if multi-match - ;; (m)occur. - (cl-loop for r in (helm-mp-split-pattern - helm-pattern) - unless (string-match "\\`!" r) - collect r) - ;; async sources (grep, gid etc...) - (list helm-input)) + (cl-loop for reg in + (if multi-match + ;; (m)occur. + (cl-loop for r in (helm-mm-split-pattern + helm-pattern) + unless (string-match "\\`!" r) + collect + (helm-aif (and helm-migemo-mode + (assoc r helm-mm--previous-migemo-info)) + (cdr it) r)) + ;; async sources (grep, gid etc...) + (list helm-input)) do (while (and (re-search-forward reg nil t) (> (- (setq end (match-end 0)) @@ -1083,7 +1113,7 @@ If a prefix arg is given run grep on all buffers ignoring non--file-buffers." default-directory)) (fnargs (helm-grep-prepare-candidates (if (file-remote-p default-directory) - (mapcar #'(lambda (x) + (mapcar (lambda (x) (file-remote-p x 'localname)) only-files) only-files) @@ -1102,7 +1132,7 @@ If a prefix arg is given run grep on all buffers ignoring non--file-buffers." (message nil) (set-process-sentinel (get-buffer-process helm-buffer) - #'(lambda (_process event) + (lambda (_process event) (if (string= event "finished\n") (with-helm-window (setq mode-line-format @@ -1136,11 +1166,13 @@ If a prefix arg is given run grep on all buffers ignoring non--file-buffers." default-directory))) :candidates-process (lambda () (funcall helm-pdfgrep-default-function helm-pdfgrep-targets)) + :nohighlight t + :nomark t :filter-one-by-one #'helm-grep-filter-one-by-one :candidate-number-limit 9999 :history 'helm-grep-history :keymap helm-pdfgrep-map - :mode-line helm-pdfgrep-mode-line-string + :help-message 'helm-pdfgrep-help-message :action #'helm-pdfgrep-action :persistent-help "Jump to PDF Page" :requires-pattern 2) @@ -1156,70 +1188,131 @@ If a prefix arg is given run grep on all buffers ignoring non--file-buffers." "pdf-reader" nil (format-spec helm-pdfgrep-default-read-command (list (cons ?f fname) (cons ?p pageno)))))) + +;;; AG - AT +;; +;; https://github.com/ggreer/the_silver_searcher +;; https://github.com/monochromegane/the_platinum_searcher -;;;###autoload -(defun helm-do-grep () - "Preconfigured helm for grep. -Contrarily to Emacs `grep', no default directory is given, but -the full path of candidates in ONLY. -That allow to grep different files not only in `default-directory' but anywhere -by marking them (C-). If one or more directory is selected -grep will search in all files of these directories. -You can also use wildcard in the base name of candidate. -If a prefix arg is given use the -r option of grep (recurse). -The prefix arg can be passed before or after start file selection. -See also `helm-do-grep-1'." - (interactive) - (require 'helm-mode) - (let* ((preselection (or (dired-get-filename nil t) - (buffer-file-name (current-buffer)))) - (only (helm-read-file-name - "Search in file(s): " - :marked-candidates t - :preselect (and helm-do-grep-preselect-candidate - (if helm-ff-transformer-show-only-basename - (helm-basename preselection) - preselection)))) - (prefarg (or current-prefix-arg helm-current-prefix-arg))) - (helm-do-grep-1 only prefarg))) +(defcustom helm-grep-ag-command + "ag --line-numbers -S --hidden --color --nogroup %s %s" + "The default command for AG or PT. +Takes two format specs, the first for pattern and the second for directory. +You must use an output format that fit with helm grep, that is: + + \"filename:line-number:string\" + +The option \"--nogroup\" allow this. +The option \"--line-numbers\" is also mandatory except with PT (not supported). + +You can use safely \"--color\" (default)." + :group 'helm-grep + :type 'string) + +(defun helm-grep--ag-command () + (car (split-string helm-grep-ag-command))) + +(defun helm-grep-ag-init (directory) + (let ((cmd-line (format helm-grep-ag-command + (shell-quote-argument helm-pattern) + (shell-quote-argument directory)))) + (set (make-local-variable 'helm-grep-last-cmd-line) cmd-line) + (prog1 + (start-process-shell-command + "ag" helm-buffer cmd-line) + (set-process-sentinel + (get-buffer-process helm-buffer) + (lambda (_process event) + (when (string= event "finished\n") + (with-helm-window + (setq mode-line-format + '(" " mode-line-buffer-identification " " + (:eval (format "L%s" (helm-candidate-number-at-point))) " " + (:eval (propertize + (format + "[%s process finished - (%s results)] " + (upcase (helm-grep--ag-command)) + (max (1- (count-lines + (point-min) + (point-max))) + 0)) + 'face 'helm-grep-finish)))) + (force-mode-line-update)))))))) + +(defvar helm-source-grep-ag nil) +(defun helm-grep-ag-1 (directory) + (setq helm-source-grep-ag + (helm-build-async-source (upcase (helm-grep--ag-command)) + :header-name (lambda (name) + (format "%s [%s]" + name (abbreviate-file-name directory))) + :candidates-process + (lambda () (helm-grep-ag-init directory)) + :nohighlight t + :keymap helm-grep-map + :help-message 'helm-grep-help-message + :filter-one-by-one 'helm-grep-filter-one-by-one + :persistent-action 'helm-grep-persistent-action + :candidate-number-limit 99999 + :requires-pattern 2 + :nomark t + :action (helm-make-actions + "Find File" 'helm-grep-action + "Find file other frame" 'helm-grep-other-frame + (lambda () (and (locate-library "elscreen") + "Find file in Elscreen")) + 'helm-grep-jump-elscreen + "Save results in grep buffer" 'helm-grep-save-results + "Find file other window" 'helm-grep-other-window))) + (helm :sources 'helm-source-grep-ag + :keymap helm-grep-map + :truncate-lines helm-grep-truncate-lines + :buffer (format "*helm %s*" (helm-grep--ag-command)))) + +;;; Git grep +;; +;; +(defcustom helm-grep-git-grep-command + "git grep -n%cH --color=always --exclude-standard --no-index --full-name -e %p -- %f" + "The git grep default command line. +The option \"--color=always\" can be used safely. +The color of matched items can be customized in your .gitconfig +See `helm-grep-default-command' for more infos. + +The \"--exclude-standard\" and \"--no-index\" switches allow +skipping unwanted files specified in ~/.gitignore_global +and searching files not already staged. +You have also to enable this in global \".gitconfig\" with + \"git config --global core.excludesfile ~/.gitignore_global\"." + :group 'helm-grep + :type 'string) + +(defun helm-grep-git-1 (directory &optional all) + (require 'vc) + (let* ((helm-grep-default-command helm-grep-git-grep-command) + helm-grep-default-recurse-command + ;; Expand filename of each candidate with the git root dir. + ;; The filename will be in the help-echo prop. + (helm-grep-default-directory-fn (lambda () + (vc-find-root directory ".git"))) + (helm-ff-default-directory (funcall helm-grep-default-directory-fn))) + (cl-assert helm-ff-default-directory nil "Not inside a Git repository") + (helm-do-grep-1 (if all '("") `(,(expand-file-name directory)))))) + + ;;;###autoload -(defun helm-do-zgrep () - "Preconfigured helm for zgrep." +(defun helm-do-grep-ag () + "Preconfigured helm for grepping with AG in `default-directory'." (interactive) - (require 'helm-mode) - (let* ((prefarg (or current-prefix-arg helm-current-prefix-arg)) - (preselection (or (dired-get-filename nil t) - (buffer-file-name (current-buffer)))) - (ls (helm-read-file-name - "Search in file(s): " - :marked-candidates t - :preselect (and helm-do-grep-preselect-candidate - (if helm-ff-transformer-show-only-basename - (helm-basename preselection) - preselection))))) - (helm-ff-zgrep-1 ls prefarg))) + (helm-grep-ag-1 default-directory)) ;;;###autoload -(defun helm-do-pdfgrep () - "Preconfigured helm for pdfgrep." - (interactive) - (require 'helm-mode) - (let* ((preselection (or (dired-get-filename nil t) - (buffer-file-name (current-buffer)))) - (only (helm-read-file-name - "Search in file(s): " - :marked-candidates t - :test #'(lambda (file) - (or (string= (file-name-extension file) "pdf") - (string= (file-name-extension file) "PDF") - (file-directory-p file))) - :preselect (and helm-do-grep-preselect-candidate - (if helm-ff-transformer-show-only-basename - (helm-basename preselection) - preselection)))) - (helm-grep-default-function 'helm-pdfgrep-init)) - (helm-do-pdfgrep-1 only))) +(defun helm-grep-do-git-grep (arg) + "Preconfigured helm for git-grepping `default-directory'. +With a prefix arg ARG git-grep the whole repository." + (interactive "P") + (helm-grep-git-1 default-directory arg)) (provide 'helm-grep) diff --git a/elpa/helm-20150704.1247/helm-help.el b/elpa/helm-20160105.2046/helm-help.el similarity index 54% rename from elpa/helm-20150704.1247/helm-help.el rename to elpa/helm-20160105.2046/helm-help.el index d2af029d..edecf3a6 100644 --- a/elpa/helm-20150704.1247/helm-help.el +++ b/elpa/helm-20160105.2046/helm-help.el @@ -76,173 +76,46 @@ Find here the documentation of all sources actually documented." (cl-loop for elm in helm-help--string-list for str = (symbol-value elm) do (insert (substitute-command-keys - (if (functionp str) (funcall str) str)))))) + (if (functionp str) (funcall str) str)) + "\n\n")))) (let ((helm-org-headings--nofilename t)) (helm :sources (helm-source-org-headings-for-files (list helm-documentation-file)) :candidate-number-limit 99999 :buffer "*helm documentation*"))) -;;; Global help message - Used by `helm-help' -;; -;; -(defvar helm-help-message - (lambda () - (concat - "\n* Helm generic help\n" - "\\" - "\n`helm' is an Emacs incremental completion and selection narrowing framework. - -Narrow the list by typing some pattern, -Multiple patterns are allowed by splitting by space. -Select with natural Emacs operations, choose with RET. - -** Help - -C-h m : Run this generic help for helm. -C-c ? : Run specific helm help for current source. - -** Basic Operations - -C-p, Up: Previous Line -C-n, Down : Next Line -M-v, PageUp : Previous Page -C-v, PageDown : Next Page -Enter : Execute first (default) action / Select -M-< : First Line -M-> : Last Line -M-PageUp, C-M-S-v, C-M-y : Previous Page (other-window) -M-PageDown, C-M-v : Next Page (other-window) - -Tab, C-i : Show action list -Left : Previous Source -Right, C-o : Next Source -C-k : Delete pattern (with prefix arg delete from point to end) -C-j or C-z: Persistent Action (Execute action with helm session kept) - -** Shortcuts For nth Action - -f1-12: Execute nth 1 to 12 Action(s). - -** Visible Marks - -Visible marks store candidate. Some actions uses marked candidates. - -\\[helm-toggle-visible-mark] : Toggle Visible Mark -\\[helm-prev-visible-mark] : Previous Mark -\\[helm-next-visible-mark] : Next Mark - -** Miscellaneous Commands - -\\[helm-toggle-resplit-window] : Toggle vertical/horizontal split helm window. -\\[helm-quit-and-find-file] : Drop into `find-file'. -\\[helm-delete-current-selection] : Delete selected item (visually). -\\[helm-kill-selection-and-quit] : Kill display value of candidate and quit (with prefix arg kill the real value). -\\[helm-yank-selection] : Yank selection into pattern. -\\[helm-follow-mode] : Toggle automatical execution of persistent action. -\\[helm-follow-action-forward] : Run persistent action and goto next line. -\\[helm-follow-action-backward] : Run persistent action and goto previous line. -\\[helm-force-update] : Recalculate and redisplay candidates. - -** Global Commands - -\\\\[helm-resume] revives last `helm' session. -It is very useful, so you should bind any key.")) - "Detailed help message string for `helm'. -It also accepts function or variable symbol.") - -(defun helm-help-internal (bufname insert-content-fn) - "Show long message during `helm' session in BUFNAME. -INSERT-CONTENT-FN is the function that insert -text to be displayed in BUFNAME." - (let ((winconf (current-frame-configuration))) - (unwind-protect - (progn - (setq helm-suspend-update-flag t) - (set-buffer (get-buffer-create bufname)) - (switch-to-buffer bufname) - (delete-other-windows) - (delete-region (point-min) (point-max)) - (outline-mode) - (save-excursion - (funcall insert-content-fn)) - (setq cursor-type nil) - (buffer-disable-undo) - (helm-help-event-loop)) - (setq helm-suspend-update-flag nil) - (set-frame-configuration winconf)))) - -(defun helm-help-scroll-up (amount) - (condition-case _err - (scroll-up-command amount) - (beginning-of-buffer nil) - (end-of-buffer nil))) - -(defun helm-help-scroll-down (amount) - (condition-case _err - (scroll-down-command amount) - (beginning-of-buffer nil) - (end-of-buffer nil))) - -(defun helm-help-event-loop () - (let ((prompt (propertize - "[SPC,C-v,down,next:NextPage b,M-v,up,prior:PrevPage C-s/r:Isearch q:Quit]" - 'face 'helm-helper)) - scroll-error-top-bottom) - (cl-loop for event = (read-key prompt) do - (cl-case event - ((?\C-v ? down next) (helm-help-scroll-up helm-scroll-amount)) - ((?\M-v ?b up prior) (helm-help-scroll-down helm-scroll-amount)) - (?\C-s (isearch-forward)) - (?\C-r (isearch-backward)) - (?q (cl-return)) - (t (ignore)))))) - -;;;###autoload -(defun helm-help () - "Help of `helm'." - (interactive) - (with-helm-alive-p - (save-selected-window - (helm-help-internal - "*Helm Help*" - (lambda () - (insert (substitute-command-keys - (helm-interpret-value (or (assoc-default - 'help-message - (helm-get-current-source)) - helm-help-message))))))))) +;;; Local help messages. ;;; `helm-buffer-list' help ;; ;; (defvar helm-buffer-help-message - "\n* Helm Buffer\n + "* Helm Buffer -** Helm buffers tips: +** Tips -*** Completion: +*** Completion -**** Major-mode: +**** Major-mode -You can enter a partial name of major-mode (e.g lisp, sh) to narrow down buffers. -To specify the major-mode, prefix it with \"*\" e.g \"*lisp\". +You can enter a partial name of major-mode (e.g. lisp, sh) to narrow down buffers. +To specify the major-mode, prefix it with \"*\" e.g. \"*lisp\". If you want to match all buffers but the ones with a specific major-mode (negation), -prefix the major-mode with \"!\" e.g \"*!lisp\". +prefix the major-mode with \"!\" e.g. \"*!lisp\". If you want to specify more than one major-mode, separate them with \",\", -e.g \"*!lisp,!sh,!fun\" will list all buffers but the ones in lisp-mode, sh-mode and +e.g. \"*!lisp,!sh,!fun\" will list all buffers but the ones in lisp-mode, sh-mode and fundamental-mode. Enter then a space and a pattern to narrow down to buffers matching this pattern. -**** Search inside buffers: +**** Search inside buffers If you enter a space and a pattern prefixed by \"@\" helm will search for text matching this pattern INSIDE the buffer (i.e not in the name of buffer). NOTE that if you enter your pattern prefixed with \"@\" but escaped, helm will search a buffer matching \"@pattern\" but will not search inside. -**** Search by directory name: +**** Search by directory name If you prefix the beginning of pattern with \"/\" the match will occur on directory name of buffer, it is interesting to narrow down to one directory for example, subsequent string @@ -250,32 +123,39 @@ entered after a space will match on buffer-name only. Note that negation is not supported for matching on buffer-file-name. You can specify more than one directory starting from helm v1.6.8 -**** Fuzzy matching: +**** Fuzzy matching Note that if `helm-buffers-fuzzy-matching' is non--nil you will have fuzzy matching on buffer names (not on directory name matching and major-mode though). A pattern starting with \"^\" will disable fuzzy matching and will match by exact regexp. -**** Examples: +**** Examples if I enter in pattern prompt: -\"*lisp ^helm @moc\" + + \"*lisp ^helm @moc\" + helm will narrow down the list by selecting only buffers that are in lisp mode, start by helm and match \"moc\" in their contents. if I enter in pattern prompt: -\"*lisp ^helm moc\" + + \"*lisp ^helm moc\" + Notice there is no \"@\" this time helm will look for lisp mode buffers starting by \"helm\" and have \"moc\" in their name. if I enter in pattern prompt: -\"*!lisp !helm\" + + \"*!lisp !helm\" + helm will narrow down to buffers that are not in \"lisp\" mode and that do not match \"helm\" if I enter in pattern prompt: -/helm/ w3 -helm will narrow down to buffers that are in any \"helm\" subdirectory and matching w3. + /helm/ w3 + +helm will narrow down to buffers that are in any \"helm\" subdirectory and matching w3. *** Creating buffers @@ -286,11 +166,12 @@ This list is customizable, see `helm-buffers-favorite-modes'. You have a command to kill buffer(s) and quit emacs and a command to kill buffers one by one \(no marked\) without quitting helm. + You can run this persistent kill buffer command either with the regular `helm-execute-persistent-action' called with a prefix arg (C-u C-j) or with its specific command `helm-buffer-run-kill-persistent' see binding below. -*** Meaning of colors and prefixes for buffers: +*** Meaning of colors and prefixes for buffers Remote buffers are prefixed with '@'. Red => Buffer have its file modified on disk by an external process. @@ -298,92 +179,133 @@ Indianred2 => Buffer exists but its file have been deleted. Orange => Buffer is modified and its file not saved to disk. Italic => A non--file buffer. -\n** Specific commands for `helm-buffers-list': +** Commands \\ -\\[helm-buffer-run-zgrep]\t\t->Grep Buffer(s) works as zgrep too (C-u grep all buffers but non--file buffers). -\\[helm-buffers-run-multi-occur]\t\t->Multi Occur buffer or marked buffers. (C-u toggle force searching current-buffer). -\\[helm-buffer-switch-other-window]\t\t->Switch other window. -\\[helm-buffer-switch-other-frame]\t\t->Switch other frame. -\\[helm-buffer-run-query-replace-regexp]\t\t->Query replace regexp in marked buffers. -\\[helm-buffer-run-query-replace]\t\t->Query replace in marked buffers. -\\[helm-buffer-run-ediff]\t\t->Ediff current buffer with candidate. If two marked buffers ediff those buffers. -\\[helm-buffer-run-ediff-merge]\t\t->Ediff merge current buffer with candidate. If two marked buffers ediff merge those buffers. -\\[helm-buffer-diff-persistent]\t\t->Toggle Diff buffer with saved file without quitting. -\\[helm-buffer-revert-persistent]\t\t->Revert buffer without quitting. -\\[helm-buffer-save-persistent]\t\t->Save buffer without quitting. -\\[helm-buffer-run-kill-buffers]\t\t->Delete marked buffers and quit. -\\[helm-buffer-run-kill-persistent]\t\t->Delete buffer without quitting helm. -\\[helm-toggle-all-marks]\t\t->Toggle all marks. -\\[helm-mark-all]\t\t->Mark all. -\\[helm-toggle-buffers-details]\t\t->Toggle details. -\\[helm-buffers-toggle-show-hidden-buffers]\t\t->Show hidden buffers. -\\[helm-buffers-mark-similar-buffers]\t\t->Mark all buffers with same type (color) than current. -\\[helm-buffer-help]\t\t->Display this help. -\n** Helm Map -\\{helm-map}") - -;;;###autoload -(defun helm-buffer-help () - "Help command for helm buffers." - (interactive) - (let ((helm-help-message helm-buffer-help-message)) - (helm-help))) +\\[helm-buffer-run-zgrep]\t\tGrep Buffer(s) works as zgrep too (C-u grep all buffers but non--file buffers). +\\[helm-buffers-run-multi-occur]\t\tMulti Occur buffer or marked buffers. (C-u toggle force searching current-buffer). +\\[helm-buffer-switch-other-window]\t\tSwitch other window. +\\[helm-buffer-switch-other-frame]\t\tSwitch other frame. +\\[helm-buffer-run-query-replace-regexp]\t\tQuery replace regexp in marked buffers. +\\[helm-buffer-run-query-replace]\t\tQuery replace in marked buffers. +\\[helm-buffer-run-ediff]\t\tEdiff current buffer with candidate. If two marked buffers ediff those buffers. +\\[helm-buffer-run-ediff-merge]\t\tEdiff merge current buffer with candidate. If two marked buffers ediff merge those buffers. +\\[helm-buffer-diff-persistent]\t\tToggle Diff buffer with saved file without quitting. +\\[helm-buffer-revert-persistent]\t\tRevert buffer without quitting. +\\[helm-buffer-save-persistent]\t\tSave buffer without quitting. +\\[helm-buffer-run-kill-buffers]\t\tDelete marked buffers and quit. +\\[helm-buffer-run-kill-persistent]\t\tDelete buffer without quitting helm. +\\[helm-toggle-all-marks]\t\tToggle all marks. +\\[helm-mark-all]\t\tMark all. +\\[helm-toggle-buffers-details]\t\tToggle details. +\\[helm-buffers-toggle-show-hidden-buffers]\t\tShow hidden buffers. +\\[helm-buffers-mark-similar-buffers]\t\tMark all buffers with same type (color) than current.") ;;; Find files help (`helm-find-files') ;; ;; (defvar helm-ff-help-message - "\n* Helm Find Files\n + "* Helm Find Files + +** Tips + +*** Navigation summary + +For a better experience you can enable auto completion by setting +`helm-ff-auto-update-initial-value' to non-nil in your init file. +It is not enabled by default to not confuse new users. + +**** Use `C-j' (persistent action) on a directory to go down one level + +On a symlinked directory a prefix arg will allow expanding to its true name. + +**** Use `C-l' on a directory to go up one level + +**** Use `C-r' to walk back the resulting tree of all the `C-l' you did + +Note: The tree is reinitialized each time you enter a new tree with `C-j' +or by entering some pattern in prompt. + +*** Find file at point + +Helm is using `ffap' partially or completely to find file at point +depending on value of `helm-ff-guess-ffap-filenames'. +You can use full `ffap' by setting this to non-nil (annoying). +Default value is nil which make `ffap' working partially. + +**** Find file at number line + +With something like this at point: + + ~/elisp/helm/helm.el:1234 + +Helm will find this file at line number 1234. + +**** Find url at point -** Helm find files tips: +When an url is found at point, helm expand to that url only. +Pressing RET jump to that url using `browse-url-browser-function'. -*** Quick pattern expansion: +**** Find mail at point -\n**** Enter `~/' at end of pattern to quickly reach home directory. +When a mail address is found at point helm expand to this email address +prefixed by \"mailto:\". Pressing RET open a message buffer with this mail +address. -**** Enter `/' at end of pattern to quickly reach root of your file system. +*** Quick pattern expansion -**** Enter `./' at end of pattern to quickly reach `default-directory' (initial start of session). - If you are already in `default-directory' this will move cursor on top. +**** Enter `~/' at end of pattern to quickly reach home directory -**** Enter `../' at end of pattern will reach upper directory, moving cursor on top. - NOTE: This is different to using `C-l' in that `C-l' don't move cursor on top but stay on previous - subdir name. +**** Enter `/' at end of pattern to quickly reach root of your file system -**** Enter any environment var (e.g `$HOME') at end of pattern, it will be expanded. +**** Enter `./' at end of pattern to quickly reach `default-directory' (initial start of session) -**** You can yank any valid filename after pattern, it will be expanded. +If you are already in `default-directory' this will move cursor on top. -*** You can complete with partial basename (start on third char entered) +**** Enter `../' at end of pattern will reach upper directory, moving cursor on top - e.g \"fob\" or \"fbr\" will complete \"foobar\" - but \"fb\" will wait for a third char for completing. +NOTE: This is different to using `C-l' in that `C-l' don't move cursor on top but stay on previous +subdir name. -*** Use `C-u C-j' to watch an image. +**** Enter any environment var (e.g. `$HOME') at end of pattern, it will be expanded -*** `C-j' on a filename will expand in helm-buffer to this filename. - Second hit on `C-j' will display buffer filename. - Third hit on `C-j' will kill buffer filename. - NOTE: `C-u C-j' will display buffer directly. +**** You can yank any valid filename after pattern, it will be expanded -*** To browse images directories turn on `helm-follow-mode' and navigate with arrow keys. - You can also use `helm-follow-action-forward' and `helm-follow-action-backward' - (`C-'). +*** Helm find files is fuzzy matching (start on third char entered) -*** You can turn off/on (toggle) autoupdate completion at any moment with `C-DEL'. - NOTE: On a terminal C- may not work, use in this case C-c . +e.g. \"fob\" or \"fbr\" will complete \"foobar\" +but \"fb\" will wait for a third char for completing. -*** You can create a new directory and a new file at the same time. - just write the path in prompt and press `'. - e.g You can create \"~/new/newnew/newnewnew/my_newfile.txt\". +*** Use `C-u C-j' to watch an image or `C-' -*** To create a new directory, add a \"/\" at end of new name and press . +*** `C-j' on a filename will expand in helm-buffer to this filename -*** To create a new file just write the filename not ending with \"/\". +Second hit on `C-j' will display buffer filename. +Third hit on `C-j' will kill buffer filename. +NOTE: `C-u C-j' will display buffer directly. + +*** To browse images directories turn on `helm-follow-mode' and navigate with arrow keys + +You can also use `helm-follow-action-forward' and `helm-follow-action-backward' +\(`C-'). + +*** You can turn off/on (toggle) autoupdate completion at any moment with `C-DEL' + +It is useful when auto completion is enabled and when trying to create a new file +or directory you want to prevent helm trying to complete what you are writing. +NOTE: On a terminal C- may not work, use in this case C-c . + +*** You can create a new directory and a new file at the same time + +Just write the path in prompt and press `'. +e.g. You can create \"~/new/newnew/newnewnew/my_newfile.txt\". + +*** To create a new directory, add a \"/\" at end of new name and press + +*** To create a new file just write the filename not ending with \"/\" *** Recursive search from helm find files -**** You can use helm browse project (see binding below). +**** You can use helm browse project (see binding below) - With no prefix arg If your current directory is under version control @@ -398,10 +320,11 @@ Italic => A non--file buffer. - With two prefix args same but the cache will be refreshed. -**** You can start a recursive search with Locate of Find (See commands below). - With Locate you can use a local db with a prefix arg; If the localdb doesn't already - exists, you will be prompted for its creation, if it exists and you want to refresh it, - give two prefix args. +**** You can start a recursive search with Locate of Find (See commands below) + +With Locate you can use a local db with a prefix arg. If the localdb doesn't already +exists, you will be prompted for its creation, if it exists and you want to refresh it, +give two prefix args. *** Insert filename at point or complete filename at point @@ -421,18 +344,17 @@ On completion: Use of wilcard is supported to give a set of files to an action: -e.g -You can copy all the files with \".el\" extension by using \"*.el\" +e.g. You can copy all the files with \".el\" extension by using \"*.el\" and then run your copy action. You can do the same but with \"**.el\" (note the two stars), this will select recursively all \".el\" files under current directory. -NOTE: When using an action that involve an external backend (e.g grep), using \"**\" +NOTE: When using an action that involve an external backend (e.g. grep), using \"**\" is not advised (even if it works fine) because it will be slower to select all your files, you have better time letting the backend doing it, it will be faster. However, if you know you have not many files it is reasonable to use this, -also using not recursive wilcard (e.g \"*.el\") is perfectly fine for this. +also using not recursive wilcard (e.g. \"*.el\") is perfectly fine for this. This feature (\"**\") is activated by default with the option `helm-file-globstar'. The directory selection with \"**foo/\" like bash shopt globstar option is not supported yet. @@ -458,145 +380,148 @@ You can navigate to a project containing an ID file created with the `mkid' command from id-utils, and run the `gid' command which will use the symbol at point in `helm-current-buffer' as default. -\n** Specific commands for `helm-find-files':\n +** Commands \\ -\\[helm-ff-run-locate]\t\t->Run Locate (C-u to specify locate db, M-n insert basename of candidate) -\\[helm-ff-run-browse-project]\t\t->Browse project (`C-u' recurse, `C-u C-u' recurse and refresh db) -\\[helm-ff-run-find-sh-command]\t\t->Run Find shell command from this directory. -\\[helm-ff-run-grep]\t\t->Run Grep (C-u Recursive). -\\[helm-ff-run-pdfgrep]\t\t->Run Pdfgrep on marked files. -\\[helm-ff-run-zgrep]\t\t->Run zgrep (C-u Recursive). -\\[helm-ff-run-gid]\t\t->Run gid (id-utils). -\\[helm-ff-run-etags]\t\t->Run Etags (C-u use thing-at-point `C-u C-u' reload cache) -\\[helm-ff-run-rename-file]\t\t->Rename File (C-u Follow). -\\[helm-ff-run-query-replace-on-marked]\t\t->Query replace on marked files. -\\[helm-ff-run-copy-file]\t\t->Copy File (C-u Follow). -\\[helm-ff-run-byte-compile-file]\t\t->Byte Compile File (C-u Load). -\\[helm-ff-run-load-file]\t\t->Load File. -\\[helm-ff-run-symlink-file]\t\t->Symlink File. -\\[helm-ff-run-hardlink-file]\t\t->Hardlink file. -\\[helm-ff-run-delete-file]\t\t->Delete File. -\\[helm-ff-run-kill-buffer-persistent]\t\t->Kill buffer candidate without quitting. -\\[helm-ff-persistent-delete]\t\t->Delete file without quitting. -\\[helm-ff-run-switch-to-eshell]\t\t->Switch to Eshell. -\\[helm-ff-run-eshell-command-on-file]\t\t->Eshell command on file (C-u Apply on marked files, otherwise treat them sequentially). -\\[helm-ff-run-ediff-file]\t\t->Ediff file. -\\[helm-ff-run-ediff-merge-file]\t\t->Ediff merge file. -\\[helm-ff-run-complete-fn-at-point]\t\t->Complete file name at point. -\\[helm-ff-run-switch-other-window]\t\t->Switch other window. -\\[helm-ff-run-switch-other-frame]\t\t->Switch other frame. -\\[helm-ff-run-open-file-externally]\t\t->Open file with external program (C-u to choose). -\\[helm-ff-run-open-file-with-default-tool]\t\t->Open file externally with default tool. -\\[helm-ff-rotate-left-persistent]\t\t->Rotate Image Left. -\\[helm-ff-rotate-right-persistent]\t\t->Rotate Image Right. -\\[helm-find-files-up-one-level]\t\t->Go down precedent directory. -\\[helm-ff-run-switch-to-history]\t\t->Switch to last visited directories history. -\\[helm-ff-file-name-history]\t\t->Switch to file name history. -\\[helm-ff-properties-persistent]\t\t->Show file properties in a tooltip. -\\[helm-mark-all]\t\t->Mark all visibles candidates. -\\[helm-ff-run-toggle-auto-update]\t\t->Toggle auto expansion of directories. -\\[helm-unmark-all]\t\t->Unmark all candidates, visibles and invisibles. -\\[helm-ff-run-gnus-attach-files]\t\t->Gnus attach files to message buffer. -\\[helm-ff-run-print-file]\t\t->Print file, (C-u to refresh printers list). -\\[helm-enlarge-window]\t\t->Enlarge helm window. -\\[helm-narrow-window]\t\t->Narrow helm window. -\\[helm-ff-run-toggle-basename]\t\t->Toggle basename/fullpath. -\\[helm-ff-run-find-file-as-root]\t\t->Find file as root. -\\[helm-ff-run-insert-org-link]\t\t->Insert org link. -\\[helm-ff-help]\t\t->Display this help info. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-ff-help () - "Help command for `helm-find-files'." - (interactive) - (let ((helm-help-message helm-ff-help-message)) - (helm-help))) +\\[helm-ff-run-locate]\t\tRun Locate (C-u to specify locate db, M-n insert basename of candidate) +\\[helm-ff-run-browse-project]\t\tBrowse project (`C-u' recurse, `C-u C-u' recurse and refresh db) +\\[helm-ff-run-find-sh-command]\t\tRun Find shell command from this directory. +\\[helm-ff-run-grep]\t\tRun Grep (C-u Recursive). +\\[helm-ff-run-pdfgrep]\t\tRun Pdfgrep on marked files. +\\[helm-ff-run-zgrep]\t\tRun zgrep (C-u Recursive). +\\[helm-ff-run-grep-ag]\t\tRun AG grep on current directory. +\\[helm-ff-run-git-grep]\t\tRun git-grep on current directory. +\\[helm-ff-run-gid]\t\tRun gid (id-utils). +\\[helm-ff-run-etags]\t\tRun Etags (C-u use thing-at-point `C-u C-u' reload cache) +\\[helm-ff-run-rename-file]\t\tRename File (C-u Follow). +\\[helm-ff-run-query-replace-on-marked]\t\tQuery replace on marked files. +\\[helm-ff-run-copy-file]\t\tCopy File (C-u Follow). +\\[helm-ff-run-byte-compile-file]\t\tByte Compile File (C-u Load). +\\[helm-ff-run-load-file]\t\tLoad File. +\\[helm-ff-run-symlink-file]\t\tSymlink File. +\\[helm-ff-run-hardlink-file]\t\tHardlink file. +\\[helm-ff-run-delete-file]\t\tDelete File. +\\[helm-ff-run-kill-buffer-persistent]\t\tKill buffer candidate without quitting. +\\[helm-ff-persistent-delete]\t\tDelete file without quitting. +\\[helm-ff-run-switch-to-eshell]\t\tSwitch to Eshell. +\\[helm-ff-run-eshell-command-on-file]\t\tEshell command on file (C-u Apply on marked files, otherwise treat them sequentially). +\\[helm-ff-run-ediff-file]\t\tEdiff file. +\\[helm-ff-run-ediff-merge-file]\t\tEdiff merge file. +\\[helm-ff-run-complete-fn-at-point]\t\tComplete file name at point. +\\[helm-ff-run-switch-other-window]\t\tSwitch other window. +\\[helm-ff-run-switch-other-frame]\t\tSwitch other frame. +\\[helm-ff-run-open-file-externally]\t\tOpen file with external program (C-u to choose). +\\[helm-ff-run-open-file-with-default-tool]\t\tOpen file externally with default tool. +\\[helm-ff-rotate-left-persistent]\t\tRotate Image Left. +\\[helm-ff-rotate-right-persistent]\t\tRotate Image Right. +\\[helm-find-files-up-one-level]\t\tGo down precedent directory. +\\[helm-ff-run-switch-to-history]\t\tSwitch to last visited directories history. +\\[helm-ff-file-name-history]\t\tSwitch to file name history. +\\[helm-ff-properties-persistent]\t\tShow file properties in a tooltip. +\\[helm-mark-all]\t\tMark all visibles candidates. +\\[helm-ff-run-toggle-auto-update]\t\tToggle auto expansion of directories. +\\[helm-unmark-all]\t\tUnmark all candidates, visibles and invisibles. +\\[helm-ff-run-gnus-attach-files]\t\tGnus attach files to message buffer. +\\[helm-ff-run-print-file]\t\tPrint file, (C-u to refresh printers list). +\\[helm-enlarge-window]\t\tEnlarge helm window. +\\[helm-narrow-window]\t\tNarrow helm window. +\\[helm-ff-run-toggle-basename]\t\tToggle basename/fullpath. +\\[helm-ff-run-find-file-as-root]\t\tFind file as root. +\\[helm-ff-run-find-alternate-file]\t\tFind alternate file. +\\[helm-ff-run-insert-org-link]\t\tInsert org link.") ;;; Help for `helm-read-file-name' ;; ;; (defvar helm-read-file-name-help-message - "\n* Helm read file name\n + "* Helm read file name -** Helm read file name tips: +** Tips -\n*** Enter `~/' at end of pattern to quickly reach home directory. +If you are here, you are probably using a vanilla command like `find-file' +helmized by `helm-mode', this is cool, but it is even better for your file +navigation to use `helm-find-files' which is fully featured. -*** Enter `/' at end of pattern to quickly reach root of your file system. +*** Navigation -*** Enter `./' at end of pattern to quickly reach `default-directory' (initial start of session). - If you are in `default-directory' move cursor on top. +**** Enter `~/' at end of pattern to quickly reach home directory -*** Enter `../' at end of pattern will reach upper directory, moving cursor on top. - NOTE: This different to using `C-l' in that `C-l' don't move cursor on top but stay on previous - subdir name. +**** Enter `/' at end of pattern to quickly reach root of your file system -*** You can complete with partial basename (start on third char entered) +**** Enter `./' at end of pattern to quickly reach `default-directory' (initial start of session) - e.g \"fob\" or \"fbr\" will complete \"foobar\" - but \"fb\" will wait for a third char for completing. +If you are in `default-directory' move cursor on top. -*** Persistent actions: +**** Enter `../' at end of pattern will reach upper directory, moving cursor on top -By default `helm-read-file-name' use the persistent actions of `helm-find-files'. +NOTE: This different to using `C-l' in that `C-l' don't move cursor on top but stay on previous +subdir name. -**** Use `C-u C-j' to watch an image. +**** You can complete with partial basename (start on third char entered) -**** `C-j' on a filename will expand in helm-buffer to this filename. - Second hit on `C-j' will display buffer filename. - Third hit on `C-j' will kill buffer filename. - NOTE: `C-u C-j' will display buffer directly. +E.g. \"fob\" or \"fbr\" will complete \"foobar\" +but \"fb\" will wait for a third char for completing. -**** To browse images directories turn on `helm-follow-mode' and navigate with arrow keys. +*** Persistent actions -**** When you want to delete backward characters to e.g creating a new file or directory, - autoupdate may keep updating to an existent directory - preventing you to do so, in this case just hit C- and then . - This should not needed when copying/renaming files because autoupdate is disabled - by default in this case. - NOTE: On a terminal C- may not work, use in this case C-c . +By default `helm-read-file-name' use the persistent actions of `helm-find-files' -**** You can create a new directory and a new file at the same time, just write the path in prompt - and press . - e.g You can create \"~/new/newnew/newnewnew/my_newfile.txt\". +**** Use `C-u C-j' to watch an image -**** To create a new directory, add a \"/\" at end of new name and press . +**** `C-j' on a filename will expand in helm-buffer to this filename -**** To create a new file just write the filename not ending with \"/\". +Second hit on `C-j' will display buffer filename. +Third hit on `C-j' will kill buffer filename. +NOTE: `C-u C-j' will display buffer directly. -\n** Specific commands for helm-read-file-name:\n -\\ -\\[helm-find-files-up-one-level]\t\t->Go down precedent directory. -\\[helm-ff-run-toggle-auto-update]\t\t->Toggle auto expansion of directories. -\\[helm-ff-run-toggle-basename]\t\t->Toggle basename. -\\[helm-ff-file-name-history]\t\t->File name history. -C/\\[helm-cr-empty-string]\t\t->Maybe return empty string (unless `must-match'). -\\[helm-next-source]\t\t->Goto next source. -\\[helm-previous-source]\t->Goto previous source. -\\[helm-read-file-name-help]\t\t->Display this help info. -\n** Helm Map\n -\\{helm-map}") +**** To browse images directories turn on `helm-follow-mode' and navigate with arrow keys -;;;###autoload -(defun helm-read-file-name-help () - "Help command for `read-file-name'." - (interactive) - (let ((helm-help-message helm-read-file-name-help-message)) - (helm-help))) +*** Delete characters backward + +When you want to delete backward characters, e.g. to create a new file or directory, +autoupdate may keep updating to an existent directory preventing you from doing so. +In this case, type C- and then . +This should not be needed when copying/renaming files because autoupdate is disabled +by default in that case. +NOTE: On a terminal C- may not work, use in this case C-c . + +*** Create new directory and files + +**** Create a new directory and a new file at the same time + +You can create a new directory and a new file at the same time, +just write the path in prompt and press . +E.g. You can create \"~/new/newnew/newnewnew/my_newfile.txt\". + +**** To create a new directory, add a \"/\" at end of new name and press + +**** To create a new file just write the filename not ending with \"/\" + +_NOTE_: File and directory creation work only in some commands (e.g `find-file') +and will not work in other commands where it is not intended to return a file or a directory +\(e.g `list-directory'). + +** Commands +\\ +\\[helm-find-files-up-one-level]\t\tGo down precedent directory. +\\[helm-ff-run-toggle-auto-update]\t\tToggle auto expansion of directories. +\\[helm-ff-run-toggle-basename]\t\tToggle basename. +\\[helm-ff-file-name-history]\t\tFile name history. +C/\\[helm-cr-empty-string]\t\tMaybe return empty string (unless `must-match'). +\\[helm-next-source]\t\tGoto next source. +\\[helm-previous-source]\t\tGoto previous source.") ;;; Generic file help - Used by locate. ;; ;; (defvar helm-generic-file-help-message - "\n* Helm Generic files\n + "* Helm Generic files -** Helm generic file tips:\n +** Tips *** Locate + You can add after writing search pattern any of the locate command line options. -e.g -b, -e, -n ...etc. +e.g. -b, -e, -n ...etc. See Man locate for more infos. Some other sources (at the moment recentf and file in current directory sources) @@ -619,47 +544,52 @@ You can pass arbitrary options directly to find after a \"*\" separator. For example, this would find all files matching \"book\" that are larger than 1 megabyte: -book * -size +1M - -\n** Specific commands for helm locate and others files sources: + book * -size +1M +** Commands \\ -\\[helm-ff-run-toggle-basename]\t\t->Toggle basename. -\\[helm-ff-run-grep]\t\t->Run grep (C-u recurse). -\\[helm-ff-run-pdfgrep]\t\t->Run Pdfgrep on marked files. -\\[helm-ff-run-delete-file]\t\t->Delete file. -\\[helm-ff-run-ediff-file]\t\t->Ediff file. -\\[helm-ff-run-ediff-merge-file]\t\t->Ediff merge file. -\\[helm-ff-run-switch-other-window]\t\t->Switch other window. -\\[helm-ff-properties-persistent]\t\t->Show file properties. -\\[helm-ff-run-etags]\t\t->Run etags (C-u use tap, C-u C-u reload DB). -\\[helm-yank-text-at-point]\t\t->Yank text at point. -\\[helm-ff-run-open-file-externally]\t\t->Open file with external program (C-u to choose). -\\[helm-ff-run-open-file-with-default-tool]\t\t->Open file externally with default tool. -\\[helm-ff-run-insert-org-link]\t\t->Insert org link. -\\[helm-generic-file-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-generic-file-help () - "Global help for helm." - (interactive) - (let ((helm-help-message helm-generic-file-help-message)) - (helm-help))) +\\[helm-ff-run-toggle-basename]\t\tToggle basename. +\\[helm-ff-run-grep]\t\tRun grep (C-u recurse). +\\[helm-ff-run-zgrep]\t\tRun zgrep. +\\[helm-ff-run-gid]\t\tRun gid (id-utils). +\\[helm-ff-run-pdfgrep]\t\tRun Pdfgrep on marked files. +\\[helm-ff-run-copy-file]\t\tCopy file(s) +\\[helm-ff-run-rename-file]\t\tRename file(s). +\\[helm-ff-run-symlink-file]\t\tSymlink file(s). +\\[helm-ff-run-hardlink-file]\t\tHardlink file(s). +\\[helm-ff-run-delete-file]\t\tDelete file(s). +\\[helm-ff-run-byte-compile-file]\t\tByte compile file(s) (C-u load) (elisp). +\\[helm-ff-run-load-file]\t\tLoad file(s) (elisp). +\\[helm-ff-run-ediff-file]\t\tEdiff file. +\\[helm-ff-run-ediff-merge-file]\t\tEdiff merge file. +\\[helm-ff-run-switch-other-window]\t\tSwitch other window. +\\[helm-ff-properties-persistent]\t\tShow file properties. +\\[helm-ff-run-etags]\t\tRun etags (C-u use tap, C-u C-u reload DB). +\\[helm-yank-text-at-point]\t\tYank text at point. +\\[helm-ff-run-open-file-externally]\t\tOpen file with external program (C-u to choose). +\\[helm-ff-run-open-file-with-default-tool]\t\tOpen file externally with default tool. +\\[helm-ff-run-insert-org-link]\t\tInsert org link.") ;;; Grep help ;; ;; (defvar helm-grep-help-message - "\n* Helm Grep\n -** Helm grep tips:\n -*** You can start grep with a prefix arg to recurse in subdirectories. -*** You can use wild card when selecting files (e.g *.el) -*** You can grep in many differents directories by marking files or wild cards. -*** You can save your results in a grep-mode buffer, see commands below. - -*** Important:\n + "* Helm Grep + +** Tips + +*** You can start grep with a prefix arg to recurse in subdirectories + +*** You can use wild card when selecting files (e.g. *.el) + +*** You can grep in many differents directories by marking files or wild cards + +*** You can save your results in a `helm-grep-mode' buffer, see commands below + +Once in this buffer you can use emacs-wgrep to edit your changes. + +*** Important + Grepping on remote file will work only with grep, not ack-grep, but it is anyway bad supported as tramp doesn't support multiple process running in a short delay (less than 5s actually) among other things, @@ -669,8 +599,9 @@ your regexp is ready to send to remote process, even if helm is handling this by delaying each process at 5s. Or even better don't use tramp at all and mount your remote file system on SSHFS. -* Helm Gid\n -** Helm Gid tips +* Helm Gid + +** Tips Helm gid read the database created with the `mkid' command from id-utils. The name of the database file can be customized with `helm-gid-db-file-name', it @@ -679,138 +610,108 @@ Helm Gid use the symbol at point as default-input. You have access to this command also from `helm-find-files' which allow you to navigate to another directory to consult its database. -\n** Specific commands for Helm Grep:\n -\\ -\\[helm-goto-next-file]\t->Next File. -\\[helm-goto-precedent-file]\t\t->Precedent File. -\\[helm-yank-text-at-point]\t\t->Yank Text at point in minibuffer. -\\[helm-grep-run-other-window-action]\t\t->Jump other window. -\\[helm-grep-run-other-frame-action]\t\t->Jump other frame. -\\[helm-grep-run-persistent-action]\t\t->Run persistent action (Same as `C-j'). -\\[helm-grep-run-default-action]\t\t->Run default action (Same as RET). -\\[helm-grep-run-save-buffer]\t\t->Save to a `grep-mode' enabled buffer. -\\[helm-grep-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") +* Helm AG -;;;###autoload -(defun helm-grep-help () - "Help command for helm grep." - (interactive) - (let ((helm-help-message helm-grep-help-message)) - (helm-help))) +** Tips + +Helm AG is different from grep or ack-grep in that it works on a directory and not +a list of files. +You can ignore files and directories by using a \".agignore\" file, local to directory +or global when placed in home directory (See AG man page for more infos). +This file supports same entries as what you will find in `helm-grep-ignored-files' and +`helm-grep-ignored-directories'. +As always you can access helm AG from `helm-find-files'. + +** Commands +\\ +\\[helm-goto-next-file]\t\tNext File. +\\[helm-goto-precedent-file]\t\tPrecedent File. +\\[helm-yank-text-at-point]\t\tYank Text at point in minibuffer. +\\[helm-grep-run-other-window-action]\t\tJump other window. +\\[helm-grep-run-other-frame-action]\t\tJump other frame. +\\[helm-grep-run-default-action]\t\tRun default action (Same as RET). +\\[helm-grep-run-save-buffer]\t\tSave to a `helm-grep-mode' enabled buffer.") ;;; Pdf grep help ;; ;; (defvar helm-pdfgrep-help-message - "\n* Helm PdfGrep Map\n -\n** Specific commands for Pdf Grep:\n -\\ -\\[helm-goto-next-file]\t->Next File. -\\[helm-goto-precedent-file]\t\t->Precedent File. -\\[helm-yank-text-at-point]\t\t->Yank Text at point in minibuffer. -\\[helm-pdfgrep-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") + "* Helm PdfGrep Map -;;;###autoload -(defun helm-pdfgrep-help () - "Help command for pdfgrep." - (interactive) - (let ((helm-help-message helm-pdfgrep-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-goto-next-file]\t\tNext File. +\\[helm-goto-precedent-file]\t\tPrecedent File. +\\[helm-yank-text-at-point]\t\tYank Text at point in minibuffer.") ;;; Etags help ;; ;; (defvar helm-etags-help-message - "\n* Helm Etags Map\n -\n** Specific commands for Etags:\n -\\ -\\[helm-goto-next-file]\t->Next File. -\\[helm-goto-precedent-file]\t\t->Precedent File. -\\[helm-yank-text-at-point]\t\t->Yank Text at point in minibuffer. -\\[helm-etags-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") + "* Helm Etags Map -;;;###autoload -(defun helm-etags-help () - "The help function for etags." - (interactive) - (let ((helm-help-message helm-etags-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-goto-next-file]\t\tNext File. +\\[helm-goto-precedent-file]\t\tPrecedent File. +\\[helm-yank-text-at-point]\t\tYank Text at point in minibuffer.") ;;; Ucs help ;; ;; (defvar helm-ucs-help-message - "\n* Helm Ucs\n -\n** Specific commands for `helm-ucs':\n -\\ -\\[helm-ucs-persistent-insert]\t->Insert char. -\\[helm-ucs-persistent-forward]\t->Forward char. -\\[helm-ucs-persistent-backward]\t->Backward char. -\\[helm-ucs-persistent-delete]\t->Delete char backward. -\\[helm-ucs-help]\t\t->Show this help. + "* Helm Ucs -\n** Helm Map\n -\\{helm-map}") +** Tips -;;;###autoload -(defun helm-ucs-help () - "Help command for `helm-ucs'." - (interactive) - (let ((helm-help-message helm-ucs-help-message)) - (helm-help))) +Use commands below to insert unicode characters +in current-buffer without quitting helm. + +** Commands +\\ +\\[helm-ucs-persistent-insert]\t\tInsert char. +\\[helm-ucs-persistent-forward]\t\tForward char. +\\[helm-ucs-persistent-backward]\t\tBackward char. +\\[helm-ucs-persistent-delete]\t\tDelete char backward.") ;;; Bookmark help ;; ;; (defvar helm-bookmark-help-message - "\n* Helm bookmark name\n -\n** Specific commands for bookmarks:\n -\\ -\\[helm-bookmark-run-jump-other-window]\t\t->Jump other window. -\\[helm-bookmark-run-delete]\t\t->Delete bookmark. -\\[helm-bookmark-run-edit]\t\t->Edit bookmark. -\\[helm-bookmark-toggle-filename]\t\t->Toggle bookmark location visibility. -\\[helm-bookmark-help]\t\t->Run this help. -\n** Helm Map\n -\\{helm-map}") + "* Helm bookmark name -;;;###autoload -(defun helm-bookmark-help () - "Help command for bookmarks." - (interactive) - (let ((helm-help-message helm-bookmark-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-bookmark-run-jump-other-window]\t\tJump other window. +\\[helm-bookmark-run-delete]\t\tDelete bookmark. +\\[helm-bookmark-run-edit]\t\tEdit bookmark. +\\[helm-bookmark-toggle-filename]\t\tToggle bookmark location visibility.") ;;; Eshell command on file help ;; ;; (defvar helm-esh-help-message - "\n* Helm eshell on file\n -** Helm eshell on file tips: + "* Helm eshell on file -*** Passing extra args after filename: +** Tips -Normally your command or alias will be called with file as argument. +*** Passing extra args after filename -e.g 'candidate_file' +Normally your command or alias will be called with file as argument. E.g., + + 'candidate_file' But you can also pass an argument or more after 'candidate_file' like this: - %s [extra_args]\n + %s [extra_args] 'candidate_file' will be added at '%s' and your command will look at this: - 'candidate_file' [extra_args] + 'candidate_file' [extra_args] -*** Specify many files as args (marked files): +*** Specify many files as args (marked files) -e.g file1 file2 ... +E.g. file1 file2 ... Call `helm-find-files-eshell-command-on-file' with one prefix-arg Otherwise you can pass one prefix-arg from the command selection buffer. @@ -822,53 +723,36 @@ the output is printed to your `current-buffer'. Note that with no prefix-arg or a prefix-arg value of '(16) (C-u C-u) the command is called once for each file like this: - file1 file2 etc... - -\n** Specific commands for `helm-find-files-eshell-command-on-file':\n -\\ -\\[helm-esh-help]\t\t->Display this help. -\n** Helm Map\n -\\{helm-map}") + file1 file2 etc... -;;;###autoload -(defun helm-esh-help () - "Help command for `helm-find-files-eshell-command-on-file'." - (interactive) - (let ((helm-help-message helm-esh-help-message)) - (helm-help))) +** Commands +\\") ;;; Ido virtual buffer help ;; ;; (defvar helm-buffers-ido-virtual-help-message - "\n* Helm ido virtual buffers\n -\n** Specific commands for ido virtuals buffers:\n -\\ -\\[helm-ff-run-switch-other-window]\t\t->Switch other window. -\\[helm-ff-run-switch-other-frame]\t\t->Switch other frame. -\\[helm-ff-run-grep]\t\t->Grep file. -\\[helm-ff-run-zgrep]\t\t->Zgrep file. -\\[helm-ff-run-delete-file]\t\t->Delete file. -\\[helm-ff-run-open-file-externally]\t\t->Open file externally. -\\[helm-buffers-ido-virtual-help]\t\t->Display this help. -\n** Helm Map\n -\\{helm-map}") + "* Helm ido virtual buffers -;;;###autoload -(defun helm-buffers-ido-virtual-help () - "Help command for ido virtual buffers." - (interactive) - (let ((helm-help-message helm-buffers-ido-virtual-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-ff-run-switch-other-window]\t\tSwitch other window. +\\[helm-ff-run-switch-other-frame]\t\tSwitch other frame. +\\[helm-ff-run-grep]\t\tGrep file. +\\[helm-ff-run-zgrep]\t\tZgrep file. +\\[helm-ff-run-delete-file]\t\tDelete file. +\\[helm-ff-run-open-file-externally]\t\tOpen file externally.") ;;; Moccur help ;; ;; (defvar helm-moccur-help-message - "\n* Helm Moccur\n -** Helm Moccur tips: + "* Helm Moccur + +** Tips *** Matching + Multiple regexp matching is allowed, just enter a space to separate your regexps. Matching empty lines is supported with the regexp \"^$\", you will get the results @@ -883,27 +767,30 @@ This is disabled by default, to enable this you have to add `helm-source-occur' and `helm-source-moccur' to `helm-sources-using-default-as-input'. *** Jump to the corresponding line in the searched buffer + You can do this with `C-j' (persistent-action), to do it repetitively you can use `C-' and `C-' or enable `helm-follow-mode' with `C-c C-f'. *** Saving results + Same as with helm-grep, you can save the results with `C-x C-s'. Of course if you don't save your results, you can get back your session with `helm-resume'. *** Refreshing the resumed session. + When the buffer(s) where you ran helm-(m)occur have been modified, you will be warned of this with the buffer flashing to red, you can refresh the buffer by running `C-c C-u'. This can be done automatically by customizing `helm-moccur-auto-update-on-resume'. *** Refreshing a saved buffer -Just hit `g' to update your buffer. + +Type `g' to update your buffer. *** Edit a saved buffer -To do so you have to install wgrep -https://github.com/mhayashi1120/Emacs-wgrep +First, install wgrep https://github.com/mhayashi1120/Emacs-wgrep and then: 1) C-c C-p to edit the buffer(s). @@ -912,85 +799,79 @@ and then: Tip: Use the excellent iedit https://github.com/tsdh/iedit to modify occurences in your buffer. -\n** Specific commands for Helm Moccur:\n +** Commands \\ -\\[helm-goto-next-file]\t->Next Buffer. -\\[helm-goto-precedent-file]\t\t->Precedent Buffer. -\\[helm-yank-text-at-point]\t\t->Yank Text at point in minibuffer. -\\[helm-moccur-run-goto-line-ow]\t\t->Goto line in other window. -\\[helm-moccur-run-goto-line-of]\t\t->Goto line in new frame. -\\[helm-moccur-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-moccur-help () - "Help command for (m)occur." - (interactive) - (let ((helm-help-message helm-moccur-help-message)) - (helm-help))) +\\[helm-goto-next-file]\t\tNext Buffer. +\\[helm-goto-precedent-file]\t\tPrecedent Buffer. +\\[helm-yank-text-at-point]\t\tYank Text at point in minibuffer. +\\[helm-moccur-run-goto-line-ow]\t\tGoto line in other window. +\\[helm-moccur-run-goto-line-of]\t\tGoto line in new frame.") ;;; Helm Top ;; ;; (defvar helm-top-help-message - "\n* Helm Top\n -\n** Helm Top tips: + "* Helm Top -\n** Specific commands for Helm Top:\n -\\ -\\[helm-top-run-sort-by-com]\t->Sort by commands. -\\[helm-top-run-sort-by-cpu]\t->Sort by cpu usage. -\\[helm-top-run-sort-by-user]\t->Sort alphabetically by user. -\\[helm-top-run-sort-by-mem]\t->Sort by memory. -\n** Helm Map\n -\\{helm-map}") +** Tips -;;;###autoload -(defun helm-top-help () - "Help command for top." - (interactive) - (let ((helm-help-message helm-top-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-top-run-sort-by-com]\t\tSort by commands. +\\[helm-top-run-sort-by-cpu]\t\tSort by cpu usage. +\\[helm-top-run-sort-by-user]\t\tSort alphabetically by user. +\\[helm-top-run-sort-by-mem]\t\tSort by memory.") ;;; Helm Apt ;; ;; (defvar helm-apt-help-message - "\n* Helm Apt\n -\n** Helm Apt tips: + "* Helm Apt -\n** Specific commands for Helm Apt:\n -\\ -\\[helm-apt-show-all]\t->Show all packages. -\\[helm-apt-show-only-installed]\t->Show installed packages only. -\\[helm-apt-show-only-not-installed]\t->Show not installed packages only. -\\[helm-apt-show-only-deinstalled]\t-Show deinstalled (not purged yet) packages only.> -\n** Helm Map\n -\\{helm-map}") +** Tips -;;;###autoload -(defun helm-apt-help () - "Help command for helm apt." - (interactive) - (let ((helm-help-message helm-apt-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-apt-show-all]\t\tShow all packages. +\\[helm-apt-show-only-installed]\t\tShow installed packages only. +\\[helm-apt-show-only-not-installed]\t\tShow not installed packages only. +\\[helm-apt-show-only-deinstalled]\t\tShow deinstalled (not purged yet) packages only.>") ;;; Helm elisp package ;; ;; (defvar helm-el-package-help-message - "\n* Helm elisp package\n -\n** Helm elisp package tips: + "* Helm elisp package + +** Tips + +*** Compile all your packages asynchronously + +When using async (if you have installed from MELPA you do), only helm, helm-core, +and magit are compiled asynchronously, if you want all your packages compiled async, +add to your init file: + + (setq async-bytecomp-allowed-packages '(all)) + *** Upgrade elisp packages +On initial start (when emacs is fetching packages on remote), if helm find +package to upgrade it will start in the upgradables packages view showing the packages +availables to upgrade. +On further starts, you will have to refresh the list with `C-c C-u', if helm find upgrades +you will have a message telling you some packages are available for upgrade, you can switch to +upgrade view (see below) to see what packages are available for upgrade or just hit `C-c U'. +to upgrade all. + To see upgradables packages hit . -Then you can install all upgradables packages with the upgrade all action, +Then you can install all upgradables packages with the upgrade all action (`C-c C-u'), or upgrade only the specific packages by marking them (the new ones) and running the upgrade action (visible only when there is upgradables packages). Of course you can upgrade a single package by just running the upgrade action -without marking it. +without marking it (`C-c u' or RET) . + +\*WARNING* You are strongly advised to RESTART emacs after UPGRADING packages. *** Meaning of flags prefixing packages (Emacs-25) @@ -1000,125 +881,82 @@ This feature is only available with emacs-25. - The flag \"U\" that prefix package names mean that this package is no more needed. This feature is only available with emacs-25. -\n** Specific commands for Helm elisp package:\n +** Commands \\ -\\[helm-el-package-show-all]\t->Show all packages. -\\[helm-el-package-show-installed]\t->Show installed packages only. -\\[helm-el-package-show-uninstalled]\t->Show not installed packages only. -\\[helm-el-package-show-upgrade]\t->Show upgradable packages only. -\\[helm-el-run-package-install]\t->Install package(s). -\\[helm-el-run-package-reinstall]\t->Reinstall package(s). -\\[helm-el-run-package-uninstall]\t->Uninstall package(s). -\\[helm-el-run-package-upgrade]\t->Upgrade package(s). -\\[helm-el-run-package-upgrade-all]\t->Upgrade all packages upgradables. -\\[helm-el-run-visit-homepage]\t->Visit package homepage. -\\[helm-el-package-help]\t->Show this help. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-el-package-help () - "Help command for emacs packages." - (interactive) - (let ((helm-help-message helm-el-package-help-message)) - (helm-help))) +\\[helm-el-package-show-all]\t\tShow all packages. +\\[helm-el-package-show-installed]\t\tShow installed packages only. +\\[helm-el-package-show-uninstalled]\t\tShow not installed packages only. +\\[helm-el-package-show-upgrade]\t\tShow upgradable packages only. +\\[helm-el-run-package-install]\t\tInstall package(s). +\\[helm-el-run-package-reinstall]\t\tReinstall package(s). +\\[helm-el-run-package-uninstall]\t\tUninstall package(s). +\\[helm-el-run-package-upgrade]\t\tUpgrade package(s). +\\[helm-el-run-package-upgrade-all]\t\tUpgrade all packages upgradables. +\\[helm-el-run-visit-homepage]\t\tVisit package homepage.") ;;; Helm M-x ;; ;; (defvar helm-M-x-help-message - "\n* Helm M-x\n -\n** Helm M-x tips: + "* Helm M-x -*** You can get help on any command with persistent action (C-j). +** Tips -*** All the prefix args passed BEFORE running `helm-M-x' are ignored, -you should have an error message if you do so. -When you want to pass prefix args, pass them AFTER starting `helm-M-x', -you will have a prefix arg counter appearing in mode-line notifying you -the amount of prefix args entered. +*** You can get help on any command with persistent action (C-j) -\n** Specific commands for Helm M-x:\n -\\ -\\[helm-M-x-help]\t\t->Show this help. -\n** Helm Map\n -\\{helm-map}") +*** Prefix Args -;;;###autoload -(defun helm-M-x-help () - "Help command for `helm-M-x'." - (interactive) - (let ((helm-help-message helm-M-x-help-message)) - (helm-help))) +All the prefix args passed BEFORE running `helm-M-x' are ignored, +you should get an error message if you do so. +When you want to pass prefix args, pass them AFTER starting `helm-M-x', +you will see a prefix arg counter appearing in mode-line notifying you +the number of prefix args entered.") ;;; helm-imenu ;; ;; (defvar helm-imenu-help-message - "\n* Helm imenu\n -\n** Helm imenu tips: + "* Helm imenu -\n** Specific commands for Helm imenu:\n -\\ -\\[helm-imenu-help]\t->Show this help. -\n** Helm Map\n -\\{helm-map}") +** Tips -;;;###autoload -(defun helm-imenu-help () - "Help command for imenu." - (interactive) - (let ((helm-help-message helm-imenu-help-message)) - (helm-help))) +** Commands +\\ +\\[helm-imenu-next-section]\t\tGo to next section. +\\[helm-imenu-previous-section]\t\tGo to previous section.") ;;; helm-colors ;; ;; (defvar helm-colors-help-message - "\n* Helm colors\n -\n** Specific commands for Helm colors:\n + "* Helm colors + +** Commands \\ \\[helm-color-run-insert-name]\t\tInsert the entry'name. \\[helm-color-run-kill-name]\t\tKill the entry's name. \\[helm-color-run-insert-rgb]\t\tInsert entry in RGB format. -\\[helm-color-run-kill-rgb]\t\tKill entry in RGB format. -\\[helm-color-help]\t\tShow this help. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-color-help () - "Help command for color." - (interactive) - (let ((helm-help-message helm-colors-help-message)) - (helm-help))) +\\[helm-color-run-kill-rgb]\t\tKill entry in RGB format.") ;;; helm semantic ;; ;; (defvar helm-semantic-help-message - "\n* Helm semantic\n -\n** Helm semantic tips: + "* Helm semantic -\n** Specific commands for Helm semantic:\n -\\ -\\[helm-semantic-help]\t->Show this help. -\n** Helm Map\n -\\{helm-map}") +** Tips -;;;###autoload -(defun helm-semantic-help () - "Help command for semantic." - (interactive) - (let ((helm-help-message helm-semantic-help-message)) - (helm-help))) +** Commands +\\") ;;; helm kmacro ;; ;; (defvar helm-kmacro-help-message - "\n* Helm kmacro\n -\n** Helm kmacro tips: + "* Helm kmacro + +** Tips + - Start recording some keys with `f3' - Record new kmacro with `f4' - Start `helm-execute-kmacro' to list all your macros. @@ -1129,161 +967,13 @@ you can change of kmacro with `helm-next-line' `helm-previous-line'. NOTE: You can't record keys running helm commands except `helm-M-x' unless you don't choose from there a command using helm completion. -\n** Specific commands for Helm kmacro:\n -\\ -\\[helm-kmacro-help]\t->Show this help. -\n** Helm Map\n -\\{helm-map}") - -;;;###autoload -(defun helm-kmacro-help () - "Help command for kmacro." - (interactive) - (let ((helm-help-message helm-kmacro-help-message)) - (helm-help))) +** Commands +\\") ;;; Mode line strings ;; ;; -;;;###autoload -(defvar helm-buffer-mode-line-string - '("Buffer(s)" "\ -\\\ -\\[helm-buffer-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-source-buffers-list'")) - -;;;###autoload -(defvar helm-color-mode-line-string - '("Colors" "\ -\\\ -\\[helm-color-help]:Help/\ -\\[helm-color-run-insert-name]:Insert name/\ -\\[helm-color-run-insert-rgb]:Insert RGB/\ -with shift: Kill")) - -;;;###autoload -(defvar helm-buffers-ido-virtual-mode-line-string - '("Killed Buffer(s)" "\ -\\\ -\\[helm-buffers-ido-virtual-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-source-buffers-list'")) - -;;;###autoload -(defvar helm-ff-mode-line-string "\ -\\\ -\\[helm-ff-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-source-find-files'") - -;;;###autoload -(defvar helm-read-file-name-mode-line-string "\ -\\\ -\\[helm-read-file-name-help]:Help \ -C/\\[helm-cr-empty-string]:Empty \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-source-find-files'.") - -;;;###autoload -(defvar helm-generic-file-mode-line-string "\ -\\\ -\\[helm-generic-file-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend" - "String displayed in mode-line in Locate.") - -;;;###autoload -(defvar helm-grep-mode-line-string"\ -\\\ -\\[helm-grep-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend" - "String displayed in mode-line in `helm-do-grep'.") - -;;;###autoload -(defvar helm-pdfgrep-mode-line-string "\ -\\\ -\\[helm-pdfgrep-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend" - "String displayed in mode-line in `helm-do-pdfgrep'.") - -;;;###autoload -(defvar helm-etags-mode-line-string "\ -\\\ -\\[helm-etags-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-etags-select'.") - -;;;###autoload -(defvar helm-ucs-mode-line-string "\ -\\\ -\\[helm-ucs-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" - "String displayed in mode-line in `helm-ucs'.") - -;;;###autoload -(defvar helm-bookmark-mode-line-string - '("Bookmark(s)" "\ -\\\ -\\[helm-bookmark-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct") - "String displayed in mode-line in `helm-source-buffers-list'") - -;;;###autoload -(defvar helm-occur-mode-line "\ -\\\ -\\[helm-help]:Help \ -\\\ -\\[helm-occur-run-query-replace-regexp]:Query replace regexp \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") - -;;;###autoload -(defvar helm-moccur-mode-line "\ -\\\ -\\[helm-moccur-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") - ;;;###autoload (defvar helm-comp-read-mode-line "\ \\\ @@ -1292,62 +982,25 @@ C/\\[helm-cr-empty-string]:Empty \ \\[helm-help]:Help \ \\[helm-select-action]:Act \ \\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct") - -;;;###autoload -(defvar helm-top-mode-line "\ -\\\ -\\[helm-top-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") - -;;;###autoload -(defvar helm-apt-mode-line "\ -\\\ -\\[helm-apt-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") - -;;;###autoload -(defvar helm-el-package-mode-line "\ -\\\ -\\[helm-el-package-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") - -;;;###autoload -(defvar helm-M-x-mode-line "\ -\\\ -\\[helm-M-x-help]:Help \ -\\\ -\\[helm-select-action]:Act \ -\\[helm-maybe-exit-minibuffer]/\ f1/f2/f-n:NthAct \ \\[helm-toggle-suspend-update]:Tog.suspend") ;;;###autoload -(defvar helm-imenu-mode-line "\ -\\\ -\\[helm-imenu-help]:Help \ +(defvar helm-read-file-name-mode-line-string "\ +\\\ +\\[helm-help]:Help \ +C/\\[helm-cr-empty-string]:Empty \ \\\ \\[helm-select-action]:Act \ \\[helm-maybe-exit-minibuffer]/\ f1/f2/f-n:NthAct \ -\\[helm-toggle-suspend-update]:Tog.suspend") +\\[helm-toggle-suspend-update]:Tog.suspend" + "String displayed in mode-line in `helm-source-find-files'.") ;;;###autoload -(defvar helm-semantic-mode-line "\ -\\\ -\\[helm-semantic-help]:Help \ +(defvar helm-top-mode-line "\ +\\\ +\\[helm-help]:Help \ \\\ \\[helm-select-action]:Act \ \\[helm-maybe-exit-minibuffer]/\ @@ -1568,7 +1221,7 @@ HELM-ATTRIBUTE should be a symbol." (helm-document-attribute 'persistent-action "optional" " Can be a either a Function called with one parameter (the selected candidate) or a cons cell where first element is this - same function and second element a symbol (e.g never-split) + same function and second element a symbol (e.g. never-split) that inform `helm-execute-persistent-action'to not split his window to execute this persistent action.") @@ -1678,7 +1331,7 @@ HELM-ATTRIBUTE should be a symbol." 'resume "optional" " Function called with no parameters at end of initialization when `helm-resume' is started. - If this function try to do something against `helm-buffer', \(e.g updating, + If this function try to do something against `helm-buffer', \(e.g. updating, searching etc...\) probably you should run it in a timer to ensure `helm-buffer' is ready.") @@ -1699,7 +1352,7 @@ HELM-ATTRIBUTE should be a symbol." In candidates-in-buffer sources, match is done with `re-search-forward' which allow matching only a regexp on the `helm-buffer'; when this search is done, match-part allow - matching only a specific part of the current line e.g with a + matching only a specific part of the current line e.g. with a line like this: filename:candidate-containing-the-word-filename @@ -1719,7 +1372,7 @@ HELM-ATTRIBUTE should be a symbol." (helm-document-attribute 'match-strict "optional" " When specifying a match function within a source and - helm-match-plugin is enabled, the result of all matching + helm-multi-match is enabled, the result of all matching functions will be concatened, which in some cases is not what is wanted. When using `match-strict' only this or these functions will be used. You can specify those functions as a @@ -1748,8 +1401,8 @@ HELM-ATTRIBUTE should be a symbol." (helm-document-attribute 'follow-delay "optional" " `helm-follow-mode' will execute persistent-action after this delay. -Otherwise value of `helm-follow-input-idle-delay' is used if non--nil, -If none of these are found fallback to `helm-input-idle-delay'.") + Otherwise value of `helm-follow-input-idle-delay' is used if non--nil, + If none of these are found fallback to `helm-input-idle-delay'.") (helm-document-attribute 'allow-dups "optional" " Allow helm collecting duplicates candidates.") @@ -1759,7 +1412,7 @@ If none of these are found fallback to `helm-input-idle-delay'.") It is called with one arg the candidate. It is faster than `filtered-candidate-transformer' or `candidates-transformer', but should be used only in sources that recompute constantly their candidates, - e.g `helm-source-find-files'. + e.g. `helm-source-find-files'. Filtering happen early and candidates are treated one by one instead of re-looping on the whole list. If used with `filtered-candidate-transformer' or `candidates-transformer' diff --git a/elpa/helm-20150704.1247/helm-id-utils.el b/elpa/helm-20160105.2046/helm-id-utils.el similarity index 88% rename from elpa/helm-20150704.1247/helm-id-utils.el rename to elpa/helm-20160105.2046/helm-id-utils.el index 7b7e9225..15f6bc42 100644 --- a/elpa/helm-20150704.1247/helm-id-utils.el +++ b/elpa/helm-20160105.2046/helm-id-utils.el @@ -18,11 +18,21 @@ ;;; Code: (require 'helm-grep) +(require 'helm-help) (defgroup helm-id-utils nil "ID-Utils related Applications and libraries for Helm." :group 'helm) +(defcustom helm-gid-program "gid" + "Name of gid command (usually `gid'). +For Mac OS X users, if you install GNU coreutils, the name `gid' +might be occupied by `id' from GNU coreutils, and you should set +it to correct name (or absolute path), for example, if using +MacPorts to install id-utils, it should be `gid32'." + :group 'helm-id-utils + :type 'file) + (defcustom helm-gid-db-file-name "ID" "Name of a database file created by `mkid' command from `ID-utils'." :group 'helm-id-utils @@ -30,10 +40,10 @@ (defun helm-gid-candidates-process () (let ((proc (start-process - "gid" nil "gid" + "gid" nil helm-gid-program "-r" helm-pattern))) (set (make-local-variable 'helm-grep-last-cmd-line) - (format "gid -r %s" helm-pattern)) + (format "%s -r %s" helm-gid-program helm-pattern)) (prog1 proc (set-process-sentinel proc (lambda (_process event) @@ -70,7 +80,6 @@ (filtered-candidate-transformer :initform #'helm-gid-filtered-candidate-transformer) (candidate-number-limit :initform 99999) - (mode-line :initform helm-grep-mode-line-string) (action :initform (helm-make-actions "Find File" 'helm-grep-action "Find file other frame" 'helm-grep-other-frame @@ -82,6 +91,7 @@ (persistent-action :initform 'helm-grep-persistent-action) (history :initform 'helm-grep-history) (nohighlight :initform t) + (help-message :initform 'helm-grep-help-message) (requires-pattern :initform 2))) ;;;###autoload @@ -103,7 +113,7 @@ See ." :db-dir db) :buffer "*helm gid*" :keymap helm-grep-map - :truncate-lines t))) + :truncate-lines helm-grep-truncate-lines))) (provide 'helm-id-utils) diff --git a/elpa/helm-20150704.1247/helm-imenu.el b/elpa/helm-20160105.2046/helm-imenu.el similarity index 93% rename from elpa/helm-20150704.1247/helm-imenu.el rename to elpa/helm-20160105.2046/helm-imenu.el index 6637c4a8..ba4848a4 100644 --- a/elpa/helm-20150704.1247/helm-imenu.el +++ b/elpa/helm-20160105.2046/helm-imenu.el @@ -33,10 +33,11 @@ :group 'helm-imenu :type 'string) -(defcustom helm-imenu-execute-action-at-once-if-one t +(defcustom helm-imenu-execute-action-at-once-if-one + #'helm-imenu--execute-action-at-once-p "Goto the candidate when only one is remaining." :group 'helm-imenu - :type 'boolean) + :type 'function) (defcustom helm-imenu-lynx-style-map t "Use Arrow keys to jump to occurences." @@ -48,7 +49,6 @@ (defvar helm-imenu-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-imenu-help) (define-key map (kbd "M-") 'helm-imenu-next-section) (define-key map (kbd "M-") 'helm-imenu-previous-section) (when helm-imenu-lynx-style-map @@ -101,7 +101,7 @@ (persistent-action :initform 'helm-imenu-persistent-action) (persistent-help :initform "Show this entry") (keymap :initform helm-imenu-map) - (mode-line :initform helm-imenu-mode-line) + (help-message :initform 'helm-imenu-help-message) (action :initform 'helm-imenu-action))) (defcustom helm-imenu-fuzzy-match nil @@ -118,6 +118,18 @@ (helm-aif (marker-buffer (cdr candidate)) (switch-to-buffer it))) +(defun helm-imenu--execute-action-at-once-p () + (let ((cur (helm-get-selection)) + (mb (with-helm-current-buffer + (save-excursion + (goto-char (point-at-bol)) + (point-marker))))) + (if (equal (cdr cur) mb) + (prog1 nil + (helm-set-pattern "") + (helm-force-update)) + t))) + (defun helm-imenu-action (candidate) "Default action for `helm-source-imenu'." (helm-log-run-hook 'helm-goto-line-before-hook) @@ -230,6 +242,7 @@ helm-imenu-execute-action-at-once-if-one)) (helm :sources 'helm-source-imenu :default (list (concat "\\_<" str "\\_>") str) + :preselect str :buffer "*helm imenu*"))) ;;;###autoload @@ -247,6 +260,9 @@ helm-imenu-execute-action-at-once-if-one)) (helm :sources 'helm-source-imenu-all :default (list (concat "\\_<" str "\\_>") str) + :preselect (unless (memq 'helm-source-imenu-all + helm-sources-using-default-as-input) + str) :buffer "*helm imenu all*"))) (provide 'helm-imenu) diff --git a/elpa/helm-20150704.1247/helm-info.el b/elpa/helm-20160105.2046/helm-info.el similarity index 100% rename from elpa/helm-20150704.1247/helm-info.el rename to elpa/helm-20160105.2046/helm-info.el diff --git a/elpa/helm-20150704.1247/helm-locate.el b/elpa/helm-20160105.2046/helm-locate.el similarity index 83% rename from elpa/helm-20150704.1247/helm-locate.el rename to elpa/helm-20160105.2046/helm-locate.el index b7d3f912..8d672c9e 100644 --- a/elpa/helm-20150704.1247/helm-locate.el +++ b/elpa/helm-20160105.2046/helm-locate.el @@ -23,6 +23,8 @@ (require 'cl-lib) (require 'helm) +(require 'helm-types) +(require 'helm-help) (defgroup helm-locate nil @@ -51,7 +53,7 @@ Normally you should not have to modify this yourself. If nil it will be calculated when `helm-locate' startup with these default values for different systems: -Gnu/linux: \"locate %s -e -A %s\" +Gnu/linux: \"locate %s -e -r %s\" berkeley-unix: \"locate %s %s\" windows-nt: \"es %s %s\" Others: \"locate %s %s\" @@ -88,6 +90,13 @@ the opposite of \"locate\" command." :group 'helm-locate :type 'boolean) +(defcustom helm-locate-project-list nil + "A list of directories, your projects. +When set, allow browsing recursively files in all +directories of this list with `helm-projects-find-files'." + :group 'helm-locate + :type '(repeat string)) + (defvar helm-generic-files-map (let ((map (make-sparse-keymap))) @@ -97,6 +106,7 @@ the opposite of \"locate\" command." (define-key map (kbd "M-g s") 'helm-ff-run-grep) (define-key map (kbd "M-g z") 'helm-ff-run-zgrep) (define-key map (kbd "M-g p") 'helm-ff-run-pdfgrep) + (define-key map (kbd "C-c g") 'helm-ff-run-gid) (define-key map (kbd "M-R") 'helm-ff-run-rename-file) (define-key map (kbd "M-C") 'helm-ff-run-copy-file) (define-key map (kbd "M-B") 'helm-ff-run-byte-compile-file) @@ -114,7 +124,6 @@ the opposite of \"locate\" command." (define-key map (kbd "M-.") 'helm-ff-run-etags) (define-key map (kbd "C-w") 'helm-yank-text-at-point) (define-key map (kbd "C-c @") 'helm-ff-run-insert-org-link) - (define-key map (kbd "C-c ?") 'helm-generic-file-help) map) "Generic Keymap for files.") @@ -146,6 +155,19 @@ fall back to `default-directory' if FROM-FF is nil." helm-ff-locate-db-filename default-directory)))))) + +(defun helm-locate-create-db-default-function (db-name directory) + "Default function used to create a locale locate db file. +Argument DB-NAME name of the db file. +Argument DIRECTORY root of file system subtree to scan." + (format helm-locate-create-db-command db-name directory)) + +(defvar helm-locate-create-db-function + #'helm-locate-create-db-default-function + "Function used to create a locale locate db file. +It should receive the same arguments as +`helm-locate-create-db-default-function'.") + (defun helm-locate-1 (&optional localdb init from-ff default) "Generic function to run Locate. Prefix arg LOCALDB when (4) search and use a local locate db file when it @@ -156,13 +178,13 @@ INIT is a string to use as initial input in prompt. See `helm-locate-with-db' and `helm-locate'." (require 'helm-mode) (helm-locate-set-command) - (let ((pfn #'(lambda (candidate) + (let ((pfn (lambda (candidate) (if (file-directory-p candidate) (message "Error: The locate Db should be a file") (if (= (shell-command - (format helm-locate-create-db-command - candidate - helm-ff-default-directory)) + (funcall helm-locate-create-db-function + candidate + helm-ff-default-directory)) 0) (message "New locatedb file `%s' created" candidate) (error "Failed to create locatedb file `%s'" candidate))))) @@ -176,7 +198,7 @@ See `helm-locate-with-db' and `helm-locate'." (or helm-ff-default-directory default-directory)) :preselect helm-locate-db-file-regexp - :test #'(lambda (x) + :test (lambda (x) (if helm-locate-db-file-regexp ;; Select only locate db files and directories ;; to allow navigation. @@ -206,6 +228,7 @@ If DB is not given or nil use locate without -d option. Argument DB can be given as a string or list of db files. Argument INITIAL-INPUT is a string to use as initial-input. See also `helm-locate'." + (require 'helm-files) (when (and db (stringp db)) (setq db (list db))) (helm-locate-set-command) (let ((helm-locate-command @@ -261,7 +284,7 @@ See also `helm-locate'." cmd) (set-process-sentinel (get-buffer-process helm-buffer) - #'(lambda (_process event) + (lambda (_process event) (if (string= event "finished\n") (with-helm-window (setq mode-line-format @@ -283,9 +306,9 @@ See also `helm-locate'." (requires-pattern :initform 3) (history :initform 'helm-file-name-history) (keymap :initform helm-generic-files-map) - (help-message :initform helm-generic-file-help-message) - (candidate-number-limit :initform 9999) - (mode-line :initform helm-generic-file-mode-line-string))) + (persistent-action :initform 'helm-ff-kill-or-find-buffer-fname) + (help-message :initform 'helm-generic-file-help-message) + (candidate-number-limit :initform 9999))) (defvar helm-source-locate (helm-make-source "Locate" 'helm-locate-source @@ -301,6 +324,37 @@ See also `helm-locate'." (t (helm--mapconcat-pattern pattern))) pattern)) +(defun helm-locate-find-dbs-in-projects (&optional update) + (let* ((pfn (lambda (candidate directory) + (unless (= (shell-command + (funcall helm-locate-create-db-function + candidate + directory)) + 0) + (error "Failed to create locatedb file `%s'" candidate))))) + (cl-loop for p in helm-locate-project-list + for db = (expand-file-name + helm-ff-locate-db-filename + (file-name-as-directory p)) + if (and (null update) (file-exists-p db)) + collect db + else do (funcall pfn db p) + and collect db))) + +;;;###autoload +(defun helm-projects-find-files (update) + "Find files with locate in `helm-locate-project-list'. +With a prefix arg refresh the database in each project." + (interactive "P") + (helm-locate-set-command) + (cl-assert (and (string-match-p "\\`locate" helm-locate-command) + (executable-find "updatedb")) + nil "Unsupported locate version") + (let ((dbs (helm-locate-find-dbs-in-projects update))) + (if dbs + (helm-locate-with-db dbs) + (user-error "No projects found, please setup `helm-locate-project-list'")))) + ;;;###autoload (defun helm-locate-read-file-name (prompt) (let* ((src `((name . "Locate read fname") @@ -329,8 +383,6 @@ See 'man locate' for valid options and also `helm-locate-command'. You can specify a local database with prefix argument ARG. With two prefix arg, refresh the current local db or create it if it doesn't exists. -Many databases can be used: navigate and mark them. -See also `helm-locate-with-db'. To create a user specific db, use \"updatedb -l 0 -o db_path -U directory\". @@ -338,7 +390,7 @@ Where db_path is a filename matched by `helm-locate-db-file-regexp'." (interactive "P") (setq helm-ff-default-directory default-directory) - (helm-locate-1 arg)) + (helm-locate-1 arg nil nil (thing-at-point 'filename))) (provide 'helm-locate) diff --git a/elpa/helm-20150704.1247/helm-man.el b/elpa/helm-20160105.2046/helm-man.el similarity index 99% rename from elpa/helm-20150704.1247/helm-man.el rename to elpa/helm-20160105.2046/helm-man.el index 392ad93f..8ba57953 100644 --- a/elpa/helm-20150704.1247/helm-man.el +++ b/elpa/helm-20160105.2046/helm-man.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (defvar woman-topic-all-completions) (defvar woman-manpath) diff --git a/elpa/helm-20150704.1247/helm-misc.el b/elpa/helm-20160105.2046/helm-misc.el similarity index 89% rename from elpa/helm-20150704.1247/helm-misc.el rename to elpa/helm-20160105.2046/helm-misc.el index 28a26d3d..b297a62e 100644 --- a/elpa/helm-20150704.1247/helm-misc.el +++ b/elpa/helm-20160105.2046/helm-misc.el @@ -18,6 +18,11 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-help) +(require 'helm-types) + +(declare-function display-time-world-display "time.el") +(defvar display-time-world-list) (defgroup helm-misc nil @@ -29,6 +34,13 @@ :group 'helm-misc :type 'string) +(defcustom helm-timezone-actions + '(("Set timezone env (TZ)" . (lambda (candidate) + (setenv "TZ" candidate)))) + "Actions for helm-timezone." + :group 'helm-misc + :type '(alist :key-type string :value-type function)) + (defcustom helm-mini-default-sources '(helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) @@ -93,22 +105,24 @@ ;; (defun helm-time-zone-transformer (candidates _source) (cl-loop for i in candidates - collect - (cond ((string-match (format-time-string "%H:%M" (current-time)) i) - (propertize i 'face 'helm-time-zone-current)) - ((string-match helm-time-zone-home-location i) - (propertize i 'face 'helm-time-zone-home)) - (t i)))) + for (z . p) in display-time-world-list + collect + (cons + (cond ((string-match (format-time-string "%H:%M" (current-time)) i) + (propertize i 'face 'helm-time-zone-current)) + ((string-match helm-time-zone-home-location i) + (propertize i 'face 'helm-time-zone-home)) + (t i)) + z))) (defvar helm-source-time-world - '((name . "Time World List") - (init . (lambda () - (require 'time) - (let ((helm-buffer (helm-candidate-buffer 'global))) - (with-current-buffer helm-buffer - (display-time-world-display display-time-world-list))))) - (candidates-in-buffer) - (filtered-candidate-transformer . helm-time-zone-transformer))) + (helm-build-in-buffer-source "Time World List" + :data (lambda () + (with-temp-buffer + (display-time-world-display display-time-world-list) + (buffer-string))) + :action 'helm-timezone-actions + :filtered-candidate-transformer 'helm-time-zone-transformer)) ;;; LaCarte ;; @@ -265,7 +279,8 @@ It is added to `extended-command-history'. ;;;###autoload (defun helm-world-time () - "Preconfigured `helm' to show world time." + "Preconfigured `helm' to show world time. +Default action change TZ environment variable locally to emacs." (interactive) (helm-other-buffer 'helm-source-time-world "*helm world time*")) diff --git a/elpa/helm-20150704.1247/helm-mode.el b/elpa/helm-20160105.2046/helm-mode.el similarity index 90% rename from elpa/helm-20150704.1247/helm-mode.el rename to elpa/helm-20160105.2046/helm-mode.el index c5d9e888..d934bbe0 100644 --- a/elpa/helm-20150704.1247/helm-mode.el +++ b/elpa/helm-20160105.2046/helm-mode.el @@ -29,8 +29,10 @@ (defcustom helm-completing-read-handlers-alist '((describe-function . helm-completing-read-symbols) (describe-variable . helm-completing-read-symbols) + (describe-symbol . helm-completing-read-symbols) (debug-on-entry . helm-completing-read-symbols) (find-function . helm-completing-read-symbols) + (disassemble . helm-completing-read-symbols) (trace-function . helm-completing-read-symbols) (trace-function-foreground . helm-completing-read-symbols) (trace-function-background . helm-completing-read-symbols) @@ -101,10 +103,23 @@ Affect among others `completion-at-point', `completing-read-multiple'." :type 'boolean) (defcustom helm-mode-fuzzy-match nil - "Enable fuzzy matching in `helm-mode'." + "Enable fuzzy matching in `helm-mode' globally. +Note that this will slow down completion and modify sorting +which is unwanted in many places. +This affect only the functions with completing-read helmized by helm-mode. +To fuzzy match `completion-at-point' and friends see +`helm-completion-in-region-fuzzy-match'." :group 'helm-mode :type 'boolean) +(defcustom helm-mode-minibuffer-setup-hook-black-list '(minibuffer-completion-help) + "Incompatible `minibuffer-setup-hook' functions go here. +A list of symbols. +Helm-mode is rejecting all lambda's, byte-code fns +and all functions belonging in this list from `minibuffer-setup-hook'." + :group 'helm-mode + :type '(repeat (choice symbol))) + (defvar helm-comp-read-map (let ((map (make-sparse-keymap))) @@ -114,6 +129,13 @@ Affect among others `completion-at-point', `completing-read-multiple'." map) "Keymap for `helm-comp-read'.") +(defvar helm-comp-read-must-match-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "RET") + 'helm-confirm-and-exit-minibuffer) + map) + "Keymap use as must-match-map in `helm-comp-read' and `helm-read-file-name'.") + ;;; Internal ;; @@ -130,8 +152,8 @@ Affect among others `completion-at-point', `completing-read-multiple'." "Return empty string." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action - #'(lambda (_candidate) + (helm-exit-and-execute-action + (lambda (_candidate) (identity ""))))) (defun helm-mode--keyboard-quit () @@ -265,6 +287,7 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'." (persistent-action nil) (persistent-help "DoNothing") (mode-line helm-comp-read-mode-line) + help-message (keymap helm-comp-read-map) (name "Helm Completions") candidates-in-buffer @@ -276,7 +299,8 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'." hist-fc-transformer marked-candidates nomark - (alistp t)) + (alistp t) + (candidate-number-limit helm-candidate-number-limit)) "Read a string in the minibuffer, with helm completion. It is helm `completing-read' equivalent. @@ -302,6 +326,8 @@ Keys description: - MUST-MATCH: Candidate selected must be one of COLLECTION. +- FUZZY: Enable fuzzy matching. + - REVERSE-HISTORY: When non--nil display history source after current source completion. @@ -337,9 +363,14 @@ Keys description: - VOLATILE: Use volatile attribute \(enabled by default\). -- SORT: A predicate to give to `sort' e.g `string-lessp'. +- SORT: A predicate to give to `sort' e.g `string-lessp' + Use this only on small data as it is ineficient. + If you want to sort faster add a sort function to + FC-TRANSFORMER. + Note that FUZZY when enabled is already providing a sort function. -- FC-TRANSFORMER: A `filtered-candidate-transformer' function. +- FC-TRANSFORMER: A `filtered-candidate-transformer' function + or a list of functions. - HIST-FC-TRANSFORMER: A `filtered-candidate-transformer' function for the history source. @@ -351,7 +382,7 @@ Keys description: - ALISTP: \(default is non--nil\) See `helm-comp-read-get-candidates'. - CANDIDATES-IN-BUFFER: when non--nil use a source build with - `helm-candidates-in-buffer' which is much faster. + `helm-source-in-buffer' which is much faster. Argument VOLATILE have no effect when CANDIDATES-IN-BUFFER is non--nil. Any prefix args passed during `helm-comp-read' invocation will be recorded @@ -372,11 +403,7 @@ that use `helm-comp-read' See `helm-M-x' for example." (when (eq must-match 'confirm-after-completion) (setq must-match 'confirm)) (let* ((minibuffer-completion-confirm must-match) - (must-match-map (when must-match - (let ((map (make-sparse-keymap))) - (define-key map (kbd "RET") - 'helm-confirm-and-exit-minibuffer) - map))) + (must-match-map (when must-match helm-comp-read-must-match-map)) (loc-map (if must-match-map (make-composed-keymap must-match-map (or keymap helm-map)) @@ -395,7 +422,9 @@ that use `helm-comp-read' See `helm-M-x' for example." (string= helm-pattern "") (assoc helm-pattern cands) (assoc (intern helm-pattern) cands) - (member helm-pattern cands)) + (member helm-pattern cands) + (member (downcase helm-pattern) cands) + (member (upcase helm-pattern) cands)) (setq cands (append (list ;; Unquote helm-pattern ;; when it is added @@ -404,6 +433,9 @@ that use `helm-comp-read' See `helm-M-x' for example." "\\s\\" "" helm-pattern)) cands)) (setq helm-cr-unknown-pattern-flag t)) + ;; When DEFAULT is initially a list, candidates + ;; come already computed with DEFAULT list appended, + ;; and DEFAULT is set to the car of this list. (if (and default (not (string= default ""))) (delq nil (cons default (delete default cands))) cands)))) @@ -433,6 +465,7 @@ that use `helm-comp-read' See `helm-M-x' for example." :persistent-action persistent-action :persistent-help persistent-help :mode-line mode-line + :help-message help-message :action action-fn)) (src (helm-build-sync-source name :candidates get-candidates @@ -442,6 +475,7 @@ that use `helm-comp-read' See `helm-M-x' for example." :persistent-help persistent-help :fuzzy-match fuzzy :mode-line mode-line + :help-message help-message :action action-fn)) (src-1 (helm-build-in-buffer-source name :data get-candidates @@ -451,6 +485,7 @@ that use `helm-comp-read' See `helm-M-x' for example." :fuzzy-match fuzzy :persistent-help persistent-help :mode-line mode-line + :help-message help-message :action action-fn)) (src-list (list src-hist (if candidates-in-buffer @@ -474,6 +509,7 @@ that use `helm-comp-read' See `helm-M-x' for example." :preselect preselect :prompt prompt :resume 'noresume + :candidate-number-limit candidate-number-limit :case-fold-search case-fold :keymap loc-map :history (and (symbolp input-history) input-history) @@ -530,19 +566,22 @@ that use `helm-comp-read' See `helm-M-x' for example." (prompt _collection test _require-match init hist default _inherit-input-method name buffer) "Specialized function for fast symbols completion in `helm-mode'." + (require 'helm-elisp) (or (helm :sources (helm-build-in-buffer-source name :init (lambda () - (require 'helm-elisp) (helm-apropos-init (lambda (x) (and (funcall test x) (not (keywordp x)))) (or (car-safe default) default))) :filtered-candidate-transformer 'helm-apropos-default-sort-fn :fuzzy-match helm-mode-fuzzy-match - :persistent-action 'helm-lisp-completion-persistent-action - :persistent-help "Show brief doc in mode-line") + :persistent-action + (lambda (candidate) + (helm-lisp-completion-persistent-action + candidate name)) + :persistent-help (helm-lisp-completion-persistent-help)) :prompt prompt :buffer buffer :input init @@ -568,14 +607,14 @@ It should be used when candidate list don't need to rebuild dynamically." (when (and default (listp default)) ;; When DEFAULT is a list move the list on head of COLLECTION ;; and set it to its car. #bugfix `grep-read-files'. - (setq collection (if (listp collection) - (append default collection) - ;; Else COLLECTION is maybe a function or a table. - (prog1 - (append default (all-completions "" collection)) - ;; Ensure `all-completions' will not be used - ;; a second time to recompute COLLECTION [1]. - (setq alistp t)))) + (setq collection + ;; COLLECTION is maybe a function or a table. + (append default + (helm-comp-read-get-candidates + collection test nil (listp collection)))) + ;; Ensure `all-completions' will not be used + ;; a second time to recompute COLLECTION [1]. + (setq alistp t) (setq default (car default))) (helm-comp-read prompt collection @@ -640,7 +679,7 @@ See documentation of `completing-read' and `all-completions' for details." (entry (assq current-command helm-completing-read-handlers-alist)) (def-com (cdr-safe entry)) - (str-defcom (and def-com (symbol-name def-com))) + (str-defcom (and def-com (helm-symbol-name def-com))) (def-args (list prompt collection predicate require-match initial-input hist def inherit-input-method)) ;; Append the two extra args needed to set the buffer and source name @@ -653,11 +692,19 @@ See documentation of `completing-read' and `all-completions' for details." ;; calling `minibuffer-completion-help' or other minibuffer ;; functions we DONT WANT here, in these cases removing the hook ;; (a symbol) have no effect. Issue #448. - ;; But because `minibuffer-completion-table' and + ;; Because `minibuffer-completion-table' and ;; `minibuffer-completion-predicate' are not bound - ;; anymore here, these functions should have no effect now. - (minibuffer-setup-hook (remove 'minibuffer-completion-help - minibuffer-setup-hook)) + ;; anymore here, these functions should have no effect now, + ;; except in some rare cases like in `woman-file-name', + ;; so remove all incompatible functions + ;; from `minibuffer-setup-hook' (Issue #1205, #1240). + ;; otherwise helm have not the time to close its initial session. + (minibuffer-setup-hook + (cl-loop for h in minibuffer-setup-hook + unless (or (consp h) ; a lambda. + (byte-code-function-p h) + (memq h helm-mode-minibuffer-setup-hook-black-list)) + collect h)) ;; Disable hack that could be used before `completing-read'. ;; i.e (push ?\t unread-command-events). unread-command-events) @@ -710,11 +757,12 @@ See documentation of `completing-read' and `all-completions' for details." ;;; Generic read-file-name ;; ;; +;;;###autoload (cl-defun helm-read-file-name (prompt &key (name "Read File Name") - (initial-input (expand-file-name default-directory)) + (initial-input default-directory) (buffer "*Helm file completions*") test (case-fold helm-file-name-case-fold-search) @@ -723,6 +771,7 @@ See documentation of `completing-read' and `all-completions' for details." must-match default marked-candidates + (candidate-number-limit helm-ff-candidate-number-limit) nomark (alistp t) (persistent-action 'helm-find-files-persistent-action) @@ -782,11 +831,7 @@ Keys description: (hist (and history (helm-comp-read-get-candidates history nil nil alistp))) (minibuffer-completion-confirm must-match) - (must-match-map (when must-match - (let ((map (make-sparse-keymap))) - (define-key map (kbd "RET") - 'helm-confirm-and-exit-minibuffer) - map))) + (must-match-map (when must-match helm-comp-read-must-match-map)) (cmap (if must-match-map (make-composed-keymap must-match-map helm-read-file-map) @@ -801,8 +846,9 @@ Keys description: (list ;; History source. (helm-build-sync-source (format "%s History" name) - :header-name (lambda (hname) - (concat hname helm-find-files-doc-header)) + :header-name (lambda (name) + (concat name (substitute-command-keys + helm-find-files-doc-header))) :mode-line mode-line :candidates hist :nohighlight t @@ -812,14 +858,16 @@ Keys description: :action action-fn) ;; Other source. (helm-build-sync-source name - :header-name (lambda (hname) - (concat hname helm-find-files-doc-header)) + :header-name (lambda (name) + (concat name (substitute-command-keys + helm-find-files-doc-header))) :init (lambda () (setq helm-ff-auto-update-flag helm-ff-auto-update-initial-value) (setq helm-ff--auto-update-state helm-ff-auto-update-flag)) :mode-line mode-line + :help-message 'helm-read-file-name-help-message :nohighlight t :candidates (lambda () @@ -836,7 +884,6 @@ Keys description: :filtered-candidate-transformer 'helm-ff-sort-candidates :filter-one-by-one 'helm-ff-filter-candidate-one-by-one :persistent-action persistent-action - :candidate-number-limit 9999 :persistent-help persistent-help :volatile t :nomark nomark @@ -844,15 +891,15 @@ Keys description: ;; Helm result. (result (helm :sources src-list - :input initial-input + :input (expand-file-name initial-input) :prompt prompt :keymap cmap + :candidate-number-limit candidate-number-limit :resume 'noresume :case-fold-search case-fold :default default :buffer buffer - :preselect (and (stringp preselect) - (regexp-quote preselect))))) + :preselect preselect))) (or (cond ((and result (stringp result) (string= result "") "")) @@ -900,7 +947,7 @@ Don't use it directly, use instead `helm-read-file-name' in your programs." (entry (assq current-command helm-completing-read-handlers-alist)) (def-com (cdr-safe entry)) - (str-defcom (and def-com (symbol-name def-com))) + (str-defcom (and def-com (helm-symbol-name def-com))) (def-args (list prompt dir default-filename mustmatch initial predicate)) ;; Append the two extra args needed to set the buffer and source name ;; in helm specialized functions. @@ -974,7 +1021,7 @@ Don't use it directly, use instead `helm-read-file-name' in your programs." (apply old--fn args))) (defun helm--completion-in-region (start end collection &optional predicate) - "[EXPERIMENTAL] Helm replacement of `completion--in-region'. + "Helm replacement of `completion--in-region'. Can be used as value for `completion-in-region-function'." (cl-declare (special require-match prompt)) (if (memq major-mode helm-mode-no-completion-in-region-in-modes) @@ -987,7 +1034,7 @@ Can be used as value for `completion-in-region-function'." (let* ((enable-recursive-minibuffers t) (input (buffer-substring-no-properties start end)) (current-command (or (helm-this-command) this-command)) - (str-command (symbol-name current-command)) + (str-command (helm-symbol-name current-command)) (buf-name (format "*helm-mode-%s*" str-command)) (require-match (or (and (boundp 'require-match) require-match) minibuffer-completion-confirm @@ -1003,11 +1050,13 @@ Can be used as value for `completion-in-region-function'." ;; See Issue #407. (afun (plist-get completion-extra-properties :annotation-function)) (data (all-completions input collection predicate)) - (init-space-suffix (unless helm-completion-in-region-fuzzy-match " ")) + (init-space-suffix (unless (or helm-completion-in-region-fuzzy-match + (string-suffix-p " " input)) + " ")) ;; Assume that when `afun' and `predicate' are null ;; we are in filename completion. (file-comp-p (or (helm-mode--in-file-completion-p) - (and (null afun) (null predicate)))) + (and (null afun) (null predicate)))) ;; Completion-at-point and friends have no prompt. (result (if (stringp data) data @@ -1053,11 +1102,11 @@ Can be used as value for `completion-in-region-function'." (sort candidates 'helm-generic-sort-fn)))) :exec-when-only-one t :quit-when-no-cand - #'(lambda () + (lambda () ;; Delay message to overwrite "Quit". (run-with-timer 0.01 nil - #'(lambda () + (lambda () (message "[No matches]"))) t) ; exit minibuffer immediately. :must-match require-match)))) diff --git a/elpa/helm-20160105.2046/helm-multi-match.el b/elpa/helm-20160105.2046/helm-multi-match.el new file mode 100644 index 00000000..3e740da2 --- /dev/null +++ b/elpa/helm-20160105.2046/helm-multi-match.el @@ -0,0 +1,373 @@ +;;; helm-multi-match.el --- Multiple regexp matching methods for helm -*- lexical-binding: t -*- + +;; Original Author: rubikitch + +;; Copyright (C) 2008 ~ 2011 rubikitch +;; Copyright (C) 2011 ~ 2015 Thierry Volpiatto + +;; Author: Thierry Volpiatto +;; URL: http://github.com/emacs-helm/helm + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'cl-lib) +(require 'helm-lib) + + +(defgroup helm-multi-match nil + "Helm multi match." + :group 'helm) + +(defcustom helm-mm-matching-method 'multi3 + "Matching method for helm match plugin. +You can set here different methods to match candidates in helm. +Here are the possible value of this symbol and their meaning: +- multi1: Respect order, prefix of pattern must match. +- multi2: Same but with partial match. +- multi3: The best, multiple regexp match, allow negation. +- multi3p: Same but prefix must match. + +Default is multi3, you should keep this for a better experience. + +Note that multi1 and multi3p are incompatible with fuzzy matching +in file completion and by the way fuzzy matching will be disabled there +when these options are used." + :type '(radio :tag "Matching methods for helm" + (const :tag "Multiple regexp 1 ordered with prefix match" multi1) + (const :tag "Multiple regexp 2 ordered with partial match" multi2) + (const :tag "Multiple regexp 3 matching no order, partial, best." multi3) + (const :tag "Multiple regexp 3p matching with prefix match" multi3p)) + :group 'helm-multi-match) + + +;; Internal +(defconst helm-mm-default-match-functions + '(helm-mm-exact-match helm-mm-match)) +(defconst helm-mm-default-search-functions + '(helm-mm-exact-search helm-mm-search)) + + +;;; Build regexps +;; +;; +(defvar helm-mm-space-regexp "[\\ ] " + "Regexp to represent space itself in multiple regexp match.") + +(defun helm-mm-split-pattern (pattern) + "Split PATTERN if it contain spaces and return resulting list. +If spaces in PATTERN are escaped, don't split at this place. +i.e \"foo bar\"=> (\"foo\" \"bar\") +but \"foo\ bar\"=> (\"foobar\")." + (if (string= pattern "") + '("") + (cl-loop for s in (split-string + (replace-regexp-in-string helm-mm-space-regexp + "\000\000" pattern) + " " t) + collect (replace-regexp-in-string "\000\000" " " s)))) + +(defun helm-mm-1-make-regexp (pattern) + "Replace spaces in PATTERN with \"\.*\"." + (mapconcat 'identity (helm-mm-split-pattern pattern) ".*")) + + +;;; Exact match. +;; +;; +;; Internal. +(defvar helm-mm-exact-pattern-str nil) +(defvar helm-mm-exact-pattern-real nil) + +(defun helm-mm-exact-get-pattern (pattern) + (unless (equal pattern helm-mm-exact-pattern-str) + (setq helm-mm-exact-pattern-str pattern + helm-mm-exact-pattern-real (concat "\n" pattern "\n"))) + helm-mm-exact-pattern-real) + + +(cl-defun helm-mm-exact-match (str &optional (pattern helm-pattern)) + (if case-fold-search + (progn + (setq str (downcase str) + pattern (downcase pattern)) + (string= str pattern)) + (string= str pattern))) + +(defun helm-mm-exact-search (pattern &rest _ignore) + (and (search-forward (helm-mm-exact-get-pattern pattern) nil t) + (forward-line -1))) + + +;;; Prefix match +;; +;; +;; Internal +(defvar helm-mm-prefix-pattern-str nil) +(defvar helm-mm-prefix-pattern-real nil) + +(defun helm-mm-prefix-get-pattern (pattern) + (unless (equal pattern helm-mm-prefix-pattern-str) + (setq helm-mm-prefix-pattern-str pattern + helm-mm-prefix-pattern-real (concat "\n" pattern))) + helm-mm-prefix-pattern-real) + +(defun helm-mm-prefix-match (str &optional pattern) + ;; In filename completion basename and basedir may be + ;; quoted, unquote them for string comparison (Issue #1283). + (setq pattern (replace-regexp-in-string + "\\\\" "" (or pattern helm-pattern))) + (let ((len (length pattern))) + (and (<= len (length str)) + (string= (substring str 0 len) pattern )))) + +(defun helm-mm-prefix-search (pattern &rest _ignore) + (search-forward (helm-mm-prefix-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 1 (order is preserved / prefix). +;; +;; +;; Internal +(defvar helm-mm-1-pattern-str nil) +(defvar helm-mm-1-pattern-real nil) + +(defun helm-mm-1-get-pattern (pattern) + (unless (equal pattern helm-mm-1-pattern-str) + (setq helm-mm-1-pattern-str pattern + helm-mm-1-pattern-real + (concat "^" (helm-mm-1-make-regexp pattern)))) + helm-mm-1-pattern-real) + +(cl-defun helm-mm-1-match (str &optional (pattern helm-pattern)) + (string-match (helm-mm-1-get-pattern pattern) str)) + +(defun helm-mm-1-search (pattern &rest _ignore) + (re-search-forward (helm-mm-1-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 2 (order is preserved / partial). +;; +;; +;; Internal +(defvar helm-mm-2-pattern-str nil) +(defvar helm-mm-2-pattern-real nil) + +(defun helm-mm-2-get-pattern (pattern) + (unless (equal pattern helm-mm-2-pattern-str) + (setq helm-mm-2-pattern-str pattern + helm-mm-2-pattern-real + (concat "^.*" (helm-mm-1-make-regexp pattern)))) + helm-mm-2-pattern-real) + +(cl-defun helm-mm-2-match (str &optional (pattern helm-pattern)) + (string-match (helm-mm-2-get-pattern pattern) str)) + +(defun helm-mm-2-search (pattern &rest _ignore) + (re-search-forward (helm-mm-2-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 3 (permutation). +;; +;; +;; Internal +(defvar helm-mm-3-pattern-str nil) +(defvar helm-mm-3-pattern-list nil) + +(defun helm-mm-3-get-patterns (pattern) + "Return `helm-mm-3-pattern-list', a list of predicate/regexp cons cells. +e.g ((identity . \"foo\") (identity . \"bar\")). +This is done only if `helm-mm-3-pattern-str' is same as PATTERN." + (unless (equal pattern helm-mm-3-pattern-str) + (setq helm-mm-3-pattern-str pattern + helm-mm-3-pattern-list + (helm-mm-3-get-patterns-internal pattern))) + helm-mm-3-pattern-list) + +(defun helm-mm-3-get-patterns-internal (pattern) + "Return a list of predicate/regexp cons cells. +e.g ((identity . \"foo\") (identity . \"bar\"))." + (unless (string= pattern "") + (cl-loop for pat in (helm-mm-split-pattern pattern) + collect (if (string= "!" (substring pat 0 1)) + (cons 'not (substring pat 1)) + (cons 'identity pat))))) + +(cl-defun helm-mm-3-match (str &optional (pattern helm-pattern)) + "Check if PATTERN match STR. +When PATTERN contain a space, it is splitted and matching is done +with the several resulting regexps against STR. +e.g \"bar foo\" will match \"foobar\" and \"barfoo\". +Argument PATTERN, a string, is transformed in a list of +cons cell with `helm-mm-3-get-patterns' if it contain a space. +e.g \"foo bar\"=>((identity . \"foo\") (identity . \"bar\")). +Then each predicate of cons cell(s) is called with regexp of same +cons cell against STR (a candidate). +i.e (identity (string-match \"foo\" \"foo bar\")) => t." + (let ((pat (helm-mm-3-get-patterns pattern))) + (cl-loop for (predicate . regexp) in pat + always (funcall predicate + (condition-case _err + ;; FIXME: Probably do nothing when + ;; using fuzzy leaving the job + ;; to the fuzzy fn. + (string-match regexp str) + (invalid-regexp nil)))))) + +(defun helm-mm-3-search-base (pattern searchfn1 searchfn2) + "Try to find PATTERN in `helm-buffer' with SEARCHFN1 and SEARCHFN2. +This is the search function for `candidates-in-buffer' enabled sources. +Use the same method as `helm-mm-3-match' except it search in buffer +instead of matching on a string. +i.e (identity (re-search-forward \"foo\" (point-at-eol) t)) => t." + (cl-loop with pat = (if (stringp pattern) + (helm-mm-3-get-patterns pattern) + pattern) + when (eq (caar pat) 'not) return + ;; Pass the job to `helm-search-match-part'. + (prog1 (list (point-at-bol) (point-at-eol)) + (forward-line 1)) + while (condition-case _err + (funcall searchfn1 (or (cdar pat) "") nil t) + (invalid-regexp nil)) + for bol = (point-at-bol) + for eol = (point-at-eol) + if (cl-loop for (pred . str) in (cdr pat) always + (progn (goto-char bol) + (funcall pred (condition-case _err + (funcall searchfn2 str eol t) + (invalid-regexp nil))))) + do (goto-char eol) and return t + else do (goto-char eol) + finally return nil)) + +(defun helm-mm-3-search (pattern &rest _ignore) + (when (stringp pattern) + (setq pattern (helm-mm-3-get-patterns pattern))) + (helm-mm-3-search-base + pattern 're-search-forward 're-search-forward)) + +;;; mp-3 with migemo +;; +;; +(defvar helm-mm--previous-migemo-info nil + "[Internal] Cache previous migemo query.") +(make-local-variable 'helm-mm--previous-migemo-info) + +(declare-function migemo-get-pattern "ext:migemo.el") +(declare-function migemo-search-pattern-get "ext:migemo.el") + +(define-minor-mode helm-migemo-mode + "Enable migemo in helm. +It will be available in the sources handling it, +i.e the sources which have the slot :migemo with non--nil value." + :lighter " Hmio" + :group 'helm + :global t + (cl-assert (featurep 'migemo) + nil "No feature called migemo found, install migemo.el.")) + +(defun helm-mm-migemo-get-pattern (pattern) + (let ((regex (migemo-get-pattern pattern))) + (if (ignore-errors (string-match regex "") t) + (concat regex "\\|" pattern) pattern))) + +(defun helm-mm-migemo-search-pattern-get (pattern) + (let ((regex (migemo-search-pattern-get pattern))) + (if (ignore-errors (string-match regex "") t) + (concat regex "\\|" pattern) pattern))) + +(defun helm-mm-migemo-string-match (pattern str) + "Migemo version of `string-match'." + (unless (assoc pattern helm-mm--previous-migemo-info) + (with-helm-buffer + (setq helm-mm--previous-migemo-info + (push (cons pattern (helm-mm-migemo-get-pattern pattern)) + helm-mm--previous-migemo-info)))) + (string-match (assoc-default pattern helm-mm--previous-migemo-info) str)) + +(cl-defun helm-mm-3-migemo-match (str &optional (pattern helm-pattern)) + (and helm-migemo-mode + (cl-loop for (pred . re) in (helm-mm-3-get-patterns pattern) + always (funcall pred (helm-mm-migemo-string-match re str))))) + +(defun helm-mm-migemo-forward (word &optional bound noerror count) + (with-helm-buffer + (unless (assoc word helm-mm--previous-migemo-info) + (setq helm-mm--previous-migemo-info + (push (cons word (if (delq 'ascii (find-charset-string word)) + word + (helm-mm-migemo-search-pattern-get word))) + helm-mm--previous-migemo-info)))) + (re-search-forward + (assoc-default word helm-mm--previous-migemo-info) bound noerror count)) + +(defun helm-mm-3-migemo-search (pattern &rest _ignore) + (and helm-migemo-mode + (helm-mm-3-search-base + pattern 'helm-mm-migemo-forward 'helm-mm-migemo-forward))) + + +;;; mp-3p- (multiple regexp pattern 3 with prefix search) +;; +;; +(defun helm-mm-3p-match (str &optional pattern) + "Check if PATTERN match STR. +Same as `helm-mm-3-match' but more strict, matching against prefix also. +e.g \"bar foo\" will match \"barfoo\" but not \"foobar\" contrarily to +`helm-mm-3-match'." + (let* ((pat (helm-mm-3-get-patterns (or pattern helm-pattern))) + (first (car pat))) + (and (funcall (car first) (helm-mm-prefix-match str (cdr first))) + (cl-loop for (predicate . regexp) in (cdr pat) + always (funcall predicate (string-match regexp str)))))) + +(defun helm-mm-3p-search (pattern &rest _ignore) + (when (stringp pattern) + (setq pattern (helm-mm-3-get-patterns pattern))) + (helm-mm-3-search-base + pattern 'helm-mm-prefix-search 're-search-forward)) + + +;;; Generic multi-match/search functions +;; +;; +(cl-defun helm-mm-match (str &optional (pattern helm-pattern)) + (let ((fun (cl-ecase helm-mm-matching-method + (multi1 #'helm-mm-1-match) + (multi2 #'helm-mm-2-match) + (multi3 #'helm-mm-3-match) + (multi3p #'helm-mm-3p-match)))) + (funcall fun str pattern))) + +(defun helm-mm-search (pattern &rest _ignore) + (let ((fun (cl-ecase helm-mm-matching-method + (multi1 #'helm-mm-1-search) + (multi2 #'helm-mm-2-search) + (multi3 #'helm-mm-3-search) + (multi3p #'helm-mm-3p-search)))) + (funcall fun pattern))) + + +(provide 'helm-multi-match) + + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-multi-match.el ends here diff --git a/elpa/helm-20150704.1247/helm-net.el b/elpa/helm-20160105.2046/helm-net.el similarity index 78% rename from elpa/helm-20150704.1247/helm-net.el rename to elpa/helm-20160105.2046/helm-net.el index 60c90302..cdcc53e1 100644 --- a/elpa/helm-20150704.1247/helm-net.el +++ b/elpa/helm-20160105.2046/helm-net.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'url) (require 'xml) (require 'browse-url) @@ -58,23 +59,14 @@ When nil, fallback to `browse-url-browser-function'." :type 'string :group 'helm-net) -(defcustom helm-google-suggest-use-curl-p nil - "When non--nil use CURL to get info from `helm-google-suggest-url'. +(defcustom helm-net-prefer-curl nil + "When non--nil use CURL external program to fetch data. Otherwise `url-retrieve-synchronously' is used." :type 'boolean :group 'helm-net) -(defcustom helm-yahoo-suggest-url - "http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=Generic&query=" - "Url used for looking up Yahoo suggestions." - :type 'string - :group 'helm-net) - -(defcustom helm-yahoo-suggest-search-url - "http://search.yahoo.com/search?&ei=UTF-8&fr&h=c&p=%s" - "Url used for Yahoo searching." - :type 'string - :group 'helm-net) +(defvaralias 'helm-google-suggest-use-curl-p 'helm-net-prefer-curl) +(make-obsolete-variable 'helm-google-suggest-use-curl-p 'helm-net-prefer-curl "1.7.7") (defcustom helm-surfraw-duckduckgo-url "https://duckduckgo.com/lite/?q=%s&kp=1" @@ -86,7 +78,7 @@ a personal url, see your settings on duckduckgo." :group 'helm-net) (defcustom helm-wikipedia-suggest-url - "http://en.wikipedia.org/w/api.php?action=opensearch&search=" + "https://en.wikipedia.org/w/api.php?action=opensearch&search=" "Url used for looking up Wikipedia suggestions." :type 'string :group 'helm-net) @@ -137,18 +129,9 @@ This is a format string, don't forget the `%s'." :type 'string :group 'helm-net) - -;;; Additional actions for search suggestions -;; -;; -;; Internal - -(defun helm-search-suggest-perform-additional-action (url query) - "Perform the search via URL using QUERY as input." - (browse-url (format url (url-hexify-string query)))) - -(defvar helm-search-suggest-additional-actions - '(("Wikipedia" . (lambda (candidate) +(defcustom helm-google-suggest-actions + '(("Google Search" . helm-google-suggest-action) + ("Wikipedia" . (lambda (candidate) (helm-search-suggest-perform-additional-action helm-search-suggest-action-wikipedia-url candidate))) @@ -168,31 +151,55 @@ This is a format string, don't forget the `%s'." (helm-search-suggest-perform-additional-action helm-search-suggest-action-google-news-url candidate)))) - "List of additional actions for suggest sources.") + "List of actions for google suggest sources." + :group 'helm-net + :type '(alist :key-type string :value-type function)) + +(defcustom helm-browse-url-firefox-new-window "-new-tab" + "Allow choosing to browse url in new window or new tab. +Can be \"-new-tab\" (default) or \"-new-window\"." + :group 'helm-net + :type '(radio + (const :tag "New tab" "-new-tab") + (const :tag "New window" "-new-window"))) + + +;;; Additional actions for search suggestions +;; +;; +;; Internal + +(defun helm-search-suggest-perform-additional-action (url query) + "Perform the search via URL using QUERY as input." + (browse-url (format url (url-hexify-string query)))) + +(defun helm-net--url-retrieve-sync (request parser) + (if helm-net-prefer-curl + (with-temp-buffer + (call-process "curl" nil t nil request) + (funcall parser)) + (with-current-buffer (url-retrieve-synchronously request) + (funcall parser)))) ;;; Google Suggestions ;; ;; +(defun helm-google-suggest-parser () + (cl-loop + with result-alist = (xml-get-children + (car (xml-parse-region + (point-min) (point-max))) + 'CompleteSuggestion) + for i in result-alist collect + (cdr (cl-caadr (assoc 'suggestion i))))) + (defun helm-google-suggest-fetch (input) "Fetch suggestions for INPUT from XML buffer." (let ((request (concat helm-google-suggest-url - (url-hexify-string input))) - (fetch #'(lambda () - (cl-loop - with result-alist = (xml-get-children - (car (xml-parse-region - (point-min) (point-max))) - 'CompleteSuggestion) - for i in result-alist collect - (cdr (cl-caadr (assoc 'suggestion i))))))) - (if helm-google-suggest-use-curl-p - (with-temp-buffer - (call-process "curl" nil t nil request) - (funcall fetch)) - (with-current-buffer - (url-retrieve-synchronously request) - (funcall fetch))))) + (url-hexify-string input)))) + (helm-net--url-retrieve-sync + request #'helm-google-suggest-parser))) (defun helm-google-suggest-set-candidates (&optional request-prefix) "Set candidates with result and number of google results found." @@ -238,60 +245,18 @@ This is a format string, don't forget the `%s'." "Default function to use in helm google suggest.") (defvar helm-source-google-suggest - `((name . "Google Suggest") - (candidates . (lambda () - (funcall helm-google-suggest-default-function))) - (action . ,(cons '("Google Search" . helm-google-suggest-action) - helm-search-suggest-additional-actions)) - (volatile) - (keymap . ,helm-map) - (requires-pattern . 3))) + (helm-build-sync-source "Google Suggest" + :candidates (lambda () + (funcall helm-google-suggest-default-function)) + :action 'helm-google-suggest-actions + :volatile t + :keymap helm-map + :requires-pattern 3)) (defun helm-google-suggest-emacs-lisp () "Try to emacs lisp complete with google suggestions." (helm-google-suggest-set-candidates "emacs lisp")) - -;;; Yahoo suggestions -;; -;; -(defun helm-yahoo-suggest-fetch (input) - "Fetch Yahoo suggestions for INPUT from XML buffer. -Return an alist with elements like (data . number_results)." - (let ((request (concat helm-yahoo-suggest-url - (url-hexify-string input)))) - (with-current-buffer - (url-retrieve-synchronously request) - (cl-loop with result-alist = - (xml-get-children - (car (xml-parse-region - (point-min) (point-max))) - 'Result) - for i in result-alist - collect (cl-caddr i))))) - -(defun helm-yahoo-suggest-set-candidates () - "Set candidates with Yahoo results found." - (let ((suggestions (helm-yahoo-suggest-fetch helm-input))) - (or suggestions - (append - suggestions - (list (cons (concat "Search for " "'" helm-input "'" " on Yahoo") - helm-input)))))) - -(defun helm-yahoo-suggest-action (candidate) - "Default action to jump to a Yahoo suggested candidate." - (helm-browse-url (format helm-yahoo-suggest-search-url - (url-hexify-string candidate)))) - -(defvar helm-source-yahoo-suggest - `((name . "Yahoo Suggest") - (candidates . helm-yahoo-suggest-set-candidates) - (action . (("Yahoo Search" . helm-yahoo-suggest-action))) - (volatile) - (keymap . ,helm-map) - (requires-pattern . 3))) - ;;; Wikipedia suggestions ;; ;; @@ -301,13 +266,8 @@ Return an alist with elements like (data . number_results)." (require 'json) (let ((request (concat helm-wikipedia-suggest-url (url-hexify-string helm-pattern)))) - (if helm-google-suggest-use-curl-p - (with-temp-buffer - (call-process "curl" nil t nil request) - (helm-wikipedia--parse-buffer)) - (with-current-buffer - (url-retrieve-synchronously request) - (helm-wikipedia--parse-buffer))))) + (helm-net--url-retrieve-sync + request #'helm-wikipedia--parse-buffer))) (defun helm-wikipedia--parse-buffer () (goto-char (point-min)) @@ -352,17 +312,11 @@ Return an alist with elements like (data . number_results)." (display-buffer buf) (message mess))))) - (defun helm-wikipedia-fetch-summary (input) - (let* ((request (concat helm-wikipedia-summary-url (url-hexify-string input)))) - (if helm-google-suggest-use-curl-p - (with-temp-buffer - (call-process "curl" nil t nil request) - (helm-wikipedia--parse-summary)) - (with-current-buffer - (url-retrieve-synchronously request) - (helm-wikipedia--parse-summary))))) - + (let* ((request (concat helm-wikipedia-summary-url + (url-hexify-string input)))) + (helm-net--url-retrieve-sync + request #'helm-wikipedia--parse-summary))) (defun helm-wikipedia--parse-summary () (goto-char (point-min)) @@ -398,18 +352,18 @@ Return an alist with elements like (data . number_results)." (defvar helm-source-wikipedia-suggest - `((name . "Wikipedia Suggest") - (candidates . helm-wikipedia-suggest-fetch) - (action . (("Wikipedia" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-wikipedia-url - candidate))))) - (persistent-action . helm-wikipedia-persistent-action) - (volatile) - (keymap . ,helm-map) - (follow . 1) - (follow-delay . ,helm-wikipedia-follow-delay) - (requires-pattern . 3))) + (helm-build-sync-source "Wikipedia Suggest" + :candidates #'helm-wikipedia-suggest-fetch + :action '(("Wikipedia" . (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-wikipedia-url + candidate)))) + :persistent-action #'helm-wikipedia-persistent-action + :volatile t + :keymap helm-map + :follow 1 + :follow-delay helm-wikipedia-follow-delay + :requires-pattern 3)) ;;; Web browser functions. @@ -447,10 +401,25 @@ Return an alist with elements like (data . number_results)." (append args (list url))) (set-process-sentinel (get-process proc) - #'(lambda (process event) + (lambda (process event) (when (string= event "finished\n") (message "%s process %s" process event)))))) +(defun helm-browse-url-firefox (url &optional _ignore) + "Same as `browse-url-firefox' but detach from emacs. +So when you quit emacs you can keep your firefox open +and not be prompted to kill firefox process. + +NOTE: Probably not supported on some systems (e.g Windows)." + (interactive (list (read-string "URL: " (browse-url-url-at-point)) + nil)) + (let ((process-environment (browse-url-process-environment))) + (call-process-shell-command + (format "(%s %s %s &)" + browse-url-firefox-program + helm-browse-url-firefox-new-window + url)))) + (defun helm-browse-url-chromium (url &optional _ignore) "Browse URL with google chrome browser." (interactive "sURL: ") @@ -538,12 +507,6 @@ Return an alist with elements like (data . number_results)." (interactive) (helm-other-buffer 'helm-source-google-suggest "*helm google*")) -;;;###autoload -(defun helm-yahoo-suggest () - "Preconfigured `helm' for Yahoo searching with Yahoo suggest." - (interactive) - (helm-other-buffer 'helm-source-yahoo-suggest "*helm yahoo*")) - ;;;###autoload (defun helm-wikipedia-suggest () "Preconfigured `helm' for Wikipedia lookup with Wikipedia suggest." diff --git a/elpa/helm-20160105.2046/helm-org.el b/elpa/helm-20160105.2046/helm-org.el new file mode 100644 index 00000000..422c273b --- /dev/null +++ b/elpa/helm-20160105.2046/helm-org.el @@ -0,0 +1,221 @@ +;;; helm-org.el --- Helm for org headlines and keywords completion -*- lexical-binding: t -*- + +;; Copyright (C) 2012 ~ 2015 Thierry Volpiatto + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: +(require 'cl-lib) +(require 'helm) +(require 'helm-utils) +(require 'org) + +(declare-function org-agenda-switch-to "org-agenda.el") + +(defgroup helm-org nil + "Org related functions for helm." + :group 'helm) + +(defcustom helm-org-headings-fontify nil + "Fontify org buffers before parsing them. +This reflect fontification in helm-buffer when non--nil. +NOTE: This will be slow on large org buffers." + :group 'helm-org + :type 'boolean) + +(defcustom helm-org-format-outline-path nil + "Show all org level as path." + :group 'helm-org + :type 'boolean) + +(defcustom helm-org-show-filename nil + "Show org filenames in `helm-org-agenda-files-headings' when non--nil. +Note this have no effect in `helm-org-in-buffer-headings'." + :group 'helm-org + :type 'boolean) + +(defcustom helm-org-headings-min-depth 1 + "Minimum depth of org headings to start with." + :group 'helm-org + :type 'integer) + +(defcustom helm-org-headings-max-depth 8 + "Go down to this maximum depth of org headings." + :group 'helm-org + :type 'integer) + +;;; Org capture templates +;; +;; +(defvar org-capture-templates) +(defun helm-source-org-capture-templates () + (helm-build-sync-source "Org Capture Templates:" + :candidates (cl-loop for template in org-capture-templates + collect (cons (nth 1 template) (nth 0 template))) + :action '(("Do capture" . (lambda (template-shortcut) + (org-capture nil template-shortcut)))))) + +;;; Org headings +;; +;; +(defun helm-org-goto-marker (marker) + (switch-to-buffer (marker-buffer marker)) + (goto-char (marker-position marker)) + (org-show-context) + (re-search-backward "^\\*+ " nil t) + (org-show-entry)) + +(defun helm-source-org-headings-for-files (filenames &optional parents) + (helm-build-sync-source "Org Headings" + :candidates filenames ; Start with only filenames. + :match (lambda (candidate) + (string-match + helm-pattern + (helm-aif (get-text-property 0 'helm-real-display candidate) + it + candidate))) + :candidate-transformer + ;; Now that the helm-window is available proceed to truncation + ;; and other transformations. + (lambda (candidates) + (let ((cands (helm-org-get-candidates candidates parents))) + (if parents (nreverse cands) cands))) + :action '(("Go to line" . helm-org-goto-marker) + ("Refile to this heading" . helm-org-heading-refile) + ("Insert link to this heading" + . helm-org-insert-link-to-heading-at-marker)))) + +(defun helm-org-get-candidates (filenames &optional parents) + (helm-flatten-list + (mapcar (lambda (filename) + (helm-org--get-candidates-in-file + filename + helm-org-headings-fontify + (or parents (null helm-org-show-filename)) + parents)) + filenames) + t)) + +(defun helm-org--get-candidates-in-file (filename &optional fontify nofname parents) + (with-current-buffer (pcase filename + ((pred bufferp) filename) + ((pred stringp) (find-file-noselect filename))) + (and fontify (jit-lock-fontify-now)) + (let ((match-fn (if fontify + #'match-string + #'match-string-no-properties)) + (search-fn (lambda () + (when (or (null parents) + (org-up-heading-safe)) + (re-search-forward + org-complex-heading-regexp nil t))))) + (save-excursion + (save-restriction + (widen) + (unless parents (goto-char (point-min))) + (cl-loop with width = (window-width (helm-window)) + while (funcall search-fn) + for all = (funcall match-fn 0) + for truncated-all = (if (and all (> (length all) width)) + (substring all 0 width) all) + for level = (length (match-string-no-properties 1)) + for heading = (funcall match-fn 4) + for file = (unless nofname + (concat (helm-basename filename) ":")) + if (and (>= level helm-org-headings-min-depth) + (<= level helm-org-headings-max-depth)) + collect (cons (propertize + (if helm-org-format-outline-path + (org-format-outline-path + (append (apply #'org-get-outline-path + (unless parents + (list t level heading))) + (list heading)) + width file) + (if file + (concat file truncated-all) + truncated-all)) + 'helm-real-display heading) + (point-marker)))))))) + +(defun helm-org-insert-link-to-heading-at-marker (marker) + (with-current-buffer (marker-buffer marker) + (let ((heading-name (save-excursion (goto-char (marker-position marker)) + (nth 4 (org-heading-components)))) + (file-name (buffer-file-name))) + (with-helm-current-buffer + (org-insert-link + file-name (concat "file:" file-name "::*" heading-name)))))) + +(defun helm-org-heading-refile (marker) + (save-selected-window + (when (eq major-mode 'org-agenda-mode) + (org-agenda-switch-to)) + (org-cut-subtree) + (let ((target-level (with-current-buffer (marker-buffer marker) + (goto-char (marker-position marker)) + (org-current-level)))) + (helm-org-goto-marker marker) + (org-end-of-subtree t t) + (org-paste-subtree (+ target-level 1))))) + +;;;###autoload +(defun helm-org-agenda-files-headings () + "Preconfigured helm for org files headings." + (interactive) + (helm :sources (helm-source-org-headings-for-files (org-agenda-files)) + :candidate-number-limit 99999 + :buffer "*helm org headings*")) + +;;;###autoload +(defun helm-org-in-buffer-headings () + "Preconfigured helm for org buffer headings." + (interactive) + (let ((helm-org-show-filename nil)) + (helm :sources (helm-source-org-headings-for-files + (list (current-buffer))) + :candidate-number-limit 99999 + :buffer "*helm org inbuffer*"))) + +;;;###autoload +(defun helm-org-parent-headings () + "Preconfigured helm for org headings that are parents of the +current heading." + (interactive) + ;; Use a large max-depth to ensure all parents are displayed. + (let ((helm-org-headings-min-depth 1) + (helm-org-headings-max-depth 50)) + (helm :sources (helm-source-org-headings-for-files + (list (current-buffer)) t) + :candidate-number-limit 99999 + :buffer "*helm org parent headings*"))) + +;;;###autoload +(defun helm-org-capture-templates () + "Preconfigured helm for org templates." + (interactive) + (helm :sources (helm-source-org-capture-templates) + :candidate-number-limit 99999 + :buffer "*helm org capture templates*")) + + +(provide 'helm-org) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-org.el ends here diff --git a/elpa/helm-20150704.1247/helm-pkg.el b/elpa/helm-20160105.2046/helm-pkg.el similarity index 60% rename from elpa/helm-20150704.1247/helm-pkg.el rename to elpa/helm-20160105.2046/helm-pkg.el index edc362e9..b758deae 100644 --- a/elpa/helm-20150704.1247/helm-pkg.el +++ b/elpa/helm-20160105.2046/helm-pkg.el @@ -1,7 +1,8 @@ -(define-package "helm" "20150704.1247" "Helm is an Emacs incremental and narrowing framework" +(define-package "helm" "20160105.2046" "Helm is an Emacs incremental and narrowing framework" '((emacs "24") (cl-lib "0.5") - (async "1.3")) + (async "1.6") + (helm-core "1.9.1")) :url "https://emacs-helm.github.io/helm/") ;; Local Variables: ;; no-byte-compile: t diff --git a/elpa/helm-20150704.1247/helm-plugin.el b/elpa/helm-20160105.2046/helm-plugin.el similarity index 100% rename from elpa/helm-20150704.1247/helm-plugin.el rename to elpa/helm-20160105.2046/helm-plugin.el diff --git a/elpa/helm-20150704.1247/helm-regexp.el b/elpa/helm-20160105.2046/helm-regexp.el similarity index 92% rename from elpa/helm-20150704.1247/helm-regexp.el rename to elpa/helm-20160105.2046/helm-regexp.el index 5e6d8af5..e8a7f2d9 100644 --- a/elpa/helm-20150704.1247/helm-regexp.el +++ b/elpa/helm-20160105.2046/helm-regexp.el @@ -19,9 +19,12 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'helm-utils) (require 'helm-plugin) +(declare-function helm-mm-split-pattern "helm-multi-match") + (defgroup helm-regexp nil "Regexp related Applications and libraries for Helm." @@ -50,6 +53,19 @@ Any other non--nil value update after confirmation." (const :tag "Don't update but signal buffer needs update" nil) (const :tag "Update after confirmation" t))) +(defcustom helm-source-multi-occur-actions + '(("Go to Line" . helm-moccur-goto-line) + ("Goto line other window" . helm-moccur-goto-line-ow) + ("Goto line new frame" . helm-moccur-goto-line-of)) + "Actions for helm-occur and helm-moccur." + :group 'helm-regexp + :type '(alist :key-type string :value-type function)) + +(defcustom helm-moccur-truncate-lines t + "When nil the (m)occur line that appears will not be truncated." + :group 'helm-regexp + :type 'boolean) + (defface helm-moccur-buffer '((t (:foreground "DarkTurquoise" :underline t))) @@ -68,7 +84,6 @@ Any other non--nil value update after confirmation." (define-key map (kbd "M-") 'helm-goto-next-file) (define-key map (kbd "M-") 'helm-goto-precedent-file) (define-key map (kbd "C-w") 'helm-yank-text-at-point) - (define-key map (kbd "C-c ?") 'helm-moccur-help) (define-key map (kbd "C-c o") 'helm-moccur-run-goto-line-ow) (define-key map (kbd "C-c C-o") 'helm-moccur-run-goto-line-of) (define-key map (kbd "C-x C-s") 'helm-moccur-run-save-buffer) @@ -79,7 +94,10 @@ Any other non--nil value update after confirmation." "Keymap used in Moccur source.") +;; History vars (defvar helm-build-regexp-history nil) +(defvar helm-occur-history nil) + (defun helm-query-replace-regexp (_candidate) "Query replace regexp from `helm-regexp'. With a prefix arg replace only matches surrounded by word boundaries, @@ -150,10 +168,6 @@ i.e Don't replace inside a word, regexp is surrounded with \\bregexp\\b." (kill-new input) (message "Killed: %s" input)) -(defun helm-quote-whitespace (candidate) - "Quote whitespace, if some, in string CANDIDATE." - (replace-regexp-in-string " " "\\\\ " candidate)) - ;;; Occur ;; @@ -223,7 +237,7 @@ arg METHOD can be one of buffer, buffer-other-window, buffer-other-frame." (let* ((split (helm-grep-split-line candidate)) (buf (car split)) (lineno (string-to-number (nth 1 split))) - (split-pat (helm-mp-split-pattern helm-input))) + (split-pat (helm-mm-split-pattern helm-input))) (cl-case method (buffer (switch-to-buffer buf)) (buffer-other-window (switch-to-buffer-other-window buf)) @@ -233,7 +247,9 @@ arg METHOD can be one of buffer, buffer-other-window, buffer-other-frame." (cl-loop for reg in split-pat when (save-excursion (condition-case _err - (re-search-forward reg (point-at-eol) t) + (if helm-migemo-mode + (helm-mm-migemo-forward reg (point-at-eol) t) + (re-search-forward reg (point-at-eol) t)) (invalid-regexp nil))) collect (match-beginning 0) into pos-ls finally (when pos-ls (goto-char (apply #'min pos-ls)))) @@ -271,18 +287,18 @@ Same as `helm-moccur-goto-line' but go in new frame." "Run goto line other window action from `helm-source-moccur'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-moccur-goto-line-ow))) + (helm-exit-and-execute-action 'helm-moccur-goto-line-ow))) (defun helm-moccur-run-goto-line-of () "Run goto line new frame action from `helm-source-moccur'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-moccur-goto-line-of))) + (helm-exit-and-execute-action 'helm-moccur-goto-line-of))) (defun helm-moccur-run-default-action () (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-moccur-goto-line))) + (helm-exit-and-execute-action 'helm-moccur-goto-line))) (defvar helm-source-moccur nil) (defclass helm-source-multi-occur (helm-source-in-buffer) @@ -292,17 +308,16 @@ Same as `helm-moccur-goto-line' but go in new frame." (filter-one-by-one :initform 'helm-moccur-filter-one-by-one) (get-line :initform helm-moccur-get-line) (nohighlight :initform t) + (nomark :initform t) (migemo :initform t) - (action :initform '(("Go to Line" . helm-moccur-goto-line) - ("Goto line other window" . helm-moccur-goto-line-ow) - ("Goto line new frame" . helm-moccur-goto-line-of))) + (action :initform 'helm-source-multi-occur-actions) (persistent-action :initform 'helm-moccur-persistent-action) (persistent-help :initform "Go to line") (resume :initform 'helm-moccur-resume-fn) (candidate-number-limit :initform 9999) - (mode-line :initform helm-moccur-mode-line) + (help-message :initform 'helm-moccur-help-message) (keymap :initform helm-moccur-map) - (history :initform 'helm-grep-history) + (history :initform 'helm-occur-history) (requires-pattern :initform 2))) (defun helm-moccur-resume-fn () @@ -389,15 +404,16 @@ Same as `helm-moccur-goto-line' but go in new frame." collect (buffer-chars-modified-tick (get-buffer b))))) (helm :sources 'helm-source-moccur :buffer "*helm multi occur*" - :history 'helm-grep-history + :history 'helm-occur-history + :keymap helm-moccur-map :input input - :truncate-lines t)) + :truncate-lines helm-moccur-truncate-lines)) (defun helm-moccur-run-save-buffer () "Run moccur save results action from `helm-moccur'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action 'helm-moccur-save-results))) + (helm-exit-and-execute-action 'helm-moccur-save-results))) ;;; helm-moccur-mode @@ -557,11 +573,11 @@ Special commands: collect (buffer-chars-modified-tick (get-buffer b))))) (helm :sources 'helm-source-occur :buffer "*helm occur*" - :history 'helm-grep-history + :history 'helm-occur-history :preselect (and (memq 'helm-source-occur helm-sources-using-default-as-input) (format "%s:%d:" (regexp-quote (buffer-name)) (line-number-at-pos (point)))) - :truncate-lines t)) + :truncate-lines helm-moccur-truncate-lines)) ;;;###autoload (defun helm-occur-from-isearch () @@ -581,28 +597,9 @@ Special commands: collect (buffer-chars-modified-tick (get-buffer b)))) (helm :sources 'helm-source-occur :buffer "*helm occur*" - :history 'helm-grep-history + :history 'helm-occur-history :input input - :truncate-lines t))) - -;;;###autoload -(defun helm-multi-occur (buffers) - "Preconfigured helm for multi occur. - - BUFFERS is a list of buffers to search through. -With a prefix arg, reverse the behavior of -`helm-moccur-always-search-in-current'. -The prefix arg can be set before calling `helm-multi-occur' -or during the buffer selection." - (interactive (list (helm-comp-read - "Buffers: " (helm-buffer-list) - :marked-candidates t))) - (let ((helm-moccur-always-search-in-current - (if (or current-prefix-arg - helm-current-prefix-arg) - (not helm-moccur-always-search-in-current) - helm-moccur-always-search-in-current))) - (helm-multi-occur-1 buffers))) + :truncate-lines helm-moccur-truncate-lines))) ;;;###autoload (defun helm-multi-occur-from-isearch (&optional _arg) diff --git a/elpa/helm-20150704.1247/helm-ring.el b/elpa/helm-20160105.2046/helm-ring.el similarity index 87% rename from elpa/helm-20150704.1247/helm-ring.el rename to elpa/helm-20160105.2046/helm-ring.el index 75594807..04df6ae5 100644 --- a/elpa/helm-20150704.1247/helm-ring.el +++ b/elpa/helm-20160105.2046/helm-ring.el @@ -20,6 +20,7 @@ (require 'cl-lib) (require 'helm) (require 'helm-utils) +(require 'helm-help) (require 'helm-elisp) (declare-function undo-tree-restore-state-from-register "ext:undo-tree.el" (register)) @@ -46,6 +47,16 @@ If nil or zero (disabled), don't truncate candidate, show all." :group 'helm-ring :type 'integer) +(defcustom helm-kill-ring-actions + '(("Yank" . helm-kill-ring-action) + ("Delete" . (lambda (_candidate) + (cl-loop for cand in (helm-marked-candidates) + do (setq kill-ring + (delete cand kill-ring)))))) + "List of actions for kill ring source." + :group 'helm-ring + :type '(alist :key-type string :value-type function)) + ;;; Kill ring ;; @@ -63,11 +74,7 @@ If nil or zero (disabled), don't truncate candidate, show all." :init (lambda () (helm-attrset 'last-command last-command)) :candidates #'helm-kill-ring-candidates :filtered-candidate-transformer #'helm-kill-ring-transformer - :action '(("Yank" . helm-kill-ring-action) - ("Delete" . (lambda (candidate) - (cl-loop for cand in (helm-marked-candidates) - do (setq kill-ring - (delete cand kill-ring)))))) + :action 'helm-kill-ring-actions :persistent-action (lambda (_candidate) (ignore)) :persistent-help "DoNothing" :keymap helm-kill-ring-map @@ -136,23 +143,28 @@ replace with STR as yanked string." ;; the commands `helm-mark-ring', `helm-global-mark-ring' or ;; `helm-all-mark-rings' instead. -(defun helm-mark-ring-get-marks (pos) +(defun helm-mark-ring-line-string-at-pos (pos) + "Return line string at position POS." (save-excursion (goto-char pos) (forward-line 0) - (let ((line (car (split-string (thing-at-point 'line) "[\n\r]")))) - (when (string= "" line) - (setq line "")) - (format "%7d: %s" (line-number-at-pos) line)))) + (let ((line (car (split-string (thing-at-point 'line) "[\n\r]")))) + (if (string= "" line) + "" + line)))) (defun helm-mark-ring-get-candidates () (with-helm-current-buffer (cl-loop with marks = (if (mark t) (cons (mark-marker) mark-ring) mark-ring) - for i in marks - for m = (helm-mark-ring-get-marks i) - unless (and recip (member m recip)) - collect m into recip - finally return recip))) + for i in marks + with max-line-number = (line-number-at-pos (point-max)) + with width = (length (number-to-string max-line-number)) + for m = (format (concat "%" (number-to-string width) "d: %s") + (line-number-at-pos i) + (helm-mark-ring-line-string-at-pos i)) + unless (and recip (member m recip)) + collect m into recip + finally return recip))) (defvar helm-source-mark-ring (helm-build-sync-source "mark-ring" @@ -231,6 +243,9 @@ replace with STR as yanked string." (set-mark (mark t))) nil) +(defadvice push-mark (around helm-push-mark-mode) + (helm--push-mark location nomsg activate)) + ;;;###autoload (define-minor-mode helm-push-mark-mode "Provide an improved version of `push-mark'. @@ -239,8 +254,12 @@ the `global-mark-ring' after each new visit." :group 'helm-ring :global t (if helm-push-mark-mode - (advice-add 'push-mark :override #'helm--push-mark) - (advice-remove 'push-mark #'helm--push-mark))) + (if (fboundp 'advice-add) + (advice-add 'push-mark :override #'helm--push-mark) + (ad-activate 'push-mark)) + (if (fboundp 'advice-remove) + (advice-remove 'push-mark #'helm--push-mark) + (ad-deactivate 'push-mark)))) ;;;; ;;; Insert from register @@ -248,8 +267,15 @@ the `global-mark-ring' after each new visit." (helm-build-sync-source "Registers" :candidates #'helm-register-candidates :action-transformer #'helm-register-action-transformer + :persistent-help "" :multiline t - :action nil) + :action '(("Delete Register(s)" . + (lambda (_candidate) + (cl-loop for candidate in (helm-marked-candidates) + for register = (car candidate) + do (setq register-alist + (delq (assoc register register-alist) + register-alist))))))) "See (info \"(emacs)Registers\")") (defun helm-register-candidates () @@ -314,15 +340,15 @@ the `global-mark-ring' after each new visit." "[...]" "")) 'insert-register 'append-to-register - 'prepend-to-register)) - (t - "GARBAGE!")) + 'prepend-to-register))) + unless (null string-actions) ; Fix Issue #1107. collect (cons (format "Register %3s:\n %s" key (car string-actions)) (cons char (cdr string-actions))))) -(defun helm-register-action-transformer (_actions register-and-functions) +(defun helm-register-action-transformer (actions register-and-functions) "Decide actions by the contents of register." - (cl-loop with func-actions = + (cl-loop with transformer-actions = nil + with func-actions = '((insert-register "Insert Register" . (lambda (c) (insert-register (car c)))) @@ -348,7 +374,8 @@ the `global-mark-ring' after each new visit." for func in (cdr register-and-functions) for cell = (assq func func-actions) when cell - collect (cdr cell))) + do (push (cdr cell) transformer-actions) + finally return (append (nreverse transformer-actions) actions))) ;;;###autoload (defun helm-mark-ring () @@ -397,12 +424,6 @@ First call open the kill-ring browser, next calls move to next line." :resume 'noresume :allow-nest t))) -(defvar helm-kmacro-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-kmacro-help) - map)) - ;;;###autoload (defun helm-execute-kmacro () "Preconfigured helm for keyboard macros. @@ -418,13 +439,13 @@ This command is useful when used with persistent action." kmacro-ring) :test 'equal)) :multiline t - :keymap helm-kmacro-map :candidate-transformer (lambda (candidates) (cl-loop for c in candidates collect (propertize (help-key-description (car c) nil) 'helm-realvalue c))) :persistent-help "Execute kmacro" + :help-message 'helm-kmacro-help-message :action (helm-make-actions "Execute kmacro (`C-u ' to execute times)" diff --git a/elpa/helm-20150704.1247/helm-semantic.el b/elpa/helm-20160105.2046/helm-semantic.el similarity index 98% rename from elpa/helm-20150704.1247/helm-semantic.el rename to elpa/helm-20160105.2046/helm-semantic.el index 7fcdbee6..13801826 100644 --- a/elpa/helm-20150704.1247/helm-semantic.el +++ b/elpa/helm-20160105.2046/helm-semantic.el @@ -24,6 +24,7 @@ (require 'cl-lib) (require 'semantic) +(require 'helm-help) (require 'helm-imenu) (declare-function pulse-momentary-highlight-one-line "pulse.el" (point &optional face)) @@ -61,7 +62,6 @@ you have completion on these functions with `C-M i' in the customize interface." (defvar helm-semantic-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-semantic-help) (when helm-semantic-lynx-style-map (define-key map (kbd "") 'helm-maybe-exit-minibuffer) (define-key map (kbd "") 'helm-execute-persistent-action)) @@ -139,7 +139,7 @@ you have completion on these functions with `C-M i' in the customize interface." (get-line :initform 'buffer-substring) (persistent-help :initform "Show this entry") (keymap :initform 'helm-semantic-map) - (mode-line :initform helm-semantic-mode-line) + (help-message :initform 'helm-semantic-help-message) (persistent-action :initform (lambda (elm) (helm-semantic-default-action elm t) (helm-highlight-current-line))) diff --git a/elpa/helm-20150704.1247/helm-sys.el b/elpa/helm-20160105.2046/helm-sys.el similarity index 99% rename from elpa/helm-20150704.1247/helm-sys.el rename to elpa/helm-20160105.2046/helm-sys.el index 86d1a7a7..4c94ff21 100644 --- a/elpa/helm-20150704.1247/helm-sys.el +++ b/elpa/helm-20160105.2046/helm-sys.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'helm-utils) @@ -60,7 +61,6 @@ A format string where %s will be replaced with `frame-width'." (defvar helm-top-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "C-c ?") 'helm-top-help) (define-key map (kbd "M-P") 'helm-top-run-sort-by-cpu) (define-key map (kbd "M-C") 'helm-top-run-sort-by-com) (define-key map (kbd "M-M") 'helm-top-run-sort-by-mem) @@ -75,7 +75,7 @@ A format string where %s will be replaced with `frame-width'." :display-to-real #'helm-top-display-to-real :persistent-action #'helm-top-sh-persistent-action :persistent-help "SIGTERM" - :mode-line helm-top-mode-line + :help-message 'helm-top-help-message :follow 'never :keymap helm-top-map :filtered-candidate-transformer #'helm-top-sort-transformer diff --git a/elpa/helm-20150704.1247/helm-tags.el b/elpa/helm-20160105.2046/helm-tags.el similarity index 72% rename from elpa/helm-20150704.1247/helm-tags.el rename to elpa/helm-20160105.2046/helm-tags.el index 1e2ec221..fb5c2adf 100644 --- a/elpa/helm-20150704.1247/helm-tags.el +++ b/elpa/helm-20160105.2046/helm-tags.el @@ -19,7 +19,9 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'helm-utils) +(require 'helm-grep) (defgroup helm-tags nil @@ -37,10 +39,17 @@ Don't search tag file deeply if outside this value." :type 'number :group 'helm-tags) -(defcustom helm-etags-match-part-only t - "Whether to match only the tag part of CANDIDATE in -helm-source-etags-select." - :type 'boolean +(defcustom helm-etags-match-part-only 'tag + "Allow choosing the tag part of CANDIDATE in `helm-source-etags-select'. +A tag looks like this: + filename: \(defun foo +You can choose matching against only end part of tag (i.e \"foo\"), +against only the tag part (i.e \"(defun foo\"), +or against the whole candidate (i.e \"(filename: (defun foo\")." + :type '(choice + (const :tag "Match only tag" tag) + (const :tag "Match last part of tag" endtag) + (const :tag "Match all file+tag" all)) :group 'helm-tags) (defcustom helm-etags-execute-action-at-once-if-one t @@ -70,7 +79,7 @@ one match." "Run switch to other window action from `helm-source-etags-select'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action + (helm-exit-and-execute-action (lambda (c) (helm-etags-action-goto 'find-file-other-window c))))) @@ -78,7 +87,7 @@ one match." "Run switch to other frame action from `helm-source-etags-select'." (interactive) (with-helm-alive-p - (helm-quit-and-execute-action + (helm-exit-and-execute-action (lambda (c) (helm-etags-action-goto 'find-file-other-frame c))))) @@ -88,7 +97,6 @@ one match." (define-key map (kbd "M-") 'helm-goto-next-file) (define-key map (kbd "M-") 'helm-goto-precedent-file) (define-key map (kbd "C-w") 'helm-yank-text-at-point) - (define-key map (kbd "C-c ?") 'helm-etags-help) (define-key map (kbd "C-c o") 'helm-etags-run-switch-other-window) (define-key map (kbd "C-c C-o") 'helm-etags-run-switch-other-frame) map) @@ -125,7 +133,7 @@ Lookes recursively in parents directorys for a (defun helm-etags-find-tag-file-directory (current-dir) "Try to find the directory containing tag file. If not found in CURRENT-DIR search in upper directory." - (let ((file-exists? #'(lambda (dir) + (let ((file-exists? (lambda (dir) (let ((tag-path (expand-file-name helm-etags-tag-file-name dir))) (and (stringp tag-path) @@ -163,17 +171,19 @@ If not found in CURRENT-DIR search in upper directory." with fname with cand for i in split for count from 0 - for elm = (unless (string-match "^\x0c" i) - (helm-aif (string-match "\177" i) + for elm = (unless (string-match "^\x0c" i) ;; "^L" + (helm-aif (string-match "\177" i) ;; "^?" (substring i 0 it) i)) + for linum = (when (string-match "[0-9]+,?[0-9]*$" i) + (car (split-string (match-string 0 i) ","))) do (cond ((and elm (string-match "^\\([^,]+\\),[0-9]+$" elm)) (setq fname (propertize (match-string 1 elm) 'face 'helm-etags-file))) - (elm (setq cand (concat fname ": " elm))) + (elm (setq cand (format "%s:%s:%s" fname linum elm))) (t (setq cand nil))) when cand do (progn - (insert (concat cand "\n")) + (insert (propertize (concat cand "\n") 'linum linum)) (progress-reporter-update progress-reporter count))))) (defun helm-etags-init () @@ -198,11 +208,6 @@ If no entry in cache, create one." (add-to-list 'helm-etags-mtime-alist (cons f (helm-etags-mtime f)))))))))) -(defun helm-etags-split-line (line) - (let ((regexp "\\`\\([[:lower:][:upper:]]?:?.*?\\): \\(.*\\)")) - (when (string-match regexp line) - (cl-loop for n from 1 to 2 collect (match-string n line))))) - (defvar helm-source-etags-select nil "Helm source for Etags.") @@ -214,14 +219,13 @@ If no entry in cache, create one." :match-part (lambda (candidate) ;; Match only the tag part of CANDIDATE ;; and not the filename. - (if helm-etags-match-part-only - ;; Ignore the first part of the tag - ;; which is irrelevant - ;;(e.g in "(cl-defun foo" search only if "foo" match) - (cadr (split-string - (cadr (helm-etags-split-line candidate)))) - candidate)) - :mode-line helm-etags-mode-line-string + (cl-ecase helm-etags-match-part-only + (endtag (cadr (split-string + (cl-caddr (helm-grep-split-line candidate))))) + (tag (cl-caddr (helm-grep-split-line candidate))) + (all candidate))) + :fuzzy-match helm-etags-fuzzy-match + :help-message 'helm-etags-help-message :keymap helm-etags-map :action '(("Go to tag" . (lambda (c) (helm-etags-action-goto 'find-file c))) @@ -238,26 +242,36 @@ If no entry in cache, create one." (helm-etags-action-goto 'find-file candidate) (helm-highlight-current-line)))) +(defcustom helm-etags-fuzzy-match nil + "Use fuzzy matching in `helm-etags-select'." + :group 'helm-tags + :type 'boolean + :set (lambda (var val) + (set var val) + (setq helm-source-etags-select + (helm-etags-build-source)))) + (defvar find-tag-marker-ring) (defun helm-etags-action-goto (switcher candidate) "Helm default action to jump to an etags entry in other window." (require 'etags) (helm-log-run-hook 'helm-goto-line-before-hook) - (let* ((split (helm-etags-split-line candidate)) + (let* ((split (helm-grep-split-line candidate)) (fname (cl-loop for tagf being the hash-keys of helm-etags-cache for f = (expand-file-name (car split) (file-name-directory tagf)) when (file-exists-p f) return f)) - (elm (cadr split))) + (elm (cl-caddr split)) + (linum (string-to-number (cadr split)))) (if (null fname) (error "file %s not found" fname) (ring-insert find-tag-marker-ring (point-marker)) (funcall switcher fname) - (goto-char (point-min)) - (search-forward elm nil t) - (goto-char (match-beginning 0))))) + (helm-goto-line linum t) + (when (search-forward elm nil t) + (goto-char (match-beginning 0)))))) (defun helm-etags-mtime (file) "Last modification time of etags tag FILE." @@ -271,41 +285,53 @@ If FILE is nil return nil." (and last-modif (/= last-modif (helm-etags-mtime file))))) - ;;;###autoload -(defun helm-etags-select (arg) +(defun helm-etags-select (reinit) "Preconfigured helm for etags. -If called with a prefix argument or if any of the tag files have -been modified, reinitialize cache. +If called with a prefix argument REINIT +or if any of the tag files have been modified, reinitialize cache. This function aggregates three sources of tag files: - 1) An automatically located file in the parent directories, by `helm-etags-get-tag-file'. + 1) An automatically located file in the parent directories, + by `helm-etags-get-tag-file'. 2) `tags-file-name', which is commonly set by `find-tag' command. 3) `tags-table-list' which is commonly set by `visit-tags-table' command." (interactive "P") (let ((tag-files (helm-etags-all-tag-files)) - (helm-execute-action-at-once-if-one helm-etags-execute-action-at-once-if-one) - (str (if (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end)) - (thing-at-point 'symbol)))) + (helm-execute-action-at-once-if-one + helm-etags-execute-action-at-once-if-one) + (str (if (region-active-p) + (buffer-substring-no-properties + (region-beginning) (region-end)) + ;; Use a raw syntax-table to determine tap. + ;; This may be wrong when calling etags + ;; with hff from a buffer that use + ;; a different syntax, but most of the time it + ;; should be better. + (with-syntax-table (standard-syntax-table) + (thing-at-point 'symbol))))) (if (cl-notany 'file-exists-p tag-files) - (message "Error: No tag file found. Create with etags shell command, or visit with `find-tag' or `visit-tags-table'.") - (cl-loop for k being the hash-keys of helm-etags-cache - unless (member k tag-files) - do (remhash k helm-etags-cache)) - (mapc (lambda (f) - (when (or (equal arg '(4)) - (and helm-etags-mtime-alist - (helm-etags-file-modified-p f))) - (remhash f helm-etags-cache))) - tag-files) - (unless helm-source-etags-select - (setq helm-source-etags-select - (helm-etags-build-source))) - (helm :sources 'helm-source-etags-select - :keymap helm-etags-map - :default (list (concat "\\_<" str "\\_>") str) - :buffer "*helm etags*")))) + (message "Error: No tag file found.\ +Create with etags shell command, or visit with `find-tag' or `visit-tags-table'.") + (cl-loop for k being the hash-keys of helm-etags-cache + unless (member k tag-files) + do (remhash k helm-etags-cache)) + (mapc (lambda (f) + (when (or (equal reinit '(4)) + (and helm-etags-mtime-alist + (helm-etags-file-modified-p f))) + (remhash f helm-etags-cache))) + tag-files) + (unless helm-source-etags-select + (setq helm-source-etags-select + (helm-etags-build-source))) + (helm :sources 'helm-source-etags-select + :keymap helm-etags-map + :default (if helm-etags-fuzzy-match + str + (list (concat "\\_<" str "\\_>") str)) + :buffer "*helm etags*")))) (provide 'helm-tags) diff --git a/elpa/helm-20160105.2046/helm-types.el b/elpa/helm-20160105.2046/helm-types.el new file mode 100644 index 00000000..d622d3fd --- /dev/null +++ b/elpa/helm-20160105.2046/helm-types.el @@ -0,0 +1,274 @@ +;;; helm-types.el --- Helm types classes and methods. -*- lexical-binding: t -*- + +;; Copyright (C) 2015 Thierry Volpiatto + +;; Author: Thierry Volpiatto +;; URL: http://github.com/emacs-helm/helm + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + + +;;; Code: + +(require 'cl-lib) +(require 'eieio) + + +;; Files +(defclass helm-type-file (helm-source) () + "A class to define helm type file.") + +(defmethod helm-source-get-action-from-type ((object helm-type-file)) + (slot-value object 'action)) + +(defun helm-actions-from-type-file () + (let ((source (make-instance 'helm-type-file))) + (helm--setup-source source) + (helm-source-get-action-from-type source))) + +(defcustom helm-type-file-actions + (helm-make-actions + "Find file" 'helm-find-many-files + "Find file as root" 'helm-find-file-as-root + "Find file other window" 'helm-find-files-other-window + "Find file other frame" 'find-file-other-frame + "Open dired in file's directory" 'helm-open-dired + "Grep File(s) `C-u recurse'" 'helm-find-files-grep + "Zgrep File(s) `C-u Recurse'" 'helm-ff-zgrep + "Pdfgrep File(s)" 'helm-ff-pdfgrep + "Insert as org link" 'helm-files-insert-as-org-link + "Checksum File" 'helm-ff-checksum + "Ediff File" 'helm-find-files-ediff-files + "Ediff Merge File" 'helm-find-files-ediff-merge-files + "Etags `M-., C-u reload tag file'" 'helm-ff-etags-select + "View file" 'view-file + "Insert file" 'insert-file + "Add marked files to file-cache" 'helm-ff-cache-add-file + "Delete file(s)" 'helm-delete-marked-files + "Copy file(s) `M-C, C-u to follow'" 'helm-find-files-copy + "Rename file(s) `M-R, C-u to follow'" 'helm-find-files-rename + "Symlink files(s) `M-S, C-u to follow'" 'helm-find-files-symlink + "Relsymlink file(s) `C-u to follow'" 'helm-find-files-relsymlink + "Hardlink file(s) `M-H, C-u to follow'" 'helm-find-files-hardlink + "Open file externally (C-u to choose)" 'helm-open-file-externally + "Open file with default tool" 'helm-open-file-with-default-tool + "Find file in hex dump" 'hexl-find-file) + "Default actions for type files." + :group 'helm-files + :type '(alist :key-type string :value-type function)) + +(defmethod helm--setup-source :primary ((_source helm-type-file))) + +(defmethod helm--setup-source :before ((source helm-type-file)) + (set-slot-value source 'action 'helm-type-file-actions) + (set-slot-value source 'persistent-help "Show this file") + (set-slot-value source 'action-transformer '(helm-transform-file-load-el + helm-transform-file-browse-url + helm-transform-file-cache)) + (set-slot-value source 'candidate-transformer '(helm-skip-boring-files + helm-highlight-files + helm-w32-pathname-transformer))) + +;; Bookmarks +(defclass helm-type-bookmark (helm-source) () + "A class to define type bookmarks.") + +(defcustom helm-type-bookmark-actions + (helm-make-actions + "Jump to bookmark" 'helm-bookmark-jump + "Jump to BM other window" 'helm-bookmark-jump-other-window + "Bookmark edit annotation" 'bookmark-edit-annotation + "Bookmark show annotation" 'bookmark-show-annotation + "Delete bookmark(s)" 'helm-delete-marked-bookmarks + "Edit Bookmark" 'helm-bookmark-edit-bookmark + "Rename bookmark" 'helm-bookmark-rename + "Relocate bookmark" 'bookmark-relocate) + "Default actions for type bookmarks." + :group 'helm-bookmark + :type '(alist :key-type string + :value-type function)) + +(defmethod helm-source-get-action-from-type ((object helm-type-bookmark)) + (slot-value object 'action)) + +(defmethod helm--setup-source :primary ((_source helm-type-bookmark))) + +(defmethod helm--setup-source :before ((source helm-type-bookmark)) + (set-slot-value source 'action 'helm-type-bookmark-actions) + (set-slot-value source 'keymap helm-bookmark-map) + (set-slot-value source 'help-message 'helm-bookmark-help-message) + (set-slot-value source 'migemo t)) + + +;; Buffers +(defclass helm-type-buffer (helm-source) () + "A class to define type buffer.") + +(defcustom helm-type-buffer-actions + (helm-make-actions + "Switch to buffer(s)" 'helm-switch-to-buffers + (lambda () (and (locate-library "popwin") + "Switch to buffer in popup window")) + 'popwin:popup-buffer + "Switch to buffer(s) other window `C-c o'" + 'helm-switch-to-buffers-other-window + "Switch to buffer other frame `C-c C-o'" + 'switch-to-buffer-other-frame + (lambda () (and (locate-library "elscreen") + "Display buffer in Elscreen")) + 'helm-find-buffer-on-elscreen + "Query replace regexp `C-M-%'" + 'helm-buffer-query-replace-regexp + "Query replace `M-%'" 'helm-buffer-query-replace + "View buffer" 'view-buffer + "Display buffer" 'display-buffer + "Grep buffers `M-g s' (C-u grep all buffers)" + 'helm-zgrep-buffers + "Multi occur buffer(s) `C-s'" 'helm-multi-occur-as-action + "Revert buffer(s) `M-U'" 'helm-revert-marked-buffers + "Insert buffer" 'insert-buffer + "Kill buffer(s) `M-D'" 'helm-kill-marked-buffers + "Diff with file `C-='" 'diff-buffer-with-file + "Ediff Marked buffers `C-c ='" 'helm-ediff-marked-buffers + "Ediff Merge marked buffers `M-='" + (lambda (candidate) + (helm-ediff-marked-buffers candidate t))) + "Default actions for type buffers." + :group 'helm-buffers + :type '(alist :key-type string :value-type function)) + +(defmethod helm-source-get-action-from-type ((object helm-type-buffer)) + (slot-value object 'action)) + +(defmethod helm--setup-source :primary ((_source helm-type-buffer))) + +(defmethod helm--setup-source :before ((source helm-type-buffer)) + (set-slot-value source 'action 'helm-type-buffer-actions) + (set-slot-value source 'persistent-help "Show this buffer") + (set-slot-value + source 'filtered-candidate-transformer + '(helm-skip-boring-buffers + helm-buffers-sort-transformer + helm-highlight-buffers))) + +;; Functions +(defclass helm-type-function (helm-source) () + "A class to define helm type function.") + +(defcustom helm-type-function-actions + (helm-make-actions + "Describe command" 'describe-function + "Add command to kill ring" 'helm-kill-new + "Go to command's definition" 'find-function + "Debug on entry" 'debug-on-entry + "Cancel debug on entry" 'cancel-debug-on-entry + "Trace function" 'trace-function + "Trace function (background)" 'trace-function-background + "Untrace function" 'untrace-function) + "Default actions for type functions." + :group 'helm-elisp + :type '(alist :key-type string :value-type function)) + +(defmethod helm-source-get-action-from-type ((object helm-type-function)) + (slot-value object 'action)) + +(defun helm-actions-from-type-function () + (let ((source (make-instance 'helm-type-function))) + (helm--setup-source source) + (helm-source-get-action-from-type source))) + +(defmethod helm--setup-source :primary ((_source helm-type-function))) + +(defmethod helm--setup-source :before ((source helm-type-function)) + (set-slot-value source 'action 'helm-type-function-actions) + (set-slot-value source 'action-transformer + 'helm-transform-function-call-interactively) + (set-slot-value source 'candidate-transformer + 'helm-mark-interactive-functions) + (set-slot-value source 'coerce 'helm-symbolify)) + + +;; Commands +(defclass helm-type-command (helm-source) () + "A class to define helm type command.") + +(defun helm-actions-from-type-command () + (let ((source (make-instance 'helm-type-command))) + (helm--setup-source source) + (helm-source-get-action-from-type source))) + +(defcustom helm-type-command-actions + (append (helm-make-actions + "Call interactively" 'helm-call-interactively) + (helm-actions-from-type-function)) + "Default actions for type command." + :group 'helm-command + :type '(alist :key-type string :value-type function)) + +(defmethod helm--setup-source :primary ((_source helm-type-command))) + +(defmethod helm--setup-source :before ((source helm-type-command)) + (set-slot-value + source 'action 'helm-type-command-actions) + (set-slot-value source 'coerce 'helm-symbolify) + (set-slot-value source 'persistent-action 'describe-function)) + +;; Timers +(defclass helm-type-timers (helm-source) () + "A class to define helm type timers.") + +(defcustom helm-type-timers-actions + '(("Cancel Timer" . (lambda (_timer) + (let ((mkd (helm-marked-candidates))) + (cl-loop for timer in mkd + do (cancel-timer timer))))) + ("Describe Function" . (lambda (tm) + (describe-function (timer--function tm)))) + ("Find Function" . (lambda (tm) + (helm-aif (timer--function tm) + (if (byte-code-function-p it) + (message "Can't find anonymous function `%s'" it) + (find-function it)))))) + "Default actions for type timers." + :group 'helm-elisp + :type '(alist :key-type string :value-type function)) + +(defmethod helm--setup-source :primary ((_source helm-type-timers))) + +(defmethod helm--setup-source :before ((source helm-type-timers)) + (set-slot-value source 'action 'helm-type-timers-actions) + (set-slot-value source 'persistent-action + (lambda (tm) + (describe-function (timer--function tm)))) + (set-slot-value source 'persistent-help "Describe Function")) + +;; Builders. +(defun helm-build-type-file () + (helm-make-type 'helm-type-file)) + +(defun helm-build-type-function () + (helm-make-type 'helm-type-function)) + +(defun helm-build-type-command () + (helm-make-type 'helm-type-command)) + +(provide 'helm-types) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-types.el ends here diff --git a/elpa/helm-20150704.1247/helm-utils.el b/elpa/helm-20160105.2046/helm-utils.el similarity index 64% rename from elpa/helm-20150704.1247/helm-utils.el rename to elpa/helm-20160105.2046/helm-utils.el index 9f764692..3f28a791 100644 --- a/elpa/helm-20150704.1247/helm-utils.el +++ b/elpa/helm-20160105.2046/helm-utils.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) +(require 'helm-help) (require 'compile) ; Fixme: Is this needed? (require 'dired) @@ -35,15 +36,6 @@ :type 'string :group 'helm-utils) -(defcustom helm-yank-text-at-point-function nil - "The function used to forward point with `helm-yank-text-at-point'. -With a nil value, fallback to default `forward-word'. -The function should take one arg, an integer like `forward-word'. -NOTE: Using `forward-symbol' here is not very useful as it is already -provided by \\\\[next-history-element]." - :type 'function - :group 'helm-utils) - (defcustom helm-default-kbsize 1024.0 "Default Kbsize to use for showing files size. It is a float, usually 1024.0 but could be 1000.0 on some systems." @@ -107,17 +99,6 @@ In this case last position is added to the register ;;; Utils functions ;; ;; -(defun helm-ff-find-printers () - "Return a list of available printers on Unix systems." - (when (executable-find "lpstat") - (let ((printer-list (with-temp-buffer - (call-process "lpstat" nil t nil "-a") - (split-string (buffer-string) "\n")))) - (cl-loop for p in printer-list - for printer = (car (split-string p)) - when printer - collect printer)))) - (defun helm-switch-to-buffers (buffer-or-name &optional other-window) "Switch to buffer BUFFER-OR-NAME. If more than one buffer marked switch to these buffers in separate windows. @@ -146,53 +127,6 @@ in separate windows." See `helm-switch-to-buffers' for switching to marked buffers." (helm-switch-to-buffers buffer-or-name t)) -(cl-defmacro helm-position (item seq &key (test 'eq) all) - "A simple and faster replacement of CL `position'. -Return position of first occurence of ITEM found in SEQ. -Argument SEQ can be a string, in this case ITEM have to be a char. -Argument ALL, if non--nil specify to return a list of positions of -all ITEM found in SEQ." - (let ((key (if (stringp seq) 'across 'in))) - `(cl-loop for c ,key ,seq - for index from 0 - when (funcall ,test c ,item) - if ,all collect index into ls - else return index - finally return ls))) - -(defun helm-substring (str width) - "Return the substring of string STR from 0 to WIDTH. -Handle multibyte characters by moving by columns." - (with-temp-buffer - (save-excursion - (insert str)) - (move-to-column width) - (buffer-substring (point-at-bol) (point)))) - -(cl-defun helm-substring-by-width (str width &optional (endstr "...")) - "Truncate string STR to end at column WIDTH. -Similar to `truncate-string-to-width'. -Add ENDSTR (default \"...\") at end of truncated STR. -Add spaces at end if needed to reach WIDTH when STR is shorter than WIDTH." - (cl-loop for ini-str = str - then (substring ini-str 0 (1- (length ini-str))) - for sw = (string-width ini-str) - when (<= sw width) return - (concat ini-str endstr (make-string (- width sw) ? )))) - -(defun helm-string-multibyte-p (str) - "Check if string STR contains multibyte characters." - (cl-loop for c across str - thereis (> (char-width c) 1))) - -(defun helm-get-pid-from-process-name (process-name) - "Get pid from running process PROCESS-NAME." - (cl-loop with process-list = (list-system-processes) - for pid in process-list - for process = (assoc-default 'comm (process-attributes pid)) - when (and process (string-match process-name process)) - return pid)) - (cl-defun helm-current-buffer-narrowed-p (&optional (buffer helm-current-buffer)) "Check if BUFFER is narrowed. @@ -203,9 +137,6 @@ Default is `helm-current-buffer'." (total (buffer-size))) (or (/= beg 1) (/= end (1+ total)))))) -(defun helm-region-active-p () - (and transient-mark-mode mark-active (/= (mark) (point)))) - (defun helm-goto-char (loc) "Go to char, revealing if necessary." (goto-char loc) @@ -266,60 +197,6 @@ With a numeric prefix arg show only the ARG number of candidates." collect (buffer-substring-no-properties (point-at-bol)(point-at-eol)) do (forward-line 1)))) -(defun helm-skip-entries (seq regexp-list) - "Remove entries which matches one of REGEXP-LIST from SEQ." - (cl-loop for i in seq - unless (cl-loop for regexp in regexp-list - thereis (and (stringp i) - (string-match regexp i))) - collect i)) - -(defun helm-shadow-entries (seq regexp-list) - "Put shadow property on entries in SEQ matching a regexp in REGEXP-LIST." - (let ((face 'italic)) - (cl-loop for i in seq - if (cl-loop for regexp in regexp-list - thereis (and (stringp i) - (string-match regexp i))) - collect (propertize i 'face face) - else collect i))) - -(defun helm-describe-function (func) - "FUNC is symbol or string." - (describe-function (helm-symbolify func)) - (message nil)) - -(defun helm-describe-variable (var) - "VAR is symbol or string." - (describe-variable (helm-symbolify var)) - (message nil)) - -(defun helm-find-function (func) - "FUNC is symbol or string." - (find-function (helm-symbolify func))) - -(defun helm-find-variable (var) - "VAR is symbol or string." - (find-variable (helm-symbolify var))) - -(defun helm-kill-new (candidate &optional replace) - "CANDIDATE is symbol or string. -See `kill-new' for argument REPLACE." - (kill-new (helm-stringify candidate) replace)) - -(cl-defun helm-fast-remove-dups (seq &key (test 'eq)) - "Remove duplicates elements in list SEQ. -This is same as `remove-duplicates' but with memoisation. -It is much faster, especially in large lists. -A test function can be provided with TEST argument key. -Default is `eq'." - (cl-loop with cont = (make-hash-table :test test) - for elm in seq - unless (gethash elm cont) - do (puthash elm elm cont) - finally return - (cl-loop for i being the hash-values in cont collect i))) - (defun helm-handle-winner-boring-buffers () "Add `helm-buffer' to `winner-boring-buffers' when quitting/exiting helm. Add this function to `helm-cleanup-hook' when you don't want to see helm buffers @@ -335,7 +212,7 @@ If current selection is a buffer or a file, `helm-find-files' from its directory." (interactive) (require 'helm-grep) - (helm-run-after-quit + (helm-run-after-exit (lambda (f) (if (file-exists-p f) (helm-find-files-1 (file-name-directory f) @@ -352,7 +229,8 @@ from its directory." (not grep-line) (replace-regexp-in-string "\\`\\*" "" sel))) (bmk (and bmk-name (assoc bmk-name bookmark-alist))) - (buf (helm-aif (get-buffer sel) (buffer-name it))) + (buf (helm-aif (and (bufferp sel) (get-buffer sel)) + (buffer-name it))) (default-preselection (or (buffer-file-name helm-current-buffer) default-directory))) (cond @@ -385,108 +263,38 @@ from its directory." ;; Default. (t default-preselection))))) -;; Same as `vc-directory-exclusion-list'. -(defvar helm-walk-ignore-directories - '("SCCS" "RCS" "CVS" "MCVS" ".svn" ".git" ".hg" ".bzr" - "_MTN" "_darcs" "{arch}" ".gvfs")) - -(cl-defun helm-walk-directory (directory &key (path 'basename) - (directories t) - match skip-subdirs) - "Walk through DIRECTORY tree. -Argument PATH can be one of basename, relative, full, or a function -called on file name, default to basename. -Argument DIRECTORIES when non--nil (default) return also directories names, -otherwise skip directories names. -Argument MATCH can be a predicate or a regexp. -Argument SKIP-SUBDIRS when non--nil will skip `helm-walk-ignore-directories' -unless it is given as a list of directories, in this case this list will be used -instead of `helm-walk-ignore-directories'." - (let* ((result '()) - (fn (cl-case path - (basename 'file-name-nondirectory) - (relative 'file-relative-name) - (full 'identity) - (t path)))) - (cl-labels ((ls-rec (dir) - (unless (and skip-subdirs - (member (helm-basename dir) - (if (listp skip-subdirs) - skip-subdirs - helm-walk-ignore-directories))) - (cl-loop with ls = (sort (file-name-all-completions "" dir) - 'string-lessp) - for f in ls - ;; Use `directory-file-name' to remove the final slash. - ;; Needed to avoid infloop on symlinks symlinking - ;; a directory inside it [1]. - for file = (directory-file-name - (expand-file-name f dir)) - unless (member f '("./" "../")) - ;; A directory. - if (char-equal (aref f (1- (length f))) ?/) - do (progn (when directories - (push (funcall fn file) result)) - ;; Don't recurse in symlinks. - ;; `file-symlink-p' have to be called - ;; on the directory with its final - ;; slash removed [1]. - (and (not (file-symlink-p file)) - (ls-rec file))) - else do - (if match - (and (if (functionp match) - (funcall match f) - (and (stringp match) - (string-match match f))) - (push (funcall fn file) result)) - (push (funcall fn file) result)))))) - (ls-rec directory) - (nreverse result)))) - (defun helm-generic-sort-fn (s1 s2) "Sort predicate function for helm candidates. Args S1 and S2 can be single or \(display . real\) candidates, that is sorting is done against real value of candidate." - (let* ((reg1 (concat "\\_<" helm-pattern "\\_>")) - (reg2 (concat "\\_<" helm-pattern)) - (split (split-string helm-pattern)) + (let* ((pattern (regexp-quote helm-pattern)) + (reg1 (concat "\\_<" pattern "\\_>")) + (reg2 (concat "\\_<" pattern)) + (reg3 helm-pattern) + (split (split-string pattern)) (str1 (if (consp s1) (cdr s1) s1)) (str2 (if (consp s2) (cdr s2) s2)) - (score #'(lambda (str r1 r2 lst) - (cond ((string-match r1 str) 4) - ((and (string-match " " helm-pattern) - (string-match (concat "\\_<" (car lst)) str) - (cl-loop for r in (cdr lst) - always (string-match r str))) 3) - ((and (string-match " " helm-pattern) - (cl-loop for r in lst always (string-match r str))) 2) - ((string-match r2 str) 1) - (t 0)))) - (sc1 (funcall score str1 reg1 reg2 split)) - (sc2 (funcall score str2 reg1 reg2 split))) - (cond ((or (zerop (string-width helm-pattern)) + (score (lambda (str r1 r2 r3 lst) + (+ (if (string-match (concat "\\`" pattern) str) 1 0) + (cond ((string-match r1 str) 5) + ((and (string-match " " pattern) + (string-match (concat "\\_<" (car lst)) str) + (cl-loop for r in (cdr lst) + always (string-match r str))) 4) + ((and (string-match " " pattern) + (cl-loop for r in lst always (string-match r str))) 3) + ((string-match r2 str) 2) + ((string-match r3 str) 1) + (t 0))))) + (sc1 (funcall score str1 reg1 reg2 reg3 split)) + (sc2 (funcall score str2 reg1 reg2 reg3 split))) + (cond ((or (zerop (string-width pattern)) (and (zerop sc1) (zerop sc2))) (string-lessp str1 str2)) ((= sc1 sc2) (< (length str1) (length str2))) (t (> sc1 sc2))))) -(defun helm-basename (fname &optional ext) - "Print FNAME with any leading directory components removed. -If specified, also remove filename extension EXT." - (let ((non-essential t)) - (if (and ext (or (string= (file-name-extension fname) ext) - (string= (file-name-extension fname t) ext)) - (not (file-directory-p fname))) - (file-name-sans-extension (file-name-nondirectory fname)) - (file-name-nondirectory (directory-file-name fname))))) - -(defun helm-basedir (fname) - "Return the base directory of filename." - (helm-aif (and fname (file-name-directory fname)) - (file-name-as-directory it))) - (defun helm-ff-get-host-from-tramp-invalid-fname (fname) "Extract hostname from an incomplete tramp file name. Return nil on valid file name remote or not." @@ -621,13 +429,6 @@ If STRING is non--nil return instead a space separated string." (mapconcat 'identity (list type user group other) " ") (list :mode-type type :user user :group group :other other)))) -(defun helm-current-directory () - "Return current-directory name at point. -Useful in dired buffers when there is inserted subdirs." - (if (eq major-mode 'dired-mode) - (dired-current-directory) - default-directory)) - (defmacro with-helm-display-marked-candidates (buffer-or-name candidates &rest body) (declare (indent 0) (debug t)) (helm-with-gensyms (buffer window) @@ -655,20 +456,20 @@ Useful in dired buffers when there is inserted subdirs." "Highlight and underline current position" (let* ((start (or start (line-beginning-position))) (end (or end (1+ (line-end-position)))) - (start-match (if (or (zerop helm-highlight-number-lines-around-point) - (null helm-highlight-number-lines-around-point)) + (start-match (if (or (null helm-highlight-number-lines-around-point) + (zerop helm-highlight-number-lines-around-point)) start - (save-excursion - (forward-line - (- helm-highlight-number-lines-around-point)) - (point-at-bol)))) - (end-match (if (or (zerop helm-highlight-number-lines-around-point) - (null helm-highlight-number-lines-around-point)) + (save-excursion + (forward-line + (- helm-highlight-number-lines-around-point)) + (point-at-bol)))) + (end-match (if (or (null helm-highlight-number-lines-around-point) + (zerop helm-highlight-number-lines-around-point)) end - (save-excursion - (forward-line - helm-highlight-number-lines-around-point) - (point-at-eol)))) + (save-excursion + (forward-line + helm-highlight-number-lines-around-point) + (point-at-eol)))) (args (list start end buf))) (if (not helm-match-line-overlay) (setq helm-match-line-overlay (apply 'make-overlay args)) @@ -682,16 +483,18 @@ Useful in dired buffers when there is inserted subdirs." do (save-excursion (goto-char start-match) (while (condition-case _err - (re-search-forward r end-match t) + (if helm-migemo-mode + (helm-mm-migemo-forward r end-match t) + (re-search-forward r end-match t)) (invalid-regexp nil)) (let ((s (match-beginning 0)) (e (match-end 0))) (if (= s e) (throw 'empty-line nil) - (push (setq ov (make-overlay s e)) - helm--match-item-overlays) - (overlay-put ov 'face 'helm-match-item) - (overlay-put ov 'priority 1))))))) + (push (setq ov (make-overlay s e)) + helm--match-item-overlays) + (overlay-put ov 'face 'helm-match-item) + (overlay-put ov 'priority 1))))))) (recenter) (when pulse (sit-for 0.3) @@ -719,20 +522,6 @@ Useful in dired buffers when there is inserted subdirs." (add-hook 'helm-cleanup-hook 'helm-match-line-cleanup) (add-hook 'helm-after-persistent-action-hook 'helm-match-line-update) -(defun helm-w32-prepare-filename (file) - "Convert filename FILE to something usable by external w32 executables." - (replace-regexp-in-string ; For UNC paths - "/" "\\" - (replace-regexp-in-string ; Strip cygdrive paths - "/cygdrive/\\(.\\)" "\\1:" - file nil nil) nil t)) - -;;;###autoload -(defun helm-w32-shell-execute-open-file (file) - (interactive "fOpen file:") - (with-no-warnings - (w32-shell-execute "open" (helm-w32-prepare-filename file)))) - (defun helm-open-file-with-default-tool (file) "Open FILE with the default tool on this platform." (let (process-connection-type) @@ -780,41 +569,6 @@ directory, open this directory." (let ((helm--reading-passwd-or-string t)) (mapc 'find-file (helm-marked-candidates)))) -(defun helm-quit-and-execute-action (action) - "Quit current helm session and execute ACTION." - (setq helm-saved-action action) - (helm-exit-minibuffer)) - -;; Yank text at point. -;; -;; -;; Internal -(defvar helm-yank-point nil) - -;;;###autoload -(defun helm-yank-text-at-point () - "Yank text at point in `helm-current-buffer' into minibuffer. -If `helm-yank-symbol-first' is non--nil the first yank -grabs the entire symbol." - (interactive) - (with-helm-current-buffer - (let ((fwd-fn (or helm-yank-text-at-point-function #'forward-word))) - ;; Start to initial point if C-w have never been hit. - (unless helm-yank-point (setq helm-yank-point (point))) - (save-excursion - (goto-char helm-yank-point) - (funcall fwd-fn 1) - (helm-set-pattern - (concat - helm-pattern (replace-regexp-in-string - "\\`\n" "" - (buffer-substring-no-properties - helm-yank-point (point))))) - (setq helm-yank-point (point)))))) - -(defun helm-reset-yank-point () - (setq helm-yank-point nil)) - (defun helm-read-repeat-string (prompt &optional count) "Prompt as many time PROMPT is not empty. If COUNT is non--nil add a number after each prompt." @@ -826,9 +580,6 @@ If COUNT is non--nil add a number after each prompt." collect (setq elm (helm-read-string prompt)) into lis finally return (remove "" lis))) -(add-hook 'helm-cleanup-hook 'helm-reset-yank-point) -(add-hook 'helm-after-initialize-hook 'helm-reset-yank-point) - (defun helm-html-bookmarks-to-alist (file url-regexp bmk-regexp) "Parse html bookmark FILE and return an alist with (title . url) as elements." (let (bookmarks-alist url title) diff --git a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-pkg.el b/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-pkg.el deleted file mode 100644 index 66694c0b..00000000 --- a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "helm-c-yasnippet" "20140131.226" "helm source for yasnippet.el" (quote ((helm "1.5.8") (yasnippet "0.8.0") (cl-lib "0.3")))) diff --git a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-autoloads.el b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-autoloads.el similarity index 66% rename from elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-autoloads.el rename to elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-autoloads.el index faa11e92..f4fc61d2 100644 --- a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet-autoloads.el +++ b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-autoloads.el @@ -1,11 +1,10 @@ ;;; helm-c-yasnippet-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads (helm-yas-create-snippet-on-region helm-yas-visit-snippet-file -;;;;;; helm-yas-complete) "helm-c-yasnippet" "helm-c-yasnippet.el" -;;;;;; (21827 20380 0 0)) +;;;### (autoloads nil "helm-c-yasnippet" "helm-c-yasnippet.el" (22156 +;;;;;; 56481 0 0)) ;;; Generated autoloads from helm-c-yasnippet.el (autoload 'helm-yas-complete "helm-c-yasnippet" "\ @@ -25,16 +24,9 @@ Create a snippet from region. ;;;*** -;;;### (autoloads nil nil ("helm-c-yasnippet-pkg.el") (21827 20380 -;;;;;; 405368 0)) - -;;;*** - -(provide 'helm-c-yasnippet-autoloads) ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; helm-c-yasnippet-autoloads.el ends here diff --git a/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-pkg.el b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-pkg.el new file mode 100644 index 00000000..2e82c7c3 --- /dev/null +++ b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet-pkg.el @@ -0,0 +1 @@ +(define-package "helm-c-yasnippet" "20151231.10" "helm source for yasnippet.el" '((helm "1.7.7") (yasnippet "0.8.0") (cl-lib "0.3")) :keywords '("convenience" "emulation")) diff --git a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet.el b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet.el similarity index 74% rename from elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet.el rename to elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet.el index 68081cb5..f763928b 100644 --- a/elpa/helm-c-yasnippet-20140131.226/helm-c-yasnippet.el +++ b/elpa/helm-c-yasnippet-20151231.10/helm-c-yasnippet.el @@ -1,13 +1,13 @@ -;;; helm-c-yasnippet.el --- helm source for yasnippet.el +;;; helm-c-yasnippet.el --- helm source for yasnippet.el -*- lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 Kenji.I (Kenji Imakado) ;; Copyright (C) 2012,2013 Yuhei Maeda ;; Copyright (C) 2014 Yuhei Maeda , Yasuyuki Oka ;; Author: Kenji.I (Kenji Imakado) -;; Version: 0.6.6 -;; Package-Version: 20140131.226 -;; Package-Requires: ((helm "1.5.8")(yasnippet "0.8.0") (cl-lib "0.3")) +;; Version: 0.6.7 +;; Package-Version: 20151231.10 +;; Package-Requires: ((helm "1.7.7") (yasnippet "0.8.0") (cl-lib "0.3")) ;; Keywords: convenience, emulation ;; This file is free software; you can redistribute it and/or modify @@ -73,6 +73,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-files) (require 'yasnippet) (defgroup helm-yasnippet nil @@ -112,6 +113,10 @@ ex. for (...) { ... }" :type 'function :group 'helm-yasnippet) +(defface helm-yas-key '((t (:foreground "orange" :underline t))) + "Face used in helm-yas-complete to show key triggers." + :group 'helm-yasnippet) + (defvar helm-yas-cur-snippets-alist nil) (defun helm-yas-create-new-snippet-insert (selected-text snippet-file) @@ -133,13 +138,14 @@ ex. for (...) { ... }" If SNIPPET-FILE is nil, asks file name. If SNIPPET-FILE does not contain directory, it is placed in default snippet directory." (let* ((major-mode-dir (regexp-quote (symbol-name major-mode))) - (yas-dir (expand-file-name (or (car-safe yas/root-directory) yas/root-directory))) + (yas-dir (expand-file-name (or (car-safe yas-snippet-dirs) yas-snippet-dirs))) (snippet-dir (or (helm-yas-find-recursively major-mode-dir yas-dir 'snippet-file) (let ((target-dir (format "%s/%s/" yas-dir major-mode-dir))) (if (yes-or-no-p (format "%s doesn't exist. Would you like to create this directory?" target-dir)) - (progn (make-directory target-dir) - (setq snippet-dir target-dir)) + (progn + (make-directory target-dir) + target-dir) (deactivate-mark) (error "Snippet creation failed")))))) (setq snippet-file @@ -151,23 +157,23 @@ If SNIPPET-FILE does not contain directory, it is placed in default snippet dire (helm-yas-create-new-snippet-file selected-text snippet-file))) (defun helm-yas-find-recursively (regexp &optional directory predicate) - (let ((directory (or directory default-directory)) - (predfunc (case predicate - (dir 'file-directory-p) - (file 'file-regular-p) - (otherwise 'identity))) - (files (cl-remove-if (lambda (s) (string-match "^\\." (file-name-nondirectory s))) (directory-files directory t))) - (found nil) - (result nil)) - (loop for file in files - unless found - do (if (and (funcall predfunc file) - (string-match regexp file)) - (progn (setq found t) - (return (file-name-as-directory file))) - (when (file-directory-p file) - (setq result (helm-yas-find-recursively regexp file predicate)))) - finally (return result)))) + (let* ((directory (or directory default-directory)) + (predfunc (cl-case predicate + (dir 'file-directory-p) + (file 'file-regular-p) + (otherwise 'identity))) + (files (cl-remove-if (lambda (s) (string-match "^\\." (file-name-nondirectory s))) (directory-files directory t))) + (found nil) + (result nil)) + (cl-loop for file in files + unless found + do (if (and (funcall predfunc file) + (string-match regexp file)) + (progn (setq found t) + (return (file-name-as-directory file))) + (when (file-directory-p file) + (setq result (helm-yas-find-recursively regexp file predicate)))) + finally (return result)))) (defun helm-yas-build-cur-snippets-alist (&optional table) @@ -180,35 +186,35 @@ If SNIPPET-FILE does not contain directory, it is placed in default snippet dire (list table) (yas--get-snippet-tables))) (hash-value-alist nil)) - (let ((hashes (loop for table in cur-tables - collect (yas--table-hash table)))) - (loop for hash in hashes - do (maphash (lambda (k v) - (let (a) - (maphash (lambda (n te) - (setq a (append (list (cons k te)) a))) - v) - (setq hash-value-alist (append a hash-value-alist)))) - hash)) - (loop with transformed - with templates - with template-key-alist - with template-file-alist - for lst in hash-value-alist - for key = (car lst) - for template-struct = (cdr lst) - for name = (yas--template-name template-struct) ;`yas--template-name' - for template = (yas--template-content template-struct) ;`yas--template-content' - for file = (yas--template-file template-struct) ;`yas--template-content' - do (progn (push template templates) - (push `(,name . ,template) transformed) - (push `(,template . ,key) template-key-alist) - (push `(,template . ,file) template-file-alist) - ) - finally (progn (push `(candidates . ,templates) result-alist) - (push `(transformed . ,transformed) result-alist) - (push `(template-file-alist . ,template-file-alist) result-alist) - (push `(template-key-alist . ,template-key-alist) result-alist))) + (let ((hashes (cl-loop for table in cur-tables + collect (yas--table-hash table)))) + (cl-loop for hash in hashes + do (maphash (lambda (k v) + (let (a) + (maphash (lambda (_n te) + (setq a (append (list (cons k te)) a))) + v) + (setq hash-value-alist (append a hash-value-alist)))) + hash)) + (cl-loop with transformed + with templates + with template-key-alist + with template-file-alist + for lst in hash-value-alist + for key = (car lst) + for template-struct = (cdr lst) + for name = (yas--template-name template-struct) ;`yas--template-name' + for template = (yas--template-content template-struct) ;`yas--template-content' + for file = (yas--template-load-file template-struct) ;`yas--template-content' + do (progn (push template templates) + (push `(,name . ,template) transformed) + (push `(,template . ,key) template-key-alist) + (push `(,template . ,file) template-file-alist) + ) + finally (progn (push `(candidates . ,templates) result-alist) + (push `(transformed . ,transformed) result-alist) + (push `(template-file-alist . ,template-file-alist) result-alist) + (push `(template-key-alist . ,template-key-alist) result-alist))) result-alist) ))) @@ -244,12 +250,13 @@ like `yas--current-key'" (setq transformed-list (cl-remove-if-not (lambda (lst) (string-match (concat "^" (regexp-quote initial-input)) (car lst))) transformed-list)) - (setq transformed-list (loop for dotlst in transformed-list - for name = (car dotlst) - for template = (cdr dotlst) - for key = (helm-yas-get-key-by-template template alist) - for name-inc-key = (concat "[" key "] " name) - collect `(,name-inc-key . ,template)))) + (setq transformed-list (cl-loop for dotlst in transformed-list + for name = (car dotlst) + for template = (cdr dotlst) + for key = (helm-yas-get-key-by-template template alist) + for name-inc-key = (concat "[" (propertize key 'face 'helm-yas-key) "] " name) + collect `(,name-inc-key . ,template)))) + ;; default ex: for (...) { ... } (t (setq transformed-list (cl-remove-if-not (lambda (lst) @@ -262,8 +269,8 @@ like `yas--current-key'" transformed-list)) (defun helm-yas-find-file-snippet-by-template (template &optional other-window) - (let* ((path (helm-yas-get-path-by-template template)) -;; (let* ((path (assoc-default template (assoc-default 'template-file-alist helm-yas-cur-snippets-alist))) + (let* ((path (helm-yas-get-path-by-template template)) + ;; (let* ((path (assoc-default template (assoc-default 'template-file-alist helm-yas-cur-snippets-alist))) (ff-func (if other-window 'find-file-other-window 'find-file))) (if path (funcall ff-func path) @@ -291,7 +298,7 @@ space match anyword greedy" (init . (lambda () (setq helm-yas-selected-text (if mark-active (buffer-substring-no-properties (region-beginning) (region-end)) "")) (multiple-value-setq - (helm-yas-initial-input helm-yas-point-start helm-yas-point-end) (helm-yas-get-cmp-context)) ;return values(str point point) + (helm-yas-initial-input helm-yas-point-start helm-yas-point-end) (helm-yas-get-cmp-context)) ;return values(str point point) (setq helm-yas-cur-snippets-alist (helm-yas-build-cur-snippets-alist)))) (candidates . (helm-yas-get-candidates helm-yas-cur-snippets-alist)) (candidate-transformer . (lambda (candidates) @@ -302,7 +309,7 @@ space match anyword greedy" (message "this snippet is bound to [ %s ]" (helm-yas-get-key-by-template template helm-yas-cur-snippets-alist))))) ("Open snippet file" . (lambda (template) - (helm-yas-find-file-snippet-by-template template))) + (helm-yas-find-file-snippet-by-template template))) ("Open snippet file other window" . (lambda (template) (helm-yas-find-file-snippet-by-template template t))) ("Create new snippet on region" . (lambda (template) @@ -311,12 +318,12 @@ space match anyword greedy" (yas-reload-all) (message "Reload All Snippts done"))) ("Rename snippet file" . (lambda (template) - (let* ((path (or (helm-yas-get-path-by-template template) "")) - (dir (file-name-directory path)) - (filename (file-name-nondirectory path)) - (rename-to (read-string (concat "rename [" filename "] to: ")))) - (rename-file path (concat dir rename-to)) - (yas-reload-all)))) + (let* ((path (or (helm-yas-get-path-by-template template) "")) + (dir (file-name-directory path)) + (filename (file-name-nondirectory path)) + (rename-to (read-string (concat "rename [" filename "] to: ")))) + (rename-file path (concat dir rename-to)) + (yas-reload-all)))) ("Delete snippet file" . (lambda (template) (let ((path (or (helm-yas-get-path-by-template template) ""))) (when (y-or-n-p "really delete?") @@ -330,8 +337,8 @@ space match anyword greedy" ;;; visit template (defun helm-yas-all-templates () (let ((tables (yas--get-snippet-tables))) - (loop for table in tables - append (yas--table-templates table)))) + (cl-loop for table in tables + append (yas--table-templates table)))) (defun helm-yas-snippet-files-candidates () "called in `helm-source-yasnippet-snippet-files' candidates" @@ -339,16 +346,19 @@ space match anyword greedy" (yas-choose-tables-first nil) (yas-buffer-local-condition 'always)) (with-current-buffer helm-current-buffer - (cl-mapcar 'yas--template-file + (cl-mapcar 'yas--template-load-file (mapcar 'cdr (helm-yas-all-templates)))))) +(defun helm-yas--visit-files-transformer (candidate) + (file-name-nondirectory candidate)) + ;; (helm 'helm-source-yasnippet-snippet-files) (defvar helm-source-yasnippet-snippet-files - '((name . "yasnippet snippet files") - (candidates . helm-yas-snippet-files-candidates) - (type . file) - )) + (helm-build-sync-source "yasnippet snippet files" + :candidates #'helm-yas-snippet-files-candidates + :real-to-display #'helm-yas--visit-files-transformer + :action (helm-actions-from-type-file))) ;;; Commands diff --git a/elpa/helm-core-20160105.2046/helm-core-autoloads.el b/elpa/helm-core-20160105.2046/helm-core-autoloads.el new file mode 100644 index 00000000..71356981 --- /dev/null +++ b/elpa/helm-core-20160105.2046/helm-core-autoloads.el @@ -0,0 +1,202 @@ +;;; helm-core-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +;;;### (autoloads nil "helm" "helm.el" (22156 56341 0 0)) +;;; Generated autoloads from helm.el + +(autoload 'helm-define-multi-key "helm" "\ +In KEYMAP, define key sequence KEY for function list FUNCTIONS. +Each function run sequentially each time the key KEY is pressed. +If DELAY is specified switch back to initial function of FUNCTIONS list +after DELAY seconds. +The functions in FUNCTIONS list are functions with no args. +e.g + (defun foo () + (message \"Run foo\")) + (defun bar () + (message \"Run bar\")) + (defun baz () + (message \"Run baz\")) + +\(helm-define-multi-key global-map \" q\" '(foo bar baz) 2) + +Each time \" q\" is pressed the next function is executed, if you wait +More than 2 seconds, next hit will run again the first function and so on. + +\(fn KEYMAP KEY FUNCTIONS &optional DELAY)" nil nil) + +(autoload 'helm-multi-key-defun "helm" "\ +Define NAME as a multi-key command running FUNS. +After DELAY seconds the FUNS list is reinitialised. +See `helm-define-multi-key'. + +\(fn NAME DOCSTRING FUNS &optional DELAY)" nil t) + +(put 'helm-multi-key-defun 'lisp-indent-function '2) + +(autoload 'helm-define-key-with-subkeys "helm" "\ +Allow defining in MAP a KEY and SUBKEY to COMMAND. + +This allow typing KEY to call COMMAND the first time and +type only SUBKEY on subsequent calls. + +Arg MAP is the keymap to use, SUBKEY is the initial short keybinding to +call COMMAND. + +Arg OTHER-SUBKEYS is an alist specifying other short keybindings +to use once started. +e.g: + +\(helm-define-key-with-subkeys global-map + (kbd \"C-x v n\") ?n 'git-gutter:next-hunk '((?p . git-gutter:previous-hunk))) + + +In this example, `C-x v n' will run `git-gutter:next-hunk' +subsequent hits on \"n\" will run this command again +and subsequent hits on \"p\" will run `git-gutter:previous-hunk'. + +Arg MENU is a string to display in minibuffer +to describe SUBKEY and OTHER-SUBKEYS. +Arg EXIT-FN specify a function to run on exit. + +Any other keys pressed run their assigned command defined in MAP +and exit the loop running EXIT-FN if specified. + +NOTE: SUBKEY and OTHER-SUBKEYS bindings support +only char syntax actually (e.g ?n) +so don't use strings, vectors or whatever to define them. + +\(fn MAP KEY SUBKEY COMMAND &optional OTHER-SUBKEYS MENU EXIT-FN)" nil nil) + +(put 'helm-define-key-with-subkeys 'lisp-indent-function '1) + +(autoload 'helm-debug-open-last-log "helm" "\ +Open helm log file of last helm session. +If `helm-last-log-file' is nil, switch to `helm-debug-buffer' . + +\(fn)" t nil) + +(autoload 'helm "helm" "\ +Main function to execute helm sources. + +Keywords supported: +:sources :input :prompt :resume :preselect +:buffer :keymap :default :history :allow-nest + +Extra LOCAL-VARS keywords are supported, see below. + +PLIST is a list like (:key1 val1 :key2 val2 ...) or +\(&optional sources input prompt resume + preselect buffer keymap default history). + +Basic keywords are the following: + +:sources + +A list of sources used for this session. It also accepts a +symbol, interpreted as a variable of a helm source +i.e (a symbol can be passed instead of a list of sources). +It also accepts an alist representing a helm source, which is +detected by (assq 'name ANY-SOURCES). +NOTE: In this case the source is embedded in the helm command and +have no symbol name, so it is not reachable from outside. +It will be referenced in `helm-sources' as a whole alist. + +:input + +Temporary value of `helm-pattern', ie. initial input of minibuffer. + +:prompt + +Prompt other than \"pattern: \". + +:resume + +If t, Resurrect previously instance of `helm'. Skip the initialization. +If 'noresume, this instance of `helm' cannot be resumed. + +:preselect + +Initially selected candidate. Specified by exact candidate or a regexp. + +:buffer + +`helm-buffer' instead of *helm*. + +:keymap + +`helm-map' for current `helm' session. + +:default + +A default argument that will be inserted in minibuffer with \\\\[next-history-element]. +When nil or not present `thing-at-point' will be used instead. +If `helm--maybe-use-default-as-input' is non--nil display will be +updated using :default arg as input unless :input is specified, +which in this case will take precedence on :default +This is a string or a list, in this case the car of the list will +be used as initial default input, but you will be able to cycle in this +list with \\\\[next-history-element]. + +:history + +By default all minibuffer input is pushed to `minibuffer-history', +if an argument HISTORY is provided, input will be pushed to HISTORY. +History element should be a symbol. + +:allow-nest + +Allow running this helm command within a running helm session. + +Of course, conventional arguments are supported, the two are same. + +\(helm :sources sources :input input :prompt prompt :resume resume + :preselect preselect :buffer buffer :keymap keymap :default default + :history history) + +and + +\(helm sources input prompt resume preselect buffer keymap default history) + +are the same. + +However the use of non keyword args is deprecated and should not be used. + +Other keywords are interpreted as local variables of this helm session. +The `helm-' prefix can be omitted. For example, + +\(helm :sources 'helm-source-buffers-list + :buffer \"*buffers*\" :candidate-number-limit 10) + +means starting helm session with `helm-source-buffers' +source in *buffers* buffer and set variable `helm-candidate-number-limit' +to 10 as session local variable. + +\(fn &key SOURCES INPUT PROMPT RESUME PRESELECT BUFFER KEYMAP DEFAULT HISTORY ALLOW-NEST OTHER-LOCAL-VARS)" nil nil) + +(autoload 'helm-other-buffer "helm" "\ +Simplified interface of `helm' with other `helm-buffer'. +Call `helm' with only ANY-SOURCES and ANY-BUFFER as args. + +\(fn ANY-SOURCES ANY-BUFFER)" nil nil) + +(autoload 'helm-debug-toggle "helm" "\ +Enable/disable helm debug from outside of helm session. + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("helm-core-pkg.el" "helm-lib.el" "helm-multi-match.el" +;;;;;; "helm-source.el") (22156 56341 612132 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; helm-core-autoloads.el ends here diff --git a/elpa/helm-core-20160105.2046/helm-core-pkg.el b/elpa/helm-core-20160105.2046/helm-core-pkg.el new file mode 100644 index 00000000..7e688058 --- /dev/null +++ b/elpa/helm-core-20160105.2046/helm-core-pkg.el @@ -0,0 +1,8 @@ +(define-package "helm-core" "20160105.2046" "Development files for Helm" + '((emacs "24") + (cl-lib "0.5") + (async "1.6")) + :url "https://emacs-helm.github.io/helm/") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/helm-core-20160105.2046/helm-lib.el b/elpa/helm-core-20160105.2046/helm-lib.el new file mode 100644 index 00000000..999f36f5 --- /dev/null +++ b/elpa/helm-core-20160105.2046/helm-lib.el @@ -0,0 +1,674 @@ +;;; helm-lib.el --- Helm routines. -*- lexical-binding: t -*- + +;; Copyright (C) 2015 Thierry Volpiatto + +;; Author: Thierry Volpiatto +;; URL: http://github.com/emacs-helm/helm + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; All helm functions that don't require specific helm code should go here. + +;;; Code: + +(require 'cl-lib) +(require 'dired) + + +;;; User vars. +;; +(defcustom helm-file-globstar t + "Same as globstar bash shopt option. +When non--nil a pattern beginning with two stars will expand recursively. +Directories expansion is not supported yet." + :group 'helm + :type 'boolean) + +(defcustom helm-yank-text-at-point-function nil + "The function used to forward point with `helm-yank-text-at-point'. +With a nil value, fallback to default `forward-word'. +The function should take one arg, an integer like `forward-word'. +NOTE: Using `forward-symbol' here is not very useful as it is already +provided by \\\\[next-history-element]." + :type 'function + :group 'helm) + +(defcustom helm-scroll-amount nil + "Scroll amount when scrolling other window in a helm session. +It is used by `helm-scroll-other-window' +and `helm-scroll-other-window-down'. + +If you prefer scrolling line by line, set this value to 1." + :group 'helm + :type 'integer) + + +;;; Internal vars +;; +(defvar helm-yank-point nil) +(defvar helm-pattern "" + "The input pattern used to update the helm buffer.") +(defvar helm-buffer "*helm*" + "Buffer showing completions.") +(defvar helm-current-buffer nil + "Current buffer when `helm' is invoked.") +(defvar helm-suspend-update-flag nil) +(defvar helm-action-buffer "*helm action*" + "Buffer showing actions.") + +;;; Macros helper. +;; +(defmacro helm-with-gensyms (symbols &rest body) + "Bind the SYMBOLS to fresh uninterned symbols and eval BODY." + (declare (indent 1)) + `(let ,(mapcar (lambda (s) + ;; Use cl-gensym here instead of make-symbol + ;; to ensure a symbol that have a live that go + ;; beyond the live of its macro have different name. + ;; i.e symbols created with `with-helm-temp-hook' + ;; should have random names. + `(,s (cl-gensym (symbol-name ',s)))) + symbols) + ,@body)) + +;;; Iterators +;; +(defun helm-iter-list (seq) + "Return an iterator object from SEQ." + (let ((lis seq)) + (lambda () + (let ((elm (car lis))) + (setq lis (cdr lis)) + elm)))) + +(defun helm-iter-next (iterator) + "Return next elm of ITERATOR." + (funcall iterator)) + +(defun helm-make-actions (&rest args) + "Build an alist with (NAME . ACTION) elements with each pairs in ARGS. +Where NAME is a string or a function returning a string or nil and ACTION +a function. +If NAME returns nil the pair is skipped. + +\(fn NAME ACTION ...)" + (cl-loop for i on args by #'cddr + for name = (car i) + when (functionp name) + do (setq name (funcall name)) + when name + collect (cons name (cadr i)))) + +(defmacro helm-aif (test-form then-form &rest else-forms) + "Like `if' but set the result of TEST-FORM in a temprary variable called `it'. +THEN-FORM and ELSE-FORMS are then excuted just like in `if'." + (declare (indent 2) (debug t)) + `(let ((it ,test-form)) + (if it ,then-form ,@else-forms))) + +(defun helm-current-line-contents () + "Current line string without properties." + (buffer-substring-no-properties (point-at-bol) (point-at-eol))) + +;;; Fuzzy matching routines +;; +(defsubst helm--mapconcat-pattern (pattern) + "Transform string PATTERN in regexp for further fuzzy matching. +e.g helm.el$ + => \"[^h]*h[^e]*e[^l]*l[^m]*m[^.]*[.][^e]*e[^l]*l$\" + ^helm.el$ + => \"helm[.]el$\"." + (let ((ls (split-string-and-unquote pattern ""))) + (if (string= "^" (car ls)) + ;; Exact match. + (mapconcat (lambda (c) + (if (and (string= c "$") + (string-match "$\\'" pattern)) + c (regexp-quote c))) + (cdr ls) "") + ;; Fuzzy match. + (mapconcat (lambda (c) + (if (and (string= c "$") + (string-match "$\\'" pattern)) + c (format "[^%s]*%s" c (regexp-quote c)))) + ls "")))) + +(defsubst helm--collect-pairs-in-string (string) + (cl-loop for str on (split-string string "" t) by 'cdr + when (cdr str) + collect (list (car str) (cadr str)))) + +;;; Help routines. +;; +(defun helm-help-internal (bufname insert-content-fn) + "Show long message during `helm' session in BUFNAME. +INSERT-CONTENT-FN is the function that insert +text to be displayed in BUFNAME." + (let ((winconf (current-frame-configuration))) + (unwind-protect + (progn + (setq helm-suspend-update-flag t) + (set-buffer (get-buffer-create bufname)) + (switch-to-buffer bufname) + (delete-other-windows) + (delete-region (point-min) (point-max)) + (org-mode) + (save-excursion + (funcall insert-content-fn)) + (setq cursor-type nil) + (buffer-disable-undo) + (helm-help-event-loop)) + (setq helm-suspend-update-flag nil) + (set-frame-configuration winconf)))) + +(defun helm-help-scroll-up (amount) + (condition-case _err + (scroll-up-command amount) + (beginning-of-buffer nil) + (end-of-buffer nil))) + +(defun helm-help-scroll-down (amount) + (condition-case _err + (scroll-down-command amount) + (beginning-of-buffer nil) + (end-of-buffer nil))) + +(defun helm-help-event-loop () + (let ((prompt (propertize + "[SPC,C-v,down,next:NextPage b,M-v,up,prior:PrevPage C-s/r:Isearch q:Quit]" + 'face 'helm-helper)) + scroll-error-top-bottom) + (cl-loop for event = (read-key prompt) do + (cl-case event + ((?\C-v ? down next) (helm-help-scroll-up helm-scroll-amount)) + ((?\M-v ?b up prior) (helm-help-scroll-down helm-scroll-amount)) + (?\C-s (isearch-forward)) + (?\C-r (isearch-backward)) + (?q (cl-return)) + (t (ignore)))))) + + +;;; List processing +;; +(defun helm-flatten-list (seq &optional omit-nulls) + "Return a list of all single elements of sublists in SEQ." + (let (result) + (cl-labels ((flatten (seq) + (cl-loop + for elm in seq + if (and (or elm + (null omit-nulls)) + (or (atom elm) + (functionp elm) + (and (consp elm) + (cdr elm) + (atom (cdr elm))))) + do (push elm result) + else do (flatten elm)))) + (flatten seq)) + (nreverse result))) + +(defun helm-mklist (obj) + "If OBJ is a list \(but not lambda\), return itself. +Otherwise make a list with one element." + (if (and (listp obj) (not (functionp obj))) + obj + (list obj))) + +(cl-defmacro helm-position (item seq &key (test 'eq) all) + "A simple and faster replacement of CL `position'. +Return position of first occurence of ITEM found in SEQ. +Argument SEQ can be a string, in this case ITEM have to be a char. +Argument ALL, if non--nil specify to return a list of positions of +all ITEM found in SEQ." + (let ((key (if (stringp seq) 'across 'in))) + `(cl-loop for c ,key ,seq + for index from 0 + when (funcall ,test c ,item) + if ,all collect index into ls + else return index + finally return ls))) + +(cl-defun helm-fast-remove-dups (seq &key (test 'eq)) + "Remove duplicates elements in list SEQ. +This is same as `remove-duplicates' but with memoisation. +It is much faster, especially in large lists. +A test function can be provided with TEST argument key. +Default is `eq'." + (cl-loop with cont = (make-hash-table :test test) + for elm in seq + unless (gethash elm cont) + do (puthash elm elm cont) + finally return + (cl-loop for i being the hash-values in cont collect i))) + +(defun helm-skip-entries (seq black-regexp-list &optional white-regexp-list) + "Remove entries which matches one of REGEXP-LIST from SEQ." + (cl-loop for i in seq + unless (and (cl-loop for re in black-regexp-list + thereis (and (stringp i) + (string-match-p re i))) + (null + (cl-loop for re in white-regexp-list + thereis (and (stringp i) + (string-match-p re i))))) + collect i)) + +(defun helm-shadow-entries (seq regexp-list) + "Put shadow property on entries in SEQ matching a regexp in REGEXP-LIST." + (let ((face 'italic)) + (cl-loop for i in seq + if (cl-loop for regexp in regexp-list + thereis (and (stringp i) + (string-match regexp i))) + collect (propertize i 'face face) + else collect i))) + +(defun helm-remove-if-not-match (regexp seq) + "Remove all elements of SEQ that don't match REGEXP." + (cl-loop for s in seq + for str = (cond ((symbolp s) + (symbol-name s)) + ((consp s) + (car s)) + (t s)) + when (string-match-p regexp str) + collect s)) + +(defun helm-remove-if-match (regexp seq) + "Remove all elements of SEQ that match REGEXP." + (cl-loop for s in seq + for str = (cond ((symbolp s) + (symbol-name s)) + ((consp s) + (car s)) + (t s)) + unless (string-match-p regexp str) + collect s)) + +(defun helm-transform-mapcar (function args) + "`mapcar' for candidate-transformer. + +ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...) + +\(helm-transform-mapcar 'upcase '(\"foo\" \"bar\")) +=> (\"FOO\" \"BAR\") +\(helm-transform-mapcar 'upcase '((\"1st\" . \"foo\") (\"2nd\" . \"bar\"))) +=> ((\"1st\" . \"FOO\") (\"2nd\" . \"BAR\")) +" + (cl-loop for arg in args + if (consp arg) + collect (cons (car arg) (funcall function (cdr arg))) + else + collect (funcall function arg))) + +;;; Strings processing. +;; +(defun helm-stringify (str-or-sym) + "Get string of STR-OR-SYM." + (if (stringp str-or-sym) + str-or-sym + (symbol-name str-or-sym))) + +(defun helm-substring (str width) + "Return the substring of string STR from 0 to WIDTH. +Handle multibyte characters by moving by columns." + (with-temp-buffer + (save-excursion + (insert str)) + (move-to-column width) + (buffer-substring (point-at-bol) (point)))) + +(defun helm-substring-by-width (str width &optional endstr) + "Truncate string STR to end at column WIDTH. +Similar to `truncate-string-to-width'. +Add ENDSTR at end of truncated STR. +Add spaces at end if needed to reach WIDTH when STR is shorter than WIDTH." + (cl-loop for ini-str = str + then (substring ini-str 0 (1- (length ini-str))) + for sw = (string-width ini-str) + when (<= sw width) return + (concat ini-str endstr (make-string (- width sw) ? )))) + +(defun helm-string-multibyte-p (str) + "Check if string STR contains multibyte characters." + (cl-loop for c across str + thereis (> (char-width c) 1))) + +(defun helm-get-pid-from-process-name (process-name) + "Get pid from running process PROCESS-NAME." + (cl-loop with process-list = (list-system-processes) + for pid in process-list + for process = (assoc-default 'comm (process-attributes pid)) + when (and process (string-match process-name process)) + return pid)) + +(defun helm-ff-find-printers () + "Return a list of available printers on Unix systems." + (when (executable-find "lpstat") + (let ((printer-list (with-temp-buffer + (call-process "lpstat" nil t nil "-a") + (split-string (buffer-string) "\n")))) + (cl-loop for p in printer-list + for printer = (car (split-string p)) + when printer + collect printer)))) + +(defun helm-region-active-p () + (and transient-mark-mode mark-active (/= (mark) (point)))) + +(defun helm-quote-whitespace (candidate) + "Quote whitespace, if some, in string CANDIDATE." + (replace-regexp-in-string " " "\\\\ " candidate)) + + +;;; Symbols routines +;; +(defun helm-symbolify (str-or-sym) + "Get symbol of STR-OR-SYM." + (if (symbolp str-or-sym) + str-or-sym + (intern str-or-sym))) + +(defun helm-symbol-name (obj) + (if (or (consp obj) (byte-code-function-p obj)) + "Anonymous" + (symbol-name obj))) + +(defun helm-describe-function (func) + "FUNC is symbol or string." + (describe-function (helm-symbolify func)) + (message nil)) + +(defun helm-describe-variable (var) + "VAR is symbol or string." + (describe-variable (helm-symbolify var)) + (message nil)) + +(defun helm-describe-face (face) + "VAR is symbol or string." + (describe-face (helm-symbolify face)) + (message nil)) + +(defun helm-find-function (func) + "FUNC is symbol or string." + (find-function (helm-symbolify func))) + +(defun helm-find-variable (var) + "VAR is symbol or string." + (find-variable (helm-symbolify var))) + +(defun helm-find-face-definition (face) + "FACE is symbol or string." + (find-face-definition (helm-symbolify face))) + +(defun helm-kill-new (candidate &optional replace) + "CANDIDATE is symbol or string. +See `kill-new' for argument REPLACE." + (kill-new (helm-stringify candidate) replace)) + +;;; Files routines +;; +(defun helm-basename (fname &optional ext) + "Print FNAME with any leading directory components removed. +If specified, also remove filename extension EXT." + (let ((non-essential t)) + (if (and ext (or (string= (file-name-extension fname) ext) + (string= (file-name-extension fname t) ext)) + (not (file-directory-p fname))) + (file-name-sans-extension (file-name-nondirectory fname)) + (file-name-nondirectory (directory-file-name fname))))) + +(defun helm-basedir (fname) + "Return the base directory of filename ending by a slash." + (helm-aif (and fname + (or (and (string= fname "~") "~") + (file-name-directory fname))) + (file-name-as-directory it))) + +(defun helm-current-directory () + "Return current-directory name at point. +Useful in dired buffers when there is inserted subdirs." + (expand-file-name + (if (eq major-mode 'dired-mode) + (dired-current-directory) + default-directory))) + +(defun helm-w32-prepare-filename (file) + "Convert filename FILE to something usable by external w32 executables." + (replace-regexp-in-string ; For UNC paths + "/" "\\" + (replace-regexp-in-string ; Strip cygdrive paths + "/cygdrive/\\(.\\)" "\\1:" + file nil nil) nil t)) + +(defun helm-w32-shell-execute-open-file (file) + (interactive "fOpen file:") + (with-no-warnings + (w32-shell-execute "open" (helm-w32-prepare-filename file)))) + +;; Same as `vc-directory-exclusion-list'. +(defvar helm-walk-ignore-directories + '("SCCS" "RCS" "CVS" "MCVS" ".svn" ".git" ".hg" ".bzr" + "_MTN" "_darcs" "{arch}" ".gvfs")) + +(cl-defun helm-walk-directory (directory &key (path 'basename) + (directories t) + match skip-subdirs) + "Walk through DIRECTORY tree. +Argument PATH can be one of basename, relative, full, or a function +called on file name, default to basename. +Argument DIRECTORIES when non--nil (default) return also directories names, +otherwise skip directories names. +Argument MATCH can be a predicate or a regexp. +Argument SKIP-SUBDIRS when non--nil will skip `helm-walk-ignore-directories' +unless it is given as a list of directories, in this case this list will be used +instead of `helm-walk-ignore-directories'." + (let* ((result '()) + (fn (cl-case path + (basename 'file-name-nondirectory) + (relative 'file-relative-name) + (full 'identity) + (t path)))) + (cl-labels ((ls-rec (dir) + (unless (and skip-subdirs + (member (helm-basename dir) + (if (listp skip-subdirs) + skip-subdirs + helm-walk-ignore-directories))) + (cl-loop with ls = (sort (file-name-all-completions "" dir) + 'string-lessp) + for f in ls + ;; Use `directory-file-name' to remove the final slash. + ;; Needed to avoid infloop on symlinks symlinking + ;; a directory inside it [1]. + for file = (directory-file-name + (expand-file-name f dir)) + unless (member f '("./" "../")) + ;; A directory. + if (char-equal (aref f (1- (length f))) ?/) + do (progn (when directories + (push (funcall fn file) result)) + ;; Don't recurse in symlinks. + ;; `file-symlink-p' have to be called + ;; on the directory with its final + ;; slash removed [1]. + (and (not (file-symlink-p file)) + (ls-rec file))) + else do + (if match + (and (if (functionp match) + (funcall match f) + (and (stringp match) + (string-match match f))) + (push (funcall fn file) result)) + (push (funcall fn file) result)))))) + (ls-rec directory) + (nreverse result)))) + +(defun helm-file-expand-wildcards (pattern &optional full) + "Same as `file-expand-wildcards' but allow recursion. +Recursion happen when PATTERN starts with two stars. +Directories expansion is not supported." + (let ((bn (helm-basename pattern))) + (if (and helm-file-globstar + (string-match "\\`\\*\\{2\\}\\(.*\\)" bn)) + (helm-walk-directory (helm-basedir pattern) + :path (cl-case full + (full 'full) + (relative 'relative) + ((basename nil) 'basename) + (t 'full)) + :directories nil + :match (wildcard-to-regexp bn) + :skip-subdirs t) + (file-expand-wildcards pattern full)))) + +;;; helm internals +;; +(defun helm-set-pattern (pattern &optional noupdate) + "Set minibuffer contents to PATTERN. +if optional NOUPDATE is non-nil, helm buffer is not changed." + (with-selected-window (or (active-minibuffer-window) (minibuffer-window)) + (delete-minibuffer-contents) + (insert pattern)) + (when noupdate + (setq helm-pattern pattern))) + +(defun helm-minibuffer-completion-contents () + "Return the user input in a minibuffer before point as a string. +That is what completion commands operate on." + (buffer-substring (field-beginning) (point))) + +(defmacro with-helm-buffer (&rest body) + "Eval BODY inside `helm-buffer'." + (declare (indent 0) (debug t)) + `(with-current-buffer (helm-buffer-get) + ,@body)) + +(defmacro with-helm-current-buffer (&rest body) + "Eval BODY inside `helm-current-buffer'." + (declare (indent 0) (debug t)) + `(with-current-buffer (or (and (buffer-live-p helm-current-buffer) + helm-current-buffer) + (setq helm-current-buffer + (current-buffer))) + ,@body)) + +(defun helm-buffer-get () + "Return `helm-action-buffer' if shown otherwise `helm-buffer'." + (if (helm-action-window) + helm-action-buffer + helm-buffer)) + +(defun helm-window () + "Window of `helm-buffer'." + (get-buffer-window (helm-buffer-get) 0)) + +(defun helm-action-window () + "Window of `helm-action-buffer'." + (get-buffer-window helm-action-buffer 'visible)) + +(defmacro with-helm-window (&rest body) + "Be sure BODY is excuted in the helm window." + (declare (indent 0) (debug t)) + `(with-selected-window (helm-window) + ,@body)) + + +;; Yank text at point. +;; +;; +(defun helm-yank-text-at-point () + "Yank text at point in `helm-current-buffer' into minibuffer." + (interactive) + (with-helm-current-buffer + (let ((fwd-fn (or helm-yank-text-at-point-function #'forward-word))) + ;; Start to initial point if C-w have never been hit. + (unless helm-yank-point (setq helm-yank-point (point))) + (save-excursion + (goto-char helm-yank-point) + (funcall fwd-fn 1) + (helm-set-pattern + (concat + helm-pattern (replace-regexp-in-string + "\\`\n" "" + (buffer-substring-no-properties + helm-yank-point (point))))) + (setq helm-yank-point (point)))))) + +(defun helm-reset-yank-point () + (setq helm-yank-point nil)) + +(add-hook 'helm-cleanup-hook 'helm-reset-yank-point) +(add-hook 'helm-after-initialize-hook 'helm-reset-yank-point) + +;;; Ansi +;; +;; +(defvar helm--ansi-color-regexp + "\033\\[\\(K\\|[0-9;]*m\\)") +(defvar helm--ansi-color-drop-regexp + "\033\\[\\([ABCDsuK]\\|[12][JK]\\|=[0-9]+[hI]\\|[0-9;]*[Hf]\\)") +(defun helm--ansi-color-apply (string) + "A version of `ansi-color-apply' immune to upstream changes. + +Similar to the emacs-24.5 version without support to `ansi-color-context' +which is buggy in emacs. + +Modify also `ansi-color-regexp' by using own variable `helm--ansi-color-regexp' +that match whole STRING. + +This is needed to provide compatibility for both emacs-25 and emacs-24.5 +as emacs-25 version of `ansi-color-apply' is partially broken." + (let ((start 0) + codes end escape-sequence + result colorized-substring) + ;; Find the next escape sequence. + (while (setq end (string-match helm--ansi-color-regexp string start)) + (setq escape-sequence (match-string 1 string)) + ;; Colorize the old block from start to end using old face. + (when codes + (put-text-property + start end 'font-lock-face (ansi-color--find-face codes) string)) + (setq colorized-substring (substring string start end) + start (match-end 0)) + ;; Eliminate unrecognized ANSI sequences. + (while (string-match helm--ansi-color-drop-regexp colorized-substring) + (setq colorized-substring + (replace-match "" nil nil colorized-substring))) + (push colorized-substring result) + ;; Create new face, by applying escape sequence parameters. + (setq codes (ansi-color-apply-sequence escape-sequence codes))) + ;; If the rest of the string should have a face, put it there. + (when codes + (put-text-property + start (length string) + 'font-lock-face (ansi-color--find-face codes) string)) + ;; Save the remainder of the string to the result. + (if (string-match "\033" string start) + (push (substring string start (match-beginning 0)) result) + (push (substring string start) result)) + (apply 'concat (nreverse result)))) + +(provide 'helm-lib) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-lib ends here diff --git a/elpa/helm-core-20160105.2046/helm-multi-match.el b/elpa/helm-core-20160105.2046/helm-multi-match.el new file mode 100644 index 00000000..3e740da2 --- /dev/null +++ b/elpa/helm-core-20160105.2046/helm-multi-match.el @@ -0,0 +1,373 @@ +;;; helm-multi-match.el --- Multiple regexp matching methods for helm -*- lexical-binding: t -*- + +;; Original Author: rubikitch + +;; Copyright (C) 2008 ~ 2011 rubikitch +;; Copyright (C) 2011 ~ 2015 Thierry Volpiatto + +;; Author: Thierry Volpiatto +;; URL: http://github.com/emacs-helm/helm + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'cl-lib) +(require 'helm-lib) + + +(defgroup helm-multi-match nil + "Helm multi match." + :group 'helm) + +(defcustom helm-mm-matching-method 'multi3 + "Matching method for helm match plugin. +You can set here different methods to match candidates in helm. +Here are the possible value of this symbol and their meaning: +- multi1: Respect order, prefix of pattern must match. +- multi2: Same but with partial match. +- multi3: The best, multiple regexp match, allow negation. +- multi3p: Same but prefix must match. + +Default is multi3, you should keep this for a better experience. + +Note that multi1 and multi3p are incompatible with fuzzy matching +in file completion and by the way fuzzy matching will be disabled there +when these options are used." + :type '(radio :tag "Matching methods for helm" + (const :tag "Multiple regexp 1 ordered with prefix match" multi1) + (const :tag "Multiple regexp 2 ordered with partial match" multi2) + (const :tag "Multiple regexp 3 matching no order, partial, best." multi3) + (const :tag "Multiple regexp 3p matching with prefix match" multi3p)) + :group 'helm-multi-match) + + +;; Internal +(defconst helm-mm-default-match-functions + '(helm-mm-exact-match helm-mm-match)) +(defconst helm-mm-default-search-functions + '(helm-mm-exact-search helm-mm-search)) + + +;;; Build regexps +;; +;; +(defvar helm-mm-space-regexp "[\\ ] " + "Regexp to represent space itself in multiple regexp match.") + +(defun helm-mm-split-pattern (pattern) + "Split PATTERN if it contain spaces and return resulting list. +If spaces in PATTERN are escaped, don't split at this place. +i.e \"foo bar\"=> (\"foo\" \"bar\") +but \"foo\ bar\"=> (\"foobar\")." + (if (string= pattern "") + '("") + (cl-loop for s in (split-string + (replace-regexp-in-string helm-mm-space-regexp + "\000\000" pattern) + " " t) + collect (replace-regexp-in-string "\000\000" " " s)))) + +(defun helm-mm-1-make-regexp (pattern) + "Replace spaces in PATTERN with \"\.*\"." + (mapconcat 'identity (helm-mm-split-pattern pattern) ".*")) + + +;;; Exact match. +;; +;; +;; Internal. +(defvar helm-mm-exact-pattern-str nil) +(defvar helm-mm-exact-pattern-real nil) + +(defun helm-mm-exact-get-pattern (pattern) + (unless (equal pattern helm-mm-exact-pattern-str) + (setq helm-mm-exact-pattern-str pattern + helm-mm-exact-pattern-real (concat "\n" pattern "\n"))) + helm-mm-exact-pattern-real) + + +(cl-defun helm-mm-exact-match (str &optional (pattern helm-pattern)) + (if case-fold-search + (progn + (setq str (downcase str) + pattern (downcase pattern)) + (string= str pattern)) + (string= str pattern))) + +(defun helm-mm-exact-search (pattern &rest _ignore) + (and (search-forward (helm-mm-exact-get-pattern pattern) nil t) + (forward-line -1))) + + +;;; Prefix match +;; +;; +;; Internal +(defvar helm-mm-prefix-pattern-str nil) +(defvar helm-mm-prefix-pattern-real nil) + +(defun helm-mm-prefix-get-pattern (pattern) + (unless (equal pattern helm-mm-prefix-pattern-str) + (setq helm-mm-prefix-pattern-str pattern + helm-mm-prefix-pattern-real (concat "\n" pattern))) + helm-mm-prefix-pattern-real) + +(defun helm-mm-prefix-match (str &optional pattern) + ;; In filename completion basename and basedir may be + ;; quoted, unquote them for string comparison (Issue #1283). + (setq pattern (replace-regexp-in-string + "\\\\" "" (or pattern helm-pattern))) + (let ((len (length pattern))) + (and (<= len (length str)) + (string= (substring str 0 len) pattern )))) + +(defun helm-mm-prefix-search (pattern &rest _ignore) + (search-forward (helm-mm-prefix-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 1 (order is preserved / prefix). +;; +;; +;; Internal +(defvar helm-mm-1-pattern-str nil) +(defvar helm-mm-1-pattern-real nil) + +(defun helm-mm-1-get-pattern (pattern) + (unless (equal pattern helm-mm-1-pattern-str) + (setq helm-mm-1-pattern-str pattern + helm-mm-1-pattern-real + (concat "^" (helm-mm-1-make-regexp pattern)))) + helm-mm-1-pattern-real) + +(cl-defun helm-mm-1-match (str &optional (pattern helm-pattern)) + (string-match (helm-mm-1-get-pattern pattern) str)) + +(defun helm-mm-1-search (pattern &rest _ignore) + (re-search-forward (helm-mm-1-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 2 (order is preserved / partial). +;; +;; +;; Internal +(defvar helm-mm-2-pattern-str nil) +(defvar helm-mm-2-pattern-real nil) + +(defun helm-mm-2-get-pattern (pattern) + (unless (equal pattern helm-mm-2-pattern-str) + (setq helm-mm-2-pattern-str pattern + helm-mm-2-pattern-real + (concat "^.*" (helm-mm-1-make-regexp pattern)))) + helm-mm-2-pattern-real) + +(cl-defun helm-mm-2-match (str &optional (pattern helm-pattern)) + (string-match (helm-mm-2-get-pattern pattern) str)) + +(defun helm-mm-2-search (pattern &rest _ignore) + (re-search-forward (helm-mm-2-get-pattern pattern) nil t)) + + +;;; Multiple regexp patterns 3 (permutation). +;; +;; +;; Internal +(defvar helm-mm-3-pattern-str nil) +(defvar helm-mm-3-pattern-list nil) + +(defun helm-mm-3-get-patterns (pattern) + "Return `helm-mm-3-pattern-list', a list of predicate/regexp cons cells. +e.g ((identity . \"foo\") (identity . \"bar\")). +This is done only if `helm-mm-3-pattern-str' is same as PATTERN." + (unless (equal pattern helm-mm-3-pattern-str) + (setq helm-mm-3-pattern-str pattern + helm-mm-3-pattern-list + (helm-mm-3-get-patterns-internal pattern))) + helm-mm-3-pattern-list) + +(defun helm-mm-3-get-patterns-internal (pattern) + "Return a list of predicate/regexp cons cells. +e.g ((identity . \"foo\") (identity . \"bar\"))." + (unless (string= pattern "") + (cl-loop for pat in (helm-mm-split-pattern pattern) + collect (if (string= "!" (substring pat 0 1)) + (cons 'not (substring pat 1)) + (cons 'identity pat))))) + +(cl-defun helm-mm-3-match (str &optional (pattern helm-pattern)) + "Check if PATTERN match STR. +When PATTERN contain a space, it is splitted and matching is done +with the several resulting regexps against STR. +e.g \"bar foo\" will match \"foobar\" and \"barfoo\". +Argument PATTERN, a string, is transformed in a list of +cons cell with `helm-mm-3-get-patterns' if it contain a space. +e.g \"foo bar\"=>((identity . \"foo\") (identity . \"bar\")). +Then each predicate of cons cell(s) is called with regexp of same +cons cell against STR (a candidate). +i.e (identity (string-match \"foo\" \"foo bar\")) => t." + (let ((pat (helm-mm-3-get-patterns pattern))) + (cl-loop for (predicate . regexp) in pat + always (funcall predicate + (condition-case _err + ;; FIXME: Probably do nothing when + ;; using fuzzy leaving the job + ;; to the fuzzy fn. + (string-match regexp str) + (invalid-regexp nil)))))) + +(defun helm-mm-3-search-base (pattern searchfn1 searchfn2) + "Try to find PATTERN in `helm-buffer' with SEARCHFN1 and SEARCHFN2. +This is the search function for `candidates-in-buffer' enabled sources. +Use the same method as `helm-mm-3-match' except it search in buffer +instead of matching on a string. +i.e (identity (re-search-forward \"foo\" (point-at-eol) t)) => t." + (cl-loop with pat = (if (stringp pattern) + (helm-mm-3-get-patterns pattern) + pattern) + when (eq (caar pat) 'not) return + ;; Pass the job to `helm-search-match-part'. + (prog1 (list (point-at-bol) (point-at-eol)) + (forward-line 1)) + while (condition-case _err + (funcall searchfn1 (or (cdar pat) "") nil t) + (invalid-regexp nil)) + for bol = (point-at-bol) + for eol = (point-at-eol) + if (cl-loop for (pred . str) in (cdr pat) always + (progn (goto-char bol) + (funcall pred (condition-case _err + (funcall searchfn2 str eol t) + (invalid-regexp nil))))) + do (goto-char eol) and return t + else do (goto-char eol) + finally return nil)) + +(defun helm-mm-3-search (pattern &rest _ignore) + (when (stringp pattern) + (setq pattern (helm-mm-3-get-patterns pattern))) + (helm-mm-3-search-base + pattern 're-search-forward 're-search-forward)) + +;;; mp-3 with migemo +;; +;; +(defvar helm-mm--previous-migemo-info nil + "[Internal] Cache previous migemo query.") +(make-local-variable 'helm-mm--previous-migemo-info) + +(declare-function migemo-get-pattern "ext:migemo.el") +(declare-function migemo-search-pattern-get "ext:migemo.el") + +(define-minor-mode helm-migemo-mode + "Enable migemo in helm. +It will be available in the sources handling it, +i.e the sources which have the slot :migemo with non--nil value." + :lighter " Hmio" + :group 'helm + :global t + (cl-assert (featurep 'migemo) + nil "No feature called migemo found, install migemo.el.")) + +(defun helm-mm-migemo-get-pattern (pattern) + (let ((regex (migemo-get-pattern pattern))) + (if (ignore-errors (string-match regex "") t) + (concat regex "\\|" pattern) pattern))) + +(defun helm-mm-migemo-search-pattern-get (pattern) + (let ((regex (migemo-search-pattern-get pattern))) + (if (ignore-errors (string-match regex "") t) + (concat regex "\\|" pattern) pattern))) + +(defun helm-mm-migemo-string-match (pattern str) + "Migemo version of `string-match'." + (unless (assoc pattern helm-mm--previous-migemo-info) + (with-helm-buffer + (setq helm-mm--previous-migemo-info + (push (cons pattern (helm-mm-migemo-get-pattern pattern)) + helm-mm--previous-migemo-info)))) + (string-match (assoc-default pattern helm-mm--previous-migemo-info) str)) + +(cl-defun helm-mm-3-migemo-match (str &optional (pattern helm-pattern)) + (and helm-migemo-mode + (cl-loop for (pred . re) in (helm-mm-3-get-patterns pattern) + always (funcall pred (helm-mm-migemo-string-match re str))))) + +(defun helm-mm-migemo-forward (word &optional bound noerror count) + (with-helm-buffer + (unless (assoc word helm-mm--previous-migemo-info) + (setq helm-mm--previous-migemo-info + (push (cons word (if (delq 'ascii (find-charset-string word)) + word + (helm-mm-migemo-search-pattern-get word))) + helm-mm--previous-migemo-info)))) + (re-search-forward + (assoc-default word helm-mm--previous-migemo-info) bound noerror count)) + +(defun helm-mm-3-migemo-search (pattern &rest _ignore) + (and helm-migemo-mode + (helm-mm-3-search-base + pattern 'helm-mm-migemo-forward 'helm-mm-migemo-forward))) + + +;;; mp-3p- (multiple regexp pattern 3 with prefix search) +;; +;; +(defun helm-mm-3p-match (str &optional pattern) + "Check if PATTERN match STR. +Same as `helm-mm-3-match' but more strict, matching against prefix also. +e.g \"bar foo\" will match \"barfoo\" but not \"foobar\" contrarily to +`helm-mm-3-match'." + (let* ((pat (helm-mm-3-get-patterns (or pattern helm-pattern))) + (first (car pat))) + (and (funcall (car first) (helm-mm-prefix-match str (cdr first))) + (cl-loop for (predicate . regexp) in (cdr pat) + always (funcall predicate (string-match regexp str)))))) + +(defun helm-mm-3p-search (pattern &rest _ignore) + (when (stringp pattern) + (setq pattern (helm-mm-3-get-patterns pattern))) + (helm-mm-3-search-base + pattern 'helm-mm-prefix-search 're-search-forward)) + + +;;; Generic multi-match/search functions +;; +;; +(cl-defun helm-mm-match (str &optional (pattern helm-pattern)) + (let ((fun (cl-ecase helm-mm-matching-method + (multi1 #'helm-mm-1-match) + (multi2 #'helm-mm-2-match) + (multi3 #'helm-mm-3-match) + (multi3p #'helm-mm-3p-match)))) + (funcall fun str pattern))) + +(defun helm-mm-search (pattern &rest _ignore) + (let ((fun (cl-ecase helm-mm-matching-method + (multi1 #'helm-mm-1-search) + (multi2 #'helm-mm-2-search) + (multi3 #'helm-mm-3-search) + (multi3p #'helm-mm-3p-search)))) + (funcall fun pattern))) + + +(provide 'helm-multi-match) + + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-multi-match.el ends here diff --git a/elpa/helm-20150704.1247/helm-source.el b/elpa/helm-core-20160105.2046/helm-source.el similarity index 75% rename from elpa/helm-20150704.1247/helm-source.el rename to elpa/helm-core-20160105.2046/helm-source.el index c9839918..beb737ff 100644 --- a/elpa/helm-20150704.1247/helm-source.el +++ b/elpa/helm-core-20160105.2046/helm-source.el @@ -30,6 +30,15 @@ (require 'cl-lib) (require 'eieio) +(require 'helm-lib) + +(defvar helm-fuzzy-sort-fn) +(defvar helm-fuzzy-match-fn) +(defvar helm-fuzzy-search-fn) + +(declare-function helm-init-candidates-in-buffer "helm.el") +(declare-function helm-interpret-value "helm.el") +(declare-function helm-fuzzy-highlight-matches "helm.el") (defgeneric helm--setup-source (source) @@ -61,7 +70,7 @@ Its argument is the name of the source. This attribute is useful to add an additional information with the source name. It doesn't modify the name of the source.") - + (init :initarg :init :initform nil @@ -81,10 +90,10 @@ " Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates. - + The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs. - + In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more @@ -92,11 +101,11 @@ for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes. - + Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.") - + (update :initarg :update :initform nil @@ -114,7 +123,7 @@ closed. It is useful for killing unneeded candidates buffer. Note that the function is executed BEFORE performing action.") - + (delayed :initarg :delayed :initform nil @@ -124,7 +133,7 @@ typing and is idle for `helm-idle-delay' seconds. If a value is given to delayed attr, this value is used instead only if it is > to `helm-idle-delay'.") - + (keymap :initarg :keymap :initform nil @@ -136,14 +145,14 @@ `helm' argument KEYMAP. NOTE: when a source have `helm-map' as keymap attr, the global value of `helm-map' will override the actual local one.") - + (action :initarg :action :initform 'identity :custom (alist :key-type string :value-type function) :documentation - " It is a list of (DISPLAY . FUNCTION) pairs or FUNCTION. + " An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate. An action other than the default can be chosen from this list @@ -182,14 +191,14 @@ :documentation " Help message for this source. If not present, `helm-help-message' value will be used.") - + (multiline :initarg :multiline :initform nil :custom boolean :documentation " Enable to selection multiline candidates.") - + (requires-pattern :initarg :requires-pattern :initform nil @@ -218,7 +227,7 @@ Note that `candidates' is run already, so the given transformer function should also be able to handle candidates with (DISPLAY . REAL) format.") - + (filtered-candidate-transformer :initarg :filtered-candidate-transformer :initform nil @@ -388,7 +397,7 @@ :custom boolean :documentation " Don't allow marking candidates when this attribute is present.") - + (nohighlight :initarg :nohighlight :initform nil @@ -404,14 +413,14 @@ Remember that this function should run AFTER all filter functions if those filter functions are modifying face properties, though it is possible to avoid this by using new `add-face-text-property' in your filter functions.") - + (allow-dups :initarg :allow-dups :initform nil :custom boolean :documentation " Allow helm collecting duplicates candidates.") - + (history :initarg :history :initform nil @@ -419,7 +428,7 @@ :documentation " Allow passing history variable to helm from source. It should be a quoted symbol.") - + (coerce :initarg :coerce :initform nil @@ -489,14 +498,6 @@ :documentation " A list of compile functions plugin to ignore.") - (migemo - :initarg :migemo - :initform nil - :custom boolean - :documentation - " Needed for Japanese input with helm-migemo.el. - If you are not Japanese, ignore this.") - (matchplugin :initarg :matchplugin :initform t @@ -512,7 +513,7 @@ on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate.") - + (before-init-hook :initarg :before-init-hook :initform nil @@ -528,7 +529,7 @@ :documentation " A local hook that run at end of initilization of this source. i.e After the creation of `helm-buffer'.")) - + "Main interface to define helm sources." :abstract t) @@ -537,16 +538,32 @@ :initform '("ERROR: You must specify the `candidates' slot, either with a list or a function")) (dont-plug - :initform '(helm-compile-source--match-plugin - helm-compile-source--persistent-help)) - + :initform '(helm-compile-source--multi-match + helm-compile-source--persistent-help + ;; Ensure this will not be plugged + ;; if user have somewhere old helm-migemo.el. + helm-compile-source--migemo)) + + (migemo + :initarg :migemo + :initform nil + :custom boolean + :documentation + " Enable migemo. + When multimatch is disabled, you can give the symbol 'nomultimatch as value + to force not using generic migemo matching function. + In this case you have to provide your own migemo matching funtion + that kick in when `helm-migemo-mode' is enabled. + Otherwise it will be available for this source once `helm-migemo-mode' + is enabled when non-nil.") + (match-strict :initarg :match-strict :initform nil :custom function :documentation " When specifying a match function within a source and - helm-match-plugin is enabled, the result of all matching + helm-multi-match is enabled, the result of all matching functions will be concatened, which in some cases is not what is wanted. When using `match-strict' only this or these functions will be used. You can specify those functions as a @@ -567,7 +584,7 @@ Matching is done basically with `string-match' against each candidate.") :documentation " This attribute is used to define a process as candidate. The value must be a process. - + NOTE: When building the source at runtime you can give directly a process as value, otherwise wrap the process call into a function. @@ -575,7 +592,7 @@ Matching is done basically with `string-match' against each candidate.") `helm-buffer' give to the process a sentinel.") (matchplugin :initform nil) - (dont-plug :initform '(helm-compile-source--match-plugin + (dont-plug :initform '(helm-compile-source--multi-match helm-compile-source--persistent-help))) "Use this class to define a helm source calling an external process. @@ -595,21 +612,35 @@ inherit from `helm-source'.") This data will be passed in a function added to the init slot and the buffer will be build with `helm-init-candidates-in-buffer'. This is an easy and fast method to build a `candidates-in-buffer' source.") - + (dont-plug :initform '(helm-compile-source--candidates-in-buffer - helm-compile-source--match-plugin - helm-compile-source--persistent-help)) - + helm-compile-source--multi-match + helm-compile-source--persistent-help + helm-compile-source--migemo)) + + (migemo + :initarg :migemo + :initform nil + :custom boolean + :documentation + " Enable migemo. + When multimatch is disabled, you can give the symbol 'nomultimatch as value + to force not using generic migemo matching function. + In this case you have to provide your own migemo matching funtion + that kick in when `helm-migemo-mode' is enabled. + Otherwise it will be available for this source once `helm-migemo-mode' + is enabled when non-nil.") + (candidates :initform 'helm-candidates-in-buffer) (volatile :initform t) - + (match :initform '(identity)) - + (get-line :initarg :get-line :initform 'buffer-substring-no-properties @@ -634,17 +665,17 @@ inherit from `helm-source'.") this function should returns in such case a cons cell of two integers defining the beg and end positions to match in the line previously matched by `re-search-forward' or similar, and move point to next line - (See how the `helm-mp-3-search-base' and `helm-fuzzy-search' functions are working). + (See how the `helm-mm-3-search-base' and `helm-fuzzy-search' functions are working). NOTE: FUZZY-MATCH slot will overhide value of this slot.") - + (search-strict :initarg :search-strict :initform nil :custom function :documentation " When specifying a search function within a source and - helm-match-plugin is enabled, the result of all searching + helm-multi-match is enabled, the result of all searching functions will be concatened, which in some cases is not what is wanted. When using `search-strict' only this or these functions will be used. You can specify those functions as a @@ -666,7 +697,7 @@ like `re-search-forward', see below documentation of :search slot.") (matchplugin :initform nil) - + (accept-empty :initarg :accept-empty :initform t @@ -677,7 +708,7 @@ like `re-search-forward', see below documentation of :search slot.") (match :initform 'identity) - + (volatile :initform t))) @@ -691,177 +722,8 @@ like `re-search-forward', see below documentation of :search slot.") :initform nil :custom string :documentation "A filename.")) - - "The contents of the file will be used as candidates in buffer.") - -;;; Classes for types. -;; -;; Files -(defclass helm-type-file (helm-source) () - "A class to define helm type file.") - -(defmethod helm--setup-source :primary ((_source helm-type-file))) - -(defmethod helm--setup-source :before ((source helm-type-file)) - (set-slot-value - source 'action - (helm-make-actions - "Find file" 'helm-find-many-files - "Find file as root" 'helm-find-file-as-root - "Find file other window" 'find-file-other-window - "Find file other frame" 'find-file-other-frame - "Open dired in file's directory" 'helm-open-dired - "Grep File(s) `C-u recurse'" 'helm-find-files-grep - "Zgrep File(s) `C-u Recurse'" 'helm-ff-zgrep - "Pdfgrep File(s)" 'helm-ff-pdfgrep - "Insert as org link" 'helm-files-insert-as-org-link - "Checksum File" 'helm-ff-checksum - "Ediff File" 'helm-find-files-ediff-files - "Ediff Merge File" 'helm-find-files-ediff-merge-files - "Etags `M-., C-u tap, C-u C-u reload tag file'" - 'helm-ff-etags-select - "View file" 'view-file - "Insert file" 'insert-file - "Add marked files to file-cache" 'helm-ff-cache-add-file - "Delete file(s)" 'helm-delete-marked-files - "Copy file(s) `M-C, C-u to follow'" 'helm-find-files-copy - "Rename file(s) `M-R, C-u to follow'" 'helm-find-files-rename - "Symlink files(s) `M-S, C-u to follow'" 'helm-find-files-symlink - "Relsymlink file(s) `C-u to follow'" 'helm-find-files-relsymlink - "Hardlink file(s) `M-H, C-u to follow'" 'helm-find-files-hardlink - "Open file externally (C-u to choose)" 'helm-open-file-externally - "Open file with default tool" 'helm-open-file-with-default-tool - "Find file in hex dump" 'hexl-find-file)) - (set-slot-value source 'persistent-help "Show this file") - (set-slot-value source 'action-transformer '(helm-transform-file-load-el - helm-transform-file-browse-url - helm-transform-file-cache)) - (set-slot-value source 'candidate-transformer '(helm-skip-boring-files - helm-highlight-files - helm-w32-pathname-transformer))) - -;; Bookmarks -(defclass helm-type-bookmark (helm-source) () - "A class to define type bookmarks.") - -(defmethod helm--setup-source :primary ((_source helm-type-bookmark))) - -(defmethod helm--setup-source :before ((source helm-type-bookmark)) - (set-slot-value - source 'action (helm-make-actions - "Jump to bookmark" 'helm-bookmark-jump - "Jump to BM other window" 'helm-bookmark-jump-other-window - "Bookmark edit annotation" 'bookmark-edit-annotation - "Bookmark show annotation" 'bookmark-show-annotation - "Delete bookmark(s)" 'helm-delete-marked-bookmarks - "Edit Bookmark" 'helm-bookmark-edit-bookmark - "Rename bookmark" 'helm-bookmark-rename - "Relocate bookmark" 'bookmark-relocate)) - (set-slot-value source 'keymap helm-bookmark-map) - (set-slot-value source 'mode-line helm-bookmark-mode-line-string)) - -;; Buffers -(defclass helm-type-buffer (helm-source) () - "A class to define type buffer.") - -(defmethod helm--setup-source :primary ((_source helm-type-buffer))) - -(defmethod helm--setup-source :before ((source helm-type-buffer)) - (set-slot-value - source 'action (helm-make-actions - "Switch to buffer(s)" 'helm-switch-to-buffers - (lambda () (and (locate-library "popwin") - "Switch to buffer in popup window")) - 'popwin:popup-buffer - "Switch to buffer(s) other window `C-c o'" - 'helm-switch-to-buffers-other-window - "Switch to buffer other frame `C-c C-o'" - 'switch-to-buffer-other-frame - (lambda () (and (locate-library "elscreen") - "Display buffer in Elscreen")) - 'helm-find-buffer-on-elscreen - "Query replace regexp `C-M-%'" - 'helm-buffer-query-replace-regexp - "Query replace `M-%'" 'helm-buffer-query-replace - "View buffer" 'view-buffer - "Display buffer" 'display-buffer - "Grep buffers `M-g s' (C-u grep all buffers)" - 'helm-zgrep-buffers - "Multi occur buffer(s) `C-s'" 'helm-multi-occur-as-action - "Revert buffer(s) `M-U'" 'helm-revert-marked-buffers - "Insert buffer" 'insert-buffer - "Kill buffer(s) `M-D'" 'helm-kill-marked-buffers - "Diff with file `C-='" 'diff-buffer-with-file - "Ediff Marked buffers `C-c ='" 'helm-ediff-marked-buffers - "Ediff Merge marked buffers `M-='" - (lambda (candidate) - (helm-ediff-marked-buffers candidate t)))) - (set-slot-value source 'persistent-help "Show this buffer") - (set-slot-value - source 'filtered-candidate-transformer - '(helm-skip-boring-buffers - helm-buffers-sort-transformer - helm-highlight-buffers))) - -;; Functions -(defclass helm-type-function (helm-source) () - "A class to define helm type function.") - -(defmethod helm--setup-source :primary ((_source helm-type-function))) - -(defmethod helm--setup-source :before ((source helm-type-function)) - (set-slot-value - source 'action (helm-make-actions - "Describe command" 'describe-function - "Add command to kill ring" 'helm-kill-new - "Go to command's definition" 'find-function - "Debug on entry" 'debug-on-entry - "Cancel debug on entry" 'cancel-debug-on-entry - "Trace function" 'trace-function - "Trace function (background)" 'trace-function-background - "Untrace function" 'untrace-function)) - (set-slot-value source 'action-transformer - 'helm-transform-function-call-interactively) - (set-slot-value source 'candidate-transformer - 'helm-mark-interactive-functions) - (set-slot-value source 'coerce 'helm-symbolify)) - -;; Commands -(defclass helm-type-command (helm-source) () - "A class to define helm type command.") - -(defmethod helm--setup-source :primary ((_source helm-type-command))) - -(defmethod helm--setup-source :before ((source helm-type-command)) - (set-slot-value - source 'action (append (helm-make-actions - "Call interactively" 'helm-call-interactively) - (helm-actions-from-type-function))) - (set-slot-value source 'coerce 'helm-symbolify) - (set-slot-value source 'persistent-action 'describe-function)) - -;; Timers -(defclass helm-type-timers (helm-source) () - "A class to define helm type timers.") - -(defmethod helm--setup-source :primary ((_source helm-type-timers))) - -(defmethod helm--setup-source :before ((source helm-type-timers)) - (set-slot-value - source 'action - '(("Cancel Timer" . (lambda (_timer) - (let ((mkd (helm-marked-candidates))) - (cl-loop for timer in mkd - do (cancel-timer timer))))) - ("Describe Function" . (lambda (tm) - (describe-function (timer--function tm)))) - ("Find Function" . (lambda (tm) - (find-function (timer--function tm)))))) - (set-slot-value source 'persistent-action - (lambda (tm) - (describe-function (timer--function tm)))) - (set-slot-value source 'persistent-help "Describe Function")) + "The contents of the file will be used as candidates in buffer.") ;;; Error functions @@ -889,7 +751,7 @@ Argument NAME is a string which define the source name, so no need to use the keyword :name in your source, NAME will be used instead. Argument CLASS is an eieio class object. Arguments ARGS are keyword value pairs as defined in CLASS." - (declare (indent 2)) + (declare (indent 2)) (let ((source (apply #'make-instance class name args))) (set-slot-value source 'name name) (helm--setup-source source) @@ -902,11 +764,11 @@ Arguments ARGS are keyword value pairs as defined in CLASS." (helm--setup-source source) (helm--create-source source))) -(defun helm-source-mp-get-search-or-match-fns (source method) - (require 'helm-match-plugin) - (let ((searchers (and (eq method 'search) - helm-mp-default-search-functions)) - (defmatch (helm-aif (slot-value source 'match) +(defvar helm-mm-default-search-functions) +(defvar helm-mm-default-match-functions) + +(defun helm-source-mm-get-search-or-match-fns (source method) + (let ((defmatch (helm-aif (slot-value source 'match) (helm-mklist it))) (defmatch-strict (helm-aif (and (eq method 'match) (slot-value source 'match-strict)) @@ -916,16 +778,23 @@ Arguments ARGS are keyword value pairs as defined in CLASS." (helm-mklist it))) (defsearch-strict (helm-aif (and (eq method 'search-strict) (slot-value source 'search-strict)) - (helm-mklist it)))) + (helm-mklist it))) + (migemo (slot-value source 'migemo))) (cl-case method (match (cond (defmatch-strict) + (migemo + (append helm-mm-default-match-functions + defmatch '(helm-mm-3-migemo-match))) (defmatch - (append helm-mp-default-match-functions defmatch)) - (t helm-mp-default-match-functions))) + (append helm-mm-default-match-functions defmatch)) + (t helm-mm-default-match-functions))) (search (cond (defsearch-strict) + (migemo + (append helm-mm-default-search-functions + defsearch '(helm-mm-3-migemo-search))) (defsearch - (append searchers defsearch)) - (t searchers)))))) + (append helm-mm-default-search-functions defsearch)) + (t helm-mm-default-search-functions)))))) ;;; Modifiers @@ -943,29 +812,15 @@ an eieio class." (helm-append-at-nth actions (quote ,new-action) ,index)) (t actions))))) - (when (or (symbolp actions) (functionp actions)) - (set-slot-value source 'action (list (cons "Default action" actions)))) + (if (functionp actions) + (set-slot-value source 'action (list (cons "Default action" actions))) + (set-slot-value source 'action (helm-interpret-value actions source))) (when (or (symbolp action-transformers) (functionp action-transformers)) (setq action-transformers (list action-transformers))) (set-slot-value source 'action-transformer (delq nil (append (list transformer) action-transformers))))) - -;;; Methods to access types slots. -;; -;; -(defmethod helm-source-get-action-from-type ((object helm-type-file)) - (slot-value object 'action)) - -(defmethod helm-source-get-action-from-type ((object helm-type-buffer)) - (slot-value object 'action)) - -(defmethod helm-source-get-action-from-type ((object helm-type-bookmark)) - (slot-value object 'action)) - -(defmethod helm-source-get-action-from-type ((object helm-type-function)) - (slot-value object 'action)) ;;; Methods to build sources. @@ -982,7 +837,16 @@ an eieio class." (concat "\\\\[helm-execute-persistent-action]: " (helm-aif (or (slot-value source 'persistent-action) (slot-value source 'action)) - (cond ((or (symbolp it) (functionp it)) + (cond ((and (symbolp it) + (functionp it) + (eq it 'identity)) + "Do Nothing") + ((and (symbolp it) + (boundp it) + (listp (symbol-value it)) + (stringp (caar (symbol-value it)))) + (caar (symbol-value it))) + ((or (symbolp it) (functionp it)) (helm-symbol-name it)) ((listp it) (let ((action (car it))) @@ -1003,10 +867,13 @@ an eieio class." (defmethod helm--setup-source :before ((source helm-source)) (helm-aif (slot-value source 'keymap) (and (symbolp it) (set-slot-value source 'keymap (symbol-value it)))) - (set-slot-value source 'header-line (helm-source--header-line source)) (helm-aif (slot-value source 'persistent-help) (set-slot-value source 'header-line - (helm-source--persistent-help-string it source))) + (helm-source--persistent-help-string it source)) + (set-slot-value source 'header-line (helm-source--header-line source))) + (helm-aif (slot-value source 'candidate-number-limit) + (and (symbolp it) (set-slot-value + source 'candidate-number-limit (symbol-value it)))) (when (and (slot-value source 'fuzzy-match) helm-fuzzy-sort-fn) (set-slot-value source 'filtered-candidate-transformer (helm-aif (slot-value source 'filtered-candidate-transformer) @@ -1030,7 +897,13 @@ an eieio class." (set-slot-value source 'match helm-fuzzy-match-fn))) (when (slot-value source 'matchplugin) (set-slot-value source 'match - (helm-source-mp-get-search-or-match-fns source 'match)))) + (helm-source-mm-get-search-or-match-fns source 'match))) + (helm-aif (and (null (slot-value source 'matchplugin)) + (slot-value source 'migemo)) + (unless (eq it 'nomultimatch) ; Use own migemo fn. + (set-slot-value source 'match + (append (helm-mklist (slot-value source 'match)) + '(helm-mm-3-migemo-match)))))) (defmethod helm--setup-source ((source helm-source-in-buffer)) (let ((cur-init (slot-value source 'init))) @@ -1054,7 +927,13 @@ an eieio class." (set-slot-value source 'search (list helm-fuzzy-search-fn)))) (when (slot-value source 'matchplugin) (set-slot-value - source 'search (helm-source-mp-get-search-or-match-fns source 'search))) + source 'search (helm-source-mm-get-search-or-match-fns source 'search))) + (helm-aif (and (null (slot-value source 'matchplugin)) + (slot-value source 'migemo)) + (unless (eq it 'nomultimatch) + (set-slot-value source 'search + (append (helm-mklist (slot-value source 'search)) + '(helm-mm-3-migemo-search))))) (let ((mtc (slot-value source 'match))) (cl-assert (or (equal '(identity) mtc) (eq 'identity mtc)) @@ -1117,30 +996,6 @@ Args ARGS are keywords provided by `helm-source-in-file'." `(helm-make-source ,name 'helm-source-in-file :candidates-file ,file ,@args)) -;; Types -(defun helm-actions-from-type-file () - (let ((source (make-instance 'helm-type-file))) - (helm--setup-source source) - (helm-source-get-action-from-type source))) - -(defun helm-build-type-file () - (helm-make-type 'helm-type-file)) - -(defun helm-actions-from-type-function () - (let ((source (make-instance 'helm-type-function))) - (helm--setup-source source) - (helm-source-get-action-from-type source))) - -(defun helm-build-type-function () - (helm-make-type 'helm-type-function)) - -(defun helm-actions-from-type-command () - (let ((source (make-instance 'helm-type-command))) - (helm--setup-source source) - (helm-source-get-action-from-type source))) - -(defun helm-build-type-command () - (helm-make-type 'helm-type-command)) (provide 'helm-source) diff --git a/elpa/helm-20150704.1247/helm.el b/elpa/helm-core-20160105.2046/helm.el similarity index 86% rename from elpa/helm-20150704.1247/helm.el rename to elpa/helm-core-20160105.2046/helm.el index 4f3dae02..6f2c0d21 100644 --- a/elpa/helm-20150704.1247/helm.el +++ b/elpa/helm-core-20160105.2046/helm.el @@ -29,21 +29,11 @@ ;;; Code: (require 'cl-lib) +(require 'advice) ; Shutup byte compiler about ad-deactivate. +(require 'helm-lib) +(require 'helm-multi-match) (require 'helm-source) -(defmacro helm-with-gensyms (symbols &rest body) - "Bind the SYMBOLS to fresh uninterned symbols and eval BODY." - (declare (indent 1)) - `(let ,(mapcar (lambda (s) - ;; Use cl-gensym here instead of make-symbol - ;; to ensure a symbol that have a live that go - ;; beyond the live of its macro have different name. - ;; i.e symbols created with `with-helm-temp-hook' - ;; should have random names. - `(,s (cl-gensym (symbol-name ',s)))) - symbols) - ,@body)) - ;;; Multi keys ;; @@ -87,10 +77,10 @@ Run each function of FUNCTIONS list in turn when called within DELAY seconds." (iter (cl-gensym "helm-iter-key")) (timeout delay)) (eval (list 'defvar iter nil)) - #'(lambda () (interactive) (helm-run-multi-key-command funs iter timeout)))) + (lambda () (interactive) (helm-run-multi-key-command funs iter timeout)))) (defun helm-run-multi-key-command (functions iterator delay) - (let ((fn #'(lambda () + (let ((fn (lambda () (cl-loop for count from 1 to (length functions) collect count))) next) @@ -106,18 +96,6 @@ Run each function of FUNCTIONS list in turn when called within DELAY seconds." (when delay (run-with-idle-timer delay nil `(lambda () (setq ,iterator nil)))))) -(defun helm-iter-list (seq) - "Return an iterator object from SEQ." - (let ((lis seq)) - (lambda () - (let ((elm (car lis))) - (setq lis (cdr lis)) - elm)))) - -(defun helm-iter-next (iterator) - "Return next elm of ITERATOR." - (funcall iterator)) - (helm-multi-key-defun helm-toggle-resplit-and-swap-windows "Multi key command to resplit and swap helm window. First call run `helm-toggle-resplit-window', @@ -230,7 +208,7 @@ so don't use strings, vectors or whatever to define them." (define-key map (kbd "C-x C-f") 'helm-quit-and-find-file) (define-key map (kbd "M-m") 'helm-toggle-all-marks) (define-key map (kbd "M-a") 'helm-mark-all) - (define-key map (kbd "M-u") 'helm-unmark-all) + (define-key map (kbd "M-U") 'helm-unmark-all) (define-key map (kbd "C-w") 'helm-yank-text-at-point) (define-key map (kbd "C-M-a") 'helm-show-all-in-this-source-only) (define-key map (kbd "C-M-e") 'helm-display-all-sources) @@ -245,7 +223,8 @@ so don't use strings, vectors or whatever to define them." (define-key map (kbd "C-c C-k") 'helm-kill-selection-and-quit) (define-key map (kbd "C-c C-i") 'helm-copy-to-buffer) (define-key map (kbd "C-c C-f") 'helm-follow-mode) - (define-key map (kbd "C-c C-u") 'helm-force-update) + (define-key map (kbd "C-c C-u") 'helm-refresh) + (define-key map (kbd "C-c >") 'helm-toggle-truncate-line) (define-key map (kbd "M-p") 'previous-history-element) (define-key map (kbd "M-n") 'next-history-element) (define-key map (kbd "C-!") 'helm-toggle-suspend-update) @@ -257,19 +236,35 @@ so don't use strings, vectors or whatever to define them." (define-key map (kbd "C-t") 'helm-toggle-resplit-and-swap-windows) ;; Debugging command (define-key map (kbd "C-h C-d") 'undefined) - (define-key map (kbd "C-h C-d") 'helm-debug-output) - ;; Use `describe-mode' key in `global-map'. - (define-key map [f1] nil) ; Allow to eval keymap without errors. + (define-key map (kbd "C-h C-d") 'helm-enable-or-switch-to-debug) + ;; Allow to eval keymap without errors. + (define-key map [f1] nil) (define-key map (kbd "C-h C-h") 'undefined) (define-key map (kbd "C-h h") 'undefined) + ;; Use `describe-mode' key in `global-map'. (cl-dolist (k (where-is-internal 'describe-mode global-map)) (define-key map k 'helm-help)) + (define-key map (kbd "C-c ?") 'helm-help) ;; Bind all actions from 1 to 12 to their corresponding nth index+1. (cl-loop for n from 0 to 12 do (define-key map (kbd (format "" (1+ n))) `(lambda () (interactive) (helm-select-nth-action ,n)))) + ;; Bind keys to allow executing default action + ;; on first 9 candidates before and after selection. + (cl-loop for n from 1 to 9 + for key = (format "C-c %d" n) + for key- = (format "C-x %d" n) + for fn = `(lambda () + (interactive) + (helm-execute-selection-action-at-nth ,n)) + for fn- = `(lambda () + (interactive) + (helm-execute-selection-action-at-nth ,(- n))) + do (progn + (define-key map (kbd key) fn) + (define-key map (kbd key-) fn-))) map) "Keymap for helm.") @@ -379,15 +374,6 @@ because flickering can occur in some environment." :group 'helm :type 'boolean) -(defcustom helm-scroll-amount nil - "Scroll amount when scrolling other window in a helm session. -It is used by `helm-scroll-other-window' -and `helm-scroll-other-window-down'. - -If you prefer scrolling line by line, set this value to 1." - :group 'helm - :type 'integer) - (defcustom helm-display-function 'helm-default-display-buffer "Function to display *helm* buffer. It is `helm-default-display-buffer' by default, @@ -572,13 +558,6 @@ to exit or helm update to disable the `current-input-method' with `C-\\'." :group 'helm :type 'boolean) -(defcustom helm-file-globstar t - "Same as globstar bash shopt option. -When non--nil a pattern beginning with two stars will expand recursively. -Directories expansion is not supported yet." - :group 'helm - :type 'boolean) - (defcustom helm-inherit-input-method t "Inherit `current-input-method' from `current-buffer' when non--nil. The default is to enable this by default, the user can toggle the current @@ -691,9 +670,6 @@ Other sources won't appear in the search results. If nil then there is no filtering. See also `helm-set-source-filter'.") -(defvar helm-action-buffer "*helm action*" - "Buffer showing actions.") - (defvar helm-selection-overlay nil "Overlay used to highlight the currently selected item.") @@ -751,6 +727,9 @@ and before performing action.") (defvar helm-move-selection-after-hook nil "Run after moving selection in `helm-buffer'.") +(defvar helm-after-preselection-hook nil + "Run after preselection in `helm-buffer'.") + (defvar helm-window-configuration-hook nil "Run when switching to and back from action buffer.") @@ -763,7 +742,8 @@ and before performing action.") "Variables which are restored after `helm' invocation.") (defvar helm-execute-action-at-once-if-one nil - "Execute default action and exit when only one candidate is remaining.") + "Execute default action and exit when only one candidate is remaining. +It can be also a function called with no args returning a boolean value.") (defvar helm-quit-if-no-candidate nil "Quit when there is no candidates when non--nil. @@ -794,7 +774,8 @@ It is disabled by default because `helm-debug-buffer' grows quickly.") \\[helm-help]:Help \ \\[helm-select-action]:Act \ \\[helm-maybe-exit-minibuffer]/\ -f1/f2/f-n:NthAct" +f1/f2/f-n:NthAct \ +\\[helm-toggle-suspend-update]:Tog.suspend" "Help string displayed in mode-line in `helm'. It can be a string or a list of two args, in this case, first arg is a string that will be used as name for candidates number, @@ -813,6 +794,84 @@ Here an example to hide minibuffer when using Note that we check `helm-echo-input-in-header-line' value from `helm-buffer' which allow detecting possible local value of this var.") + +(defvar helm-help-message + "* Helm Generic Help + +\\`helm' is an Emacs incremental completion and selection narrowing framework. + +Narrow the list by typing some pattern, +Multiple patterns are allowed by separating with a space. +Select with natural Emacs operations, choose with RET. + +** Help + +C-h m\t\tRun this generic help for helm. + +** Basic Operations + +These are the default key bindings: + +| Key | Alternative Keys | Command | +|---------+------------------+-----------------------------------------------------------| +| C-p | Up | Previous Line | +| C-n | Down | Next Line | +| M-v | PageUp | Previous Page | +| C-v | PageDown | Next Page | +| Enter | | Execute first (default) action / Select | +| M-< | | First Line | +| M-> | | Last Line | +| C-M-S-v | M-PageUp, C-M-y | Previous Page (other-window) | +| C-M-v | M-PageDown | Next Page (other-window) | +| Tab | C-i | Show action list | +| Left | | Previous Source | +| Right | C-o | Next Source | +| C-k | | Delete pattern (with prefix arg delete from point to end) | +| C-j | C-z | Persistent Action (Execute and keep helm session) | + +** Shortcuts For nth Action + +f1-12: Execute nth 1 to 12 Action(s). + +** Shortcuts for executing Default Action on nth candidate + +C-x => execute default action on number candidate before selection. +C-c => execute default action on number candidate after selection. + +Of course this works only on the 9 first and previous candidates. + +Helm provides nothing to visualize candidates numbers, up to you to install +linum-relative package and enable linum-relative in helm.. + +** Visible Marks + +Visible marks store candidate. Some actions uses marked candidates. + +** Miscellaneous Commands + +\\[helm-toggle-resplit-and-swap-windows]\t\tToggle vertical/horizontal split on first hit and swap helm window on second hit. +\\[helm-quit-and-find-file]\t\tDrop into `helm-find-files'. +\\[helm-delete-current-selection]\t\tDelete selected item (visually). +\\[helm-kill-selection-and-quit]\t\tKill display value of candidate and quit (with prefix arg kill the real value). +\\[helm-yank-selection]\t\tYank selection into pattern. +\\[helm-follow-mode]\t\tToggle automatical execution of persistent action. +\\[helm-follow-action-forward]\tRun persistent action and goto next line. +\\[helm-follow-action-backward]\t\tRun persistent action and goto previous line. +\\[helm-refresh]\t\tRecalculate and redisplay candidates. +\\[helm-toggle-suspend-update]\t\tSuspend/reenable update. + +** Global Commands + +\\\\[helm-resume] revives last `helm' session. +It is very useful, so you should bind any key. + +** Helm Map +\\{helm-map}" + "Detailed help message string for `helm'. +It also accepts function or variable symbol.") + +(defvar helm-autoresize-mode) ;; Undefined in `helm-default-display-buffer'. + ;;; Internal Variables ;; @@ -833,16 +892,10 @@ value of this var.") "Value of the currently selected object when the action list is shown.") (defvar helm-sources nil "[INTERNAL] Value of current sources in use, a list.") -(defvar helm-buffer "*helm*" - "Buffer showing completions.") -(defvar helm-current-buffer nil - "Current buffer when `helm' is invoked.") (defvar helm-buffer-file-name nil "Variable `buffer-file-name' when `helm' is invoked.") (defvar helm-candidate-cache (make-hash-table :test 'equal) "Holds the available candidate within a single helm invocation.") -(defvar helm-pattern "" - "The input pattern used to update the helm buffer.") (defvar helm-input "" "The input typed in the candidates panel.") (defvar helm-input-local nil @@ -870,7 +923,6 @@ See `helm-log-save-maybe' for more info.") (defvar helm-visible-mark-overlays nil) (defvar helm-update-blacklist-regexps '("^" "^ *" "$" "!" " " "\\b" "\\<" "\\>" "\\_<" "\\_>" ".*")) -(defvar helm-suspend-update-flag nil) (defvar helm-force-updating-p nil) (defvar helm-exit-status 0 "Flag to inform whether helm have exited or quitted. @@ -913,7 +965,14 @@ precedence on :default.") (defvar helm-truncate-lines nil "[Internal] Don't set this globally, it is used as a local var.") (defvar helm--prompt nil) - +(defvar helm--file-completion-sources + '("Find Files" "Read File Name" "Read File Name History") + "Sources that use the *find-files mechanism can be added here. +Sources generated by `helm-mode' don't need to be added here, it will +be done automatically. +You should not modify this yourself unless you know what you do.") +;; Same as `ffap-url-regexp' but keep it here to ensure `ffap-url-regexp' is not nil. +(defvar helm--url-regexp "\\(news\\(post\\)?:\\|mailto:\\|file:\\|\\(ftp\\|https?\\|telnet\\|gopher\\|www\\|wais\\)://\\)") ;; Utility: logging (defun helm-log (format-string &rest args) @@ -1004,19 +1063,6 @@ If `helm-last-log-file' is nil, switch to `helm-debug-buffer' ." ;; Programming Tools -(defmacro helm-aif (test-form then-form &rest else-forms) - "Like `if' but set the result of TEST-FORM in a temprary variable called `it'. -THEN-FORM and ELSE-FORMS are then excuted just like in `if'." - (declare (indent 2) (debug t)) - `(let ((it ,test-form)) - (if it ,then-form ,@else-forms))) - -(defun helm-mklist (obj) - "If OBJ is a list \(but not lambda\), return itself. -Otherwise make a list with one element." - (if (and (listp obj) (not (functionp obj))) - obj - (list obj))) (defun helm-this-command () "Return the actual command in action. @@ -1042,24 +1088,6 @@ not `exit-minibuffer' or unwanted functions." (> (length btf) 2)) return (cadr (cdr btf)))) -(defun helm-flatten-list (seq &optional omit-nulls) - "Return a list of all single elements of sublists in SEQ." - (let (result) - (cl-labels ((flatten (seq) - (cl-loop - for elm in seq - if (and (or elm - (null omit-nulls)) - (or (atom elm) - (functionp elm) - (and (consp elm) - (cdr elm) - (atom (cdr elm))))) - do (push elm result) - else do (flatten elm)))) - (flatten seq)) - (nreverse result))) - ;; Test tools (defmacro with-helm-time-after-update (&rest body) @@ -1079,41 +1107,6 @@ not `exit-minibuffer' or unwanted functions." ;; Helm API -(defun helm-buffer-get () - "Return `helm-action-buffer' if shown otherwise `helm-buffer'." - (if (helm-action-window) - helm-action-buffer - helm-buffer)) - -(defun helm-window () - "Window of `helm-buffer'." - (get-buffer-window (helm-buffer-get) 0)) - -(defun helm-action-window () - "Window of `helm-action-buffer'." - (get-buffer-window helm-action-buffer 'visible)) - -(defmacro with-helm-window (&rest body) - "Be sure BODY is excuted in the helm window." - (declare (indent 0) (debug t)) - `(with-selected-window (helm-window) - ,@body)) - -(defmacro with-helm-current-buffer (&rest body) - "Eval BODY inside `helm-current-buffer'." - (declare (indent 0) (debug t)) - `(with-current-buffer (or (and (buffer-live-p helm-current-buffer) - helm-current-buffer) - (setq helm-current-buffer - (current-buffer))) - ,@body)) - -(defmacro with-helm-buffer (&rest body) - "Eval BODY inside `helm-buffer'." - (declare (indent 0) (debug t)) - `(with-current-buffer (helm-buffer-get) - ,@body)) - (defmacro with-helm-restore-variables (&rest body) "Restore `helm-restored-variables' after executing BODY." (declare (indent 0) (debug t)) @@ -1163,15 +1156,20 @@ not `exit-minibuffer' or unwanted functions." (progn ,@body) (error "Running helm command outside of context")))) -(cl-defun helm-attr (attribute-name - &optional (src (helm-get-current-source)) compute) +(defun helm-attr (attribute-name &optional source compute) "Get the value of ATTRIBUTE-NAME of SRC. If SRC is omitted, use current source. If COMPUTE is non--nil compute value of ATTRIBUTE-NAME -with `helm-interpret-value'." - (helm-aif (or (assq attribute-name src) - (helm-get-attribute-from-source-type attribute-name src)) - (if compute (helm-interpret-value (cdr it)) (cdr it)))) +with `helm-interpret-value'. COMPUTE can have also 'ignorefn as +value, in this case `helm-interpret-value' will return a function +as value inchanged, but will eval a symbol which is bound +(i.e a variable)." + (let ((src (or source (helm-get-current-source)))) + (helm-aif (or (assq attribute-name src) + (helm-get-attribute-from-source-type attribute-name src)) + (if compute + (helm-interpret-value (cdr it) src compute) + (cdr it))))) (cl-defun helm-attr-defined (attribute-name &optional (src (helm-get-current-source))) @@ -1244,9 +1242,9 @@ If INDEX is specified, action is added in action list at INDEX, otherwise it is added at end. This allow user to add a specific action to an existing source without modifying source code." - (let ((actions (helm-attr 'action source)) + (let ((actions (helm-attr 'action source 'ignorefn)) (new-action (list (cons name fn)))) - (when (symbolp actions) + (when (functionp actions) (setq actions (list (cons "Default action" actions)))) (helm-attrset 'action (if index @@ -1258,7 +1256,7 @@ without modifying source code." "Delete ACTION-OR-NAME from SOURCE. ACTION-OR-NAME can either be the name of action or the symbol function associated to name." - (let* ((actions (helm-attr 'action source)) + (let* ((actions (helm-attr 'action source 'ignorefn)) (del-action (if (symbolp action-or-name) (rassoc action-or-name actions) (assoc action-or-name actions)))) @@ -1287,7 +1285,7 @@ only when predicate helm-ff-candidates-lisp-p return non--nil: 'async-byte-compile-file helm-source-find-files 'helm-ff-candidates-lisp-p\)." - (let* ((actions (helm-attr 'action source)) + (let* ((actions (helm-attr 'action source 'ignorefn)) (action-transformers (helm-attr 'action-transformer source)) (new-action (list (cons name fn))) (transformer `(lambda (actions candidate) @@ -1295,7 +1293,7 @@ only when predicate helm-ff-candidates-lisp-p return non--nil: (helm-append-at-nth actions (quote ,new-action) ,index)) (t actions))))) - (when (or (symbolp actions) (functionp actions)) + (when (functionp actions) (helm-attrset 'action (list (cons "Default action" actions)) source)) (when (or (symbolp action-transformers) (functionp action-transformers)) (setq action-transformers (list action-transformers))) @@ -1429,7 +1427,7 @@ of \(action-display . function\)." (helm-aif (helm-attr 'action-transformer) (helm-composed-funcall-with-source (helm-get-current-source) it - (helm-attr 'action) + (helm-attr 'action nil 'ignorefn) ;; Check if the first given transformer ;; returns the same set of actions for each ;; candidate in marked candidates. @@ -1442,7 +1440,7 @@ of \(action-display . function\)." always (equal (funcall act nil c) acts)) (car (helm-marked-candidates)) (helm-get-selection))) - (helm-attr 'action)))) + (helm-attr 'action nil 'ignorefn)))) (defun helm-get-current-source () "Return the source for the current selection. @@ -1486,58 +1484,54 @@ Allow also checking if helm-buffer contain candidates." "Check if `helm-current-buffer' is modified since `helm' was invoked." (helm-buffer-is-modified helm-current-buffer)) -(defun helm-run-after-quit (function &rest args) - "Perform an action after quitting `helm'. -The action is to call FUNCTION with arguments ARGS." - (setq helm-quit t) +(defun helm-run-after-exit (function &rest args) + "Exectute FUNCTION with ARGS after exiting `helm'. +The action is to call FUNCTION with arguments ARGS. +Contrarily to `helm-exit-and-execute-action' this can be used +to call non--actions functions with any ARGS or no ARGS at all. + +Use this on commands invoked from keybindings, but not +on action functions invoked as action from the action menu, +i.e functions called with RET." (helm-kill-async-processes) (helm-log "function = %S" function) (helm-log "args = %S" args) - (apply 'run-with-timer 0.1 nil function args) + (helm-exit-and-execute-action + (lambda (_candidate) + (apply function args)))) + +(defun helm-exit-and-execute-action (action) + "Exit current helm session and execute ACTION. +Argument ACTION is a function called with one arg (candidate) +and part of the actions of current source. + +Use this on commands invoked from keybindings, but not +on action functions invoked as action from the action menu, +i.e functions called with RET." + (setq helm-saved-action action) + (setq helm-saved-selection (helm-get-selection)) (helm-exit-minibuffer)) +(defalias 'helm-run-after-quit 'helm-run-after-exit) +(make-obsolete 'helm-run-after-quit 'helm-run-after-exit "1.7.7") +(defalias 'helm-quit-and-execute-action 'helm-exit-and-execute-action) +(make-obsolete 'helm-quit-and-execute-action 'helm-exit-and-execute-action "1.7.7") -(defun define-helm-type-attribute (type definition &optional doc) - "Register type attribute of TYPE as DEFINITION with DOC. -DOC is displayed in `helm-type-attributes' docstring. - -Use this function is better than setting `helm-type-attributes' directly." - (cl-loop for i in definition do - ;; without `ignore-errors', error at emacs22 - (ignore-errors (setf i (delete nil i)))) - (helm-add-type-attribute type definition) - (and doc (helm-document-type-attribute type doc)) - nil) - -(defun helm-document-attribute (attribute short-doc &optional long-doc) - "Register ATTRIBUTE documentation introduced by plug-in. -SHORT-DOC is displayed beside attribute name. -LONG-DOC is displayed below attribute name and short documentation." - (if long-doc - (setq short-doc (concat "(" short-doc ")")) - (setq long-doc short-doc - short-doc "")) - (add-to-list 'helm-attributes attribute t) - (put attribute 'helm-attrdoc - (concat "- " (symbol-name attribute) - " " short-doc "\n\n" long-doc "\n"))) - -(put 'helm-document-attribute 'lisp-indent-function 2) - -(defun helm-interpret-value (value &optional source) +(defun helm-interpret-value (value &optional source compute) "Interpret VALUE as variable, function or literal and return it. -If VALUE is a function, call it with no arguments and return the value. +If VALUE is a function, call it with no arguments and return the value +unless COMPUTE value is 'ignorefn. If SOURCE compute VALUE for this source. If VALUE is a variable, return the value. If VALUE is a symbol, but it is not a function or a variable, cause an error. Otherwise, return VALUE itself." - (cond ((and source (functionp value)) + (cond ((and source (functionp value) (not (eq compute 'ignorefn))) (helm-funcall-with-source source value)) - ((functionp value) + ((and (functionp value) (not (eq compute 'ignorefn))) (funcall value)) ((and (symbolp value) (boundp value)) (symbol-value value)) - ((symbolp value) + ((and (symbolp value) (not (functionp value))) (error "helm-interpret-value: Symbol must be a function or a variable")) (t @@ -1566,19 +1560,6 @@ IOW Don't use VALUE of previous VAR to set the VALUE of next VAR. collect (cons (car i) (cadr i))) helm--local-variables)))) -(defun helm-make-actions (&rest args) - "Build an alist with (NAME . ACTION) elements with each pairs in ARGS. -Where NAME is a string or a function returning a string or nil and ACTION -a function. -If NAME returns nil the pair is skipped. - -\(fn NAME ACTION ...)" - (cl-loop for i on args by #'cddr - for name = (car i) - when (functionp name) - do (setq name (funcall name)) - when name - collect (cons name (cadr i)))) ;; Core: API helper (cl-defun helm-empty-buffer-p (&optional (buffer helm-buffer)) @@ -1600,16 +1581,8 @@ of a source is deleted without updating the source." (helm-pos-header-line-p)) (bobp)))))) -(defun helm-symbol-name (obj) - (if (or (consp obj) (byte-code-function-p obj)) - "Anonymous" - (symbol-name obj))) - ;; Core: tools -(defun helm-current-line-contents () - "Current line string without properties." - (buffer-substring-no-properties (point-at-bol) (point-at-eol))) (defun helm-funcall-with-source (source functions &rest args) "Call from SOURCE FUNCTIONS list or single function FUNCTIONS with ARGS. @@ -1728,39 +1701,6 @@ This is used in transformers to modify candidates list." (lambda (&rest oargs) (helm-compose oargs funcs)) args))) -(defun helm-stringify (str-or-sym) - "Get string of STR-OR-SYM." - (if (stringp str-or-sym) - str-or-sym - (symbol-name str-or-sym))) - -(defun helm-symbolify (str-or-sym) - "Get symbol of STR-OR-SYM." - (if (symbolp str-or-sym) - str-or-sym - (intern str-or-sym))) - -(defun helm-remove-if-not-match (regexp seq) - "Remove all elements of SEQ that don't match REGEXP." - (cl-loop for s in seq - for str = (cond ((symbolp s) - (symbol-name s)) - ((consp s) - (car s)) - (t s)) - when (string-match-p regexp str) - collect s)) - -(defun helm-remove-if-match (regexp seq) - "Remove all elements of SEQ that match REGEXP." - (cl-loop for s in seq - for str = (cond ((symbolp s) - (symbol-name s)) - ((consp s) - (car s)) - (t s)) - unless (string-match-p regexp str) - collect s)) ;; Core: entry point ;; `:allow-nest' is not in this list because it is treated before. @@ -1896,7 +1836,7 @@ to 10 as session local variable. ;; take precedence on same vars ;; that may have been passed before helm call. (helm-parse-keys plist))) - (apply fn (mapcar #'(lambda (key) (plist-get plist key)) + (apply fn (mapcar (lambda (key) (plist-get plist key)) helm-argument-keys))) (apply fn plist))))) ; [1] fn == helm-internal. @@ -1960,9 +1900,10 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (input-method-verbose-flag helm-input-method-verbose-flag) (old--cua cua-mode) (helm--maybe-use-default-as-input - (or helm--maybe-use-default-as-input ; it is let-bounded so use it. - (cl-loop for s in (helm-normalize-sources any-sources) - thereis (memq s helm-sources-using-default-as-input))))) + (and (null any-input) + (or helm--maybe-use-default-as-input ; it is let-bounded so use it. + (cl-loop for s in (helm-normalize-sources any-sources) + thereis (memq s helm-sources-using-default-as-input)))))) ;; cua-mode overhide local helm bindings. ;; disable this stupid thing if enabled. (and cua-mode (cua-mode -1)) @@ -1979,6 +1920,7 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (helm-initialize any-resume any-input any-default any-sources) (helm-display-buffer helm-buffer) + ;; We are now in helm-buffer. (when helm-prevent-escaping-from-minibuffer (helm--remap-mouse-mode 1)) ; Disable mouse bindings. (add-hook 'post-command-hook 'helm--maybe-update-keymap) @@ -1996,8 +1938,6 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (helm-restore-position-on-quit) (helm-log (concat "[End session (quit)] " (make-string 34 ?-))) nil)) - (remove-hook 'post-command-hook 'helm--maybe-update-keymap) - (remove-hook 'post-command-hook 'helm--update-header-line) (if (fboundp 'advice-add) (progn (advice-remove 'tramp-read-passwd @@ -2041,6 +1981,8 @@ Called from lisp, you can specify a buffer-name as a string with ARG." (setq helm-compiled-sources nil) (setq cur-dir (buffer-local-value 'default-directory (get-buffer any-buffer))) + (setq helm-saved-selection nil + helm-saved-action nil) (unless (buffer-live-p helm-current-buffer) ;; `helm-current-buffer' may have been killed. (setq helm-current-buffer (current-buffer))) @@ -2058,14 +2000,14 @@ Called from lisp, you can specify a buffer-name as a string with ARG." "Resume previous helm session within running helm." (interactive "p") (if (and helm-alive-p (> (length helm-buffers) arg)) - (helm-run-after-quit `(lambda () (helm-resume (nth ,arg helm-buffers)))) + (helm-run-after-exit `(lambda () (helm-resume (nth ,arg helm-buffers)))) (message "No previous helm sessions to resume yet!"))) (defun helm-resume-list-buffers-after-quit () "List resumable helm buffers within running helm." (interactive) (if (and helm-alive-p (> (length helm-buffers) 0)) - (helm-run-after-quit #'(lambda () (helm-resume t))) + (helm-run-after-exit (lambda () (helm-resume t))) (message "No previous helm sessions to resume yet!"))) (defun helm-resume-p (any-resume) @@ -2255,15 +2197,15 @@ The function used to display `helm-buffer'." "Allow setting `no-other-window' window parameter in all windows. Arg ENABLE will be the value of the `no-other-window' window property." (walk-windows - #'(lambda (w) + (lambda (w) (unless (window-dedicated-p w) (set-window-parameter w 'no-other-window enabled))) 0)) (defun helm-default-display-buffer (buffer) "Default function to display `helm-buffer' BUFFER. -It uses `switch-to-buffer' or `pop-to-buffer' depending of value of -`helm-full-frame' and/or `helm-split-window-default-side'." +It uses `switch-to-buffer' or `display-buffer' depending of value +of `helm-full-frame' and/or `helm-split-window-default-side'." (if (or (buffer-local-value 'helm-full-frame (get-buffer buffer)) (and (eq helm-split-window-default-side 'same) (one-window-p t))) @@ -2278,7 +2220,7 @@ It uses `switch-to-buffer' or `pop-to-buffer' depending of value of (not (minibufferp helm-current-buffer)) (not helm-split-window-in-side-p)) (delete-other-windows)) - (pop-to-buffer buffer))) + (display-buffer buffer))) ;;; Core: initialize @@ -2362,6 +2304,7 @@ It is intended to use this only in `helm-initial-setup'." (window-buffer (with-selected-window (minibuffer-window) (minibuffer-selected-window))))) + (defun helm-initial-setup (any-default) "Initialize helm settings and set up the helm buffer." (helm-log-run-hook 'helm-before-initialize-hook) @@ -2371,13 +2314,15 @@ It is intended to use this only in `helm-initial-setup'." ;; For initialization of helm locals vars that need ;; a value from current buffer, it is here. (helm-set-local-variable 'current-input-method current-input-method) - (setq helm-current-prefix-arg nil) - (setq helm-suspend-update-flag nil) - (setq helm-current-buffer (helm--current-buffer)) - (setq helm-buffer-file-name buffer-file-name) - (setq helm-issued-errors nil) - (setq helm-compiled-sources nil) - (setq helm-saved-current-source nil) + (setq helm-current-prefix-arg nil + helm-saved-action nil + helm-saved-selection nil + helm-suspend-update-flag nil + helm-current-buffer (helm--current-buffer) + helm-buffer-file-name buffer-file-name + helm-issued-errors nil + helm-compiled-sources nil + helm-saved-current-source nil) (unless (and (or helm-split-window-state helm--window-side-state) helm-reuse-last-window-split-state) @@ -2391,7 +2336,7 @@ It is intended to use this only in `helm-initial-setup'." ;; Call the init function for sources where appropriate (helm-funcall-foreach 'init (and helm-source-filter - (cl-remove-if-not #'(lambda (s) + (cl-remove-if-not (lambda (s) (member (assoc-default 'name s) helm-source-filter)) (helm-get-sources)))) @@ -2521,7 +2466,9 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." (helm-force-update))) ;; Handle `helm-execute-action-at-once-if-one' and ;; `helm-quit-if-no-candidate' now only for not--delayed sources. - (cond ((and helm-execute-action-at-once-if-one + (cond ((and (if (functionp helm-execute-action-at-once-if-one) + (funcall helm-execute-action-at-once-if-one) + helm-execute-action-at-once-if-one) (not source-delayed-p) (= (helm-get-candidate-number) 1)) (ignore)) ; Don't enter the minibuffer loop. @@ -2537,31 +2484,31 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." (thing-at-point 'symbol))))) (unwind-protect (minibuffer-with-setup-hook - #'(lambda () - ;; Start minor-mode with global value of helm-map. - (helm--minor-mode 1) - ;; Now overhide the global value of `helm-map' with - ;; the local one which is in this order: - ;; - The keymap of current source. - ;; - The value passed in ANY-KEYMAP - ;; which will become buffer local. - ;; - Or fallback to the global value of helm-map. - (helm--maybe-update-keymap - (or src-keymap any-keymap helm-map)) - (helm-log-run-hook 'helm-minibuffer-set-up-hook) - (setq timer - (run-with-idle-timer - (max helm-input-idle-delay 0.001) 'repeat - #'(lambda () - ;; Stop updating in persistent action - ;; or when `helm-suspend-update-flag' - ;; is non--nil. - (unless (or helm-in-persistent-action - helm-suspend-update-flag) - (save-selected-window - (helm-check-minibuffer-input) - (helm-print-error-messages)))))) - (helm--update-header-line)) ; minibuffer has already been filled here + (lambda () + ;; Start minor-mode with global value of helm-map. + (helm--minor-mode 1) + ;; Now overhide the global value of `helm-map' with + ;; the local one which is in this order: + ;; - The keymap of current source. + ;; - The value passed in ANY-KEYMAP + ;; which will become buffer local. + ;; - Or fallback to the global value of helm-map. + (helm--maybe-update-keymap + (or src-keymap any-keymap helm-map)) + (helm-log-run-hook 'helm-minibuffer-set-up-hook) + (setq timer + (run-with-idle-timer + (max helm-input-idle-delay 0.001) 'repeat + (lambda () + ;; Stop updating in persistent action + ;; or when `helm-suspend-update-flag' + ;; is non--nil. + (unless (or helm-in-persistent-action + helm-suspend-update-flag) + (save-selected-window + (helm-check-minibuffer-input) + (helm-print-error-messages)))))) + (helm--update-header-line)) ; minibuffer has already been filled here (read-from-minibuffer (or any-prompt "pattern: ") any-input helm-map nil hist tap @@ -2573,7 +2520,9 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." This function is handling `helm-execute-action-at-once-if-one' and `helm-quit-if-no-candidate' in delayed sources." (with-helm-window - (cond ((and helm-execute-action-at-once-if-one + (cond ((and (if (functionp helm-execute-action-at-once-if-one) + (funcall helm-execute-action-at-once-if-one) + helm-execute-action-at-once-if-one) (= (helm-get-candidate-number) 1)) (helm-exit-minibuffer)) ((and helm-quit-if-no-candidate @@ -2690,6 +2639,8 @@ WARNING: Do not use this mode yourself, it is internal to helm." (with-current-buffer helm-buffer ;; bury-buffer from this window. (bury-buffer) ;[1] + (remove-hook 'post-command-hook 'helm--maybe-update-keymap) + (remove-hook 'post-command-hook 'helm--update-header-line) ;; Be sure we call this from helm-buffer. (helm-funcall-foreach 'cleanup)) (helm-kill-async-processes) @@ -2711,6 +2662,7 @@ WARNING: Do not use this mode yourself, it is internal to helm." ;; be a helm buffer. (replace-buffer-in-windows helm-buffer) (setq helm-alive-p nil) + (setq helm-debug nil) ;; This is needed in some cases where last input ;; is yielded infinitely in minibuffer after helm session. (helm-clean-up-minibuffer)) @@ -2854,21 +2806,6 @@ Cache the candidates if there is not yet a cached value." ;;; Core: candidate transformers -(defun helm-transform-mapcar (function args) - "`mapcar' for candidate-transformer. - -ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...) - -\(helm-transform-mapcar 'upcase '(\"foo\" \"bar\")) -=> (\"FOO\" \"BAR\") -\(helm-transform-mapcar 'upcase '((\"1st\" . \"foo\") (\"2nd\" . \"bar\"))) -=> ((\"1st\" . \"FOO\") (\"2nd\" . \"BAR\")) -" - (cl-loop for arg in args - if (consp arg) - collect (cons (car arg) (funcall function (cdr arg))) - else - collect (funcall function arg))) (defun helm-process-candidate-transformer (candidates source) "Execute `candidate-transformer' function(s) on CANDIDATES in SOURCE." @@ -2890,7 +2827,8 @@ ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...) (cl-loop for f in it do (setq ,candidate (funcall f ,candidate)) finally return ,candidate) - (setq ,candidate (funcall it ,candidate))))) + (setq ,candidate (funcall it ,candidate))) + ,candidate)) (defun helm--initialize-one-by-one-candidates (candidates source) "Process the CANDIDATES with the `filter-one-by-one' function in SOURCE. @@ -2975,27 +2913,6 @@ Default function to match candidates according to `helm-pattern'." ;;; Fuzzy matching ;; ;; -(defsubst helm--mapconcat-pattern (pattern) - "Transform string PATTERN in regexp for further fuzzy matching. -e.g helm.el$ - => \"[^h]*h[^e]*e[^l]*l[^m]*m[^.]*[.][^e]*e[^l]*l$\" - ^helm.el$ - => \"helm[.]el$\"." - (let ((ls (split-string-and-unquote pattern ""))) - (if (string= "^" (car ls)) - ;; Exact match. - (mapconcat (lambda (c) - (if (and (string= c "$") - (string-match "$\\'" pattern)) - c (regexp-quote c))) - (cdr ls) "") - ;; Fuzzy match. - (mapconcat (lambda (c) - (if (and (string= c "$") - (string-match "$\\'" pattern)) - c (format "[^%s]*%s" c (regexp-quote c)))) - ls "")))) - (defvar helm--fuzzy-regexp-cache (make-hash-table :test 'eq)) (defun helm--fuzzy-match-maybe-set-pattern () ;; Computing helm-pattern with helm--mapconcat-pattern @@ -3028,7 +2945,7 @@ e.g helm.el$ This function is used with sources build with `helm-source-sync'." (unless (string-match " " helm-pattern) ;; When pattern have one or more spaces, let - ;; match-plugin doing the job with no fuzzy matching.[1] + ;; multi-match doing the job with no fuzzy matching.[1] (let ((regexp (cadr (gethash 'helm-pattern helm--fuzzy-regexp-cache)))) (if (string-match "\\`!" helm-pattern) (not (string-match regexp candidate)) @@ -3067,11 +2984,6 @@ This function is used with sources build with `helm-source-sync'." else do (goto-char eol) finally return nil))))) -(defsubst helm--collect-pairs-in-string (string) - (cl-loop for str on (split-string string "" t) by 'cdr - when (cdr str) - collect (list (car str) (cadr str)))) - (defun helm-score-candidate-for-pattern (candidate pattern) "Give a score to CANDIDATE according to PATTERN. Score is calculated against number of contiguous matches found with PATTERN. @@ -3142,29 +3054,49 @@ sort on the real part." It is meant to use with `filter-one-by-one' slot." (let* ((pair (and (consp candidate) candidate)) (display (helm-stringify (if pair (car pair) candidate))) - (real (cdr pair))) + (real (cdr pair)) + (regex (helm-aif (and helm-migemo-mode + (assoc helm-pattern + helm-mm--previous-migemo-info)) + (cdr it) + helm-pattern)) + (mp (helm-aif (helm-attr 'match-part (helm-get-current-source)) + (funcall it display)))) (with-temp-buffer - (insert display) + (insert (propertize display 'read-only nil)) ; Fix (#1176) (goto-char (point-min)) - (if (search-forward helm-pattern nil t) + (when mp + ;; FIXME the first part of display may contain an occurence of mp. + ;; e.g "helm-adaptive.el:27:(defgroup helm-adapt" + (search-forward mp nil t) + (goto-char (match-beginning 0))) + (if (re-search-forward regex (and mp (+ (point) (length mp))) t) (add-text-properties (match-beginning 0) (match-end 0) '(face helm-match)) - (cl-loop with pattern = (if (string-match-p " " helm-pattern) - (split-string helm-pattern) - (split-string helm-pattern "" t)) - for p in pattern + (cl-loop with multi-match + with patterns = (if (string-match-p " " helm-pattern) + (prog1 (split-string helm-pattern) + (setq multi-match t)) + (split-string helm-pattern "" t)) + for p in patterns + for re = (or (and helm-migemo-mode + (assoc-default + p helm-mm--previous-migemo-info)) + p) do - (when (search-forward p nil t) + (when (re-search-forward re nil t) (add-text-properties - (match-beginning 0) (match-end 0) '(face helm-match))))) + (match-beginning 0) (match-end 0) + '(face helm-match))) + (when multi-match (goto-char (point-min))))) (setq display (buffer-string))) (if real (cons display real) display))) (defun helm-fuzzy-highlight-matches (candidates _source) "The filtered-candidate-transformer function to highlight matches in fuzzy. -See helm-fuzzy-default-highlight-match." +See `helm-fuzzy-default-highlight-match'." (cl-loop for c in candidates - collect (helm-fuzzy-default-highlight-match c))) + collect (funcall helm-fuzzy-matching-highlight-fn c))) (defun helm-match-functions (source) (let ((matchfns (or (assoc-default 'match source) @@ -3228,18 +3160,19 @@ and `helm-pattern'." (case-fold-search (helm-set-case-fold-search))) (clrhash helm-match-hash) (cl-dolist (match matchfns) - (let (newmatches) - (cl-dolist (candidate cands) - (unless (gethash candidate helm-match-hash) - (let ((target (helm-candidate-get-display candidate))) - (when (funcall match - (if match-part-fn - (funcall match-part-fn target) target)) - (helm--accumulate-candidates - candidate newmatches - helm-match-hash item-count limit source))))) - ;; filter-one-by-one may return nil candidates, so delq them if some. - (setq matches (nconc matches (nreverse (delq nil newmatches))))))) + (when (< item-count limit) + (let (newmatches) + (cl-dolist (candidate cands) + (unless (gethash candidate helm-match-hash) + (let ((target (helm-candidate-get-display candidate))) + (when (funcall match + (if match-part-fn + (funcall match-part-fn target) target)) + (helm--accumulate-candidates + candidate newmatches + helm-match-hash item-count limit source))))) + ;; filter-one-by-one may return nil candidates, so delq them if some. + (setq matches (nconc matches (nreverse (delq nil newmatches)))))))) (error (unless (eq (car err) 'invalid-regexp) ; Always ignore regexps errors. (helm-log-error "helm-match-from-candidates in source `%s': %s %s" (assoc-default 'name source) (car err) (cdr err))) @@ -3268,6 +3201,10 @@ and `helm-pattern'." (helm-get-cached-candidates source) limit) ;; Compute candidates according to pattern with their match fns. (helm-match-from-candidates + ;; FIXME: What when volatile is used, and the display expected + ;; comes from the filtered-candidate-transformer fn ? + ;; In this case match function try to match on real which is maybe not + ;; a string. (helm-get-cached-candidates source) matchfns matchpartfn limit source)) source)))) @@ -3301,11 +3238,14 @@ and `helm-pattern'." (helm-log "Using here `helm-while-no-input'") (helm-while-no-input ,@body)))) +(defun helm--collect-matches (src-list) + (let ((matches (helm--maybe-use-while-no-input + (cl-loop for src in src-list + collect (helm-compute-matches src))))) + (unless (eq matches t) matches))) + (defun helm--compute-sources (src-list) - (cl-loop with matches = (helm--maybe-use-while-no-input - (cl-loop for src in src-list - collect (helm-compute-matches src))) - when (eq matches t) do (setq matches nil) + (cl-loop with matches = (helm--collect-matches src-list) for src in src-list for mtc in matches do (helm-render-source src mtc))) @@ -3357,7 +3297,8 @@ is done on whole `helm-buffer' and not on current source." (with-current-buffer (helm-buffer-get) (set (make-local-variable 'helm-input-local) helm-pattern) (let (normal-sources - delayed-sources) + delayed-sources + matches) (unwind-protect (progn ;; Iterate over all the sources @@ -3373,13 +3314,21 @@ is done on whole `helm-buffer' and not on current source." ;; Export the variables from cl-loop finally (setq delayed-sources ds normal-sources ns)) - (erase-buffer) - ;; Render all the sources into the helm buffer after - ;; calculating all candidates. - ;; Candidates must be computed AFTER erasing buffer - ;; even if it cause flickering; Doing so avoid - ;; unexpected results when executing actions. - (helm--compute-sources normal-sources)) + ;; When no normal-sources erase buffer + ;; for the next possible delayed source + ;; or the already computed normal-source + ;; that is no more "updateable" (requires-pattern). + (unless normal-sources (erase-buffer)) + ;; Compute matches without rendering the sources. + (helm-log "Matches: %S" + (setq matches (helm--collect-matches normal-sources))) + ;; If computing matches finished and is not interrupted + ;; erase the helm-buffer and render results (Fix #1157). + (when matches + (erase-buffer) + (cl-loop for src in normal-sources + for mtc in matches + do (helm-render-source src mtc)))) (helm-log "Delayed sources = %S" (mapcar (lambda (s) (assoc-default 'name s)) delayed-sources)) @@ -3428,7 +3377,7 @@ is done on whole `helm-buffer' and not on current source." (if (or (assoc 'matchplugin source) (null (assoc 'no-matchplugin source))) ;; Don't count spaces entered when using - ;; match-plugin. + ;; multi-match. (replace-regexp-in-string " " "" helm-pattern) helm-pattern)))) (and (or (not helm-source-filter) @@ -3437,7 +3386,7 @@ is done on whole `helm-buffer' and not on current source." (helm-aif (assoc 'requires-pattern source) (or (cdr it) 1) 0)) ;; These incomplete regexps hang helm forever ;; so defer update. Maybe replace spaces quoted when using - ;; match-plugin-mode. + ;; multi-match. (not (member (replace-regexp-in-string "\\s\\ " " " helm-pattern) helm-update-blacklist-regexps))))) @@ -3458,12 +3407,16 @@ is done on whole `helm-buffer' and not on current source." (defun helm-force-update (&optional preselect) "Force recalculation and update of candidates. + The difference with `helm-update' is this function is reevaling the `init' and `update' attributes functions when present -before updating candidates according to pattern i.e calling `helm-update'. +before running `helm-update', also `helm-candidate-cache', +if some (async candidates are not cached) +is not reinitialized so that candidates are not recomputed +unless pattern have changed. + Selection is preserved to current candidate or moved to PRESELECT if specified." - (interactive) (let ((source (helm-get-current-source)) (selection (helm-get-selection nil t)) ;; `helm-goto-source' need to have all sources displayed @@ -3476,6 +3429,12 @@ if specified." (helm-update (or preselect selection) source) (with-helm-window (recenter)))) +(defun helm-refresh () + "Force recalculation and update of candidates." + (interactive) + (with-helm-alive-p + (helm-force-update))) + (defun helm-force-update--reinit (source) "Reinit SOURCE by calling his update and/or init functions." (helm-aif (helm-funcall-with-source @@ -3575,24 +3534,24 @@ after the source name by overlay." (cl-dolist (candidate (helm-transform-candidates (helm-output-filter--collect-candidates (split-string output-string "\n") - (assoc 'incomplete-line source) - source) + (assoc 'incomplete-line source)) source t)) - (when candidate ; filter-one-by-one may return nil candidates. - (if (assq 'multiline source) - (let ((start (point))) - (helm-insert-candidate-separator) - (helm-insert-match candidate 'insert-before-markers source - (1+ (cdr (assoc 'item-count source)))) - (put-text-property start (point) 'helm-multiline t)) + (setq candidate + (helm--maybe-process-filter-one-by-one-candidate candidate source)) + (if (assq 'multiline source) + (let ((start (point))) + (helm-insert-candidate-separator) (helm-insert-match candidate 'insert-before-markers source - (1+ (cdr (assoc 'item-count source))))) - (cl-incf (cdr (assoc 'item-count source))) - (when (>= (assoc-default 'item-count source) limit) - (helm-kill-async-process process) - (cl-return))))) - -(defun helm-output-filter--collect-candidates (lines incomplete-line-info source) + (1+ (cdr (assoc 'item-count source)))) + (put-text-property start (point) 'helm-multiline t)) + (helm-insert-match candidate 'insert-before-markers source + (1+ (cdr (assoc 'item-count source))))) + (cl-incf (cdr (assoc 'item-count source))) + (when (>= (assoc-default 'item-count source) limit) + (helm-kill-async-process process) + (cl-return)))) + +(defun helm-output-filter--collect-candidates (lines incomplete-line-info) "Collect LINES maybe completing the truncated first and last lines." ;; The output of process may come in chunks of any size, ;; so the last line of LINES come truncated, this truncated line is @@ -3603,17 +3562,21 @@ after the source name by overlay." (helm-log "incomplete-line-info = %S" (cdr incomplete-line-info)) (butlast (cl-loop for line in lines - ;; On start `incomplete-line-info' value is empty string. - for newline = (helm-aif (cdr incomplete-line-info) - (prog1 - (concat it line) - (setcdr incomplete-line-info nil)) - line) - do (helm--maybe-process-filter-one-by-one-candidate newline source) - collect newline - ;; Store last incomplete line (last chunk truncated) - ;; until new output arrives. - finally do (setcdr incomplete-line-info line)))) + ;; On start `incomplete-line-info' value is empty string. + for newline = (helm-aif (cdr incomplete-line-info) + (prog1 + (concat it line) + (setcdr incomplete-line-info nil)) + line) + collect newline + ;; Store last incomplete line (last chunk truncated) + ;; until new output arrives. + ;; Previously we were storing 'line' in incomplete-line-info + ;; assuming output is truncated in only two chunks, + ;; which may be wrong if output is very large and is truncated + ;; in more than two chunks, so store now 'newline' which + ;; contain the previous chunks (Issue #1187). + finally do (setcdr incomplete-line-info newline)))) (defun helm-output-filter--post-process () (let ((src (helm-get-current-source))) @@ -3652,7 +3615,7 @@ Meant to be called at beginning of a sentinel process function." (run-at-time (or (and (boundp 'tramp-connection-min-time-diff) tramp-connection-min-time-diff) 5) - nil #'(lambda () + nil (lambda () (when helm-alive-p ; Don't run timer fn after quit. (setq helm-suspend-update-flag nil) (helm-check-minibuffer-input)))))) @@ -3698,14 +3661,14 @@ If PRESERVE-SAVED-ACTION is non--nil save action." (let ((source (or helm-saved-current-source (helm-get-current-source))) non-essential) - (setq selection (or selection - (helm-get-selection) - (and (assoc 'accept-empty source) ""))) + (setq selection (helm-coerce-selection + (or selection + helm-saved-selection + (helm-get-selection) + (and (assoc 'accept-empty source) "")) + source)) (unless preserve-saved-action (setq helm-saved-action nil)) - (when (and selection action) - (helm-funcall-with-source - source action - (helm-coerce-selection selection source))))) + (when (and selection action) (funcall action selection)))) (defun helm-coerce-selection (selection source) "Apply coerce attribute function to SELECTION in SOURCE. @@ -3724,30 +3687,29 @@ Coerce source with coerce function." "Select an action for the currently selected candidate. If action buffer is selected, back to the helm buffer." (interactive) - (let ((src (helm-get-current-source))) - (helm-log-run-hook 'helm-select-action-hook) - (setq helm-saved-selection (helm-get-selection)) - (with-selected-frame (with-helm-window (selected-frame)) - (prog1 - (cond ((get-buffer-window helm-action-buffer 'visible) - (set-window-buffer (get-buffer-window helm-action-buffer) - helm-buffer) - (kill-buffer helm-action-buffer) - (helm-set-pattern helm-input 'noupdate)) - (helm-saved-selection - (setq helm-saved-current-source src) - (let ((actions (helm-get-actions-from-current-source))) - (if (functionp actions) - (message "Sole action: %s" actions) - (helm-show-action-buffer actions) - ;; Be sure the minibuffer is entirely deleted (#907). - (helm--delete-minibuffer-contents-from "") - ;; Make `helm-pattern' differs from the previous value. - (setq helm-pattern 'dummy) - (helm-check-minibuffer-input)))) - (t (message "No Actions available"))) - (helm-display-mode-line src) - (run-hooks 'helm-window-configuration-hook))))) + (helm-log-run-hook 'helm-select-action-hook) + (setq helm-saved-selection (helm-get-selection)) + (with-selected-frame (with-helm-window (selected-frame)) + (prog1 + (cond ((get-buffer-window helm-action-buffer 'visible) + (set-window-buffer (get-buffer-window helm-action-buffer) + helm-buffer) + (kill-buffer helm-action-buffer) + (helm-set-pattern helm-input 'noupdate)) + (helm-saved-selection + (setq helm-saved-current-source (helm-get-current-source)) + (let ((actions (helm-get-actions-from-current-source))) + (if (functionp actions) + (message "Sole action: %s" actions) + (helm-show-action-buffer actions) + ;; Be sure the minibuffer is entirely deleted (#907). + (helm--delete-minibuffer-contents-from "") + ;; Make `helm-pattern' differs from the previous value. + (setq helm-pattern 'dummy) + (helm-check-minibuffer-input)))) + (t (message "No Actions available"))) + (helm-display-mode-line (helm-get-current-source)) + (run-hooks 'helm-window-configuration-hook)))) (defun helm-show-action-buffer (actions) (with-current-buffer (get-buffer-create helm-action-buffer) @@ -3755,24 +3717,26 @@ If action buffer is selected, back to the helm buffer." (buffer-disable-undo) (set-window-buffer (get-buffer-window helm-buffer) helm-action-buffer) (set (make-local-variable 'helm-sources) - `(((name . "Actions") - (volatile) - (nomark) - (candidates . ,actions) - (mode-line . ("Action(s)" "TAB:BackToCands RET/f1/f2/fn:NthAct")) - (candidate-transformer - . (lambda (candidates) - (cl-loop for (i . j) in candidates - for count from 1 - collect - (cons (concat (cond ((> count 12) - " ") - ((< count 10) - (format "[f%s] " count)) - (t (format "[f%s] " count))) - (propertize i 'face 'helm-action)) - j)))) - (candidate-number-limit)))) + (list + (helm-build-sync-source "Actions" + :volatile t + :nomark t + :keymap 'helm-map + :candidates actions + :mode-line '("Action(s)" "TAB:BackToCands RET/f1/f2/fn:NthAct") + :candidate-transformer + (lambda (candidates) + (cl-loop for (i . j) in candidates + for count from 1 + collect + (cons (concat (cond ((> count 12) + " ") + ((< count 10) + (format "[f%s] " count)) + (t (format "[f%s] " count))) + (propertize i 'face 'helm-action)) + j))) + :candidate-number-limit nil))) (set (make-local-variable 'helm-source-filter) nil) (set (make-local-variable 'helm-selection-overlay) nil) (helm-initialize-overlays helm-action-buffer))) @@ -3816,19 +3780,32 @@ Possible value of DIRECTION are 'next or 'previous." (assoc-default 'mode-line source)) (default-value 'helm-mode-line-string)) source)) - (let ((follow (and (eq (cdr (assq 'follow source)) 1) "(HF) "))) + (let ((follow (and (eq (cdr (assq 'follow source)) 1) " (HF)")) + (marked (and helm-marked-candidates + (cl-loop with cur-name = (assoc-default 'name source) + for c in helm-marked-candidates + for name = (assoc-default 'name (car c)) + when (string= name cur-name) + collect c)))) ;; Setup mode-line. (if helm-mode-line-string (setq mode-line-format `(" " mode-line-buffer-identification " " - (:eval (format "L%d" (helm-candidate-number-at-point))) - " " ,follow + (:eval (format "L%-3d" (helm-candidate-number-at-point))) + ,follow + (:eval ,(and marked + (concat + " " + (propertize + (format "M%d" (length marked)) + 'face 'helm-visible-mark)))) (:eval (when ,helm--mode-line-display-prefarg (let ((arg (prefix-numeric-value (or prefix-arg current-prefix-arg)))) (unless (= arg 1) - (propertize (format "[prefarg:%s] " arg) + (propertize (format " [prefarg:%s]" arg) 'face 'helm-prefarg))))) + " " (:eval (helm-show-candidate-number (car-safe helm-mode-line-string))) " " helm--mode-line-string-real " " mode-line-end-spaces) @@ -3842,19 +3819,19 @@ Possible value of DIRECTION are 'next or 'previous." (setq force t) (helm--set-header-line)) (helm-display-header-line - (let* ((hlstr (helm-interpret-value + (let ((hlstr (helm-interpret-value (and (listp source) (assoc-default 'header-line source)) source)) - (hlend (make-string (max 0 (- (window-width) - (length hlstr))) ? ))) + (endstr (make-string (window-width) ? ))) (setq header-line-format - (propertize (concat " " hlstr hlend) 'face 'helm-header)))))) + (propertize (concat " " hlstr endstr) + 'face 'helm-header)))))) (when force (force-mode-line-update))) (defun helm--set-header-line (&optional update) (with-selected-window (minibuffer-window) - (let* ((beg (save-excursion (vertical-motion 0) (point))) + (let* ((beg (save-excursion (vertical-motion 0 (helm-window)) (point))) (end (save-excursion (end-of-visual-line) (point))) ;; The visual line where the cursor is. (cont (buffer-substring beg end)) @@ -3871,7 +3848,11 @@ Possible value of DIRECTION are 'next or 'previous." (put-text-property ;; Increment pos to handle the space before prompt (i.e `pref'). (1+ pos) (+ 2 pos) - 'face 'cursor header-line-format) + 'face ;don't just use 'cursor; this can hide the current character + (list :inverse-video t + :foreground (face-background 'cursor) + :background (face-background 'default)) + header-line-format) (when update (force-mode-line-update)))))) (defun helm--update-header-line () @@ -3897,11 +3878,15 @@ You can specify NAME of candidates e.g \"Buffers\" otherwise it is \"Candidate\(s\)\" by default." (when helm-alive-p (unless (helm-empty-source-p) - (propertize - (format "[%s %s]" - (helm-get-candidate-number 'in-current-source) - (or name "Candidate(s)")) - 'face 'helm-candidate-number)))) + ;; Build a fixed width string when candidate-number < 1000 + (let* ((cand-name (or name "Candidate(s)")) + (width (length (format "[999 %s]" cand-name)))) + (propertize + (format (concat "%-" (number-to-string width) "s") + (format "[%s %s]" + (helm-get-candidate-number 'in-current-source) + cand-name)) + 'face 'helm-candidate-number))))) (cl-defun helm-move-selection-common (&key where direction) "Move the selection marker to a new position. @@ -4030,7 +4015,13 @@ Key arg DIRECTION can be one of: (forward-line 1)) (defun helm-move--next-source-fn () - (goto-char (or (helm-get-next-header-pos) (point-min)))) + (goto-char (or (and (not (save-excursion + (forward-line 1) (eobp))) + ;; Empty source at eob are just + ;; not displayed unless they are dummy. + ;; Issue #1117. + (helm-get-next-header-pos)) + (point-min)))) (defun helm-move--goto-source-fn (source-or-name) (goto-char (point-min)) @@ -4052,7 +4043,9 @@ Key arg DIRECTION can be one of: (if (and arg (> arg 1)) (cl-loop with pos = (helm-candidate-number-at-point) with cand-num = (helm-get-candidate-number t) - with iter = (min arg (- cand-num pos)) + with iter = (min arg (if (eq direction 'next) + (- cand-num pos) + (min arg (1- pos)))) for count from 1 while (<= count iter) do @@ -4113,8 +4106,8 @@ current source (i.e don't move to next source if some)." (eq last-command 'helm-follow-action-backward) (eq last-command 'helm-execute-persistent-action)) (if (> arg 0) - (helm-next-line) - (helm-previous-line))) + (helm-next-line 1) + (helm-previous-line 1))) (helm-execute-persistent-action))) (defun helm-follow-action-forward () @@ -4300,6 +4293,24 @@ to a list of forms.\n\n") (pp-to-string (with-current-buffer helm-buffer (eval v))) "\n")) (message "Calculating all helm-related values...Done")) +;;;###autoload +(defun helm-debug-toggle () + "Enable/disable helm debug from outside of helm session." + (interactive) + (setq helm-debug (not helm-debug)) + (message "Helm Debug is now %s" + (if helm-debug "Enabled" "Disabled"))) + +(defun helm-enable-or-switch-to-debug () + "First hit enable helm debugging, second hit switch to debug buffer." + (interactive) + (with-helm-alive-p + (if helm-debug + (helm-run-after-exit + #'helm-debug-open-last-log) + (setq helm-debug t) + (message "Debugging enabled")))) + ;; Core: misc (defun helm-kill-buffer-hook () @@ -4334,7 +4345,9 @@ before the candidate we want to preselect." (when (helm-pos-multiline-p) (helm-move--beginning-of-multiline-candidate)) (when (helm-pos-header-line-p) (forward-line 1)) - (helm-mark-current-line))) + (helm-mark-current-line) + (helm-display-mode-line (helm-get-current-source)) + (helm-log-run-hook 'helm-after-preselection-hook))) (defun helm-delete-current-selection () "Delete the currently selected item." @@ -4403,23 +4416,8 @@ Used generally to modify current selection." `(helm-edit-current-selection-internal (lambda () ,@forms))) -(defun helm-set-pattern (pattern &optional noupdate) - "Set minibuffer contents to PATTERN. -if optional NOUPDATE is non-nil, helm buffer is not changed." - (with-selected-window (or (active-minibuffer-window) (minibuffer-window)) - (delete-minibuffer-contents) - (insert pattern)) - (when noupdate - (setq helm-pattern pattern))) - -(defun helm-minibuffer-completion-contents () - "Return the user input in a minibuffer before point as a string. -That is what completion commands operate on." - (buffer-substring (field-beginning) (point))) - (defun helm--delete-minibuffer-contents-from (from-str) ;; Giving an empty string value to FROM-STR delete all. - (require 'helm-utils) (let ((input (minibuffer-contents))) (helm-reset-yank-point) (if (> (length input) 0) @@ -4444,15 +4442,70 @@ When at end of minibuffer delete all." (helm--delete-minibuffer-contents-from str))) -;;; Plugins +;;; Plugins (Deprecated in favor of helm-types) ;; -;; Built-in plug-in: type +;; i.e Inherit instead of helm-type-* classes in your own classes. + +;; [DEPRECATED] Enable multi-match by default in old sources. +;; This is deprecated and will not run in sources +;; created by helm-source. +;; Keep it for backward compatibility with old sources. +(defun helm-compile-source--multi-match (source) + (if (assoc 'no-matchplugin source) + source + (let* ((searchers helm-mm-default-search-functions) + (defmatch (helm-aif (assoc-default 'match source) + (helm-mklist it))) + (defmatch-strict (helm-aif (assoc-default 'match-strict source) + (helm-mklist it))) + (defsearch (helm-aif (assoc-default 'search source) + (helm-mklist it))) + (defsearch-strict (helm-aif (assoc-default 'search-strict source) + (helm-mklist it))) + (matchfns (cond (defmatch-strict) + (defmatch + (append helm-mm-default-match-functions defmatch)) + (t helm-mm-default-match-functions))) + (searchfns (cond (defsearch-strict) + (defsearch + (append searchers defsearch)) + (t searchers)))) + `(,(if (assoc 'candidates-in-buffer source) + `(search ,@searchfns) `(match ,@matchfns)) + ,@source)))) + +(add-to-list 'helm-compile-source-functions 'helm-compile-source--multi-match) + (defun helm-compile-source--type (source) (helm-aif (assoc-default 'type source) (append source (assoc-default it helm-type-attributes) nil) source)) -;; `define-helm-type-attribute' is public API. +(defun define-helm-type-attribute (type definition &optional doc) + "Register type attribute of TYPE as DEFINITION with DOC. +DOC is displayed in `helm-type-attributes' docstring. + +Use this function is better than setting `helm-type-attributes' directly." + (cl-loop for i in definition do + ;; without `ignore-errors', error at emacs22 + (ignore-errors (setf i (delete nil i)))) + (helm-add-type-attribute type definition) + (and doc (helm-document-type-attribute type doc)) + nil) + +(defun helm-document-attribute (attribute short-doc &optional long-doc) + "Register ATTRIBUTE documentation introduced by plug-in. +SHORT-DOC is displayed beside attribute name. +LONG-DOC is displayed below attribute name and short documentation." + (declare (indent 2)) + (if long-doc + (setq short-doc (concat "(" short-doc ")")) + (setq long-doc short-doc + short-doc "")) + (add-to-list 'helm-attributes attribute t) + (put attribute 'helm-attrdoc + (concat "- " (symbol-name attribute) + " " short-doc "\n\n" long-doc "\n"))) (defun helm-add-type-attribute (type definition) (helm-aif (assq type helm-type-attributes) @@ -4486,24 +4539,31 @@ When at end of minibuffer delete all." ;; Built-in plug-in: candidates-in-buffer (defun helm-candidates-in-buffer (&optional source) - "Get candidates from the candidates buffer according to `helm-pattern'. + "The top level function used to store candidates in `helm-source-in-buffer'. + +Candidates are stored in a buffer generated internally by the function +`helm-candidate-buffer'. Each candidate must be placed in one line. +This function is meant to be used in candidates-in-buffer or candidates +attribute of an helm source. Especially fast for many (1000+) candidates. + +The buffer is created and feeded in the init attribute function of helm. + +e.g: + + (helm-build-in-buffer-source \"test\" + :init (lambda () + (helm-init-candidates-in-buffer + 'global '(foo foa fob bar baz)))) -BUFFER is `helm-candidate-buffer' by default. Each -candidate must be placed in one line. This function is meant to -be used in candidates-in-buffer or candidates attribute of an -helm source. Especially fast for many (1000+) candidates. +A shortcut can be used to simplify: + + (helm-build-in-buffer-source \"test\" + :data '(foo foa fob bar baz)) -eg. - '((name . \"many files\") - (init . (lambda () (with-current-buffer (helm-candidate-buffer 'local) - (insert-many-filenames)))) - (search re-search-forward) ; optional - (candidates-in-buffer) - (type . file)) +The usage of the `candidates-in-buffer' is deprecated in favor +of `helm-source-in-buffer' class. -+===============================================================+ -| The new way of making and narrowing candidates: Using buffers | -+===============================================================+ +It is anyway described below and provided for backward compatibility. By default, `helm' makes candidates by evaluating the candidates function, then narrows them by `string-match' for each @@ -4535,7 +4595,7 @@ And `(candidates-in-buffer . func)' is shortcut of three attributes: (match identity) The expansion is performed in `helm-get-sources'. -The candidates-in-buffer attribute implies the volatile attribute. +The `candidates-in-buffer' attribute implies the volatile attribute. The volatile attribute is needed because `helm-candidates-in-buffer' creates candidates dynamically and need to be called everytime `helm-pattern' changes. @@ -4543,7 +4603,7 @@ creates candidates dynamically and need to be called everytime Because `helm-candidates-in-buffer' plays the role of `match' attribute function, specifying `(match identity)' makes the source slightly faster. -However if source contain match-part attribute, match is computed only +However if source contain `match-part' attribute, match is computed only on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate. @@ -4590,6 +4650,7 @@ To customize `helm-candidates-in-buffer' behavior, use `search', (let (buffer-read-only matches newmatches + (item-count 0) (case-fold-search (helm-set-case-fold-search))) (helm--search-from-candidate-buffer-1 (lambda () @@ -4599,7 +4660,6 @@ To customize `helm-candidates-in-buffer' behavior, use `search', (forward-line 1) ; >>>[1] (setq newmatches nil) (cl-loop with pos-lst - with item-count = 0 while (and (setq pos-lst (funcall searcher pattern)) (not (eobp))) for cand = (apply get-line-fn @@ -4608,14 +4668,17 @@ To customize `helm-candidates-in-buffer' behavior, use `search', (list (point-at-bol) (point-at-eol)))) when (and (not (gethash cand helm-cib-hash)) (or - ;; Always collect when cand is matched by searcher funcs - ;; and match-part attr is not present. + ;; Always collect when cand is matched + ;; by searcher funcs and match-part attr + ;; is not present. (and (not match-part-fn) (not (consp pos-lst))) ;; If match-part attr is present, or if SEARCHER fn ;; returns a cons cell, collect PATTERN only if it - ;; match the part of CAND specified by the match-part func. - (helm-search-match-part cand pattern (or match-part-fn #'identity)))) + ;; match the part of CAND specified by + ;; the match-part func. + (helm-search-match-part + cand pattern (or match-part-fn #'identity)))) do (helm--accumulate-candidates cand newmatches helm-cib-hash item-count limit source)) (setq matches (append matches (nreverse newmatches)))) @@ -4624,24 +4687,26 @@ To customize `helm-candidates-in-buffer' behavior, use `search', (defun helm-search-match-part (candidate pattern match-part-fn) "Match PATTERN only on part of CANDIDATE returned by MATCH-PART-FN. Because `helm-search-match-part' maybe called even if unspecified -in source (negation), MATCH-PART-FN default to `identity' to match whole candidate. -When using fuzzy matching and negation (i.e \"!\"), this function is always called." +in source (negation), MATCH-PART-FN default to `identity' +to match whole candidate. +When using fuzzy matching and negation (i.e \"!\"), +this function is always called." (let ((part (funcall match-part-fn candidate)) - (fuzzy-regexp (cadr (gethash 'helm-pattern helm--fuzzy-regexp-cache)))) + (fuzzy-regexp (cadr (gethash 'helm-pattern helm--fuzzy-regexp-cache))) + (matchfn (if helm-migemo-mode + 'helm-mm-migemo-string-match 'string-match))) (if (string-match " " pattern) (cl-loop for i in (split-string pattern) always (if (string-match "\\`!" i) - (not (string-match (substring i 1) part)) - (string-match i part))) + (not (funcall matchfn (substring i 1) part)) + (funcall matchfn i part))) (if (string-match "\\`!" pattern) - (not (string-match (if helm--in-fuzzy - ;; Fuzzy regexp have already been - ;; computed with substring 1. - fuzzy-regexp - (substring 1 pattern)) - part)) - (string-match (if helm--in-fuzzy fuzzy-regexp pattern) - part))))) + (if helm--in-fuzzy + ;; Fuzzy regexp have already been + ;; computed with substring 1. + (not (string-match fuzzy-regexp part)) + (not (funcall matchfn (substring pattern 1) part))) + (funcall matchfn (if helm--in-fuzzy fuzzy-regexp pattern) part))))) (defun helm-initial-candidates-from-candidate-buffer (get-line-fn limit) (delq nil (cl-loop for i from 1 to limit @@ -4691,31 +4756,36 @@ Acceptable values of CREATE-OR-BUFFER: (local-bname (format " *helm candidates:%s*%s" helm-source-name (buffer-name helm-current-buffer))) - (register-func #'(lambda () - (setq helm-candidate-buffer-alist - (cons (cons helm-source-name create-or-buffer) - (delete (assoc helm-source-name - helm-candidate-buffer-alist) - helm-candidate-buffer-alist))))) - (kill-buffers-func #'(lambda () - (cl-loop for b in (buffer-list) - if (string-match (format "^%s" (regexp-quote global-bname)) - (buffer-name b)) - do (kill-buffer b)))) - (create-func #'(lambda () - (with-current-buffer - (get-buffer-create (if (eq create-or-buffer 'global) - global-bname - local-bname)) - (buffer-disable-undo) - (erase-buffer) - (font-lock-mode -1)))) - (return-func #'(lambda () - (or (get-buffer local-bname) - (get-buffer global-bname) - (helm-aif (assoc-default helm-source-name - helm-candidate-buffer-alist) - (and (buffer-live-p it) it)))))) + (register-func + (lambda () + (setq helm-candidate-buffer-alist + (cons (cons helm-source-name create-or-buffer) + (delete (assoc helm-source-name + helm-candidate-buffer-alist) + helm-candidate-buffer-alist))))) + (kill-buffers-func + (lambda () + (cl-loop for b in (buffer-list) + if (string-match (format "^%s" (regexp-quote global-bname)) + (buffer-name b)) + do (kill-buffer b)))) + (create-func + (lambda () + (with-current-buffer + (get-buffer-create (if (eq create-or-buffer 'global) + global-bname + local-bname)) + (set (make-local-variable 'inhibit-read-only) t) ; Fix (#1176) + (buffer-disable-undo) + (erase-buffer) + (font-lock-mode -1)))) + (return-func + (lambda () + (or (get-buffer local-bname) + (get-buffer global-bname) + (helm-aif (assoc-default helm-source-name + helm-candidate-buffer-alist) + (and (buffer-live-p it) it)))))) (when create-or-buffer (funcall register-func) (unless (bufferp create-or-buffer) @@ -4896,6 +4966,15 @@ Possible values are 'left 'right 'below or 'above." (t (error "Error in `helm-select-nth-action'")))) +(defun helm-execute-selection-action-at-nth (linum) + "Allow to execute default action on candidate at LINUM." + (let ((prefarg current-prefix-arg)) + (if (>= linum 0) + (helm-next-line linum) + (helm-previous-line (lognot (1- linum)))) + (setq current-prefix-arg prefarg) + (helm-exit-minibuffer))) + ;; Utility: Persistent Action (defmacro with-helm-display-same-window (&rest body) "Execute BODY in the window used for persistent action. @@ -5089,13 +5168,20 @@ Argument ACTION if present will be used as second argument of `display-buffer'." (helm-aif (helm-this-visible-mark) (helm-delete-visible-mark it) (helm-make-visible-mark)) - (unless (helm-end-of-source-p) - (helm-next-line)))))) + (if (helm-end-of-source-p) + (helm-display-mode-line (helm-get-current-source)) + (helm-next-line)))))) + +(defun helm-file-completion-source-p () + "Return non--nil if current source is a file completion source." + (or minibuffer-completing-file-name + (let ((cur-source (cdr (assoc 'name (helm-get-current-source))))) + (cl-loop for i in helm--file-completion-sources + thereis (string= cur-source i))))) (defun helm-mark-all () "Mark all visible unmarked candidates in current source." (interactive) - (require 'helm-files) (with-helm-window (let ((nomark (assq 'nomark (helm-get-current-source))) (follow (if helm-follow-mode 1 -1))) @@ -5158,6 +5244,7 @@ Argument ACTION if present will be used as second argument of `display-buffer'." (helm-clear-visible-mark)) (setq helm-marked-candidates nil) (helm-mark-current-line) + (helm-display-mode-line (helm-get-current-source)) (message "%s candidates unmarked" len)))) (defun helm-toggle-all-marks () @@ -5171,48 +5258,42 @@ visible or invisible in all sources of current helm session" (helm-unmark-all) (helm-mark-all)))) +(defun helm--compute-marked (real source wildcard) + (let* ((coerced (helm-coerce-selection real source)) + (wilds (and wildcard + (condition-case nil + (helm-file-expand-wildcards coerced t) + (error nil))))) + ;; Avoid returning a not expanded wilcard fname. + ;; e.g assuming "/tmp" doesn't contain "*.el" + ;; return nil when coerced is "/tmp/*.el". + (unless (or wilds (null wildcard) + (string-match-p helm--url-regexp coerced) + (file-exists-p coerced) + (and (stringp coerced) + (null (string-match-p "[[*?]" coerced)))) + (setq coerced nil)) + (or wilds (and coerced (list coerced))))) + (cl-defun helm-marked-candidates (&key with-wildcard) "Return marked candidates of current source if any. Otherwise one element list of current selection. When key WITH-WILDCARD is specified try to expand a wilcard if some." (with-current-buffer helm-buffer - (cl-loop with current-src = (helm-get-current-source) - for (source . real) in - (or (reverse helm-marked-candidates) - (list (cons current-src (helm-get-selection)))) - when (equal (assoc 'name current-src) - (assoc 'name source)) - ;; When real is a normal filename without wildcard - ;; file-expand-wildcards returns a list of one file. - ;; When real is a non--existent file it return nil. - append (let* ((elm (helm-coerce-selection real source)) - (c (and with-wildcard - (condition-case nil - (helm-file-expand-wildcards elm t) - (error nil))))) - (or c (list elm))) - into cands - finally do (prog1 (cl-return cands) - (helm-log "Marked candidates = %S" cands))))) - -(defun helm-file-expand-wildcards (pattern &optional full) - "Same as `file-expand-wildcards' but allow recursion. -Recursion happen when PATTERN starts with two stars. -Directories expansion is not supported." - (require 'helm-utils) - (let ((bn (helm-basename pattern))) - (if (and helm-file-globstar - (string-match "\\`\\*\\{2\\}\\(.*\\)" bn)) - (helm-walk-directory (helm-basedir pattern) - :path (cl-case full - (full 'full) - (relative 'relative) - ((basename nil) 'basename) - (t 'full)) - :directories nil - :match (wildcard-to-regexp bn) - :skip-subdirs t) - (file-expand-wildcards pattern full)))) + (let ((candidates + (cl-loop with current-src = (helm-get-current-source) + for (source . real) in (reverse helm-marked-candidates) + when (equal (assq 'name source) (assq 'name current-src)) + append (helm--compute-marked real source with-wildcard) + into cands + finally return (or cands + (append + (helm--compute-marked + (helm-get-selection) current-src + with-wildcard) + cands))))) + (helm-log "Marked candidates = %S" candidates) + candidates))) (defun helm-current-source-name= (name) (save-excursion @@ -5222,22 +5303,23 @@ Directories expansion is not supported." (defun helm-revive-visible-mark () "Restore marked candidates when helm update display." (with-current-buffer helm-buffer - (cl-dolist (o helm-visible-mark-overlays) - (goto-char (point-min)) - (while (and (search-forward (overlay-get o 'string) nil t) - (helm-current-source-name= (overlay-get o 'source))) - ;; Calculate real value of candidate. - ;; It can be nil if candidate have only a display value. - (let ((real (get-text-property (point-at-bol 0) 'helm-realvalue))) - (if real - ;; Check if real value of current candidate is the same - ;; than the one stored in overlay. - ;; This is needed when some cands have same display names. - ;; Using equal allow testing any type of value for real cand. - ;; Issue (#706). - (and (equal (overlay-get o 'real) real) - (move-overlay o (point-at-bol 0) (1+ (point-at-eol 0)))) - (move-overlay o (point-at-bol 0) (1+ (point-at-eol 0))))))))) + (save-excursion + (cl-dolist (o helm-visible-mark-overlays) + (goto-char (point-min)) + (while (and (search-forward (overlay-get o 'string) nil t) + (helm-current-source-name= (overlay-get o 'source))) + ;; Calculate real value of candidate. + ;; It can be nil if candidate have only a display value. + (let ((real (get-text-property (point-at-bol 0) 'helm-realvalue))) + (if real + ;; Check if real value of current candidate is the same + ;; than the one stored in overlay. + ;; This is needed when some cands have same display names. + ;; Using equal allow testing any type of value for real cand. + ;; Issue (#706). + (and (equal (overlay-get o 'real) real) + (move-overlay o (point-at-bol 0) (1+ (point-at-eol 0)))) + (move-overlay o (point-at-bol 0) (1+ (point-at-eol 0)))))))))) (add-hook 'helm-update-hook 'helm-revive-visible-mark) (defun helm-next-point-in-list (curpos points &optional prev) @@ -5293,10 +5375,13 @@ With a prefix arg set to real value of current selection. Display value is what you see in `helm-buffer' and real value is what is used to perform actions." (interactive "P") - (helm-run-after-quit + (helm-run-after-exit (lambda (sel) (kill-new sel) - (message "Killed: %s" sel)) + ;; Return nil to force `helm-mode--keyboard-quit' + ;; in `helm-comp-read' otherwise the value "Saved to kill-ring: foo" + ;; is used as exit value for `helm-comp-read'. + (prog1 nil (message "Saved to kill-ring: %s" sel) (sit-for 1))) (helm-get-selection nil (not arg)))) (defun helm-copy-to-buffer () @@ -5305,7 +5390,7 @@ is what is used to perform actions." (with-helm-buffer (cl-loop for cand in (helm-marked-candidates) do (with-helm-current-buffer - (insert cand "\n"))))) + (insert (format "%s\n" cand)))))) ;;; Follow-mode: Automatical execution of persistent-action @@ -5328,7 +5413,7 @@ in source in `helm-before-initialize-hook'. e.g: \(add-hook 'helm-before-initialize-hook - #'(lambda () (helm-attrset 'follow 1 helm-source-buffers-list))) + (lambda () (helm-attrset 'follow 1 helm-source-buffers-list))) This will enable `helm-follow-mode' automatically in `helm-source-buffers-list'." (interactive "p") @@ -5358,7 +5443,7 @@ This will enable `helm-follow-mode' automatically in `helm-source-buffers-list'. (message "helm-follow-mode is %s" (if helm-follow-mode "enabled" "disabled")) - (helm-display-mode-line src)) + (helm-display-mode-line src t)) (unless helm-follow-mode-persistent (and sym (set sym (remove (assq 'follow src) src))))) (message "Not enough candidates for helm-follow-mode"))))) @@ -5411,6 +5496,30 @@ See `fit-window-to-buffer' for more infos." (remove-hook 'helm-after-update-hook 'helm--autoresize-hook) (remove-hook 'helm-window-configuration-hook 'helm--autoresize-hook))) +(defun helm-help () + "Help of `helm'." + (interactive) + (with-helm-alive-p + (save-selected-window + (helm-help-internal + "*Helm Help*" + (lambda () + (helm-aif (assoc-default 'help-message (helm-get-current-source)) + (insert (substitute-command-keys + (helm-interpret-value it))) + (insert "* No specific help for this source at this time.\n +It may appear after first results popup in helm buffer.")) + (insert "\n\n" + (substitute-command-keys + (helm-interpret-value helm-help-message)))))))) + +(defun helm-toggle-truncate-line () + "Toggle `truncate-lines' value in `helm-buffer'" + (interactive) + (with-helm-alive-p + (with-helm-buffer + (setq truncate-lines (not truncate-lines)) + (helm-update (regexp-quote (helm-get-selection nil t)))))) (provide 'helm) -- 2.47.3