From aeef66423b42c53143701892183b1188bdea3840 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 14 Jul 2015 22:42:49 +0200 Subject: [PATCH] new version of helm. --- bba.org | 2 +- .../emacs-helm.sh | 15 +- .../helm-adaptive.el | 3 +- .../helm-aliases.el | 2 - .../helm-apt.el | 0 .../helm-autoloads.el | 251 +++++---- .../helm-bookmark.el | 0 .../helm-buffers.el | 89 ++- .../helm-color.el | 49 +- .../helm-command.el | 27 +- .../helm-config.el | 77 +-- .../helm-dabbrev.el | 99 ++-- elpa/helm-20150704.1247/helm-easymenu.el | 89 +++ .../helm-elisp-package.el | 70 ++- .../helm-elisp.el | 109 ++-- .../helm-elscreen.el | 0 .../helm-eshell.el | 4 +- .../helm-eval.el | 70 +-- .../helm-external.el | 0 .../helm-files.el | 478 ++++++++++------ .../helm-font.el | 0 .../helm-grep.el | 72 +-- .../helm-help.el | 91 ++- elpa/helm-20150704.1247/helm-id-utils.el | 116 ++++ .../helm-imenu.el | 135 ++++- .../helm-info.el | 0 .../helm-locate.el | 14 +- .../helm-man.el | 68 ++- .../helm-match-plugin.el | 0 .../helm-misc.el | 19 +- .../helm-mode.el | 109 ++-- .../helm-net.el | 88 +-- .../helm-org.el | 4 + .../helm-pkg.el | 4 +- .../helm-plugin.el | 0 .../helm-regexp.el | 15 +- .../helm-ring.el | 69 ++- .../helm-semantic.el | 40 +- .../helm-source.el | 71 +-- .../helm-sys.el | 1 + .../helm-tags.el | 6 +- .../helm-utils.el | 46 +- .../helm.el | 531 ++++++++++++------ 43 files changed, 1849 insertions(+), 1084 deletions(-) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/emacs-helm.sh (89%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-adaptive.el (99%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-aliases.el (99%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-apt.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-autoloads.el (84%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-bookmark.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-buffers.el (92%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-color.el (80%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-command.el (90%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-config.el (73%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-dabbrev.el (81%) create mode 100644 elpa/helm-20150704.1247/helm-easymenu.el rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-elisp-package.el (82%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-elisp.el (91%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-elscreen.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-eshell.el (98%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-eval.el (74%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-external.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-files.el (89%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-font.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-grep.el (96%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-help.el (94%) create mode 100644 elpa/helm-20150704.1247/helm-id-utils.el rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-imenu.el (50%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-info.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-locate.el (96%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-man.el (60%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-match-plugin.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-misc.el (95%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-mode.el (93%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-net.el (84%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-org.el (97%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-pkg.el (65%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-plugin.el (100%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-regexp.el (98%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-ring.el (85%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-semantic.el (85%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-source.el (94%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-sys.el (99%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-tags.el (97%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm-utils.el (96%) rename elpa/{helm-20150426.2119 => helm-20150704.1247}/helm.el (92%) diff --git a/bba.org b/bba.org index 3485937d..0646930b 100644 --- a/bba.org +++ b/bba.org @@ -1403,7 +1403,7 @@ Some links you might check out: (if (>= emacs-major-version 24) (progn (add-to-list 'load-path - "~/.emacs.d/elpa/helm-20150426.2119") + "~/.emacs.d/elpa/helm-20150704.1247") (require 'helm) (helm-mode 1) (global-set-key (kbd "M-y") 'helm-show-kill-ring) diff --git a/elpa/helm-20150426.2119/emacs-helm.sh b/elpa/helm-20150704.1247/emacs-helm.sh similarity index 89% rename from elpa/helm-20150426.2119/emacs-helm.sh rename to elpa/helm-20150704.1247/emacs-helm.sh index d24128da..f3e45a7a 100755 --- a/elpa/helm-20150426.2119/emacs-helm.sh +++ b/elpa/helm-20150704.1247/emacs-helm.sh @@ -20,9 +20,12 @@ # Preconfigured Emacs with a basic helm configuration. # Useful to start quickly an emacs -Q with helm. -# Run it from this directory. +# Run it from this directory or symlink it somewhere in your PATH. -TMP="/tmp/helm-cfg.el" +# If TEMP env var exists use it otherwise declare it. +[ -z $TEMP ] && declare TEMP="/tmp" + +CONF_FILE="$TEMP/helm-cfg.el" EMACS=emacs case $1 in @@ -54,13 +57,13 @@ if [ ! -e "$AUTO_FILE" ]; then fi -cat > $TMP < $CONF_FILE <\`helm-find-files'\n\ ;; - \`occur'(M-s o) =>\`helm-occur'\n\ @@ -89,8 +92,8 @@ cat > $TMP <\\[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 +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 @@ -184,10 +184,24 @@ Call `helm' with only ANY-SOURCES and ANY-BUFFER as args. ;;;*** -;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (21822 2333 +;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-adaptive.el +(defvar helm-adaptive-mode nil "\ +Non-nil if Helm-Adaptive mode is enabled. +See the command `helm-adaptive-mode' for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `helm-adaptive-mode'.") + +(custom-autoload 'helm-adaptive-mode "helm-adaptive" nil) + +(autoload 'helm-adaptive-mode "helm-adaptive" "\ +Toggle adaptive sorting in all sources. + +\(fn &optional ARG)" t nil) + (autoload 'helm-reset-adaptive-history "helm-adaptive" "\ Delete all `helm-adaptive-history' and his file. Useful when you have a old or corrupted `helm-adaptive-history-file'. @@ -196,7 +210,7 @@ Useful when you have a old or corrupted `helm-adaptive-history-file'. ;;;*** -;;;### (autoloads nil "helm-apt" "helm-apt.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-apt" "helm-apt.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-apt.el (autoload 'helm-apt "helm-apt" "\ @@ -207,7 +221,7 @@ With a prefix arg reload cache. ;;;*** -;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (21822 2333 +;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-bookmark.el @@ -230,7 +244,7 @@ only if external library addressbook-bookmark.el is available. ;;;*** -;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (21822 2333 +;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-buffers.el @@ -239,9 +253,14 @@ Preconfigured `helm' to list buffers. \(fn)" t nil) +(autoload 'helm-mini "helm-buffers" "\ +Preconfigured `helm' lightweight version (buffer -> recentf). + +\(fn)" t nil) + ;;;*** -;;;### (autoloads nil "helm-color" "helm-color.el" (21822 2333 0 +;;;### (autoloads nil "helm-color" "helm-color.el" (21913 4104 0 ;;;;;; 0)) ;;; Generated autoloads from helm-color.el @@ -252,7 +271,7 @@ Preconfigured `helm' for color. ;;;*** -;;;### (autoloads nil "helm-command" "helm-command.el" (21822 2333 +;;;### (autoloads nil "helm-command" "helm-command.el" (21913 4103 ;;;;;; 0 0)) ;;; Generated autoloads from helm-command.el @@ -269,7 +288,7 @@ You can get help on each command by persistent action. ;;;*** -;;;### (autoloads nil "helm-config" "helm-config.el" (21822 2333 +;;;### (autoloads nil "helm-config" "helm-config.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-config.el @@ -280,28 +299,28 @@ Customize `helm'. ;;;*** -;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (21822 2333 +;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-dabbrev.el (autoload 'helm-dabbrev "helm-dabbrev" "\ - +Preconfigured helm for dynamic abbreviations. \(fn)" t nil) ;;;*** -;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (21822 2333 0 +;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (21913 4104 0 ;;;;;; 0)) ;;; Generated autoloads from helm-elisp.el (autoload 'helm-lisp-completion-at-point "helm-elisp" "\ -Helm lisp symbol completion at point. +Preconfigured helm for lisp symbol completion at point. \(fn)" t nil) (autoload 'helm-complete-file-name-at-point "helm-elisp" "\ -Complete file name at point. +Preconfigured helm to complete file name at point. \(fn &optional FORCE)" t nil) @@ -311,7 +330,7 @@ Complete file name at point. \(fn)" t nil) (autoload 'helm-lisp-completion-or-file-name-at-point "helm-elisp" "\ -Complete lisp symbol or filename at point. +Preconfigured helm to complete lisp symbol or filename at point. Filename completion happen if string start after or between a double quote. \(fn)" t nil) @@ -327,7 +346,7 @@ Preconfigured `helm' to disable/enable function advices. \(fn)" t nil) (autoload 'helm-locate-library "helm-elisp" "\ - +Preconfigured helm to locate elisp libraries. \(fn)" t nil) @@ -337,29 +356,30 @@ Preconfigured `helm' for timers. \(fn)" t nil) (autoload 'helm-complex-command-history "helm-elisp" "\ - +Preconfigured helm for complex command history. \(fn)" t nil) ;;;*** ;;;### (autoloads nil "helm-elisp-package" "helm-elisp-package.el" -;;;;;; (21822 2333 0 0)) +;;;;;; (21913 4104 0 0)) ;;; Generated autoloads from helm-elisp-package.el (autoload 'helm-list-elisp-packages "helm-elisp-package" "\ - +Preconfigured helm for listing and handling emacs packages. \(fn ARG)" t nil) (autoload 'helm-list-elisp-packages-no-fetch "helm-elisp-package" "\ - +Preconfigured helm for emacs packages. +Same as `helm-list-elisp-packages' but don't fetch packages on remote. \(fn)" t nil) ;;;*** -;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (21822 2333 +;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (21913 4103 ;;;;;; 0 0)) ;;; Generated autoloads from helm-elscreen.el @@ -370,7 +390,7 @@ Preconfigured helm to list elscreen. ;;;*** -;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (21822 2333 +;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-eshell.el @@ -386,7 +406,7 @@ Preconfigured helm for eshell history. ;;;*** -;;;### (autoloads nil "helm-eval" "helm-eval.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-eval" "helm-eval.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-eval.el (autoload 'helm-eval-expression "helm-eval" "\ @@ -406,7 +426,7 @@ Preconfigured helm for `helm-source-calculation-result'. ;;;*** -;;;### (autoloads nil "helm-external" "helm-external.el" (21822 2333 +;;;### (autoloads nil "helm-external" "helm-external.el" (21913 4103 ;;;;;; 0 0)) ;;; Generated autoloads from helm-external.el @@ -420,14 +440,15 @@ You can set your own list of commands with ;;;*** -;;;### (autoloads nil "helm-files" "helm-files.el" (21822 2333 0 +;;;### (autoloads nil "helm-files" "helm-files.el" (21913 4104 0 ;;;;;; 0)) ;;; Generated autoloads from helm-files.el (autoload 'helm-browse-project "helm-files" "\ +Preconfigured helm to browse projects. Browse files and see status of project with its vcs. Only HG and GIT are supported for now. -Fall back to `helm-find-files' or `helm-browse-project-find-files' +Fall back to `helm-browse-project-find-files' if current directory is not under control of one of those vcs. With a prefix ARG browse files recursively, with two prefix ARG rebuild the cache. @@ -436,9 +457,11 @@ If the current directory is found in the cache, start NOTE: The prefix ARG have no effect on the VCS controlled directories. Needed dependencies for VCS: - + +and + and -. +. \(fn ARG)" t nil) @@ -462,7 +485,10 @@ Run all sources defined in `helm-for-files-preferred-list'. \(fn)" t nil) (autoload 'helm-multi-files "helm-files" "\ -Same as `helm-for-files' but allow toggling from locate to others sources. +Preconfigured helm similar to `helm-for-files' but that don't run locate. +Allow toggling from locate to others sources. +This allow seeing first if what you search is in other sources before launching +locate. \(fn)" t nil) @@ -473,7 +499,7 @@ Preconfigured `helm' for `recentf'. ;;;*** -;;;### (autoloads nil "helm-font" "helm-font.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-font" "helm-font.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-font.el (autoload 'helm-select-xfont "helm-font" "\ @@ -488,7 +514,7 @@ Preconfigured helm for `ucs-names' math symbols. ;;;*** -;;;### (autoloads nil "helm-grep" "helm-grep.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-grep" "helm-grep.el" (21913 4105 0 0)) ;;; Generated autoloads from helm-grep.el (autoload 'helm-goto-precedent-file "helm-grep" "\ @@ -501,47 +527,12 @@ Go to precedent file in helm grep/etags buffers. \(fn)" t nil) -(autoload 'helm-grep-run-save-buffer "helm-grep" "\ -Run grep save results action from `helm-do-grep-1'. - -\(fn)" t nil) - (autoload 'helm-grep-mode "helm-grep" "\ Major mode to provide actions in helm grep saved buffer. Special commands: \\{helm-grep-mode-map} -\(fn)" t nil) - -(autoload 'helm-gm-next-file "helm-grep" "\ - - -\(fn)" t nil) - -(autoload 'helm-gm-precedent-file "helm-grep" "\ - - -\(fn)" t nil) - -(autoload 'helm-grep-mode-jump "helm-grep" "\ - - -\(fn)" t nil) - -(autoload 'helm-grep-mode-jump-other-window-forward "helm-grep" "\ - - -\(fn)" t nil) - -(autoload 'helm-grep-mode-jump-other-window-backward "helm-grep" "\ - - -\(fn)" t nil) - -(autoload 'helm-grep-mode-jump-other-window "helm-grep" "\ - - \(fn)" t nil) (autoload 'helm-do-grep "helm-grep" "\ @@ -570,11 +561,11 @@ Preconfigured helm for pdfgrep. ;;;*** -;;;### (autoloads nil "helm-help" "helm-help.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-help" "helm-help.el" (21913 4103 0 0)) ;;; Generated autoloads from helm-help.el (autoload 'helm-documentation "helm-help" "\ -Helm documentation. +Preconfigured helm for helm documentation. With a prefix arg refresh the documentation. Find here the documentation of all sources actually documented. @@ -597,22 +588,22 @@ 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) @@ -642,47 +633,47 @@ 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) @@ -742,7 +733,22 @@ HELM-ATTRIBUTE should be a symbol. ;;;*** -;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (21822 2333 0 +;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (21913 4104 +;;;;;; 0 0)) +;;; Generated autoloads from helm-id-utils.el + +(autoload 'helm-gid "helm-id-utils" "\ +Preconfigured helm for `gid' command line of `ID-Utils'. +Need A database created with the command `mkid' +above `default-directory'. +Need id-utils as dependency which provide `mkid', `gid' etc... +See . + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (21913 4104 0 ;;;;;; 0)) ;;; Generated autoloads from helm-imenu.el @@ -751,9 +757,14 @@ Preconfigured `helm' for `imenu'. \(fn)" t nil) +(autoload 'helm-imenu-in-all-buffers "helm-imenu" "\ +Preconfigured helm for fetching imenu entries of all buffers. + +\(fn)" t nil) + ;;;*** -;;;### (autoloads nil "helm-info" "helm-info.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-info" "helm-info.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-info.el (autoload 'helm-info-at-point "helm-info" "\ @@ -764,7 +775,7 @@ With a prefix-arg insert symbol at point. ;;;*** -;;;### (autoloads nil "helm-locate" "helm-locate.el" (21822 2333 +;;;### (autoloads nil "helm-locate" "helm-locate.el" (21913 4103 ;;;;;; 0 0)) ;;; Generated autoloads from helm-locate.el @@ -793,7 +804,7 @@ Where db_path is a filename matched by ;;;*** -;;;### (autoloads nil "helm-man" "helm-man.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-man" "helm-man.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-man.el (autoload 'helm-man-woman "helm-man" "\ @@ -804,11 +815,11 @@ With a prefix arg reinitialize the cache. ;;;*** -;;;### (autoloads nil "helm-misc" "helm-misc.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-misc" "helm-misc.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-misc.el (autoload 'helm-browse-menubar "helm-misc" "\ -Helm interface to the menubar using lacarte.el. +Preconfigured helm to the menubar using lacarte.el. \(fn)" t nil) @@ -828,12 +839,7 @@ Preconfigured `helm' to execute ratpoison commands. \(fn)" t nil) (autoload 'helm-stumpwm-commands "helm-misc" "\ - - -\(fn)" t nil) - -(autoload 'helm-mini "helm-misc" "\ -Preconfigured `helm' lightweight version (buffer -> recentf). +Preconfigured helm for stumpwm commands. \(fn)" t nil) @@ -843,13 +849,13 @@ Preconfigured `helm' for `minibuffer-history'. \(fn)" t nil) (autoload 'helm-comint-input-ring "helm-misc" "\ -Predefined `helm' that provide completion of `comint' history. +Preconfigured `helm' that provide completion of `comint' history. \(fn)" t nil) ;;;*** -;;;### (autoloads nil "helm-mode" "helm-mode.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-mode" "helm-mode.el" (21913 4103 0 0)) ;;; Generated autoloads from helm-mode.el (autoload 'helm-comp-read "helm-mode" "\ @@ -971,7 +977,7 @@ Note: This mode is incompatible with Emacs23. ;;;*** -;;;### (autoloads nil "helm-net" "helm-net.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-net" "helm-net.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-net.el (autoload 'helm-surfraw "helm-net" "\ @@ -996,35 +1002,30 @@ Preconfigured `helm' for Wikipedia lookup with Wikipedia suggest. ;;;*** -;;;### (autoloads nil "helm-org" "helm-org.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-org" "helm-org.el" (21913 4105 0 0)) ;;; Generated autoloads from helm-org.el (autoload 'helm-org-agenda-files-headings "helm-org" "\ - +Preconfigured helm for org files headings. \(fn)" t nil) (autoload 'helm-org-in-buffer-headings "helm-org" "\ - +Preconfigured helm for org buffer headings. \(fn)" t nil) (autoload 'helm-org-capture-templates "helm-org" "\ - +Preconfigured helm for org templates. \(fn)" t nil) ;;;*** -;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (21822 2333 +;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-regexp.el -(autoload 'helm-moccur-run-save-buffer "helm-regexp" "\ -Run grep save results action from `helm-do-grep-1'. - -\(fn)" t nil) - (autoload 'helm-moccur-mode "helm-regexp" "\ Major mode to provide actions in helm moccur saved buffer. @@ -1072,9 +1073,25 @@ The prefix arg can be set before calling ;;;*** -;;;### (autoloads nil "helm-ring" "helm-ring.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-ring" "helm-ring.el" (21913 4103 0 0)) ;;; Generated autoloads from helm-ring.el +(defvar helm-push-mark-mode nil "\ +Non-nil if Helm-Push-Mark mode is enabled. +See the command `helm-push-mark-mode' for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `helm-push-mark-mode'.") + +(custom-autoload 'helm-push-mark-mode "helm-ring" nil) + +(autoload 'helm-push-mark-mode "helm-ring" "\ +Provide an improved version of `push-mark'. +Modify the behavior of `push-mark' to update +the `global-mark-ring' after each new visit. + +\(fn &optional ARG)" t nil) + (autoload 'helm-mark-ring "helm-ring" "\ Preconfigured `helm' for `helm-source-mark-ring'. @@ -1104,7 +1121,7 @@ First call open the kill-ring browser, next calls move to next line. \(fn)" t nil) (autoload 'helm-execute-kmacro "helm-ring" "\ -Keyboard macros with helm interface. +Preconfigured helm for keyboard macros. Define your macros with `f3' and `f4'. See (info \"(emacs) Keyboard Macros\") for detailed infos. This command is useful when used with persistent action. @@ -1113,7 +1130,7 @@ This command is useful when used with persistent action. ;;;*** -;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (21822 2333 +;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (21913 4104 ;;;;;; 0 0)) ;;; Generated autoloads from helm-semantic.el @@ -1124,7 +1141,7 @@ If ARG is supplied, pre-select symbol at point instead of current \(fn ARG)" t nil) (autoload 'helm-semantic-or-imenu "helm-semantic" "\ -Run `helm' with `semantic' or `imenu'. +Preconfigured helm for `semantic' or `imenu'. If ARG is supplied, pre-select symbol at point instead of current semantic tag in scope. @@ -1136,7 +1153,7 @@ Fill in the symbol at point by default. ;;;*** -;;;### (autoloads nil "helm-sys" "helm-sys.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-sys" "helm-sys.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-sys.el (autoload 'helm-top "helm-sys" "\ @@ -1150,13 +1167,13 @@ Preconfigured `helm' for emacs process. \(fn)" t nil) (autoload 'helm-xrandr-set "helm-sys" "\ - +Preconfigured helm for xrandr. \(fn)" t nil) ;;;*** -;;;### (autoloads nil "helm-tags" "helm-tags.el" (21822 2333 0 0)) +;;;### (autoloads nil "helm-tags" "helm-tags.el" (21913 4104 0 0)) ;;; Generated autoloads from helm-tags.el (autoload 'helm-etags-select "helm-tags" "\ @@ -1174,7 +1191,7 @@ This function aggregates three sources of tag files: ;;;*** -;;;### (autoloads nil "helm-utils" "helm-utils.el" (21822 2333 0 +;;;### (autoloads nil "helm-utils" "helm-utils.el" (21913 4103 0 ;;;;;; 0)) ;;; Generated autoloads from helm-utils.el @@ -1210,9 +1227,9 @@ grabs the entire symbol. ;;;*** -;;;### (autoloads nil nil ("helm-aliases.el" "helm-match-plugin.el" -;;;;;; "helm-pkg.el" "helm-plugin.el" "helm-source.el") (21822 3132 -;;;;;; 761426 0)) +;;;### (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)) ;;;*** diff --git a/elpa/helm-20150426.2119/helm-bookmark.el b/elpa/helm-20150704.1247/helm-bookmark.el similarity index 100% rename from elpa/helm-20150426.2119/helm-bookmark.el rename to elpa/helm-20150704.1247/helm-bookmark.el diff --git a/elpa/helm-20150426.2119/helm-buffers.el b/elpa/helm-20150704.1247/helm-buffers.el similarity index 92% rename from elpa/helm-20150426.2119/helm-buffers.el rename to elpa/helm-20150704.1247/helm-buffers.el index 6775f329..60a65057 100644 --- a/elpa/helm-20150426.2119/helm-buffers.el +++ b/elpa/helm-20150704.1247/helm-buffers.el @@ -75,6 +75,19 @@ Only buffer names are fuzzy matched when this is enabled, "Ignore checking for `file-exists-p' on remote files." :group 'helm-buffers :type 'boolean) + +(defcustom helm-buffers-truncate-lines t + "Truncate lines in `helm-buffers-list' when non--nil." + :group 'helm-buffers + :type 'boolean) + +(defcustom helm-mini-default-sources '(helm-source-buffers-list + helm-source-recentf + helm-source-buffer-not-found) + "Default sources list used in `helm-mini'." + :group 'helm-misc + :type '(repeat (choice symbol))) + ;;; Faces ;; @@ -162,6 +175,21 @@ Only buffer names are fuzzy matched when this is enabled, (defvar helm-buffers-list-cache nil) (defvar helm-buffer-max-len-mode nil) + +(defun helm-buffers-list--init () + ;; Issue #51 Create the list before `helm-buffer' creation. + (setq helm-buffers-list-cache (funcall (helm-attr 'buffer-list))) + (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))) + into len-mode + finally return (cons len-buf len-mode)))) + (unless (default-value 'helm-buffer-max-length) + (helm-set-local-variable 'helm-buffer-max-length (car result))) + (unless (default-value 'helm-buffer-max-len-mode) + (helm-set-local-variable 'helm-buffer-max-len-mode (cdr result))))) + (defclass helm-source-buffers (helm-source-sync helm-type-buffer) ((buffer-list :initarg :buffer-list @@ -169,24 +197,9 @@ Only buffer names are fuzzy matched when this is enabled, :custom function :documentation " A function with no arguments to create buffer list.") - (init :initform (lambda () - ;; Issue #51 Create the list before `helm-buffer' creation. - (setq helm-buffers-list-cache (funcall (helm-attr 'buffer-list))) - (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))) - into len-mode - finally return (cons len-buf len-mode)))) - (unless helm-buffer-max-length - (setq helm-buffer-max-length (car result))) - (unless helm-buffer-max-len-mode - ;; If a new buffer is longer that this value - ;; this value will be updated - (setq helm-buffer-max-len-mode (cdr result)))))) + (init :initform 'helm-buffers-list--init) (candidates :initform helm-buffers-list-cache) (matchplugin :initform nil) - ;(nohighlight :initform t) (match :initform 'helm-buffers-match-function) (persistent-action :initform 'helm-buffers-list-persistent-action) (resume :initform (lambda () @@ -320,9 +333,8 @@ See `ido-make-buffer-list' for more infos." (helm-buffer--show-details name name-prefix file-name size mode dir 'helm-buffer-saved-out 'helm-buffer-process nil details 'modout)) - ;; A new buffer file not already saved on disk.=>indianred2 - ((and file-name - (not (verify-visited-file-modtime buf))) + ;; A new buffer file not already saved on disk (or a deleted file) .=>indianred2 + ((and file-name (not (file-exists-p file-name))) (helm-buffer--show-details name name-prefix file-name size mode dir 'helm-buffer-not-saved 'helm-buffer-process nil details 'notsaved)) @@ -682,16 +694,20 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (defun helm-buffers-persistent-kill-1 (buffer) "Persistent action to kill buffer." - (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))) - (helm-delete-current-selection) - (with-helm-temp-hook 'helm-after-persistent-action-hook - (helm-force-update (regexp-quote (helm-get-selection nil t))))) + (if (eql (get-buffer buffer) (get-buffer helm-current-buffer)) + (progn + (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))) + (helm-delete-current-selection) + (with-helm-temp-hook 'helm-after-persistent-action-hook + (helm-force-update (regexp-quote (helm-get-selection nil t)))))) (defun helm-buffers--quote-truncated-buffer (buffer) (let ((bufname (and (bufferp buffer) @@ -841,7 +857,20 @@ displayed with the `file-name-shadow' face if available." helm-source-buffer-not-found) :buffer "*helm buffers*" :keymap helm-buffer-map - :truncate-lines t)) + :truncate-lines helm-buffers-truncate-lines)) + +;;;###autoload +(defun helm-mini () + "Preconfigured `helm' lightweight version \(buffer -> recentf\)." + (interactive) + (require 'helm-files) + (unless helm-source-buffers-list + (setq helm-source-buffers-list + (helm-make-source "Buffers" 'helm-source-buffers))) + (helm :sources helm-mini-default-sources + :buffer "*helm mini*" + :ff-transformer-show-only-basename nil + :truncate-lines helm-buffers-truncate-lines)) (provide 'helm-buffers) diff --git a/elpa/helm-20150426.2119/helm-color.el b/elpa/helm-20150704.1247/helm-color.el similarity index 80% rename from elpa/helm-20150426.2119/helm-color.el rename to elpa/helm-20150704.1247/helm-color.el index af4af763..7707c5d0 100644 --- a/elpa/helm-20150426.2119/helm-color.el +++ b/elpa/helm-20150704.1247/helm-color.el @@ -37,16 +37,15 @@ (kill-buffer "*Faces*"))) (defvar helm-source-customize-face - '((name . "Customize Face") - (init . helm-custom-faces-init) - (candidates-in-buffer) - (get-line . buffer-substring) - (action . (("Customize" - . (lambda (line) - (customize-face (intern (car (split-string line)))))) - ("Copy name" - . (lambda (line) - (kill-new (car (split-string line " " t)))))))) + (helm-build-in-buffer-source "Customize Face" + :init 'helm-custom-faces-init + :get-line 'buffer-substring + :action '(("Customize" + . (lambda (line) + (customize-face (intern (car (split-string line)))))) + ("Copy name" + . (lambda (line) + (kill-new (car (split-string line " " t))))))) "See (info \"(emacs)Faces\")") ;;; Colors browser @@ -108,19 +107,18 @@ map)) (defvar helm-source-colors - `((name . "Colors") - (init . helm-colors-init) - (candidates-in-buffer) - (get-line . buffer-substring) - (keymap . ,helm-color-map) - (persistent-help . "Kill entry in RGB format.") - (persistent-action . helm-color-kill-rgb) - (mode-line . helm-color-mode-line-string) - (action - ("Copy Name (C-c N)" . helm-color-kill-name) - ("Copy RGB (C-c R)" . helm-color-kill-rgb) - ("Insert Name (C-c n)" . helm-color-insert-name) - ("Insert RGB (C-c r)" . helm-color-insert-rgb)))) + (helm-build-in-buffer-source "Colors" + :init 'helm-colors-init + :get-line 'buffer-substring + :keymap helm-color-map + :persistent-help "Kill entry in RGB format." + :persistent-action 'helm-color-kill-rgb + :mode-line 'helm-color-mode-line-string + :action + '(("Copy Name (C-c N)" . helm-color-kill-name) + ("Copy RGB (C-c R)" . helm-color-kill-rgb) + ("Insert Name (C-c n)" . helm-color-insert-name) + ("Insert RGB (C-c r)" . helm-color-insert-rgb)))) (defun helm-colors-get-name (candidate) "Get color name." @@ -148,9 +146,8 @@ (defun helm-colors () "Preconfigured `helm' for color." (interactive) - (helm-other-buffer - '(helm-source-colors helm-source-customize-face) - "*helm colors*")) + (helm :sources '(helm-source-colors helm-source-customize-face) + :buffer "*helm colors*")) (provide 'helm-color) diff --git a/elpa/helm-20150426.2119/helm-command.el b/elpa/helm-20150704.1247/helm-command.el similarity index 90% rename from elpa/helm-20150426.2119/helm-command.el rename to elpa/helm-20150704.1247/helm-command.el index e17d2a0b..4a98e11d 100644 --- a/elpa/helm-20150426.2119/helm-command.el +++ b/elpa/helm-20150704.1247/helm-command.el @@ -143,10 +143,29 @@ fuzzy matching is running its own sort function with a different algorithm." (with-helm-window (helm-display-mode-line (helm-get-current-source) 'force)))) -(defun helm-M-x-read-extended-command () +(defun helm-cmd--get-current-function-name () + (save-excursion + (beginning-of-defun) + (cadr (split-string (buffer-substring-no-properties + (point-at-bol) (point-at-eol)))))) + +(defun helm-cmd--get-preconfigured-commands (&optional dir) + (let* ((helm-dir (or dir (helm-basedir (locate-library "helm")))) + (helm-autoload-file (expand-file-name "helm-autoloads.el" helm-dir)) + results) + (when (file-exists-p helm-autoload-file) + (with-temp-buffer + (insert-file-contents helm-autoload-file) + (while (re-search-forward "Preconfigured" nil t) + (push (substring (helm-cmd--get-current-function-name) 1) results)))) + results)) + +(defun helm-M-x-read-extended-command (&optional collection history) "Read command name to invoke in `helm-M-x'. Helm completion is not provided when executing or defining -kbd macros." +kbd macros. +Optional arg COLLECTION is to allow using another COLLECTION +than the default which is OBARRAY." (if (or defining-kbd-macro executing-kbd-macro) (if helm-mode (unwind-protect @@ -194,14 +213,14 @@ kbd macros." (user-error msg)) (setq current-prefix-arg nil) (helm-comp-read - "M-x " obarray + "M-x " (or collection obarray) :test 'commandp :requires-pattern helm-M-x-requires-pattern :name "Emacs Commands" :buffer "*helm M-x*" :persistent-action pers-help :persistent-help "Describe this command" - :history extended-command-history + :history (or history extended-command-history) :reverse-history helm-M-x-reverse-history :del-input nil :mode-line helm-M-x-mode-line diff --git a/elpa/helm-20150426.2119/helm-config.el b/elpa/helm-20150704.1247/helm-config.el similarity index 73% rename from elpa/helm-20150426.2119/helm-config.el rename to elpa/helm-20150704.1247/helm-config.el index 2d4eb23e..58e29e21 100644 --- a/elpa/helm-20150426.2119/helm-config.el +++ b/elpa/helm-20150704.1247/helm-config.el @@ -21,9 +21,11 @@ ;;; Require ;; ;; -(require 'easymenu) (require 'helm-aliases) -(require 'async-bytecomp nil t) +(declare-function async-bytecomp-package-mode "ext:async-bytecomp.el") +(when (require 'async-bytecomp nil t) + (and (fboundp 'async-bytecomp-package-mode) + (async-bytecomp-package-mode 1))) (defgroup helm-config nil @@ -81,6 +83,7 @@ (define-key map (kbd "t") 'helm-top) (define-key map (kbd "/") 'helm-find) (define-key map (kbd "i") 'helm-semantic-or-imenu) + (define-key map (kbd "I") 'helm-imenu-in-all-buffers) (define-key map (kbd "") 'helm-lisp-completion-at-point) (define-key map (kbd "p") 'helm-list-emacs-process) (define-key map (kbd "C-x r b") 'helm-filtered-bookmarks) @@ -105,6 +108,8 @@ (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 "@") 'helm-list-elisp-packages) map)) ;; Don't override the keymap we just defined with an empty @@ -116,60 +121,8 @@ ;;; Menu -;; -;; -(easy-menu-add-item - nil '("Tools") - '("Helm" - ["Find any Files/Buffers" helm-multi-files t] - ["Helm Everywhere (Toggle)" helm-mode t] - ["Helm resume" helm-resume t] - "----" - ("Files" - ["Find files" helm-find-files t] - ["Recent Files" helm-recentf t] - ["Locate" helm-locate t] - ["Search Files with find" helm-find t] - ["Bookmarks" helm-filtered-bookmarks t]) - ("Buffers" - ["Find buffers" helm-buffers-list t]) - ("Commands" - ["Emacs Commands" helm-M-x t] - ["Externals Commands" helm-run-external-command t]) - ("Help" - ["Helm Apropos" helm-apropos t]) - ("Info" - ["Info at point" helm-info-at-point t] - ["Emacs Manual index" helm-info-emacs t] - ["Gnus Manual index" helm-info-gnus t]) - ("Org" - ["Org keywords" helm-org-keywords t] - ["Org headlines" helm-org-headlines t]) - ("Tools" - ["Occur" helm-occur t] - ["Grep" helm-do-grep t] - ["Etags" helm-etags-select t] - ["Lisp complete at point" helm-lisp-completion-at-point t] - ["Browse Kill ring" helm-show-kill-ring t] - ["Browse register" helm-register t] - ["Mark Ring" helm-all-mark-rings t] - ["Regexp handler" helm-regexp t] - ["Colors & Faces" helm-colors t] - ["Show xfonts" helm-select-xfont t] - ["Ucs Symbols" helm-ucs t] - ["Imenu" helm-imenu t] - ["Semantic or Imenu" helm-semantic-or-imenu t] - ["Google Suggest" helm-google-suggest t] - ["Eval expression" helm-eval-expression-with-eldoc t] - ["Calcul expression" helm-calcul-expression t] - ["Man pages" helm-man-woman t] - ["Top externals process" helm-top t] - ["Emacs internals process" helm-list-emacs-process t]) - "----" - ["Preferred Options" helm-configuration t]) - "Spell Checking") - -(easy-menu-add-item nil '("Tools") '("----") "Spell Checking") + +(require 'helm-easymenu) ;;;###autoload @@ -198,18 +151,6 @@ ("(\\<\\(helm-while-no-input\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(helm-aif\\)\\>" 1 font-lock-keyword-face)))) - -;;; Compatibility emacs-24.4+ -;; Inlined from Emacs trunk. -(defalias 'function-put - ;; We don't want people to just use `put' because we can't conveniently - ;; hook into `put' to remap old properties to new ones. But for now, there's - ;; no such remapping, so we just call `put'. - #'(lambda (f prop value) (put f prop value)) - "Set function F's property PROP to VALUE. -The namespace for PROP is shared with symbols. -So far, F can only be a symbol, not a lambda expression.") - ;;; Load the autoload file ;; It should have been generated either by diff --git a/elpa/helm-20150426.2119/helm-dabbrev.el b/elpa/helm-20150704.1247/helm-dabbrev.el similarity index 81% rename from elpa/helm-20150426.2119/helm-dabbrev.el rename to elpa/helm-20150704.1247/helm-dabbrev.el index d71f9a70..08b525b9 100644 --- a/elpa/helm-20150426.2119/helm-dabbrev.el +++ b/elpa/helm-20150704.1247/helm-dabbrev.el @@ -106,7 +106,7 @@ but the initial search for all candidates in buffer(s)." (defvar helm-dabbrev--exclude-current-buffer-flag nil) (defvar helm-dabbrev--cache nil) (defvar helm-dabbrev--data nil) -(defvar helm-dabbrev--regexp "\\s-\\|\t\\|[(\[\{\"'`=<$;]\\|\\s\\\\|^\\|\\.") +(defvar helm-dabbrev--regexp "\\s-\\|\t\\|[(\[\{\"'`=<$;.]\\|\\s\\\\|^") (cl-defstruct helm-dabbrev-info dabbrev limits iterator) @@ -175,7 +175,8 @@ but the initial search for all candidates in buffer(s)." (point)))) (setq pos-before pos) (search-backward pattern pos t)))) - (let* ((match-1 (helm-aif (thing-at-point 'symbol) + (let* ((replace-regexp (concat "\\(" helm-dabbrev--regexp "\\)\\'")) + (match-1 (helm-aif (thing-at-point 'symbol) ;; `thing-at-point' returns ;; the quote outside of e-lisp mode, ;; e.g in message mode, @@ -184,11 +185,13 @@ but the initial search for all candidates in buffer(s)." ;; `foo' => foo ;; so remove it [1]. (replace-regexp-in-string - "[']\\'" "" (substring-no-properties it)))) + replace-regexp + "" (substring-no-properties it)))) (match-2 (helm-aif (thing-at-point 'filename) ;; Same as in [1]. (replace-regexp-in-string - "[']\\'" "" (substring-no-properties it)))) + replace-regexp + "" (substring-no-properties it)))) (lst (if (string= match-1 match-2) (list match-1) (list match-1 match-2)))) @@ -254,6 +257,7 @@ but the initial search for all candidates in buffer(s)." ;;;###autoload (defun helm-dabbrev () + "Preconfigured helm for dynamic abbreviations." (interactive) (let ((dabbrev (helm-thing-before-point nil helm-dabbrev--regexp)) (limits (helm-bounds-of-thing-before-point helm-dabbrev--regexp)) @@ -278,29 +282,31 @@ but the initial search for all candidates in buffer(s)." (unless (or cycling-disabled-p (helm-dabbrev-info-p helm-dabbrev--data)) (setq helm-dabbrev--cache (helm-dabbrev--get-candidates dabbrev)) - (setq helm-dabbrev--data (make-helm-dabbrev-info - :dabbrev dabbrev - :limits limits - :iterator - (helm-iter-list - (cl-loop for i in helm-dabbrev--cache when - (and i (string-match - (concat "^" (regexp-quote dabbrev)) i)) - collect i into selection - when (and selection - (= (length selection) - helm-dabbrev-cycle-threshold)) - ;; When selection len reach - ;; `helm-dabbrev-cycle-threshold' - ;; return selection. - return selection - ;; selection len never reach - ;; `helm-dabbrev-cycle-threshold' - ;; return selection. - finally return selection))))) + (setq helm-dabbrev--data + (make-helm-dabbrev-info + :dabbrev dabbrev + :limits limits + :iterator + (helm-iter-list + (cl-loop for i in helm-dabbrev--cache when + (and i (string-match + (concat "^" (regexp-quote dabbrev)) i)) + collect i into selection + when (and selection + (= (length selection) + helm-dabbrev-cycle-threshold)) + ;; When selection len reach + ;; `helm-dabbrev-cycle-threshold' + ;; return selection. + return selection + ;; selection len never reach + ;; `helm-dabbrev-cycle-threshold' + ;; return selection. + finally return selection))))) (let ((iter (and (helm-dabbrev-info-p helm-dabbrev--data) (helm-dabbrev-info-iterator helm-dabbrev--data))) deactivate-mark) + ;; Cycle until iterator is consumed. (helm-aif (and iter (helm-iter-next iter)) (progn (helm-insert-completion-at-point @@ -309,23 +315,34 @@ but the initial search for all candidates in buffer(s)." ;; Move already tried candidates to end of list. (setq helm-dabbrev--cache (append (remove it helm-dabbrev--cache) (list it)))) - (unless cycling-disabled-p - (delete-region (car limits) (point)) - (setq dabbrev (helm-dabbrev-info-dabbrev helm-dabbrev--data) - limits (helm-dabbrev-info-limits helm-dabbrev--data)) - (setq helm-dabbrev--data nil) - (insert dabbrev)) - (with-helm-show-completion (car limits) (cdr limits) - (helm :sources (helm-build-in-buffer-source "Dabbrev Expand" - :data helm-dabbrev--cache - :persistent-action 'ignore - :persistent-help "DoNothing" - :keymap helm-dabbrev-map - :action 'helm-dabbrev-default-action) - :buffer "*helm dabbrev*" - :input (concat "^" dabbrev " ") - :resume 'noresume - :allow-nest t)))))) + ;; If the length of candidates is only one when computed + ;; that's mean the unique matched item have already been + ;; inserted by the iterator, so no need to reinsert the old dabbrev, + ;; just let helm exiting with "No expansion found". + (let ((old-dabbrev (if (helm-dabbrev-info-p helm-dabbrev--data) + (helm-dabbrev-info-dabbrev helm-dabbrev--data) + dabbrev))) + (unless (cdr (all-completions old-dabbrev helm-dabbrev--cache)) + (setq cycling-disabled-p t)) + ;; Iterator is now empty, reset dabbrev to initial value + ;; and start helm completion. + (unless cycling-disabled-p + (setq dabbrev old-dabbrev + limits (helm-dabbrev-info-limits helm-dabbrev--data)) + (setq helm-dabbrev--data nil) + (delete-region (car limits) (point)) + (insert dabbrev)) + (with-helm-show-completion (car limits) (cdr limits) + (helm :sources (helm-build-in-buffer-source "Dabbrev Expand" + :data helm-dabbrev--cache + :persistent-action 'ignore + :persistent-help "DoNothing" + :keymap helm-dabbrev-map + :action 'helm-dabbrev-default-action) + :buffer "*helm dabbrev*" + :input (concat "^" dabbrev " ") + :resume 'noresume + :allow-nest t))))))) (provide 'helm-dabbrev) diff --git a/elpa/helm-20150704.1247/helm-easymenu.el b/elpa/helm-20150704.1247/helm-easymenu.el new file mode 100644 index 00000000..23f263bb --- /dev/null +++ b/elpa/helm-20150704.1247/helm-easymenu.el @@ -0,0 +1,89 @@ +;;; helm-easymenu.el --- Helm easymenu definitions. -*- lexical-binding: t -*- + +;; Copyright (C) 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 'easymenu) + +(easy-menu-add-item + nil '("Tools") + '("Helm" + ["Find any Files/Buffers" helm-multi-files t] + ["Helm Everywhere (Toggle)" helm-mode t] + ["Helm resume" helm-resume t] + "----" + ("Files" + ["Find files" helm-find-files t] + ["Recent Files" helm-recentf t] + ["Locate" helm-locate t] + ["Search Files with find" helm-find t] + ["Bookmarks" helm-filtered-bookmarks t]) + ("Buffers" + ["Find buffers" helm-buffers-list t]) + ("Commands" + ["Emacs Commands" helm-M-x t] + ["Externals Commands" helm-run-external-command t]) + ("Help" + ["Helm Apropos" helm-apropos t]) + ("Info" + ["Info at point" helm-info-at-point t] + ["Emacs Manual index" helm-info-emacs t] + ["Gnus Manual index" helm-info-gnus t]) + ("Org" + ["Org keywords" helm-org-keywords t] + ["Org headlines" helm-org-headlines 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] + ["Gid" helm-gid t] + ["Etags" helm-etags-select t] + ["Lisp complete at point" helm-lisp-completion-at-point t] + ["Browse Kill ring" helm-show-kill-ring t] + ["Browse register" helm-register t] + ["Mark Ring" helm-all-mark-rings t] + ["Regexp handler" helm-regexp t] + ["Colors & Faces" helm-colors t] + ["Show xfonts" helm-select-xfont t] + ["Ucs Symbols" helm-ucs t] + ["Imenu" helm-imenu t] + ["Imenu all" helm-imenu-in-all-buffers t] + ["Semantic or Imenu" helm-semantic-or-imenu t] + ["Google Suggest" helm-google-suggest t] + ["Eval expression" helm-eval-expression-with-eldoc t] + ["Calcul expression" helm-calcul-expression t] + ["Man pages" helm-man-woman t] + ["Top externals process" helm-top t] + ["Emacs internals process" helm-list-emacs-process t]) + "----" + ["Preferred Options" helm-configuration t]) + "Spell Checking") + +(easy-menu-add-item nil '("Tools") '("----") "Spell Checking") + + +(provide 'helm-easymenu) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-easymenu.el ends here diff --git a/elpa/helm-20150426.2119/helm-elisp-package.el b/elpa/helm-20150704.1247/helm-elisp-package.el similarity index 82% rename from elpa/helm-20150426.2119/helm-elisp-package.el rename to elpa/helm-20150704.1247/helm-elisp-package.el index dfb33a30..32d95140 100644 --- a/elpa/helm-20150426.2119/helm-elisp-package.el +++ b/elpa/helm-20150704.1247/helm-elisp-package.el @@ -66,6 +66,24 @@ (package-desc-name id) (car id))))) +(defun helm-el-package-visit-homepage (candidate) + (let* ((id (get-text-property 0 'tabulated-list-id candidate)) + (pkg (if (fboundp 'package-desc-name) (package-desc-name id) + (car id))) + (desc (cadr (assoc pkg package-archive-contents))) + (extras (package-desc-extras desc)) + (url (and (listp extras) (cdr-safe (assoc :url extras))))) + (if (stringp url) + (browse-url url) + (message "Package %s has no homepage" + (propertize (symbol-name pkg) + 'face 'font-lock-keyword-face))))) + +(defun helm-el-run-visit-homepage () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-el-package-visit-homepage))) + (defun helm-el-package-install-1 (pkg-list) (cl-loop with mkd = pkg-list for p in mkd @@ -96,6 +114,11 @@ (defun helm-el-package-install (_candidate) (helm-el-package-install-1 (helm-marked-candidates))) +(defun helm-el-run-package-install () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-el-package-install))) + (defun helm-el-package-uninstall-1 (pkg-list) (cl-loop with mkd = pkg-list for p in mkd @@ -139,6 +162,11 @@ (defun helm-el-package-uninstall (_candidate) (helm-el-package-uninstall-1 (helm-marked-candidates))) +(defun helm-el-run-package-uninstall () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-el-package-uninstall))) + (defun helm-el-package-menu--find-upgrades () (cl-loop for entry in helm-el-package--tabulated-list for pkg-desc = (car entry) @@ -184,6 +212,11 @@ if (member (symbol-name (package-desc-name pkg)) pkgs) collect p))) +(defun helm-el-run-package-upgrade () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-el-package-upgrade))) + (defun helm-el-package-upgrade-all () (if helm-el-package--upgrades (with-helm-display-marked-candidates @@ -193,6 +226,11 @@ (helm-el-package-upgrade-1 helm-el-package--tabulated-list))) (message "No packages to upgrade actually!"))) +(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)) @@ -249,9 +287,16 @@ (defvar helm-el-package-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) - (define-key map (kbd "M-I") 'helm-el-package-show-installed) - (define-key map (kbd "M-U") 'helm-el-package-show-upgrade) - (define-key map (kbd "M-A") 'helm-el-package-show-all) + (define-key map (kbd "M-I") 'helm-el-package-show-installed) + (define-key map (kbd "M-O") 'helm-el-package-show-uninstalled) + (define-key map (kbd "M-U") 'helm-el-package-show-upgrade) + (define-key map (kbd "M-A") 'helm-el-package-show-all) + (define-key map (kbd "C-c i") 'helm-el-run-package-install) + (define-key map (kbd "C-c r") 'helm-el-run-package-reinstall) + (define-key map (kbd "C-c d") 'helm-el-run-package-uninstall) + (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)) @@ -271,16 +316,17 @@ actions))) (cond ((cdr (assq (package-desc-name pkg-desc) helm-el-package--upgrades)) - (append '(("Upgrade package" . helm-el-package-upgrade)) acts)) + (append '(("Upgrade package(s)" . helm-el-package-upgrade)) acts)) ((package-installed-p (package-desc-name pkg-desc)) - (append acts '(("Reinstall package" . helm-el-package-reinstall) - ("Uninstall" . helm-el-package-uninstall)))) - (t (append acts '(("Install" . helm-el-package-install)))))))) + (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) (keymap :initform helm-el-package-map) (update :initform 'helm-el-package--update) (candidate-number-limit :initform 9999) - (action :initform '(("Describe" . helm-el-package-describe))))) + (action :initform '(("Describe package" . helm-el-package-describe) + ("Visit homepage" . helm-el-package-visit-homepage))))) (defun helm-el-package--update () (setq helm-el-package--initialized-p nil)) @@ -294,8 +340,14 @@ (package-delete pkg-desc) (package-install name)))) +(defun helm-el-run-package-reinstall () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-el-package-reinstall))) + ;;;###autoload (defun helm-list-elisp-packages (arg) + "Preconfigured helm for listing and handling emacs packages." (interactive "P") (when arg (setq helm-el-package--initialized-p nil)) (unless helm-source-list-el-package @@ -306,6 +358,8 @@ ;;;###autoload (defun helm-list-elisp-packages-no-fetch () + "Preconfigured helm for emacs packages. +Same as `helm-list-elisp-packages' but don't fetch packages on remote." (interactive) (let ((helm-el-package--initialized-p t)) (helm-list-elisp-packages nil))) diff --git a/elpa/helm-20150426.2119/helm-elisp.el b/elpa/helm-20150704.1247/helm-elisp.el similarity index 91% rename from elpa/helm-20150426.2119/helm-elisp.el rename to elpa/helm-20150704.1247/helm-elisp.el index c7dc5813..156b879f 100644 --- a/elpa/helm-20150426.2119/helm-elisp.el +++ b/elpa/helm-20150704.1247/helm-elisp.el @@ -107,6 +107,15 @@ fuzzy completion is not available in `completion-at-point'." "Face used for showing info in `helm-lisp-completion'." :group 'helm-elisp-faces) +(defcustom helm-elisp-help-function + 'helm-elisp-show-doc-modeline + "Function for displaying help for lisp symbols." + :group 'helm-elisp + :type '(choice (function :tag "Open help for the symbol." + helm-elisp-show-help) + (function :tag "Show one liner in modeline." + helm-elisp-show-doc-modeline))) + ;;; Show completion. ;; @@ -142,7 +151,8 @@ fuzzy completion is not available in `completion-at-point'." (recenter -1) (set-window-buffer (if (active-minibuffer-window) (minibuffer-selected-window) - (split-window nil upper-height)) + (split-window nil upper-height + helm-split-window-default-side)) buffer))))) (defmacro with-helm-show-completion (beg end &rest body) @@ -254,7 +264,7 @@ Return a cons \(beg . end\)." (defvar helm-lgst-len nil) ;;;###autoload (defun helm-lisp-completion-at-point () - "Helm lisp symbol completion at point." + "Preconfigured helm for lisp symbol completion at point." (interactive) (setq helm-lgst-len 0) (let* ((target (helm-thing-before-point)) @@ -284,7 +294,8 @@ Return a cons \(beg . end\)." :nomark t :fuzzy-match helm-lisp-fuzzy-completion :persistent-help "Show brief doc in mode-line" - :filtered-candidate-transformer 'helm-lisp-completion-transformer + :filtered-candidate-transformer + 'helm-lisp-completion-transformer :action `(lambda (candidate) (with-helm-current-buffer (run-with-timer @@ -299,6 +310,21 @@ Return a cons \(beg . end\)." (message "[No Match]")))) (defun helm-lisp-completion-persistent-action (candidate) + "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)) + +(defun helm-elisp-show-help (candidate) + "Show full help for the function." + (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) + "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 @@ -325,13 +351,10 @@ Return a cons \(beg . end\)." (defun helm-get-first-line-documentation (sym) "Return first line documentation of symbol SYM. If SYM is not documented, return \"Not documented\"." - (let ((doc (cond ((fboundp sym) - (documentation sym t)) - ((boundp sym) - (documentation-property sym 'variable-documentation t)) - ((facep sym) - (face-documentation sym)) - (t nil)))) + (let ((doc (cl-typecase sym + (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. @@ -345,7 +368,7 @@ If SYM is not documented, return \"Not documented\"." ;;;###autoload (defun helm-complete-file-name-at-point (&optional force) - "Complete file name at point." + "Preconfigured helm to complete file name at point." (interactive) (require 'helm-mode) (let* ((tap (thing-at-point 'filename)) @@ -356,7 +379,7 @@ If SYM is not documented, return \"Not documented\"." (end-of-line) (search-backward tap (point-at-bol) t) (setq beg (point)) - (looking-back "[^'`( ]" 1))) + (looking-back "[^'`( ]" (1- (point))))) (expand-file-name (substring-no-properties tap)))) (end (point)) @@ -383,14 +406,14 @@ If SYM is not documented, return \"Not documented\"." ;;;###autoload (defun helm-lisp-completion-or-file-name-at-point () - "Complete lisp symbol or filename at point. + "Preconfigured helm to complete lisp symbol or filename at point. Filename completion happen if string start after or between a double quote." (interactive) (let* ((tap (thing-at-point 'filename))) (if (and tap (save-excursion (end-of-line) (search-backward tap (point-at-bol) t) - (looking-back "[^'`( ]" 1))) + (looking-back "[^'`( ]" (1- (point))))) (helm-complete-file-name-at-point) (helm-lisp-completion-at-point)))) @@ -530,17 +553,20 @@ Filename completion happen if string start after or between a double quote." ("Find Function" . helm-find-function) ("Info lookup" . helm-info-lookup-symbol)))) -(defun helm-info-lookup-symbol (candidate) +(defun helm-info-lookup-symbol-1 (c) (let ((helm-execute-action-at-once-if-one t) (helm-quit-if-no-candidate `(lambda () - (message "`%s' Not Documented as a symbol" ,candidate)))) + (message "`%s' Not Documented as a symbol" ,c)))) (helm :sources '(helm-source-info-elisp helm-source-info-cl helm-source-info-eieio) :resume 'noresume :buffer "*helm lookup*" - :input candidate))) + :input c))) + +(defun helm-info-lookup-symbol (candidate) + (run-with-timer 0.01 nil #'helm-info-lookup-symbol-1 candidate)) ;;;###autoload (defun helm-apropos () @@ -627,6 +653,7 @@ Filename completion happen if string start after or between a double quote." ;;;###autoload (defun helm-locate-library () + "Preconfigured helm to locate elisp libraries." (interactive) (helm :sources (helm-build-in-buffer-source "Elisp libraries (Scan)" :data (lambda () (helm-locate-library-scan-list)) @@ -650,53 +677,6 @@ Filename completion happen if string start after or between a double quote." (prin1-to-string val) (format "'%s" (prin1-to-string val))))))) - -;;; Type attributes -;; -;; -(let ((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)))) - (define-helm-type-attribute 'command - `((action ("Call interactively" . helm-call-interactively) - ,@actions) - (coerce . helm-symbolify) - (persistent-action . describe-function)) - "Command. (string or symbol)") - - (define-helm-type-attribute 'function - `((action . ,actions) - (action-transformer helm-transform-function-call-interactively) - (candidate-transformer helm-mark-interactive-functions) - (coerce . helm-symbolify)) - "Function. (string or symbol)")) - -(define-helm-type-attribute 'variable - '((action - ("Describe variable" . describe-variable) - ("Add variable to kill ring" . helm-kill-new) - ("Go to variable's definition" . find-variable) - ("Set variable" . helm-set-variable)) - (coerce . helm-symbolify)) - "Variable.") - -(define-helm-type-attribute 'timer - '((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))))) - (persistent-action . (lambda (tm) (describe-function (timer--function tm)))) - (persistent-help . "Describe Function")) - "Timer.") - ;;; Elisp Timers. ;; @@ -814,6 +794,7 @@ Filename completion happen if string start after or between a double quote." ;;;###autoload (defun helm-complex-command-history () + "Preconfigured helm for complex command history." (interactive) (helm :sources 'helm-source-complex-command-history :buffer "*helm complex commands*")) diff --git a/elpa/helm-20150426.2119/helm-elscreen.el b/elpa/helm-20150704.1247/helm-elscreen.el similarity index 100% rename from elpa/helm-20150426.2119/helm-elscreen.el rename to elpa/helm-20150704.1247/helm-elscreen.el diff --git a/elpa/helm-20150426.2119/helm-eshell.el b/elpa/helm-20150704.1247/helm-eshell.el similarity index 98% rename from elpa/helm-20150426.2119/helm-eshell.el rename to elpa/helm-20150704.1247/helm-eshell.el index 7b164a0b..2b0deed9 100644 --- a/elpa/helm-20150426.2119/helm-eshell.el +++ b/elpa/helm-20150704.1247/helm-eshell.el @@ -178,7 +178,7 @@ The function that call this should set `helm-ec-target' to thing at point." (args (catch 'eshell-incomplete (eshell-parse-arguments beg end))) (target - (or (and (looking-back " " 1) " ") + (or (and (looking-back " " (1- (point))) " ") (buffer-substring-no-properties (save-excursion (eshell-backward-argument 1) (point)) @@ -232,7 +232,7 @@ The function that call this should set `helm-ec-target' to thing at point." :resume 'noresume :input input)) (when (and flag-empty - (looking-back " " 1)) + (looking-back " " (1- (point)))) (delete-char -1))))) (provide 'helm-eshell) diff --git a/elpa/helm-20150426.2119/helm-eval.el b/elpa/helm-20150704.1247/helm-eval.el similarity index 74% rename from elpa/helm-20150426.2119/helm-eval.el rename to elpa/helm-20150704.1247/helm-eval.el index 183c570b..175a2673 100644 --- a/elpa/helm-20150426.2119/helm-eval.el +++ b/elpa/helm-20150704.1247/helm-eval.el @@ -19,6 +19,7 @@ (require 'cl-lib) (require 'helm) (require 'eldoc) +(require 'edebug) (defgroup helm-eval nil @@ -48,9 +49,9 @@ Should take one arg: the string to display." (eldoc-fnsym-in-current-sexp . elisp--fnsym-in-current-sexp) (eldoc-get-fnsym-args-string . - elisp--get-fnsym-args-string) + elisp-get-fnsym-args-string) (eldoc-get-var-docstring . - elisp--get-var-docstring)) + elisp-get-var-docstring)) unless (fboundp f) do (defalias f a)) ;; Emacs-24. @@ -79,28 +80,27 @@ Should take one arg: the string to display." (define-key map (kbd "") 'backward-char) map)) -(defvar helm-source-evaluation-result - '((name . "Evaluation Result") - (init . (lambda () (require 'edebug))) - (dummy) - (multiline) - (mode-line . "C-RET: nl-and-indent, tab: reindent, C-tab:complete, C-p/n: next/prec-line.") - (filtered-candidate-transformer . (lambda (candidates _source) - (list - (condition-case nil - (with-helm-current-buffer - (pp-to-string - (if edebug-active - (edebug-eval-expression - (read helm-pattern)) +(defun helm-build-evaluation-result-source () + (helm-build-dummy-source "Evaluation Result" + :multiline t + :mode-line "C-RET: nl-and-indent, M-tab: reindent, C-tab:complete, C-p/n: next/prec-line." + :filtered-candidate-transformer (lambda (_candidates _source) + (list + (condition-case nil + (with-helm-current-buffer + (pp-to-string + (if edebug-active + (edebug-eval-expression + (read helm-pattern)) (eval (read helm-pattern))))) - (error "Error"))))) - (action . (("Copy result to kill-ring" . (lambda (candidate) - (kill-new - (replace-regexp-in-string - "\n" "" candidate)))) - ("copy sexp to kill-ring" . (lambda (candidate) - (kill-new helm-input))))))) + (error "Error")))) + :nohighlight t + :action '(("Copy result to kill-ring" . (lambda (candidate) + (kill-new + (replace-regexp-in-string + "\n" "" candidate)))) + ("copy sexp to kill-ring" . (lambda (_candidate) + (kill-new helm-input)))))) (defun helm-eval-new-line-and-indent () (interactive) @@ -118,7 +118,7 @@ Should take one arg: the string to display." (when (member buf helm-eldoc-active-minibuffers-list) (with-current-buffer buf (let* ((sym (save-excursion - (unless (looking-back ")\\|\"" 1) + (unless (looking-back ")\\|\"" (1- (point))) (forward-char -1)) (eldoc-current-symbol))) (info-fn (eldoc-fnsym-in-current-sexp)) @@ -141,22 +141,23 @@ Should take one arg: the string to display." ;; ;; (defvar helm-source-calculation-result - '((name . "Calculation Result") - (dummy) - (filtered-candidate-transformer . (lambda (candidates _source) - (list - (condition-case nil - (calc-eval helm-pattern) - (error "error"))))) - (action ("Copy result to kill-ring" . kill-new)))) + (helm-build-dummy-source "Calculation Result" + :filtered-candidate-transformer (lambda (_candidates _source) + (list + (condition-case nil + (calc-eval helm-pattern) + (error "error")))) + :nohighlight t + :action '(("Copy result to kill-ring" . kill-new)))) ;;;###autoload (defun helm-eval-expression (arg) "Preconfigured helm for `helm-source-evaluation-result'." (interactive "P") - (helm :sources 'helm-source-evaluation-result + (helm :sources (helm-build-evaluation-result-source) :input (when arg (thing-at-point 'sexp)) :buffer "*helm eval*" + :echo-input-in-header-line nil :history 'read-expression-history :keymap helm-eval-expression-map)) @@ -180,7 +181,8 @@ Should take one arg: the string to display." (defun helm-calcul-expression () "Preconfigured helm for `helm-source-calculation-result'." (interactive) - (helm-other-buffer 'helm-source-calculation-result "*helm calcul*")) + (helm :sources 'helm-source-calculation-result + :buffer "*helm calcul*")) (provide 'helm-eval) diff --git a/elpa/helm-20150426.2119/helm-external.el b/elpa/helm-20150704.1247/helm-external.el similarity index 100% rename from elpa/helm-20150426.2119/helm-external.el rename to elpa/helm-20150704.1247/helm-external.el diff --git a/elpa/helm-20150426.2119/helm-files.el b/elpa/helm-20150704.1247/helm-files.el similarity index 89% rename from elpa/helm-20150426.2119/helm-files.el rename to elpa/helm-20150704.1247/helm-files.el index 4a10a739..71ba3180 100644 --- a/elpa/helm-20150426.2119/helm-files.el +++ b/elpa/helm-20150704.1247/helm-files.el @@ -44,8 +44,11 @@ (declare-function eshell-send-input "esh-mode" (&optional use-region queue-p no-newline)) (declare-function eshell-kill-input "esh-mode") (declare-function eshell-bol "esh-mode") +(declare-function eshell-quote-argument "esh-arg.el") (declare-function helm-ls-git-ls "ext:helm-ls-git") (declare-function helm-hg-find-files-in-project "ext:helm-ls-hg") +(declare-function helm-gid "helm-id-utils.el") +(declare-function helm-ls-svn-ls "ext:helm-ls-svn") (defvar recentf-list) @@ -211,7 +214,9 @@ I.e use the -path/ipath arguments of find instead of -name/iname." :group 'helm-files :type 'boolean) -(defcustom helm-files-save-history-extra-sources '("Find" "Locate") +(defcustom helm-files-save-history-extra-sources + '("Find" "Locate" "Recentf" + "Files from Current Directory" "File Cache") "Extras source that save candidate to `file-name-history'." :group 'helm-files :type '(repeat (choice string))) @@ -301,10 +306,12 @@ I.e use the -path/ipath arguments of find instead of -name/iname." (define-key map (kbd "C-x C-f") 'helm-ff-run-locate) (define-key map (kbd "C-x C-d") 'helm-ff-run-browse-project) (define-key map (kbd "C-x r m") 'helm-ff-bookmark-set) + (define-key map (kbd "C-x r b") 'helm-find-files-toggle-to-bookmark) (define-key map (kbd "C-s") 'helm-ff-run-grep) (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 "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) (define-key map (kbd "M-C") 'helm-ff-run-copy-file) @@ -339,9 +346,7 @@ I.e use the -path/ipath arguments of find instead of -name/iname." ;; Next 2 have no effect if candidate is not an image file. (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-.") 'helm-find-files-up-one-level) (define-key map (kbd "C-l") 'helm-find-files-up-one-level) - (define-key map (kbd "C-h C-b") 'helm-send-bug-report-from-helm) (define-key map (kbd "C-c r") 'helm-ff-run-find-file-as-root) (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 @@ -402,6 +407,7 @@ Don't set it directly, use instead `helm-ff-auto-update-initial-value'.") (defvar helm-ff--deleting-char-backward nil) (defvar helm-multi-files--toggle-locate nil) (defvar helm-ff--move-to-first-real-candidate t) +(defvar helm-find-files--toggle-bookmark nil) ;;; Helm-find-files @@ -431,6 +437,7 @@ Should not be used among other sources.") (mode-line :initform helm-ff-mode-line-string) (volatile :initform t) (nohighlight :initform t) + (keymap :initform helm-find-files-map) (candidate-number-limit :initform 9999) (action-transformer @@ -460,6 +467,7 @@ Should not be used among other sources.") "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.'" @@ -519,6 +527,8 @@ for current buffer." (save-selected-window (other-window 1) default-directory) + ;; Using the car of *ff-history allow + ;; allow staying in the directory visited instead of current. (or (car-safe helm-ff-history) default-directory)))))) (defun helm-find-files-do-action (action) @@ -549,8 +559,9 @@ ACTION must be an action supported by `helm-dired-action'." (with-helm-current-buffer (helm-read-file-name prompt - :preselect (if helm-ff-transformer-show-only-basename - (helm-basename cand) cand) + :preselect (unless (cdr ifiles) + (if helm-ff-transformer-show-only-basename + (helm-basename cand) cand)) :initial-input (helm-dwim-target-directory) :history (helm-find-files-history :comp-read nil)))))) (helm-dired-action @@ -684,7 +695,7 @@ will not be loaded first time you use this." (when (or eshell-command-aliases-list (y-or-n-p "Eshell is not loaded, run eshell-command without alias anyway? ")) (and eshell-command-aliases-list (eshell-read-aliases-list)) - (let* ((cand-list (helm-marked-candidates :with-wildcard t)) + (let* ((cand-list (helm-marked-candidates)) (default-directory (or helm-ff-default-directory ;; If candidate is an url *-ff-default-directory is nil ;; so keep value of default-directory. @@ -692,9 +703,9 @@ will not be loaded first time you use this." (command (helm-comp-read "Command: " (cl-loop for (a . c) in eshell-command-aliases-list - when (string-match "\\(\\$1\\|\\$\\*\\)$" (car c)) - collect (propertize a 'help-echo (car c)) into ls - finally return (sort ls 'string<)) + when (string-match "\\(\\$1\\|\\$\\*\\)$" (car c)) + collect (propertize a 'help-echo (car c)) into ls + finally return (sort ls 'string<)) :buffer "*helm eshell on file*" :name "Eshell command" :keymap helm-esh-on-file-map @@ -703,15 +714,16 @@ will not be loaded first time you use this." "C-c ?: Help, \\[universal-argument]: Insert output at point") :input-history 'helm-eshell-command-on-file-input-history)) - (alias-value (car (assoc-default command eshell-command-aliases-list)))) + (alias-value (car (assoc-default command eshell-command-aliases-list))) + cmd-line) (if (or (equal helm-current-prefix-arg '(16)) (equal map '(16))) ;; Two time C-u from `helm-comp-read' mean print to current-buffer. ;; i.e `eshell-command' will use this value. (setq current-prefix-arg '(16)) - ;; Else reset the value of `current-prefix-arg' - ;; to avoid printing in current-buffer. - (setq current-prefix-arg nil)) + ;; Else reset the value of `current-prefix-arg' + ;; to avoid printing in current-buffer. + (setq current-prefix-arg nil)) (if (and (or ;; One prefix-arg have been passed before `helm-comp-read'. ;; If map have been set with C-u C-u (value == '(16)) @@ -729,27 +741,30 @@ will not be loaded first time you use this." ;; Run eshell-command with ALL marked files as arguments. ;; This wont work on remote files, because tramp handlers depends ;; on `default-directory' (limitation). - (let ((mapfiles (mapconcat 'shell-quote-argument cand-list " "))) + (let ((mapfiles (mapconcat 'eshell-quote-argument cand-list " "))) (if (string-match "'%s'\\|\"%s\"\\|%s" command) - (eshell-command (format command mapfiles)) ; See [1] - (eshell-command (format "%s %s" command mapfiles)))) - - ;; Run eshell-command on EACH marked files. - ;; To work with tramp handler we have to call - ;; COMMAND on basename of each file, using - ;; its basedir as `default-directory'. - (cl-loop for f in cand-list - for dir = (and (not (string-match ffap-url-regexp f)) - (helm-basedir f)) - for file = (format "'%s'" (if (and dir (file-remote-p dir)) - (helm-basename f) f)) - for com = (if (string-match "'%s'\\|\"%s\"\\|%s" command) - ;; [1] This allow to enter other args AFTER filename - ;; i.e - (format command file) - (format "%s %s" command file)) - do (let ((default-directory (or dir default-directory))) - (eshell-command com))))))) + (setq cmd-line (format command mapfiles)) ; See [1] + (setq cmd-line (format "%s %s" command mapfiles))) + (helm-log "%S" cmd-line) + (eshell-command cmd-line)) + + ;; Run eshell-command on EACH marked files. + ;; To work with tramp handler we have to call + ;; COMMAND on basename of each file, using + ;; its basedir as `default-directory'. + (cl-loop for f in cand-list + for dir = (and (not (string-match ffap-url-regexp f)) + (helm-basedir f)) + for file = (eshell-quote-argument + (format "%s" (if (and dir (file-remote-p dir)) + (helm-basename f) f))) + for com = (if (string-match "'%s'\\|\"%s\"\\|%s" command) + ;; [1] This allow to enter other args AFTER filename + ;; i.e + (format command file) + (format "%s %s" command file)) + do (let ((default-directory (or dir default-directory))) + (eshell-command com))))))) (defun helm-find-files-eshell-command-on-file (_candidate) "Run `eshell-command' on CANDIDATE or marked candidates. @@ -1218,19 +1233,19 @@ The checksum is copied to kill-ring." (message "Checksum copied to kill-ring."))) (defun helm-ff-toggle-basename (_candidate) - (setq helm-ff-transformer-show-only-basename - (not helm-ff-transformer-show-only-basename)) - (let* ((cand (helm-get-selection nil t)) - (target (if helm-ff-transformer-show-only-basename - (helm-basename cand) cand))) - (helm-force-update (regexp-quote target)))) + (with-helm-buffer + (setq helm-ff-transformer-show-only-basename + (not helm-ff-transformer-show-only-basename)) + (let* ((cand (helm-get-selection nil t)) + (target (if helm-ff-transformer-show-only-basename + (helm-basename cand) cand))) + (helm-force-update (regexp-quote target))))) (defun helm-ff-run-toggle-basename () (interactive) (with-helm-alive-p (unless (helm-empty-source-p) - (helm-attrset 'toggle-basename '(helm-ff-toggle-basename . never-split)) - (helm-execute-persistent-action 'toggle-basename)))) + (helm-ff-toggle-basename nil)))) (cl-defun helm-reduce-file-name (fname level &key unix-close expand) "Reduce FNAME by LEVEL from end or beginning depending LEVEL value. @@ -1260,7 +1275,8 @@ If EXPAND is non--nil expand-file-name." ;; Internal (defvar helm--file-completion-sources - '("Find Files" "Read File Name" "Read File Name History") + '("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. @@ -1360,7 +1376,8 @@ or when `helm-pattern' is equal to \"~/\"." (helm-create-tramp-name helm-pattern) helm-pattern)) (completed-p (string= (file-name-as-directory - (expand-file-name pat)) + (expand-file-name + (substitute-in-file-name pat))) helm-ff-default-directory)) (candnum (helm-get-candidate-number))) (when (and (or @@ -1404,7 +1421,7 @@ or when `helm-pattern' is equal to \"~/\"." "Allow expanding to home/user directory or root or text yanked after pattern." (when (and (helm-file-completion-source-p) (string-match - "/\\$.*/\\|/\\./\\|/\\.\\./\\|/~.*/\\|//\\|\\(/[[:alpha:]]:/\\|\\s\\+\\)" + "/?\\$.*/\\|/\\./\\|/\\.\\./\\|/~.*/\\|//\\|\\(/[[:alpha:]]:/\\|\\s\\+\\)" helm-pattern) (with-current-buffer (window-buffer (minibuffer-window)) (eolp)) (not (string-match helm-ff-url-regexp helm-pattern))) @@ -1510,15 +1527,15 @@ purpose." ;; In some rare cases tramp can return a nil input, ;; so be sure pattern is a string for safety (Issue #476). (unless pattern (setq pattern "")) - (cond ((string-match "\\`\\$" pattern) + (cond ((string-match helm-ff-url-regexp pattern) pattern) + ((string-match "\\`\\$" pattern) (substitute-in-file-name pattern)) ((string= pattern "") "") ((string-match "\\`[.]\\{1,2\\}/\\'" pattern) (expand-file-name pattern)) ((string-match ".*\\(~?/?[.]\\{1\\}/\\)\\'" pattern) (expand-file-name default-directory)) - ((and (string-match ".*\\(~//\\|//\\)\\'" pattern) - (not (string-match helm-ff-url-regexp helm-pattern))) + ((string-match ".*\\(~//\\|//\\)\\'" pattern) (expand-file-name "/")) ; Expand to "/" or "c:/" ((string-match "\\`\\(~/\\|.*/~/\\)\\'" pattern) (expand-file-name "~/")) @@ -1607,7 +1624,8 @@ purpose." ;; Add the final "/" to path ;; when `helm-ff-auto-update-flag' is enabled. (file-name-as-directory path) - (file-name-directory path)))) + (if (string= path "") "/" + (file-name-directory path))))) (setq helm-ff-default-directory (if (string= helm-pattern "") (expand-file-name "/") ; Expand to "/" or "c:/" @@ -1637,8 +1655,9 @@ purpose." (and ffap-url-regexp (string-match ffap-url-regexp path))) (list path)) ((string= path "") (helm-ff-directory-files "/" t)) + ;; Check here if directory is accessible (not working on Windows). ((and (file-directory-p path) (not (file-readable-p path))) - (list (format "Opening directory: access denied, `%s'" path))) + (list (format "file-error: Opening directory permission denied `%s'" path))) ;; A fast expansion of PATH is made only if `helm-ff-auto-update-flag' ;; is enabled. ((and dir-p helm-ff-auto-update-flag) @@ -1651,7 +1670,7 @@ purpose." (list path)) (helm-ff-directory-files basedir t)))))) -(defsubst helm-ff-directory-files (directory &optional full) +(defun helm-ff-directory-files (directory &optional full) "List contents of DIRECTORY. Argument FULL mean absolute path. It is same as `directory-files' but always returns the @@ -1659,11 +1678,25 @@ dotted filename '.' and '..' even on root directories in Windows systems." (setq directory (file-name-as-directory (expand-file-name directory))) - (let ((ls (directory-files - directory full directory-files-no-dot-files-regexp)) + (let* (file-error + (ls (condition-case err + (directory-files + directory full directory-files-no-dot-files-regexp) + ;; Handle file-error from here for Windows + ;; because predicates like `file-readable-p' and friends + ;; seem broken on emacs for Windows systems (always returns t). + ;; This should never be called on GNU/Linux/Unix + ;; as the error is properly intercepted in + ;; `helm-find-files-get-candidates' by `file-readable-p'. + (file-error + (prog1 + (list (format "%s:%s" + (car err) + (mapconcat 'identity (cdr err) " "))) + (setq file-error t))))) (dot (concat directory ".")) (dot2 (concat directory ".."))) - (append (list dot dot2) ls))) + (append (and (not file-error) (list dot dot2)) ls))) (defun helm-ff-handle-backslash (fname) ;; Allow creation of filenames containing a backslash. @@ -1851,7 +1884,11 @@ Note that only existing directories are saved here." (with-helm-buffer (setq helm-marked-candidates nil helm-visible-mark-overlays nil)) - (helm-force-update)))) + (helm-force-update + (let ((presel (helm-get-selection))) + (regexp-quote (if (and helm-ff-transformer-show-only-basename + (not (helm-ff-dot-file-p presel))) + (helm-basename presel) presel))))))) (defun helm-ff-kill-buffer-fname (candidate) (let ((buf (get-file-buffer candidate))) @@ -1971,7 +2008,7 @@ Return candidates prefixed with basename of `helm-input' first." (attr (file-attributes file)) (type (car attr))) - (cond ((string-match "access denied" file) file) + (cond ((string-match "file-error" file) file) ( ;; A not already saved file. (and (stringp type) (not (helm-ff-valid-symlink-p file)) @@ -2012,29 +2049,55 @@ Return candidates prefixed with basename of `helm-input' first." (defun helm-find-files-action-transformer (actions candidate) "Action transformer for `helm-source-find-files'." - (cond ((with-helm-current-buffer - (eq major-mode 'message-mode)) - (append actions - '(("Gnus attach file(s)" . helm-ff-gnus-attach-files)))) - ((string-match (image-file-name-regexp) candidate) - (append actions - '(("Rotate image right `M-r'" . helm-ff-rotate-image-right) - ("Rotate image left `M-l'" . helm-ff-rotate-image-left)))) - ((string-match "\.el$" (helm-aif (helm-marked-candidates) - (car it) candidate)) - (append actions - '(("Byte compile lisp file(s) `M-B, C-u to load'" - . helm-find-files-byte-compile) - ("Load File(s) `M-L'" . helm-find-files-load-files)))) - ((and (string-match "\.html?$" candidate) - (file-exists-p candidate)) - (append actions - '(("Browse url file" . browse-url-of-file)))) - ((or (string= (file-name-extension candidate) "pdf") - (string= (file-name-extension candidate) "PDF")) - (append actions - '(("Pdfgrep File(s)" . helm-ff-pdfgrep)))) - (t actions))) + (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)))) + (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))) + (append '(("Find file to line number" . helm-ff-goto-linum)) + actions)) + ((string-match (image-file-name-regexp) candidate) + (append actions + '(("Rotate image right `M-r'" . helm-ff-rotate-image-right) + ("Rotate image left `M-l'" . helm-ff-rotate-image-left)))) + ((string-match "\.el$" (helm-aif (helm-marked-candidates) + (car it) candidate)) + (append actions + '(("Byte compile lisp file(s) `M-B, C-u to load'" + . helm-find-files-byte-compile) + ("Load File(s) `M-L'" . helm-find-files-load-files)))) + ((and (string-match "\.html?$" candidate) + (file-exists-p candidate)) + (append actions + '(("Browse url file" . browse-url-of-file)))) + ((or (string= (file-name-extension candidate) "pdf") + (string= (file-name-extension candidate) "PDF")) + (append actions + '(("Pdfgrep File(s)" . helm-ff-pdfgrep)))) + (t actions)))) + +(defun helm-ff-goto-linum (candidate) + "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 + (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))))) + (find-file candidate) + (and linum (not (string= linum "")) + (helm-goto-line (string-to-number linum) t)))) (defun helm-ff-gnus-attach-files (_candidate) "Run `gnus-dired-attach' on `helm-marked-candidates' or CANDIDATE." @@ -2235,6 +2298,7 @@ Like `find-file' but with `helm' support. Use it for non--interactive calls of `helm-find-files'." (when (get-buffer helm-action-buffer) (kill-buffer helm-action-buffer)) + (setq helm-find-files--toggle-bookmark nil) (let* ( ;; Be sure we don't erase the precedent minibuffer if some. (helm-ff-auto-update-initial-value (and helm-ff-auto-update-initial-value @@ -2248,12 +2312,26 @@ Use it for non--interactive calls of `helm-find-files'." (helm :sources 'helm-source-find-files :input fname :case-fold-search helm-file-name-case-fold-search - :keymap helm-find-files-map :preselect preselect + :ff-transformer-show-only-basename + helm-ff-transformer-show-only-basename :default def :prompt "Find Files or Url: " :buffer "*Helm Find Files*"))) +(defun helm-find-files-toggle-to-bookmark () + "Toggle helm-bookmark for `helm-find-files' and `helm-find-files.'" + (interactive) + (with-helm-buffer + (if (setq helm-find-files--toggle-bookmark + (not helm-find-files--toggle-bookmark)) + (progn + (helm-set-pattern "" t) + (helm-set-sources '(helm-source-bookmark-helm-find-files))) + ;; Switch back to helm-find-files. + (helm-set-pattern "./" t) ; Back to initial directory of hff session. + (helm-set-sources '(helm-source-find-files)) + (helm--maybe-update-keymap)))) (defun helm-find-files-initial-input (&optional input) "Return INPUT if present, otherwise try to guess it." @@ -2337,7 +2415,7 @@ Find inside `require' and `declare-function' sexp." ;;; Handle copy, rename, symlink, relsymlink and hardlink from helm. ;; ;; -(defvar dired-async-be-async) +(defvar dired-async-mode) (cl-defun helm-dired-action (candidate &key action follow (files (dired-get-marked-files))) "Execute ACTION on FILES to CANDIDATE. @@ -2360,21 +2438,23 @@ copy and rename." (dirflag (and (= (length files) 1) (file-directory-p (car files)) (not (file-directory-p candidate)))) - ;; When FOLLOW is enabled, disable helm-async. - ;; If it is globally disabled use this nil value. - (dired-async-be-async (and (boundp 'dired-async-be-async) - dired-async-be-async - (not follow)))) - (dired-create-files - fn (symbol-name action) files - ;; CANDIDATE is the destination. - (if (file-directory-p candidate) - ;; When CANDIDATE is a directory, build file-name in this directory. - ;; Else we use CANDIDATE. - #'(lambda (from) - (expand-file-name (file-name-nondirectory from) candidate)) - #'(lambda (_from) candidate)) - marker) + (dired-async-state (if (and (boundp 'dired-async-mode) + dired-async-mode) + 1 -1))) + (and follow (fboundp 'dired-async-mode) (dired-async-mode -1)) + (unwind-protect + (dired-create-files + fn (symbol-name action) files + ;; CANDIDATE is the destination. + (if (file-directory-p candidate) + ;; When CANDIDATE is a directory, build file-name in this directory. + ;; Else we use CANDIDATE. + #'(lambda (from) + (expand-file-name (file-name-nondirectory from) candidate)) + #'(lambda (_from) candidate)) + marker) + (and (fboundp 'dired-async-mode) + (dired-async-mode dired-async-state))) (push (file-name-as-directory (if (file-directory-p candidate) (expand-file-name candidate) @@ -2846,9 +2926,10 @@ Set `recentf-max-saved-items' to a bigger value if default is too small.") ;;;###autoload (defun helm-browse-project (arg) - "Browse files and see status of project with its vcs. + "Preconfigured helm to browse projects. +Browse files and see status of project with its vcs. Only HG and GIT are supported for now. -Fall back to `helm-find-files' or `helm-browse-project-find-files' +Fall back to `helm-browse-project-find-files' if current directory is not under control of one of those vcs. With a prefix ARG browse files recursively, with two prefix ARG rebuild the cache. @@ -2857,9 +2938,11 @@ If the current directory is found in the cache, start NOTE: The prefix ARG have no effect on the VCS controlled directories. Needed dependencies for VCS: - + +and + and -." +." (interactive "P") (cond ((and (require 'helm-ls-git nil t) (fboundp 'helm-ls-git-root-dir) @@ -2869,11 +2952,24 @@ and (fboundp 'helm-hg-root) (helm-hg-root)) (helm-hg-find-files-in-project)) - (t (let ((cur-dir (helm-current-directory))) - (if (or arg (gethash cur-dir helm--browse-project-cache)) + ((and (require 'helm-ls-svn nil t) + (fboundp 'helm-ls-svn-root-dir) + (helm-ls-svn-root-dir)) + (helm-ls-svn-ls)) + (t (let ((cur-dir (helm-browse-project-get--root-dir + (helm-current-directory)))) + (if (or arg (gethash cur-dir helm--browse-project-cache)) (helm-browse-project-find-files cur-dir (equal arg '(16))) - (helm :sources (helm-browse-project-build-buffers-source cur-dir) - :buffer "*helm browse project*")))))) + (helm :sources (helm-browse-project-build-buffers-source cur-dir) + :buffer "*helm browse project*")))))) + +(defun helm-browse-project-get--root-dir (directory) + (cl-loop with dname = (file-name-as-directory directory) + while (and dname (not (gethash dname helm--browse-project-cache))) + if (file-remote-p dname) + do (setq dname nil) else + do (setq dname (helm-basedir (substring dname 0 (1- (length dname))))) + finally return (or dname (file-name-as-directory directory)))) (defun helm-ff-browse-project (_candidate) "Browse project in current directory. @@ -2886,6 +2982,15 @@ See `helm-browse-project'." (with-helm-alive-p (helm-quit-and-execute-action 'helm-ff-browse-project))) +(defun helm-ff-gid (_candidate) + (with-helm-default-directory helm-ff-default-directory + (helm-gid))) + +(defun helm-ff-run-gid () + (interactive) + (with-helm-alive-p + (helm-quit-and-execute-action 'helm-ff-gid))) + ;;; session.el files ;; ;; session (http://emacs-session.sourceforge.net/) is an alternative to @@ -2917,7 +3022,8 @@ Colorize only symlinks, directories and files." (string-match ffap-url-regexp i))) (not (string-match helm-ff-url-regexp i))) (helm-basename i) i) - for type = (car (file-attributes i)) + for type = (and (null helm-ff-tramp-not-fancy) + (car (file-attributes i))) collect (cond ((and helm-ff-tramp-not-fancy (string-match helm-tramp-file-name-regexp i)) @@ -3034,80 +3140,91 @@ utility mdfind.") :requires-pattern 3)) (defun helm-findutils-transformer (candidates _source) - (cl-loop for i in candidates - for type = (car (file-attributes i)) - for abs = (expand-file-name i (helm-default-directory)) - for disp = (if (and helm-ff-transformer-show-only-basename - (not (string-match "[.]\\{1,2\\}$" i))) - (helm-basename i) abs) - collect (cond ((eq t type) - (cons (propertize disp 'face 'helm-ff-directory) abs)) - ((stringp type) - (cons (propertize disp 'face 'helm-ff-symlink) abs)) - (t (cons (propertize disp 'face 'helm-ff-file) abs))))) + (let (non-essential + (default-directory (helm-default-directory))) + (cl-loop for i in candidates + for abs = (expand-file-name + (helm-aif (file-remote-p default-directory) + (concat it i) i)) + for type = (car (file-attributes abs)) + for disp = (if (and helm-ff-transformer-show-only-basename + (not (string-match "[.]\\{1,2\\}$" i))) + (helm-basename abs) abs) + collect (cond ((eq t type) + (cons (propertize disp 'face 'helm-ff-directory) + abs)) + ((stringp type) + (cons (propertize disp 'face 'helm-ff-symlink) + abs)) + (t (cons (propertize disp 'face 'helm-ff-file) + abs)))))) + +(defun helm-find--build-cmd-line () + (require 'find-cmd) + (let* ((default-directory (or (file-remote-p default-directory 'localname) + default-directory)) + (patterns+options (split-string helm-pattern "\\(\\`\\| +\\)\\* +")) + (fold-case (helm-set-case-fold-search (car patterns+options))) + (patterns (split-string (car patterns+options))) + (additional-options (and (cdr patterns+options) + (list (concat (cadr patterns+options) " ")))) + (ignored-dirs ()) + (ignored-files (when helm-findutils-skip-boring-files + (cl-loop for f in completion-ignored-extensions + if (string-match "/$" f) + do (push (replace-match "" nil t f) + ignored-dirs) + else collect (concat "*" f)))) + (path-or-name (if helm-findutils-search-full-path + '(ipath path) '(iname name))) + (name-or-iname (if fold-case + (car path-or-name) (cadr path-or-name)))) + (find-cmd (and ignored-dirs + `(prune (name ,@ignored-dirs))) + (and ignored-files + `(not (name ,@ignored-files))) + `(and ,@(mapcar + (lambda (pattern) + `(,name-or-iname ,(concat "*" pattern "*"))) + patterns) + ,@additional-options)))) (defun helm-find-shell-command-fn () "Asynchronously fetch candidates for `helm-find'. -Additional find options can be sepcified after a \"*\" +Additional find options can be specified after a \"*\" separator." - (require 'find-cmd) - (with-helm-default-directory (helm-default-directory) - (let* (process-connection-type - (patterns+options (split-string helm-pattern "\\(\\`\\| +\\)\\* +")) - (fold-case (helm-set-case-fold-search (car patterns+options))) - (patterns (split-string (car patterns+options))) - (additional-options (and (cdr patterns+options) - (list (concat (cadr patterns+options) " ")))) - (ignored-dirs ()) - (ignored-files (when helm-findutils-skip-boring-files - (cl-loop for f in completion-ignored-extensions - if (string-match "/$" f) - do (push (replace-match "" nil t f) - ignored-dirs) - else collect (concat "*" f)))) - (path-or-name (if helm-findutils-search-full-path - '(ipath path) '(iname name))) - (name-or-iname (if fold-case - (car path-or-name) (cadr path-or-name))) - (cmd (find-cmd (and ignored-dirs - `(prune (name ,@ignored-dirs))) - (and ignored-files - `(not (name ,@ignored-files))) - `(and ,@(mapcar - (lambda (pattern) - `(,name-or-iname ,(concat "*" pattern "*"))) - patterns) - ,@additional-options))) - (proc (start-file-process-shell-command "hfind" helm-buffer cmd))) - (helm-log "Find command:\n%s" cmd) - (prog1 proc - (set-process-sentinel - proc - #'(lambda (process event) - (helm-process-deferred-sentinel-hook - process event (helm-default-directory)) - (if (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 "[Find process finished - (%s results)]" - (max (1- (count-lines - (point-min) (point-max))) - 0)) - 'face 'helm-locate-finish)))) - (force-mode-line-update)) - (helm-log "Error: Find %s" - (replace-regexp-in-string "\n" "" event))))))))) + (let* (process-connection-type + non-essential + (cmd (helm-find--build-cmd-line)) + (proc (start-file-process-shell-command "hfind" helm-buffer cmd))) + (helm-log "Find command:\n%s" cmd) + (prog1 proc + (set-process-sentinel + proc + #'(lambda (process event) + (helm-process-deferred-sentinel-hook + process event (helm-default-directory)) + (if (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 "[Find process finished - (%s results)]" + (max (1- (count-lines + (point-min) (point-max))) + 0)) + 'face 'helm-locate-finish)))) + (force-mode-line-update)) + (helm-log "Error: Find %s" + (replace-regexp-in-string "\n" "" event)))))))) (defun helm-find-1 (dir) - (helm :sources 'helm-source-findutils - :buffer "*helm find*" - ;; Make these vars local for further resuming. - :default-directory dir ; reset it when called from elsewhere. - :ff-transformer-show-only-basename nil - :case-fold-search helm-file-name-case-fold-search)) + (let ((default-directory (file-name-as-directory dir))) + (helm :sources 'helm-source-findutils + :buffer "*helm find*" + :ff-transformer-show-only-basename nil + :case-fold-search helm-file-name-case-fold-search))) ;; helm-find-files integration. (defun helm-ff-find-sh-command (_candidate) @@ -3171,19 +3288,22 @@ Run all sources defined in `helm-for-files-preferred-list'." (unless helm-source-buffers-list (setq helm-source-buffers-list (helm-make-source "Buffers" 'helm-source-buffers))) - (let ((helm-ff-transformer-show-only-basename nil)) - (helm :sources helm-for-files-preferred-list :buffer "*helm for files*"))) + (helm :sources helm-for-files-preferred-list + :ff-transformer-show-only-basename nil + :buffer "*helm for files*")) ;;;###autoload (defun helm-multi-files () - "Same as `helm-for-files' but allow toggling from locate to others sources." + "Preconfigured helm similar to `helm-for-files' but that don't run locate. +Allow toggling from locate to others sources. +This allow seeing first if what you search is in other sources before launching +locate." (interactive) (unless helm-source-buffers-list (setq helm-source-buffers-list (helm-make-source "Buffers" 'helm-source-buffers))) (setq helm-multi-files--toggle-locate nil) (let ((sources (remove 'helm-source-locate helm-for-files-preferred-list)) - (helm-ff-transformer-show-only-basename nil) (old-key (lookup-key helm-map (read-kbd-macro helm-multi-files-toggle-locate-binding)))) @@ -3192,6 +3312,7 @@ Run all sources defined in `helm-for-files-preferred-list'." 'helm-multi-files-toggle-to-locate)) (unwind-protect (helm :sources sources + :ff-transformer-show-only-basename nil :buffer "*helm multi files*") (define-key helm-map (kbd helm-multi-files-toggle-locate-binding) old-key)))) @@ -3200,8 +3321,9 @@ Run all sources defined in `helm-for-files-preferred-list'." (defun helm-recentf () "Preconfigured `helm' for `recentf'." (interactive) - (let ((helm-ff-transformer-show-only-basename nil)) - (helm-other-buffer 'helm-source-recentf "*helm recentf*"))) + (helm :sources 'helm-source-recentf + :ff-transformer-show-only-basename nil + :buffer "*helm recentf*")) (provide 'helm-files) diff --git a/elpa/helm-20150426.2119/helm-font.el b/elpa/helm-20150704.1247/helm-font.el similarity index 100% rename from elpa/helm-20150426.2119/helm-font.el rename to elpa/helm-20150704.1247/helm-font.el diff --git a/elpa/helm-20150426.2119/helm-grep.el b/elpa/helm-20150704.1247/helm-grep.el similarity index 96% rename from elpa/helm-20150426.2119/helm-grep.el rename to elpa/helm-20150704.1247/helm-grep.el index 0bf22647..f1ab0972 100644 --- a/elpa/helm-20150426.2119/helm-grep.el +++ b/elpa/helm-20150704.1247/helm-grep.el @@ -390,7 +390,7 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") (defun helm-grep-init (cmd-line) "Start an asynchronous grep process with CMD-LINE using ZGREP if non--nil." - (let* ((default-directory (or (expand-file-name helm-ff-default-directory) + (let* ((default-directory (or helm-ff-default-directory (helm-default-directory))) (zgrep (string-match "\\`zgrep" cmd-line)) ;; Use pipe only with grep, zgrep or git-grep. @@ -583,21 +583,23 @@ If N is positive go forward otherwise go backward." (defun helm-goto-precedent-file () "Go to precedent file in helm grep/etags buffers." (interactive) - (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-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))))) ;;;###autoload (defun helm-goto-next-file () "Go to precedent file in helm grep/etags buffers." (interactive) - (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-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))))) (defun helm-grep-run-default-action () "Run grep default action from `helm-do-grep-1'." @@ -617,7 +619,6 @@ If N is positive go forward otherwise go backward." (with-helm-alive-p (helm-quit-and-execute-action 'helm-grep-other-frame))) -;;;###autoload (defun helm-grep-run-save-buffer () "Run grep save results action from `helm-do-grep-1'." (interactive) @@ -697,17 +698,14 @@ Special commands: "\n")))) (message "Reverting buffer done")))))) -;;;###autoload (defun helm-gm-next-file () (interactive) (helm-goto-next-or-prec-file 1)) -;;;###autoload (defun helm-gm-precedent-file () (interactive) (helm-goto-next-or-prec-file -1)) -;;;###autoload (defun helm-grep-mode-jump () (interactive) (helm-grep-action @@ -723,17 +721,14 @@ Special commands: (forward-line arg)) (error nil)))) -;;;###autoload (defun helm-grep-mode-jump-other-window-forward () (interactive) (helm-grep-mode-jump-other-window-1 1)) -;;;###autoload (defun helm-grep-mode-jump-other-window-backward () (interactive) (helm-grep-mode-jump-other-window-1 -1)) -;;;###autoload (defun helm-grep-mode-jump-other-window () (interactive) (let ((candidate (buffer-substring (point-at-bol) (point-at-eol)))) @@ -834,17 +829,21 @@ These extensions will be added to command line with --include arg of grep." ;; ;; (defvar helm-source-grep nil) -(defun helm-do-grep-1 (targets &optional recurse zgrep exts default-input) +(defun helm-do-grep-1 (targets &optional recurse zgrep exts default-input input) "Launch grep on a list of TARGETS files. When RECURSE is given use -r option of grep and prompt user to set the --include args of grep. -You can give more than one arg separated by space. +You can give more than one arg separated by space at prompt. 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. -If prompt is empty '--exclude `grep-find-ignored-files' is used instead. +instead and EXTS will be ignored. +If prompt is empty `grep-find-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 -in recurse, search being made on `helm-zgrep-file-extension-regexp'." +in recurse, and ignoring EXTS, search being made on +`helm-zgrep-file-extension-regexp'." (when (and (helm-grep-use-ack-p) helm-ff-default-directory (file-remote-p helm-ff-default-directory)) @@ -924,6 +923,7 @@ in recurse, search being made on `helm-zgrep-file-extension-regexp'." :sources 'helm-source-grep :buffer (format "*helm %s*" (if zgrep "zgrep" (helm-grep-command recurse))) :default default-input + :input input :keymap helm-grep-map :history 'helm-grep-history :truncate-lines t))) @@ -995,28 +995,32 @@ in recurse, search being made on `helm-zgrep-file-extension-regexp'." (lambda () (or helm-ff-default-directory (helm-default-directory) default-directory))))) - (helm-grep--filter-candidate-1 candidate))) + (if (consp candidate) + (helm-grep--filter-candidate-1 (cdr 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 nil + (condition-case-unless-debug nil (with-temp-buffer (insert str) (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) - (list helm-pattern)) - do - (while (and (re-search-forward reg nil t) - (> (- (setq end (match-end 0)) - (setq beg (match-beginning 0))) 0)) - (add-text-properties beg end '(face helm-grep-match))) - do (goto-char (point-min))) + unless (string-match "\\`!" r) + collect r) + ;; async sources (grep, gid etc...) + (list helm-input)) + do + (while (and (re-search-forward reg nil t) + (> (- (setq end (match-end 0)) + (setq beg (match-beginning 0))) 0)) + (add-text-properties beg end '(face helm-grep-match))) + do (goto-char (point-min))) (buffer-string)) (error nil)))) diff --git a/elpa/helm-20150426.2119/helm-help.el b/elpa/helm-20150704.1247/helm-help.el similarity index 94% rename from elpa/helm-20150426.2119/helm-help.el rename to elpa/helm-20150704.1247/helm-help.el index bfef7768..d2af029d 100644 --- a/elpa/helm-20150426.2119/helm-help.el +++ b/elpa/helm-20150704.1247/helm-help.el @@ -17,7 +17,9 @@ ;;; Code: (require 'helm) -(require 'helm-org) + +(defvar helm-org-headings--nofilename) +(declare-function helm-source-org-headings-for-files "helm-org.el") (defgroup helm-help nil @@ -59,22 +61,22 @@ ;;;###autoload (defun helm-documentation (arg) - "Helm documentation. + "Preconfigured helm for helm documentation. With a prefix arg refresh the documentation. Find here the documentation of all sources actually documented." (interactive "P") + (require 'helm-org) (when arg (delete-file helm-documentation-file) (helm-aif (get-file-buffer helm-documentation-file) - (kill-buffer it))) + (kill-buffer it))) (unless (file-exists-p helm-documentation-file) (with-temp-file helm-documentation-file (erase-buffer) (cl-loop for elm in helm-help--string-list - for str = (symbol-value elm) - do (if (functionp str) - (insert (funcall str)) - (insert str))))) + for str = (symbol-value elm) + do (insert (substitute-command-keys + (if (functionp str) (funcall str) str)))))) (let ((helm-org-headings--nofilename t)) (helm :sources (helm-source-org-headings-for-files (list helm-documentation-file)) @@ -334,17 +336,24 @@ Italic => A non--file buffer. "\n* Helm Find Files\n ** Helm find files tips: -\n*** Enter `~/' at end of pattern to quickly reach home directory. -*** 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). +\n**** Enter `~/' at end of pattern to quickly reach home directory. + +**** Enter `/' at end of pattern to quickly reach root of your file system. + +**** 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 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 +**** 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 any environment var (e.g `$HOME') at end of pattern, it will be expanded. + +**** You can yank any valid filename after pattern, it will be expanded. + *** You can complete with partial basename (start on third char entered) e.g \"fob\" or \"fbr\" will complete \"foobar\" @@ -428,10 +437,26 @@ 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. +*** Copying renaming asynchronously + +If you use async library (if you have installed helm from MELPA you do) you can enable +async for copying/renaming etc... your files by enabling `dired-async-mode'. + +Note that even when async is enabled, running a copy/rename action with a prefix arg +will execute action synchronously, it will follow also the first file of the marked files +in its destination directory. + *** Bookmark your `helm-find-files' session You can bookmark your `helm-find-files' session with `C-x r m'. -You can retrieve later these bookmarks easily by using M-x helm-filtered-bookmarks. +You can retrieve later these bookmarks easily by using M-x helm-filtered-bookmarks +or from the current `helm-find-files' session just hitting `C-x r b'. + +*** Run Gid from `helm-find-files' + +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 \\ @@ -441,6 +466,7 @@ You can retrieve later these bookmarks easily by using M-x helm-filtered-bookmar \\[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. @@ -555,6 +581,7 @@ C/\\[helm-cr-empty-string]\t\t->Maybe return empty string (unless `must-match'). ;;;###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))) @@ -616,6 +643,7 @@ book * -size +1M ;;;###autoload (defun helm-generic-file-help () + "Global help for helm." (interactive) (let ((helm-help-message helm-generic-file-help-message)) (helm-help))) @@ -641,6 +669,16 @@ 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 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 +is usually \"ID\". +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. @@ -657,6 +695,7 @@ Or even better don't use tramp at all and mount your remote file system on SSHFS ;;;###autoload (defun helm-grep-help () + "Help command for helm grep." (interactive) (let ((helm-help-message helm-grep-help-message)) (helm-help))) @@ -677,6 +716,7 @@ Or even better don't use tramp at all and mount your remote file system on SSHFS ;;;###autoload (defun helm-pdfgrep-help () + "Help command for pdfgrep." (interactive) (let ((helm-help-message helm-pdfgrep-help-message)) (helm-help))) @@ -833,7 +873,14 @@ 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 with only the buffer-name and the line number, you can of course save and edit these -results. +results (i.e add text to the empty line) . + +*** Automatically matching symbol at point + +You can match automatically the symbol at point, but keeping +the minibuffer empty ready to write into. +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 @@ -878,6 +925,7 @@ to modify occurences in your buffer. ;;;###autoload (defun helm-moccur-help () + "Help command for (m)occur." (interactive) (let ((helm-help-message helm-moccur-help-message)) (helm-help))) @@ -900,6 +948,7 @@ to modify occurences in your buffer. ;;;###autoload (defun helm-top-help () + "Help command for top." (interactive) (let ((helm-help-message helm-top-help-message)) (helm-help))) @@ -922,6 +971,7 @@ to modify occurences in your buffer. ;;;###autoload (defun helm-apt-help () + "Help command for helm apt." (interactive) (let ((helm-help-message helm-apt-help-message)) (helm-help))) @@ -955,12 +1005,20 @@ This feature is only available with emacs-25. \\[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))) @@ -988,6 +1046,7 @@ the amount of prefix args entered. ;;;###autoload (defun helm-M-x-help () + "Help command for `helm-M-x'." (interactive) (let ((helm-help-message helm-M-x-help-message)) (helm-help))) @@ -1007,6 +1066,7 @@ the amount of prefix args entered. ;;;###autoload (defun helm-imenu-help () + "Help command for imenu." (interactive) (let ((helm-help-message helm-imenu-help-message)) (helm-help))) @@ -1028,6 +1088,7 @@ the amount of prefix args entered. ;;;###autoload (defun helm-color-help () + "Help command for color." (interactive) (let ((helm-help-message helm-colors-help-message)) (helm-help))) @@ -1047,6 +1108,7 @@ the amount of prefix args entered. ;;;###autoload (defun helm-semantic-help () + "Help command for semantic." (interactive) (let ((helm-help-message helm-semantic-help-message)) (helm-help))) @@ -1075,6 +1137,7 @@ you don't choose from there a command using helm completion. ;;;###autoload (defun helm-kmacro-help () + "Help command for kmacro." (interactive) (let ((helm-help-message helm-kmacro-help-message)) (helm-help))) diff --git a/elpa/helm-20150704.1247/helm-id-utils.el b/elpa/helm-20150704.1247/helm-id-utils.el new file mode 100644 index 00000000..7b7e9225 --- /dev/null +++ b/elpa/helm-20150704.1247/helm-id-utils.el @@ -0,0 +1,116 @@ +;;; helm-id-utils.el --- Helm interface for id-utils. -*- lexical-binding: t -*- + +;; Copyright (C) 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 'helm-grep) + +(defgroup helm-id-utils nil + "ID-Utils related Applications and libraries for Helm." + :group 'helm) + +(defcustom helm-gid-db-file-name "ID" + "Name of a database file created by `mkid' command from `ID-utils'." + :group 'helm-id-utils + :type 'string) + +(defun helm-gid-candidates-process () + (let ((proc (start-process + "gid" nil "gid" + "-r" helm-pattern))) + (set (make-local-variable 'helm-grep-last-cmd-line) + (format "gid -r %s" helm-pattern)) + (prog1 proc + (set-process-sentinel + proc (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 "[Helm Gid process finished - (%s results)]" + (max (1- (count-lines + (point-min) (point-max))) + 0)) + 'face 'helm-locate-finish)))) + (force-mode-line-update)) + (helm-log "Error: Gid %s" + (replace-regexp-in-string "\n" "" event)))))))) + +(defun helm-gid-filtered-candidate-transformer (candidates _source) + ;; "gid -r" may add dups in some rare cases. + (cl-loop for c in (helm-fast-remove-dups candidates :test 'equal) + collect (helm-grep--filter-candidate-1 c))) + +(defclass helm-gid-source (helm-source-async) + ((header-name + :initform + (lambda (name) + (concat name " [" (helm-attr 'db-dir) "]"))) + (db-dir :initarg :db-dir + :initform nil + :custom string + :documentation " Location of ID file.") + (candidates-process :initform #'helm-gid-candidates-process) + (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 + (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)) + (persistent-action :initform 'helm-grep-persistent-action) + (history :initform 'helm-grep-history) + (nohighlight :initform t) + (requires-pattern :initform 2))) + +;;;###autoload +(defun helm-gid () + "Preconfigured helm for `gid' command line of `ID-Utils'. +Need A database created with the command `mkid' +above `default-directory'. +Need id-utils as dependency which provide `mkid', `gid' etc... +See ." + (interactive) + (let* ((db (locate-dominating-file + default-directory + helm-gid-db-file-name)) + (helm-grep-default-directory-fn + (lambda () default-directory)) + (helm--maybe-use-default-as-input t)) + (cl-assert db nil "No DataBase found, create one with `mkid'") + (helm :sources (helm-make-source "Gid" 'helm-gid-source + :db-dir db) + :buffer "*helm gid*" + :keymap helm-grep-map + :truncate-lines t))) + +(provide 'helm-id-utils) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions obsolete) +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; helm-id-utils ends here diff --git a/elpa/helm-20150426.2119/helm-imenu.el b/elpa/helm-20150704.1247/helm-imenu.el similarity index 50% rename from elpa/helm-20150426.2119/helm-imenu.el rename to elpa/helm-20150704.1247/helm-imenu.el index 2bf44c42..6637c4a8 100644 --- a/elpa/helm-20150426.2119/helm-imenu.el +++ b/elpa/helm-20150704.1247/helm-imenu.el @@ -48,12 +48,38 @@ (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 "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 (define-key map (kbd "") 'helm-maybe-exit-minibuffer) (define-key map (kbd "") 'helm-execute-persistent-action)) (delq nil map))) +(defun helm-imenu-next-or-previous-section (n) + (with-helm-buffer + (let* ((fn (lambda () + (car (split-string (helm-get-selection nil t) + helm-imenu-delimiter)))) + (curtype (funcall fn)) + (move-fn (if (> n 0) #'helm-next-line #'helm-previous-line)) + (stop-fn (if (> n 0) + #'helm-end-of-source-p + #'helm-beginning-of-source-p))) + (catch 'break + (while (not (funcall stop-fn)) + (funcall move-fn) + (unless (string= curtype (funcall fn)) + (throw 'break nil))))))) + +(defun helm-imenu-next-section () + (interactive) + (helm-imenu-next-or-previous-section 1)) + +(defun helm-imenu-previous-section () + (interactive) + (helm-imenu-next-or-previous-section -1)) + ;;; Internals (defvar helm-cached-imenu-alist nil) @@ -67,15 +93,16 @@ (defvar helm-source-imenu nil "See (info \"(emacs)Imenu\")") +(defvar helm-source-imenu-all nil) (defclass helm-imenu-source (helm-source-sync) ((candidates :initform 'helm-imenu-candidates) - (candidate-transformer :initform 'helm-imenu-transformer) - (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) - (action :initform 'helm-imenu-action))) + (candidate-transformer :initform 'helm-imenu-transformer) + (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) + (action :initform 'helm-imenu-action))) (defcustom helm-imenu-fuzzy-match nil "Enable fuzzy matching in `helm-source-imenu'." @@ -87,8 +114,14 @@ (helm-make-source "Imenu" 'helm-imenu-source :fuzzy-match helm-imenu-fuzzy-match)))) +(defun helm-imenu--maybe-switch-to-buffer (candidate) + (helm-aif (marker-buffer (cdr candidate)) + (switch-to-buffer it))) + (defun helm-imenu-action (candidate) "Default action for `helm-source-imenu'." + (helm-log-run-hook 'helm-goto-line-before-hook) + (helm-imenu--maybe-switch-to-buffer candidate) (imenu candidate) ;; If semantic is supported in this buffer ;; imenu used `semantic-imenu-goto-function' @@ -100,31 +133,56 @@ (defun helm-imenu-persistent-action (candidate) "Default persistent action for `helm-source-imenu'." + (helm-imenu--maybe-switch-to-buffer candidate) (imenu candidate) (helm-highlight-current-line)) -(defun helm-imenu-candidates () - (with-helm-current-buffer +(defun helm-imenu-candidates (&optional buffer) + (with-current-buffer (or buffer helm-current-buffer) (let ((tick (buffer-modified-tick))) (if (eq helm-cached-imenu-tick tick) helm-cached-imenu-candidates (setq imenu--index-alist nil) (prog1 (setq helm-cached-imenu-candidates - (let ((index (imenu--make-index-alist))) + (let ((index (imenu--make-index-alist t))) (helm-imenu--candidates-1 (delete (assoc "*Rescan*" index) index)))) (setq helm-cached-imenu-tick tick)))))) +(defun helm-imenu-candidates-in-all-buffers () + (let* ((lst (buffer-list)) + (progress-reporter (make-progress-reporter + "Imenu indexing buffers..." 1 (length lst)))) + (prog1 + (cl-loop for b in lst + for count from 1 + for mm = (with-current-buffer b major-mode) + for cmm = (with-helm-current-buffer major-mode) + when (or (with-helm-current-buffer + (derived-mode-p mm)) + (with-current-buffer b + (derived-mode-p cmm))) + do (progress-reporter-update progress-reporter count) + and + append (with-current-buffer b + (helm-imenu-candidates b))) + (progress-reporter-done progress-reporter)))) + (defun helm-imenu--candidates-1 (alist) (cl-loop for elm in alist - append (if (imenu--subalist-p elm) - (helm-imenu--candidates-1 - (cl-loop for (e . v) in (cdr elm) collect - (cons (propertize - e 'helm-imenu-type (car elm)) - v))) - (and (cdr elm) ; bug in imenu, should not be needed. - (list elm))))) + nconc (if (imenu--subalist-p elm) + (helm-imenu--candidates-1 + (cl-loop for (e . v) in (cdr elm) collect + (cons (propertize + e 'helm-imenu-type (car elm)) + ;; If value is an integer, convert it + ;; to a marker, otherwise it is a cons cell + ;; and it will be converted on next recursions. + ;; (Issue #1060) [1]. + (if (integerp v) (copy-marker v) v)))) + (and (cdr elm) ; bug in imenu, should not be needed. + (setcdr elm (copy-marker (cdr elm))) ; Same as [1]. + (list elm))))) (defun helm-imenu--get-prop (item) ;; property value of ITEM can have itself @@ -143,17 +201,20 @@ (cl-loop for (k . v) in candidates for types = (or (helm-imenu--get-prop k) (list "Function" k)) + for bufname = (buffer-name (marker-buffer v)) + for disp1 = (mapconcat + (lambda (x) + (propertize + x 'face (cond ((string= x "Variables") + 'font-lock-variable-name-face) + ((string= x "Function") + 'font-lock-function-name-face) + ((string= x "Types") + 'font-lock-type-face)))) + types helm-imenu-delimiter) + for disp = (propertize disp1 'help-echo bufname) collect - (cons (mapconcat (lambda (x) - (propertize - x 'face (cond ((string= x "Variables") - 'font-lock-variable-name-face) - ((string= x "Function") - 'font-lock-function-name-face) - ((string= x "Types") - 'font-lock-type-face)))) - types helm-imenu-delimiter) - (cons k v)))) + (cons disp (cons k v)))) ;;;###autoload (defun helm-imenu () @@ -169,9 +230,25 @@ helm-imenu-execute-action-at-once-if-one)) (helm :sources 'helm-source-imenu :default (list (concat "\\_<" str "\\_>") str) - :candidate-number-limit 9999 :buffer "*helm imenu*"))) +;;;###autoload +(defun helm-imenu-in-all-buffers () + "Preconfigured helm for fetching imenu entries of all buffers." + (interactive) + (unless helm-source-imenu-all + (setq helm-source-imenu-all + (helm-make-source "Imenu in all buffers" 'helm-imenu-source + :candidates 'helm-imenu-candidates-in-all-buffers + :fuzzy-match helm-imenu-fuzzy-match))) + (let ((imenu-auto-rescan t) + (str (thing-at-point 'symbol)) + (helm-execute-action-at-once-if-one + helm-imenu-execute-action-at-once-if-one)) + (helm :sources 'helm-source-imenu-all + :default (list (concat "\\_<" str "\\_>") str) + :buffer "*helm imenu all*"))) + (provide 'helm-imenu) ;; Local Variables: diff --git a/elpa/helm-20150426.2119/helm-info.el b/elpa/helm-20150704.1247/helm-info.el similarity index 100% rename from elpa/helm-20150426.2119/helm-info.el rename to elpa/helm-20150704.1247/helm-info.el diff --git a/elpa/helm-20150426.2119/helm-locate.el b/elpa/helm-20150704.1247/helm-locate.el similarity index 96% rename from elpa/helm-20150426.2119/helm-locate.el rename to elpa/helm-20150704.1247/helm-locate.el index 2c50ea64..b7d3f912 100644 --- a/elpa/helm-20150426.2119/helm-locate.el +++ b/elpa/helm-20150704.1247/helm-locate.el @@ -97,6 +97,12 @@ 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 "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) + (define-key map (kbd "M-L") 'helm-ff-run-load-file) + (define-key map (kbd "M-S") 'helm-ff-run-symlink-file) + (define-key map (kbd "M-H") 'helm-ff-run-hardlink-file) (define-key map (kbd "M-D") 'helm-ff-run-delete-file) (define-key map (kbd "C-=") 'helm-ff-run-ediff-file) (define-key map (kbd "C-c =") 'helm-ff-run-ediff-merge-file) @@ -202,8 +208,7 @@ Argument INITIAL-INPUT is a string to use as initial-input. See also `helm-locate'." (when (and db (stringp db)) (setq db (list db))) (helm-locate-set-command) - (let ((helm-ff-transformer-show-only-basename nil) - (helm-locate-command + (let ((helm-locate-command (if db (replace-regexp-in-string "locate" @@ -219,6 +224,7 @@ See also `helm-locate'." (setq helm-file-name-history (mapcar 'helm-basename file-name-history)) (helm :sources 'helm-source-locate :buffer "*helm locate*" + :ff-transformer-show-only-basename nil :input initial-input :default default :history 'helm-file-name-history))) @@ -297,8 +303,7 @@ See also `helm-locate'." ;;;###autoload (defun helm-locate-read-file-name (prompt) - (let* (helm-ff-transformer-show-only-basename - (src `((name . "Locate read fname") + (let* ((src `((name . "Locate read fname") (init . helm-locate-set-command) (candidates-process . helm-locate-init) (action . identity) @@ -309,6 +314,7 @@ See also `helm-locate'." (candidate-number-limit . 9999) (no-matchplugin)))) (or (helm :sources src + :ff-transformer-show-only-basename nil :prompt prompt :buffer "*helm locate read fname*" :resume 'noresume) diff --git a/elpa/helm-20150426.2119/helm-man.el b/elpa/helm-20150704.1247/helm-man.el similarity index 60% rename from elpa/helm-20150426.2119/helm-man.el rename to elpa/helm-20150704.1247/helm-man.el index cdf7c2aa..392ad93f 100644 --- a/elpa/helm-20150426.2119/helm-man.el +++ b/elpa/helm-20150704.1247/helm-man.el @@ -20,8 +20,15 @@ (require 'cl-lib) (require 'helm) +(defvar woman-topic-all-completions) +(defvar woman-manpath) +(defvar woman-path) +(defvar woman-expanded-directory-path) +(declare-function woman-file-name "woman.el" (topic &optional re-cache)) (declare-function woman-file-name-all-completions "woman.el" (topic)) (declare-function Man-getpage-in-background "man.el" (topic)) +(declare-function woman-expand-directory-path "woman.el" (path-dirs path-regexps)) +(declare-function woman-topic-all-completions "woman.el" (path)) (declare-function helm-generic-sort-fn "helm-utils.el" (S1 S2)) (defgroup helm-man nil @@ -35,8 +42,17 @@ (const :tag "Man" Man-getpage-in-background) (const :tag "Woman" woman))) +(defcustom helm-man-format-switches "-l %s" + "Arguments to pass to the `manual-entry' function. +Arguments are passed to `manual-entry' with `format.' +Default use \"-l\" which may not be supported on old man versions, +in this case use \"%s\" as value to pass only the filename as argument. +See Issue #1035" + :group 'helm-man + :type 'string) + ;; Internal -(defvar helm-man-pages nil +(defvar helm-man--pages nil "All man pages on system. Will be calculated the first time you invoke helm with this source.") @@ -50,46 +66,42 @@ source.") (let ((file (helm-comp-read "ManFile: " wfiles :must-match t))) (if (eq helm-man-or-woman-function 'Man-getpage-in-background) - (manual-entry (format "-l %s" file)) - (woman-find-file file))) + (manual-entry (format helm-man-format-switches file)) + (woman-find-file file))) (funcall helm-man-or-woman-function candidate)) ;; If woman is unable to format correctly ;; use man instead. (error (kill-buffer) ; Kill woman buffer. (Man-getpage-in-background candidate))))) +(defun helm-man--init () + (require 'woman) + (require 'helm-utils) + (unless helm-man--pages + (setq woman-expanded-directory-path + (woman-expand-directory-path woman-manpath woman-path)) + (setq woman-topic-all-completions + (woman-topic-all-completions woman-expanded-directory-path)) + (setq helm-man--pages (mapcar 'car woman-topic-all-completions))) + (helm-init-candidates-in-buffer 'global helm-man--pages)) + (defvar helm-source-man-pages - '((name . "Manual Pages") - (init . (lambda () - (require 'woman) - (require 'helm-utils) - (unless helm-man-pages - (setq helm-man-pages - (ignore-errors - (woman-file-name "" t) - (sort (mapcar 'car woman-topic-all-completions) - 'string-lessp)))) - (helm-init-candidates-in-buffer 'global helm-man-pages))) - (candidates-in-buffer) - (persistent-action . ignore) - (filtered-candidate-transformer - . (lambda (candidates _source) - (sort candidates #'helm-generic-sort-fn))) - (action . (("Display Man page" . helm-man-default-action))) - ;; Woman does not work OS X - ;; http://xahlee.org/emacs/modernization_man_page.html - (action-transformer . (lambda (actions candidate) - (if (eq system-type 'darwin) - '(("Display Man page" . man)) - actions))))) + (helm-build-in-buffer-source "Manual Pages" + :init #'helm-man--init + :persistent-action #'ignore + :filtered-candidate-transformer + (lambda (candidates _source) + (sort candidates #'helm-generic-sort-fn)) + :action '(("Display Man page" . helm-man-default-action)))) ;;;###autoload (defun helm-man-woman (arg) "Preconfigured `helm' for Man and Woman pages. With a prefix arg reinitialize the cache." (interactive "P") - (when arg (setq helm-man-pages nil)) - (helm-other-buffer 'helm-source-man-pages "*Helm man woman*")) + (when arg (setq helm-man--pages nil)) + (helm :sources 'helm-source-man-pages + :buffer "*Helm man woman*")) (provide 'helm-man) diff --git a/elpa/helm-20150426.2119/helm-match-plugin.el b/elpa/helm-20150704.1247/helm-match-plugin.el similarity index 100% rename from elpa/helm-20150426.2119/helm-match-plugin.el rename to elpa/helm-20150704.1247/helm-match-plugin.el diff --git a/elpa/helm-20150426.2119/helm-misc.el b/elpa/helm-20150704.1247/helm-misc.el similarity index 95% rename from elpa/helm-20150426.2119/helm-misc.el rename to elpa/helm-20150704.1247/helm-misc.el index 88fee5f3..28a26d3d 100644 --- a/elpa/helm-20150426.2119/helm-misc.el +++ b/elpa/helm-20150704.1247/helm-misc.el @@ -46,6 +46,7 @@ "Face used to colorize home time in `helm-world-time'." :group 'helm-misc) + ;;; Latex completion (defvar LaTeX-math-menu) @@ -142,7 +143,7 @@ current local map, current global map, and all current minor maps." ;;;###autoload (defun helm-browse-menubar () - "Helm interface to the menubar using lacarte.el." + "Preconfigured helm to the menubar using lacarte.el." (interactive) (require 'lacarte) (helm :sources (mapcar @@ -283,23 +284,11 @@ It is added to `extended-command-history'. ;;;###autoload (defun helm-stumpwm-commands() + "Preconfigured helm for stumpwm commands." (interactive) (helm-other-buffer 'helm-source-stumpwm-commands "*helm stumpwm commands*")) -;;;###autoload -(defun helm-mini () - "Preconfigured `helm' lightweight version \(buffer -> recentf\)." - (interactive) - (require 'helm-files) - (unless helm-source-buffers-list - (setq helm-source-buffers-list - (helm-make-source "Buffers" 'helm-source-buffers))) - (let ((helm-ff-transformer-show-only-basename nil)) - (helm :sources helm-mini-default-sources - :buffer "*helm mini*" - :truncate-lines t))) - ;;;###autoload (defun helm-minibuffer-history () "Preconfigured `helm' for `minibuffer-history'." @@ -310,7 +299,7 @@ It is added to `extended-command-history'. ;;;###autoload (defun helm-comint-input-ring () - "Predefined `helm' that provide completion of `comint' history." + "Preconfigured `helm' that provide completion of `comint' history." (interactive) (when (derived-mode-p 'comint-mode) (helm :sources 'helm-source-comint-input-ring diff --git a/elpa/helm-20150426.2119/helm-mode.el b/elpa/helm-20150704.1247/helm-mode.el similarity index 93% rename from elpa/helm-20150426.2119/helm-mode.el rename to elpa/helm-20150704.1247/helm-mode.el index d49b30c5..c5d9e888 100644 --- a/elpa/helm-20150426.2119/helm-mode.el +++ b/elpa/helm-20150704.1247/helm-mode.el @@ -100,6 +100,11 @@ Affect among others `completion-at-point', `completing-read-multiple'." :group 'helm-mode :type 'boolean) +(defcustom helm-mode-fuzzy-match nil + "Enable fuzzy matching in `helm-mode'." + :group 'helm-mode + :type 'boolean) + (defvar helm-comp-read-map (let ((map (make-sparse-keymap))) @@ -164,51 +169,57 @@ e.g See docstring of `all-completions' for more info. If COLLECTION is an `obarray', a TEST should be needed. See `obarray'." - - (let ((cands - (cond ((vectorp collection) - (all-completions "" collection test)) - ((and (symbolp collection) (boundp collection) - ;; Issue #324 history is let-bounded and given - ;; quoted as hist argument of completing-read. - ;; See example in `rcirc-browse-url'. - (symbolp (symbol-value collection))) - nil) - ;; When collection is a symbol, most of the time - ;; it should be a symbol used as a minibuffer-history. - ;; The value of this symbol in this case return a list - ;; of string which maybe are converted later as symbol - ;; in special cases. - ;; we treat here commandp as a special case as it return t - ;; also with a string unless its last arg is provided. - ;; Also, the history collections generally collect their - ;; elements as string, so intern them to call predicate. - ((and (symbolp collection) (boundp collection) test) - (let ((predicate `(lambda (elm) - (condition-case err - (if (eq (quote ,test) 'commandp) - (funcall (quote ,test) (intern elm)) - (funcall (quote ,test) elm)) - (wrong-type-argument - (funcall (quote ,test) (intern elm))))))) - (all-completions "" (symbol-value collection) predicate))) - ((and (symbolp collection) (boundp collection)) - (all-completions "" (symbol-value collection))) - ;; Normally file completion should not be handled here, - ;; but special cases like `find-file-at-point' do it. - ;; Handle here specially such cases. - ((and (functionp collection) minibuffer-completing-file-name) - (cl-loop for f in (funcall collection helm-pattern test t) - unless (member f '("./" "../")) - collect (concat (file-name-as-directory - (helm-basedir helm-pattern)) f))) - ((functionp collection) - (funcall collection "" test t)) - ((and alistp test) - (cl-loop for i in collection when (funcall test i) collect i)) - (alistp collection) - (t (all-completions "" collection test))))) - (if sort-fn (sort cands sort-fn) cands))) + ;; Ensure COLLECTION is computed from `helm-current-buffer' + ;; because some functions used as COLLECTION work + ;; only in the context of current-buffer (Issue #1030) . + (with-helm-current-buffer + (let ((cands + (cond ((vectorp collection) + (all-completions "" collection test)) + ((and (symbolp collection) (boundp collection) + ;; Issue #324 history is let-bounded and given + ;; quoted as hist argument of completing-read. + ;; See example in `rcirc-browse-url'. + (symbolp (symbol-value collection))) + nil) + ;; When collection is a symbol, most of the time + ;; it should be a symbol used as a minibuffer-history. + ;; The value of this symbol in this case return a list + ;; of string which maybe are converted later as symbol + ;; in special cases. + ;; we treat here commandp as a special case as it return t + ;; also with a string unless its last arg is provided. + ;; Also, the history collections generally collect their + ;; elements as string, so intern them to call predicate. + ((and (symbolp collection) (boundp collection) test) + (let ((predicate `(lambda (elm) + (condition-case err + (if (eq (quote ,test) 'commandp) + (funcall (quote ,test) (intern elm)) + (funcall (quote ,test) elm)) + (wrong-type-argument + (funcall (quote ,test) (intern elm))))))) + (all-completions "" (symbol-value collection) predicate))) + ((and (symbolp collection) (boundp collection)) + (all-completions "" (symbol-value collection))) + ;; Normally file completion should not be handled here, + ;; but special cases like `find-file-at-point' do it. + ;; Handle here specially such cases. + ((and (functionp collection) minibuffer-completing-file-name) + (cl-loop for f in (funcall collection helm-pattern test t) + unless (member f '("./" "../")) + if (string-match ffap-url-regexp helm-pattern) + collect f + else + collect (concat (file-name-as-directory + (helm-basedir helm-pattern)) f))) + ((functionp collection) + (funcall collection "" test t)) + ((and alistp test) + (cl-loop for i in collection when (funcall test i) collect i)) + (alistp collection) + (t (all-completions "" collection test))))) + (if sort-fn (sort cands sort-fn) cands)))) (defun helm-cr-default-transformer (candidates _source) "Default filter candidate function for `helm-comp-read'." @@ -529,6 +540,7 @@ that use `helm-comp-read' See `helm-M-x' for example." (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") :prompt prompt @@ -581,6 +593,7 @@ It should be used when candidate list don't need to rebuild dynamically." 1 0) :candidates-in-buffer cands-in-buffer :exec-when-only-one exec-when-only-one + :fuzzy helm-mode-fuzzy-match :buffer buffer ;; If DEF is not provided, fallback to empty string ;; to avoid `thing-at-point' to be appended on top of list @@ -838,7 +851,8 @@ Keys description: :case-fold-search case-fold :default default :buffer buffer - :preselect preselect))) + :preselect (and (stringp preselect) + (regexp-quote preselect))))) (or (cond ((and result (stringp result) (string= result "") "")) @@ -952,7 +966,8 @@ Don't use it directly, use instead `helm-read-file-name' in your programs." (ido-mode (if ido-state 1 -1)) ;; Same comment as in `helm--completing-read-default'. (setq this-command current-command)) - fname)) + (if (eq predicate 'file-directory-p) ; Using `read-directory-name'. + (file-name-as-directory fname) fname))) (defun helm-mode--advice-lisp--local-variables (old--fn &rest args) (ignore-errors diff --git a/elpa/helm-20150426.2119/helm-net.el b/elpa/helm-20150704.1247/helm-net.el similarity index 84% rename from elpa/helm-20150426.2119/helm-net.el rename to elpa/helm-20150704.1247/helm-net.el index 702a3aa6..60c90302 100644 --- a/elpa/helm-20150426.2119/helm-net.el +++ b/elpa/helm-20150704.1247/helm-net.el @@ -174,85 +174,41 @@ This is a format string, don't forget the `%s'." ;;; Google Suggestions ;; ;; -;; Internal -(defvar helm-ggs-max-length-real-flag 0) -(defvar helm-ggs-max-length-num-flag 0) - (defun helm-google-suggest-fetch (input) - "Fetch suggestions for INPUT from XML buffer. -Return an alist with elements like (data . number_results)." - (setq helm-ggs-max-length-real-flag 0 - helm-ggs-max-length-num-flag 0) + "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 - for data = (cdr (cl-caadr (assoc 'suggestion i))) - for nqueries = (cdr (cl-caadr (assoc 'num_queries i))) - for lqueries = (length (helm-ggs-set-number-result - nqueries)) - for ldata = (length data) - do - (progn - (when (> ldata helm-ggs-max-length-real-flag) - (setq helm-ggs-max-length-real-flag ldata)) - (when (> lqueries helm-ggs-max-length-num-flag) - (setq helm-ggs-max-length-num-flag lqueries))) - collect (cons data nqueries) into cont - finally return cont)))) + 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))))) + (with-current-buffer + (url-retrieve-synchronously request) + (funcall fetch))))) (defun helm-google-suggest-set-candidates (&optional request-prefix) "Set candidates with result and number of google results found." - (let ((suggestions - (cl-loop with suggested-results = (helm-google-suggest-fetch - (or (and request-prefix - (concat request-prefix - " " helm-pattern)) - helm-pattern)) - for (real . numresult) in suggested-results - ;; Prepare number of results with "," - for fnumresult = (helm-ggs-set-number-result numresult) - ;; Calculate number of spaces to add before fnumresult - ;; if it is smaller than longest result - ;; `helm-ggs-max-length-num-flag'. - ;; e.g 1,234,567 - ;; 345,678 - ;; To be sure it is aligned properly. - for nspaces = (if (< (length fnumresult) - helm-ggs-max-length-num-flag) - (- helm-ggs-max-length-num-flag - (length fnumresult)) - 0) - ;; Add now the spaces before fnumresult. - for align-fnumresult = (concat (make-string nspaces ? ) - fnumresult) - for interval = (- helm-ggs-max-length-real-flag - (length real)) - for spaces = (make-string (+ 2 interval) ? ) - for display = (format "%s%s(%s results)" - real spaces align-fnumresult) - collect (cons display real)))) - (if (cl-loop for (_disp . dat) in suggestions - thereis (equal dat helm-pattern)) + (let ((suggestions (helm-google-suggest-fetch + (or (and request-prefix + (concat request-prefix + " " helm-pattern)) + helm-pattern)))) + (if (member helm-pattern suggestions) suggestions - ;; if there is no suggestion exactly matching the input then - ;; prepend a Search on Google item to the list - (append - suggestions - (list (cons (concat "Search for " "'" helm-input "'" " on Google") - helm-input)))))) + ;; if there is no suggestion exactly matching the input then + ;; prepend a Search on Google item to the list + (append + suggestions + (list (cons (format "Search for '%s' on Google" helm-input) + helm-input)))))) (defun helm-ggs-set-number-result (num) (if num diff --git a/elpa/helm-20150426.2119/helm-org.el b/elpa/helm-20150704.1247/helm-org.el similarity index 97% rename from elpa/helm-20150426.2119/helm-org.el rename to elpa/helm-20150704.1247/helm-org.el index 6570016a..73062c07 100644 --- a/elpa/helm-20150426.2119/helm-org.el +++ b/elpa/helm-20150704.1247/helm-org.el @@ -18,6 +18,7 @@ ;;; Code: (require 'cl-lib) (require 'helm) +(require 'helm-utils) (require 'org) (defgroup helm-org nil @@ -115,6 +116,7 @@ NOTE: This will be slow on large org buffers." ;;;###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 @@ -122,6 +124,7 @@ NOTE: This will be slow on large org buffers." ;;;###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 @@ -131,6 +134,7 @@ NOTE: This will be slow on large org buffers." ;;;###autoload (defun helm-org-capture-templates () + "Preconfigured helm for org templates." (interactive) (helm :sources (helm-source-org-capture-templates) :candidate-number-limit 99999 diff --git a/elpa/helm-20150426.2119/helm-pkg.el b/elpa/helm-20150704.1247/helm-pkg.el similarity index 65% rename from elpa/helm-20150426.2119/helm-pkg.el rename to elpa/helm-20150704.1247/helm-pkg.el index 071b8bf9..edc362e9 100644 --- a/elpa/helm-20150426.2119/helm-pkg.el +++ b/elpa/helm-20150704.1247/helm-pkg.el @@ -1,7 +1,7 @@ -(define-package "helm" "20150426.2119" "Helm is an Emacs incremental and narrowing framework" +(define-package "helm" "20150704.1247" "Helm is an Emacs incremental and narrowing framework" '((emacs "24") (cl-lib "0.5") - (async "1.2")) + (async "1.3")) :url "https://emacs-helm.github.io/helm/") ;; Local Variables: ;; no-byte-compile: t diff --git a/elpa/helm-20150426.2119/helm-plugin.el b/elpa/helm-20150704.1247/helm-plugin.el similarity index 100% rename from elpa/helm-20150426.2119/helm-plugin.el rename to elpa/helm-20150704.1247/helm-plugin.el diff --git a/elpa/helm-20150426.2119/helm-regexp.el b/elpa/helm-20150704.1247/helm-regexp.el similarity index 98% rename from elpa/helm-20150426.2119/helm-regexp.el rename to elpa/helm-20150704.1247/helm-regexp.el index 5b2b2fc7..5e6d8af5 100644 --- a/elpa/helm-20150426.2119/helm-regexp.el +++ b/elpa/helm-20150704.1247/helm-regexp.el @@ -134,7 +134,7 @@ i.e Don't replace inside a word, regexp is surrounded with \\bregexp\\b." (let ((matches (match-data)) (line (buffer-substring s e))) (propertize - (cl-loop with ln = (format "%5d: %s" (line-number-at-pos s) line) + (cl-loop with ln = (format "%5d: %s" (1- (line-number-at-pos s)) line) for i from 0 to (1- (/ (length matches) 2)) concat (format "\n %s'%s'" (format "Group %d: " i) (match-string i)) @@ -223,7 +223,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-pattern))) + (split-pat (helm-mp-split-pattern helm-input))) (cl-case method (buffer (switch-to-buffer buf)) (buffer-other-window (switch-to-buffer-other-window buf)) @@ -298,7 +298,6 @@ Same as `helm-moccur-goto-line' but go in new frame." ("Goto line new frame" . helm-moccur-goto-line-of))) (persistent-action :initform 'helm-moccur-persistent-action) (persistent-help :initform "Go to line") - (recenter :initform t) (resume :initform 'helm-moccur-resume-fn) (candidate-number-limit :initform 9999) (mode-line :initform helm-moccur-mode-line) @@ -394,9 +393,8 @@ Same as `helm-moccur-goto-line' but go in new frame." :input input :truncate-lines t)) -;;;###autoload (defun helm-moccur-run-save-buffer () - "Run grep save results action from `helm-do-grep-1'." + "Run moccur save results action from `helm-moccur'." (interactive) (with-helm-alive-p (helm-quit-and-execute-action 'helm-moccur-save-results))) @@ -464,7 +462,7 @@ Same as `helm-moccur-goto-line' but go in new frame." (let ((inhibit-read-only t)) (erase-buffer) (insert "-*- mode: helm-moccur -*-\n\n" - (format "Moccur Results for `%s':\n\n" helm-pattern)) + (format "Moccur Results for `%s':\n\n" helm-input)) (save-excursion (insert (with-current-buffer helm-buffer (goto-char (point-min)) (forward-line 1) @@ -521,7 +519,7 @@ Special commands: (insert (propertize (car (helm-moccur-filter-one-by-one line)) - 'helm-real-value line) + 'helm-realvalue line) "\n"))))) (message "Reverting buffer done"))))) @@ -561,7 +559,8 @@ Special commands: :buffer "*helm occur*" :history 'helm-grep-history :preselect (and (memq 'helm-source-occur helm-sources-using-default-as-input) - (format "%s:%d:" (buffer-name) (line-number-at-pos (point)))) + (format "%s:%d:" (regexp-quote (buffer-name)) + (line-number-at-pos (point)))) :truncate-lines t)) ;;;###autoload diff --git a/elpa/helm-20150426.2119/helm-ring.el b/elpa/helm-20150704.1247/helm-ring.el similarity index 85% rename from elpa/helm-20150426.2119/helm-ring.el rename to elpa/helm-20150704.1247/helm-ring.el index a43895c6..75594807 100644 --- a/elpa/helm-20150426.2119/helm-ring.el +++ b/elpa/helm-20150704.1247/helm-ring.el @@ -109,7 +109,7 @@ replace with STR as yanked string." (with-helm-current-buffer (setq kill-ring (delete str kill-ring)) (if (not (eq (helm-attr 'last-command helm-source-kill-ring) 'yank)) - (run-with-timer 0.01 nil `(lambda () (insert-for-yank ,str))) + (insert-for-yank str) ;; from `yank-pop' (let ((inhibit-read-only t) (before (< (point) (mark t)))) @@ -118,7 +118,7 @@ replace with STR as yanked string." (funcall (or yank-undo-function 'delete-region) (mark t) (point))) (setq yank-undo-function nil) (set-marker (mark-marker) (point) helm-current-buffer) - (run-with-timer 0.01 nil `(lambda () (insert-for-yank ,str))) + (insert-for-yank str) ;; Set the window start back where it was in the yank command, ;; if possible. (set-window-start (selected-window) yank-window-start t) @@ -130,8 +130,6 @@ replace with STR as yanked string." (set-marker (mark-marker) (point) helm-current-buffer)))))) (kill-new str))) - - ;;;; ;; DO NOT use these sources with other sources use @@ -167,7 +165,6 @@ replace with STR as yanked string." (helm-highlight-current-line)) :persistent-help "Show this line")) - ;;; Global-mark-ring (defvar helm-source-global-mark-ring (helm-build-sync-source "global-mark-ring" @@ -188,11 +185,11 @@ replace with STR as yanked string." (with-current-buffer (marker-buffer marker) (goto-char marker) (forward-line 0) - (let (line) - (if (string= "" line) - (setq line "") - (setq line (car (split-string (thing-at-point 'line) - "[\n\r]")))) + (let ((line (pcase (thing-at-point 'line) + ((and line (pred stringp) + (guard (not (string-match-p "\\`\n?\\'" line)))) + (car (split-string line "[\n\r]"))) + (_ "")))) (format "%7d:%s: %s" (line-number-at-pos) (marker-buffer marker) line)))) @@ -200,14 +197,50 @@ replace with STR as yanked string." (let ((marks global-mark-ring)) (when marks (cl-loop for i in marks - for gm = (unless (or (string-match - "^ " (format "%s" (marker-buffer i))) - (null (marker-buffer i))) - (helm-global-mark-ring-format-buffer i)) - when (and gm (not (member gm recip))) - collect gm into recip - finally return recip)))) + for mb = (marker-buffer i) + for gm = (unless (or (string-match "^ " (format "%s" mb)) + (null mb)) + (helm-global-mark-ring-format-buffer i)) + when (and gm (not (member gm recip))) + collect gm into recip + finally return recip)))) + +(defun helm--push-mark (&optional location nomsg activate) + "[Internal] Don't use directly, use instead `helm-push-mark-mode'." + (unless (null (mark t)) + (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring)) + (when (> (length mark-ring) mark-ring-max) + (move-marker (car (nthcdr mark-ring-max mark-ring)) nil) + (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil))) + (set-marker (mark-marker) (or location (point)) (current-buffer)) + ;; Now push the mark on the global mark ring. + (setq global-mark-ring (cons (copy-marker (mark-marker)) + ;; Avoid having multiple entries + ;; for same buffer in `global-mark-ring'. + (cl-loop with mb = (current-buffer) + for m in global-mark-ring + for nmb = (marker-buffer m) + unless (eq mb nmb) + collect m))) + (when (> (length global-mark-ring) global-mark-ring-max) + (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil) + (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)) + (or nomsg executing-kbd-macro (> (minibuffer-depth) 0) + (message "Mark set")) + (when (or activate (not transient-mark-mode)) + (set-mark (mark t))) + nil) +;;;###autoload +(define-minor-mode helm-push-mark-mode + "Provide an improved version of `push-mark'. +Modify the behavior of `push-mark' to update +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))) ;;;; ;;; Insert from register @@ -372,7 +405,7 @@ First call open the kill-ring browser, next calls move to next line." ;;;###autoload (defun helm-execute-kmacro () - "Keyboard macros with helm interface. + "Preconfigured helm for keyboard macros. Define your macros with `f3' and `f4'. See (info \"(emacs) Keyboard Macros\") for detailed infos. This command is useful when used with persistent action." diff --git a/elpa/helm-20150426.2119/helm-semantic.el b/elpa/helm-20150704.1247/helm-semantic.el similarity index 85% rename from elpa/helm-20150426.2119/helm-semantic.el rename to elpa/helm-20150704.1247/helm-semantic.el index 72ab49c5..7fcdbee6 100644 --- a/elpa/helm-20150426.2119/helm-semantic.el +++ b/elpa/helm-20150704.1247/helm-semantic.el @@ -37,12 +37,25 @@ :group 'helm-semantic :type 'boolean) -(defcustom helm-semantic-display-style 'semantic-format-tag-summarize - "Function to present a semantic tag." +(defcustom helm-semantic-display-style + '((python-mode . semantic-format-tag-summarize) + (c-mode . semantic-format-tag-concise-prototype-c-mode) + (emacs-lisp-mode . semantic-format-tag-abbreviate-emacs-lisp-mode)) + "Function to present a semantic tag according to `major-mode'. + +It is an alist where the `car' of each element is a `major-mode' and +the `cdr' a `semantic-format-tag-*' function. + +If no function is found for current `major-mode', fall back to +`semantic-format-tag-summarize' default function. + +You can have more or less informations depending of the `semantic-format-tag-*' +function you choose. + +All the supported functions are prefixed with \"semantic-format-tag-\", +you have completion on these functions with `C-M i' in the customize interface." :group 'helm-semantic - :type '(radio - (const :tag "Default" semantic-format-tag-summarize) - (const :tag "Prototype" semantic-format-tag-prototype))) + :type '(alist :key-type symbol :value-type symbol)) ;;; keymap (defvar helm-semantic-map @@ -59,7 +72,10 @@ (defun helm-semantic--fetch-candidates (tags depth &optional class) "Write the contents of TAGS to the current buffer." - (let ((class class) cur-type) + (let ((class class) cur-type + (stylefn (or (with-helm-current-buffer + (assoc-default major-mode helm-semantic-display-style)) + #'semantic-format-tag-summarize))) (cl-dolist (tag tags) (when (listp tag) (cl-case (setq cur-type (semantic-tag-class tag)) @@ -74,7 +90,7 @@ spaces (if (< depth 2) "" "├►") class) spaces) ;; Save the tag for later - (propertize (funcall helm-semantic-display-style tag nil t) + (propertize (funcall stylefn tag nil t) 'semantic-tag tag) "\n") (and type-p (setq class (car tag))) @@ -86,7 +102,7 @@ ;; Don't do anything with packages or includes for now ((package include) (insert - (propertize (funcall helm-semantic-display-style tag nil t) + (propertize (funcall stylefn tag nil t) 'semantic-tag tag) "\n") ) @@ -108,10 +124,8 @@ (defun helm-semantic--maybe-set-needs-update () (with-helm-current-buffer - (let ((tick (buffer-modified-tick))) - (unless (eq helm-cached-imenu-tick tick) - (setq helm-cached-imenu-tick tick) - (semantic-parse-tree-set-needs-update))))) + (when (semantic-parse-tree-needs-update-p) + (semantic-parse-tree-set-needs-update)))) (defvar helm-source-semantic nil) @@ -163,7 +177,7 @@ If ARG is supplied, pre-select symbol at point instead of current" ;;;###autoload (defun helm-semantic-or-imenu (arg) - "Run `helm' with `semantic' or `imenu'. + "Preconfigured helm for `semantic' or `imenu'. If ARG is supplied, pre-select symbol at point instead of current semantic tag in scope. diff --git a/elpa/helm-20150426.2119/helm-source.el b/elpa/helm-20150704.1247/helm-source.el similarity index 94% rename from elpa/helm-20150426.2119/helm-source.el rename to elpa/helm-20150704.1247/helm-source.el index 2a2e65c4..c9839918 100644 --- a/elpa/helm-20150426.2119/helm-source.el +++ b/elpa/helm-20150704.1247/helm-source.el @@ -172,7 +172,8 @@ :documentation " A string to explain persistent-action of this source. It also accepts a function or a variable name. - It will be displayed in source header.") + It will be displayed in `header-line'. + Have no effect when `helm-echo-input-in-header-line' is non--nil.") (help-message :initarg :help-message @@ -410,14 +411,7 @@ :custom boolean :documentation " Allow helm collecting duplicates candidates.") - - (recenter - :initarg :recenter - :initform nil - :custom boolean - :documentation - " `recenter' after jumping to candidate.") - + (history :initarg :history :initform nil @@ -454,6 +448,7 @@ :custom (choice string function) :documentation " Source local `header-line-format'. + Have no effect when `helm-echo-input-in-header-line' is non--nil. It accepts also variable/function name.") (resume @@ -570,9 +565,14 @@ Matching is done basically with `string-match' against each candidate.") :initform nil :custom function :documentation - " You should use this attribute when using a function involving - an async process instead of `candidates'. - The function must return a process.") + " 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. + The process buffer should be nil, otherwise, if you use + `helm-buffer' give to the process a sentinel.") (matchplugin :initform nil) (dont-plug :initform '(helm-compile-source--match-plugin @@ -707,27 +707,32 @@ like `re-search-forward', see below documentation of :search slot.") (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 + "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 - "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)) + "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 @@ -938,9 +943,9 @@ an eieio class." (helm-append-at-nth actions (quote ,new-action) ,index)) (t actions))))) - (when (symbolp actions) + (when (or (symbolp actions) (functionp actions)) (set-slot-value source 'action (list (cons "Default action" actions)))) - (when (symbolp action-transformers) + (when (or (symbolp action-transformers) (functionp action-transformers)) (setq action-transformers (list action-transformers))) (set-slot-value source diff --git a/elpa/helm-20150426.2119/helm-sys.el b/elpa/helm-20150704.1247/helm-sys.el similarity index 99% rename from elpa/helm-20150426.2119/helm-sys.el rename to elpa/helm-20150704.1247/helm-sys.el index 2c3ce071..86d1a7a7 100644 --- a/elpa/helm-20150426.2119/helm-sys.el +++ b/elpa/helm-20150704.1247/helm-sys.el @@ -284,6 +284,7 @@ Show actions only on line starting by a PID." ;;;###autoload (defun helm-xrandr-set () + "Preconfigured helm for xrandr." (interactive) (helm :sources 'helm-source-xrandr-change-resolution :buffer "*helm xrandr*")) diff --git a/elpa/helm-20150426.2119/helm-tags.el b/elpa/helm-20150704.1247/helm-tags.el similarity index 97% rename from elpa/helm-20150426.2119/helm-tags.el rename to elpa/helm-20150704.1247/helm-tags.el index 2df5c4ea..1e2ec221 100644 --- a/elpa/helm-20150426.2119/helm-tags.el +++ b/elpa/helm-20150704.1247/helm-tags.el @@ -215,7 +215,11 @@ If no entry in cache, create one." ;; Match only the tag part of CANDIDATE ;; and not the filename. (if helm-etags-match-part-only - (cadr (helm-etags-split-line candidate)) + ;; 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 :keymap helm-etags-map diff --git a/elpa/helm-20150426.2119/helm-utils.el b/elpa/helm-20150704.1247/helm-utils.el similarity index 96% rename from elpa/helm-20150426.2119/helm-utils.el rename to elpa/helm-20150704.1247/helm-utils.el index 6e5853a6..9f764692 100644 --- a/elpa/helm-20150426.2119/helm-utils.el +++ b/elpa/helm-20150704.1247/helm-utils.el @@ -35,10 +35,13 @@ :type 'string :group 'helm-utils) -(defcustom helm-yank-symbol-first nil - "`helm-yank-text-at-point' yanks symbol at point on first -invocation if this is non-nil." - :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-utils) (defcustom helm-default-kbsize 1024.0 @@ -66,7 +69,13 @@ It is a float, usually 1024.0 but could be 1000.0 on some systems." (defvar helm-goto-line-before-hook '(helm-save-current-pos-to-mark-ring) "Run before jumping to line. This hook run when jumping from `helm-goto-line', `helm-etags-default-action', -and `helm-imenu-default-action'.") +and `helm-imenu-default-action'. +This allow you to retrieve a previous position after using the different helm +tools for searching (etags, grep, gid, (m)occur etc...). +By default positions are added to `mark-ring' you can also add to register +by using instead (or adding) `helm-save-pos-to-register-before-jump'. +In this case last position is added to the register +`helm-save-pos-before-jump-register'.") (defvar helm-save-pos-before-jump-register ?_ "The register where `helm-save-pos-to-register-before-jump' save position.") @@ -311,28 +320,6 @@ Default is `eq'." finally return (cl-loop for i being the hash-values in cont 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-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 @@ -691,7 +678,7 @@ Useful in dired buffers when there is inserted subdirs." (catch 'empty-line (cl-loop with ov for r in (helm-remove-if-match - "\\`!" (split-string helm-pattern)) + "\\`!" (split-string helm-input)) do (save-excursion (goto-char start-match) (while (condition-case _err @@ -811,8 +798,7 @@ If `helm-yank-symbol-first' is non--nil the first yank grabs the entire symbol." (interactive) (with-helm-current-buffer - (let ((fwd-fn (if helm-yank-symbol-first - 'forward-symbol 'forward-word))) + (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 diff --git a/elpa/helm-20150426.2119/helm.el b/elpa/helm-20150704.1247/helm.el similarity index 92% rename from elpa/helm-20150426.2119/helm.el rename to elpa/helm-20150704.1247/helm.el index 10c78ed3..4f3dae02 100644 --- a/elpa/helm-20150426.2119/helm.el +++ b/elpa/helm-20150704.1247/helm.el @@ -34,7 +34,13 @@ (defmacro helm-with-gensyms (symbols &rest body) "Bind the SYMBOLS to fresh uninterned symbols and eval BODY." (declare (indent 1)) - `(let ,(mapcar (lambda (s) `(,s (make-symbol (concat "--" (symbol-name ',s))))) + `(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)) @@ -431,13 +437,13 @@ will reuse the same window scheme than the one of last session unless (defcustom helm-split-window-default-side 'below "The default side to display `helm-buffer'. Must be one acceptable arg for `split-window' SIDE, -that is 'below, 'above, 'left or 'right. +that is `below', `above', `left' or `right'. -Other acceptable values are 'same which always display `helm-buffer' -in current window and 'other that display `helm-buffer' below if only one +Other acceptable values are `same' which always display `helm-buffer' +in current window and `other' that display `helm-buffer' below if only one window or in `other-window-for-scrolling' if available. -A nil value as same effect as 'below. +A nil value as same effect as `below'. If `helm-full-frame' is non--nil, it take precedence on this. See also `helm-split-window-in-side-p' and `helm-always-two-windows' that @@ -461,17 +467,26 @@ NOTE: this have no effect if `helm-split-window-preferred-function' is not "When non--nil helm will use two windows in this frame. That is one window to display `helm-buffer' and one to display `helm-current-buffer'. + Note: this have no effect when `helm-split-window-in-side-p' is non--nil, or when `helm-split-window-default-side' is set to 'same. + When `helm-autoresize-mode' is enabled, setting this to nil -will have no effect until this mode will be disabled." +will have no effect. + +Also when non-nil it overhides the effect of `helm-split-window-default-side' +set to `other'." :group 'helm :type 'boolean) (defcustom helm-sources-using-default-as-input '(helm-source-imenu + helm-source-imenu-all helm-source-info-elisp - helm-source-etags-select) - "List of helm sources that need to use `helm-maybe-use-default-as-input'. + helm-source-etags-select + helm-source-man-pages + helm-source-occur + helm-source-moccur) + "List of helm sources that need to use `helm--maybe-use-default-as-input'. When a source is member of this list, default `thing-at-point' will be used as input." :group 'helm @@ -497,12 +512,6 @@ you want this mode enabled definitely." :group 'helm :type 'boolean) -(defcustom helm-truncate-lines nil - "Truncate long lines when non--nil. -See `truncate-lines'." - :group 'helm - :type 'boolean) - (defcustom helm-move-to-line-cycle-in-source nil "Move to end or beginning of source when reaching top or bottom of source. This happen when using `helm-next/previous-line'." @@ -576,6 +585,12 @@ The default is to enable this by default, the user can toggle the current input method with `toggle-input-method'." :group 'helm :type 'boolean) + +(defcustom helm-echo-input-in-header-line nil + "Send current input in header-line." + :group 'helm + :type 'boolean) + ;;; Faces ;; @@ -649,7 +664,12 @@ input method with `toggle-input-method'." '((((background light)) :foreground "#b00000") (((background dark)) :foreground "gold1")) "Face used to highlight matches." - :group 'helm) + :group 'helm-faces) + +(defface helm-header-line-left-margin + '((t (:foreground "black" :background "yellow"))) + "Face used to highlight helm-header sign in left-margin." + :group 'helm-faces) ;;; Variables. @@ -689,9 +709,8 @@ can be set here with `helm-set-local-variable'.") (defvar helm-after-initialize-hook nil "Run after helm initialization. -This hook run inside `helm-buffer' once created. -Variables are initialized and the `helm-buffer' is created. -But the `helm-buffer' has no contents.") +This hook run after `helm-buffer' is created but not from `helm-buffer' +so the hook have to specify in which buffer it should run.") (defvar helm-update-hook nil "Run after the helm buffer was updated according the new input pattern. @@ -750,11 +769,6 @@ and before performing action.") "Quit when there is no candidates when non--nil. This variable accepts a function, which is executed if no candidate.") -(defvar helm-maybe-use-default-as-input nil - "Use :default arg of `helm' as input to update display. -Note that if also :input is specified as `helm' arg, it will take -precedence on :default.") - (defvar helm-source-in-each-line-flag nil "Non-nil means add helm-source text-property in each candidate. experimental feature.") @@ -787,6 +801,18 @@ first arg is a string that will be used as name for candidates number, second arg any string to display in mode line. If nil, use default `mode-line-format'.") +(defvar helm-minibuffer-set-up-hook nil + "Hook that run at initialization of minibuffer. +Useful for modifying the settings of minibuffer in helm. + +Here an example to hide minibuffer when using +`helm-echo-input-in-header-line': + + (add-hook 'helm-minibuffer-set-up-hook #'helm-hide-minibuffer-maybe) + +Note that we check `helm-echo-input-in-header-line' value +from `helm-buffer' which allow detecting possible local +value of this var.") ;;; Internal Variables ;; @@ -876,6 +902,18 @@ when `helm' is keyboard-quitted.") (defvar helm--reading-passwd-or-string nil) (defvar helm--in-update nil) (defvar helm--in-fuzzy nil) +(defvar helm--maybe-use-default-as-input nil + "Flag to notify the use of use-default-as-input. +Use only in let-bindings. +Use :default arg of `helm' as input to update display. +Note that if also :input is specified as `helm' arg, it will take +precedence on :default.") +(defvar helm--temp-hooks nil + "Store temporary hooks added by `with-helm-temp-hook'.") +(defvar helm-truncate-lines nil + "[Internal] Don't set this globally, it is used as a local var.") +(defvar helm--prompt nil) + ;; Utility: logging (defun helm-log (format-string &rest args) @@ -1102,13 +1140,15 @@ not `exit-minibuffer' or unwanted functions." (defmacro with-helm-temp-hook (hook &rest body) "Execute temporarily BODY as a function for HOOK." (declare (indent 1) (debug t)) - (helm-with-gensyms (fun) + (helm-with-gensyms (helm--hook) `(progn - (defun ,fun () + (defun ,helm--hook () (unwind-protect (progn ,@body) - (remove-hook ,hook (quote ,fun)))) - (add-hook ,hook (quote ,fun))))) + (remove-hook ,hook (quote ,helm--hook)) + (fmakunbound (quote ,helm--hook)))) + (push (cons ',helm--hook ,hook) helm--temp-hooks) + (add-hook ,hook (quote ,helm--hook))))) (defmacro with-helm-after-update-hook (&rest body) "Execute BODY at end of `helm-update'." @@ -1185,12 +1225,15 @@ arg TYPE is an existing type defined in `helm-type-attributes'." (defun helm-append-at-nth (seq elm index) "Append ELM at INDEX in SEQ." (let ((len (length seq))) - (when (> index len) (setq index len)) - (cl-loop for i in seq - for count from 1 collect i - when (= count index) - if (listp elm) append elm - else collect elm))) + (cond ((> index len) (setq index len)) + ((< index 0) (setq index 0))) + (if (zerop index) + (append elm seq) + (cl-loop for i in seq + for count from 1 collect i + when (= count index) + if (listp elm) append elm + else collect elm)))) (defun helm-add-action-to-source (name fn source &optional index) "Add new action NAME linked to function FN to SOURCE. @@ -1252,9 +1295,9 @@ only when predicate helm-ff-candidates-lisp-p return non--nil: (helm-append-at-nth actions (quote ,new-action) ,index)) (t actions))))) - (when (symbolp actions) + (when (or (symbolp actions) (functionp actions)) (helm-attrset 'action (list (cons "Default action" actions)) source)) - (when (symbolp action-transformers) + (when (or (symbolp action-transformers) (functionp action-transformers)) (setq action-transformers (list action-transformers))) (if test-only ; debug (delq nil (append (list transformer) action-transformers)) @@ -1386,7 +1429,19 @@ of \(action-display . function\)." (helm-aif (helm-attr 'action-transformer) (helm-composed-funcall-with-source (helm-get-current-source) it - (helm-attr 'action) (helm-get-selection)) + (helm-attr 'action) + ;; Check if the first given transformer + ;; returns the same set of actions for each + ;; candidate in marked candidates. + ;; If so use the car of marked to determine + ;; the set of actions, otherwise use the selection. + (if (cl-loop with marked = (helm-marked-candidates) + with act = (car (helm-mklist it)) + with acts = (funcall act nil (car marked)) + for c in marked + always (equal (funcall act nil c) acts)) + (car (helm-marked-candidates)) + (helm-get-selection))) (helm-attr 'action)))) (defun helm-get-current-source () @@ -1490,17 +1545,26 @@ Otherwise, return VALUE itself." (defun helm-set-local-variable (&rest args) "Bind each pair in ARGS locally to `helm-buffer'. + Use this to set local vars before calling helm. + +When used from an init or update function +(i.e when `helm-force-update' is running) the variables are set +using `make-local-variable' within the `helm-buffer'. + Usage: helm-set-local-variable ([VAR VALUE]...) Just like `setq' except that the vars are not set sequentially. -IOW Don't use VALUE of previous VAR to eval the VALUE of next VAR. -When helm is alive use `make-local-variable' as usual on `helm-buffer'. +IOW Don't use VALUE of previous VAR to set the VALUE of next VAR. \(fn VAR VALUE ...)" - (setq helm--local-variables - (append (cl-loop for i on args by #'cddr - collect (cons (car i) (cadr i))) - helm--local-variables))) + (if helm-force-updating-p + (with-helm-buffer + (cl-loop for i on args by #'cddr + do (set (make-local-variable (car i)) (cadr i)))) + (setq helm--local-variables + (append (cl-loop for i on args by #'cddr + 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. @@ -1676,6 +1740,27 @@ This is used in transformers to modify candidates list." 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. @@ -1740,7 +1825,7 @@ Initially selected candidate. Specified by exact candidate or a regexp. 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 +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 @@ -1870,11 +1955,12 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (helm-log "any-keymap = %S" any-keymap) (helm-log "any-default = %S" any-default) (helm-log "any-history = %S" any-history) + (setq helm--prompt (or any-prompt "pattern: ")) (let ((non-essential t) (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. + (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))))) ;; cua-mode overhide local helm bindings. @@ -1896,6 +1982,7 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (when helm-prevent-escaping-from-minibuffer (helm--remap-mouse-mode 1)) ; Disable mouse bindings. (add-hook 'post-command-hook 'helm--maybe-update-keymap) + (add-hook 'post-command-hook 'helm--update-header-line) (helm-log "show prompt") (unwind-protect (helm-read-pattern-maybe @@ -1910,6 +1997,7 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `helm'." (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 @@ -2008,6 +2096,7 @@ Arguments SAME-AS-HELM are the same as `helm', which see." (with-helm-window (let ((orig-helm-current-buffer helm-current-buffer) (orig-helm-buffer helm-buffer) + (orig-helm--prompt helm--prompt) (orig-helm--in-fuzzy helm--in-fuzzy) (orig-helm-last-frame-or-window-configuration helm-last-frame-or-window-configuration) @@ -2027,6 +2116,7 @@ Arguments SAME-AS-HELM are the same as `helm', which see." (with-current-buffer orig-helm-buffer (setq helm-alive-p t) ; Nested session set this to nil on exit. (setq helm-buffer orig-helm-buffer) + (setq helm--prompt orig-helm--prompt) (setq helm--in-fuzzy orig-helm--in-fuzzy) (helm-initialize-overlays helm-buffer) (unless (helm-empty-buffer-p) (helm-mark-current-line t)) @@ -2034,7 +2124,24 @@ Arguments SAME-AS-HELM are the same as `helm', which see." orig-helm-last-frame-or-window-configuration) (setq cursor-type nil) (setq helm-current-buffer orig-helm-current-buffer) - (setq helm-onewindow-p orig-one-window-p)))))) + (setq helm-onewindow-p orig-one-window-p) + ;; Be sure advices, hooks, and local modes keep running. + (if (fboundp 'advice-add) + (progn + (advice-add 'tramp-read-passwd + :around #'helm--advice-tramp-read-passwd) + (advice-add 'ange-ftp-get-passwd + :around #'helm--advice-ange-ftp-get-passwd)) + (ad-activate 'tramp-read-passwd) + (ad-activate 'ange-ftp-get-passwd)) + (when helm-prevent-escaping-from-minibuffer + (helm--remap-mouse-mode 1)) + (unless (cl-loop for h in post-command-hook + thereis (memq h '(helm--maybe-update-keymap + helm--update-header-line))) + (add-hook 'post-command-hook 'helm--maybe-update-keymap) + (add-hook 'post-command-hook 'helm--update-header-line)) + (helm-display-mode-line (helm-get-current-source))))))) ;;; Core: Accessors @@ -2047,14 +2154,18 @@ Argument SAVE-OR-RESTORE is one of save or restore." (helm-log "Save position at %S" (cons (point) (window-start))) (setq helm-current-position (cons (point) (window-start)))) (restore - (helm-log "Restore position at %S in buffer %s" - helm-current-position - (buffer-name (current-buffer))) - (goto-char (car helm-current-position)) - ;; Fix this position with the NOFORCE arg of `set-window-start' - ;; otherwise, if there is some other buffer than `helm-current-buffer' - ;; one, position will be lost. - (set-window-start (selected-window) (cdr helm-current-position) t)))) + ;; Maybe `helm-current-buffer' have been deleted + ;; during helm session so check if it is here + ;; otherwise position in underlaying buffer will be lost. + (when (get-buffer-window helm-current-buffer 'visible) + (helm-log "Restore position at %S in buffer %s" + helm-current-position + (buffer-name (current-buffer))) + (goto-char (car helm-current-position)) + ;; Fix this position with the NOFORCE arg of `set-window-start' + ;; otherwise, if there is some other buffer than `helm-current-buffer' + ;; one, position will be lost. + (set-window-start (selected-window) (cdr helm-current-position) t))))) (defun helm-frame-or-window-configuration (save-or-restore) @@ -2157,7 +2268,12 @@ It uses `switch-to-buffer' or `pop-to-buffer' depending of value of (and (eq helm-split-window-default-side 'same) (one-window-p t))) (progn (delete-other-windows) (switch-to-buffer buffer)) - (when (and (or helm-always-two-windows helm-autoresize-mode) + (when (and (or helm-always-two-windows helm-autoresize-mode + (and (not helm-split-window-in-side-p) + (eq (save-selected-window + (funcall helm-split-window-preferred-function + (selected-window))) + (get-buffer-window helm-current-buffer)))) (not (eq helm-split-window-default-side 'same)) (not (minibufferp helm-current-buffer)) (not helm-split-window-in-side-p)) @@ -2279,7 +2395,7 @@ It is intended to use this only in `helm-initial-setup'." (member (assoc-default 'name s) helm-source-filter)) (helm-get-sources)))) - (setq helm-pattern (or (and helm-maybe-use-default-as-input + (setq helm-pattern (or (and helm--maybe-use-default-as-input (or (if (listp any-default) (car any-default) any-default) (with-helm-current-buffer @@ -2335,6 +2451,10 @@ Please don't use it. :keymap (and helm-alive-p helm-map) (unless helm-alive-p (setq helm--minor-mode nil))) +(defun helm--reset-default-pattern () + (setq helm-pattern "") + (setq helm--maybe-use-default-as-input nil)) + (defun helm-read-pattern-maybe (any-prompt any-input any-preselect any-resume any-keymap any-default any-history) @@ -2345,7 +2465,7 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." ;; or contain non--candidate lines (e.g grep exit status) (helm-get-current-source)) (helm-mark-current-line t) - (helm-update any-preselect)) + (helm-update any-preselect)) (with-current-buffer (helm-buffer-get) (let* ((src (helm-get-current-source)) (src-keymap (assoc-default 'keymap src)) @@ -2354,19 +2474,16 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." (assoc-default 'history src))) (timer nil) blink-matching-paren + (resize-mini-windows (and (null helm-echo-input-in-header-line) + resize-mini-windows)) (first-src (car helm-sources)) + (first-src-val (if (symbolp first-src) + (symbol-value first-src) + first-src)) + (source-process-p (or (assq 'candidates-process src) + (assq 'candidates-process first-src-val))) (source-delayed-p (or (assq 'delayed src) - (assq 'delayed (if (symbolp first-src) - (symbol-value first-src) - first-src))))) - ;; Startup with the first keymap found either in current source - ;; or helm arg, otherwise use global value of `helm-map'. - ;; This map will be used as a `minibuffer-local-map'. - ;; Maybe it will be overriden when changing source - ;; by `helm--maybe-update-keymap'. - ;; Note that helm-map have been made buffer-local - ;; in `helm-create-helm-buffer'. - (setq helm-map (or src-keymap any-keymap helm-map)) + (assq 'delayed first-src-val)))) (helm-log "helm-get-candidate-number => %S" (helm-get-candidate-number)) (helm-log "helm-execute-action-at-once-if-one = %S" @@ -2384,11 +2501,21 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." ;; display if no result found with precedent value of `helm-pattern' ;; unless `helm-quit-if-no-candidate' is non--nil, in this case ;; Don't force update with an empty pattern. - ;; Reset also `helm-maybe-use-default-as-input' as this checking + ;; Reset also `helm--maybe-use-default-as-input' as this checking ;; happen only on startup. - (when (and helm-maybe-use-default-as-input (not source-delayed-p)) - (setq helm-pattern "") - (setq helm-maybe-use-default-as-input nil) + (when helm--maybe-use-default-as-input + ;; Store value of `default' temporarily here waiting next update + ;; to allow actions like helm-moccur-action matching pattern + ;; at the place it jump to. + (setq helm-input helm-pattern) + (if (or source-delayed-p source-process-p) + ;; Reset pattern to next update. + (with-helm-after-update-hook + (helm--reset-default-pattern)) + ;; Reset pattern right now. + (helm--reset-default-pattern)) + ;; Ensure force-update when no candidates + ;; when we start with an empty pattern. (and (helm-empty-buffer-p) (null helm-quit-if-no-candidate) (helm-force-update))) @@ -2397,14 +2524,14 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." (cond ((and helm-execute-action-at-once-if-one (not source-delayed-p) (= (helm-get-candidate-number) 1)) - (ignore)) ; Don't enter the minibuffer loop. + (ignore)) ; Don't enter the minibuffer loop. ((and helm-quit-if-no-candidate (not source-delayed-p) (= (helm-get-candidate-number) 0)) (setq helm-quit t) (and (functionp helm-quit-if-no-candidate) (funcall helm-quit-if-no-candidate))) - (t ; Enter now minibuffer and wait for input. + (t ; Enter now minibuffer and wait for input. (let ((tap (or any-default (with-helm-current-buffer (thing-at-point 'symbol))))) @@ -2413,25 +2540,32 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'." #'(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. - (setq minor-mode-overriding-map-alist - `((helm--minor-mode - . ,(with-helm-buffer helm-map)))) - (setq timer (run-with-idle-timer - (max helm-input-idle-delay 0.001) 'repeat - #'(lambda () - ;; Stop updating when 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))))))) + ;; 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 helm-inherit-input-method)) + nil hist tap + helm-inherit-input-method)) (when timer (cancel-timer timer) (setq timer nil))))))))) (defun helm-exit-or-quit-maybe () @@ -2506,23 +2640,24 @@ This can be useful for e.g writing quietly a complex regexp." (setq helm--reading-passwd-or-string nil) (setq helm-suspend-update-flag nil))) -(defun helm--maybe-update-keymap () +(defun helm--maybe-update-keymap (&optional map) "Handle differents keymaps in multiples sources. It will override `helm-map' with the local map of current source. If no map is found in current source do nothing (keep previous map)." (with-helm-buffer - (helm-aif (assoc-default 'keymap (helm-get-current-source)) - ;; We need the timer to leave enough time - ;; to helm to setup its buffer when changing source - ;; from a recursive minibuffer. + (helm-aif (or map (assoc-default 'keymap (helm-get-current-source))) + ;; We used a timer in the past to leave + ;; enough time to helm to setup its keymap + ;; when changing source from a recursive minibuffer. ;; e.g C-x C-f M-y C-g ;; => *find-files have now the bindings of *kill-ring. - (run-with-idle-timer - 0.01 nil - (lambda () - (with-current-buffer (window-buffer (minibuffer-window)) - (setq minor-mode-overriding-map-alist `((helm--minor-mode . ,it))))))))) + ;; It is no more true now we are using `minor-mode-overriding-map-alist' + ;; and `helm--minor-mode' thus it fix issue #1076 for emacs-24.3 + ;; where concurrent timers are not supported. + ;; i.e update keymap+check input. + (with-current-buffer (window-buffer (minibuffer-window)) + (setq minor-mode-overriding-map-alist `((helm--minor-mode . ,it))))))) ;;; Prevent loosing focus when using mouse. ;; @@ -2558,6 +2693,12 @@ WARNING: Do not use this mode yourself, it is internal to helm." ;; Be sure we call this from helm-buffer. (helm-funcall-foreach 'cleanup)) (helm-kill-async-processes) + ;; Remove the temporary hooks added + ;; by `with-helm-temp-hook' that + ;; may not have been consumed. + (when helm--temp-hooks + (cl-loop for (fn . hook) in helm--temp-hooks + do (set hook (delete fn (symbol-value hook))))) ;; When running helm from a dedicated frame ;; with no minibuffer, helm will run in the main frame ;; which have a minibuffer, so be sure to disable @@ -2598,15 +2739,12 @@ WARNING: Do not use this mode yourself, it is internal to helm." "Check INPUT string and update the helm buffer if necessary." ;; First time minibuffer is entered ;; we check value of `helm-pattern' that have been set - ;; in `helm-initial-setup' when `helm-maybe-use-default-as-input' + ;; in `helm-initial-setup' when `helm--maybe-use-default-as-input' ;; is non--nil. After this initial check, reset - ;; `helm-maybe-use-default-as-input' and ignore this. + ;; `helm--maybe-use-default-as-input' and ignore this. ;; This happen only when source is `delayed'. - (when helm-maybe-use-default-as-input ; nil when non--delayed. - (setq input helm-pattern) - (with-helm-after-update-hook (setq helm-pattern "")) - (setq helm-maybe-use-default-as-input nil)) - ;; In delayed sources `helm-pattern' have not been resat yet. + (when helm--maybe-use-default-as-input ; nil when non--delayed. + (setq input helm-pattern)) (unless (equal input helm-pattern) (setq helm-pattern input) (unless (helm-action-window) @@ -2657,7 +2795,10 @@ Helm plug-ins are realized by this function." ;; Process candidates-(process) function ;; It may return a process or a list of candidates. (if candidate-proc - (helm-interpret-value candidate-proc source) + ;; Calling `helm-interpret-value' with no + ;; SOURCE arg force the use of `funcall' + ;; and not `helm-funcall-with-source'. + (helm-interpret-value candidate-proc) (helm-interpret-value candidate-fn source)) (error (helm-log "Error: %S" err) nil)))) (when (and (processp candidates) (not candidate-proc)) @@ -2747,7 +2888,8 @@ ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...) (if (and (listp it) (not (functionp it))) ;; Don't treat lambda's as list. (cl-loop for f in it - do (setq ,candidate (funcall f ,candidate))) + do (setq ,candidate (funcall f ,candidate)) + finally return ,candidate) (setq ,candidate (funcall it ,candidate))))) (defun helm--initialize-one-by-one-candidates (candidates source) @@ -2755,9 +2897,8 @@ ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...) Return CANDIDATES when pattern is empty." (helm-aif (and (string= helm-pattern "") (assoc-default 'filter-one-by-one source)) - (cl-loop for cand in candidates - do (helm--maybe-process-filter-one-by-one-candidate cand source) - collect cand) + (cl-loop for cand in candidates collect + (helm--maybe-process-filter-one-by-one-candidate cand source)) candidates)) (defun helm-process-filtered-candidate-transformer-maybe @@ -2937,11 +3078,13 @@ Score is calculated against number of contiguous matches found with PATTERN. If PATTERN is fully matched in CANDIDATE a maximal score (100) is given. A bonus of one point is given when PATTERN prefix match CANDIDATE. Contiguous matches have a coefficient of 2." - (let* ((pat-lookup (helm--collect-pairs-in-string pattern)) - (str-lookup (helm--collect-pairs-in-string candidate)) + (let* ((cand (if (stringp candidate) + candidate (helm-stringify candidate))) + (pat-lookup (helm--collect-pairs-in-string pattern)) + (str-lookup (helm--collect-pairs-in-string cand)) (bonus (if (equal (car pat-lookup) (car str-lookup)) 1 0)) (bonus1 (and (string-match (concat "\\<" (regexp-quote pattern) "\\>") - candidate) + cand) 100))) (+ bonus (or bonus1 ;; Give a coefficient of 2 for contiguous matches. @@ -2975,14 +3118,16 @@ sort on the real part." (funcall real-or-disp-fn s2) s2)) (data1 (or (gethash cand1 table-scr) - (puthash cand1 (list (helm-score-candidate-for-pattern - cand1 helm-pattern) - (length cand1)) + (puthash cand1 + (list (helm-score-candidate-for-pattern + cand1 helm-pattern) + (length (helm-stringify cand1))) table-scr))) (data2 (or (gethash cand2 table-scr) - (puthash cand2 (list (helm-score-candidate-for-pattern - cand2 helm-pattern) - (length cand2)) + (puthash cand2 + (list (helm-score-candidate-for-pattern + cand2 helm-pattern) + (length (helm-stringify cand2))) table-scr))) (len1 (cadr data1)) (len2 (cadr data2)) @@ -3272,8 +3417,10 @@ is done on whole `helm-buffer' and not on current source." (helm-log "end update"))))) ;; Update keymap after updating. -;; Putting this in a hook allow users to disable it. -(add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) +;; Now we run this in post-command-hook, it is +;; probably no more needed in helm-after-update-hook. +;; Leave it commented as a reminder for now. +;; (add-hook 'helm-after-update-hook 'helm--maybe-update-keymap) (defun helm-update-source-p (source) "Whether SOURCE need updating or not." @@ -3577,29 +3724,30 @@ Coerce source with coerce function." "Select an action for the currently selected candidate. If action buffer is selected, back to the helm buffer." (interactive) - (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-display-mode-line (helm-get-current-source)) - (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"))) - (run-hooks 'helm-window-configuration-hook)))) + (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))))) (defun helm-show-action-buffer (actions) (with-current-buffer (get-buffer-create helm-action-buffer) @@ -3690,16 +3838,59 @@ Possible value of DIRECTION are 'next or 'previous." helm-mode-line-string))) (setq mode-line-format (default-value 'mode-line-format))) ;; Setup header-line. - (when helm-display-header-line - (let* ((hlstr (helm-interpret-value - (and (listp source) - (assoc-default 'header-line source)) - source)) - (hlend (make-string (max 0 (- (window-width) (length hlstr))) ? ))) - (setq header-line-format - (propertize (concat " " hlstr hlend) 'face 'helm-header))))) + (cond (helm-echo-input-in-header-line + (setq force t) + (helm--set-header-line)) + (helm-display-header-line + (let* ((hlstr (helm-interpret-value + (and (listp source) + (assoc-default 'header-line source)) + source)) + (hlend (make-string (max 0 (- (window-width) + (length hlstr))) ? ))) + (setq header-line-format + (propertize (concat " " hlstr hlend) '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))) + (end (save-excursion (end-of-visual-line) (point))) + ;; The visual line where the cursor is. + (cont (buffer-substring beg end)) + (pref (propertize + " " + 'display (if (string-match-p (regexp-quote helm--prompt) cont) + '(space :width left-fringe) + (propertize + "->" + 'face 'helm-header-line-left-margin)))) + (pos (- (point) beg))) + (with-helm-buffer + (setq header-line-format (concat pref cont " ")) + (put-text-property + ;; Increment pos to handle the space before prompt (i.e `pref'). + (1+ pos) (+ 2 pos) + 'face 'cursor header-line-format) + (when update (force-mode-line-update)))))) + +(defun helm--update-header-line () + ;; This should be used in `post-command-hook', + ;; nowhere else. + (when (with-helm-buffer helm-echo-input-in-header-line) + (helm--set-header-line t))) + +(defun helm-hide-minibuffer-maybe () + "Hide minibuffer contents in a Helm session. +This function should normally go to `helm-minibuffer-set-up-hook'. +It has no effect if `helm-echo-input-in-header-line' is nil." + (when (with-helm-buffer helm-echo-input-in-header-line) + (let ((ov (make-overlay (point-min) (point-max) nil nil t))) + (overlay-put ov 'window (selected-window)) + (overlay-put ov 'face (let ((bg-color (face-background 'default nil))) + `(:background ,bg-color :foreground ,bg-color))) + (setq cursor-type nil)))) + (defun helm-show-candidate-number (&optional name) "Used to display candidate number in mode-line. You can specify NAME of candidates e.g \"Buffers\" otherwise @@ -4180,6 +4371,16 @@ before the candidate we want to preselect." (helm-pos-header-line-p) (eobp))))) +(defun helm-beginning-of-source-p (&optional at-point) + "Return non--nil if we are at bob or beginning of source." + (save-excursion + (if (and (helm-pos-multiline-p) (null at-point)) + (null (helm-get-previous-candidate-separator-pos)) + (forward-line (if at-point 0 -1)) + (or (eq (point-at-bol) (point-at-eol)) + (helm-pos-header-line-p) + (bobp))))) + (defun helm-edit-current-selection-internal (func) (with-helm-window (forward-line 0) @@ -4395,6 +4596,7 @@ To customize `helm-candidates-in-buffer' behavior, use `search', (clrhash helm-cib-hash) (cl-dolist (searcher search-fns) (goto-char start-point) + (forward-line 1) ; >>>[1] (setq newmatches nil) (cl-loop with pos-lst with item-count = 0 @@ -4449,13 +4651,22 @@ When using fuzzy matching and negation (i.e \"!\"), this function is always call do (forward-line 1)))) (defun helm--search-from-candidate-buffer-1 (search-fn) - ;; Previously we were adding a newline at bob and at eol - ;; and removing these newlines afterward, it seems it is no more - ;; needed, thus when searching for empty line ("^$") - ;; it was adding the first line as a matched line - ;; which is wrong. + ;; We are adding a newline at bob and at eol + ;; and removing these newlines afterward. + ;; This is a bad hack that should be removed. + ;; To avoid matching the empty line at first line + ;; when searching with e.g occur and "^$" just + ;; forward-line before searching (See >>>[1] above). + (goto-char (point-min)) + (insert "\n") + (goto-char (point-max)) + (insert "\n") (unwind-protect (funcall search-fn) + (goto-char (point-min)) + (delete-char 1) + (goto-char (1- (point-max))) + (delete-char 1) (set-buffer-modified-p nil))) (defun helm-candidate-buffer (&optional create-or-buffer) -- 2.47.3