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
;;
;;; 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
(autoload 'company-mode "company" "\
@ -37,9 +38,8 @@ keymap during active completions (`company-active-map'):
\(fn &optional ARG)" t nil)
(defvar global-company-mode nil "\
Non-nil if Global Company mode is enabled.
See the `global-company-mode' command
for a description of this minor mode.
Non-nil if Global-Company mode is enabled.
See the command `global-company-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `global-company-mode'.")
@ -48,7 +48,7 @@ or call the function `global-company-mode'.")
(autoload 'global-company-mode "company" "\
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
ARG is omitted or nil.
@ -73,8 +73,8 @@ inserted.
;;;***
;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22454
;;;;;; 5294 949613 562000))
;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22490
;;;;;; 24940 399394 311000))
;;; Generated autoloads from company-abbrev.el
(autoload 'company-abbrev "company-abbrev" "\
@ -84,8 +84,8 @@ inserted.
;;;***
;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22454 5294
;;;;;; 768609 306000))
;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22490 24940
;;;;;; 379394 367000))
;;; Generated autoloads from company-bbdb.el
(autoload 'company-bbdb "company-bbdb" "\
@ -95,8 +95,8 @@ inserted.
;;;***
;;;### (autoloads nil "company-css" "company-css.el" (22454 5294
;;;;;; 307598 466000))
;;;### (autoloads nil "company-css" "company-css.el" (22490 24940
;;;;;; 327394 512000))
;;; Generated autoloads from company-css.el
(autoload 'company-css "company-css" "\
@ -106,8 +106,8 @@ inserted.
;;;***
;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22454
;;;;;; 5294 565604 532000))
;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22490
;;;;;; 24940 355394 433000))
;;; Generated autoloads from company-dabbrev.el
(autoload 'company-dabbrev "company-dabbrev" "\
@ -118,7 +118,7 @@ dabbrev-like `company-mode' completion backend.
;;;***
;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el"
;;;;;; (22454 5294 475602 417000))
;;;;;; (22490 24940 347394 456000))
;;; Generated autoloads from company-dabbrev-code.el
(autoload 'company-dabbrev-code "company-dabbrev-code" "\
@ -130,8 +130,8 @@ comments or strings.
;;;***
;;;### (autoloads nil "company-elisp" "company-elisp.el" (22454 5295
;;;;;; 17615 161000))
;;;### (autoloads nil "company-elisp" "company-elisp.el" (22490 24940
;;;;;; 407394 288000))
;;; Generated autoloads from company-elisp.el
(autoload 'company-elisp "company-elisp" "\
@ -141,8 +141,8 @@ comments or strings.
;;;***
;;;### (autoloads nil "company-etags" "company-etags.el" (22454 5294
;;;;;; 396600 559000))
;;;### (autoloads nil "company-etags" "company-etags.el" (22490 24940
;;;;;; 339394 478000))
;;; Generated autoloads from company-etags.el
(autoload 'company-etags "company-etags" "\
@ -152,8 +152,8 @@ comments or strings.
;;;***
;;;### (autoloads nil "company-files" "company-files.el" (22454 5294
;;;;;; 611605 614000))
;;;### (autoloads nil "company-files" "company-files.el" (22490 24940
;;;;;; 363394 410000))
;;; Generated autoloads from company-files.el
(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
;;;;;; 137594 469000))
;;;### (autoloads nil "company-gtags" "company-gtags.el" (22490 24940
;;;;;; 299394 590000))
;;; Generated autoloads from company-gtags.el
(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
;;;;;; 5294 983614 361000))
;;;### (autoloads nil "company-ispell" "company-ispell.el" (22490
;;;;;; 24940 403394 299000))
;;; Generated autoloads from company-ispell.el
(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
;;;;;; 5294 678607 190000))
;;;### (autoloads nil "company-keywords" "company-keywords.el" (22490
;;;;;; 24940 371394 389000))
;;; Generated autoloads from company-keywords.el
(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
;;;;;; 802610 105000))
;;;### (autoloads nil "company-nxml" "company-nxml.el" (22490 24940
;;;;;; 383394 355000))
;;; Generated autoloads from company-nxml.el
(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
;;;;;; 5294 239596 867000))
;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (22490
;;;;;; 24940 319394 534000))
;;; Generated autoloads from company-oddmuse.el
(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
;;;;;; 5294 171595 268000))
;;;### (autoloads nil "company-semantic" "company-semantic.el" (22490
;;;;;; 24940 303394 579000))
;;; Generated autoloads from company-semantic.el
(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
;;;;;; 520603 474000))
;;;### (autoloads nil "company-tempo" "company-tempo.el" (22490 24940
;;;;;; 351394 444000))
;;; Generated autoloads from company-tempo.el
(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
;;;;;; 871611 728000))
;;;### (autoloads nil "company-xcode" "company-xcode.el" (22490 24940
;;;;;; 395394 322000))
;;; Generated autoloads from company-xcode.el
(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"
;;;;;; (22454 5294 837610 928000))
;;;;;; (22490 24940 391394 333000))
;;; Generated autoloads from company-yasnippet.el
(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"
;;;;;; "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
(let (tags)
(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))
(cl-loop while
(re-search-forward (concat

View File

@ -210,6 +210,14 @@
"do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
"next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
"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
"abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
"final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
@ -225,8 +233,10 @@
)
;; aliases
(js2-mode . javascript-mode)
(js2-jsx-mode . javascript-mode)
(espresso-mode . javascript-mode)
(js-mode . javascript-mode)
(js-jsx-mode . javascript-mode)
(cperl-mode . perl-mode)
(jde-mode . java-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")
(cl-lib "0.5"))
: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.")
(defface company-tooltip-search
'((default :inherit company-tooltip-selection))
'((default :inherit highlight))
"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
'((default :inherit highlight))
"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)
line)
(when selected
(if (let ((re (funcall company-search-regexp-function
(when (let ((re (funcall company-search-regexp-function
company-search-string)))
(and (not (string= re ""))
(string-match re value (length company-prefix))))
(pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
(let ((beg (+ margin mbeg))
(end (+ margin mend))
(width (- width (length right))))
(when (< beg width)
(font-lock-prepend-text-property beg (min end width)
'face 'company-tooltip-search
line))))
(font-lock-append-text-property 0 width 'face
'company-tooltip-selection
line)))
(pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
(let ((beg (+ margin mbeg))
(end (+ margin mend))
(width (- width (length right))))
(when (< beg width)
(font-lock-prepend-text-property beg (min end width) 'face
(if selected
'company-tooltip-search-selection
'company-tooltip-search)
line)))))
(when selected
(font-lock-append-text-property 0 width 'face
'company-tooltip-selection
line))
(font-lock-append-text-property 0 width 'face
'company-tooltip
line)

View File

@ -4,7 +4,7 @@
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company-quickhelp" "company-quickhelp.el"
;;;;;; (22297 53348 410925 167000))
;;;;;; (22490 24939 611396 515000))
;;; Generated autoloads from company-quickhelp.el
(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
;; Copyright (C) 2015, Lars Andersen
;; Copyright (C) 2016, Lars Andersen
;; Author: Lars Andersen <expez@expez.com>
;; URL: https://www.github.com/expez/company-quickhelp
;; Package-Version: 20160211.718
;; Package-Version: 20160826.806
;; 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"))
;; 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))
: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
"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
(define-minor-mode company-quickhelp-mode
"Provides documentation popups for `company-mode' using `pos-tip'."
:global t :keymap company-quickhelp-mode-map
:global t
(if company-quickhelp-mode
(company-quickhelp--enable)
(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
;;
;;; 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>
;; Version: 2.13.0
;; Package-Version: 20160813.951
;; Package-Version: 20160820.501
;; Keywords: lists
;; This program is free software; you can redistribute it and/or modify
@ -358,7 +358,7 @@ See also: `-each-indexed'."
(nreverse ,r))))
(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
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
;;
;;; 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
(autoload 'erlang-mode "erlang" "\
@ -118,8 +118,8 @@ editing control characters:
;;;***
;;;### (autoloads nil "erlang-start" "erlang-start.el" (22454 5334
;;;;;; 87533 826000))
;;;### (autoloads nil "erlang-start" "erlang-start.el" (22490 24938
;;;;;; 243400 358000))
;;; 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))))
@ -132,7 +132,7 @@ editing control characters:
;;;### (autoloads nil nil ("erlang-eunit.el" "erlang-flymake.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)
("gen_fsm" "gen-fsm"
erlang-skel-gen-fsm erlang-skel-header)
("gen_statem" "gen-statem"
erlang-skel-gen-statem erlang-skel-header)
("gen_statem (StateName/3)" "gen-statem-StateName"
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"
erlang-skel-wx-object erlang-skel-header)
("Library module" "gen-lib"
@ -497,6 +499,7 @@ Please see the function `tempo-define-template'.")
"%% {stop, Reason}" n
(erlang-skel-separator-end 2)
"init([]) ->" n>
"process_flag(trap_exit, true)," n>
"{ok, #state{}}." n
n
(erlang-skel-separator-start 2)
@ -740,6 +743,7 @@ Please see the function `tempo-define-template'.")
"%% {stop, StopReason}" n
(erlang-skel-separator-end 2)
"init([]) ->" n>
"process_flag(trap_exit, true)," n>
"{ok, state_name, #state{}}." n
n
(erlang-skel-separator-start 2)
@ -860,7 +864,7 @@ Please see the function `tempo-define-template'.")
"*The template of a gen_fsm.
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)
"-behaviour(gen_statem)." n n
@ -868,8 +872,118 @@ Please see the function `tempo-define-template'.")
"-export([start_link/0])." n
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
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
n
"-define(SERVER, ?MODULE)." n
@ -899,43 +1013,35 @@ Please see the function `tempo-define-template'.")
(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() -> 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
"%% 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>
"{gen_statem:callback_mode()," n>
"State :: term(), Data :: term()} |" n>
"{gen_statem:callback_mode()," n>
"State :: term(), Data :: 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>
"{state_functions, state_name, #data{}}." n
"process_flag(trap_exit, true)," n>
"{ok, state_name, #data{}}." n
n
(erlang-skel-separator-start 2)
"%% @private" n
"%% @doc" n
"%% If the gen_statem runs with CallbackMode =:= state_functions" n
"%% there should be one instance of this function for each possible" n
"%% state name. Whenever a gen_statem receives an event," n
"%% the instance of this function with the same name" 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
"%% This function is called for every event a gen_statem receives." n
"%%" n
"%% NOTE: If there is no exported function handle_event/4," n
"%% StateName/3 functions are called instead!" n
(erlang-skel-separator-end 2)
"-spec handle_event(" n>
"gen_statem:event_type(), Msg :: term()," n>
@ -965,17 +1071,16 @@ Please see the function `tempo-define-template'.")
"-spec code_change(" n>
"OldVsn :: term() | {down,term()}," n>
"State :: term(), Data :: term(), Extra :: term()) ->" n>
"{gen_statem:callback_mode()," n>
"NewState :: term(), NewData :: term()} |" n>
"{ok, NewState :: term(), NewData :: term()} |" n>
"(Reason :: term())." n
"code_change(_OldVsn, State, Data, _Extra) ->" n>
"{state_functions, State, Data}." 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.
"*The template of a gen_statem (handle_event/4).
Please see the function `tempo-define-template'.")
(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 ()
(let* ((dir (make-temp-file "erlang-test" t))
(erlang-file (expand-file-name "erlang_test.erl" dir))
(tags-file (expand-file-name "TAGS" dir))
tags-file-name tags-table-list erlang-buffer)
(unwind-protect
(progn
(erlang-test-create-erlang-file erlang-file)
(erlang-test-compile-tags erlang-file tags-file)
(setq erlang-buffer (find-file-noselect erlang-file))
(with-current-buffer erlang-buffer
(setq-local tags-file-name tags-file))
;; Setting global tags-file-name is a workaround for
;; GNU Emacs bug#23164.
(setq tags-file-name 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)))))
(erlang-file (expand-file-name "erlang_test.erl" dir))
(tags-file (expand-file-name "TAGS" dir))
(old-tags-file-name (default-value 'tags-file-name))
(old-tags-table-list (default-value 'tags-table-list))
tags-file-name
tags-table-list
tags-table-set-list
erlang-buffer
erlang-mode-hook
prog-mode-hook
erlang-shell-mode-hook
tags-add-tables)
(unwind-protect
(progn
(setq-default tags-file-name nil)
(setq-default tags-table-list nil)
(erlang-test-create-erlang-file erlang-file)
(erlang-test-compile-tags erlang-file tags-file)
(setq erlang-buffer (find-file-noselect erlang-file))
(with-current-buffer erlang-buffer
(setq-local tags-file-name tags-file))
;; 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)
(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 (= (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)

View File

@ -1436,8 +1436,6 @@ Other commands:
(erlang-skel-init)
(when (fboundp 'tempo-use-tag-list)
(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)
(if (zerop (buffer-size))
(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-level) (lambda () 1))
(set (make-local-variable 'add-log-current-defun-function)
'erlang-current-defun)
(set (make-local-variable 'find-tag-default-function)
'erlang-find-tag-for-completion))
'erlang-current-defun))
(defun erlang-font-lock-init ()
"Initialize Font Lock for Erlang mode."
@ -3233,18 +3229,16 @@ With argument, do this that many times."
(interactive "p")
(or arg (setq arg 1))
(while (and (looking-at "[ \t]*[%\n]")
(zerop (forward-line 1))))
(zerop (forward-line 1))))
;; Move to the next clause.
(erlang-beginning-of-clause (- arg))
(beginning-of-line);; Just to be sure...
(let ((continue t))
(while (and (not (bobp)) continue)
(forward-line -1)
(skip-chars-forward " \t")
(if (looking-at "[%\n]")
nil
(end-of-line)
(setq continue nil)))))
(unless (looking-at "[ \t]*[%\n]")
(end-of-line)
(setq continue nil)))))
(defun erlang-mark-clause ()
"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.
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
is not implemented under XEmacs. (Hint: The Emacs 19 etags module
works under XEmacs.)"
@ -4367,11 +4356,16 @@ works under XEmacs.)"
(setq erlang-tags-installed t))
(t
(require 'etags)
;; 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)))))
(set (make-local-variable 'find-tag-default-function)
'erlang-find-tag-for-completion)
(if (>= emacs-major-version 25)
(add-hook 'xref-backend-functions
#'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
;;; `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")
(require 'etags)
(fboundp 'etags-tags-completion-table)
@ -4784,11 +4776,7 @@ for a tag on the form `module:tag'."
(if (fboundp 'advice-add)
;; Emacs 24.4+
(advice-add 'etags-tags-completion-table :around
(lambda (oldfun)
(if erlang-replace-etags-tags-completion-table
(erlang-etags-tags-completion-table)
(funcall oldfun)))
(list :name 'erlang-replace-tags-table))
#'erlang-etags-tags-completion-table-advice)
;; Emacs 23.1-24.3
(defadvice etags-tags-completion-table (around
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))
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 ()
"Perform tags completion on the text around point.
Completes to the set of names listed in the current tags table.
@ -4807,8 +4800,7 @@ about Erlang modules."
(condition-case nil
(require 'etags)
(error nil))
(cond ((and erlang-tags-installed
(fboundp 'etags-tags-completion-table)
(cond ((and (fboundp 'etags-tags-completion-table)
(fboundp 'tags-lazy-completion-table)) ; Emacs 23.1+
(let ((erlang-replace-etags-tags-completion-table t))
(complete-tag)))
@ -5213,19 +5205,10 @@ The following special commands are available:
(setq comint-input-ignoredups t)
(setq comint-scroll-show-maximum-output t)
(setq comint-scroll-to-bottom-on-output t)
;; In Emacs 19.30, `add-hook' has got a `local' flag, use it. If
;; the call fails, just call the normal `add-hook'.
(condition-case nil
(progn
(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)))
(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)
;; Some older versions of comint don't have an input ring.
(if (fboundp 'comint-read-input-ring)
(progn
@ -5251,6 +5234,7 @@ The following special commands are available:
(define-key map [menu-bar compilation]
(cons "Errors" compilation-menu-map)))
map)))))
(erlang-tags-init)
(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)
(if (null opts)
""
(concat ", " (inferior-erlang-format-opts opts))))
(defun inferior-erlang-format-opts (opts)
(concat "[" (inferior-erlang-string-join (mapcar 'inferior-erlang-format-opt
opts)
", ")
"]"))
(concat ", " (inferior-erlang-format-opt opts))))
(defun inferior-erlang-format-opt (opt)
(cond ((stringp opt) (concat "\"" opt "\""))
((atom opt) (format "%s" opt))
((consp opt) (concat "{" (inferior-erlang-string-join
(mapcar 'inferior-erlang-format-opt
(list (car opt) (cdr opt)))
", ")
"}"))
(t (error (format "Unexpected opt %s" opt)))))
((vectorp opt) (inferior-erlang-tuple (append opt nil)))
((atom opt) (format "%s" opt))
((consp opt) (if (listp (cdr opt))
(inferior-erlang-list opt)
(inferior-erlang-tuple (list (car opt) (cdr opt)))))
(t (error "Unexpected erlang compile option %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 ()
;; 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:
(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
(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>
;; Version: 0.8.12
;; Package-Version: 20160617.1840
;; Package-Version: 20160909.813
;; Keywords: tools, convenience
;; Created: 2013-01-29
;; URL: https://github.com/leoliu/ggtags
@ -466,32 +466,36 @@ Set to `nil' to disable tag highlighting."
(defun ggtags-make-project (root)
(cl-check-type root string)
(pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" root)))
(`(,mtime ,_ ,tag-size . ,_)
(let* ((default-directory (file-name-as-directory root))
(rtags-size (nth 7 (file-attributes "GRTAGS")))
(has-refs
(when rtags-size
(and (or (> rtags-size (* 32 1024))
(with-demoted-errors "ggtags-make-project: %S"
(not (equal "" (ggtags-process-string "global" "-crs")))))
'has-refs)))
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518
(has-path-style
(and (ggtags-process-succeed-p "global" "--path-style" "shorter" "--help")
'has-path-style))
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542
(has-color (and (ggtags-process-succeed-p "global" "--color" "--help")
'has-color)))
(puthash default-directory
(ggtags-project--make :root default-directory
:tag-size tag-size
:has-refs has-refs
:has-path-style has-path-style
:has-color has-color
:mtime (float-time mtime)
:timestamp (float-time))
ggtags-projects)))))
(let* ((default-directory (file-name-as-directory root))
;; NOTE: use of GTAGSDBPATH is not recommended. -- GLOBAL(1)
;; ROOT and DB can be different directories due to GTAGSDBPATH.
(dbdir (concat (file-remote-p root)
(ggtags-process-string "global" "-p"))))
(pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" dbdir)))
(`(,mtime ,_ ,tag-size . ,_)
(let* ((rtags-size (nth 7 (file-attributes (expand-file-name "GRTAGS" dbdir))))
(has-refs
(when rtags-size
(and (or (> rtags-size (* 32 1024))
(with-demoted-errors "ggtags-make-project: %S"
(not (equal "" (ggtags-process-string "global" "-crs")))))
'has-refs)))
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518
(has-path-style
(and (ggtags-process-succeed-p "global" "--path-style" "shorter" "--help")
'has-path-style))
;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542
(has-color (and (ggtags-process-succeed-p "global" "--color" "--help")
'has-color)))
(puthash default-directory
(ggtags-project--make :root default-directory
:tag-size tag-size
:has-refs has-refs
: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)
(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:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "git-commit" "git-commit.el" (22387 29368 875424
;;;;;; 490000))
;;;### (autoloads nil "git-commit" "git-commit.el" (22490 24936 815404
;;;;;; 393000))
;;; Generated autoloads from git-commit.el
(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>
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
;; Package-Requires: ((emacs "24.4") (dash "20151021.113") (with-editor "20160408.201"))
;; Package-Version: 20160519.950
;; Package-Requires: ((emacs "24.4") (dash "20160820.501") (with-editor "20160812.1457"))
;; Package-Version: 20160821.1338
;; Keywords: git tools vc
;; Homepage: https://github.com/magit/magit

View File

@ -3,8 +3,8 @@
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "git-gutter" "git-gutter.el" (22404 60266 753885
;;;;;; 560000))
;;;### (autoloads nil "git-gutter" "git-gutter.el" (22490 24936 311405
;;;;;; 824000))
;;; Generated autoloads from git-gutter.el
(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>
;; URL: https://github.com/syohex/emacs-git-gutter
;; Package-Version: 20160702.354
;; Version: 0.89
;; Package-Version: 20160903.852
;; Version: 0.90
;; Package-Requires: ((cl-lib "0.5") (emacs "24"))
;; 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))
(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
(git (git-gutter:in-git-repository-p))
(svn (git-gutter:in-repository-common-p "svn" '("info") ".svn"))
(hg (git-gutter:in-repository-common-p "hg" '("root") ".hg"))
(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
when (git-gutter:vcs-check-function vcs)
return (set (make-local-variable 'git-gutter:vcs-type) vcs)))
@ -841,6 +841,13 @@ gutter information of other windows."
(interactive "p")
(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)
(make-obsolete 'git-gutter:next-diff 'git-gutter:next-hunk "0.60")
(defalias 'git-gutter:previous-diff 'git-gutter:previous-hunk)

View File

@ -3,7 +3,8 @@
;;; 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
(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"))
;; Local Variables:
;; no-byte-compile: t

View File

@ -1527,25 +1527,25 @@ description at POINT."
(error "godef does not reliably work in XEmacs, expect bad results"))
(if (not (buffer-file-name (go--coverage-origin-buffer)))
(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-write 'utf-8))
(with-current-buffer outbuf
(erase-buffer))
(call-process-region (point-min)
(point-max)
godef-command
nil
outbuf
nil
"-i"
"-t"
"-f"
(file-truename (buffer-file-name (go--coverage-origin-buffer)))
"-o"
(number-to-string (go--position-bytes point)))
(with-current-buffer outbuf
(split-string (buffer-substring-no-properties (point-min) (point-max)) "\n")))))
(prog2
(call-process-region (point-min)
(point-max)
godef-command
nil
outbuf
nil
"-i"
"-t"
"-f"
(file-truename (buffer-file-name (go--coverage-origin-buffer)))
"-o"
(number-to-string (go--position-bytes point)))
(with-current-buffer outbuf
(split-string (buffer-substring-no-properties (point-min) (point-max)) "\n"))
(kill-buffer outbuf)))))
(defun godef--successful-p (output)
(not (or (string= "-" output)

View File

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

View File

@ -1,16 +1,15 @@
;;; helm-autoloads.el --- automatically extracted autoloads
;;
;;; 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
;;;;;; 428259 677000))
;;;### (autoloads nil "helm-adaptive" "helm-adaptive.el" (22490 24935
;;;;;; 275408 774000))
;;; Generated autoloads from helm-adaptive.el
(defvar helm-adaptive-mode nil "\
Non-nil if Helm-Adaptive mode is enabled.
See the `helm-adaptive-mode' command
for a description of this minor mode.
See the command `helm-adaptive-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `helm-adaptive-mode'.")
@ -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
;;;;;; 80000))
;;;### (autoloads nil "helm-apt" "helm-apt.el" (22490 24935 247408
;;;;;; 853000))
;;; Generated autoloads from helm-apt.el
(autoload 'helm-apt "helm-apt" "\
@ -42,8 +41,8 @@ With a prefix arg reload cache.
;;;***
;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (22454 5322
;;;;;; 866269 976000))
;;;### (autoloads nil "helm-bookmark" "helm-bookmark.el" (22490 24935
;;;;;; 323408 637000))
;;; Generated autoloads from helm-bookmark.el
(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
;;;;;; 122252 481000))
;;;### (autoloads nil "helm-buffers" "helm-buffers.el" (22490 24935
;;;;;; 227408 911000))
;;; Generated autoloads from helm-buffers.el
(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
;;;;;; 803000))
;;;### (autoloads nil "helm-color" "helm-color.el" (22490 24935 307408
;;;;;; 682000))
;;; Generated autoloads from helm-color.el
(autoload 'helm-colors "helm-color" "\
@ -87,8 +86,8 @@ Preconfigured `helm' for color.
;;;***
;;;### (autoloads nil "helm-command" "helm-command.el" (22454 5321
;;;;;; 795244 793000))
;;;### (autoloads nil "helm-command" "helm-command.el" (22490 24935
;;;;;; 183409 35000))
;;; Generated autoloads from helm-command.el
(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
;;;;;; 821268 918000))
;;;### (autoloads nil "helm-config" "helm-config.el" (22490 24935
;;;;;; 315408 659000))
;;; Generated autoloads from helm-config.el
(autoload 'helm-configuration "helm-config" "\
@ -117,8 +116,8 @@ Customize `helm'.
;;;***
;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (22454 5322
;;;;;; 257255 656000))
;;;### (autoloads nil "helm-dabbrev" "helm-dabbrev.el" (22490 24935
;;;;;; 255408 831000))
;;; Generated autoloads from helm-dabbrev.el
(autoload 'helm-dabbrev "helm-dabbrev" "\
@ -128,8 +127,8 @@ Preconfigured helm for dynamic abbreviations.
;;;***
;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (22454 5322 777267
;;;;;; 884000))
;;;### (autoloads nil "helm-elisp" "helm-elisp.el" (22490 24935 311408
;;;;;; 670000))
;;; Generated autoloads from helm-elisp.el
(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"
;;;;;; (22454 5321 829245 592000))
;;;;;; (22490 24935 191409 13000))
;;; Generated autoloads from helm-elisp-package.el
(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
;;;;;; 728243 218000))
;;;### (autoloads nil "helm-elscreen" "helm-elscreen.el" (22490 24935
;;;;;; 171409 70000))
;;; Generated autoloads from helm-elscreen.el
(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
;;;;;; 942248 250000))
;;;### (autoloads nil "helm-eshell" "helm-eshell.el" (22490 24935
;;;;;; 203408 979000))
;;; Generated autoloads from helm-eshell.el
(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
;;;;;; 793000))
;;;### (autoloads nil "helm-eval" "helm-eval.el" (22490 24935 283408
;;;;;; 750000))
;;; Generated autoloads from helm-eval.el
(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
;;;;;; 638241 101000))
;;;### (autoloads nil "helm-external" "helm-external.el" (22490 24935
;;;;;; 163409 93000))
;;; Generated autoloads from helm-external.el
(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
;;;;;; 455000))
;;;### (autoloads nil "helm-files" "helm-files.el" (22490 24935 259408
;;;;;; 818000))
;;; Generated autoloads from helm-files.el
(autoload 'helm-projects-history "helm-files" "\
@ -345,8 +344,8 @@ Preconfigured `helm' for `recentf'.
;;;***
;;;### (autoloads nil "helm-font" "helm-font.el" (22454 5321 987249
;;;;;; 307000))
;;;### (autoloads nil "helm-font" "helm-font.el" (22490 24935 207408
;;;;;; 967000))
;;; Generated autoloads from helm-font.el
(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
;;;;;; 58000))
;;;### (autoloads nil "helm-grep" "helm-grep.el" (22490 24935 327408
;;;;;; 625000))
;;; Generated autoloads from helm-grep.el
(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
;;;;;; 43000))
;;;### (autoloads nil "helm-help" "helm-help.el" (22490 24935 159409
;;;;;; 104000))
;;; Generated autoloads from helm-help.el
(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
;;;;;; 156253 281000))
;;;### (autoloads nil "helm-id-utils" "helm-id-utils.el" (22490 24935
;;;;;; 239408 876000))
;;; Generated autoloads from helm-id-utils.el
(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
;;;;;; 883000))
;;;### (autoloads nil "helm-imenu" "helm-imenu.el" (22490 24935 219408
;;;;;; 933000))
;;; Generated autoloads from helm-imenu.el
(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
;;;;;; 83000))
;;;### (autoloads nil "helm-info" "helm-info.el" (22490 24935 215408
;;;;;; 945000))
;;; Generated autoloads from helm-info.el
(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
;;;;;; 683242 159000))
;;;### (autoloads nil "helm-locate" "helm-locate.el" (22490 24935
;;;;;; 167409 82000))
;;; Generated autoloads from helm-locate.el
(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
;;;;;; 851000))
;;;### (autoloads nil "helm-man" "helm-man.el" (22490 24935 291408
;;;;;; 728000))
;;; Generated autoloads from helm-man.el
(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
;;;;;; 619000))
;;;### (autoloads nil "helm-misc" "helm-misc.el" (22490 24935 271408
;;;;;; 785000))
;;; Generated autoloads from helm-misc.el
(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
;;;;;; 433000))
;;;### (autoloads nil "helm-mode" "helm-mode.el" (22490 24935 143409
;;;;;; 149000))
;;; Generated autoloads from helm-mode.el
(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 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" "\
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'.
\(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 "\
Non-nil if Helm mode is enabled.
See the `helm-mode' command
for a description of this minor mode.
See the command `helm-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `helm-mode'.")
@ -714,8 +712,8 @@ Note: This mode is incompatible with Emacs23.
;;;***
;;;### (autoloads nil "helm-net" "helm-net.el" (22454 5322 686265
;;;;;; 744000))
;;;### (autoloads nil "helm-net" "helm-net.el" (22490 24935 303408
;;;;;; 694000))
;;; Generated autoloads from helm-net.el
(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
;;;;;; 116000))
;;;### (autoloads nil "helm-org" "helm-org.el" (22490 24935 331408
;;;;;; 613000))
;;; Generated autoloads from helm-org.el
(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
;;;;;; 642264 709000))
;;;### (autoloads nil "helm-regexp" "helm-regexp.el" (22490 24935
;;;;;; 299408 706000))
;;; Generated autoloads from helm-regexp.el
(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
;;;;;; 985000))
;;;### (autoloads nil "helm-ring" "helm-ring.el" (22490 24935 151409
;;;;;; 127000))
;;; Generated autoloads from helm-ring.el
(defvar helm-push-mark-mode nil "\
Non-nil if Helm-Push-Mark mode is enabled.
See the `helm-push-mark-mode' command
for a description of this minor mode.
See the command `helm-push-mark-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `helm-push-mark-mode'.")
@ -866,8 +863,8 @@ This command is useful when used with persistent action.
;;;***
;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (22454 5322
;;;;;; 88251 682000))
;;;### (autoloads nil "helm-semantic" "helm-semantic.el" (22490 24935
;;;;;; 223408 922000))
;;; Generated autoloads from helm-semantic.el
(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
;;;;;; 856000))
;;;### (autoloads nil "helm-sys" "helm-sys.el" (22490 24935 251408
;;;;;; 842000))
;;; Generated autoloads from helm-sys.el
(defvar helm-top-poll-mode nil "\
Non-nil if Helm-Top-Poll mode is enabled.
See the `helm-top-poll-mode' command
for a description of this minor mode.
See the command `helm-top-poll-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `helm-top-poll-mode'.")
@ -925,8 +921,8 @@ Preconfigured helm for xrandr.
;;;***
;;;### (autoloads nil "helm-tags" "helm-tags.el" (22454 5321 897247
;;;;;; 191000))
;;;### (autoloads nil "helm-tags" "helm-tags.el" (22490 24935 199408
;;;;;; 990000))
;;; Generated autoloads from helm-tags.el
(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
;;;;;; 994000))
;;;### (autoloads nil "helm-utils" "helm-utils.el" (22490 24935 179409
;;;;;; 47000))
;;; Generated autoloads from helm-utils.el
(defvar helm-popup-tip-mode nil "\
Non-nil if Helm-Popup-Tip mode is enabled.
See the `helm-popup-tip-mode' command
for a description of this minor mode.
See the command `helm-popup-tip-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `helm-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"
;;;;;; "helm-pkg.el" "helm-types.el") (22454 5323 1273 151000))
;;;### (autoloads nil nil ("helm-easymenu.el" "helm-pkg.el" "helm-types.el")
;;;;;; (22490 24935 351383 40000))
;;;***

View File

@ -19,6 +19,7 @@
(require 'cl-lib)
(require 'bookmark)
(require 'helm)
(require 'helm-lib)
(require 'helm-help)
(require 'helm-types)
(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)
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)
(setf (slot-value source 'action)
(helm-append-at-nth
@ -489,7 +491,7 @@ than `w3m-browse-url' use it."
(setf (slot-value source 'keymap) helm-bookmark-find-files-map))
(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

View File

@ -435,8 +435,9 @@ Should be called after others transformers i.e (boring buffers)."
(defun helm-buffers-mark-similar-buffers-1 ()
(with-helm-window
(let ((type (get-text-property
0 'type (helm-get-selection nil 'withprop))))
(let* ((src (helm-get-current-source))
(type (get-text-property
0 'type (helm-get-selection nil 'withprop src))))
(save-excursion
(goto-char (helm-get-previous-header-pos))
(helm-next-line)
@ -449,13 +450,13 @@ Should be called after others transformers i.e (boring buffers)."
(maxpoint (or end (point-max))))
(while (< (point) maxpoint)
(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))
(eq (get-text-property 0 'type cand) type))
(helm-make-visible-mark)))
(forward-line 1) (end-of-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)))))
(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)
"Toggle diff buffer CANDIDATE with it's file."
(let (helm-persistent-action-use-special-display)
(helm-aif (get-buffer-window "*Diff*")
(progn (kill-buffer "*Diff*")
(set-window-buffer it helm-current-buffer))
(diff-buffer-with-file (get-buffer candidate)))))
(helm-aif (get-buffer-window "*Diff*")
(progn (kill-buffer "*Diff*")
(set-window-buffer it helm-current-buffer))
(diff-buffer-with-file (get-buffer candidate))))
(defun helm-buffer-diff-persistent ()
"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)
(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))))
(switch-to-buffer candidate)
(switch-to-buffer helm-current-buffer))))

View File

@ -144,7 +144,6 @@
("(\\<\\(with-helm-buffer\\)\\>" 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-display-same-window\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(with-helm-restore-variables\\)\\>" 1 font-lock-keyword-face)
("(\\<\\(helm-multi-key-defun\\)\\>" 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))
(if helm--force-updating-p
(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))
(message "Refreshing packages list done, no upgrades available"))
(setq helm-el-package--show-only (if helm-el-package--upgrades
@ -130,7 +130,7 @@
(helm-exit-and-execute-action 'helm-el-package-install)))
(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
for p in mkd
for id = (get-text-property 0 'tabulated-list-id p)
@ -139,7 +139,10 @@
(with-no-warnings
(if (fboundp 'package-desc-full-name)
;; emacs 24.4
(package-delete id)
(condition-case nil
(package-delete id force)
(wrong-number-of-arguments
(package-delete id)))
;; emacs 24.3
(package-delete (symbol-name (car id))
(package-version-join (cdr id)))))
@ -171,7 +174,7 @@
"No package deleted")))
(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 ()
(interactive)

View File

@ -94,6 +94,13 @@ fuzzy completion is not available in `completion-at-point'."
:group 'helm-elisp
: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
;;
@ -309,12 +316,12 @@ Return a cons \(beg . end\)."
:persistent-help (helm-lisp-completion-persistent-help)
:filtered-candidate-transformer
'helm-lisp-completion-transformer
:action `(lambda (candidate)
(with-helm-current-buffer
(run-with-timer
0.01 nil
'helm-insert-completion-at-point
,beg ,end candidate))))
:action (lambda (candidate)
(with-helm-current-buffer
(run-with-timer
0.01 nil
'helm-insert-completion-at-point
beg end candidate))))
:input (if helm-lisp-fuzzy-completion
target (concat target " "))
: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)
(helm-build-in-buffer-source "Variables"
:init `(lambda ()
(helm-apropos-init
(lambda (x) (and (boundp x) (not (keywordp x)))) ,default))
:init (lambda ()
(helm-apropos-init
(lambda (x) (and (boundp x) (not (keywordp x)))) default))
:fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'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)
(helm-build-in-buffer-source "Commands"
:init `(lambda ()
(helm-apropos-init 'commandp ,default))
:init (lambda ()
(helm-apropos-init 'commandp default))
:fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'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)
(helm-build-in-buffer-source "Functions"
:init `(lambda ()
(helm-apropos-init (lambda (x)
(and (fboundp x)
(not (commandp x))
(not (generic-p x))
(not (class-p x))))
,default))
:init (lambda ()
(helm-apropos-init (lambda (x)
(and (fboundp x)
(not (commandp x))
(not (generic-p x))
(not (class-p x))))
default))
:fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'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)
(helm-build-in-buffer-source "Classes"
:init `(lambda ()
(helm-apropos-init (lambda (x)
(class-p x))
,default))
:init (lambda ()
(helm-apropos-init (lambda (x)
(class-p x))
default))
:fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn)
@ -607,10 +614,10 @@ Filename completion happen if string start after or between a double quote."
(defun helm-def-source--eieio-generic (&optional default)
(helm-build-in-buffer-source "Generic functions"
:init `(lambda ()
(helm-apropos-init (lambda (x)
(generic-p x))
,default))
:init (lambda ()
(helm-apropos-init (lambda (x)
(generic-p x))
default))
:fuzzy-match helm-apropos-fuzzy-match
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
'helm-apropos-default-sort-fn)
@ -623,36 +630,67 @@ Filename completion happen if string start after or between a double quote."
("Find function" . helm-find-function)
("Info lookup" . helm-info-lookup-symbol))))
(defun helm-info-lookup-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)
(let ((helm-execute-action-at-once-if-one t)
(helm-quit-if-no-candidate
`(lambda ()
(message "`%s' Not Documented as a symbol" ,c))))
(helm :sources '(helm-source-info-elisp
helm-source-info-cl
helm-source-info-eieio)
(let ((helm-execute-action-at-once-if-one 'current-source))
(helm :sources (append helm-apropos-defaut-info-lookup-sources
(list (helm-info-lookup-fallback-source c)))
:resume 'noresume
:buffer "*helm lookup*"
:input c)))
(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)
(let ((hbuf (get-buffer (help-buffer))))
(if (and (helm-attr 'help-running-p)
(string= candidate (helm-attr 'help-current-symbol))
(null helm-persistent-action-use-special-display))
(progn
;; When started from a help buffer,
;; Don't kill this buffer as it is helm-current-buffer.
(unless (equal hbuf helm-current-buffer)
(kill-buffer hbuf)
(set-window-buffer (get-buffer-window hbuf)
helm-current-buffer))
(helm-attrset 'help-running-p nil))
(if name (funcall fun candidate name) (funcall fun candidate))
(helm-attrset 'help-running-p t))
(cond ((helm-follow-mode-p)
(if name
(funcall fun candidate name)
(funcall fun candidate)))
((or (and (helm-attr 'help-running-p)
(string= candidate (helm-attr 'help-current-symbol))))
(progn
;; When started from a help buffer,
;; Don't kill this buffer as it is helm-current-buffer.
(unless (equal hbuf helm-current-buffer)
(kill-buffer hbuf)
(set-window-buffer (get-buffer-window hbuf)
helm-current-buffer))
(helm-attrset 'help-running-p nil)))
(t
(if name
(funcall fun candidate name)
(funcall fun candidate))
(helm-attrset 'help-running-p t)))
(helm-attrset 'help-current-symbol candidate)))
;;;###autoload
@ -734,11 +772,11 @@ i.e the `symbol-name' of any existing symbol."
;;
(defun helm-locate-library-scan-list ()
(cl-loop for dir in load-path
when (file-directory-p dir)
append (directory-files dir t (concat (regexp-opt (get-load-suffixes))
"\\'"))
into lst
finally return (helm-fast-remove-dups lst :test 'equal)))
with load-suffixes = '(".el")
when (file-directory-p dir)
append (directory-files
dir t (concat (regexp-opt (get-load-suffixes))
"\\'"))))
;;;###autoload
(defun helm-locate-library ()

View File

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

View File

@ -632,6 +632,7 @@ If N is positive go forward otherwise go backward."
(goto-char it)
(forward-line 1))
(funcall mark-maybe)))
(helm-follow-execute-persistent-action-maybe)
(helm-log-run-hook 'helm-move-selection-after-hook)))
;;;###autoload
@ -900,6 +901,13 @@ These extensions will be added to command line with --include arg of grep."
(keymap :initform helm-grep-map)
(nohighlight :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)
(help-message :initform 'helm-grep-help-message)
(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)
(defun helm-do-grep-1 (targets &optional recurse grep exts default-input input)
"Launch grep on a list of TARGETS files.
(defmethod helm--setup-source ((source helm-grep-class))
(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
for EXTS to set the --include args of grep.
(cl-defun helm-do-grep-1 (targets &optional recurse backend exts
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.
e.g
$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
is used as `input' arg of `helm', See `helm' docstring.
Arg GREP when non--nil specify which grep to use
It is used actually to specify 'zgrep or 'git.
When zgrep is used don't prompt for a choice
Arg BACKEND when non--nil specify which backend to use
It is used actually to specify 'zgrep' or 'git'.
When BACKEND 'zgrep' is used don't prompt for a choice
in recurse, and ignore EXTS, search being made recursively on files matching
`helm-zgrep-file-extension-regexp' only."
(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
(exts (and recurse
;; [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))
(or exts (helm-grep-get-file-extensions targets))))
(include-files
@ -951,16 +969,14 @@ in recurse, and ignore EXTS, search being made recursively on files matching
(remove "*" exts)
exts) " ")))
(types (and (not include-files)
(not (eq grep 'zgrep))
(not (eq backend 'zgrep))
recurse
(helm-grep-use-ack-p :where 'recursive)
;; When %e format spec is not specified
;; ignore types and do not prompt for choice.
(string-match "%e" helm-grep-default-command)
(helm-grep-read-ack-type)))
(follow (and helm-follow-mode-persistent
(assoc-default 'follow helm-source-grep)))
(src-name (capitalize (helm-grep-command recurse grep))))
(src-name (capitalize (helm-grep-command recurse backend))))
;; When called as action from an other source e.g *-find-files
;; we have to kill 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
;; to pass infos later to `helm-resume'.
(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-include-files (or include-files types)
'helm-grep-in-recurse recurse
'helm-grep-use-zgrep (eq grep 'zgrep)
'helm-grep-use-zgrep (eq backend 'zgrep)
'helm-grep-default-command
(cond ((eq grep 'zgrep) helm-default-zgrep-command)
((eq grep 'git) helm-grep-git-grep-command)
(cond ((eq backend 'zgrep) helm-default-zgrep-command)
((eq backend 'git) helm-grep-git-grep-command)
(recurse helm-grep-default-recurse-command)
;; When resuming, the local value of
;; `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))
'default-directory helm-ff-default-directory) ;; [1]
;; Setup the source.
(setq helm-source-grep (helm-make-source src-name 'helm-grep-class
:follow follow))
(set source (helm-make-source src-name 'helm-grep-class
:backend backend))
(helm
:sources 'helm-source-grep
:buffer (format "*helm %s*" (helm-grep-command recurse grep))
:sources source
:buffer (format "*helm %s*" (helm-grep-command recurse backend))
:default default-input
:input input
:keymap helm-grep-map
@ -1354,6 +1370,13 @@ if available with current AG version."
(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)
"Start helm ag in DIRECTORY maybe searching in files of type TYPE."
(setq helm-source-grep-ag
@ -1384,6 +1407,8 @@ When WITH-TYPES is non-nil provide completion on AG types."
;;; Git grep
;;
;;
(defvar helm-source-grep-git nil)
(defcustom helm-grep-git-grep-command
"git --no-pager grep -n%cH --color=always --exclude-standard --no-index --full-name -e %p -- %f"
"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)))
(cl-assert helm-ff-default-directory nil "Not inside a Git repository")
(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
@ -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."
(interactive "P")
(require 'helm-files)
(helm-grep-ag default-directory arg))
(helm-grep-ag (expand-file-name default-directory) arg))
;;;###autoload
(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.
The search is done in `helm-ff-default-directory' or
fall back to `default-directory' if FROM-FF is nil."
(when helm-ff-locate-db-filename
(cond ((and helm-ff-default-directory
from-ff
(file-exists-p (expand-file-name
helm-ff-locate-db-filename
helm-ff-default-directory))
(expand-file-name
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))))))
(helm-aif (and helm-ff-locate-db-filename
(locate-dominating-file
(or (and from-ff
helm-ff-default-directory)
default-directory)
helm-ff-locate-db-filename))
(expand-file-name helm-ff-locate-db-filename it)))
(defun helm-locate-create-db-default-function (db-name directory)
"Default function used to create a locale locate db file.

View File

@ -19,6 +19,7 @@
(require 'cl-lib)
(require 'helm)
(require 'helm-lib)
(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
;; elements as string, so intern them to call predicate.
((and (symbolp collection) (boundp collection) test)
(let ((predicate `(lambda (elm)
(condition-case err
(if (eq (quote ,test) 'commandp)
(funcall (quote ,test) (intern elm))
(funcall (quote ,test) elm))
(wrong-type-argument
(funcall (quote ,test) (intern elm)))))))
(let ((predicate (lambda (elm)
(condition-case _err
(if (eq test 'commandp)
(funcall test (intern elm))
(funcall test elm))
(wrong-type-argument
(funcall test (intern elm)))))))
(all-completions input (symbol-value collection) predicate)))
((and (symbolp collection) (boundp collection))
(all-completions input (symbol-value collection)))
@ -826,6 +827,7 @@ Keys description:
(and helm-ff-auto-update-initial-value
(not (minibuffer-window-active-p (minibuffer-window)))))
helm-full-frame
helm-follow-mode-persistent
(hist (and history (helm-comp-read-get-candidates
history nil nil alistp)))
(minibuffer-completion-confirm must-match)

View File

@ -96,11 +96,6 @@ This is a format string, don't forget the `%s'."
:type 'string
: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
"http://www.youtube.com/results?aq=f&search_query=%s"
"The Youtube search url.
@ -359,10 +354,9 @@ Can be \"-new-tab\" (default) or \"-new-window\"."
helm-search-suggest-action-wikipedia-url
candidate))))
:persistent-action #'helm-wikipedia-persistent-action
:persistent-help "show summary"
:volatile t
:keymap helm-map
:follow 1
:follow-delay helm-wikipedia-follow-delay
: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
'(("Go to heading" . helm-org-goto-marker)
("Open in indirect buffer `C-RET'" . helm-org--open-heading-in-indirect-buffer)
("Refile to this heading `C-w`''" . helm-org-heading-refile)
("Insert link to this heading `C-l`''" . helm-org-insert-link-to-heading-at-marker))
("Open in indirect buffer `C-c i'" . helm-org--open-heading-in-indirect-buffer)
("Refile to this heading `C-c w`" . helm-org-heading-refile)
("Insert link to this heading `C-c l`" . helm-org-insert-link-to-heading-at-marker))
"Default actions alist for
`helm-source-org-headings-for-files'."
: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))
(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."
(interactive)
(with-helm-alive-p
(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
(let ((map (make-sparse-keymap)))
(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-w") 'helm-org-heading-refile)
(define-key map (kbd "C-l") 'helm-org-insert-link-to-heading-at-marker)
(define-key map (kbd "<C-c i>") 'helm-org-run-open-heading-in-indirect-buffer)
(define-key map (kbd "C-c w") 'helm-org-run-heading-refile)
(define-key map (kbd "C-c l") 'helm-org-run-insert-link-to-heading-at-marker)
map)
"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
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)
(save-selected-window
(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-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
(defun helm-org-agenda-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 ()
"Preconfigured helm for org buffer headings."
(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
(list (current-buffer)))
:candidate-number-limit 99999
:preselect (helm-org-in-buffer-preselect)
:truncate-lines helm-org-truncate-lines
:buffer "*helm org inbuffer*")))

View File

@ -1,8 +1,8 @@
(define-package "helm" "20160818.623" "Helm is an Emacs incremental and narrowing framework"
'((emacs "24.3")
(define-package "helm" "20160914.813" "Helm is an Emacs incremental and narrowing framework"
'((emacs "24.4")
(async "1.9")
(popup "0.5.3")
(helm-core "1.9.9"))
(helm-core "2.1.0"))
:url "https://emacs-helm.github.io/helm/")
;; Local Variables:
;; 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))
(defun helm-regexp-kill-new (input)
(kill-new input)
(kill-new (substring-no-properties input))
(message "Killed: %s" input))

View File

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

View File

@ -35,22 +35,41 @@
(defcustom helm-top-command
(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"))
"Top command used to display output of top.
To use top command, a version supporting batch mode (-b option) is needed.
On Mac OSX top command doesn't support this, so ps command
is used by default instead.
If you modify this the number and order of elements displayed
should be the same as top command to have the sort commands
working properly, that is 12 elements with the 2 first being
PID and USER and the last 4 being %CPU, %MEM, TIME and COMMAND.
A format string where %s will be replaced with `frame-width'."
A format string where %s will be replaced with `frame-width'.
To use 'top' command, a version supporting batch mode (-b option) is needed.
On Mac OSX 'top' command doesn't support this, so ps command
is used instead by default.
Normally 'top' command output have 12 columns, but in some versions you may
have less than this, so you can either customize top to use 12 columns with the
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
: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
"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."
:group 'helm-sys
:type 'float)
@ -64,7 +83,8 @@ being idle."
(defcustom helm-top-poll-preselection 'linum
"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
:type '(radio :tag "Preferred preselection action for helm-top"
(const :tag "Follow candidate" candidate)
@ -164,6 +184,7 @@ Possible values are 'candidate or 'linum."
:persistent-action #'helm-top-sh-persistent-action
:persistent-help "SIGTERM"
:help-message 'helm-top-help-message
:mode-line 'helm-top-mode-line
:follow 'never
:keymap helm-top-map
:filtered-candidate-transformer #'helm-top-sort-transformer
@ -183,10 +204,11 @@ Return empty string for non--valid candidates."
(cons helm-top--line lst))))
(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)
(string= src-name "Top")
(helm-get-selection nil t))
(helm-get-selection nil t src))
(when (string-match-p "^ *PID" it)
(helm-next-line)))))
@ -258,55 +280,69 @@ Show actions only on line starting by a PID."
(defun helm-top-sort-by-com (s1 s2)
(let* ((split-1 (split-string s1))
(split-2 (split-string s2))
(com-1 (nth 11 split-1))
(com-2 (nth 11 split-2)))
(col (cdr (assq 'com helm-top-sort-colums-alist)))
(com-1 (nth col split-1))
(com-2 (nth col split-2)))
(string< com-1 com-2)))
(defun helm-top-sort-by-mem (s1 s2)
(let* ((split-1 (split-string s1))
(split-2 (split-string s2))
(mem-1 (string-to-number (nth 9 split-1)))
(mem-2 (string-to-number (nth 9 split-2))))
(col (cdr (assq 'mem helm-top-sort-colums-alist)))
(mem-1 (string-to-number (nth col split-1)))
(mem-2 (string-to-number (nth col split-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)
(let* ((split-1 (split-string s1))
(split-2 (split-string s2))
(user-1 (nth 1 split-1))
(user-2 (nth 1 split-2)))
(col (cdr (assq 'user helm-top-sort-colums-alist)))
(user-1 (nth col split-1))
(user-2 (nth col split-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 ()
(interactive)
(helm-top-set-mode-line "COM")
(setq helm-top-sort-fn 'helm-top-sort-by-com)
(helm-update (replace-regexp-in-string
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(helm-update (helm-top--preselect-fn)))
(defun helm-top-run-sort-by-cpu ()
(interactive)
(helm-top-set-mode-line "CPU")
(setq helm-top-sort-fn nil)
(helm-update (replace-regexp-in-string
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(let ((com (nth 2 (split-string helm-top-command))))
(helm-top-set-mode-line "CPU")
(setq helm-top-sort-fn (and (null (string= com "top"))
'helm-top-sort-by-cpu))
(helm-update (helm-top--preselect-fn))))
(defun helm-top-run-sort-by-mem ()
(interactive)
(helm-top-set-mode-line "MEM")
(setq helm-top-sort-fn 'helm-top-sort-by-mem)
(helm-update (replace-regexp-in-string
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(helm-update (helm-top--preselect-fn)))
(defun helm-top-run-sort-by-user ()
(interactive)
(helm-top-set-mode-line "USER")
(setq helm-top-sort-fn 'helm-top-sort-by-user)
(helm-update (replace-regexp-in-string
"[0-9]+" "[0-9]+"
(regexp-quote (helm-get-selection nil t)))))
(helm-update (helm-top--preselect-fn)))
;;; X RandR resolution change

View File

@ -115,7 +115,8 @@
(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 '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

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."
: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
;;
@ -680,15 +670,16 @@ If STRING is non--nil return instead a space separated string."
(member (assoc-default 'name (helm-get-current-source))
helm-sources-using-help-echo-popup))
(setq helm--show-help-echo-timer
(run-with-idle-timer
(run-with-timer
1 nil
(lambda ()
(with-helm-window
(helm-aif (get-text-property (point-at-bol) 'help-echo)
(popup-tip (concat " " (abbreviate-file-name it))
:around nil
:point (save-excursion
(end-of-visual-line) (point))))))))))
(save-selected-window
(with-helm-window
(helm-aif (get-text-property (point-at-bol) 'help-echo)
(popup-tip (concat " " (abbreviate-file-name it))
:around nil
:point (save-excursion
(end-of-visual-line) (point)))))))))))
;;;###autoload
(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
;;
;;; 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
(autoload 'helm-define-multi-key "helm" "\
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
after DELAY seconds.
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)
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
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
function on the next hit.
\(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)
(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" "\
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
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.
Arg EXIT-FN specifies a function to run on exit.
For any other keys pressed, run their assigned command as defined
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.
\(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" "\
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"
;;;;;; "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"
'((emacs "24.3")
(define-package "helm-core" "20160913.219" "Development files for Helm"
'((emacs "24.4")
(async "1.9"))
:url "https://emacs-helm.github.io/helm/")
;; Local Variables:

View File

@ -104,6 +104,33 @@ When only `add-text-properties' is available APPEND is ignored."
symbols)
,@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
;;
(defun helm-iter-list (seq)
@ -167,9 +194,6 @@ of `cl-return' is possible to exit the loop."
(progn ,@(cdr clause1))
(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
;;
@ -403,6 +427,35 @@ ARGS is (cand1 cand2 ...) or ((disp1 . real1) (disp2 . real2) ...)
collect (cons (car arg) (funcall function (cdr arg)))
else
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.
;;
@ -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."
(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
;;

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