added typescript and readme

This commit is contained in:
Raymundo Vásquez Ruiz
2019-10-27 19:05:34 +01:00
parent b6023212ea
commit 22a9de120e
156 changed files with 7949 additions and 689 deletions

11
README.md Normal file
View File

@@ -0,0 +1,11 @@
# My EMACS configuration #
Supports:
* JavaScript
* JSON
* Typescript
* Rust
Addons:
* Autocompletion
* Projectile

View File

@@ -33,7 +33,7 @@
("exports" . ("exports" .
[1 0 0 0 0 0 0]) [1 0 0 0 0 0 0])
("require" . ("require" .
[2 0 0 0 0 0 0]) [3 0 0 0 0 0 0])
("StepDefinitionTypes" . ("StepDefinitionTypes" .
[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]) [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0])
("END" . ("END" .
@@ -87,4 +87,12 @@
("wprocess" . ("wprocess" .
[1 0 0 0 1 0 0 0]) [1 0 0 0 1 0 0 0])
("false" . ("false" .
[1 0 0 0 0]))) [1 0 0 0 0])
("typescript-mode" .
[0 0 0 0 0 0 0 1 0 0 1 0 0 0 0])
("add-hook" .
[1 0 0 0 0 0 0 0])
("json-mode" .
[0 0 0 0 0 0 0 1 0])
("flycheck-mode" .
[0 0 0 0 0 1 0 0 0 0 0 0 0])))

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2019-10-27T10:10:02+0100 using RSA

File diff suppressed because it is too large Load Diff

View File

@@ -42,14 +42,21 @@
(require 'async) (require 'async)
(defcustom async-bytecomp-allowed-packages (defcustom async-bytecomp-allowed-packages
;; FIXME: Arguably the default should be `all', but currently
;; this minor mode is silently/forcefully enabled by Helm and Magit to ensure
;; they get compiled asynchronously, so this conservative default value is
;; here to make sure that the mode can be enabled without the user's
;; explicit consent.
'(async helm helm-core helm-ls-git helm-ls-hg magit) '(async helm helm-core helm-ls-git helm-ls-hg magit)
"Packages in this list will be compiled asynchronously by `package--compile'. "Packages in this list will be compiled asynchronously by `package--compile'.
All the dependencies of these packages will be compiled async too, All the dependencies of these packages will be compiled async too,
so no need to add dependencies to this list. so no need to add dependencies to this list.
The value of this variable can also be a list with a single element, The value of this variable can also be the symbol `all', in this case
the symbol `all', in this case packages are always compiled asynchronously." all packages are always compiled asynchronously."
:group 'async :group 'async
:type '(repeat (choice symbol))) :type '(choice
(const :tag "All packages" all)
(repeat symbol)))
(defvar async-byte-compile-log-file (defvar async-byte-compile-log-file
(concat user-emacs-directory "async-bytecomp.log")) (concat user-emacs-directory "async-bytecomp.log"))
@@ -109,46 +116,30 @@ All *.elc files are systematically deleted before proceeding."
(defvar package-alist) (defvar package-alist)
(declare-function package-desc-reqs "package.el" (cl-x)) (declare-function package-desc-reqs "package.el" (cl-x))
(defun async-bytecomp--get-package-deps (pkg &optional only) (defun async-bytecomp--get-package-deps (pkgs)
;; Same as `package--get-deps' but parse instead `package-archive-contents' ;; Same as `package--get-deps' but parse instead `package-archive-contents'
;; because PKG is not already installed and not present in `package-alist'. ;; because PKG is not already installed and not present in `package-alist'.
;; However fallback to `package-alist' in case PKG no more present ;; However fallback to `package-alist' in case PKG no more present
;; in `package-archive-contents' due to modification to `package-archives'. ;; in `package-archive-contents' due to modification to `package-archives'.
;; See issue #58. ;; See issue #58.
(let* ((pkg-desc (cadr (or (assq pkg package-archive-contents) (let ((seen '()))
(assq pkg package-alist)))) (while pkgs
(direct-deps (cl-loop for p in (package-desc-reqs pkg-desc) (let ((pkg (pop pkgs)))
for name = (car p) (unless (memq pkg seen)
when (or (assq name package-archive-contents) (let ((pkg-desc (cadr (or (assq pkg package-archive-contents)
(assq name package-alist)) (assq pkg package-alist)))))
collect name)) (when pkg-desc
(indirect-deps (unless (eq only 'direct) (push pkg seen)
(delete-dups (setq pkgs (append (mapcar #'car (package-desc-reqs pkg-desc))
(cl-loop for p in direct-deps append pkgs)))))))
(async-bytecomp--get-package-deps p)))))) seen))
(cl-case only
(direct direct-deps)
(separate (list direct-deps indirect-deps))
(indirect indirect-deps)
(t (delete-dups (append direct-deps indirect-deps))))))
(defun async-bytecomp-get-allowed-pkgs ()
(when (and async-bytecomp-allowed-packages
(listp async-bytecomp-allowed-packages))
(if package-archive-contents
(cl-loop for p in async-bytecomp-allowed-packages
when (assq p package-archive-contents)
append (async-bytecomp--get-package-deps p) into reqs
finally return
(delete-dups
(append async-bytecomp-allowed-packages reqs)))
async-bytecomp-allowed-packages)))
(defadvice package--compile (around byte-compile-async) (defadvice package--compile (around byte-compile-async)
(let ((cur-package (package-desc-name pkg-desc)) (let ((cur-package (package-desc-name pkg-desc))
(pkg-dir (package-desc-dir pkg-desc))) (pkg-dir (package-desc-dir pkg-desc)))
(if (or (equal async-bytecomp-allowed-packages '(all)) (if (or (member async-bytecomp-allowed-packages '(t all (all)))
(memq cur-package (async-bytecomp-get-allowed-pkgs))) (memq cur-package (async-bytecomp--get-package-deps
async-bytecomp-allowed-packages)))
(progn (progn
(when (eq cur-package 'async) (when (eq cur-package 'async)
(fmakunbound 'async-byte-recompile-directory)) (fmakunbound 'async-byte-recompile-directory))

View File

@@ -1,4 +1,4 @@
(define-package "async" "20190503.656" "Asynchronous processing in Emacs" 'nil :keywords (define-package "async" "20191009.1018" "Asynchronous processing in Emacs" 'nil :keywords
'("async") '("async")
:url "https://github.com/jwiegley/emacs-async") :url "https://github.com/jwiegley/emacs-async")
;; Local Variables: ;; Local Variables:

View File

@@ -0,0 +1,22 @@
;;; flymake-easy-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "flymake-easy" "flymake-easy.el" (0 0 0 0))
;;; Generated autoloads from flymake-easy.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flymake-easy" '("flymake-easy-")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; flymake-easy-autoloads.el ends here

View File

@@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "flymake-easy" "20140818.755" "Helpers for easily building flymake checkers" 'nil :commit "de41ea49503f71f997e5c359a2ad08df696c0147" :keywords '("convenience" "internal") :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :url "https://github.com/purcell/flymake-easy")

View File

@@ -0,0 +1,151 @@
;;; flymake-easy.el --- Helpers for easily building flymake checkers
;; Copyright (C) 2012 Steve Purcell
;; Author: Steve Purcell <steve@sanityinc.com>
;; URL: https://github.com/purcell/flymake-easy
;; Package-Version: 20140818.755
;; Version: DEV
;; Keywords: convenience, internal
;; 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/>.
;;; Commentary:
;; This library provides the `flymake-easy-load' helper function for
;; setting up flymake checkers. Just call that function with the
;; appropriate arguments in a major mode hook function. See
;; `flymake-ruby' for an example:
;; https://github.com/purcell/flymake-ruby
;;; Code:
(require 'flymake)
(defvar flymake-easy--active nil
"Indicates when flymake-easy-load has successfully run in this buffer.")
(defvar flymake-easy--command-fn nil
"The user-specified function for building the flymake command.")
(defvar flymake-easy--location nil
"Where to create the temp file when checking, one of 'tempdir, 'inplace or
'temp-with-folder.")
(defvar flymake-easy--extension nil
"The canonical file name extension to use for the current file.")
(mapc 'make-variable-buffer-local
'(flymake-easy--active
flymake-easy--command-fn
flymake-easy--location
flymake-easy--extension))
(defun flymake-easy--tempfile-in-temp-dir (file-name prefix)
"Create a temporary file for storing the contents of FILE-NAME in the system tempdir.
Argument PREFIX temp file prefix, supplied by flymake."
(make-temp-file (or prefix "flymake-easy")
nil
(concat "." flymake-easy--extension)))
(defun flymake-easy--flymake-init ()
"A catch-all flymake init function for use in `flymake-allowed-file-name-masks'."
(let* ((tempfile
(flymake-init-create-temp-buffer-copy
(cond
((eq 'tempdir flymake-easy--location)
'flymake-easy--tempfile-in-temp-dir)
((eq 'inplace flymake-easy--location)
'flymake-create-temp-inplace)
((eq 'temp-with-folder flymake-easy--location)
'flymake-create-temp-with-folder-structure)
(t
(error "unknown location for flymake-easy: %s" flymake-easy--location)))))
(command (funcall flymake-easy--command-fn tempfile)))
(list (car command) (cdr command))))
(defun flymake-easy-exclude-buffer-p ()
"Whether to skip flymake in the current buffer."
(and (fboundp 'tramp-tramp-file-p)
(buffer-file-name)
(tramp-tramp-file-p (buffer-file-name))))
(defun flymake-easy-load (command-fn &optional err-line-patterns location extension warning-re info-re)
"Enable flymake in the containing buffer using a specific narrow configuration.
Argument COMMAND-FN function called to build the
command line to run (receives filename, returns list).
Argument ERR-LINE-PATTERNS patterns for identifying errors (see `flymake-err-line-patterns').
Argument EXTENSION a canonical extension for this type of source file, e.g. \"rb\".
Argument LOCATION where to create the temporary copy: one of 'tempdir (default), 'inplace or 'temp-with-folder
Argument WARNING-RE a pattern which identifies error messages as warnings.
Argument INFO-RE a pattern which identifies messages as infos (supported only
by the flymake fork at https://github.com/illusori/emacs-flymake)."
(let ((executable (car (funcall command-fn "dummy"))))
(if (executable-find executable) ;; TODO: defer this checking
(unless (flymake-easy-exclude-buffer-p)
(setq flymake-easy--command-fn command-fn
flymake-easy--location (or location 'tempdir)
flymake-easy--extension extension
flymake-easy--active t)
(set (make-local-variable 'flymake-allowed-file-name-masks)
'(("." flymake-easy--flymake-init)))
(when err-line-patterns
(set (make-local-variable 'flymake-err-line-patterns) err-line-patterns))
(dolist (var '(flymake-warning-re flymake-warn-line-regexp))
(set (make-local-variable var) (or warning-re "^[wW]arn")))
(when (boundp 'flymake-info-line-regexp)
(set (make-local-variable 'flymake-info-line-regexp)
(or info-re "^[iI]nfo")))
(flymake-mode t))
(message "Not enabling flymake: '%s' program not found" executable))))
;; Internal overrides for flymake
(defun flymake-easy--find-all-matches (str)
"Return every match for `flymake-err-line-patterns' in STR.
This is a judicious override for `flymake-split-output', enabled
by the advice below, which allows for matching multi-line
patterns."
(let (matches
(last-match-end-pos 0))
(dolist (pattern flymake-err-line-patterns)
(let ((regex (car pattern))
(pos 0))
(while (string-match regex str pos)
(push (match-string 0 str) matches)
(setq pos (match-end 0)))
(setq last-match-end-pos (max pos last-match-end-pos))))
(let ((residual (substring str last-match-end-pos)))
(list matches
(unless (string= "" residual) residual)))))
(defadvice flymake-split-output (around flymake-easy--split-output (output) activate protect)
"Override `flymake-split-output' to support mult-line error messages."
(setq ad-return-value (if flymake-easy--active
(flymake-easy--find-all-matches output)
ad-do-it)))
(defadvice flymake-post-syntax-check (before flymake-easy--force-check-was-interrupted activate)
(when flymake-easy--active
(setq flymake-check-was-interrupted t)))
(provide 'flymake-easy)
;; Local Variables:
;; coding: utf-8
;; byte-compile-warnings: (not cl-functions)
;; eval: (checkdoc-minor-mode 1)
;; End:
;;; flymake-easy.el ends here

Binary file not shown.

View File

@@ -0,0 +1,32 @@
;;; flymake-json-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "flymake-json" "flymake-json.el" (0 0 0 0))
;;; Generated autoloads from flymake-json.el
(autoload 'flymake-json-load "flymake-json" "\
Configure flymake mode to check the current buffer's javascript syntax.
\(fn)" t nil)
(autoload 'flymake-json-maybe-load "flymake-json" "\
Call `flymake-json-load' if this file appears to be json.
\(fn)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "flymake-json" '("flymake-json-")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; flymake-json-autoloads.el ends here

View File

@@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "flymake-json" "20180511.911" "A flymake handler for json using jsonlint" '((flymake-easy "0.1")) :commit "ae58795f948402e987cda4c15f10354f8ec2d0fd" :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :url "https://github.com/purcell/flymake-json")

View File

@@ -0,0 +1,79 @@
;;; flymake-json.el --- A flymake handler for json using jsonlint
;; Copyright (c) 2013-2017 Steve Purcell
;; Author: Steve Purcell <steve@sanityinc.com>
;; Homepage: https://github.com/purcell/flymake-json
;; Package-Version: 20180511.911
;; Package-X-Original-Version: 0
;; Package-Requires: ((flymake-easy "0.1"))
;; 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/>.
;;; Commentary:
;; This package requires the "jsonlint" program, which can be installed using npm:
;;
;; npm install jsonlint -g
;;
;; Usage:
;;
;; (require 'flymake-json)
;;
;; Then, if you're using `json-mode':
;;
;; (add-hook 'json-mode-hook 'flymake-json-load)
;;
;; or, if you use `js-mode' for json:
;;
;; (add-hook 'js-mode-hook 'flymake-json-maybe-load)
;;
;; otherwise:
;;
;; (add-hook 'find-file-hook 'flymake-json-maybe-load)
;;
;; Uses flymake-easy, from https://github.com/purcell/flymake-easy
;;; Code:
(require 'flymake-easy)
(defconst flymake-json-err-line-patterns
'(("^\\(.+\\)\: line \\([0-9]+\\), col \\([0-9]+\\), \\(.+\\)$" nil 2 3 4)))
(defun flymake-json-command (filename)
"Construct a command that flymake can use to check json source in FILENAME."
(list "jsonlint" "-c" "-q" filename))
;;;###autoload
(defun flymake-json-load ()
"Configure flymake mode to check the current buffer's javascript syntax."
(interactive)
(flymake-easy-load 'flymake-json-command
flymake-json-err-line-patterns
'tempdir
"json"))
;;;###autoload
(defun flymake-json-maybe-load ()
"Call `flymake-json-load' if this file appears to be json."
(interactive)
(if (and buffer-file-name
(string= "json" (file-name-extension buffer-file-name)))
(flymake-json-load)))
(provide 'flymake-json)
;;; flymake-json.el ends here

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
elpa/gnupg/tofu.db Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -694,6 +694,9 @@ Keys description:
- MATCH-PART: Allow matching only one part of candidate. - MATCH-PART: Allow matching only one part of candidate.
See match-part documentation in `helm-source'. See match-part documentation in `helm-source'.
- MATCH-DYNAMIC: See match-dynamic in `helm-source-sync'
It have no effect when used with CANDIDATES-IN-BUFFER.
- ALLOW-NEST: Allow nesting this `helm-comp-read' in a helm session. - ALLOW-NEST: Allow nesting this `helm-comp-read' in a helm session.
See `helm'. See `helm'.
@@ -707,7 +710,7 @@ in `helm-current-prefix-arg', otherwise if prefix args were given before
That's mean you can pass prefix args before or after calling a command That's mean you can pass prefix args before or after calling a command
that use `helm-comp-read' See `helm-M-x' for example. that use `helm-comp-read' See `helm-M-x' for example.
\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (BUFFER \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (REQUIRES-PATTERN 0) HISTORY INPUT-HISTORY (CASE-FOLD helm-comp-read-case-fold-search) (DEL-INPUT t) (PERSISTENT-ACTION nil) (PERSISTENT-HELP \"DoNothing\") (MODE-LINE helm-comp-read-mode-line) HELP-MESSAGE (KEYMAP helm-comp-read-map) (NAME \"Helm Completions\") HEADER-NAME CANDIDATES-IN-BUFFER MATCH-PART EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (VOLATILE t) SORT FC-TRANSFORMER HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (ALISTP t) (CANDIDATE-NUMBER-LIMIT helm-candidate-number-limit) MULTILINE ALLOW-NEST (GROUP \\='helm))" 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\") HEADER-NAME CANDIDATES-IN-BUFFER MATCH-PART MATCH-DYNAMIC EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (VOLATILE t) SORT FC-TRANSFORMER HIST-FC-TRANSFORMER MARKED-CANDIDATES NOMARK (ALISTP t) (CANDIDATE-NUMBER-LIMIT helm-candidate-number-limit) MULTILINE ALLOW-NEST (GROUP \\='helm))" nil nil)
(autoload 'helm-read-file-name "helm-mode" "\ (autoload 'helm-read-file-name "helm-mode" "\
Read a file name with helm completion. Read a file name with helm completion.

View File

@@ -3878,8 +3878,9 @@ is helm-source-find-files."
(let* ((beg (and (use-region-p) (region-beginning))) (let* ((beg (and (use-region-p) (region-beginning)))
(end (and (use-region-p) (region-end))) (end (and (use-region-p) (region-end)))
(str (and beg end (buffer-substring-no-properties beg end))) (str (and beg end (buffer-substring-no-properties beg end)))
(ffap (or (and helm-ff-guess-ffap-urls ffap-url-regexp (ffap (or (helm-aand helm-ff-guess-ffap-urls ffap-url-regexp
(ffap-fixup-url (ffap-url-at-point))) (ffap-fixup-url (ffap-url-at-point))
(and (string-match ffap-url-regexp it) it))
(ffap-file-at-point)))) (ffap-file-at-point))))
;; Workaround emacs bugs: ;; Workaround emacs bugs:
;; When the region is active and a file is detected ;; When the region is active and a file is detected

View File

@@ -123,19 +123,9 @@ separator."
(helm-process-deferred-sentinel-hook (helm-process-deferred-sentinel-hook
process event (helm-default-directory)) process event (helm-default-directory))
(if (string= event "finished\n") (if (string= event "finished\n")
(with-helm-window (helm-locate-update-mode-line "Find")
(setq mode-line-format (helm-log "Error: Find %s"
'(" " mode-line-buffer-identification " " (replace-regexp-in-string "\n" "" event))))))))
(:eval (format "L%s" (helm-candidate-number-at-point))) " "
(:eval (propertize
(format "[Find process finished - (%s results)]"
(max (1- (count-lines
(point-min) (point-max)))
0))
'face 'helm-locate-finish))))
(force-mode-line-update))
(helm-log "Error: Find %s"
(replace-regexp-in-string "\n" "" event))))))))
(defun helm-find-1 (dir) (defun helm-find-1 (dir)
(let ((default-directory (file-name-as-directory dir))) (let ((default-directory (file-name-as-directory dir)))

View File

@@ -262,6 +262,21 @@ See also `helm-locate'."
:default default :default default
:history 'helm-file-name-history))) :history 'helm-file-name-history)))
(defun helm-locate-update-mode-line (process-name)
"Update mode-line with PROCESS-NAME status information."
(with-helm-window
(setq mode-line-format
`(" " mode-line-buffer-identification " "
(:eval (format "L%s" (helm-candidate-number-at-point))) " "
(:eval (propertize
(format "[%s process finished - (%s results)]"
(max (1- (count-lines
(point-min) (point-max)))
0)
,process-name)
'face 'helm-locate-finish))))
(force-mode-line-update)))
(defun helm-locate-init () (defun helm-locate-init ()
"Initialize async locate process for `helm-source-locate'." "Initialize async locate process for `helm-source-locate'."
(let* ((locate-is-es (string-match "\\`es" helm-locate-command)) (let* ((locate-is-es (string-match "\\`es" helm-locate-command))
@@ -309,17 +324,7 @@ See also `helm-locate'."
(when (and helm-locate-fuzzy-match (when (and helm-locate-fuzzy-match
(not (string-match-p "\\s-" helm-pattern))) (not (string-match-p "\\s-" helm-pattern)))
(helm-redisplay-buffer)) (helm-redisplay-buffer))
(with-helm-window (helm-locate-update-mode-line "Locate"))
(setq mode-line-format
'(" " mode-line-buffer-identification " "
(:eval (format "L%s" (helm-candidate-number-at-point))) " "
(:eval (propertize
(format "[Locate process finished - (%s results)]"
(max (1- (count-lines
(point-min) (point-max)))
0))
'face 'helm-locate-finish))))
(force-mode-line-update)))
(t (t
(helm-log "Error: Locate %s" (helm-log "Error: Locate %s"
(replace-regexp-in-string "\n" "" event)))))))))) (replace-regexp-in-string "\n" "" event))))))))))

View File

@@ -160,12 +160,6 @@ when non--nil."
:group 'helm-mode :group 'helm-mode
:type 'boolean) :type 'boolean)
(defcustom helm-completion-in-region-fuzzy-match nil
"Whether `helm-completion-in-region' use fuzzy matching or not.
Affect among others `completion-at-point', `completing-read-multiple'."
:group 'helm-mode
:type 'boolean)
(defcustom helm-completion-in-region-default-sort-fn (defcustom helm-completion-in-region-default-sort-fn
'helm-completion-in-region-sort-fn 'helm-completion-in-region-sort-fn
"The default sort function to sort candidates in completion-in-region. "The default sort function to sort candidates in completion-in-region.
@@ -173,8 +167,9 @@ Affect among others `completion-at-point', `completing-read-multiple'."
When nil no sorting is done. When nil no sorting is done.
The function is a `filtered-candidate-transformer' function which takes The function is a `filtered-candidate-transformer' function which takes
two args CANDIDATES and SOURCE. two args CANDIDATES and SOURCE.
It will be used only when `helm-completion-in-region-fuzzy-match' is It will be used only when `helm-completion-style' is either emacs or
nil otherwise fuzzy use its own sort function." helm, otherwise when helm-fuzzy style is used, the fuzzy sort function
will be used."
:group 'helm-mode :group 'helm-mode
:type 'function) :type 'function)
@@ -184,7 +179,7 @@ Note that this will slow down completion and modify sorting
which is unwanted in many places. which is unwanted in many places.
This affect only the functions with completing-read helmized by helm-mode. This affect only the functions with completing-read helmized by helm-mode.
To fuzzy match `completion-at-point' and friends see To fuzzy match `completion-at-point' and friends see
`helm-completion-in-region-fuzzy-match'." `helm-completion-style'."
:group 'helm-mode :group 'helm-mode
:type 'boolean) :type 'boolean)
@@ -222,9 +217,47 @@ know what you are doing."
(set-keymap-parent map helm-map) (set-keymap-parent map helm-map)
(define-key map (kbd "<C-return>") 'helm-cr-empty-string) (define-key map (kbd "<C-return>") 'helm-cr-empty-string)
(define-key map (kbd "M-RET") 'helm-cr-empty-string) (define-key map (kbd "M-RET") 'helm-cr-empty-string)
(define-key map (kbd "DEL") 'helm-mode-delete-char-backward-maybe)
map) map)
"Keymap for `helm-comp-read'.") "Keymap for `helm-comp-read'.")
(defcustom helm-completion-style 'emacs
"Style of completion to use in `completion-in-region'.
This affect only `completion-at-point' and friends, NOT
`completing-read' nor other helm commands.
NB: This have nothing to do with `completion-styles', it is independent to
helm.
There is three possible value to use:
- helm, use multi match regular helm completion.
- helm-fuzzy, use fuzzy matching, note that as usual when
entering a space helm switch to multi matching mode.
- emacs, use regular emacs completion according to
`completion-styles', note that even in this style, helm allow using
multi match. Emacs-27 provide a style called flex that can be used
along this helm style (see `completion-styles-alist').
Please use custom interface or `customize-set-variable' to set this,
NOT `setq'."
:group 'helm-mode
:type '(choice (const :tag "Emacs" emacs)
(const :tag "Helm" helm)
(const :tag "Helm-fuzzy" helm-fuzzy))
:set (lambda (var val)
(set var val)
(if (memq val '(helm helm-fuzzy))
(define-key helm-comp-read-map (kbd "DEL") 'helm-mode-delete-char-backward-maybe)
(define-key helm-comp-read-map (kbd "DEL") 'delete-backward-char))))
(defcustom helm-completion-styles-alist nil
"Allow configuring `helm-completion-style' per mode.
Each entry is a cons cell like (mode . style) where style must be a
suitable value for `helm-completion-style'."
:group 'helm-mode
:type '(alist :key-type (symbol :tag "Mode")
:value-type (symbol :tag "Style")))
;;; helm-comp-read ;;; helm-comp-read
;; ;;
@@ -324,7 +357,7 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'."
;; Handle here specially such cases. ;; Handle here specially such cases.
((and (functionp collection) (not (string= input "")) ((and (functionp collection) (not (string= input ""))
minibuffer-completing-file-name) minibuffer-completing-file-name)
(cl-loop for f in (funcall collection input test t) (cl-loop for f in (funcall collection input test)
unless (member f '("./" "../")) unless (member f '("./" "../"))
if (string-match helm--url-regexp input) if (string-match helm--url-regexp input)
collect f collect f
@@ -428,6 +461,7 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'."
header-name header-name
candidates-in-buffer candidates-in-buffer
match-part match-part
match-dynamic
exec-when-only-one exec-when-only-one
quit-when-no-cand quit-when-no-cand
(volatile t) (volatile t)
@@ -530,6 +564,9 @@ Keys description:
- MATCH-PART: Allow matching only one part of candidate. - MATCH-PART: Allow matching only one part of candidate.
See match-part documentation in `helm-source'. See match-part documentation in `helm-source'.
- MATCH-DYNAMIC: See match-dynamic in `helm-source-sync'
It have no effect when used with CANDIDATES-IN-BUFFER.
- ALLOW-NEST: Allow nesting this `helm-comp-read' in a helm session. - ALLOW-NEST: Allow nesting this `helm-comp-read' in a helm session.
See `helm'. See `helm'.
@@ -578,7 +615,9 @@ that use `helm-comp-read' See `helm-M-x' for example."
;; `all-completions' which defeat helm ;; `all-completions' which defeat helm
;; matching functions (multi match, fuzzy ;; matching functions (multi match, fuzzy
;; etc...) issue #2134. ;; etc...) issue #2134.
collection test sort alistp ""))) collection test sort alistp
(if (and match-dynamic (null candidates-in-buffer))
helm-pattern ""))))
(helm-cr-default default cands)))) (helm-cr-default default cands))))
(history-get-candidates (history-get-candidates
(lambda () (lambda ()
@@ -614,8 +653,10 @@ that use `helm-comp-read' See `helm-M-x' for example."
:multiline multiline :multiline multiline
:header-name header-name :header-name header-name
:filtered-candidate-transformer :filtered-candidate-transformer
(append (helm-mklist fc-transformer) (let ((transformers (helm-mklist fc-transformer)))
'(helm-cr-default-transformer)) (append transformers
(unless (member 'helm-cr-default-transformer transformers)
'(helm-cr-default-transformer))))
:requires-pattern requires-pattern :requires-pattern requires-pattern
:persistent-action persistent-action :persistent-action persistent-action
:persistent-help persistent-help :persistent-help persistent-help
@@ -623,6 +664,7 @@ that use `helm-comp-read' See `helm-M-x' for example."
:keymap loc-map :keymap loc-map
:group group :group group
:mode-line mode-line :mode-line mode-line
:match-dynamic match-dynamic
:help-message help-message :help-message help-message
:action action-fn :action action-fn
:volatile volatile)) :volatile volatile))
@@ -1269,8 +1311,35 @@ The `helm-find-files' history `helm-ff-history' is used here."
"Default sort function for completion-in-region." "Default sort function for completion-in-region."
(sort candidates 'helm-generic-sort-fn)) (sort candidates 'helm-generic-sort-fn))
(defun helm-completion-in-region--comps (comps afun file-comp-p)
(if file-comp-p
;; Filter out dot files in file completion.
(cl-loop for f in comps unless
(string-match "\\`\\.\\{1,2\\}/\\'" f)
collect f)
(if afun
;; Add annotation at end of
;; candidate if needed.
(mapcar (lambda (s)
(let ((ann (funcall afun s)))
(if ann
(cons
(concat
s
(propertize
" " 'display
(propertize
ann
'face 'completions-annotations)))
s)
s)))
comps)
comps)))
(defun helm-mode--completion-in-region-initial-input (str) (defun helm-mode--completion-in-region-initial-input (str)
(propertize str 'read-only t 'face 'helm-mode-prefix 'rear-nonsticky t)) (if (memq helm-completion-style '(helm helm-fuzzy))
(propertize str 'read-only t 'face 'helm-mode-prefix 'rear-nonsticky t)
str))
(defun helm-mode-delete-char-backward-1 () (defun helm-mode-delete-char-backward-1 ()
(interactive) (interactive)
@@ -1303,6 +1372,94 @@ Second call delete backward char in current-buffer and quit helm completion,
letting user starting a new completion with a new prefix." letting user starting a new completion with a new prefix."
'(helm-mode-delete-char-backward-1 helm-mode-delete-char-backward-2) 1) '(helm-mode-delete-char-backward-1 helm-mode-delete-char-backward-2) 1)
(defun helm-completion-in-region-sort-flex-candidates (candidates _source)
"Sort CANDIDATES computed with flex completion-style."
(sort candidates (lambda (s1 s2)
(let* ((str1 (if (consp s1) (car s1) s1))
(str2 (if (consp s2) (car s2) s2))
(scr1 (get-text-property 0 'completion-score str1))
(scr2 (get-text-property 0 'completion-score str2)))
(if (and scr1 scr2)
(> scr1 scr2)
(helm-generic-sort-fn s1 s2))))))
(defun helm-completion-in-region--fix-completion-styles ()
"Use a simple setting for `completion-styles' when using helm styles.
Returns a suitable value for `completion-styles'."
(if (memq helm-completion-style '(helm helm-fuzzy))
'(basic partial-completion emacs22)
(cl-loop with all-styles = (mapcar 'car completion-styles-alist)
for style in completion-styles
when (member style all-styles)
collect style)))
;; Helm style
(defun helm-completion-try-completion (string table pred point)
"The try completion function for `completing-styles-alist'.
Actually do nothing."
(ignore string table pred point))
(defun helm-completion-all-completions (string table pred point)
"The all completions function for `completing-styles-alist'."
;; FIXME: No need to bind all these value.
(cl-multiple-value-bind (all _pattern prefix _suffix _carbounds)
(helm-completion--substring-all-completions string table pred point)
;; For now (length prefix) is always == to 0.
(when all (nconc all (length prefix)))))
(defun helm-completion--all-completions-multi (string collection &optional predicate)
"Allow `all-completions' multi matching on its candidates."
(all-completions "" collection (lambda (x)
(if predicate
(and (funcall predicate x)
(helm-mm-match (helm-stringify x) string))
(helm-mm-match (helm-stringify x) string)))))
(defun helm-completion--substring-all-completions (string table pred point)
"Collect completions from TABLE for helm completion style."
(let* ((beforepoint (substring string 0 point))
(afterpoint (substring string point))
(bounds (completion-boundaries beforepoint table pred afterpoint))
(prefix (substring beforepoint 0 (car bounds)))
(suffix (substring afterpoint (cdr bounds)))
(multi-pats (string-match-p " " string))
(init-str (if multi-pats
(car (helm-mm-split-pattern string))
string))
(all (if (or multi-pats (string-match-p "\\`!" init-str))
(helm-completion--all-completions-multi string table pred)
(all-completions init-str table pred))))
(list all string prefix suffix point)))
(defun helm-completion--merge-metadata (metadata)
(if (and (eq helm-completion-style 'emacs)
(assq 'helm-completion completion-category-defaults)
(assq 'helm completion-styles-alist)
(not (assq 'category metadata)))
(append
metadata
'((category . helm-completion)))
metadata))
;; Setup completion styles for helm
(defun helm-mode--setup-completion-styles ()
(cl-pushnew '(helm helm-completion-try-completion
helm-completion-all-completions
"helm completion style.")
completion-styles-alist
:test 'equal)
(cl-pushnew '(helm-completion (styles . (helm)))
completion-category-defaults
:test 'equal))
(defun helm-mode--disable-completion-styles ()
(setq completion-styles-alist
(delete (assq 'helm completion-styles-alist)
completion-styles-alist)
completion-category-defaults
(delete (assq 'helm-completion completion-category-defaults)
completion-category-defaults)))
(defun helm--completion-in-region (start end collection &optional predicate) (defun helm--completion-in-region (start end collection &optional predicate)
"Helm replacement of `completion--in-region'. "Helm replacement of `completion--in-region'.
Can be used as value for `completion-in-region-function'." Can be used as value for `completion-in-region-function'."
@@ -1313,125 +1470,148 @@ Can be used as value for `completion-in-region-function'."
(advice-add (advice-add
'lisp--local-variables 'lisp--local-variables
:around #'helm-mode--advice-lisp--local-variables) :around #'helm-mode--advice-lisp--local-variables)
(unwind-protect (let ((old--helm-completion-style helm-completion-style))
(let* ((enable-recursive-minibuffers t) (helm-aif (cdr (assq major-mode helm-completion-styles-alist))
(input (buffer-substring-no-properties start end)) (customize-set-variable 'helm-completion-style it))
(current-command (or (helm-this-command) this-command)) (unwind-protect
(crm (eq current-command 'crm-complete)) (let* ((enable-recursive-minibuffers t)
(str-command (helm-symbol-name current-command)) (helm-completion-in-region-default-sort-fn
(buf-name (format "*helm-mode-%s*" str-command)) (cond ((and (eq helm-completion-style 'emacs)
(require-match (or (and (boundp 'require-match) require-match) ;; Emacs-27 only.
minibuffer-completion-confirm (memq 'flex completion-styles))
;; If prompt have not been propagated here, that's #'helm-completion-in-region-sort-flex-candidates)
;; probably mean we have no prompt and we are in ((or (eq helm-completion-style 'helm-fuzzy)
;; completion-at-point or friend, so use a non--nil ;; Sly only.
;; value for require-match. (memq 'backend completion-styles))
(not (boundp 'prompt)))) nil)
;; `completion-extra-properties' is let-bounded in `completion-at-point'. (t helm-completion-in-region-default-sort-fn)))
;; `afun' is a closure to call against each string in `data'. (completion-styles (helm-completion-in-region--fix-completion-styles))
;; it provide the annotation info for each string. (input (buffer-substring start end))
;; e.g "foo" => "foo <f>" where foo is a function. (current-command (or (helm-this-command) this-command))
;; See Issue #407. (crm (eq current-command 'crm-complete))
(afun (plist-get completion-extra-properties :annotation-function)) (str-command (helm-symbol-name current-command))
(metadata (completion-metadata (buf-name (format "*helm-mode-%s*" str-command))
(buffer-substring-no-properties start (point)) (require-match (or (and (boundp 'require-match) require-match)
collection predicate)) minibuffer-completion-confirm
(data (completion-all-completions ;; If prompt have not been propagated here, that's
(buffer-substring start end) ;; probably mean we have no prompt and we are in
collection ;; completion-at-point or friend, so use a non--nil
predicate ;; value for require-match.
(- (point) start) (not (boundp 'prompt))))
metadata)) ;; `completion-extra-properties' is let-bounded in `completion-at-point'.
;; `completion-all-completions' store the base-size in the last `cdr', ;; `afun' is a closure to call against each string in `data'.
;; so data looks like this: '(a b c d . 0) and (last data) == (d . 0). ;; it provide the annotation info for each string.
(last-data (last data)) ;; e.g "foo" => "foo <f>" where foo is a function.
(base-size (helm-aif (cdr (last data)) ;; See Issue #407.
(prog1 it (afun (plist-get completion-extra-properties :annotation-function))
(setcdr last-data nil)) (metadata (helm-completion--merge-metadata
0)) (completion-metadata
(init-space-suffix (unless (or helm-completion-in-region-fuzzy-match (buffer-substring start (point))
(string-suffix-p " " input) collection predicate)))
(string= input "")) (init-space-suffix (unless (or (memq helm-completion-style '(helm-fuzzy emacs))
" ")) (string-suffix-p " " input)
(file-comp-p (or (eq (completion-metadata-get metadata 'category) 'file) (string= input ""))
(helm-mode--in-file-completion-p) " "))
;; Assume that when `afun' and `predicate' are null (file-comp-p (or (eq (completion-metadata-get metadata 'category) 'file)
;; we are in filename completion. (helm-mode--in-file-completion-p)
(and (null afun) (null predicate)))) ;; Assume that when `afun' and `predicate' are null
;; Completion-at-point and friends have no prompt. ;; we are in filename completion.
(result (if (stringp data) (and (null afun) (null predicate))))
data (hash (make-hash-table :test 'equal))
(helm-comp-read ;; `completion-all-completions' store the base-size in the last `cdr',
(or (and (boundp 'prompt) prompt) "Pattern: ") ;; so data looks like this: '(a b c d . 0) and (last data) == (d . 0).
(if file-comp-p base-size
(cl-loop for f in data unless (compfn (lambda (str _predicate _action)
(string-match "\\`\\.\\{1,2\\}/\\'" f) ;; Cache data for subsequent calls when emacs
collect f) ;; style is in use, with helm style function
(if afun ;; is called only once and cache is not
(mapcar (lambda (s) ;; needed but it doesn't harm to set hash, it
(let ((ann (funcall afun s))) ;; will not be used.
(if ann (let* ((comps
(cons (or (gethash str hash)
(concat (puthash str (completion-all-completions
s ;; `helm-comp-read-get-candidates'
(propertize ;; set input to `helm-pattern'
" " 'display ;; so no need to pass
(propertize ;; `helm-pattern' directly here.
ann str
'face 'completions-annotations))) collection
s) predicate
s))) (length str)
data) metadata)
data)) hash)))
:name str-command (last-data (last comps)))
:fuzzy helm-completion-in-region-fuzzy-match (setq base-size
:nomark (null crm) (helm-aif (cdr last-data)
:marked-candidates crm (prog1 (or base-size it)
:initial-input (setcdr last-data nil))
(cond ((and file-comp-p 0))
(not (string-match "/\\'" input))) (helm-completion-in-region--comps
(concat (helm-mode--completion-in-region-initial-input comps afun file-comp-p))))
(helm-basename input)) (data (if (memq helm-completion-style '(helm helm-fuzzy))
init-space-suffix)) (funcall compfn (buffer-substring start end) nil nil)
((string-match "/\\'" input) nil) compfn))
((or (null require-match) (result (if (stringp data)
(stringp require-match)) data
(helm-mode--completion-in-region-initial-input input)) (helm-comp-read
(t (concat (helm-mode--completion-in-region-initial-input input) ;; Completion-at-point and friends have no prompt.
init-space-suffix))) (or (and (boundp 'prompt) prompt) "Pattern: ")
:buffer buf-name data
:fc-transformer (append '(helm-cr-default-transformer) :name str-command
(unless (or helm-completion-in-region-fuzzy-match :nomark (null crm)
(null helm-completion-in-region-default-sort-fn)) :marked-candidates crm
(list helm-completion-in-region-default-sort-fn))) :initial-input
:exec-when-only-one t (cond ((and file-comp-p
:quit-when-no-cand (not (string-match "/\\'" input)))
(lambda () (concat (helm-mode--completion-in-region-initial-input
;; Delay message to overwrite "Quit". (helm-basename input))
(run-with-timer init-space-suffix))
0.01 nil ((string-match "/\\'" input) nil)
(lambda () ((or (null require-match)
(message "[No matches]"))) (stringp require-match))
t) ; exit minibuffer immediately. (helm-mode--completion-in-region-initial-input input))
:must-match require-match)))) (t (concat (helm-mode--completion-in-region-initial-input input)
(cond ((stringp result) init-space-suffix)))
(choose-completion-string :buffer buf-name
result (current-buffer) :fc-transformer
(list (+ start base-size) end) ;; Ensure sort fn is at the end.
completion-list-insert-choice-function)) (append '(helm-cr-default-transformer)
((consp result) ; crm. (and helm-completion-in-region-default-sort-fn
(let ((beg (+ start base-size)) (list helm-completion-in-region-default-sort-fn)))
(sep ",")) :match-dynamic (eq helm-completion-style 'emacs)
;; Try to find a default separator. :fuzzy (eq helm-completion-style 'helm-fuzzy)
(save-excursion :exec-when-only-one t
(goto-char beg) :quit-when-no-cand
(when (looking-back crm-separator (1- (point))) (lambda ()
(setq sep (match-string 0)))) ;; Delay message to overwrite "Quit".
(funcall completion-list-insert-choice-function (run-with-timer
beg end (mapconcat 'identity result sep)))) 0.01 nil
(t nil))) (lambda ()
(advice-remove 'lisp--local-variables (message "[No matches]")))
#'helm-mode--advice-lisp--local-variables)))) t) ; exit minibuffer immediately.
:must-match require-match))))
(helm-completion-in-region--insert-result result start end base-size))
(customize-set-variable 'helm-completion-style old--helm-completion-style)
(advice-remove 'lisp--local-variables
#'helm-mode--advice-lisp--local-variables)))))
(defun helm-completion-in-region--insert-result (result start end base-size)
(cond ((stringp result)
(choose-completion-string
result (current-buffer)
(list (+ start base-size) end)
completion-list-insert-choice-function))
((consp result) ; crm.
(let ((beg (+ start base-size))
(sep ","))
;; Try to find a default separator.
(save-excursion
(goto-char beg)
(when (looking-back crm-separator (1- (point)))
(setq sep (match-string 0))))
(funcall completion-list-insert-choice-function
beg end (mapconcat 'identity result sep))))
(t nil)))
(defun helm-mode--in-file-completion-p () (defun helm-mode--in-file-completion-p ()
(with-helm-current-buffer (with-helm-current-buffer
@@ -1501,7 +1681,8 @@ Note: This mode is incompatible with Emacs23."
#'helm--generic-read-buffer) #'helm--generic-read-buffer)
(when helm-mode-handle-completion-in-region (when helm-mode-handle-completion-in-region
(add-function :override completion-in-region-function (add-function :override completion-in-region-function
#'helm--completion-in-region)) #'helm--completion-in-region)
(helm-mode--setup-completion-styles))
;; If user have enabled ido-everywhere BEFORE enabling ;; If user have enabled ido-everywhere BEFORE enabling
;; helm-mode disable it and warn user about its ;; helm-mode disable it and warn user about its
;; incompatibility with helm-mode (issue #2085). ;; incompatibility with helm-mode (issue #2085).
@@ -1515,7 +1696,8 @@ Note: This mode is incompatible with Emacs23."
read-buffer-function 'helm--generic-read-buffer) read-buffer-function 'helm--generic-read-buffer)
(when (and (boundp 'completion-in-region-function) (when (and (boundp 'completion-in-region-function)
helm-mode-handle-completion-in-region) helm-mode-handle-completion-in-region)
(setq completion-in-region-function #'helm--completion-in-region)) (setq completion-in-region-function #'helm--completion-in-region)
(helm-mode--setup-completion-styles))
(message helm-completion-mode-start-message)) (message helm-completion-mode-start-message))
(if (fboundp 'remove-function) (if (fboundp 'remove-function)
(progn (progn
@@ -1523,6 +1705,7 @@ Note: This mode is incompatible with Emacs23."
(remove-function read-file-name-function #'helm--generic-read-file-name) (remove-function read-file-name-function #'helm--generic-read-file-name)
(remove-function read-buffer-function #'helm--generic-read-buffer) (remove-function read-buffer-function #'helm--generic-read-buffer)
(remove-function completion-in-region-function #'helm--completion-in-region) (remove-function completion-in-region-function #'helm--completion-in-region)
(helm-mode--disable-completion-styles)
(remove-hook 'ido-everywhere-hook #'helm-mode--ido-everywhere-hook)) (remove-hook 'ido-everywhere-hook #'helm-mode--ido-everywhere-hook))
(setq completing-read-function (and (fboundp 'completing-read-default) (setq completing-read-function (and (fboundp 'completing-read-default)
'completing-read-default) 'completing-read-default)
@@ -1531,7 +1714,8 @@ Note: This mode is incompatible with Emacs23."
read-buffer-function (and (fboundp 'read-buffer) 'read-buffer)) read-buffer-function (and (fboundp 'read-buffer) 'read-buffer))
(when (and (boundp 'completion-in-region-function) (when (and (boundp 'completion-in-region-function)
(boundp 'helm--old-completion-in-region-function)) (boundp 'helm--old-completion-in-region-function))
(setq completion-in-region-function helm--old-completion-in-region-function)) (setq completion-in-region-function helm--old-completion-in-region-function)
(helm-mode--disable-completion-styles))
(message helm-completion-mode-quit-message)))) (message helm-completion-mode-quit-message))))
(provide 'helm-mode) (provide 'helm-mode)

View File

@@ -1,4 +1,4 @@
(define-package "helm" "20191004.1946" "Helm is an Emacs incremental and narrowing framework" (define-package "helm" "20191026.431" "Helm is an Emacs incremental and narrowing framework"
'((emacs "24.4") '((emacs "24.4")
(async "1.9.3") (async "1.9.3")
(popup "0.5.3") (popup "0.5.3")

View File

@@ -427,15 +427,13 @@ Show actions only on line starting by a PID."
"Preconfigured `helm' for top command." "Preconfigured `helm' for top command."
(interactive) (interactive)
(add-hook 'helm-after-update-hook 'helm-top--skip-top-line) (add-hook 'helm-after-update-hook 'helm-top--skip-top-line)
(save-window-excursion (unwind-protect
(unless helm-alive-p (delete-other-windows)) (helm :sources 'helm-source-top
(unwind-protect :buffer "*helm top*" :full-frame t
(helm :sources 'helm-source-top :candidate-number-limit 9999
:buffer "*helm top*" :full-frame t :preselect "^\\s-*[0-9]+"
:candidate-number-limit 9999 :truncate-lines helm-show-action-window-other-window)
:preselect "^\\s-*[0-9]+" (remove-hook 'helm-after-update-hook 'helm-top--skip-top-line)))
:truncate-lines helm-show-action-window-other-window)
(remove-hook 'helm-after-update-hook 'helm-top--skip-top-line))))
;;;###autoload ;;;###autoload
(defun helm-list-emacs-process () (defun helm-list-emacs-process ()

View File

@@ -329,9 +329,12 @@ Create with etags shell command, or visit with `find-tag' or `visit-tags-table'.
(helm-etags-build-source))) (helm-etags-build-source)))
(helm :sources 'helm-source-etags-select (helm :sources 'helm-source-etags-select
:keymap helm-etags-map :keymap helm-etags-map
:default (if helm-etags-fuzzy-match :default (and (stringp str)
str (if (or helm-etags-fuzzy-match
(list (concat "\\_<" str "\\_>") str)) (and (eq major-mode 'haskell-mode)
(string-match "[']\\'" str)))
str
(list (concat "\\_<" str "\\_>") str)))
:buffer "*helm etags*")))) :buffer "*helm etags*"))))
(provide 'helm-tags) (provide 'helm-tags)

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