Upgrade packages

This commit is contained in:
Gergely Polonkai 2016-09-15 11:18:17 +02:00
parent c6d477e36b
commit 697f492aba
167 changed files with 2215 additions and 2075 deletions

View File

@ -1,9 +1,10 @@
;;; company-autoloads.el --- automatically extracted autoloads ;;; company-autoloads.el --- automatically extracted autoloads
;; ;;
;;; Code: ;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company" "company.el" (22454 5294 352599 524000)) ;;;### (autoloads nil "company" "company.el" (22490 24940 331394
;;;;;; 500000))
;;; Generated autoloads from company.el ;;; Generated autoloads from company.el
(autoload 'company-mode "company" "\ (autoload 'company-mode "company" "\
@ -37,9 +38,8 @@ keymap during active completions (`company-active-map'):
\(fn &optional ARG)" t nil) \(fn &optional ARG)" t nil)
(defvar global-company-mode nil "\ (defvar global-company-mode nil "\
Non-nil if Global Company mode is enabled. Non-nil if Global-Company mode is enabled.
See the `global-company-mode' command See the command `global-company-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `global-company-mode'.") or call the function `global-company-mode'.")
@ -48,7 +48,7 @@ or call the function `global-company-mode'.")
(autoload 'global-company-mode "company" "\ (autoload 'global-company-mode "company" "\
Toggle Company mode in all buffers. Toggle Company mode in all buffers.
With prefix ARG, enable Global Company mode if ARG is positive; With prefix ARG, enable Global-Company mode if ARG is positive;
otherwise, disable it. If called from Lisp, enable the mode if otherwise, disable it. If called from Lisp, enable the mode if
ARG is omitted or nil. ARG is omitted or nil.
@ -73,8 +73,8 @@ inserted.
;;;*** ;;;***
;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22454 ;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22490
;;;;;; 5294 949613 562000)) ;;;;;; 24940 399394 311000))
;;; Generated autoloads from company-abbrev.el ;;; Generated autoloads from company-abbrev.el
(autoload 'company-abbrev "company-abbrev" "\ (autoload 'company-abbrev "company-abbrev" "\
@ -84,8 +84,8 @@ inserted.
;;;*** ;;;***
;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22454 5294 ;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22490 24940
;;;;;; 768609 306000)) ;;;;;; 379394 367000))
;;; Generated autoloads from company-bbdb.el ;;; Generated autoloads from company-bbdb.el
(autoload 'company-bbdb "company-bbdb" "\ (autoload 'company-bbdb "company-bbdb" "\
@ -95,8 +95,8 @@ inserted.
;;;*** ;;;***
;;;### (autoloads nil "company-css" "company-css.el" (22454 5294 ;;;### (autoloads nil "company-css" "company-css.el" (22490 24940
;;;;;; 307598 466000)) ;;;;;; 327394 512000))
;;; Generated autoloads from company-css.el ;;; Generated autoloads from company-css.el
(autoload 'company-css "company-css" "\ (autoload 'company-css "company-css" "\
@ -106,8 +106,8 @@ inserted.
;;;*** ;;;***
;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22454 ;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22490
;;;;;; 5294 565604 532000)) ;;;;;; 24940 355394 433000))
;;; Generated autoloads from company-dabbrev.el ;;; Generated autoloads from company-dabbrev.el
(autoload 'company-dabbrev "company-dabbrev" "\ (autoload 'company-dabbrev "company-dabbrev" "\
@ -118,7 +118,7 @@ dabbrev-like `company-mode' completion backend.
;;;*** ;;;***
;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el" ;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el"
;;;;;; (22454 5294 475602 417000)) ;;;;;; (22490 24940 347394 456000))
;;; Generated autoloads from company-dabbrev-code.el ;;; Generated autoloads from company-dabbrev-code.el
(autoload 'company-dabbrev-code "company-dabbrev-code" "\ (autoload 'company-dabbrev-code "company-dabbrev-code" "\
@ -130,8 +130,8 @@ comments or strings.
;;;*** ;;;***
;;;### (autoloads nil "company-elisp" "company-elisp.el" (22454 5295 ;;;### (autoloads nil "company-elisp" "company-elisp.el" (22490 24940
;;;;;; 17615 161000)) ;;;;;; 407394 288000))
;;; Generated autoloads from company-elisp.el ;;; Generated autoloads from company-elisp.el
(autoload 'company-elisp "company-elisp" "\ (autoload 'company-elisp "company-elisp" "\
@ -141,8 +141,8 @@ comments or strings.
;;;*** ;;;***
;;;### (autoloads nil "company-etags" "company-etags.el" (22454 5294 ;;;### (autoloads nil "company-etags" "company-etags.el" (22490 24940
;;;;;; 396600 559000)) ;;;;;; 339394 478000))
;;; Generated autoloads from company-etags.el ;;; Generated autoloads from company-etags.el
(autoload 'company-etags "company-etags" "\ (autoload 'company-etags "company-etags" "\
@ -152,8 +152,8 @@ comments or strings.
;;;*** ;;;***
;;;### (autoloads nil "company-files" "company-files.el" (22454 5294 ;;;### (autoloads nil "company-files" "company-files.el" (22490 24940
;;;;;; 611605 614000)) ;;;;;; 363394 410000))
;;; Generated autoloads from company-files.el ;;; Generated autoloads from company-files.el
(autoload 'company-files "company-files" "\ (autoload 'company-files "company-files" "\
@ -165,8 +165,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-gtags" "company-gtags.el" (22454 5294 ;;;### (autoloads nil "company-gtags" "company-gtags.el" (22490 24940
;;;;;; 137594 469000)) ;;;;;; 299394 590000))
;;; Generated autoloads from company-gtags.el ;;; Generated autoloads from company-gtags.el
(autoload 'company-gtags "company-gtags" "\ (autoload 'company-gtags "company-gtags" "\
@ -176,8 +176,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-ispell" "company-ispell.el" (22454 ;;;### (autoloads nil "company-ispell" "company-ispell.el" (22490
;;;;;; 5294 983614 361000)) ;;;;;; 24940 403394 299000))
;;; Generated autoloads from company-ispell.el ;;; Generated autoloads from company-ispell.el
(autoload 'company-ispell "company-ispell" "\ (autoload 'company-ispell "company-ispell" "\
@ -187,8 +187,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-keywords" "company-keywords.el" (22454 ;;;### (autoloads nil "company-keywords" "company-keywords.el" (22490
;;;;;; 5294 678607 190000)) ;;;;;; 24940 371394 389000))
;;; Generated autoloads from company-keywords.el ;;; Generated autoloads from company-keywords.el
(autoload 'company-keywords "company-keywords" "\ (autoload 'company-keywords "company-keywords" "\
@ -198,8 +198,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-nxml" "company-nxml.el" (22454 5294 ;;;### (autoloads nil "company-nxml" "company-nxml.el" (22490 24940
;;;;;; 802610 105000)) ;;;;;; 383394 355000))
;;; Generated autoloads from company-nxml.el ;;; Generated autoloads from company-nxml.el
(autoload 'company-nxml "company-nxml" "\ (autoload 'company-nxml "company-nxml" "\
@ -209,8 +209,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (22454 ;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (22490
;;;;;; 5294 239596 867000)) ;;;;;; 24940 319394 534000))
;;; Generated autoloads from company-oddmuse.el ;;; Generated autoloads from company-oddmuse.el
(autoload 'company-oddmuse "company-oddmuse" "\ (autoload 'company-oddmuse "company-oddmuse" "\
@ -220,8 +220,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-semantic" "company-semantic.el" (22454 ;;;### (autoloads nil "company-semantic" "company-semantic.el" (22490
;;;;;; 5294 171595 268000)) ;;;;;; 24940 303394 579000))
;;; Generated autoloads from company-semantic.el ;;; Generated autoloads from company-semantic.el
(autoload 'company-semantic "company-semantic" "\ (autoload 'company-semantic "company-semantic" "\
@ -231,8 +231,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-tempo" "company-tempo.el" (22454 5294 ;;;### (autoloads nil "company-tempo" "company-tempo.el" (22490 24940
;;;;;; 520603 474000)) ;;;;;; 351394 444000))
;;; Generated autoloads from company-tempo.el ;;; Generated autoloads from company-tempo.el
(autoload 'company-tempo "company-tempo" "\ (autoload 'company-tempo "company-tempo" "\
@ -242,8 +242,8 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-xcode" "company-xcode.el" (22454 5294 ;;;### (autoloads nil "company-xcode" "company-xcode.el" (22490 24940
;;;;;; 871611 728000)) ;;;;;; 395394 322000))
;;; Generated autoloads from company-xcode.el ;;; Generated autoloads from company-xcode.el
(autoload 'company-xcode "company-xcode" "\ (autoload 'company-xcode "company-xcode" "\
@ -254,7 +254,7 @@ File paths with spaces are only supported inside strings.
;;;*** ;;;***
;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el" ;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el"
;;;;;; (22454 5294 837610 928000)) ;;;;;; (22490 24940 391394 333000))
;;; Generated autoloads from company-yasnippet.el ;;; Generated autoloads from company-yasnippet.el
(autoload 'company-yasnippet "company-yasnippet" "\ (autoload 'company-yasnippet "company-yasnippet" "\
@ -286,7 +286,7 @@ shadow backends that come after it. Recommended usages:
;;;### (autoloads nil nil ("company-capf.el" "company-clang.el" "company-cmake.el" ;;;### (autoloads nil nil ("company-capf.el" "company-clang.el" "company-cmake.el"
;;;;;; "company-eclim.el" "company-pkg.el" "company-template.el") ;;;;;; "company-eclim.el" "company-pkg.el" "company-template.el")
;;;;;; (22454 5294 726608 318000)) ;;;;;; (22490 24940 420783 348000))
;;;*** ;;;***

View File

@ -66,7 +66,8 @@ completion."
(with-temp-buffer (with-temp-buffer
(let (tags) (let (tags)
(when (= 0 (call-process company-gtags-executable nil (when (= 0 (call-process company-gtags-executable nil
(list (current-buffer) nil) nil "-xGq" (concat "^" prefix))) ;; "-T" goes through all the tag files listed in GTAGSLIBPATH
(list (current-buffer) nil) nil "-xGqT" (concat "^" prefix)))
(goto-char (point-min)) (goto-char (point-min))
(cl-loop while (cl-loop while
(re-search-forward (concat (re-search-forward (concat

View File

@ -210,6 +210,14 @@
"do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module" "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
"next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super" "next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
"then" "true" "undef" "unless" "until" "when" "while" "yield") "then" "true" "undef" "unless" "until" "when" "while" "yield")
;; From https://doc.rust-lang.org/grammar.html#keywords
;; but excluding unused reserved words: https://www.reddit.com/r/rust/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj
(rust-mode
"Self"
"as" "box" "break" "const" "continue" "crate" "else" "enum" "extern"
"false" "fn" "for" "if" "impl" "in" "let" "loop" "macro" "match" "mod"
"move" "mut" "pub" "ref" "return" "self" "static" "struct" "super"
"trait" "true" "type" "unsafe" "use" "where" "while")
(scala-mode (scala-mode
"abstract" "case" "catch" "class" "def" "do" "else" "extends" "false" "abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
"final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match" "final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
@ -225,8 +233,10 @@
) )
;; aliases ;; aliases
(js2-mode . javascript-mode) (js2-mode . javascript-mode)
(js2-jsx-mode . javascript-mode)
(espresso-mode . javascript-mode) (espresso-mode . javascript-mode)
(js-mode . javascript-mode) (js-mode . javascript-mode)
(js-jsx-mode . javascript-mode)
(cperl-mode . perl-mode) (cperl-mode . perl-mode)
(jde-mode . java-mode) (jde-mode . java-mode)
(ess-julia-mode . julia-mode)) (ess-julia-mode . julia-mode))

View File

@ -1,4 +1,4 @@
(define-package "company" "20160730.1516" "Modular text completion framework" (define-package "company" "20160829.1206" "Modular text completion framework"
'((emacs "24.1") '((emacs "24.1")
(cl-lib "0.5")) (cl-lib "0.5"))
:url "http://company-mode.github.io/" :keywords :url "http://company-mode.github.io/" :keywords

View File

@ -118,9 +118,13 @@ attention to case differences."
"Face used for the selection in the tooltip.") "Face used for the selection in the tooltip.")
(defface company-tooltip-search (defface company-tooltip-search
'((default :inherit company-tooltip-selection)) '((default :inherit highlight))
"Face used for the search string in the tooltip.") "Face used for the search string in the tooltip.")
(defface company-tooltip-search-selection
'((default :inherit highlight))
"Face used for the search string inside the selection in the tooltip.")
(defface company-tooltip-mouse (defface company-tooltip-mouse
'((default :inherit highlight)) '((default :inherit highlight))
"Face used for the tooltip item under the mouse.") "Face used for the tooltip item under the mouse.")
@ -2475,22 +2479,24 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
'company-tooltip-common-selection 'company-tooltip-common-selection
'company-tooltip-common) 'company-tooltip-common)
line) line)
(when selected (when (let ((re (funcall company-search-regexp-function
(if (let ((re (funcall company-search-regexp-function
company-search-string))) company-search-string)))
(and (not (string= re "")) (and (not (string= re ""))
(string-match re value (length company-prefix)))) (string-match re value (length company-prefix))))
(pcase-dolist (`(,mbeg . ,mend) (company--search-chunks)) (pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
(let ((beg (+ margin mbeg)) (let ((beg (+ margin mbeg))
(end (+ margin mend)) (end (+ margin mend))
(width (- width (length right)))) (width (- width (length right))))
(when (< beg width) (when (< beg width)
(font-lock-prepend-text-property beg (min end width) (font-lock-prepend-text-property beg (min end width) 'face
'face 'company-tooltip-search (if selected
line)))) 'company-tooltip-search-selection
(font-lock-append-text-property 0 width 'face 'company-tooltip-search)
'company-tooltip-selection line)))))
line))) (when selected
(font-lock-append-text-property 0 width 'face
'company-tooltip-selection
line))
(font-lock-append-text-property 0 width 'face (font-lock-append-text-property 0 width 'face
'company-tooltip 'company-tooltip
line) line)

View File

@ -4,7 +4,7 @@
(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company-quickhelp" "company-quickhelp.el" ;;;### (autoloads nil "company-quickhelp" "company-quickhelp.el"
;;;;;; (22297 53348 410925 167000)) ;;;;;; (22490 24939 611396 515000))
;;; Generated autoloads from company-quickhelp.el ;;; Generated autoloads from company-quickhelp.el
(defvar company-quickhelp-mode nil "\ (defvar company-quickhelp-mode nil "\

View File

@ -1 +1 @@
(define-package "company-quickhelp" "20160211.718" "Popup documentation for completion candidates" '((emacs "24.4") (company "0.8.9") (pos-tip "0.4.6")) :url "https://www.github.com/expez/company-quickhelp" :keywords '("company" "popup" "documentation" "quickhelp")) (define-package "company-quickhelp" "20160826.806" "Popup documentation for completion candidates" '((emacs "24.4") (company "0.8.9") (pos-tip "0.4.6")) :url "https://www.github.com/expez/company-quickhelp" :keywords '("company" "popup" "documentation" "quickhelp"))

View File

@ -1,12 +1,12 @@
;;; company-quickhelp.el --- Popup documentation for completion candidates ;;; company-quickhelp.el --- Popup documentation for completion candidates
;; Copyright (C) 2015, Lars Andersen ;; Copyright (C) 2016, Lars Andersen
;; Author: Lars Andersen <expez@expez.com> ;; Author: Lars Andersen <expez@expez.com>
;; URL: https://www.github.com/expez/company-quickhelp ;; URL: https://www.github.com/expez/company-quickhelp
;; Package-Version: 20160211.718 ;; Package-Version: 20160826.806
;; Keywords: company popup documentation quickhelp ;; Keywords: company popup documentation quickhelp
;; Version: 1.3.0 ;; Version: 1.4.0
;; Package-Requires: ((emacs "24.4") (company "0.8.9") (pos-tip "0.4.6")) ;; Package-Requires: ((emacs "24.4") (company "0.8.9") (pos-tip "0.4.6"))
;; This file is not part of GNU Emacs. ;; This file is not part of GNU Emacs.
@ -60,12 +60,6 @@ be triggered manually using `company-quickhelp-show'."
(const :tag "Don't limit the number of lines shown" nil)) (const :tag "Don't limit the number of lines shown" nil))
:group 'company-quickhelp) :group 'company-quickhelp)
(defvar company-quickhelp-mode-map
(let ((keymap (make-sparse-keymap)))
(define-key keymap (kbd "M-h") #'company-quickhelp-manual-begin)
keymap)
"The keymap used by `company-quickhelp'.")
(defvar company-quickhelp--timer nil (defvar company-quickhelp--timer nil
"Quickhelp idle timer.") "Quickhelp idle timer.")
@ -200,7 +194,7 @@ Most likely this means you're on a mac with an Emacs build using Cocoa instead o
;;;###autoload ;;;###autoload
(define-minor-mode company-quickhelp-mode (define-minor-mode company-quickhelp-mode
"Provides documentation popups for `company-mode' using `pos-tip'." "Provides documentation popups for `company-mode' using `pos-tip'."
:global t :keymap company-quickhelp-mode-map :global t
(if company-quickhelp-mode (if company-quickhelp-mode
(company-quickhelp--enable) (company-quickhelp--enable)
(company-quickhelp--disable))) (company-quickhelp--disable)))

View File

@ -1,2 +0,0 @@
;;; -*- no-byte-compile: t -*-
(define-package "dash" "20160813.951" "A modern list library for Emacs" 'nil :keywords '("lists"))

View File

@ -1,9 +1,10 @@
;;; dash-autoloads.el --- automatically extracted autoloads ;;; dash-autoloads.el --- automatically extracted autoloads
;; ;;
;;; Code: ;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil nil ("dash.el") (22454 5337 8602 510000)) ;;;### (autoloads nil nil ("dash-pkg.el" "dash.el") (22490 24939
;;;;;; 339398 67000))
;;;*** ;;;***

View File

@ -0,0 +1 @@
(define-package "dash" "20160820.501" "A modern list library for Emacs" 'nil :keywords '("lists"))

View File

@ -4,7 +4,7 @@
;; Author: Magnar Sveen <magnars@gmail.com> ;; Author: Magnar Sveen <magnars@gmail.com>
;; Version: 2.13.0 ;; Version: 2.13.0
;; Package-Version: 20160813.951 ;; Package-Version: 20160820.501
;; Keywords: lists ;; Keywords: lists
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -358,7 +358,7 @@ See also: `-each-indexed'."
(nreverse ,r)))) (nreverse ,r))))
(defun -map-when (pred rep list) (defun -map-when (pred rep list)
"Return a new list where the elements in LIST that does not match the PRED function "Return a new list where the elements in LIST that do not match the PRED function
are unchanged, and where the elements in LIST that do match the PRED function are mapped are unchanged, and where the elements in LIST that do match the PRED function are mapped
through the REP function. through the REP function.

View File

@ -1,4 +0,0 @@
(define-package "erlang" "20160719.535" "Erlang major mode" 'nil)
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -1,9 +1,9 @@
;;; erlang-autoloads.el --- automatically extracted autoloads ;;; erlang-autoloads.el --- automatically extracted autoloads
;; ;;
;;; Code: ;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "erlang" "erlang.el" (22454 5334 245537 541000)) ;;;### (autoloads nil "erlang" "erlang.el" (22490 24938 259400 312000))
;;; Generated autoloads from erlang.el ;;; Generated autoloads from erlang.el
(autoload 'erlang-mode "erlang" "\ (autoload 'erlang-mode "erlang" "\
@ -118,8 +118,8 @@ editing control characters:
;;;*** ;;;***
;;;### (autoloads nil "erlang-start" "erlang-start.el" (22454 5334 ;;;### (autoloads nil "erlang-start" "erlang-start.el" (22490 24938
;;;;;; 87533 826000)) ;;;;;; 243400 358000))
;;; Generated autoloads from erlang-start.el ;;; Generated autoloads from erlang-start.el
(let ((a '("\\.erl\\'" . erlang-mode)) (b '("\\.hrl\\'" . erlang-mode))) (or (assoc (car a) auto-mode-alist) (setq auto-mode-alist (cons a auto-mode-alist))) (or (assoc (car b) auto-mode-alist) (setq auto-mode-alist (cons b auto-mode-alist)))) (let ((a '("\\.erl\\'" . erlang-mode)) (b '("\\.hrl\\'" . erlang-mode))) (or (assoc (car a) auto-mode-alist) (setq auto-mode-alist (cons a auto-mode-alist))) (or (assoc (car b) auto-mode-alist) (setq auto-mode-alist (cons b auto-mode-alist))))
@ -132,7 +132,7 @@ editing control characters:
;;;### (autoloads nil nil ("erlang-eunit.el" "erlang-flymake.el" ;;;### (autoloads nil nil ("erlang-eunit.el" "erlang-flymake.el"
;;;;;; "erlang-pkg.el" "erlang-skels-old.el" "erlang-skels.el" "erlang-test.el" ;;;;;; "erlang-pkg.el" "erlang-skels-old.el" "erlang-skels.el" "erlang-test.el"
;;;;;; "erlang_appwiz.el") (22454 5334 358540 198000)) ;;;;;; "erlang_appwiz.el") (22490 24938 297767 827000))
;;;*** ;;;***

View File

@ -0,0 +1,4 @@
(define-package "erlang" "20160831.740" "Erlang major mode" 'nil)
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -56,8 +56,10 @@
erlang-skel-gen-event erlang-skel-header) erlang-skel-gen-event erlang-skel-header)
("gen_fsm" "gen-fsm" ("gen_fsm" "gen-fsm"
erlang-skel-gen-fsm erlang-skel-header) erlang-skel-gen-fsm erlang-skel-header)
("gen_statem" "gen-statem" ("gen_statem (StateName/3)" "gen-statem-StateName"
erlang-skel-gen-statem erlang-skel-header) erlang-skel-gen-statem-StateName erlang-skel-header)
("gen_statem (handle_event/4)" "gen-statem-handle-event"
erlang-skel-gen-statem-handle-event erlang-skel-header)
("wx_object" "wx-object" ("wx_object" "wx-object"
erlang-skel-wx-object erlang-skel-header) erlang-skel-wx-object erlang-skel-header)
("Library module" "gen-lib" ("Library module" "gen-lib"
@ -497,6 +499,7 @@ Please see the function `tempo-define-template'.")
"%% {stop, Reason}" n "%% {stop, Reason}" n
(erlang-skel-separator-end 2) (erlang-skel-separator-end 2)
"init([]) ->" n> "init([]) ->" n>
"process_flag(trap_exit, true)," n>
"{ok, #state{}}." n "{ok, #state{}}." n
n n
(erlang-skel-separator-start 2) (erlang-skel-separator-start 2)
@ -740,6 +743,7 @@ Please see the function `tempo-define-template'.")
"%% {stop, StopReason}" n "%% {stop, StopReason}" n
(erlang-skel-separator-end 2) (erlang-skel-separator-end 2)
"init([]) ->" n> "init([]) ->" n>
"process_flag(trap_exit, true)," n>
"{ok, state_name, #state{}}." n "{ok, state_name, #state{}}." n
n n
(erlang-skel-separator-start 2) (erlang-skel-separator-start 2)
@ -860,7 +864,7 @@ Please see the function `tempo-define-template'.")
"*The template of a gen_fsm. "*The template of a gen_fsm.
Please see the function `tempo-define-template'.") Please see the function `tempo-define-template'.")
(defvar erlang-skel-gen-statem (defvar erlang-skel-gen-statem-StateName
'((erlang-skel-include erlang-skel-large-header) '((erlang-skel-include erlang-skel-large-header)
"-behaviour(gen_statem)." n n "-behaviour(gen_statem)." n n
@ -868,8 +872,118 @@ Please see the function `tempo-define-template'.")
"-export([start_link/0])." n "-export([start_link/0])." n
n n
"%% gen_statem callbacks" n "%% gen_statem callbacks" n
"-export([init/1, terminate/3, code_change/4])." n "-export([callback_mode/0, init/1, terminate/3, code_change/4])." n
"-export([state_name/3])." n "-export([state_name/3])." n
n
"-define(SERVER, ?MODULE)." n
n
"-record(data, {})." n
n
(erlang-skel-double-separator-start 3)
"%%% API" n
(erlang-skel-double-separator-end 3) n
(erlang-skel-separator-start 2)
"%% @doc" n
"%% Creates a gen_statem process which calls Module:init/1 to" n
"%% initialize. To ensure a synchronized start-up procedure, this" n
"%% function does not return until Module:init/1 has returned." n
"%%" n
(erlang-skel-separator-end 2)
"-spec start_link() ->" n>
"{ok, Pid :: pid()} |" n>
"ignore |" n>
"{error, Error :: term()}." n
"start_link() ->" n>
"gen_statem:start_link({local, ?SERVER}, ?MODULE, [], [])." n
n
(erlang-skel-double-separator-start 3)
"%%% gen_statem callbacks" n
(erlang-skel-double-separator-end 3) n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% Define the callback_mode() for this callback module." n
(erlang-skel-separator-end 2)
"-spec callback_mode() -> gen_statem:callback_mode()." n
"callback_mode() -> state_functions." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% Whenever a gen_statem is started using gen_statem:start/[3,4] or" n
"%% gen_statem:start_link/[3,4], this function is called by the new" n
"%% process to initialize." n
(erlang-skel-separator-end 2)
"-spec init(Args :: term()) ->" n>
"{ok, State :: term(), Data :: term()} |" n>
"{ok, State :: term(), Data :: term()," n>
"[gen_statem:action()] | gen_statem:action()} |" n>
"ignore |" n>
"{stop, Reason :: term()}." n
"init([]) ->" n>
"process_flag(trap_exit, true)," n>
"{ok, state_name, #data{}}." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% There should be one function like this for each state name." n
"%% Whenever a gen_statem receives an event, the function " n
"%% with the name of the current state (StateName) " n
"%% is called to handle the event." n
"%%" n
"%% NOTE: If there is an exported function handle_event/4, it is called" n
"%% instead of StateName/3 functions like this!" n
(erlang-skel-separator-end 2)
"-spec state_name(" n>
"gen_statem:event_type(), Msg :: term()," n>
"Data :: term()) ->" n>
"gen_statem:state_function_result()." n
"state_name({call,Caller}, _Msg, Data) ->" n>
"{next_state, state_name, Data, [{reply,Caller,ok}]}." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% This function is called by a gen_statem when it is about to" n
"%% terminate. It should be the opposite of Module:init/1 and do any" n
"%% necessary cleaning up. When it returns, the gen_statem terminates with" n
"%% Reason. The return value is ignored." n
(erlang-skel-separator-end 2)
"-spec terminate(Reason :: term(), State :: term(), Data :: term()) ->" n>
"any()." n
"terminate(_Reason, _State, _Data) ->" n>
"void." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% Convert process state when code is changed" n
(erlang-skel-separator-end 2)
"-spec code_change(" n>
"OldVsn :: term() | {down,term()}," n>
"State :: term(), Data :: term(), Extra :: term()) ->" n>
"{ok, NewState :: term(), NewData :: term()} |" n>
"(Reason :: term())." n
"code_change(_OldVsn, State, Data, _Extra) ->" n>
"{ok, State, Data}." n
n
(erlang-skel-double-separator-start 3)
"%%% Internal functions" n
(erlang-skel-double-separator-end 3)
)
"*The template of a gen_statem (StateName/3).
Please see the function `tempo-define-template'.")
(defvar erlang-skel-gen-statem-handle-event
'((erlang-skel-include erlang-skel-large-header)
"-behaviour(gen_statem)." n n
"%% API" n
"-export([start_link/0])." n
n
"%% gen_statem callbacks" n
"-export([callback_mode/0, init/1, terminate/3, code_change/4])." n
"-export([handle_event/4])." n "-export([handle_event/4])." n
n n
"-define(SERVER, ?MODULE)." n "-define(SERVER, ?MODULE)." n
@ -899,43 +1013,35 @@ Please see the function `tempo-define-template'.")
(erlang-skel-separator-start 2) (erlang-skel-separator-start 2)
"%% @private" n "%% @private" n
"%% @doc" n "%% @doc" n
"%% Define the callback_mode() for this callback module." n
(erlang-skel-separator-end 2)
"-spec callback_mode() -> gen_statem:callback_mode()." n
"callback_mode() -> handle_event_function." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% Whenever a gen_statem is started using gen_statem:start/[3,4] or" n "%% Whenever a gen_statem is started using gen_statem:start/[3,4] or" n
"%% gen_statem:start_link/[3,4], this function is called by the new" n "%% gen_statem:start_link/[3,4], this function is called by the new" n
"%% process to initialize." n "%% process to initialize." n
(erlang-skel-separator-end 2) (erlang-skel-separator-end 2)
"-spec init(Args :: term()) ->" n> "-spec init(Args :: term()) ->" n>
"{gen_statem:callback_mode()," n> "{ok, State :: term(), Data :: term()} |" n>
"State :: term(), Data :: term()} |" n> "{ok, State :: term(), Data :: term()," n>
"{gen_statem:callback_mode()," n>
"State :: term(), Data :: term()," n>
"[gen_statem:action()] | gen_statem:action()} |" n> "[gen_statem:action()] | gen_statem:action()} |" n>
"ignore |" n> "ignore |" n>
"{stop, Reason :: term()}." n "{stop, Reason :: term()}." n
"init([]) ->" n> "init([]) ->" n>
"{state_functions, state_name, #data{}}." n "process_flag(trap_exit, true)," n>
"{ok, state_name, #data{}}." n
n n
(erlang-skel-separator-start 2) (erlang-skel-separator-start 2)
"%% @private" n "%% @private" n
"%% @doc" n "%% @doc" n
"%% If the gen_statem runs with CallbackMode =:= state_functions" n "%% This function is called for every event a gen_statem receives." n
"%% there should be one instance of this function for each possible" n "%%" n
"%% state name. Whenever a gen_statem receives an event," n "%% NOTE: If there is no exported function handle_event/4," n
"%% the instance of this function with the same name" n "%% StateName/3 functions are called instead!" n
"%% as the current state name StateName is called to" n
"%% handle the event." n
(erlang-skel-separator-end 2)
"-spec state_name(" n>
"gen_statem:event_type(), Msg :: term()," n>
"Data :: term()) ->" n>
"gen_statem:state_function_result()." n
"state_name({call,Caller}, _Msg, Data) ->" n>
"{next_state, state_name, Data, [{reply,Caller,ok}]}." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% If the gen_statem runs with CallbackMode =:= handle_event_function" n
"%% this function is called for every event a gen_statem receives." n
(erlang-skel-separator-end 2) (erlang-skel-separator-end 2)
"-spec handle_event(" n> "-spec handle_event(" n>
"gen_statem:event_type(), Msg :: term()," n> "gen_statem:event_type(), Msg :: term()," n>
@ -965,17 +1071,16 @@ Please see the function `tempo-define-template'.")
"-spec code_change(" n> "-spec code_change(" n>
"OldVsn :: term() | {down,term()}," n> "OldVsn :: term() | {down,term()}," n>
"State :: term(), Data :: term(), Extra :: term()) ->" n> "State :: term(), Data :: term(), Extra :: term()) ->" n>
"{gen_statem:callback_mode()," n> "{ok, NewState :: term(), NewData :: term()} |" n>
"NewState :: term(), NewData :: term()} |" n>
"(Reason :: term())." n "(Reason :: term())." n
"code_change(_OldVsn, State, Data, _Extra) ->" n> "code_change(_OldVsn, State, Data, _Extra) ->" n>
"{state_functions, State, Data}." n "{ok, State, Data}." n
n n
(erlang-skel-double-separator-start 3) (erlang-skel-double-separator-start 3)
"%%% Internal functions" n "%%% Internal functions" n
(erlang-skel-double-separator-end 3) (erlang-skel-double-separator-end 3)
) )
"*The template of a gen_statem. "*The template of a gen_statem (handle_event/4).
Please see the function `tempo-define-template'.") Please see the function `tempo-define-template'.")
(defvar erlang-skel-wx-object (defvar erlang-skel-wx-object

View File

@ -52,28 +52,42 @@ concatenated to form an erlang file to test on.")
(ert-deftest erlang-test-tags () (ert-deftest erlang-test-tags ()
(let* ((dir (make-temp-file "erlang-test" t)) (let* ((dir (make-temp-file "erlang-test" t))
(erlang-file (expand-file-name "erlang_test.erl" dir)) (erlang-file (expand-file-name "erlang_test.erl" dir))
(tags-file (expand-file-name "TAGS" dir)) (tags-file (expand-file-name "TAGS" dir))
tags-file-name tags-table-list erlang-buffer) (old-tags-file-name (default-value 'tags-file-name))
(unwind-protect (old-tags-table-list (default-value 'tags-table-list))
(progn tags-file-name
(erlang-test-create-erlang-file erlang-file) tags-table-list
(erlang-test-compile-tags erlang-file tags-file) tags-table-set-list
(setq erlang-buffer (find-file-noselect erlang-file)) erlang-buffer
(with-current-buffer erlang-buffer erlang-mode-hook
(setq-local tags-file-name tags-file)) prog-mode-hook
;; Setting global tags-file-name is a workaround for erlang-shell-mode-hook
;; GNU Emacs bug#23164. tags-add-tables)
(setq tags-file-name tags-file) (unwind-protect
(erlang-test-completion-table) (progn
(erlang-test-xref-find-definitions erlang-file erlang-buffer)) (setq-default tags-file-name nil)
(when (buffer-live-p erlang-buffer) (setq-default tags-table-list nil)
(kill-buffer erlang-buffer)) (erlang-test-create-erlang-file erlang-file)
(let ((tags-buffer (find-buffer-visiting tags-file))) (erlang-test-compile-tags erlang-file tags-file)
(when (buffer-live-p tags-buffer) (setq erlang-buffer (find-file-noselect erlang-file))
(kill-buffer tags-buffer))) (with-current-buffer erlang-buffer
(when (file-exists-p dir) (setq-local tags-file-name tags-file))
(delete-directory dir t))))) ;; Setting global tags-file-name is a workaround for
;; GNU Emacs bug#23164.
(setq tags-file-name tags-file)
(erlang-test-complete-at-point tags-file)
(erlang-test-completion-table)
(erlang-test-xref-find-definitions erlang-file erlang-buffer))
(when (buffer-live-p erlang-buffer)
(kill-buffer erlang-buffer))
(let ((tags-buffer (find-buffer-visiting tags-file)))
(when (buffer-live-p tags-buffer)
(kill-buffer tags-buffer)))
(when (file-exists-p dir)
(delete-directory dir t))
(setq-default tags-file-name old-tags-file-name)
(setq-default tags-table-list old-tags-table-list))))
(defun erlang-test-create-erlang-file (erlang-file) (defun erlang-test-create-erlang-file (erlang-file)
(with-temp-file erlang-file (with-temp-file erlang-file
@ -116,6 +130,54 @@ concatenated to form an erlang file to test on.")
(should (eq expected-line (line-number-at-pos))) (should (eq expected-line (line-number-at-pos)))
(should (= (point-at-bol) (point)))) (should (= (point-at-bol) (point))))
(defun erlang-test-complete-at-point (tags-file)
(with-temp-buffer
(erlang-mode)
(setq-local tags-file-name tags-file)
(insert "\nerlang_test:fun")
(erlang-complete-tag)
(should (looking-back "erlang_test:function"))
(insert "\nfun")
(erlang-complete-tag)
(should (looking-back "function"))
(insert "\nerlang_")
(erlang-complete-tag)
(should (looking-back "erlang_test:"))))
(ert-deftest erlang-test-compile-options ()
(erlang-test-format-opt t
"t")
(erlang-test-format-opt nil
"nil")
(erlang-test-format-opt (cons 1 2)
"{1, 2}")
(erlang-test-format-opt (list 1)
"[1]")
(erlang-test-format-opt (list 1 2)
"[1, 2]")
(erlang-test-format-opt (list 1 2 3)
"[1, 2, 3]")
(erlang-test-format-opt 'symbol
"symbol")
(erlang-test-format-opt "string"
"\"string\"")
(erlang-test-format-opt []
"{}")
(erlang-test-format-opt [1]
"{1}")
(erlang-test-format-opt [1 2]
"{1, 2}")
(erlang-test-format-opt [1 2 (3 [4 5 6] 7)]
"{1, 2, [3, {4, 5, 6}, 7]}"))
(defun erlang-test-format-opt (elisp &optional expected-erlang)
(let ((erlang (inferior-erlang-format-opt elisp)))
(message "%s -> %s" elisp erlang)
(when expected-erlang
(should (equal erlang expected-erlang)))
erlang))
(provide 'erlang-test) (provide 'erlang-test)

View File

@ -1436,8 +1436,6 @@ Other commands:
(erlang-skel-init) (erlang-skel-init)
(when (fboundp 'tempo-use-tag-list) (when (fboundp 'tempo-use-tag-list)
(tempo-use-tag-list 'erlang-tempo-tags)) (tempo-use-tag-list 'erlang-tempo-tags))
(when (boundp 'xref-backend-functions)
(add-hook 'xref-backend-functions #'erlang-etags--xref-backend nil t))
(run-hooks 'erlang-mode-hook) (run-hooks 'erlang-mode-hook)
(if (zerop (buffer-size)) (if (zerop (buffer-size))
(run-hooks 'erlang-new-file-hook))) (run-hooks 'erlang-new-file-hook)))
@ -1548,9 +1546,7 @@ Other commands:
(set (make-local-variable 'outline-regexp) "[[:lower:]0-9_]+ *(.*) *-> *$") (set (make-local-variable 'outline-regexp) "[[:lower:]0-9_]+ *(.*) *-> *$")
(set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'outline-level) (lambda () 1))
(set (make-local-variable 'add-log-current-defun-function) (set (make-local-variable 'add-log-current-defun-function)
'erlang-current-defun) 'erlang-current-defun))
(set (make-local-variable 'find-tag-default-function)
'erlang-find-tag-for-completion))
(defun erlang-font-lock-init () (defun erlang-font-lock-init ()
"Initialize Font Lock for Erlang mode." "Initialize Font Lock for Erlang mode."
@ -3233,18 +3229,16 @@ With argument, do this that many times."
(interactive "p") (interactive "p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(while (and (looking-at "[ \t]*[%\n]") (while (and (looking-at "[ \t]*[%\n]")
(zerop (forward-line 1)))) (zerop (forward-line 1))))
;; Move to the next clause. ;; Move to the next clause.
(erlang-beginning-of-clause (- arg)) (erlang-beginning-of-clause (- arg))
(beginning-of-line);; Just to be sure... (beginning-of-line);; Just to be sure...
(let ((continue t)) (let ((continue t))
(while (and (not (bobp)) continue) (while (and (not (bobp)) continue)
(forward-line -1) (forward-line -1)
(skip-chars-forward " \t") (unless (looking-at "[ \t]*[%\n]")
(if (looking-at "[%\n]") (end-of-line)
nil (setq continue nil)))))
(end-of-line)
(setq continue nil)))))
(defun erlang-mark-clause () (defun erlang-mark-clause ()
"Put mark at end of clause, point at beginning." "Put mark at end of clause, point at beginning."
@ -4352,11 +4346,6 @@ as on the old form `tag'.
In the completion list, `module:tag' and `module:' shows up. In the completion list, `module:tag' and `module:' shows up.
Call this function from an appropriate init file, or add it to
Erlang mode hook with the commands:
(add-hook 'erlang-mode-hook 'erlang-tags-init)
(add-hook 'erlang-shell-mode-hook 'erlang-tags-init)
This function only works under Emacs 18 and Emacs 19. Currently, It This function only works under Emacs 18 and Emacs 19. Currently, It
is not implemented under XEmacs. (Hint: The Emacs 19 etags module is not implemented under XEmacs. (Hint: The Emacs 19 etags module
works under XEmacs.)" works under XEmacs.)"
@ -4367,11 +4356,16 @@ works under XEmacs.)"
(setq erlang-tags-installed t)) (setq erlang-tags-installed t))
(t (t
(require 'etags) (require 'etags)
;; Test on a function available in the Emacs 19 version (set (make-local-variable 'find-tag-default-function)
;; of tags but not in the XEmacs version. 'erlang-find-tag-for-completion)
(when (fboundp 'find-tag-noselect) (if (>= emacs-major-version 25)
(erlang-tags-define-keys (current-local-map)) (add-hook 'xref-backend-functions
(setq erlang-tags-installed t))))) #'erlang-etags--xref-backend nil t)
;; Test on a function available in the Emacs 19 version
;; of tags but not in the XEmacs version.
(when (fboundp 'find-tag-noselect)
(erlang-tags-define-keys (current-local-map))
(setq erlang-tags-installed t))))))
@ -4775,8 +4769,6 @@ for a tag on the form `module:tag'."
;;; completion-table' containing all normal tags plus tags on the form ;;; completion-table' containing all normal tags plus tags on the form
;;; `module:tag' and `module:'. ;;; `module:tag' and `module:'.
;; PENDING - Should probably make use of the
;; `completion-at-point-functions' hook instead of this advice.
(when (and (locate-library "etags") (when (and (locate-library "etags")
(require 'etags) (require 'etags)
(fboundp 'etags-tags-completion-table) (fboundp 'etags-tags-completion-table)
@ -4784,11 +4776,7 @@ for a tag on the form `module:tag'."
(if (fboundp 'advice-add) (if (fboundp 'advice-add)
;; Emacs 24.4+ ;; Emacs 24.4+
(advice-add 'etags-tags-completion-table :around (advice-add 'etags-tags-completion-table :around
(lambda (oldfun) #'erlang-etags-tags-completion-table-advice)
(if erlang-replace-etags-tags-completion-table
(erlang-etags-tags-completion-table)
(funcall oldfun)))
(list :name 'erlang-replace-tags-table))
;; Emacs 23.1-24.3 ;; Emacs 23.1-24.3
(defadvice etags-tags-completion-table (around (defadvice etags-tags-completion-table (around
erlang-replace-tags-table erlang-replace-tags-table
@ -4797,6 +4785,11 @@ for a tag on the form `module:tag'."
(setq ad-return-value (erlang-etags-tags-completion-table)) (setq ad-return-value (erlang-etags-tags-completion-table))
ad-do-it)))) ad-do-it))))
(defun erlang-etags-tags-completion-table-advice (oldfun)
(if erlang-replace-etags-tags-completion-table
(erlang-etags-tags-completion-table)
(funcall oldfun)))
(defun erlang-complete-tag () (defun erlang-complete-tag ()
"Perform tags completion on the text around point. "Perform tags completion on the text around point.
Completes to the set of names listed in the current tags table. Completes to the set of names listed in the current tags table.
@ -4807,8 +4800,7 @@ about Erlang modules."
(condition-case nil (condition-case nil
(require 'etags) (require 'etags)
(error nil)) (error nil))
(cond ((and erlang-tags-installed (cond ((and (fboundp 'etags-tags-completion-table)
(fboundp 'etags-tags-completion-table)
(fboundp 'tags-lazy-completion-table)) ; Emacs 23.1+ (fboundp 'tags-lazy-completion-table)) ; Emacs 23.1+
(let ((erlang-replace-etags-tags-completion-table t)) (let ((erlang-replace-etags-tags-completion-table t))
(complete-tag))) (complete-tag)))
@ -5213,19 +5205,10 @@ The following special commands are available:
(setq comint-input-ignoredups t) (setq comint-input-ignoredups t)
(setq comint-scroll-show-maximum-output t) (setq comint-scroll-show-maximum-output t)
(setq comint-scroll-to-bottom-on-output t) (setq comint-scroll-to-bottom-on-output t)
;; In Emacs 19.30, `add-hook' has got a `local' flag, use it. If (add-hook 'comint-output-filter-functions
;; the call fails, just call the normal `add-hook'. 'inferior-erlang-strip-delete nil t)
(condition-case nil (add-hook 'comint-output-filter-functions
(progn 'inferior-erlang-strip-ctrl-m nil t)
(add-hook 'comint-output-filter-functions
'inferior-erlang-strip-delete nil t)
(add-hook 'comint-output-filter-functions
'inferior-erlang-strip-ctrl-m nil t))
(error
(funcall (symbol-function 'make-local-hook)
'comint-output-filter-functions) ; obsolete as of Emacs 21.1
(add-hook 'comint-output-filter-functions 'inferior-erlang-strip-delete)
(add-hook 'comint-output-filter-functions 'inferior-erlang-strip-ctrl-m)))
;; Some older versions of comint don't have an input ring. ;; Some older versions of comint don't have an input ring.
(if (fboundp 'comint-read-input-ring) (if (fboundp 'comint-read-input-ring)
(progn (progn
@ -5251,6 +5234,7 @@ The following special commands are available:
(define-key map [menu-bar compilation] (define-key map [menu-bar compilation]
(cons "Errors" compilation-menu-map))) (cons "Errors" compilation-menu-map)))
map))))) map)))))
(erlang-tags-init)
(run-hooks 'erlang-shell-mode-hook)) (run-hooks 'erlang-shell-mode-hook))
@ -5730,31 +5714,29 @@ unless the optional NO-DISPLAY is non-nil."
(defun inferior-erlang-format-comma-opts (opts) (defun inferior-erlang-format-comma-opts (opts)
(if (null opts) (if (null opts)
"" ""
(concat ", " (inferior-erlang-format-opts opts)))) (concat ", " (inferior-erlang-format-opt opts))))
(defun inferior-erlang-format-opts (opts)
(concat "[" (inferior-erlang-string-join (mapcar 'inferior-erlang-format-opt
opts)
", ")
"]"))
(defun inferior-erlang-format-opt (opt) (defun inferior-erlang-format-opt (opt)
(cond ((stringp opt) (concat "\"" opt "\"")) (cond ((stringp opt) (concat "\"" opt "\""))
((atom opt) (format "%s" opt)) ((vectorp opt) (inferior-erlang-tuple (append opt nil)))
((consp opt) (concat "{" (inferior-erlang-string-join ((atom opt) (format "%s" opt))
(mapcar 'inferior-erlang-format-opt ((consp opt) (if (listp (cdr opt))
(list (car opt) (cdr opt))) (inferior-erlang-list opt)
", ") (inferior-erlang-tuple (list (car opt) (cdr opt)))))
"}")) (t (error "Unexpected erlang compile option %s" opt))))
(t (error (format "Unexpected opt %s" opt)))))
(defun inferior-erlang-tuple (opts)
(concat "{" (mapconcat 'inferior-erlang-format-opt
opts
", ")
"}"))
(defun inferior-erlang-list (opts)
(concat "[" (mapconcat 'inferior-erlang-format-opt
opts
", ")
"]"))
(defun inferior-erlang-string-join (strs sep)
(let ((result (or (car strs) "")))
(setq strs (cdr strs))
(while strs
(setq result (concat result sep (car strs)))
(setq strs (cdr strs)))
result))
(defun erlang-local-buffer-file-name () (defun erlang-local-buffer-file-name ()
;; When editing a file remotely via tramp, ;; When editing a file remotely via tramp,

View File

@ -1 +0,0 @@
(define-package "ggtags" "20160617.1840" "emacs frontend to GNU Global source code tagging system" '((emacs "24") (cl-lib "0.5")) :url "https://github.com/leoliu/ggtags" :keywords '("tools" "convenience"))

View File

@ -3,7 +3,7 @@
;;; Code: ;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "ggtags" "ggtags.el" (22387 29370 530154 256000)) ;;;### (autoloads nil "ggtags" "ggtags.el" (22490 24937 307403 1000))
;;; Generated autoloads from ggtags.el ;;; Generated autoloads from ggtags.el
(autoload 'ggtags-find-project "ggtags" "\ (autoload 'ggtags-find-project "ggtags" "\

View File

@ -0,0 +1 @@
(define-package "ggtags" "20160909.813" "emacs frontend to GNU Global source code tagging system" '((emacs "24") (cl-lib "0.5")) :url "https://github.com/leoliu/ggtags" :keywords '("tools" "convenience"))

View File

@ -4,7 +4,7 @@
;; Author: Leo Liu <sdl.web@gmail.com> ;; Author: Leo Liu <sdl.web@gmail.com>
;; Version: 0.8.12 ;; Version: 0.8.12
;; Package-Version: 20160617.1840 ;; Package-Version: 20160909.813
;; Keywords: tools, convenience ;; Keywords: tools, convenience
;; Created: 2013-01-29 ;; Created: 2013-01-29
;; URL: https://github.com/leoliu/ggtags ;; URL: https://github.com/leoliu/ggtags
@ -466,32 +466,36 @@ Set to `nil' to disable tag highlighting."
(defun ggtags-make-project (root) (defun ggtags-make-project (root)
(cl-check-type root string) (cl-check-type root string)
(pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" root))) (let* ((default-directory (file-name-as-directory root))
(`(,mtime ,_ ,tag-size . ,_) ;; NOTE: use of GTAGSDBPATH is not recommended. -- GLOBAL(1)
(let* ((default-directory (file-name-as-directory root)) ;; ROOT and DB can be different directories due to GTAGSDBPATH.
(rtags-size (nth 7 (file-attributes "GRTAGS"))) (dbdir (concat (file-remote-p root)
(has-refs (ggtags-process-string "global" "-p"))))
(when rtags-size (pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" dbdir)))
(and (or (> rtags-size (* 32 1024)) (`(,mtime ,_ ,tag-size . ,_)
(with-demoted-errors "ggtags-make-project: %S" (let* ((rtags-size (nth 7 (file-attributes (expand-file-name "GRTAGS" dbdir))))
(not (equal "" (ggtags-process-string "global" "-crs"))))) (has-refs
'has-refs))) (when rtags-size
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518 (and (or (> rtags-size (* 32 1024))
(has-path-style (with-demoted-errors "ggtags-make-project: %S"
(and (ggtags-process-succeed-p "global" "--path-style" "shorter" "--help") (not (equal "" (ggtags-process-string "global" "-crs")))))
'has-path-style)) 'has-refs)))
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542 ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518
(has-color (and (ggtags-process-succeed-p "global" "--color" "--help") (has-path-style
'has-color))) (and (ggtags-process-succeed-p "global" "--path-style" "shorter" "--help")
(puthash default-directory 'has-path-style))
(ggtags-project--make :root default-directory ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542
:tag-size tag-size (has-color (and (ggtags-process-succeed-p "global" "--color" "--help")
:has-refs has-refs 'has-color)))
:has-path-style has-path-style (puthash default-directory
:has-color has-color (ggtags-project--make :root default-directory
:mtime (float-time mtime) :tag-size tag-size
:timestamp (float-time)) :has-refs has-refs
ggtags-projects))))) :has-path-style has-path-style
:has-color has-color
:mtime (float-time mtime)
:timestamp (float-time))
ggtags-projects))))))
(defun ggtags-project-expired-p (project) (defun ggtags-project-expired-p (project)
(or (< (ggtags-project-timestamp project) 0) (or (< (ggtags-project-timestamp project) 0)

View File

@ -1 +0,0 @@
(define-package "git-commit" "20160519.950" "Edit Git commit messages" '((emacs "24.4") (dash "20151021.113") (with-editor "20160408.201")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc"))

View File

@ -3,8 +3,8 @@
;;; Code: ;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "git-commit" "git-commit.el" (22387 29368 875424 ;;;### (autoloads nil "git-commit" "git-commit.el" (22490 24936 815404
;;;;;; 490000)) ;;;;;; 393000))
;;; Generated autoloads from git-commit.el ;;; Generated autoloads from git-commit.el
(defvar global-git-commit-mode t "\ (defvar global-git-commit-mode t "\

View File

@ -0,0 +1 @@
(define-package "git-commit" "20160821.1338" "Edit Git commit messages" '((emacs "24.4") (dash "20160820.501") (with-editor "20160812.1457")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc"))

View File

@ -11,8 +11,8 @@
;; Marius Vollmer <marius.vollmer@gmail.com> ;; Marius Vollmer <marius.vollmer@gmail.com>
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li> ;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
;; Package-Requires: ((emacs "24.4") (dash "20151021.113") (with-editor "20160408.201")) ;; Package-Requires: ((emacs "24.4") (dash "20160820.501") (with-editor "20160812.1457"))
;; Package-Version: 20160519.950 ;; Package-Version: 20160821.1338
;; Keywords: git tools vc ;; Keywords: git tools vc
;; Homepage: https://github.com/magit/magit ;; Homepage: https://github.com/magit/magit

View File

@ -3,8 +3,8 @@
;;; Code: ;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "git-gutter" "git-gutter.el" (22404 60266 753885 ;;;### (autoloads nil "git-gutter" "git-gutter.el" (22490 24936 311405
;;;;;; 560000)) ;;;;;; 824000))
;;; Generated autoloads from git-gutter.el ;;; Generated autoloads from git-gutter.el
(autoload 'git-gutter:linum-setup "git-gutter" "\ (autoload 'git-gutter:linum-setup "git-gutter" "\

View File

@ -1 +1 @@
(define-package "git-gutter" "20160702.354" "Port of Sublime Text plugin GitGutter" '((cl-lib "0.5") (emacs "24")) :url "https://github.com/syohex/emacs-git-gutter") (define-package "git-gutter" "20160903.852" "Port of Sublime Text plugin GitGutter" '((cl-lib "0.5") (emacs "24")) :url "https://github.com/syohex/emacs-git-gutter")

View File

@ -4,8 +4,8 @@
;; Author: Syohei YOSHIDA <syohex@gmail.com> ;; Author: Syohei YOSHIDA <syohex@gmail.com>
;; URL: https://github.com/syohex/emacs-git-gutter ;; URL: https://github.com/syohex/emacs-git-gutter
;; Package-Version: 20160702.354 ;; Package-Version: 20160903.852
;; Version: 0.89 ;; Version: 0.90
;; Package-Requires: ((cl-lib "0.5") (emacs "24")) ;; Package-Requires: ((cl-lib "0.5") (emacs "24"))
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -219,14 +219,14 @@ gutter information of other windows."
(zerop (apply #'git-gutter:execute-command cmd nil check-subcmd)) (zerop (apply #'git-gutter:execute-command cmd nil check-subcmd))
(not (string-match-p (regexp-quote (concat "/" repodir "/")) default-directory)))) (not (string-match-p (regexp-quote (concat "/" repodir "/")) default-directory))))
(defsubst git-gutter:vcs-check-function (vcs) (defun git-gutter:vcs-check-function (vcs)
(cl-case vcs (cl-case vcs
(git (git-gutter:in-git-repository-p)) (git (git-gutter:in-git-repository-p))
(svn (git-gutter:in-repository-common-p "svn" '("info") ".svn")) (svn (git-gutter:in-repository-common-p "svn" '("info") ".svn"))
(hg (git-gutter:in-repository-common-p "hg" '("root") ".hg")) (hg (git-gutter:in-repository-common-p "hg" '("root") ".hg"))
(bzr (git-gutter:in-repository-common-p "bzr" '("root") ".bzr")))) (bzr (git-gutter:in-repository-common-p "bzr" '("root") ".bzr"))))
(defsubst git-gutter:in-repository-p () (defun git-gutter:in-repository-p ()
(cl-loop for vcs in git-gutter:handled-backends (cl-loop for vcs in git-gutter:handled-backends
when (git-gutter:vcs-check-function vcs) when (git-gutter:vcs-check-function vcs)
return (set (make-local-variable 'git-gutter:vcs-type) vcs))) return (set (make-local-variable 'git-gutter:vcs-type) vcs)))
@ -841,6 +841,13 @@ gutter information of other windows."
(interactive "p") (interactive "p")
(git-gutter:next-hunk (- arg))) (git-gutter:next-hunk (- arg)))
(defun git-gutter:end-of-hunk ()
"Move to end of current diff hunk"
(interactive)
(git-gutter:awhen (git-gutter:search-here-diffinfo git-gutter:diffinfos)
(let ((lines (- (git-gutter-hunk-end-line it) (line-number-at-pos))))
(forward-line lines))))
(defalias 'git-gutter:next-diff 'git-gutter:next-hunk) (defalias 'git-gutter:next-diff 'git-gutter:next-hunk)
(make-obsolete 'git-gutter:next-diff 'git-gutter:next-hunk "0.60") (make-obsolete 'git-gutter:next-diff 'git-gutter:next-hunk "0.60")
(defalias 'git-gutter:previous-diff 'git-gutter:previous-hunk) (defalias 'git-gutter:previous-diff 'git-gutter:previous-hunk)

View File

@ -3,7 +3,8 @@
;;; Code: ;;; Code:
;;;### (autoloads nil "go-mode" "go-mode.el" (22454 5326 453354 320000)) ;;;### (autoloads nil "go-mode" "go-mode.el" (22490 24935 827407
;;;;;; 200000))
;;; Generated autoloads from go-mode.el ;;; Generated autoloads from go-mode.el
(autoload 'go-mode "go-mode" "\ (autoload 'go-mode "go-mode" "\
@ -95,7 +96,8 @@ Tries to look for a URL at point.
;;;*** ;;;***
;;;### (autoloads nil nil ("go-mode-pkg.el") (22454 5326 404353 168000)) ;;;### (autoloads nil nil ("go-mode-pkg.el") (22490 24935 844909
;;;;;; 520000))
;;;*** ;;;***

View File

@ -1,4 +1,4 @@
(define-package "go-mode" "20160715.205" "Major mode for the Go programming language" 'nil :url "https://github.com/dominikh/go-mode.el" :keywords (define-package "go-mode" "20160913.944" "Major mode for the Go programming language" 'nil :url "https://github.com/dominikh/go-mode.el" :keywords
'("languages" "go")) '("languages" "go"))
;; Local Variables: ;; Local Variables:
;; no-byte-compile: t ;; no-byte-compile: t

View File

@ -1527,25 +1527,25 @@ description at POINT."
(error "godef does not reliably work in XEmacs, expect bad results")) (error "godef does not reliably work in XEmacs, expect bad results"))
(if (not (buffer-file-name (go--coverage-origin-buffer))) (if (not (buffer-file-name (go--coverage-origin-buffer)))
(error "Cannot use godef on a buffer without a file name") (error "Cannot use godef on a buffer without a file name")
(let ((outbuf (get-buffer-create "*godef*")) (let ((outbuf (generate-new-buffer "*godef*"))
(coding-system-for-read 'utf-8) (coding-system-for-read 'utf-8)
(coding-system-for-write 'utf-8)) (coding-system-for-write 'utf-8))
(with-current-buffer outbuf (prog2
(erase-buffer)) (call-process-region (point-min)
(call-process-region (point-min) (point-max)
(point-max) godef-command
godef-command nil
nil outbuf
outbuf nil
nil "-i"
"-i" "-t"
"-t" "-f"
"-f" (file-truename (buffer-file-name (go--coverage-origin-buffer)))
(file-truename (buffer-file-name (go--coverage-origin-buffer))) "-o"
"-o" (number-to-string (go--position-bytes point)))
(number-to-string (go--position-bytes point))) (with-current-buffer outbuf
(with-current-buffer outbuf (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n"))
(split-string (buffer-substring-no-properties (point-min) (point-max)) "\n"))))) (kill-buffer outbuf)))))
(defun godef--successful-p (output) (defun godef--successful-p (output)
(not (or (string= "-" output) (not (or (string= "-" output)

View File

@ -244,25 +244,23 @@ Support install, remove and purge actions."
(ansi-term (getenv "SHELL") "term apt") (ansi-term (getenv "SHELL") "term apt")
(setq helm-apt-term-buffer (buffer-name))) (setq helm-apt-term-buffer (buffer-name)))
(term-line-mode) (term-line-mode)
(let ((command (cl-case action (let* ((command (cl-case action
(install "sudo apt-get install ") (install "sudo apt-get install ")
(reinstall "sudo apt-get install --reinstall ") (reinstall "sudo apt-get install --reinstall ")
(uninstall "sudo apt-get remove ") (uninstall "sudo apt-get remove ")
(purge "sudo apt-get purge ") (purge "sudo apt-get purge ")
(t (error "Unknown action")))) (t (error "Unknown action"))))
(beg (point)) (cands (helm-marked-candidates))
end (cand-list (mapconcat (lambda (x) (format "'%s'" x)) cands " ")))
(cand-list (mapconcat (lambda (x) (format "'%s'" x)) (with-helm-display-marked-candidates "*apt candidates*"
(helm-marked-candidates) " "))) cands
(goto-char (point-max)) (when (y-or-n-p (format "%s package(s)" (symbol-name action)))
(insert (concat command cand-list)) (with-current-buffer helm-apt-term-buffer
(setq end (point)) (goto-char (point-max))
(if (y-or-n-p (format "%s package(s)" (symbol-name action))) (insert (concat command cand-list))
(progn
(setq helm-external-commands-list nil) (setq helm-external-commands-list nil)
(setq helm-apt-installed-packages nil) (setq helm-apt-installed-packages nil)
(term-char-mode) (term-send-input)) (term-char-mode) (term-send-input))))))
(delete-region beg end))))
;;;###autoload ;;;###autoload
(defun helm-apt (arg) (defun helm-apt (arg)

View File

@ -1,16 +1,15 @@
;;; helm-autoloads.el --- automatically extracted autoloads ;;; helm-autoloads.el --- automatically extracted autoloads
;; ;;
;;; Code: ;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (22454 5322 ;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (22490 24935
;;;;;; 428259 677000)) ;;;;;; 275408 774000))
;;; Generated autoloads from helm-adaptive.el ;;; Generated autoloads from helm-adaptive.el
(defvar helm-adaptive-mode nil "\ (defvar helm-adaptive-mode nil "\
Non-nil if Helm-Adaptive mode is enabled. Non-nil if Helm-Adaptive mode is enabled.
See the `helm-adaptive-mode' command See the command `helm-adaptive-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `helm-adaptive-mode'.") or call the function `helm-adaptive-mode'.")
@ -30,8 +29,8 @@ Useful when you have a old or corrupted `helm-adaptive-history-file'.
;;;*** ;;;***
;;;### (autoloads nil "helm-apt" "helm-apt.el" (22454 5322 190254 ;;;### (autoloads nil "helm-apt" "helm-apt.el" (22490 24935 247408
;;;;;; 80000)) ;;;;;; 853000))
;;; Generated autoloads from helm-apt.el ;;; Generated autoloads from helm-apt.el
(autoload 'helm-apt "helm-apt" "\ (autoload 'helm-apt "helm-apt" "\
@ -42,8 +41,8 @@ With a prefix arg reload cache.
;;;*** ;;;***
;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (22454 5322 ;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (22490 24935
;;;;;; 866269 976000)) ;;;;;; 323408 637000))
;;; Generated autoloads from helm-bookmark.el ;;; Generated autoloads from helm-bookmark.el
(autoload 'helm-bookmarks "helm-bookmark" "\ (autoload 'helm-bookmarks "helm-bookmark" "\
@ -60,8 +59,8 @@ only if external library addressbook-bookmark.el is available.
;;;*** ;;;***
;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (22454 5322 ;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (22490 24935
;;;;;; 122252 481000)) ;;;;;; 227408 911000))
;;; Generated autoloads from helm-buffers.el ;;; Generated autoloads from helm-buffers.el
(autoload 'helm-buffers-list "helm-buffers" "\ (autoload 'helm-buffers-list "helm-buffers" "\
@ -76,8 +75,8 @@ Preconfigured `helm' lightweight version (buffer -> recentf).
;;;*** ;;;***
;;;### (autoloads nil "helm-color" "helm-color.el" (22454 5322 731266 ;;;### (autoloads nil "helm-color" "helm-color.el" (22490 24935 307408
;;;;;; 803000)) ;;;;;; 682000))
;;; Generated autoloads from helm-color.el ;;; Generated autoloads from helm-color.el
(autoload 'helm-colors "helm-color" "\ (autoload 'helm-colors "helm-color" "\
@ -87,8 +86,8 @@ Preconfigured `helm' for color.
;;;*** ;;;***
;;;### (autoloads nil "helm-command" "helm-command.el" (22454 5321 ;;;### (autoloads nil "helm-command" "helm-command.el" (22490 24935
;;;;;; 795244 793000)) ;;;;;; 183409 35000))
;;; Generated autoloads from helm-command.el ;;; Generated autoloads from helm-command.el
(autoload 'helm-M-x "helm-command" "\ (autoload 'helm-M-x "helm-command" "\
@ -106,8 +105,8 @@ You can get help on each command by persistent action.
;;;*** ;;;***
;;;### (autoloads nil "helm-config" "helm-config.el" (22454 5322 ;;;### (autoloads nil "helm-config" "helm-config.el" (22490 24935
;;;;;; 821268 918000)) ;;;;;; 315408 659000))
;;; Generated autoloads from helm-config.el ;;; Generated autoloads from helm-config.el
(autoload 'helm-configuration "helm-config" "\ (autoload 'helm-configuration "helm-config" "\
@ -117,8 +116,8 @@ Customize `helm'.
;;;*** ;;;***
;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (22454 5322 ;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (22490 24935
;;;;;; 257255 656000)) ;;;;;; 255408 831000))
;;; Generated autoloads from helm-dabbrev.el ;;; Generated autoloads from helm-dabbrev.el
(autoload 'helm-dabbrev "helm-dabbrev" "\ (autoload 'helm-dabbrev "helm-dabbrev" "\
@ -128,8 +127,8 @@ Preconfigured helm for dynamic abbreviations.
;;;*** ;;;***
;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (22454 5322 777267 ;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (22490 24935 311408
;;;;;; 884000)) ;;;;;; 670000))
;;; Generated autoloads from helm-elisp.el ;;; Generated autoloads from helm-elisp.el
(autoload 'helm-lisp-completion-at-point "helm-elisp" "\ (autoload 'helm-lisp-completion-at-point "helm-elisp" "\
@ -183,7 +182,7 @@ Preconfigured helm for complex command history.
;;;*** ;;;***
;;;### (autoloads nil "helm-elisp-package" "helm-elisp-package.el" ;;;### (autoloads nil "helm-elisp-package" "helm-elisp-package.el"
;;;;;; (22454 5321 829245 592000)) ;;;;;; (22490 24935 191409 13000))
;;; Generated autoloads from helm-elisp-package.el ;;; Generated autoloads from helm-elisp-package.el
(autoload 'helm-list-elisp-packages "helm-elisp-package" "\ (autoload 'helm-list-elisp-packages "helm-elisp-package" "\
@ -199,8 +198,8 @@ Same as `helm-list-elisp-packages' but don't fetch packages on remote.
;;;*** ;;;***
;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (22454 5321 ;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (22490 24935
;;;;;; 728243 218000)) ;;;;;; 171409 70000))
;;; Generated autoloads from helm-elscreen.el ;;; Generated autoloads from helm-elscreen.el
(autoload 'helm-elscreen "helm-elscreen" "\ (autoload 'helm-elscreen "helm-elscreen" "\
@ -215,8 +214,8 @@ Preconfigured helm to list elscreen in history order.
;;;*** ;;;***
;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (22454 5321 ;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (22490 24935
;;;;;; 942248 250000)) ;;;;;; 203408 979000))
;;; Generated autoloads from helm-eshell.el ;;; Generated autoloads from helm-eshell.el
(autoload 'helm-esh-pcomplete "helm-eshell" "\ (autoload 'helm-esh-pcomplete "helm-eshell" "\
@ -231,8 +230,8 @@ Preconfigured helm for eshell history.
;;;*** ;;;***
;;;### (autoloads nil "helm-eval" "helm-eval.el" (22454 5322 518261 ;;;### (autoloads nil "helm-eval" "helm-eval.el" (22490 24935 283408
;;;;;; 793000)) ;;;;;; 750000))
;;; Generated autoloads from helm-eval.el ;;; Generated autoloads from helm-eval.el
(autoload 'helm-eval-expression "helm-eval" "\ (autoload 'helm-eval-expression "helm-eval" "\
@ -252,8 +251,8 @@ Preconfigured helm for `helm-source-calculation-result'.
;;;*** ;;;***
;;;### (autoloads nil "helm-external" "helm-external.el" (22454 5321 ;;;### (autoloads nil "helm-external" "helm-external.el" (22490 24935
;;;;;; 638241 101000)) ;;;;;; 163409 93000))
;;; Generated autoloads from helm-external.el ;;; Generated autoloads from helm-external.el
(autoload 'helm-run-external-command "helm-external" "\ (autoload 'helm-run-external-command "helm-external" "\
@ -266,8 +265,8 @@ You can set your own list of commands with
;;;*** ;;;***
;;;### (autoloads nil "helm-files" "helm-files.el" (22454 5322 291256 ;;;### (autoloads nil "helm-files" "helm-files.el" (22490 24935 259408
;;;;;; 455000)) ;;;;;; 818000))
;;; Generated autoloads from helm-files.el ;;; Generated autoloads from helm-files.el
(autoload 'helm-projects-history "helm-files" "\ (autoload 'helm-projects-history "helm-files" "\
@ -345,8 +344,8 @@ Preconfigured `helm' for `recentf'.
;;;*** ;;;***
;;;### (autoloads nil "helm-font" "helm-font.el" (22454 5321 987249 ;;;### (autoloads nil "helm-font" "helm-font.el" (22490 24935 207408
;;;;;; 307000)) ;;;;;; 967000))
;;; Generated autoloads from helm-font.el ;;; Generated autoloads from helm-font.el
(autoload 'helm-select-xfont "helm-font" "\ (autoload 'helm-select-xfont "helm-font" "\
@ -361,8 +360,8 @@ Preconfigured helm for `ucs-names' math symbols.
;;;*** ;;;***
;;;### (autoloads nil "helm-grep" "helm-grep.el" (22454 5322 912271 ;;;### (autoloads nil "helm-grep" "helm-grep.el" (22490 24935 327408
;;;;;; 58000)) ;;;;;; 625000))
;;; Generated autoloads from helm-grep.el ;;; Generated autoloads from helm-grep.el
(autoload 'helm-goto-precedent-file "helm-grep" "\ (autoload 'helm-goto-precedent-file "helm-grep" "\
@ -389,8 +388,8 @@ With a prefix arg ARG git-grep the whole repository.
;;;*** ;;;***
;;;### (autoloads nil "helm-help" "helm-help.el" (22454 5321 593240 ;;;### (autoloads nil "helm-help" "helm-help.el" (22490 24935 159409
;;;;;; 43000)) ;;;;;; 104000))
;;; Generated autoloads from helm-help.el ;;; Generated autoloads from helm-help.el
(autoload 'helm-documentation "helm-help" "\ (autoload 'helm-documentation "helm-help" "\
@ -410,8 +409,8 @@ String displayed in mode-line in `helm-source-find-files'.")
;;;*** ;;;***
;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (22454 5322 ;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (22490 24935
;;;;;; 156253 281000)) ;;;;;; 239408 876000))
;;; Generated autoloads from helm-id-utils.el ;;; Generated autoloads from helm-id-utils.el
(autoload 'helm-gid "helm-id-utils" "\ (autoload 'helm-gid "helm-id-utils" "\
@ -425,8 +424,8 @@ See <https://www.gnu.org/software/idutils/>.
;;;*** ;;;***
;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (22454 5322 54250 ;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (22490 24935 219408
;;;;;; 883000)) ;;;;;; 933000))
;;; Generated autoloads from helm-imenu.el ;;; Generated autoloads from helm-imenu.el
(autoload 'helm-imenu "helm-imenu" "\ (autoload 'helm-imenu "helm-imenu" "\
@ -443,8 +442,8 @@ or it have an association in `helm-imenu-all-buffer-assoc'.
;;;*** ;;;***
;;;### (autoloads nil "helm-info" "helm-info.el" (22454 5322 20250 ;;;### (autoloads nil "helm-info" "helm-info.el" (22490 24935 215408
;;;;;; 83000)) ;;;;;; 945000))
;;; Generated autoloads from helm-info.el ;;; Generated autoloads from helm-info.el
(autoload 'helm-info "helm-info" "\ (autoload 'helm-info "helm-info" "\
@ -460,8 +459,8 @@ With a prefix-arg insert symbol at point.
;;;*** ;;;***
;;;### (autoloads nil "helm-locate" "helm-locate.el" (22454 5321 ;;;### (autoloads nil "helm-locate" "helm-locate.el" (22490 24935
;;;;;; 683242 159000)) ;;;;;; 167409 82000))
;;; Generated autoloads from helm-locate.el ;;; Generated autoloads from helm-locate.el
(autoload 'helm-projects-find-files "helm-locate" "\ (autoload 'helm-projects-find-files "helm-locate" "\
@ -488,8 +487,8 @@ Where db_path is a filename matched by
;;;*** ;;;***
;;;### (autoloads nil "helm-man" "helm-man.el" (22454 5322 563262 ;;;### (autoloads nil "helm-man" "helm-man.el" (22490 24935 291408
;;;;;; 851000)) ;;;;;; 728000))
;;; Generated autoloads from helm-man.el ;;; Generated autoloads from helm-man.el
(autoload 'helm-man-woman "helm-man" "\ (autoload 'helm-man-woman "helm-man" "\
@ -500,8 +499,8 @@ With a prefix arg reinitialize the cache.
;;;*** ;;;***
;;;### (autoloads nil "helm-misc" "helm-misc.el" (22454 5322 383258 ;;;### (autoloads nil "helm-misc" "helm-misc.el" (22490 24935 271408
;;;;;; 619000)) ;;;;;; 785000))
;;; Generated autoloads from helm-misc.el ;;; Generated autoloads from helm-misc.el
(autoload 'helm-browse-menubar "helm-misc" "\ (autoload 'helm-browse-menubar "helm-misc" "\
@ -542,8 +541,8 @@ Preconfigured `helm' that provide completion of `comint' history.
;;;*** ;;;***
;;;### (autoloads nil "helm-mode" "helm-mode.el" (22454 5321 482237 ;;;### (autoloads nil "helm-mode" "helm-mode.el" (22490 24935 143409
;;;;;; 433000)) ;;;;;; 149000))
;;; Generated autoloads from helm-mode.el ;;; Generated autoloads from helm-mode.el
(autoload 'helm-comp-read "helm-mode" "\ (autoload 'helm-comp-read "helm-mode" "\
@ -640,7 +639,7 @@ in `helm-current-prefix-arg', otherwise if prefix args were given before
That's mean you can pass prefix args before or after calling a command That's mean you can pass prefix args before or after calling a command
that use `helm-comp-read' See `helm-M-x' for example. that use `helm-comp-read' See `helm-M-x' for example.
\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (BUFFER \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (REQUIRES-PATTERN 0) HISTORY INPUT-HISTORY (CASE-FOLD helm-comp-read-case-fold-search) (DEL-INPUT t) (PERSISTENT-ACTION nil) (PERSISTENT-HELP \"DoNothing\") (MODE-LINE helm-comp-read-mode-line) HELP-MESSAGE (KEYMAP helm-comp-read-map) (NAME \"Helm Completions\") CANDIDATES-IN-BUFFER MATCH-PART EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (VOLATILE t) SORT (FC-TRANSFORMER \\='helm-cr-default-transformer) HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (ALISTP t) (CANDIDATE-NUMBER-LIMIT helm-candidate-number-limit))" nil nil) \(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (buffer \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (requires-pattern 0) HISTORY INPUT-HISTORY (case-fold helm-comp-read-case-fold-search) (del-input t) (persistent-action nil) (persistent-help \"DoNothing\") (mode-line helm-comp-read-mode-line) HELP-MESSAGE (keymap helm-comp-read-map) (name \"Helm Completions\") CANDIDATES-IN-BUFFER MATCH-PART EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (volatile t) SORT (fc-transformer (quote helm-cr-default-transformer)) HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (alistp t) (candidate-number-limit helm-candidate-number-limit))" nil nil)
(autoload 'helm-read-file-name "helm-mode" "\ (autoload 'helm-read-file-name "helm-mode" "\
Read a file name with helm completion. Read a file name with helm completion.
@ -678,12 +677,11 @@ Keys description:
- MODE-LINE: A mode line message, default is `helm-read-file-name-mode-line-string'. - MODE-LINE: A mode line message, default is `helm-read-file-name-mode-line-string'.
\(fn PROMPT &key (NAME \"Read File Name\") (INITIAL-INPUT default-directory) (BUFFER \"*Helm file completions*\") TEST (CASE-FOLD helm-file-name-case-fold-search) PRESELECT HISTORY MUST-MATCH DEFAULT MARKED-CANDIDATES (CANDIDATE-NUMBER-LIMIT helm-ff-candidate-number-limit) NOMARK (ALISTP t) (PERSISTENT-ACTION \\='helm-find-files-persistent-action) (PERSISTENT-HELP \"Hit1 Expand Candidate, Hit2 or (C-u) Find file\") (MODE-LINE helm-read-file-name-mode-line-string))" nil nil) \(fn PROMPT &key (name \"Read File Name\") (initial-input default-directory) (buffer \"*Helm file completions*\") TEST (case-fold helm-file-name-case-fold-search) PRESELECT HISTORY MUST-MATCH DEFAULT MARKED-CANDIDATES (candidate-number-limit helm-ff-candidate-number-limit) NOMARK (alistp t) (persistent-action (quote helm-find-files-persistent-action)) (persistent-help \"Hit1 Expand Candidate, Hit2 or (C-u) Find file\") (mode-line helm-read-file-name-mode-line-string))" nil nil)
(defvar helm-mode nil "\ (defvar helm-mode nil "\
Non-nil if Helm mode is enabled. Non-nil if Helm mode is enabled.
See the `helm-mode' command See the command `helm-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `helm-mode'.") or call the function `helm-mode'.")
@ -714,8 +712,8 @@ Note: This mode is incompatible with Emacs23.
;;;*** ;;;***
;;;### (autoloads nil "helm-net" "helm-net.el" (22454 5322 686265 ;;;### (autoloads nil "helm-net" "helm-net.el" (22490 24935 303408
;;;;;; 744000)) ;;;;;; 694000))
;;; Generated autoloads from helm-net.el ;;; Generated autoloads from helm-net.el
(autoload 'helm-surfraw "helm-net" "\ (autoload 'helm-surfraw "helm-net" "\
@ -735,8 +733,8 @@ Preconfigured `helm' for Wikipedia lookup with Wikipedia suggest.
;;;*** ;;;***
;;;### (autoloads nil "helm-org" "helm-org.el" (22454 5322 957272 ;;;### (autoloads nil "helm-org" "helm-org.el" (22490 24935 331408
;;;;;; 116000)) ;;;;;; 613000))
;;; Generated autoloads from helm-org.el ;;; Generated autoloads from helm-org.el
(autoload 'helm-org-agenda-files-headings "helm-org" "\ (autoload 'helm-org-agenda-files-headings "helm-org" "\
@ -767,8 +765,8 @@ Preconfigured helm for org templates.
;;;*** ;;;***
;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (22454 5322 ;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (22490 24935
;;;;;; 642264 709000)) ;;;;;; 299408 706000))
;;; Generated autoloads from helm-regexp.el ;;; Generated autoloads from helm-regexp.el
(autoload 'helm-moccur-mode "helm-regexp" "\ (autoload 'helm-moccur-mode "helm-regexp" "\
@ -807,14 +805,13 @@ The prefix arg can be set before calling
;;;*** ;;;***
;;;### (autoloads nil "helm-ring" "helm-ring.el" (22454 5321 548238 ;;;### (autoloads nil "helm-ring" "helm-ring.el" (22490 24935 151409
;;;;;; 985000)) ;;;;;; 127000))
;;; Generated autoloads from helm-ring.el ;;; Generated autoloads from helm-ring.el
(defvar helm-push-mark-mode nil "\ (defvar helm-push-mark-mode nil "\
Non-nil if Helm-Push-Mark mode is enabled. Non-nil if Helm-Push-Mark mode is enabled.
See the `helm-push-mark-mode' command See the command `helm-push-mark-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `helm-push-mark-mode'.") or call the function `helm-push-mark-mode'.")
@ -866,8 +863,8 @@ This command is useful when used with persistent action.
;;;*** ;;;***
;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (22454 5322 ;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (22490 24935
;;;;;; 88251 682000)) ;;;;;; 223408 922000))
;;; Generated autoloads from helm-semantic.el ;;; Generated autoloads from helm-semantic.el
(autoload 'helm-semantic "helm-semantic" "\ (autoload 'helm-semantic "helm-semantic" "\
@ -889,14 +886,13 @@ Fill in the symbol at point by default.
;;;*** ;;;***
;;;### (autoloads nil "helm-sys" "helm-sys.el" (22454 5322 223254 ;;;### (autoloads nil "helm-sys" "helm-sys.el" (22490 24935 251408
;;;;;; 856000)) ;;;;;; 842000))
;;; Generated autoloads from helm-sys.el ;;; Generated autoloads from helm-sys.el
(defvar helm-top-poll-mode nil "\ (defvar helm-top-poll-mode nil "\
Non-nil if Helm-Top-Poll mode is enabled. Non-nil if Helm-Top-Poll mode is enabled.
See the `helm-top-poll-mode' command See the command `helm-top-poll-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `helm-top-poll-mode'.") or call the function `helm-top-poll-mode'.")
@ -925,8 +921,8 @@ Preconfigured helm for xrandr.
;;;*** ;;;***
;;;### (autoloads nil "helm-tags" "helm-tags.el" (22454 5321 897247 ;;;### (autoloads nil "helm-tags" "helm-tags.el" (22490 24935 199408
;;;;;; 191000)) ;;;;;; 990000))
;;; Generated autoloads from helm-tags.el ;;; Generated autoloads from helm-tags.el
(autoload 'helm-etags-select "helm-tags" "\ (autoload 'helm-etags-select "helm-tags" "\
@ -945,14 +941,13 @@ This function aggregates three sources of tag files:
;;;*** ;;;***
;;;### (autoloads nil "helm-utils" "helm-utils.el" (22454 5321 761243 ;;;### (autoloads nil "helm-utils" "helm-utils.el" (22490 24935 179409
;;;;;; 994000)) ;;;;;; 47000))
;;; Generated autoloads from helm-utils.el ;;; Generated autoloads from helm-utils.el
(defvar helm-popup-tip-mode nil "\ (defvar helm-popup-tip-mode nil "\
Non-nil if Helm-Popup-Tip mode is enabled. Non-nil if Helm-Popup-Tip mode is enabled.
See the `helm-popup-tip-mode' command See the command `helm-popup-tip-mode' for a description of this minor mode.
for a description of this minor mode.
Setting this variable directly does not take effect; Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization') either customize it (see the info node `Easy Customization')
or call the function `helm-popup-tip-mode'.") or call the function `helm-popup-tip-mode'.")
@ -966,8 +961,8 @@ Show help-echo informations in a popup tip at end of line.
;;;*** ;;;***
;;;### (autoloads nil nil ("helm-easymenu.el" "helm-multi-match.el" ;;;### (autoloads nil nil ("helm-easymenu.el" "helm-pkg.el" "helm-types.el")
;;;;;; "helm-pkg.el" "helm-types.el") (22454 5323 1273 151000)) ;;;;;; (22490 24935 351383 40000))
;;;*** ;;;***

View File

@ -19,6 +19,7 @@
(require 'cl-lib) (require 'cl-lib)
(require 'bookmark) (require 'bookmark)
(require 'helm) (require 'helm)
(require 'helm-lib)
(require 'helm-help) (require 'helm-help)
(require 'helm-types) (require 'helm-types)
(require 'helm-utils) (require 'helm-utils)
@ -477,9 +478,10 @@ than `w3m-browse-url' use it."
(define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project) (define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project)
map)) map))
(defclass helm-bookmark-overwrite-inheritor (helm-source) ()) (defclass helm-bookmark-override-inheritor (helm-source) ())
(defmethod helm--setup-source ((source helm-bookmark-overwrite-inheritor)) (defmethod helm--setup-source ((source helm-bookmark-override-inheritor))
;; Ensure `helm-source-in-buffer' method is called.
(call-next-method) (call-next-method)
(setf (slot-value source 'action) (setf (slot-value source 'action)
(helm-append-at-nth (helm-append-at-nth
@ -489,7 +491,7 @@ than `w3m-browse-url' use it."
(setf (slot-value source 'keymap) helm-bookmark-find-files-map)) (setf (slot-value source 'keymap) helm-bookmark-find-files-map))
(defclass helm-bookmark-find-files-class (helm-source-filtered-bookmarks (defclass helm-bookmark-find-files-class (helm-source-filtered-bookmarks
helm-bookmark-overwrite-inheritor) helm-bookmark-override-inheritor)
()) ())
(defvar helm-source-bookmark-helm-find-files (defvar helm-source-bookmark-helm-find-files

View File

@ -435,8 +435,9 @@ Should be called after others transformers i.e (boring buffers)."
(defun helm-buffers-mark-similar-buffers-1 () (defun helm-buffers-mark-similar-buffers-1 ()
(with-helm-window (with-helm-window
(let ((type (get-text-property (let* ((src (helm-get-current-source))
0 'type (helm-get-selection nil 'withprop)))) (type (get-text-property
0 'type (helm-get-selection nil 'withprop src))))
(save-excursion (save-excursion
(goto-char (helm-get-previous-header-pos)) (goto-char (helm-get-previous-header-pos))
(helm-next-line) (helm-next-line)
@ -449,13 +450,13 @@ Should be called after others transformers i.e (boring buffers)."
(maxpoint (or end (point-max)))) (maxpoint (or end (point-max))))
(while (< (point) maxpoint) (while (< (point) maxpoint)
(helm-mark-current-line) (helm-mark-current-line)
(let ((cand (helm-get-selection nil 'withprop))) (let ((cand (helm-get-selection nil 'withprop src)))
(when (and (not (helm-this-visible-mark)) (when (and (not (helm-this-visible-mark))
(eq (get-text-property 0 'type cand) type)) (eq (get-text-property 0 'type cand) type))
(helm-make-visible-mark))) (helm-make-visible-mark)))
(forward-line 1) (end-of-line)))) (forward-line 1) (end-of-line))))
(helm-mark-current-line) (helm-mark-current-line)
(helm-display-mode-line (helm-get-current-source) t) (helm-display-mode-line src t)
(message "%s candidates marked" (length helm-marked-candidates))))) (message "%s candidates marked" (length helm-marked-candidates)))))
(defun helm-buffers-mark-similar-buffers () (defun helm-buffers-mark-similar-buffers ()
@ -593,11 +594,10 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(defun helm-buffer-toggle-diff (candidate) (defun helm-buffer-toggle-diff (candidate)
"Toggle diff buffer CANDIDATE with it's file." "Toggle diff buffer CANDIDATE with it's file."
(let (helm-persistent-action-use-special-display) (helm-aif (get-buffer-window "*Diff*")
(helm-aif (get-buffer-window "*Diff*") (progn (kill-buffer "*Diff*")
(progn (kill-buffer "*Diff*") (set-window-buffer it helm-current-buffer))
(set-window-buffer it helm-current-buffer)) (diff-buffer-with-file (get-buffer candidate))))
(diff-buffer-with-file (get-buffer candidate)))))
(defun helm-buffer-diff-persistent () (defun helm-buffer-diff-persistent ()
"Toggle diff buffer without quitting helm." "Toggle diff buffer without quitting helm."
@ -783,7 +783,8 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(defun helm-buffers-list-persistent-action (candidate) (defun helm-buffers-list-persistent-action (candidate)
(let ((current (window-buffer helm-persistent-action-display-window))) (let ((current (window-buffer helm-persistent-action-display-window)))
(if (or (eql current (get-buffer helm-current-buffer)) (if (or (helm-follow-mode-p)
(eql current (get-buffer helm-current-buffer))
(not (eql current (get-buffer candidate)))) (not (eql current (get-buffer candidate))))
(switch-to-buffer candidate) (switch-to-buffer candidate)
(switch-to-buffer helm-current-buffer)))) (switch-to-buffer helm-current-buffer))))

View File

@ -144,7 +144,6 @@
("(\\<\\(with-helm-buffer\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(with-helm-buffer\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(with-helm-show-completion\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(with-helm-show-completion\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(with-helm-default-directory\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(with-helm-default-directory\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(with-helm-display-same-window\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(with-helm-restore-variables\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(with-helm-restore-variables\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(helm-multi-key-defun\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(helm-multi-key-defun\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(helm-while-no-input\\)\\>" 1 font-lock-keyword-face) ("(\\<\\(helm-while-no-input\\)\\>" 1 font-lock-keyword-face)

View File

@ -71,7 +71,7 @@
(setq helm-el-package--upgrades (helm-el-package-menu--find-upgrades)) (setq helm-el-package--upgrades (helm-el-package-menu--find-upgrades))
(if helm--force-updating-p (if helm--force-updating-p
(if helm-el-package--upgrades (if helm-el-package--upgrades
(message "%d package(s) can be upgraded, Refreshing packages list done" (message "Refreshing packages list done, [%d] package(s) to upgrade"
(length helm-el-package--upgrades)) (length helm-el-package--upgrades))
(message "Refreshing packages list done, no upgrades available")) (message "Refreshing packages list done, no upgrades available"))
(setq helm-el-package--show-only (if helm-el-package--upgrades (setq helm-el-package--show-only (if helm-el-package--upgrades
@ -130,7 +130,7 @@
(helm-exit-and-execute-action 'helm-el-package-install))) (helm-exit-and-execute-action 'helm-el-package-install)))
(put 'helm-el-run-package-install 'helm-only t) (put 'helm-el-run-package-install 'helm-only t)
(defun helm-el-package-uninstall-1 (pkg-list) (defun helm-el-package-uninstall-1 (pkg-list &optional force)
(cl-loop with mkd = pkg-list (cl-loop with mkd = pkg-list
for p in mkd for p in mkd
for id = (get-text-property 0 'tabulated-list-id p) for id = (get-text-property 0 'tabulated-list-id p)
@ -139,7 +139,10 @@
(with-no-warnings (with-no-warnings
(if (fboundp 'package-desc-full-name) (if (fboundp 'package-desc-full-name)
;; emacs 24.4 ;; emacs 24.4
(package-delete id) (condition-case nil
(package-delete id force)
(wrong-number-of-arguments
(package-delete id)))
;; emacs 24.3 ;; emacs 24.3
(package-delete (symbol-name (car id)) (package-delete (symbol-name (car id))
(package-version-join (cdr id))))) (package-version-join (cdr id)))))
@ -171,7 +174,7 @@
"No package deleted"))) "No package deleted")))
(defun helm-el-package-uninstall (_candidate) (defun helm-el-package-uninstall (_candidate)
(helm-el-package-uninstall-1 (helm-marked-candidates))) (helm-el-package-uninstall-1 (helm-marked-candidates) helm-current-prefix-arg))
(defun helm-el-run-package-uninstall () (defun helm-el-run-package-uninstall ()
(interactive) (interactive)

View File

@ -94,6 +94,13 @@ fuzzy completion is not available in `completion-at-point'."
:group 'helm-elisp :group 'helm-elisp
:type '(repeat (choice symbol))) :type '(repeat (choice symbol)))
(defcustom helm-apropos-defaut-info-lookup-sources '(helm-source-info-elisp
helm-source-info-cl
helm-source-info-eieio)
"A list of sources to look into when searching info page of a symbol."
:group 'helm-elisp
:type '(repeat (choice symbol)))
;;; Faces ;;; Faces
;; ;;
@ -309,12 +316,12 @@ Return a cons \(beg . end\)."
:persistent-help (helm-lisp-completion-persistent-help) :persistent-help (helm-lisp-completion-persistent-help)
:filtered-candidate-transformer :filtered-candidate-transformer
'helm-lisp-completion-transformer 'helm-lisp-completion-transformer
:action `(lambda (candidate) :action (lambda (candidate)
(with-helm-current-buffer (with-helm-current-buffer
(run-with-timer (run-with-timer
0.01 nil 0.01 nil
'helm-insert-completion-at-point 'helm-insert-completion-at-point
,beg ,end candidate)))) beg end candidate))))
:input (if helm-lisp-fuzzy-completion :input (if helm-lisp-fuzzy-completion
target (concat target " ")) target (concat target " "))
:resume 'noresume :resume 'noresume
@ -495,9 +502,9 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--emacs-variables (&optional default) (defun helm-def-source--emacs-variables (&optional default)
(helm-build-in-buffer-source "Variables" (helm-build-in-buffer-source "Variables"
:init `(lambda () :init (lambda ()
(helm-apropos-init (helm-apropos-init
(lambda (x) (and (boundp x) (not (keywordp x)))) ,default)) (lambda (x) (and (boundp x) (not (keywordp x)))) default))
:fuzzy-match helm-apropos-fuzzy-match :fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn) 'helm-apropos-default-sort-fn)
@ -552,8 +559,8 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--emacs-commands (&optional default) (defun helm-def-source--emacs-commands (&optional default)
(helm-build-in-buffer-source "Commands" (helm-build-in-buffer-source "Commands"
:init `(lambda () :init (lambda ()
(helm-apropos-init 'commandp ,default)) (helm-apropos-init 'commandp default))
:fuzzy-match helm-apropos-fuzzy-match :fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn) 'helm-apropos-default-sort-fn)
@ -568,13 +575,13 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--emacs-functions (&optional default) (defun helm-def-source--emacs-functions (&optional default)
(helm-build-in-buffer-source "Functions" (helm-build-in-buffer-source "Functions"
:init `(lambda () :init (lambda ()
(helm-apropos-init (lambda (x) (helm-apropos-init (lambda (x)
(and (fboundp x) (and (fboundp x)
(not (commandp x)) (not (commandp x))
(not (generic-p x)) (not (generic-p x))
(not (class-p x)))) (not (class-p x))))
,default)) default))
:fuzzy-match helm-apropos-fuzzy-match :fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn) 'helm-apropos-default-sort-fn)
@ -589,10 +596,10 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--eieio-classes (&optional default) (defun helm-def-source--eieio-classes (&optional default)
(helm-build-in-buffer-source "Classes" (helm-build-in-buffer-source "Classes"
:init `(lambda () :init (lambda ()
(helm-apropos-init (lambda (x) (helm-apropos-init (lambda (x)
(class-p x)) (class-p x))
,default)) default))
:fuzzy-match helm-apropos-fuzzy-match :fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn) 'helm-apropos-default-sort-fn)
@ -607,10 +614,10 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--eieio-generic (&optional default) (defun helm-def-source--eieio-generic (&optional default)
(helm-build-in-buffer-source "Generic functions" (helm-build-in-buffer-source "Generic functions"
:init `(lambda () :init (lambda ()
(helm-apropos-init (lambda (x) (helm-apropos-init (lambda (x)
(generic-p x)) (generic-p x))
,default)) default))
:fuzzy-match helm-apropos-fuzzy-match :fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match) :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn) 'helm-apropos-default-sort-fn)
@ -623,36 +630,67 @@ Filename completion happen if string start after or between a double quote."
("Find function" . helm-find-function) ("Find function" . helm-find-function)
("Info lookup" . helm-info-lookup-symbol)))) ("Info lookup" . helm-info-lookup-symbol))))
(defun helm-info-lookup-fallback-source (candidate)
(let ((sym (helm-symbolify candidate))
src-name fn)
(cond ((class-p sym)
(setq fn #'helm-describe-function
src-name "Describe class"))
((generic-p sym)
(setq fn #'helm-describe-function
src-name "Describe generic function"))
((fboundp sym)
(setq fn #'helm-describe-function
src-name "Describe function"))
((facep sym)
(setq fn #'helm-describe-face
src-name "Describe face"))
(t
(setq fn #'helm-describe-variable
src-name "Describe variable")))
(helm-build-sync-source src-name
:candidates (list candidate)
:persistent-action (lambda (candidate)
(helm-elisp--persistent-help
candidate fn))
:persistent-help src-name
:nomark t
:action fn)))
(defun helm-info-lookup-symbol-1 (c) (defun helm-info-lookup-symbol-1 (c)
(let ((helm-execute-action-at-once-if-one t) (let ((helm-execute-action-at-once-if-one 'current-source))
(helm-quit-if-no-candidate (helm :sources (append helm-apropos-defaut-info-lookup-sources
`(lambda () (list (helm-info-lookup-fallback-source c)))
(message "`%s' Not Documented as a symbol" ,c))))
(helm :sources '(helm-source-info-elisp
helm-source-info-cl
helm-source-info-eieio)
:resume 'noresume :resume 'noresume
:buffer "*helm lookup*" :buffer "*helm lookup*"
:input c))) :input c)))
(defun helm-info-lookup-symbol (candidate) (defun helm-info-lookup-symbol (candidate)
(run-with-timer 0.01 nil #'helm-info-lookup-symbol-1 candidate)) ;; Running an idle-timer allow not catching RET
;; when exiting with the fallback source.
(run-with-idle-timer 0.01 nil #'helm-info-lookup-symbol-1 candidate))
(defun helm-elisp--persistent-help (candidate fun &optional name) (defun helm-elisp--persistent-help (candidate fun &optional name)
(let ((hbuf (get-buffer (help-buffer)))) (let ((hbuf (get-buffer (help-buffer))))
(if (and (helm-attr 'help-running-p) (cond ((helm-follow-mode-p)
(string= candidate (helm-attr 'help-current-symbol)) (if name
(null helm-persistent-action-use-special-display)) (funcall fun candidate name)
(progn (funcall fun candidate)))
;; When started from a help buffer, ((or (and (helm-attr 'help-running-p)
;; Don't kill this buffer as it is helm-current-buffer. (string= candidate (helm-attr 'help-current-symbol))))
(unless (equal hbuf helm-current-buffer) (progn
(kill-buffer hbuf) ;; When started from a help buffer,
(set-window-buffer (get-buffer-window hbuf) ;; Don't kill this buffer as it is helm-current-buffer.
helm-current-buffer)) (unless (equal hbuf helm-current-buffer)
(helm-attrset 'help-running-p nil)) (kill-buffer hbuf)
(if name (funcall fun candidate name) (funcall fun candidate)) (set-window-buffer (get-buffer-window hbuf)
(helm-attrset 'help-running-p t)) helm-current-buffer))
(helm-attrset 'help-running-p nil)))
(t
(if name
(funcall fun candidate name)
(funcall fun candidate))
(helm-attrset 'help-running-p t)))
(helm-attrset 'help-current-symbol candidate))) (helm-attrset 'help-current-symbol candidate)))
;;;###autoload ;;;###autoload
@ -734,11 +772,11 @@ i.e the `symbol-name' of any existing symbol."
;; ;;
(defun helm-locate-library-scan-list () (defun helm-locate-library-scan-list ()
(cl-loop for dir in load-path (cl-loop for dir in load-path
when (file-directory-p dir) with load-suffixes = '(".el")
append (directory-files dir t (concat (regexp-opt (get-load-suffixes)) when (file-directory-p dir)
"\\'")) append (directory-files
into lst dir t (concat (regexp-opt (get-load-suffixes))
finally return (helm-fast-remove-dups lst :test 'equal))) "\\'"))))
;;;###autoload ;;;###autoload
(defun helm-locate-library () (defun helm-locate-library ()

View File

@ -44,6 +44,12 @@
"Helm eshell completion and history." "Helm eshell completion and history."
:group 'helm) :group 'helm)
(defcustom helm-eshell-fuzzy-match nil
"Enable fuzzy matching in `helm-esh-pcomplete' when non--nil."
:group 'helm-eshell
:type 'boolean)
(defvar helm-eshell-history-map (defvar helm-eshell-history-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
@ -222,7 +228,8 @@ The function that call this should set `helm-ec-target' to thing at point."
(car (last (ignore-errors (car (last (ignore-errors
(pcomplete-parse-arguments)))))) (pcomplete-parse-arguments))))))
(with-helm-show-completion beg end (with-helm-show-completion beg end
(or (helm :sources (helm-make-source "Eshell completions" 'helm-esh-source) (or (helm :sources (helm-make-source "Eshell completions" 'helm-esh-source
:fuzzy-match helm-eshell-fuzzy-match)
:buffer "*helm pcomplete*" :buffer "*helm pcomplete*"
:keymap helm-esh-completion-map :keymap helm-esh-completion-map
:resume 'noresume :resume 'noresume

View File

@ -447,6 +447,7 @@ Don't set it directly, use instead `helm-ff-auto-update-initial-value'.")
(defvar helm-multi-files--toggle-locate nil) (defvar helm-multi-files--toggle-locate nil)
(defvar helm-ff--move-to-first-real-candidate t) (defvar helm-ff--move-to-first-real-candidate t)
(defvar helm-find-files--toggle-bookmark nil) (defvar helm-find-files--toggle-bookmark nil)
(defvar helm-ff--tramp-methods nil)
;;; Helm-find-files ;;; Helm-find-files
@ -1434,30 +1435,31 @@ The checksum is copied to kill-ring."
If prefix numeric arg is given go ARG level up." If prefix numeric arg is given go ARG level up."
(interactive "p") (interactive "p")
(with-helm-alive-p (with-helm-alive-p
(when (and (helm-file-completion-source-p) (let ((src (helm-get-current-source)))
(not (helm-ff-invalid-tramp-name-p))) (when (and (helm-file-completion-source-p src)
(with-helm-window (not (helm-ff-invalid-tramp-name-p)))
(when helm-follow-mode (with-helm-window
(helm-follow-mode -1) (message nil))) (when (helm-follow-mode-p)
;; When going up one level we want to be at the line (helm-follow-mode -1) (message nil)))
;; corresponding to actual directory, so store this info ;; When going up one level we want to be at the line
;; in `helm-ff-last-expanded'. ;; corresponding to actual directory, so store this info
(let ((cur-cand (helm-get-selection)) ;; in `helm-ff-last-expanded'.
(new-pattern (helm-reduce-file-name helm-pattern arg))) (let ((cur-cand (helm-get-selection nil nil src))
(cond ((file-directory-p helm-pattern) (new-pattern (helm-reduce-file-name helm-pattern arg)))
(setq helm-ff-last-expanded helm-ff-default-directory)) (cond ((file-directory-p helm-pattern)
((file-exists-p helm-pattern) (setq helm-ff-last-expanded helm-ff-default-directory))
(setq helm-ff-last-expanded helm-pattern)) ((file-exists-p helm-pattern)
((and cur-cand (file-exists-p cur-cand)) (setq helm-ff-last-expanded helm-pattern))
(setq helm-ff-last-expanded cur-cand))) ((and cur-cand (file-exists-p cur-cand))
(unless helm-find-files--level-tree (setq helm-ff-last-expanded cur-cand)))
(setq helm-find-files--level-tree (unless helm-find-files--level-tree
(cons helm-ff-default-directory (setq helm-find-files--level-tree
helm-find-files--level-tree))) (cons helm-ff-default-directory
(setq helm-find-files--level-tree-iterator nil) helm-find-files--level-tree)))
(push new-pattern helm-find-files--level-tree) (setq helm-find-files--level-tree-iterator nil)
(helm-set-pattern new-pattern helm-suspend-update-flag) (push new-pattern helm-find-files--level-tree)
(with-helm-after-update-hook (helm-ff-retrieve-last-expanded)))))) (helm-set-pattern new-pattern helm-suspend-update-flag)
(with-helm-after-update-hook (helm-ff-retrieve-last-expanded)))))))
(put 'helm-find-files-up-one-level 'helm-only t) (put 'helm-find-files-up-one-level 'helm-only t)
(defun helm-find-files-down-last-level () (defun helm-find-files-down-last-level ()
@ -1500,18 +1502,19 @@ or hitting C-j on \"..\"."
(defun helm-ff-move-to-first-real-candidate () (defun helm-ff-move-to-first-real-candidate ()
"When candidate is an incomplete file name move to first real candidate." "When candidate is an incomplete file name move to first real candidate."
(helm-aif (and (helm-file-completion-source-p) (let ((src (helm-get-current-source)))
(not (helm-empty-source-p)) (helm-aif (and (helm-file-completion-source-p src)
(not (string-match (not (helm-empty-source-p))
"\\`[Dd]ired-" (not (string-match
(assoc-default 'name (helm-get-current-source)))) "\\`[Dd]ired-"
helm-ff--move-to-first-real-candidate (assoc-default 'name (helm-get-current-source))))
(helm-get-selection)) helm-ff--move-to-first-real-candidate
(unless (or (not (stringp it)) (helm-get-selection nil nil src))
(and (string-match helm-tramp-file-name-regexp it) (unless (or (not (stringp it))
(not (file-remote-p it nil t))) (and (string-match helm-tramp-file-name-regexp it)
(file-exists-p it)) (not (file-remote-p it nil t)))
(helm-next-line)))) (file-exists-p it))
(helm-next-line)))))
;;; Auto-update - helm-find-files auto expansion of directories. ;;; Auto-update - helm-find-files auto expansion of directories.
;; ;;
@ -1522,81 +1525,81 @@ When only one candidate is remaining and it is a directory,
expand to this directory. expand to this directory.
This happen only when `helm-ff-auto-update-flag' is non--nil This happen only when `helm-ff-auto-update-flag' is non--nil
or when `helm-pattern' is equal to \"~/\"." or when `helm-pattern' is equal to \"~/\"."
(when (and (helm-file-completion-source-p) (let ((src (helm-get-current-source)))
(not (helm-ff-invalid-tramp-name-p))) (when (and (helm-file-completion-source-p src)
(with-helm-window (not (helm-ff-invalid-tramp-name-p)))
(let* ((history-p (string= (assoc-default (with-helm-window
'name (helm-get-current-source)) (let* ((history-p (string= (assoc-default 'name src)
"Read File Name History")) "Read File Name History"))
(pat (if (string-match helm-tramp-file-name-regexp (pat (if (string-match helm-tramp-file-name-regexp
helm-pattern) helm-pattern)
(helm-create-tramp-name helm-pattern) (helm-create-tramp-name helm-pattern)
helm-pattern)) helm-pattern))
(completed-p (string= (file-name-as-directory (completed-p (string= (file-name-as-directory
(expand-file-name (expand-file-name
(substitute-in-file-name pat))) (substitute-in-file-name pat)))
helm-ff-default-directory)) helm-ff-default-directory))
(candnum (helm-get-candidate-number)) (candnum (helm-get-candidate-number))
(lt2-p (and (<= candnum 2) (lt2-p (and (<= candnum 2)
(>= (string-width (helm-basename helm-pattern)) 2))) (>= (string-width (helm-basename helm-pattern)) 2)))
(cur-cand (prog2 (cur-cand (prog2
(unless (or completed-p (unless (or completed-p
(file-exists-p pat) (file-exists-p pat)
history-p (null lt2-p)) history-p (null lt2-p))
;; Only one non--existing candidate ;; Only one non--existing candidate
;; and one directory candidate, move to it, ;; and one directory candidate, move to it,
;; but not when renaming, copying etc..., ;; but not when renaming, copying etc...,
;; so for this use ;; so for this use
;; `helm-ff-move-to-first-real-candidate' ;; `helm-ff-move-to-first-real-candidate'
;; instead of `helm-next-line' (Issue #910). ;; instead of `helm-next-line' (Issue #910).
(helm-ff-move-to-first-real-candidate)) (helm-ff-move-to-first-real-candidate))
(helm-get-selection)))) (helm-get-selection nil nil src))))
(when (and (or (and helm-ff-auto-update-flag (when (and (or (and helm-ff-auto-update-flag
(null helm-ff--deleting-char-backward) (null helm-ff--deleting-char-backward)
(not (get-buffer-window helm-action-buffer 'visible)) (not (get-buffer-window helm-action-buffer 'visible))
;; Issue #295 ;; Issue #295
;; File predicates are returning t ;; File predicates are returning t
;; with paths like //home/foo. ;; with paths like //home/foo.
;; So check it is not the case by regexp ;; So check it is not the case by regexp
;; to allow user to do C-a / to start e.g ;; to allow user to do C-a / to start e.g
;; entering a tramp method e.g /sudo::. ;; entering a tramp method e.g /sudo::.
(not (string-match "\\`//" helm-pattern)) (not (string-match "\\`//" helm-pattern))
(not (eq last-command 'helm-yank-text-at-point))) (not (eq last-command 'helm-yank-text-at-point)))
;; Fix issue #542. ;; Fix issue #542.
(string= helm-pattern "~/") (string= helm-pattern "~/")
;; Only one remaining directory, expand it. ;; Only one remaining directory, expand it.
(and (= candnum 1) (and (= candnum 1)
helm-ff--auto-update-state helm-ff--auto-update-state
(file-accessible-directory-p pat) (file-accessible-directory-p pat)
(null helm-ff--deleting-char-backward))) (null helm-ff--deleting-char-backward)))
(or (or
;; Only one candidate remaining ;; Only one candidate remaining
;; and at least 2 char in basename. ;; and at least 2 char in basename.
lt2-p lt2-p
;; Already completed. ;; Already completed.
completed-p) completed-p)
(not history-p) ; Don't try to auto complete in history. (not history-p) ; Don't try to auto complete in history.
(stringp cur-cand) (stringp cur-cand)
(file-accessible-directory-p cur-cand)) (file-accessible-directory-p cur-cand))
(if (and (not (helm-dir-is-dot cur-cand)) ; [1] (if (and (not (helm-dir-is-dot cur-cand)) ; [1]
;; Maybe we are here because completed-p is true ;; Maybe we are here because completed-p is true
;; but check this again to be sure. (Windows fix) ;; but check this again to be sure. (Windows fix)
(<= candnum 2)) ; [2] (<= candnum 2)) ; [2]
;; If after going to next line the candidate ;; If after going to next line the candidate
;; is not one of "." or ".." [1] ;; is not one of "." or ".." [1]
;; and only one candidate is remaining [2], ;; and only one candidate is remaining [2],
;; assume candidate is a new directory to expand, and do it. ;; assume candidate is a new directory to expand, and do it.
(helm-set-pattern (file-name-as-directory cur-cand)) (helm-set-pattern (file-name-as-directory cur-cand))
;; The candidate is one of "." or ".." ;; The candidate is one of "." or ".."
;; that mean we have entered the last letter of the directory name ;; that mean we have entered the last letter of the directory name
;; in prompt, so expansion is already done, just add the "/" at end ;; in prompt, so expansion is already done, just add the "/" at end
;; of name unless helm-pattern ends with "." ;; of name unless helm-pattern ends with "."
;; (i.e we are writing something starting with ".") ;; (i.e we are writing something starting with ".")
(unless (string-match "\\`.*[.]\\{1\\}\\'" helm-pattern) (unless (string-match "\\`.*[.]\\{1\\}\\'" helm-pattern)
(helm-set-pattern (helm-set-pattern
;; Need to expand-file-name to avoid e.g /ssh:host:./ in prompt. ;; Need to expand-file-name to avoid e.g /ssh:host:./ in prompt.
(expand-file-name (file-name-as-directory helm-pattern))))) (expand-file-name (file-name-as-directory helm-pattern)))))
(helm-check-minibuffer-input)))))) (helm-check-minibuffer-input)))))))
(defun helm-ff-auto-expand-to-home-or-root () (defun helm-ff-auto-expand-to-home-or-root ()
"Allow expanding to home/user directory or root or text yanked after pattern." "Allow expanding to home/user directory or root or text yanked after pattern."
@ -1680,6 +1683,11 @@ and should be used carefully elsewhere, or not at all, using
(cl-loop with v = (tramp-dissect-file-name fname) (cl-loop with v = (tramp-dissect-file-name fname)
for i across v collect i))) for i across v collect i)))
(defun helm-ff-get-tramp-methods ()
"Returns a list of the car of `tramp-methods'."
(or helm-ff--tramp-methods
(setq helm-ff--tramp-methods (mapcar 'car tramp-methods))))
(cl-defun helm-ff-tramp-hostnames (&optional (pattern helm-pattern)) (cl-defun helm-ff-tramp-hostnames (&optional (pattern helm-pattern))
"Get a list of hosts for tramp method found in `helm-pattern'. "Get a list of hosts for tramp method found in `helm-pattern'.
Argument PATTERN default to `helm-pattern', it is here only for debugging Argument PATTERN default to `helm-pattern', it is here only for debugging
@ -1687,7 +1695,7 @@ purpose."
(when (string-match helm-tramp-file-name-regexp pattern) (when (string-match helm-tramp-file-name-regexp pattern)
(let ((method (match-string 1 pattern)) (let ((method (match-string 1 pattern))
(tn (match-string 0 pattern)) (tn (match-string 0 pattern))
(all-methods (mapcar 'car tramp-methods))) (all-methods (helm-ff-get-tramp-methods)))
(helm-fast-remove-dups (helm-fast-remove-dups
(cl-loop for (f . h) in (tramp-get-completion-function method) (cl-loop for (f . h) in (tramp-get-completion-function method)
append (cl-loop for e in (funcall f (car h)) append (cl-loop for e in (funcall f (car h))
@ -1698,8 +1706,9 @@ purpose."
(defun helm-ff-before-action-hook-fn () (defun helm-ff-before-action-hook-fn ()
"Exit helm when user try to execute action on an invalid tramp fname." "Exit helm when user try to execute action on an invalid tramp fname."
(let ((cand (helm-get-selection))) (let* ((src (helm-get-current-source))
(when (and (helm-file-completion-source-p) (cand (helm-get-selection nil nil src)))
(when (and (helm-file-completion-source-p src)
(stringp cand) (stringp cand)
(helm-ff-invalid-tramp-name-p cand) ; Check candidate. (helm-ff-invalid-tramp-name-p cand) ; Check candidate.
(helm-ff-invalid-tramp-name-p)) ; check helm-pattern. (helm-ff-invalid-tramp-name-p)) ; check helm-pattern.
@ -1711,11 +1720,27 @@ purpose."
(string= (helm-ff-set-pattern pattern) (string= (helm-ff-set-pattern pattern)
"Invalid tramp file name")) "Invalid tramp file name"))
(defun helm-ff-tramp-postfixed-p (str methods)
(let (result)
(save-match-data
(with-temp-buffer
(save-excursion (insert str))
(helm-awhile (search-forward ":" nil t)
(if (save-excursion
(forward-char -1)
(looking-back (mapconcat 'identity methods "\\|")
(point-at-bol)))
(setq result nil)
(setq result it)))))
result))
(defun helm-ff-set-pattern (pattern) (defun helm-ff-set-pattern (pattern)
"Handle tramp filenames in `helm-pattern'." "Handle tramp filenames in `helm-pattern'."
(let ((methods (mapcar 'car tramp-methods)) (let* ((methods (helm-ff-get-tramp-methods))
(reg "\\`/\\([^[/:]+\\|[^/]+]\\):.*:") ;; Returns the position of last ":" entered.
cur-method tramp-name) (postfixed (helm-ff-tramp-postfixed-p pattern methods))
(reg "\\`/\\([^[/:]+\\|[^/]+]\\):.*:")
cur-method tramp-name)
;; In some rare cases tramp can return a nil input, ;; In some rare cases tramp can return a nil input,
;; so be sure pattern is a string for safety (Issue #476). ;; so be sure pattern is a string for safety (Issue #476).
(unless pattern (setq pattern "")) (unless pattern (setq pattern ""))
@ -1728,11 +1753,12 @@ purpose."
((string-match ".*\\(~?/?[.]\\{1\\}/\\)\\'" pattern) ((string-match ".*\\(~?/?[.]\\{1\\}/\\)\\'" pattern)
(expand-file-name default-directory)) (expand-file-name default-directory))
((string-match ".*\\(~//\\|//\\)\\'" pattern) ((string-match ".*\\(~//\\|//\\)\\'" pattern)
(expand-file-name "/")) ; Expand to "/" or "c:/" (expand-file-name "/")) ; Expand to "/" or "c:/"
((string-match "\\`\\(~/\\|.*/~/\\)\\'" pattern) ((string-match "\\`\\(~/\\|.*/~/\\)\\'" pattern)
(expand-file-name "~/")) (expand-file-name "~/"))
;; Match "/method:maybe_hostname:~" ;; Match "/method:maybe_hostname:~"
((and (string-match (concat reg "~") pattern) ((and (string-match (concat reg "~") pattern)
postfixed
(setq cur-method (match-string 1 pattern)) (setq cur-method (match-string 1 pattern))
(member cur-method methods)) (member cur-method methods))
(setq tramp-name (expand-file-name (setq tramp-name (expand-file-name
@ -1741,20 +1767,22 @@ purpose."
(replace-match tramp-name nil t pattern)) (replace-match tramp-name nil t pattern))
;; Match "/method:maybe_hostname:" ;; Match "/method:maybe_hostname:"
((and (string-match reg pattern) ((and (string-match reg pattern)
postfixed
(setq cur-method (match-string 1 pattern)) (setq cur-method (match-string 1 pattern))
(member cur-method methods)) (member cur-method methods))
(setq tramp-name (helm-create-tramp-name (setq tramp-name (helm-create-tramp-name
(match-string 0 pattern))) (match-string 0 pattern)))
(replace-match tramp-name nil t pattern)) (replace-match tramp-name nil t pattern))
;; Match "/hostname:" ;; Match "/hostname:"
((and (string-match helm-tramp-file-name-regexp pattern) ((and (string-match helm-tramp-file-name-regexp pattern)
postfixed
(setq cur-method (match-string 1 pattern)) (setq cur-method (match-string 1 pattern))
(and cur-method (not (member cur-method methods)))) (and cur-method (not (member cur-method methods))))
(setq tramp-name (helm-create-tramp-name (setq tramp-name (helm-create-tramp-name
(match-string 0 pattern))) (match-string 0 pattern)))
(replace-match tramp-name nil t pattern)) (replace-match tramp-name nil t pattern))
;; Match "/method:" in this case don't try to connect. ;; Match "/method:" in this case don't try to connect.
((and (not (string-match reg pattern)) ((and (null postfixed)
(string-match helm-tramp-file-name-regexp pattern) (string-match helm-tramp-file-name-regexp pattern)
(member (match-string 1 pattern) methods)) (member (match-string 1 pattern) methods))
"Invalid tramp file name") ; Write in helm-buffer. "Invalid tramp file name") ; Write in helm-buffer.
@ -1779,6 +1807,9 @@ purpose."
(string= path "Invalid tramp file name") (string= path "Invalid tramp file name")
;; An empty pattern ;; An empty pattern
(string= path "") (string= path "")
(and (string-match-p ":\\'" path)
(helm-ff-tramp-postfixed-p
path (helm-ff-get-tramp-methods)))
;; Check if base directory of PATH is valid. ;; Check if base directory of PATH is valid.
(helm-aif (file-name-directory path) (helm-aif (file-name-directory path)
;; If PATH is a valid directory IT=PATH, ;; If PATH is a valid directory IT=PATH,
@ -1803,6 +1834,7 @@ purpose."
helm-ff--deleting-char-backward helm-ff--deleting-char-backward
(and dir-p (not (string-match-p "/\\'" path)))) (and dir-p (not (string-match-p "/\\'" path))))
(or (>= (length (helm-basename path)) 3) dir-p))) (or (>= (length (helm-basename path)) 3) dir-p)))
;; At this point the tramp connection is triggered.
(setq helm-pattern (helm-ff--transform-pattern-for-completion path)) (setq helm-pattern (helm-ff--transform-pattern-for-completion path))
;; This have to be set after [1] to allow deleting char backward. ;; This have to be set after [1] to allow deleting char backward.
(setq basedir (expand-file-name (setq basedir (expand-file-name
@ -1810,8 +1842,8 @@ purpose."
;; Add the final "/" to path ;; Add the final "/" to path
;; when `helm-ff-auto-update-flag' is enabled. ;; when `helm-ff-auto-update-flag' is enabled.
(file-name-as-directory path) (file-name-as-directory path)
(if (string= path "") "/" (if (string= path "")
(file-name-directory path))))) "/" (file-name-directory path)))))
(setq helm-ff-default-directory (setq helm-ff-default-directory
(if (string= helm-pattern "") (if (string= helm-pattern "")
(expand-file-name "/") ; Expand to "/" or "c:/" (expand-file-name "/") ; Expand to "/" or "c:/"
@ -1820,6 +1852,9 @@ purpose."
(and ffap-url-regexp (and ffap-url-regexp
(string-match ffap-url-regexp path))) (string-match ffap-url-regexp path)))
basedir)))) basedir))))
(when (and (string-match ":\\'" path)
(file-remote-p basedir nil t))
(setq helm-pattern basedir))
(cond ((string= path "Invalid tramp file name") (cond ((string= path "Invalid tramp file name")
(or (helm-ff-tramp-hostnames) ; Hostnames completion. (or (helm-ff-tramp-hostnames) ; Hostnames completion.
(prog2 (prog2
@ -1909,6 +1944,7 @@ If PATTERN is a valid directory name,return PATTERN unchanged."
(setq pattern (helm-ff-handle-backslash pattern)) (setq pattern (helm-ff-handle-backslash pattern))
(let ((bn (helm-basename pattern)) (let ((bn (helm-basename pattern))
(bd (or (helm-basedir pattern) "")) (bd (or (helm-basedir pattern) ""))
;; Trigger tramp connection with file-directory-p.
(dir-p (file-directory-p pattern)) (dir-p (file-directory-p pattern))
(tramp-p (cl-loop for (m . f) in tramp-methods (tramp-p (cl-loop for (m . f) in tramp-methods
thereis (string-match m pattern)))) thereis (string-match m pattern))))
@ -1960,8 +1996,9 @@ Note that only existing directories are saved here."
(defun helm-files-save-file-name-history (&optional force) (defun helm-files-save-file-name-history (&optional force)
"Save selected file to `file-name-history'." "Save selected file to `file-name-history'."
(let ((src-name (assoc-default 'name (helm-get-current-source)))) (let* ((src (helm-get-current-source))
(when (or force (helm-file-completion-source-p) (src-name (assoc-default 'name src)))
(when (or force (helm-file-completion-source-p src)
(member src-name helm-files-save-history-extra-sources)) (member src-name helm-files-save-history-extra-sources))
(let ((mkd (helm-marked-candidates)) (let ((mkd (helm-marked-candidates))
(history-delete-duplicates t)) (history-delete-duplicates t))
@ -2363,9 +2400,7 @@ If CANDIDATE is alone, open file CANDIDATE filename.
That's mean: That's mean:
First hit on C-j expand CANDIDATE second hit open file. First hit on C-j expand CANDIDATE second hit open file.
If a prefix arg is given or `helm-follow-mode' is on open file." If a prefix arg is given or `helm-follow-mode' is on open file."
(let* ((follow (or (buffer-local-value (let* ((follow (or (helm-follow-mode-p)
'helm-follow-mode
(get-buffer-create helm-buffer))
helm--temp-follow-flag)) helm--temp-follow-flag))
(new-pattern (helm-get-selection)) (new-pattern (helm-get-selection))
(num-lines-buf (with-current-buffer helm-buffer (num-lines-buf (with-current-buffer helm-buffer
@ -2556,7 +2591,8 @@ Use it for non--interactive calls of `helm-find-files'."
(not (minibuffer-window-active-p (minibuffer-window))))) (not (minibuffer-window-active-p (minibuffer-window)))))
(tap (thing-at-point 'filename)) (tap (thing-at-point 'filename))
(def (and tap (or (file-remote-p tap) (def (and tap (or (file-remote-p tap)
(expand-file-name tap))))) (expand-file-name tap))))
helm-follow-mode-persistent)
(unless helm-source-find-files (unless helm-source-find-files
(setq helm-source-find-files (helm-make-source (setq helm-source-find-files (helm-make-source
"Find Files" 'helm-source-ffiles))) "Find Files" 'helm-source-ffiles)))
@ -2575,11 +2611,11 @@ Use it for non--interactive calls of `helm-find-files'."
:default def :default def
:prompt "Find files or url: " :prompt "Find files or url: "
:buffer "*helm find files*") :buffer "*helm find files*")
(helm-attrset 'resume `(lambda () (helm-attrset 'resume (lambda ()
(setq helm-ff-default-directory (setq helm-ff-default-directory
,helm-ff-default-directory helm-ff-default-directory
helm-ff-last-expanded helm-ff-last-expanded
,helm-ff-last-expanded)) helm-ff-last-expanded))
helm-source-find-files) helm-source-find-files)
(setq helm-ff-default-directory nil)))) (setq helm-ff-default-directory nil))))
@ -3183,6 +3219,7 @@ Set `recentf-max-saved-items' to a bigger value if default is too small.")
for bn = (buffer-file-name (get-buffer b)) for bn = (buffer-file-name (get-buffer b))
if (or (and bn (file-in-directory-p bn root-directory)) if (or (and bn (file-in-directory-p bn root-directory))
(and (null bn) (and (null bn)
(not (file-remote-p cd))
(file-in-directory-p cd root-directory))) (file-in-directory-p cd root-directory)))
collect b)) collect b))

View File

@ -632,6 +632,7 @@ If N is positive go forward otherwise go backward."
(goto-char it) (goto-char it)
(forward-line 1)) (forward-line 1))
(funcall mark-maybe))) (funcall mark-maybe)))
(helm-follow-execute-persistent-action-maybe)
(helm-log-run-hook 'helm-move-selection-after-hook))) (helm-log-run-hook 'helm-move-selection-after-hook)))
;;;###autoload ;;;###autoload
@ -900,6 +901,13 @@ These extensions will be added to command line with --include arg of grep."
(keymap :initform helm-grep-map) (keymap :initform helm-grep-map)
(nohighlight :initform t) (nohighlight :initform t)
(nomark :initform t) (nomark :initform t)
(backend :initarg :backend
:initform nil
:documentation
" The grep backend that will be used.
It is actually used only as an internal flag
and don't set the backend by itself.
You probably don't want to modify this.")
(candidate-number-limit :initform 9999) (candidate-number-limit :initform 9999)
(help-message :initform 'helm-grep-help-message) (help-message :initform 'helm-grep-help-message)
(history :initform 'helm-grep-history) (history :initform 'helm-grep-history)
@ -910,11 +918,21 @@ These extensions will be added to command line with --include arg of grep."
(defvar helm-source-grep nil) (defvar helm-source-grep nil)
(defun helm-do-grep-1 (targets &optional recurse grep exts default-input input) (defmethod helm--setup-source ((source helm-grep-class))
"Launch grep on a list of TARGETS files. (call-next-method)
(helm-aif (and helm-follow-mode-persistent
(if (eq (slot-value source 'backend) 'git)
helm-source-grep-git
helm-source-grep))
(setf (slot-value source 'follow)
(assoc-default 'follow it))))
When RECURSE is given use -r option of grep and prompt user (cl-defun helm-do-grep-1 (targets &optional recurse backend exts
for EXTS to set the --include args of grep. default-input input (source 'helm-source-grep))
"Launch helm using backend BACKEND on a list of TARGETS files.
When RECURSE is given and BACKEND is 'grep' use -r option of
BACKEND and prompt user for EXTS to set the --include args of BACKEND.
Interactively you can give more than one arg separated by space at prompt. Interactively you can give more than one arg separated by space at prompt.
e.g e.g
$Pattern: *.el *.py *.tex $Pattern: *.el *.py *.tex
@ -927,9 +945,9 @@ If prompt is empty `helm-grep-ignored-files' are added to --exclude.
Argument DEFAULT-INPUT is use as `default' arg of `helm' and INPUT Argument DEFAULT-INPUT is use as `default' arg of `helm' and INPUT
is used as `input' arg of `helm', See `helm' docstring. is used as `input' arg of `helm', See `helm' docstring.
Arg GREP when non--nil specify which grep to use Arg BACKEND when non--nil specify which backend to use
It is used actually to specify 'zgrep or 'git. It is used actually to specify 'zgrep' or 'git'.
When zgrep is used don't prompt for a choice When BACKEND 'zgrep' is used don't prompt for a choice
in recurse, and ignore EXTS, search being made recursively on files matching in recurse, and ignore EXTS, search being made recursively on files matching
`helm-zgrep-file-extension-regexp' only." `helm-zgrep-file-extension-regexp' only."
(when (and (helm-grep-use-ack-p) (when (and (helm-grep-use-ack-p)
@ -939,7 +957,7 @@ in recurse, and ignore EXTS, search being made recursively on files matching
(let* (non-essential (let* (non-essential
(exts (and recurse (exts (and recurse
;; [FIXME] I could handle this from helm-walk-directory. ;; [FIXME] I could handle this from helm-walk-directory.
(not (eq grep 'zgrep)) ; zgrep doesn't handle -r opt. (not (eq backend 'zgrep)) ; zgrep doesn't handle -r opt.
(not (helm-grep-use-ack-p :where 'recursive)) (not (helm-grep-use-ack-p :where 'recursive))
(or exts (helm-grep-get-file-extensions targets)))) (or exts (helm-grep-get-file-extensions targets))))
(include-files (include-files
@ -951,16 +969,14 @@ in recurse, and ignore EXTS, search being made recursively on files matching
(remove "*" exts) (remove "*" exts)
exts) " "))) exts) " ")))
(types (and (not include-files) (types (and (not include-files)
(not (eq grep 'zgrep)) (not (eq backend 'zgrep))
recurse recurse
(helm-grep-use-ack-p :where 'recursive) (helm-grep-use-ack-p :where 'recursive)
;; When %e format spec is not specified ;; When %e format spec is not specified
;; ignore types and do not prompt for choice. ;; ignore types and do not prompt for choice.
(string-match "%e" helm-grep-default-command) (string-match "%e" helm-grep-default-command)
(helm-grep-read-ack-type))) (helm-grep-read-ack-type)))
(follow (and helm-follow-mode-persistent (src-name (capitalize (helm-grep-command recurse backend))))
(assoc-default 'follow helm-source-grep)))
(src-name (capitalize (helm-grep-command recurse grep))))
;; When called as action from an other source e.g *-find-files ;; When called as action from an other source e.g *-find-files
;; we have to kill action buffer. ;; we have to kill action buffer.
(when (get-buffer helm-action-buffer) (when (get-buffer helm-action-buffer)
@ -973,14 +989,14 @@ in recurse, and ignore EXTS, search being made recursively on files matching
;; We need to store these vars locally ;; We need to store these vars locally
;; to pass infos later to `helm-resume'. ;; to pass infos later to `helm-resume'.
(helm-set-local-variable (helm-set-local-variable
'helm-zgrep-recurse-flag (and recurse (eq grep 'zgrep)) 'helm-zgrep-recurse-flag (and recurse (eq backend 'zgrep))
'helm-grep-last-targets targets 'helm-grep-last-targets targets
'helm-grep-include-files (or include-files types) 'helm-grep-include-files (or include-files types)
'helm-grep-in-recurse recurse 'helm-grep-in-recurse recurse
'helm-grep-use-zgrep (eq grep 'zgrep) 'helm-grep-use-zgrep (eq backend 'zgrep)
'helm-grep-default-command 'helm-grep-default-command
(cond ((eq grep 'zgrep) helm-default-zgrep-command) (cond ((eq backend 'zgrep) helm-default-zgrep-command)
((eq grep 'git) helm-grep-git-grep-command) ((eq backend 'git) helm-grep-git-grep-command)
(recurse helm-grep-default-recurse-command) (recurse helm-grep-default-recurse-command)
;; When resuming, the local value of ;; When resuming, the local value of
;; `helm-grep-default-command' is used, only git-grep ;; `helm-grep-default-command' is used, only git-grep
@ -988,11 +1004,11 @@ in recurse, and ignore EXTS, search being made recursively on files matching
(t helm-grep-default-command)) (t helm-grep-default-command))
'default-directory helm-ff-default-directory) ;; [1] 'default-directory helm-ff-default-directory) ;; [1]
;; Setup the source. ;; Setup the source.
(setq helm-source-grep (helm-make-source src-name 'helm-grep-class (set source (helm-make-source src-name 'helm-grep-class
:follow follow)) :backend backend))
(helm (helm
:sources 'helm-source-grep :sources source
:buffer (format "*helm %s*" (helm-grep-command recurse grep)) :buffer (format "*helm %s*" (helm-grep-command recurse backend))
:default default-input :default default-input
:input input :input input
:keymap helm-grep-map :keymap helm-grep-map
@ -1354,6 +1370,13 @@ if available with current AG version."
(defvar helm-source-grep-ag nil) (defvar helm-source-grep-ag nil)
(defmethod helm--setup-source ((source helm-grep-ag-class))
(call-next-method)
(helm-aif (and helm-follow-mode-persistent
helm-source-grep-ag
(assoc-default 'follow helm-source-grep-ag))
(setf (slot-value source 'follow) it)))
(defun helm-grep-ag-1 (directory &optional type) (defun helm-grep-ag-1 (directory &optional type)
"Start helm ag in DIRECTORY maybe searching in files of type TYPE." "Start helm ag in DIRECTORY maybe searching in files of type TYPE."
(setq helm-source-grep-ag (setq helm-source-grep-ag
@ -1384,6 +1407,8 @@ When WITH-TYPES is non-nil provide completion on AG types."
;;; Git grep ;;; Git grep
;; ;;
;; ;;
(defvar helm-source-grep-git nil)
(defcustom helm-grep-git-grep-command (defcustom helm-grep-git-grep-command
"git --no-pager grep -n%cH --color=always --exclude-standard --no-index --full-name -e %p -- %f" "git --no-pager grep -n%cH --color=always --exclude-standard --no-index --full-name -e %p -- %f"
"The git grep default command line. "The git grep default command line.
@ -1415,7 +1440,7 @@ arg INPUT is what you will have by default at prompt on startup."
(helm-ff-default-directory (funcall helm-grep-default-directory-fn))) (helm-ff-default-directory (funcall helm-grep-default-directory-fn)))
(cl-assert helm-ff-default-directory nil "Not inside a Git repository") (cl-assert helm-ff-default-directory nil "Not inside a Git repository")
(helm-do-grep-1 (if all '("") `(,(expand-file-name directory))) (helm-do-grep-1 (if all '("") `(,(expand-file-name directory)))
nil 'git nil default input))) nil 'git nil default input 'helm-source-grep-git)))
;;;###autoload ;;;###autoload
@ -1424,7 +1449,7 @@ arg INPUT is what you will have by default at prompt on startup."
With prefix-arg prompt for type if available with your AG version." With prefix-arg prompt for type if available with your AG version."
(interactive "P") (interactive "P")
(require 'helm-files) (require 'helm-files)
(helm-grep-ag default-directory arg)) (helm-grep-ag (expand-file-name default-directory) arg))
;;;###autoload ;;;###autoload
(defun helm-grep-do-git-grep (arg) (defun helm-grep-do-git-grep (arg)

View File

@ -144,23 +144,13 @@ For Windows and `es' use something like \"es -r ^%s.*%s.*$\"."
"Try to find if a local locatedb file is available. "Try to find if a local locatedb file is available.
The search is done in `helm-ff-default-directory' or The search is done in `helm-ff-default-directory' or
fall back to `default-directory' if FROM-FF is nil." fall back to `default-directory' if FROM-FF is nil."
(when helm-ff-locate-db-filename (helm-aif (and helm-ff-locate-db-filename
(cond ((and helm-ff-default-directory (locate-dominating-file
from-ff (or (and from-ff
(file-exists-p (expand-file-name helm-ff-default-directory)
helm-ff-locate-db-filename default-directory)
helm-ff-default-directory)) helm-ff-locate-db-filename))
(expand-file-name (expand-file-name helm-ff-locate-db-filename it)))
helm-ff-locate-db-filename
helm-ff-default-directory)))
((and (not from-ff)
(file-exists-p (expand-file-name
helm-ff-locate-db-filename
default-directory))
(expand-file-name
helm-ff-locate-db-filename
default-directory))))))
(defun helm-locate-create-db-default-function (db-name directory) (defun helm-locate-create-db-default-function (db-name directory)
"Default function used to create a locale locate db file. "Default function used to create a locale locate db file.

View File

@ -19,6 +19,7 @@
(require 'cl-lib) (require 'cl-lib)
(require 'helm) (require 'helm)
(require 'helm-lib)
(require 'helm-files) (require 'helm-files)
@ -219,13 +220,13 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'."
;; Also, the history collections generally collect their ;; Also, the history collections generally collect their
;; elements as string, so intern them to call predicate. ;; elements as string, so intern them to call predicate.
((and (symbolp collection) (boundp collection) test) ((and (symbolp collection) (boundp collection) test)
(let ((predicate `(lambda (elm) (let ((predicate (lambda (elm)
(condition-case err (condition-case _err
(if (eq (quote ,test) 'commandp) (if (eq test 'commandp)
(funcall (quote ,test) (intern elm)) (funcall test (intern elm))
(funcall (quote ,test) elm)) (funcall test elm))
(wrong-type-argument (wrong-type-argument
(funcall (quote ,test) (intern elm))))))) (funcall test (intern elm)))))))
(all-completions input (symbol-value collection) predicate))) (all-completions input (symbol-value collection) predicate)))
((and (symbolp collection) (boundp collection)) ((and (symbolp collection) (boundp collection))
(all-completions input (symbol-value collection))) (all-completions input (symbol-value collection)))
@ -826,6 +827,7 @@ Keys description:
(and helm-ff-auto-update-initial-value (and helm-ff-auto-update-initial-value
(not (minibuffer-window-active-p (minibuffer-window))))) (not (minibuffer-window-active-p (minibuffer-window)))))
helm-full-frame helm-full-frame
helm-follow-mode-persistent
(hist (and history (helm-comp-read-get-candidates (hist (and history (helm-comp-read-get-candidates
history nil nil alistp))) history nil nil alistp)))
(minibuffer-completion-confirm must-match) (minibuffer-completion-confirm must-match)

View File

@ -96,11 +96,6 @@ This is a format string, don't forget the `%s'."
:type 'string :type 'string
:group 'helm-net) :group 'helm-net)
(defcustom helm-wikipedia-follow-delay 2
"Delay before wikipedia summary popup."
:type 'number
:group 'helm-net)
(defcustom helm-search-suggest-action-youtube-url (defcustom helm-search-suggest-action-youtube-url
"http://www.youtube.com/results?aq=f&search_query=%s" "http://www.youtube.com/results?aq=f&search_query=%s"
"The Youtube search url. "The Youtube search url.
@ -359,10 +354,9 @@ Can be \"-new-tab\" (default) or \"-new-window\"."
helm-search-suggest-action-wikipedia-url helm-search-suggest-action-wikipedia-url
candidate)))) candidate))))
:persistent-action #'helm-wikipedia-persistent-action :persistent-action #'helm-wikipedia-persistent-action
:persistent-help "show summary"
:volatile t :volatile t
:keymap helm-map :keymap helm-map
:follow 1
:follow-delay helm-wikipedia-follow-delay
:requires-pattern 3)) :requires-pattern 3))

View File

@ -57,9 +57,9 @@ Note this have no effect in `helm-org-in-buffer-headings'."
(defcustom helm-org-headings-actions (defcustom helm-org-headings-actions
'(("Go to heading" . helm-org-goto-marker) '(("Go to heading" . helm-org-goto-marker)
("Open in indirect buffer `C-RET'" . helm-org--open-heading-in-indirect-buffer) ("Open in indirect buffer `C-c i'" . helm-org--open-heading-in-indirect-buffer)
("Refile to this heading `C-w`''" . helm-org-heading-refile) ("Refile to this heading `C-c w`" . helm-org-heading-refile)
("Insert link to this heading `C-l`''" . helm-org-insert-link-to-heading-at-marker)) ("Insert link to this heading `C-c l`" . helm-org-insert-link-to-heading-at-marker))
"Default actions alist for "Default actions alist for
`helm-source-org-headings-for-files'." `helm-source-org-headings-for-files'."
:group 'helm-org :group 'helm-org
@ -100,19 +100,19 @@ Note this have no effect in `helm-org-in-buffer-headings'."
(set-window-prev-buffers nil (append (cdr (window-prev-buffers)) (set-window-prev-buffers nil (append (cdr (window-prev-buffers))
(car (window-prev-buffers))))) (car (window-prev-buffers)))))
(defun helm-org--run-open-heading-in-indirect-buffer () (defun helm-org-run-open-heading-in-indirect-buffer ()
"Open selected Org heading in an indirect buffer." "Open selected Org heading in an indirect buffer."
(interactive) (interactive)
(with-helm-alive-p (with-helm-alive-p
(helm-exit-and-execute-action #'helm-org--open-heading-in-indirect-buffer))) (helm-exit-and-execute-action #'helm-org--open-heading-in-indirect-buffer)))
(put 'helm-org--run-open-heading-in-indirect-buffer 'helm-only t) (put 'helm-org-run-open-heading-in-indirect-buffer 'helm-only t)
(defvar helm-org-headings-map (defvar helm-org-headings-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(set-keymap-parent map helm-map) (set-keymap-parent map helm-map)
(define-key map (kbd "<C-return>") 'helm-org--run-open-heading-in-indirect-buffer) (define-key map (kbd "<C-c i>") 'helm-org-run-open-heading-in-indirect-buffer)
(define-key map (kbd "C-w") 'helm-org-heading-refile) (define-key map (kbd "C-c w") 'helm-org-run-heading-refile)
(define-key map (kbd "C-l") 'helm-org-insert-link-to-heading-at-marker) (define-key map (kbd "C-c l") 'helm-org-run-insert-link-to-heading-at-marker)
map) map)
"Keymap for `helm-source-org-headings-for-files'.") "Keymap for `helm-source-org-headings-for-files'.")
@ -218,6 +218,12 @@ Note this have no effect in `helm-org-in-buffer-headings'."
(org-insert-link (org-insert-link
file-name (concat "file:" file-name "::*" heading-name)))))) file-name (concat "file:" file-name "::*" heading-name))))))
(defun helm-org-run-insert-link-to-heading-at-marker ()
(interactive)
(with-helm-alive-p
(helm-exit-and-execute-action
'helm-org-insert-link-to-heading-at-marker)))
(defun helm-org-heading-refile (marker) (defun helm-org-heading-refile (marker)
(save-selected-window (save-selected-window
(when (eq major-mode 'org-agenda-mode) (when (eq major-mode 'org-agenda-mode)
@ -230,6 +236,19 @@ Note this have no effect in `helm-org-in-buffer-headings'."
(org-end-of-subtree t t) (org-end-of-subtree t t)
(org-paste-subtree (+ target-level 1))))) (org-paste-subtree (+ target-level 1)))))
(defun helm-org-in-buffer-preselect ()
(if (org-on-heading-p)
(buffer-substring-no-properties (point-at-bol) (point-at-eol))
(save-excursion
(outline-previous-visible-heading 1)
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
(defun helm-org-run-heading-refile ()
(interactive)
(with-helm-alive-p
(helm-exit-and-execute-action 'helm-org-heading-refile)))
(put 'helm-org-run-heading-refile 'helm-only t)
;;;###autoload ;;;###autoload
(defun helm-org-agenda-files-headings () (defun helm-org-agenda-files-headings ()
"Preconfigured helm for org files headings." "Preconfigured helm for org files headings."
@ -243,10 +262,11 @@ Note this have no effect in `helm-org-in-buffer-headings'."
(defun helm-org-in-buffer-headings () (defun helm-org-in-buffer-headings ()
"Preconfigured helm for org buffer headings." "Preconfigured helm for org buffer headings."
(interactive) (interactive)
(let ((helm-org-show-filename nil)) (let (helm-org-show-filename helm-org-format-outline-path)
(helm :sources (helm-source-org-headings-for-files (helm :sources (helm-source-org-headings-for-files
(list (current-buffer))) (list (current-buffer)))
:candidate-number-limit 99999 :candidate-number-limit 99999
:preselect (helm-org-in-buffer-preselect)
:truncate-lines helm-org-truncate-lines :truncate-lines helm-org-truncate-lines
:buffer "*helm org inbuffer*"))) :buffer "*helm org inbuffer*")))

View File

@ -1,8 +1,8 @@
(define-package "helm" "20160818.623" "Helm is an Emacs incremental and narrowing framework" (define-package "helm" "20160914.813" "Helm is an Emacs incremental and narrowing framework"
'((emacs "24.3") '((emacs "24.4")
(async "1.9") (async "1.9")
(popup "0.5.3") (popup "0.5.3")
(helm-core "1.9.9")) (helm-core "2.1.0"))
:url "https://emacs-helm.github.io/helm/") :url "https://emacs-helm.github.io/helm/")
;; Local Variables: ;; Local Variables:
;; no-byte-compile: t ;; no-byte-compile: t

View File

@ -164,7 +164,7 @@ i.e Don't replace inside a word, regexp is surrounded with \\bregexp\\b."
(helm-highlight-current-line)) (helm-highlight-current-line))
(defun helm-regexp-kill-new (input) (defun helm-regexp-kill-new (input)
(kill-new input) (kill-new (substring-no-properties input))
(message "Killed: %s" input)) (message "Killed: %s" input))

View File

@ -249,9 +249,6 @@ replace with STR as yanked string."
(set-mark (mark t))) (set-mark (mark t)))
nil) nil)
(defadvice push-mark (around helm-push-mark-mode)
(helm--push-mark location nomsg activate))
;;;###autoload ;;;###autoload
(define-minor-mode helm-push-mark-mode (define-minor-mode helm-push-mark-mode
"Provide an improved version of `push-mark'. "Provide an improved version of `push-mark'.
@ -260,12 +257,8 @@ the `global-mark-ring' after each new visit."
:group 'helm-ring :group 'helm-ring
:global t :global t
(if helm-push-mark-mode (if helm-push-mark-mode
(if (fboundp 'advice-add) (advice-add 'push-mark :override #'helm--push-mark)
(advice-add 'push-mark :override #'helm--push-mark) (advice-remove 'push-mark #'helm--push-mark)))
(ad-activate 'push-mark))
(if (fboundp 'advice-remove)
(advice-remove 'push-mark #'helm--push-mark)
(ad-deactivate 'push-mark))))
;;;; <Register> ;;;; <Register>
;;; Insert from register ;;; Insert from register

View File

@ -35,22 +35,41 @@
(defcustom helm-top-command (defcustom helm-top-command
(cl-case system-type (cl-case system-type
(darwin "env COLUMNS=%s ps -axo pid,user,pri,nice,ucomm,tty,start,vsz,%%cpu,%%mem,etime,command") (darwin "env COLUMNS=%s ps -axo pid,user,pri,nice,ucomm,tty,start_time,vsz,%%cpu,%%mem,etime,command")
(t "env COLUMNS=%s top -b -n 1")) (t "env COLUMNS=%s top -b -n 1"))
"Top command used to display output of top. "Top command used to display output of top.
To use top command, a version supporting batch mode (-b option) is needed. A format string where %s will be replaced with `frame-width'.
On Mac OSX top command doesn't support this, so ps command
is used by default instead. To use 'top' command, a version supporting batch mode (-b option) is needed.
If you modify this the number and order of elements displayed On Mac OSX 'top' command doesn't support this, so ps command
should be the same as top command to have the sort commands is used instead by default.
working properly, that is 12 elements with the 2 first being Normally 'top' command output have 12 columns, but in some versions you may
PID and USER and the last 4 being %CPU, %MEM, TIME and COMMAND. have less than this, so you can either customize top to use 12 columns with the
A format string where %s will be replaced with `frame-width'." interactives 'f' and 'W' commands of top, or modify
`helm-top-sort-colums-alist' to fit with the number of columns
your 'top' command is using.
If you modify 'ps' command be sure that 'pid' comes in first
and \"env COLUMNS=%s\" is specified at beginning of command.
Ensure also that no elements contain spaces (e.g use start_time and not start).
Same as for 'top' you can customize `helm-top-sort-colums-alist' to make sort commands
working properly according to your settings."
:group 'helm-sys :group 'helm-sys
:type 'string) :type 'string)
(defcustom helm-top-sort-colums-alist '((com . 11)
(mem . 9)
(cpu . 8)
(user . 1))
"Allow defining which column to use when sorting output of top/ps command.
Only com, mem, cpu and user are sorted, so no need to put something else there,
it will have no effect.
Note that column numbers are counted from zero, i.e column 1 is the nth 0 column."
:group 'helm-sys
:type '(alist :key-type symbol :value-type (integer :tag "Column number")))
(defcustom helm-top-poll-delay 1.5 (defcustom helm-top-poll-delay 1.5
"Helm top poll after this dealy when `helm-top-poll-mode' is enabled. "Helm top poll after this delay when `helm-top-poll-mode' is enabled.
The minimal delay allowed is 1.5, if less than this helm-top will use 1.5." The minimal delay allowed is 1.5, if less than this helm-top will use 1.5."
:group 'helm-sys :group 'helm-sys
:type 'float) :type 'float)
@ -64,7 +83,8 @@ being idle."
(defcustom helm-top-poll-preselection 'linum (defcustom helm-top-poll-preselection 'linum
"Stay on same line or follow candidate when `helm-top-poll' update display. "Stay on same line or follow candidate when `helm-top-poll' update display.
Possible values are 'candidate or 'linum." Possible values are 'candidate or 'linum.
This affect also sorting functions in the same way."
:group'helm-sys :group'helm-sys
:type '(radio :tag "Preferred preselection action for helm-top" :type '(radio :tag "Preferred preselection action for helm-top"
(const :tag "Follow candidate" candidate) (const :tag "Follow candidate" candidate)
@ -164,6 +184,7 @@ Possible values are 'candidate or 'linum."
:persistent-action #'helm-top-sh-persistent-action :persistent-action #'helm-top-sh-persistent-action
:persistent-help "SIGTERM" :persistent-help "SIGTERM"
:help-message 'helm-top-help-message :help-message 'helm-top-help-message
:mode-line 'helm-top-mode-line
:follow 'never :follow 'never
:keymap helm-top-map :keymap helm-top-map
:filtered-candidate-transformer #'helm-top-sort-transformer :filtered-candidate-transformer #'helm-top-sort-transformer
@ -183,10 +204,11 @@ Return empty string for non--valid candidates."
(cons helm-top--line lst)))) (cons helm-top--line lst))))
(defun helm-top--skip-top-line () (defun helm-top--skip-top-line ()
(let ((src-name (assoc-default 'name (helm-get-current-source)))) (let* ((src (helm-get-current-source))
(src-name (assoc-default 'name src)))
(helm-aif (and (stringp src-name) (helm-aif (and (stringp src-name)
(string= src-name "Top") (string= src-name "Top")
(helm-get-selection nil t)) (helm-get-selection nil t src))
(when (string-match-p "^ *PID" it) (when (string-match-p "^ *PID" it)
(helm-next-line))))) (helm-next-line)))))
@ -258,55 +280,69 @@ Show actions only on line starting by a PID."
(defun helm-top-sort-by-com (s1 s2) (defun helm-top-sort-by-com (s1 s2)
(let* ((split-1 (split-string s1)) (let* ((split-1 (split-string s1))
(split-2 (split-string s2)) (split-2 (split-string s2))
(com-1 (nth 11 split-1)) (col (cdr (assq 'com helm-top-sort-colums-alist)))
(com-2 (nth 11 split-2))) (com-1 (nth col split-1))
(com-2 (nth col split-2)))
(string< com-1 com-2))) (string< com-1 com-2)))
(defun helm-top-sort-by-mem (s1 s2) (defun helm-top-sort-by-mem (s1 s2)
(let* ((split-1 (split-string s1)) (let* ((split-1 (split-string s1))
(split-2 (split-string s2)) (split-2 (split-string s2))
(mem-1 (string-to-number (nth 9 split-1))) (col (cdr (assq 'mem helm-top-sort-colums-alist)))
(mem-2 (string-to-number (nth 9 split-2)))) (mem-1 (string-to-number (nth col split-1)))
(mem-2 (string-to-number (nth col split-2))))
(> mem-1 mem-2))) (> mem-1 mem-2)))
(defun helm-top-sort-by-cpu (s1 s2)
(let* ((split-1 (split-string s1))
(split-2 (split-string s2))
(col (cdr (assq 'cpu helm-top-sort-colums-alist)))
(cpu-1 (string-to-number (nth col split-1)))
(cpu-2 (string-to-number (nth col split-2))))
(> cpu-1 cpu-2)))
(defun helm-top-sort-by-user (s1 s2) (defun helm-top-sort-by-user (s1 s2)
(let* ((split-1 (split-string s1)) (let* ((split-1 (split-string s1))
(split-2 (split-string s2)) (split-2 (split-string s2))
(user-1 (nth 1 split-1)) (col (cdr (assq 'user helm-top-sort-colums-alist)))
(user-2 (nth 1 split-2))) (user-1 (nth col split-1))
(user-2 (nth col split-2)))
(string< user-1 user-2))) (string< user-1 user-2)))
(defun helm-top--preselect-fn ()
(if (eq helm-top-poll-preselection 'linum)
`(lambda ()
(goto-char (point-min))
(forward-line ,(helm-candidate-number-at-point)))
(replace-regexp-in-string
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(defun helm-top-run-sort-by-com () (defun helm-top-run-sort-by-com ()
(interactive) (interactive)
(helm-top-set-mode-line "COM") (helm-top-set-mode-line "COM")
(setq helm-top-sort-fn 'helm-top-sort-by-com) (setq helm-top-sort-fn 'helm-top-sort-by-com)
(helm-update (replace-regexp-in-string (helm-update (helm-top--preselect-fn)))
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(defun helm-top-run-sort-by-cpu () (defun helm-top-run-sort-by-cpu ()
(interactive) (interactive)
(helm-top-set-mode-line "CPU") (let ((com (nth 2 (split-string helm-top-command))))
(setq helm-top-sort-fn nil) (helm-top-set-mode-line "CPU")
(helm-update (replace-regexp-in-string (setq helm-top-sort-fn (and (null (string= com "top"))
"[0-9]+" "[0-9]+" 'helm-top-sort-by-cpu))
(regexp-quote (helm-get-selection nil t))))) (helm-update (helm-top--preselect-fn))))
(defun helm-top-run-sort-by-mem () (defun helm-top-run-sort-by-mem ()
(interactive) (interactive)
(helm-top-set-mode-line "MEM") (helm-top-set-mode-line "MEM")
(setq helm-top-sort-fn 'helm-top-sort-by-mem) (setq helm-top-sort-fn 'helm-top-sort-by-mem)
(helm-update (replace-regexp-in-string (helm-update (helm-top--preselect-fn)))
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(defun helm-top-run-sort-by-user () (defun helm-top-run-sort-by-user ()
(interactive) (interactive)
(helm-top-set-mode-line "USER") (helm-top-set-mode-line "USER")
(setq helm-top-sort-fn 'helm-top-sort-by-user) (setq helm-top-sort-fn 'helm-top-sort-by-user)
(helm-update (replace-regexp-in-string (helm-update (helm-top--preselect-fn)))
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
;;; X RandR resolution change ;;; X RandR resolution change

View File

@ -115,7 +115,8 @@
(setf (slot-value source 'keymap) helm-bookmark-map) (setf (slot-value source 'keymap) helm-bookmark-map)
(setf (slot-value source 'mode-line) (list "Bookmark(s)" helm-mode-line-string)) (setf (slot-value source 'mode-line) (list "Bookmark(s)" helm-mode-line-string))
(setf (slot-value source 'help-message) 'helm-bookmark-help-message) (setf (slot-value source 'help-message) 'helm-bookmark-help-message)
(setf (slot-value source 'migemo) t)) (setf (slot-value source 'migemo) t)
(setf (slot-value source 'follow) 'never))
;; Buffers ;; Buffers

View File

@ -211,16 +211,6 @@ In this case last position is added to the register
"Face used to highlight item matched in a selected line." "Face used to highlight item matched in a selected line."
:group 'helm-faces) :group 'helm-faces)
;; CUA workaround
(defadvice cua-delete-region (around helm-avoid-cua activate)
(ignore-errors ad-do-it))
(defadvice copy-region-as-kill (around helm-avoid-cua activate)
(if cua-mode
(ignore-errors ad-do-it)
ad-do-it))
;;; Utils functions ;;; Utils functions
;; ;;
@ -680,15 +670,16 @@ If STRING is non--nil return instead a space separated string."
(member (assoc-default 'name (helm-get-current-source)) (member (assoc-default 'name (helm-get-current-source))
helm-sources-using-help-echo-popup)) helm-sources-using-help-echo-popup))
(setq helm--show-help-echo-timer (setq helm--show-help-echo-timer
(run-with-idle-timer (run-with-timer
1 nil 1 nil
(lambda () (lambda ()
(with-helm-window (save-selected-window
(helm-aif (get-text-property (point-at-bol) 'help-echo) (with-helm-window
(popup-tip (concat " " (abbreviate-file-name it)) (helm-aif (get-text-property (point-at-bol) 'help-echo)
:around nil (popup-tip (concat " " (abbreviate-file-name it))
:point (save-excursion :around nil
(end-of-visual-line) (point)))))))))) :point (save-excursion
(end-of-visual-line) (point)))))))))))
;;;###autoload ;;;###autoload
(define-minor-mode helm-popup-tip-mode (define-minor-mode helm-popup-tip-mode

View File

@ -1,373 +0,0 @@
;;; helm-multi-match.el --- Multiple regexp matching methods for helm -*- lexical-binding: t -*-
;; Original Author: rubikitch
;; Copyright (C) 2008 ~ 2011 rubikitch
;; Copyright (C) 2011 ~ 2016 Thierry Volpiatto <thierry.volpiatto@gmail.com>
;; Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
;; URL: http://github.com/emacs-helm/helm
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(require 'cl-lib)
(require 'helm-lib)
(defgroup helm-multi-match nil
"Helm multi match."
:group 'helm)
(defcustom helm-mm-matching-method 'multi3
"Matching method for helm match plugin.
You can set here different methods to match candidates in helm.
Here are the possible value of this symbol and their meaning:
- multi1: Respect order, prefix of pattern must match.
- multi2: Same but with partial match.
- multi3: The best, multiple regexp match, allow negation.
- multi3p: Same but prefix must match.
Default is multi3, you should keep this for a better experience.
Note that multi1 and multi3p are incompatible with fuzzy matching
in file completion and by the way fuzzy matching will be disabled there
when these options are used."
:type '(radio :tag "Matching methods for helm"
(const :tag "Multiple regexp 1 ordered with prefix match" multi1)
(const :tag "Multiple regexp 2 ordered with partial match" multi2)
(const :tag "Multiple regexp 3 matching no order, partial, best." multi3)
(const :tag "Multiple regexp 3p matching with prefix match" multi3p))
:group 'helm-multi-match)
;; Internal
(defvar helm-mm-default-match-functions
'(helm-mm-exact-match helm-mm-match))
(defvar helm-mm-default-search-functions
'(helm-mm-exact-search helm-mm-search))
;;; Build regexps
;;
;;
(defvar helm-mm-space-regexp "[\\ ] "
"Regexp to represent space itself in multiple regexp match.")
(defun helm-mm-split-pattern (pattern)
"Split PATTERN if it contain spaces and return resulting list.
If spaces in PATTERN are escaped, don't split at this place.
i.e \"foo bar\"=> (\"foo\" \"bar\")
but \"foo\ bar\"=> (\"foobar\")."
(if (string= pattern "")
'("")
(cl-loop for s in (split-string
(replace-regexp-in-string helm-mm-space-regexp
"\000\000" pattern)
" " t)
collect (replace-regexp-in-string "\000\000" " " s))))
(defun helm-mm-1-make-regexp (pattern)
"Replace spaces in PATTERN with \"\.*\"."
(mapconcat 'identity (helm-mm-split-pattern pattern) ".*"))
;;; Exact match.
;;
;;
;; Internal.
(defvar helm-mm-exact-pattern-str nil)
(defvar helm-mm-exact-pattern-real nil)
(defun helm-mm-exact-get-pattern (pattern)
(unless (equal pattern helm-mm-exact-pattern-str)
(setq helm-mm-exact-pattern-str pattern
helm-mm-exact-pattern-real (concat "\n" pattern "\n")))
helm-mm-exact-pattern-real)
(cl-defun helm-mm-exact-match (str &optional (pattern helm-pattern))
(if case-fold-search
(progn
(setq str (downcase str)
pattern (downcase pattern))
(string= str pattern))
(string= str pattern)))
(defun helm-mm-exact-search (pattern &rest _ignore)
(and (search-forward (helm-mm-exact-get-pattern pattern) nil t)
(forward-line -1)))
;;; Prefix match
;;
;;
;; Internal
(defvar helm-mm-prefix-pattern-str nil)
(defvar helm-mm-prefix-pattern-real nil)
(defun helm-mm-prefix-get-pattern (pattern)
(unless (equal pattern helm-mm-prefix-pattern-str)
(setq helm-mm-prefix-pattern-str pattern
helm-mm-prefix-pattern-real (concat "\n" pattern)))
helm-mm-prefix-pattern-real)
(defun helm-mm-prefix-match (str &optional pattern)
;; In filename completion basename and basedir may be
;; quoted, unquote them for string comparison (Issue #1283).
(setq pattern (replace-regexp-in-string
"\\\\" "" (or pattern helm-pattern)))
(let ((len (length pattern)))
(and (<= len (length str))
(string= (substring str 0 len) pattern ))))
(defun helm-mm-prefix-search (pattern &rest _ignore)
(search-forward (helm-mm-prefix-get-pattern pattern) nil t))
;;; Multiple regexp patterns 1 (order is preserved / prefix).
;;
;;
;; Internal
(defvar helm-mm-1-pattern-str nil)
(defvar helm-mm-1-pattern-real nil)
(defun helm-mm-1-get-pattern (pattern)
(unless (equal pattern helm-mm-1-pattern-str)
(setq helm-mm-1-pattern-str pattern
helm-mm-1-pattern-real
(concat "^" (helm-mm-1-make-regexp pattern))))
helm-mm-1-pattern-real)
(cl-defun helm-mm-1-match (str &optional (pattern helm-pattern))
(string-match (helm-mm-1-get-pattern pattern) str))
(defun helm-mm-1-search (pattern &rest _ignore)
(re-search-forward (helm-mm-1-get-pattern pattern) nil t))
;;; Multiple regexp patterns 2 (order is preserved / partial).
;;
;;
;; Internal
(defvar helm-mm-2-pattern-str nil)
(defvar helm-mm-2-pattern-real nil)
(defun helm-mm-2-get-pattern (pattern)
(unless (equal pattern helm-mm-2-pattern-str)
(setq helm-mm-2-pattern-str pattern
helm-mm-2-pattern-real
(concat "^.*" (helm-mm-1-make-regexp pattern))))
helm-mm-2-pattern-real)
(cl-defun helm-mm-2-match (str &optional (pattern helm-pattern))
(string-match (helm-mm-2-get-pattern pattern) str))
(defun helm-mm-2-search (pattern &rest _ignore)
(re-search-forward (helm-mm-2-get-pattern pattern) nil t))
;;; Multiple regexp patterns 3 (permutation).
;;
;;
;; Internal
(defvar helm-mm-3-pattern-str nil)
(defvar helm-mm-3-pattern-list nil)
(defun helm-mm-3-get-patterns (pattern)
"Return `helm-mm-3-pattern-list', a list of predicate/regexp cons cells.
e.g ((identity . \"foo\") (identity . \"bar\")).
This is done only if `helm-mm-3-pattern-str' is same as PATTERN."
(unless (equal pattern helm-mm-3-pattern-str)
(setq helm-mm-3-pattern-str pattern
helm-mm-3-pattern-list
(helm-mm-3-get-patterns-internal pattern)))
helm-mm-3-pattern-list)
(defun helm-mm-3-get-patterns-internal (pattern)
"Return a list of predicate/regexp cons cells.
e.g ((identity . \"foo\") (identity . \"bar\"))."
(unless (string= pattern "")
(cl-loop for pat in (helm-mm-split-pattern pattern)
collect (if (string= "!" (substring pat 0 1))
(cons 'not (substring pat 1))
(cons 'identity pat)))))
(cl-defun helm-mm-3-match (str &optional (pattern helm-pattern))
"Check if PATTERN match STR.
When PATTERN contain a space, it is splitted and matching is done
with the several resulting regexps against STR.
e.g \"bar foo\" will match \"foobar\" and \"barfoo\".
Argument PATTERN, a string, is transformed in a list of
cons cell with `helm-mm-3-get-patterns' if it contain a space.
e.g \"foo bar\"=>((identity . \"foo\") (identity . \"bar\")).
Then each predicate of cons cell(s) is called with regexp of same
cons cell against STR (a candidate).
i.e (identity (string-match \"foo\" \"foo bar\")) => t."
(let ((pat (helm-mm-3-get-patterns pattern)))
(cl-loop for (predicate . regexp) in pat
always (funcall predicate
(condition-case _err
;; FIXME: Probably do nothing when
;; using fuzzy leaving the job
;; to the fuzzy fn.
(string-match regexp str)
(invalid-regexp nil))))))
(defun helm-mm-3-search-base (pattern searchfn1 searchfn2)
"Try to find PATTERN in `helm-buffer' with SEARCHFN1 and SEARCHFN2.
This is the search function for `candidates-in-buffer' enabled sources.
Use the same method as `helm-mm-3-match' except it search in buffer
instead of matching on a string.
i.e (identity (re-search-forward \"foo\" (point-at-eol) t)) => t."
(cl-loop with pat = (if (stringp pattern)
(helm-mm-3-get-patterns pattern)
pattern)
when (eq (caar pat) 'not) return
;; Pass the job to `helm-search-match-part'.
(prog1 (list (point-at-bol) (point-at-eol))
(forward-line 1))
while (condition-case _err
(funcall searchfn1 (or (cdar pat) "") nil t)
(invalid-regexp nil))
for bol = (point-at-bol)
for eol = (point-at-eol)
if (cl-loop for (pred . str) in (cdr pat) always
(progn (goto-char bol)
(funcall pred (condition-case _err
(funcall searchfn2 str eol t)
(invalid-regexp nil)))))
do (goto-char eol) and return t
else do (goto-char eol)
finally return nil))
(defun helm-mm-3-search (pattern &rest _ignore)
(when (stringp pattern)
(setq pattern (helm-mm-3-get-patterns pattern)))
(helm-mm-3-search-base
pattern 're-search-forward 're-search-forward))
;;; mp-3 with migemo
;;
;;
(defvar helm-mm--previous-migemo-info nil
"[Internal] Cache previous migemo query.")
(make-local-variable 'helm-mm--previous-migemo-info)
(declare-function migemo-get-pattern "ext:migemo.el")
(declare-function migemo-search-pattern-get "ext:migemo.el")
(define-minor-mode helm-migemo-mode
"Enable migemo in helm.
It will be available in the sources handling it,
i.e the sources which have the slot :migemo with non--nil value."
:lighter " Hmio"
:group 'helm
:global t
(cl-assert (featurep 'migemo)
nil "No feature called migemo found, install migemo.el."))
(defun helm-mm-migemo-get-pattern (pattern)
(let ((regex (migemo-get-pattern pattern)))
(if (ignore-errors (string-match regex "") t)
(concat regex "\\|" pattern) pattern)))
(defun helm-mm-migemo-search-pattern-get (pattern)
(let ((regex (migemo-search-pattern-get pattern)))
(if (ignore-errors (string-match regex "") t)
(concat regex "\\|" pattern) pattern)))
(defun helm-mm-migemo-string-match (pattern str)
"Migemo version of `string-match'."
(unless (assoc pattern helm-mm--previous-migemo-info)
(with-helm-buffer
(setq helm-mm--previous-migemo-info
(push (cons pattern (helm-mm-migemo-get-pattern pattern))
helm-mm--previous-migemo-info))))
(string-match (assoc-default pattern helm-mm--previous-migemo-info) str))
(cl-defun helm-mm-3-migemo-match (str &optional (pattern helm-pattern))
(and helm-migemo-mode
(cl-loop for (pred . re) in (helm-mm-3-get-patterns pattern)
always (funcall pred (helm-mm-migemo-string-match re str)))))
(defun helm-mm-migemo-forward (word &optional bound noerror count)
(with-helm-buffer
(unless (assoc word helm-mm--previous-migemo-info)
(setq helm-mm--previous-migemo-info
(push (cons word (if (delq 'ascii (find-charset-string word))
word
(helm-mm-migemo-search-pattern-get word)))
helm-mm--previous-migemo-info))))
(re-search-forward
(assoc-default word helm-mm--previous-migemo-info) bound noerror count))
(defun helm-mm-3-migemo-search (pattern &rest _ignore)
(and helm-migemo-mode
(helm-mm-3-search-base
pattern 'helm-mm-migemo-forward 'helm-mm-migemo-forward)))
;;; mp-3p- (multiple regexp pattern 3 with prefix search)
;;
;;
(defun helm-mm-3p-match (str &optional pattern)
"Check if PATTERN match STR.
Same as `helm-mm-3-match' but more strict, matching against prefix also.
e.g \"bar foo\" will match \"barfoo\" but not \"foobar\" contrarily to
`helm-mm-3-match'."
(let* ((pat (helm-mm-3-get-patterns (or pattern helm-pattern)))
(first (car pat)))
(and (funcall (car first) (helm-mm-prefix-match str (cdr first)))
(cl-loop for (predicate . regexp) in (cdr pat)
always (funcall predicate (string-match regexp str))))))
(defun helm-mm-3p-search (pattern &rest _ignore)
(when (stringp pattern)
(setq pattern (helm-mm-3-get-patterns pattern)))
(helm-mm-3-search-base
pattern 'helm-mm-prefix-search 're-search-forward))
;;; Generic multi-match/search functions
;;
;;
(cl-defun helm-mm-match (str &optional (pattern helm-pattern))
(let ((fun (cl-ecase helm-mm-matching-method
(multi1 #'helm-mm-1-match)
(multi2 #'helm-mm-2-match)
(multi3 #'helm-mm-3-match)
(multi3p #'helm-mm-3p-match))))
(funcall fun str pattern)))
(defun helm-mm-search (pattern &rest _ignore)
(let ((fun (cl-ecase helm-mm-matching-method
(multi1 #'helm-mm-1-search)
(multi2 #'helm-mm-2-search)
(multi3 #'helm-mm-3-search)
(multi3p #'helm-mm-3p-search))))
(funcall fun pattern)))
(provide 'helm-multi-match)
;; Local Variables:
;; byte-compile-warnings: (not cl-functions obsolete)
;; coding: utf-8
;; indent-tabs-mode: nil
;; End:
;;; helm-multi-match.el ends here

View File

@ -1,14 +1,14 @@
;;; helm-core-autoloads.el --- automatically extracted autoloads ;;; helm-core-autoloads.el --- automatically extracted autoloads
;; ;;
;;; Code: ;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "helm" "helm.el" (22454 5318 318163 35000)) ;;;### (autoloads nil "helm" "helm.el" (22490 24934 255411 690000))
;;; Generated autoloads from helm.el ;;; Generated autoloads from helm.el
(autoload 'helm-define-multi-key "helm" "\ (autoload 'helm-define-multi-key "helm" "\
In KEYMAP, define key sequence KEY for function list FUNCTIONS. In KEYMAP, define key sequence KEY for function list FUNCTIONS.
Each function runs sequentially for each KEY press. Each function runs sequentially for each KEY press.
If DELAY is specified, switch back to initial function of FUNCTIONS list If DELAY is specified, switch back to initial function of FUNCTIONS list
after DELAY seconds. after DELAY seconds.
The functions in FUNCTIONS list take no args. The functions in FUNCTIONS list take no args.
@ -22,8 +22,8 @@ e.g
\(helm-define-multi-key global-map \"<f5> q\" '(foo bar baz) 2) \(helm-define-multi-key global-map \"<f5> q\" '(foo bar baz) 2)
Each time \"<f5> q\" is pressed, the next function is executed. Waiting Each time \"<f5> q\" is pressed, the next function is executed. Waiting
more than 2 seconds between key presses switches back to executing the first more than 2 seconds between key presses switches back to executing the first
function on the next hit. function on the next hit.
\(fn KEYMAP KEY FUNCTIONS &optional DELAY)" nil nil) \(fn KEYMAP KEY FUNCTIONS &optional DELAY)" nil nil)
@ -35,7 +35,7 @@ See `helm-define-multi-key'.
\(fn NAME DOCSTRING FUNS &optional DELAY)" nil t) \(fn NAME DOCSTRING FUNS &optional DELAY)" nil t)
(function-put 'helm-multi-key-defun 'lisp-indent-function '2) (put 'helm-multi-key-defun 'lisp-indent-function '2)
(autoload 'helm-define-key-with-subkeys "helm" "\ (autoload 'helm-define-key-with-subkeys "helm" "\
Defines in MAP a KEY and SUBKEY to COMMAND. Defines in MAP a KEY and SUBKEY to COMMAND.
@ -57,19 +57,19 @@ In this example, `C-x v n' will run `git-gutter:next-hunk'
subsequent \"n\"'s run this command again subsequent \"n\"'s run this command again
and subsequent \"p\"'s run `git-gutter:previous-hunk'. and subsequent \"p\"'s run `git-gutter:previous-hunk'.
Arg MENU is a string displayed in minibuffer that Arg MENU is a string displayed in minibuffer that
describes SUBKEY and OTHER-SUBKEYS. describes SUBKEY and OTHER-SUBKEYS.
Arg EXIT-FN specifies a function to run on exit. Arg EXIT-FN specifies a function to run on exit.
For any other keys pressed, run their assigned command as defined For any other keys pressed, run their assigned command as defined
in MAP and then exit the loop running EXIT-FN, if specified. in MAP and then exit the loop running EXIT-FN, if specified.
NOTE: SUBKEY and OTHER-SUBKEYS bindings support char syntax only NOTE: SUBKEY and OTHER-SUBKEYS bindings support char syntax only
\(e.g ?n), so don't use strings or vectors to define them. \(e.g ?n), so don't use strings or vectors to define them.
\(fn MAP KEY SUBKEY COMMAND &optional OTHER-SUBKEYS MENU EXIT-FN)" nil nil) \(fn MAP KEY SUBKEY COMMAND &optional OTHER-SUBKEYS MENU EXIT-FN)" nil nil)
(function-put 'helm-define-key-with-subkeys 'lisp-indent-function '1) (put 'helm-define-key-with-subkeys 'lisp-indent-function '1)
(autoload 'helm-debug-open-last-log "helm" "\ (autoload 'helm-debug-open-last-log "helm" "\
Open helm log file or buffer of last helm session. Open helm log file or buffer of last helm session.
@ -188,7 +188,7 @@ Enable/disable helm debugging from outside of helm session.
;;;*** ;;;***
;;;### (autoloads nil nil ("helm-core-pkg.el" "helm-lib.el" "helm-multi-match.el" ;;;### (autoloads nil nil ("helm-core-pkg.el" "helm-lib.el" "helm-multi-match.el"
;;;;;; "helm-source.el") (22454 5318 397164 892000)) ;;;;;; "helm-source.el") (22490 24934 280627 285000))
;;;*** ;;;***

View File

@ -1,5 +1,5 @@
(define-package "helm-core" "20160818.5" "Development files for Helm" (define-package "helm-core" "20160913.219" "Development files for Helm"
'((emacs "24.3") '((emacs "24.4")
(async "1.9")) (async "1.9"))
:url "https://emacs-helm.github.io/helm/") :url "https://emacs-helm.github.io/helm/")
;; Local Variables: ;; Local Variables:

View File

@ -104,6 +104,33 @@ When only `add-text-properties' is available APPEND is ignored."
symbols) symbols)
,@body)) ,@body))
;;; Command loop helper
;;
(defun helm-this-command ()
"Returns the actual command in action.
Like `this-command' but return the real command,
and not `exit-minibuffer' or other unwanted functions."
(cl-loop with bl = '(helm-maybe-exit-minibuffer
helm-confirm-and-exit-minibuffer
helm-exit-minibuffer
exit-minibuffer)
for count from 1 to 50
for btf = (backtrace-frame count)
for fn = (cl-second btf)
if (and
;; In some case we may have in the way an
;; advice compiled resulting in byte-code,
;; ignore it (Issue #691).
(symbolp fn)
(commandp fn)
(not (memq fn bl)))
return fn
else
if (and (eq fn 'call-interactively)
(> (length btf) 2))
return (cadr (cdr btf))))
;;; Iterators ;;; Iterators
;; ;;
(defun helm-iter-list (seq) (defun helm-iter-list (seq)
@ -167,9 +194,6 @@ of `cl-return' is possible to exit the loop."
(progn ,@(cdr clause1)) (progn ,@(cdr clause1))
(helm-acond ,@(cdr clauses)))))))) (helm-acond ,@(cdr clauses))))))))
(defun helm-current-line-contents ()
"Current line string without properties."
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))
;;; Fuzzy matching routines ;;; Fuzzy matching routines
;; ;;
@ -403,6 +427,35 @@ ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...)
collect (cons (car arg) (funcall function (cdr arg))) collect (cons (car arg) (funcall function (cdr arg)))
else else
collect (funcall function arg))) collect (funcall function arg)))
(defun helm-append-at-nth (seq elm index)
"Append ELM at INDEX in SEQ."
(let ((len (length seq)))
(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-source-by-name (name &optional sources)
"Get a Helm source in SOURCES by NAME.
Optional argument SOURCES is a list of Helm sources. The default
value is computed with `helm-get-sources' which is faster
than specifying SOURCES because sources are cached."
(cl-loop with src-list = (if sources
(cl-loop for src in sources
collect (if (listp src)
src
(symbol-value src)))
(helm-get-sources))
for source in src-list
thereis (and (string= name (assoc-default 'name source)) source)))
;;; Strings processing. ;;; Strings processing.
;; ;;
@ -465,6 +518,10 @@ Add spaces at end if needed to reach WIDTH when STR is shorter than WIDTH."
"Quote whitespace, if some, in string CANDIDATE." "Quote whitespace, if some, in string CANDIDATE."
(replace-regexp-in-string " " "\\\\ " candidate)) (replace-regexp-in-string " " "\\\\ " candidate))
(defun helm-current-line-contents ()
"Current line string without properties."
(buffer-substring-no-properties (point-at-bol) (point-at-eol)))
;;; Symbols routines ;;; Symbols routines
;; ;;

Some files were not shown because too many files have changed in this diff Show More