Add new packages

This commit is contained in:
Gergely Polonkai 2016-04-22 09:59:30 +02:00
parent ca708c6cf1
commit 373cecf125
34 changed files with 9524 additions and 34 deletions

View File

@ -0,0 +1,32 @@
;;; coffee-mode-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "coffee-mode" "coffee-mode.el" (22297 53349
;;;;;; 494925 803000))
;;; Generated autoloads from coffee-mode.el
(autoload 'coffee-mode "coffee-mode" "\
Major mode for editing CoffeeScript.
\(fn)" t nil)
(add-to-list 'auto-mode-alist '("\\.coffee\\'" . coffee-mode))
(add-to-list 'auto-mode-alist '("\\.iced\\'" . coffee-mode))
(add-to-list 'auto-mode-alist '("Cakefile\\'" . coffee-mode))
(add-to-list 'auto-mode-alist '("\\.cson\\'" . coffee-mode))
(add-to-list 'interpreter-mode-alist '("coffee" . coffee-mode))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; coffee-mode-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "coffee-mode" "20160419.1947" "Major mode for CoffeeScript code" '((emacs "24.1") (cl-lib "0.5")) :url "http://github.com/defunkt/coffee-mode" :keywords '("coffeescript" "major" "mode"))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
;;; company-c-headers-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company-c-headers" "company-c-headers.el"
;;;;;; (22297 53348 894925 450000))
;;; Generated autoloads from company-c-headers.el
(autoload 'company-c-headers "company-c-headers" "\
Company backend for C/C++ header files.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; company-c-headers-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "company-c-headers" "20150801.901" "Company mode backend for C/C++ header files" '((emacs "24.1") (company "0.8")) :keywords '("development" "company"))

View File

@ -0,0 +1,188 @@
;;; company-c-headers.el --- Company mode backend for C/C++ header files -*- lexical-binding: t -*-
;; Copyright (C) 2014 Alastair Rankine
;; Author: Alastair Rankine <alastair@girtby.net>
;; Keywords: development company
;; Package-Version: 20150801.901
;; Package-Requires: ((emacs "24.1") (company "0.8"))
;; This file is not part of GNU Emacs.
;; This file 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 file 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 file. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This library enables the completion of C/C++ header file names using Company.
;;
;; To initialize it, just add it to `company-backends':
;;
;; (add-to-list 'company-backends 'company-c-headers)
;;
;; When you type an #include declaration within a supported major mode (see
;; `company-c-headers-modes'), company-c-headers will search for header files
;; within predefined search paths. company-c-headers can search "system" and
;; "user" paths, depending on the type of #include declaration you type.
;;
;; You will probably want to customize the `company-c-headers-path-user' and
;; `company-c-headers-path-system' variables for your specific needs.
;;; Code:
(require 'company)
(require 'rx)
(require 'cl-lib)
(defgroup company-c-headers nil
"Completion back-end for C/C++ header files."
:group 'company)
(defcustom company-c-headers-path-system
'("/usr/include/" "/usr/local/include/")
"List of paths to search for system (i.e. angle-bracket
delimited) header files. Alternatively, a function can be
supplied which returns the path list."
:type '(choice (repeat directory)
function)
)
(defcustom company-c-headers-path-user
'(".")
"List of paths to search for user (i.e. double-quote delimited)
header files. Alternatively, a function can be supplied which
returns the path list. Note that paths in
`company-c-headers-path-system' are implicitly appended."
:type '(choice (repeat directory)
function)
)
(defvar company-c-headers-include-declaration
(rx
line-start
"#" (zero-or-more blank) (or "include" "import")
(one-or-more blank)
(submatch
(in "<\"")
(zero-or-more (not (in ">\""))))
)
"Prefix matching C/C++/ObjC include directives.")
(defvar company-c-headers-modes
`(
(c-mode . ,(rx ".h" line-end))
(c++-mode . ,(rx (or (: line-start (one-or-more (in "A-Za-z0-9_")))
(or ".h" ".hpp" ".hxx" ".hh"))
line-end))
(objc-mode . ,(rx ".h" line-end))
)
"Assoc list of supported major modes and associated header file names.")
(defun call-if-function (path)
"If PATH is bound to a function, return the result of calling it.
Otherwise just return the value."
(if (functionp path)
(funcall path)
path))
(defun company-c-headers--candidates-for (prefix dir)
"Return a list of candidates for PREFIX in directory DIR.
Filters on the appropriate regex for the current major mode."
(let* ((delim (substring prefix 0 1))
(fileprefix (substring prefix 1))
(prefixdir (file-name-directory fileprefix))
(subdir (and prefixdir (concat (file-name-as-directory dir) prefixdir)))
(hdrs (cdr (assoc major-mode company-c-headers-modes)))
candidates)
;; If we need to complete inside a subdirectory, use that
(when (and subdir (file-directory-p subdir))
(setq dir subdir)
(setq fileprefix (file-name-nondirectory fileprefix))
(setq delim (concat delim prefixdir))
)
;; Using a list of completions for this directory, remove those that a) don't match the
;; headers regexp, and b) are not directories (except for "." and ".." which ARE removed)
(setq candidates (cl-remove-if
(lambda (F) (and (not (string-match-p hdrs F))
(or (cl-member (directory-file-name F) '("." "..") :test 'equal)
(not (file-directory-p (concat (file-name-as-directory dir) F))))))
(file-name-all-completions fileprefix dir)))
;; We want to see candidates in alphabetical order per directory
(setq candidates (sort candidates #'string<))
;; Add the delimiter and metadata
(mapcar (lambda (C) (propertize (concat delim C) 'directory dir)) candidates)
))
(defun company-c-headers--candidates (prefix)
"Return candidates for PREFIX."
(let ((p (if (equal (aref prefix 0) ?\")
(call-if-function company-c-headers-path-user)
(call-if-function company-c-headers-path-system)))
(next (when (equal (aref prefix 0) ?\")
(call-if-function company-c-headers-path-system)))
candidates)
(while p
(when (file-directory-p (car p))
(setq candidates (append candidates (company-c-headers--candidates-for prefix (car p)))))
(setq p (or (cdr p)
(let ((tmp next))
(setq next nil)
tmp)))
)
candidates
))
(defun company-c-headers--meta (candidate)
"Return the metadata associated with CANDIDATE. Currently just the directory."
(get-text-property 0 'directory candidate))
(defun company-c-headers--location (candidate)
"Return the location associated with CANDIDATE."
(cons (concat (file-name-as-directory (get-text-property 0 'directory candidate))
(file-name-nondirectory (substring candidate 1)))
1))
;;;###autoload
(defun company-c-headers (command &optional arg &rest ignored)
"Company backend for C/C++ header files."
(interactive (list 'interactive))
(pcase command
(`interactive (company-begin-backend 'company-c-headers))
(`prefix
(when (and (assoc major-mode company-c-headers-modes)
(looking-back company-c-headers-include-declaration (line-beginning-position)))
(match-string-no-properties 1)))
(`sorted t)
(`candidates (company-c-headers--candidates arg))
(`meta (company-c-headers--meta arg))
(`location (company-c-headers--location arg))
(`post-completion
(when (looking-back company-c-headers-include-declaration (line-beginning-position))
(let ((matched (match-string-no-properties 1)))
;; Add a terminating delimiter unless we've completed a directory name
;; If pre-existing terminating delimiter already exist, move cursor
;; to end of line.
(unless (equal matched (file-name-as-directory matched))
(pcase (aref matched 0)
(?\" (if (looking-at "\"") (end-of-line) (insert "\"")))
(?< (if (looking-at ">") (end-of-line) (insert ">"))))))))
))
(provide 'company-c-headers)
;;; company-c-headers.el ends here

View File

@ -0,0 +1,31 @@
;;; company-quickhelp-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company-quickhelp" "company-quickhelp.el"
;;;;;; (22297 53348 410925 167000))
;;; Generated autoloads from company-quickhelp.el
(defvar company-quickhelp-mode nil "\
Non-nil if Company-Quickhelp mode is enabled.
See the command `company-quickhelp-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 `company-quickhelp-mode'.")
(custom-autoload 'company-quickhelp-mode "company-quickhelp" nil)
(autoload 'company-quickhelp-mode "company-quickhelp" "\
Provides documentation popups for `company-mode' using `pos-tip'.
\(fn &optional ARG)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; company-quickhelp-autoloads.el ends here

View File

@ -0,0 +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"))

View File

@ -0,0 +1,210 @@
;;; company-quickhelp.el --- Popup documentation for completion candidates
;; Copyright (C) 2015, Lars Andersen
;; Author: Lars Andersen <expez@expez.com>
;; URL: https://www.github.com/expez/company-quickhelp
;; Package-Version: 20160211.718
;; Keywords: company popup documentation quickhelp
;; Version: 1.3.0
;; Package-Requires: ((emacs "24.4") (company "0.8.9") (pos-tip "0.4.6"))
;; This file is not part of GNU Emacs.
;; 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:
;; When idling on a completion candidate the documentation for the
;; candidate will pop up after `company-quickhelp-idle-delay' seconds.
;;; Usage:
;; put (company-quickhelp-mode 1) in you init.el to activate
;; `company-quickhelp-mode'.
;; You can adjust the time it takes for the documentation to pop up by
;; changing `company-quickhelp-delay'
;;; Code:
(require 'company)
(require 'pos-tip)
(require 'cl-lib)
(defgroup company-quickhelp nil
"Documentation popups for `company-mode'"
:group 'company)
(defcustom company-quickhelp-delay 0.5
"Delay, in seconds, before the quickhelp popup appears.
If set to nil the popup won't automatically appear, but can still
be triggered manually using `company-quickhelp-show'."
:type '(choice (number :tag "Delay in seconds")
(const :tag "Don't popup help automatically" nil))
:group 'company-quickhelp)
(defcustom company-quickhelp-max-lines nil
"When not NIL, limits the number of lines in the popup."
:type '(choice (integer :tag "Max lines to show in popup")
(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.")
(defvar company-quickhelp--original-tooltip-width company-tooltip-minimum-width
"The documentation popup breaks inexplicably when we transition
from a large pseudo-tooltip to a small one. We solve this by
overriding `company-tooltip-minimum-width' and save the
original value here so we can restore it.")
(defun company-quickhelp-frontend (command)
"`company-mode' front-end showing documentation in a `pos-tip' popup."
(pcase command
(`post-command (when company-quickhelp-delay
(company-quickhelp--set-timer)))
(`hide
(when company-quickhelp-delay
(company-quickhelp--cancel-timer))
(pos-tip-hide))))
(defun company-quickhelp--doc-and-meta (doc)
;; The company backend can either return a buffer with the doc or a
;; cons containing the doc buffer and a position at which to start
;; reading.
(let ((doc-buffer (if (consp doc) (car doc) doc))
(doc-begin (when (consp doc) (cdr doc))))
(with-current-buffer doc-buffer
(let ((truncated t))
(goto-char (or doc-begin (point-min)))
(if company-quickhelp-max-lines
(forward-line company-quickhelp-max-lines)
(goto-char (point-max)))
(beginning-of-line)
(when (= (line-number-at-pos)
(save-excursion (goto-char (point-max)) (line-number-at-pos)))
(setq truncated nil))
(while (and (not (= (line-number-at-pos) 1))
(or
;; [back] appears at the end of the help elisp help buffer
(looking-at-p "\\[back\\]")
;; [source] cider's help buffer contains a link to source
(looking-at-p "\\[source\\]")
(looking-at-p "^\\s-*$")))
(forward-line -1))
(list :doc (buffer-substring-no-properties (point-min) (point-at-eol))
:truncated truncated)))))
(defun company-quickhelp--completing-read (prompt candidates &rest rest)
"`cider', and probably other libraries, prompt the user to
resolve ambiguous documentation requests. Instead of failing we
just grab the first candidate and press forward."
(car candidates))
(defun company-quickhelp--doc (selected)
(cl-letf (((symbol-function 'completing-read)
#'company-quickhelp--completing-read))
(let* ((doc (company-call-backend 'doc-buffer selected))
(doc-and-meta (when doc
(company-quickhelp--doc-and-meta doc)))
(truncated (plist-get doc-and-meta :truncated))
(doc (plist-get doc-and-meta :doc)))
(unless (string= doc "")
(if truncated
(concat doc "\n\n[...]")
doc)))))
(defun company-quickhelp-manual-begin ()
"Manually trigger the `company-quickhelp' popup for the
currently active `company' completion candidate."
(interactive)
;; This might seem a bit roundabout, but when I attempted to call
;; `company-quickhelp--show' in a more direct manner it triggered a
;; redisplay of company's list of completion candidates which looked
;; quite weird.
(let ((company-quickhelp-delay 0.01))
(company-quickhelp--set-timer)))
(defun company-quickhelp--show ()
(company-quickhelp--ensure-compatibility)
(company-quickhelp--cancel-timer)
(let* ((selected (nth company-selection company-candidates))
(doc (company-quickhelp--doc selected))
(ovl company-pseudo-tooltip-overlay)
(overlay-width (* (frame-char-width)
(if ovl (overlay-get ovl 'company-width) 0)))
(overlay-position (* (frame-char-width)
(- (if ovl (overlay-get ovl 'company-column) 1) 1)))
(x-gtk-use-system-tooltips nil))
(when (and ovl doc)
(with-no-warnings
(pos-tip-show doc nil (overlay-start ovl) nil 300 80 nil
(+ overlay-width overlay-position) 1)))))
(defun company-quickhelp--set-timer ()
(when (null company-quickhelp--timer)
(setq company-quickhelp--timer
(run-with-idle-timer company-quickhelp-delay nil
'company-quickhelp--show))))
(defun company-quickhelp--cancel-timer ()
(when (timerp company-quickhelp--timer)
(cancel-timer company-quickhelp--timer)
(setq company-quickhelp--timer nil)))
(defun company-quickhelp-hide ()
(company-cancel))
(defun company-quickhelp--ensure-compatibility ()
;; Originally this code was in `company-quickhelp-enable' but that
;; caused trouble for --daemon users reported in #16.
(cond
((or (not (fboundp 'x-hide-tip))
(not (fboundp 'x-show-tip)))
(user-error "Company-quickhelp doesn't work on your system.
Most likely this means you're on a mac with an Emacs build using Cocoa instead of X"))
((or (null window-system)
(eq window-system 'pc))
(user-error "Company-quickhelp doesn't work in the terminal"))))
(defun company-quickhelp--enable ()
(add-hook 'focus-out-hook #'company-quickhelp-hide)
(setq company-quickhelp--original-tooltip-width company-tooltip-minimum-width
company-tooltip-minimum-width (max company-tooltip-minimum-width 40))
(add-to-list 'company-frontends 'company-quickhelp-frontend :append))
(defun company-quickhelp--disable ()
(remove-hook 'focus-out-hook #'company-quickhelp-hide)
(company-quickhelp--cancel-timer)
(setq company-tooltip-minimum-width company-quickhelp--original-tooltip-width
company-frontends
(delq 'company-quickhelp-frontend company-frontends)))
;;;###autoload
(define-minor-mode company-quickhelp-mode
"Provides documentation popups for `company-mode' using `pos-tip'."
:global t :keymap company-quickhelp-mode-map
(if company-quickhelp-mode
(company-quickhelp--enable)
(company-quickhelp--disable)))
(provide 'company-quickhelp)
;;; company-quickhelp.el ends here

View File

@ -0,0 +1,32 @@
;;; company-shell-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "company-shell" "company-shell.el" (22297 53347
;;;;;; 354924 555000))
;;; Generated autoloads from company-shell.el
(autoload 'company-shell-rebuild-cache "company-shell" "\
Builds the cache of all completions found on the $PATH and all fish functions.
\(fn)" t nil)
(autoload 'company-fish-shell "company-shell" "\
Company backend for fish shell functions.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(autoload 'company-shell "company-shell" "\
Company mode backend for binaries found on the $PATH.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; company-shell-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "company-shell" "20160212.1139" "Company mode backend for shell functions" '((company "0.8.12") (dash "2.12.0") (cl-lib "0.5")) :url "https://github.com/Alexander-Miller/company-shell" :keywords '("company" "shell"))

View File

@ -0,0 +1,181 @@
;;; company-shell.el --- Company mode backend for shell functions
;; Copyright (C) 2015 Alexander Miller
;; Author: Alexander Miller <alexanderm@web.de>
;; Package-Requires: ((company "0.8.12") (dash "2.12.0") (cl-lib "0.5"))
;; Homepage: https://github.com/Alexander-Miller/company-shell
;; Version: 1.0
;; Package-Version: 20160212.1139
;; Keywords: company, shell
;; 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:
;; Backend for company mode to complete binaries found on your $PATH
;; and fish shell functions.
;;; Code:
(require 'company)
(require 'dash)
(require 'cl-lib)
(defvar company-shell--cache nil
"Cache of all possible $PATH completions. Automatically built when nil. Invoke `company-shell-rebuild-cache' to rebuild manually.")
(defvar company-shell--fish-cache nil
"Cache of all possible fish shell function completions. Automatically built when nil. Invoke `company-shell-rebuild-cache' to rebuild manually.")
(defvar company-shell-delete-duplicates t
"If non-nil the list of completions will be purged of duplicates. Duplicates in this context means any two
string-equal entries, regardless where they have been found. This would prevent a completion candidate
appearing twice because it is found in both /usr/bin/ and /usr/local/bin.
For a change to this variable to take effect the cache needs to be rebuilt via `company-shell-rebuild-cache'.")
(defvar company-shell-modes '(sh-mode fish-mode shell-mode eshell-mode)
"List of major modes where `company-shell' will be providing completions if it is part of `company-backends'.
All modes not on this list will be ignored. Set value to nil to enable company-shell regardless of current major-mode.")
(defvar company-fish-shell-modes '(fish-mode shell-mode)
"List of major modes where `company-fish-shell' will be providing completions if it is part of `company-backends'.
All modes not on this list will be ignored. Set value to nil to enable company-fish-shell regardless of current major-mode.")
(defvar company-shell-use-help-arg nil
"SETTING THIS TO t IS POTENTIALLY UNSAFE.
If non-nil company-(fish)-shell will try and find a doc-string by running `arg --help'
if `man arg' did not produce any valid results. This is not completely safe since
company-shell does not and can not know whether it is safe to run a command in this
fashion. Some applications may simply ignore or misinterpret the command flag, with
unpredictable results. Usually this just means that instead of any actual documentation
you'll see an error message telling you the program doesn't know what to do with the
--help arg or that it was started with invalid input. In rare cases a program may simple
ignore the --help arg and directly spawn a GUI like xfce4-notes-settings does.
To mitigate any such issues company-shell will run the --help attempt on a timer of
1 second. This is more than enough to fetch the doc output if it is available, but will
quickly close any process that may accidentally have been spawned. In addition the command
will run in a restricted shell (via $(which sh) --restricted) to further avoid any unwanted
side effects.
Despite these precautions company-shell will nonetheless need to sometimes run completely unknown
binaries, which is why this option is turned off by default. You need to consciously enable
it in the understanding that you do this AT YOUR OWN RISK.")
(defun company-shell--fetch-candidates ()
(unless company-shell--cache (company-shell--build-cache))
company-shell--cache)
(defun company-shell--fetch-fish-candidates ()
(unless company-shell--fish-cache (company-shell--build-fish-cache))
company-shell--fish-cache)
(defun company-shell--build-cache ()
(let ((completions (-mapcat
(lambda (dir)
(-map
(lambda (file) (propertize file 'origin dir))
(directory-files dir)))
(-filter 'file-readable-p exec-path))))
(setq company-shell--cache (sort
(if company-shell-delete-duplicates
(delete-dups completions)
completions)
'string-lessp))))
(defun company-shell--build-fish-cache ()
(when (executable-find "fish")
(setq company-shell--fish-cache
(-> (shell-command-to-string "fish -c \"functions -a\"")
(split-string "\n")
(sort 'string-lessp)))))
(defun company-shell--prefix (mode-list)
(when (or (null mode-list)
(-contains? mode-list major-mode))
(company-grab-symbol)))
(defun company-shell--doc-buffer (arg)
(company-doc-buffer
(let ((man-page (shell-command-to-string (format "man %s" arg))))
(if (or
(null man-page)
(string= man-page "")
(string-prefix-p "No manual entry" man-page))
(company-shell--help-page arg)
man-page))))
(defun company-shell--help-page (arg)
(when company-shell-use-help-arg
(shell-command-to-string
(format "echo \"timeout 1 %s --help\" | %s --restricted"
arg
(string-trim (shell-command-to-string "which sh"))))))
(defun company-shell--meta-string (arg)
(-some-> (format "whatis %s" arg)
(shell-command-to-string)
(split-string "\n")
(first)
(split-string " - ")
(second)))
;;;###autoload
(defun company-shell-rebuild-cache ()
"Builds the cache of all completions found on the $PATH and all fish functions."
(interactive)
(company-shell--build-cache)
(company-shell--build-fish-cache))
;;;###autoload
(defun company-fish-shell (command &optional arg &rest ignored)
"Company backend for fish shell functions."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-fish-shell))
(prefix (company-shell--prefix company-fish-shell-modes))
(sorted t)
(duplicates nil)
(ignore-case nil)
(no-cache nil)
(annotation "Fish Function")
(doc-buffer (company-shell--doc-buffer arg))
(meta (company-shell--meta-string arg))
(candidates (cl-remove-if-not
(lambda (candidate) (string-prefix-p arg candidate))
(company-shell--fetch-fish-candidates)))))
;;;###autoload
(defun company-shell (command &optional arg &rest ignored)
"Company mode backend for binaries found on the $PATH."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-shell))
(prefix (company-shell--prefix company-shell-modes))
(sorted t)
(duplicates nil)
(ignore-case nil)
(no-cache nil)
(annotation (get-text-property 0 'origin arg))
(doc-buffer (company-shell--doc-buffer arg))
(meta (company-shell--meta-string arg))
(candidates (cl-remove-if-not
(lambda (candidate) (string-prefix-p arg candidate))
(company-shell--fetch-candidates)))))
(provide 'company-shell)
;;; company-shell.el ends here

View File

@ -0,0 +1,15 @@
;;; epl-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil nil ("epl.el") (22297 53343 513795 651000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; epl-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "epl" "20150517.433" "Emacs Package Library" '((cl-lib "0.3")) :url "http://github.com/cask/epl" :keywords '("convenience"))

View File

@ -0,0 +1,695 @@
;;; epl.el --- Emacs Package Library -*- lexical-binding: t; -*-
;; Copyright (C) 2013-2015 Sebastian Wiesner
;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2015 Free Software
;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
;; Maintainer: Johan Andersson <johan.rejeep@gmail.com>
;; Sebastian Wiesner <swiesner@lunaryorn.com>
;; Version: 0.9-cvs
;; Package-Version: 20150517.433
;; Package-Requires: ((cl-lib "0.3"))
;; Keywords: convenience
;; URL: http://github.com/cask/epl
;; This file is NOT part of GNU Emacs.
;; 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:
;; A package management library for Emacs, based on package.el.
;; The purpose of this library is to wrap all the quirks and hassle of
;; package.el into a sane API.
;; The following functions comprise the public interface of this library:
;;; Package directory selection
;; `epl-package-dir' gets the directory of packages.
;; `epl-default-package-dir' gets the default package directory.
;; `epl-change-package-dir' changes the directory of packages.
;;; Package system management
;; `epl-initialize' initializes the package system and activates all
;; packages.
;; `epl-reset' resets the package system.
;; `epl-refresh' refreshes all package archives.
;; `epl-add-archive' adds a new package archive.
;;; Package objects
;; Struct `epl-requirement' describes a requirement of a package with `name' and
;; `version' slots.
;; `epl-requirement-version-string' gets a requirement version as string.
;; Struct `epl-package' describes an installed or installable package with a
;; `name' and some internal `description'.
;; `epl-package-version' gets the version of a package.
;; `epl-package-version-string' gets the version of a package as string.
;; `epl-package-summary' gets the summary of a package.
;; `epl-package-requirements' gets the requirements of a package.
;; `epl-package-directory' gets the installation directory of a package.
;; `epl-package-from-buffer' creates a package object for the package contained
;; in the current buffer.
;; `epl-package-from-file' creates a package object for a package file, either
;; plain lisp or tarball.
;; `epl-package-from-descriptor-file' creates a package object for a package
;; description (i.e. *-pkg.el) file.
;;; Package database access
;; `epl-package-installed-p' determines whether a package is installed, either
;; built-in or explicitly installed.
;; `epl-package-outdated-p' determines whether a package is outdated, that is,
;; whether a package with a higher version number is available.
;; `epl-built-in-packages', `epl-installed-packages', `epl-outdated-packages'
;; and `epl-available-packages' get all packages built-in, installed, outdated,
;; or available for installation respectively.
;; `epl-find-built-in-package', `epl-find-installed-packages' and
;; `epl-find-available-packages' find built-in, installed and available packages
;; by name.
;; `epl-find-upgrades' finds all upgradable packages.
;; `epl-built-in-p' return true if package is built-in to Emacs.
;;; Package operations
;; `epl-install-file' installs a package file.
;; `epl-package-install' installs a package.
;; `epl-package-delete' deletes a package.
;; `epl-upgrade' upgrades packages.
;;; Code:
(require 'cl-lib)
(require 'package)
(unless (fboundp #'define-error)
;; `define-error' for 24.3 and earlier, copied from subr.el
(defun define-error (name message &optional parent)
"Define NAME as a new error signal.
MESSAGE is a string that will be output to the echo area if such an error
is signaled without being caught by a `condition-case'.
PARENT is either a signal or a list of signals from which it inherits.
Defaults to `error'."
(unless parent (setq parent 'error))
(let ((conditions
(if (consp parent)
(apply #'append
(mapcar (lambda (parent)
(cons parent
(or (get parent 'error-conditions)
(error "Unknown signal `%s'" parent))))
parent))
(cons parent (get parent 'error-conditions)))))
(put name 'error-conditions
(delete-dups (copy-sequence (cons name conditions))))
(when message (put name 'error-message message)))))
(defsubst epl--package-desc-p (package)
"Whether PACKAGE is a `package-desc' object.
Like `package-desc-p', but return nil, if `package-desc-p' is not
defined as function."
(and (fboundp 'package-desc-p) (package-desc-p package)))
;;; EPL errors
(define-error 'epl-error "EPL error")
(define-error 'epl-invalid-package "Invalid EPL package" 'epl-error)
(define-error 'epl-invalid-package-file "Invalid EPL package file"
'epl-invalid-package)
;;; Package directory
(defun epl-package-dir ()
"Get the directory of packages."
package-user-dir)
(defun epl-default-package-dir ()
"Get the default directory of packages."
(eval (car (get 'package-user-dir 'standard-value))))
(defun epl-change-package-dir (directory)
"Change the directory of packages to DIRECTORY."
(setq package-user-dir directory)
(epl-initialize))
;;; Package system management
(defvar epl--load-path-before-initialize nil
"Remember the load path for `epl-reset'.")
(defun epl-initialize (&optional no-activate)
"Load Emacs Lisp packages and activate them.
With NO-ACTIVATE non-nil, do not activate packages."
(setq epl--load-path-before-initialize load-path)
(package-initialize no-activate))
(defalias 'epl-refresh 'package-refresh-contents)
(defun epl-add-archive (name url)
"Add a package archive with NAME and URL."
(add-to-list 'package-archives (cons name url)))
(defun epl-reset ()
"Reset the package system.
Clear the list of installed and available packages, the list of
package archives and reset the package directory."
(setq package-alist nil
package-archives nil
package-archive-contents nil
load-path epl--load-path-before-initialize)
(when (boundp 'package-obsolete-alist) ; Legacy package.el
(setq package-obsolete-alist nil))
(epl-change-package-dir (epl-default-package-dir)))
;;; Package structures
(cl-defstruct (epl-requirement
(:constructor epl-requirement-create))
"Structure describing a requirement.
Slots:
`name' The name of the required package, as symbol.
`version' The version of the required package, as version list."
name
version)
(defun epl-requirement-version-string (requirement)
"The version of a REQUIREMENT, as string."
(package-version-join (epl-requirement-version requirement)))
(cl-defstruct (epl-package (:constructor epl-package-create))
"Structure representing a package.
Slots:
`name' The package name, as symbol.
`description' The package description.
The format package description varies between package.el
variants. For `package-desc' variants, it is simply the
corresponding `package-desc' object. For legacy variants, it is
a vector `[VERSION REQS DOCSTRING]'.
Do not access `description' directly, but instead use the
`epl-package' accessors."
name
description)
(defmacro epl-package-as-description (var &rest body)
"Cast VAR to a package description in BODY.
VAR is a symbol, bound to an `epl-package' object. This macro
casts this object to the `description' object, and binds the
description to VAR in BODY."
(declare (indent 1))
(unless (symbolp var)
(signal 'wrong-type-argument (list #'symbolp var)))
`(if (epl-package-p ,var)
(let ((,var (epl-package-description ,var)))
,@body)
(signal 'wrong-type-argument (list #'epl-package-p ,var))))
(defsubst epl-package--package-desc-p (package)
"Whether the description of PACKAGE is a `package-desc'."
(epl--package-desc-p (epl-package-description package)))
(defun epl-package-version (package)
"Get the version of PACKAGE, as version list."
(epl-package-as-description package
(cond
((fboundp 'package-desc-version) (package-desc-version package))
;; Legacy
((fboundp 'package-desc-vers)
(let ((version (package-desc-vers package)))
(if (listp version) version (version-to-list version))))
(:else (error "Cannot get version from %S" package)))))
(defun epl-package-version-string (package)
"Get the version from a PACKAGE, as string."
(package-version-join (epl-package-version package)))
(defun epl-package-summary (package)
"Get the summary of PACKAGE, as string."
(epl-package-as-description package
(cond
((fboundp 'package-desc-summary) (package-desc-summary package))
((fboundp 'package-desc-doc) (package-desc-doc package)) ; Legacy
(:else (error "Cannot get summary from %S" package)))))
(defsubst epl-requirement--from-req (req)
"Create a `epl-requirement' from a `package-desc' REQ."
(let ((version (cadr req)))
(epl-requirement-create :name (car req)
:version (if (listp version) version
(version-to-list version)))))
(defun epl-package-requirements (package)
"Get the requirements of PACKAGE.
The requirements are a list of `epl-requirement' objects."
(epl-package-as-description package
(mapcar #'epl-requirement--from-req (package-desc-reqs package))))
(defun epl-package-directory (package)
"Get the directory PACKAGE is installed to.
Return the absolute path of the installation directory of
PACKAGE, or nil, if PACKAGE is not installed."
(cond
((fboundp 'package-desc-dir)
(package-desc-dir (epl-package-description package)))
((fboundp 'package--dir)
(package--dir (symbol-name (epl-package-name package))
(epl-package-version-string package)))
(:else (error "Cannot get package directory from %S" package))))
(defun epl-package-->= (pkg1 pkg2)
"Determine whether PKG1 is before PKG2 by version."
(not (version-list-< (epl-package-version pkg1)
(epl-package-version pkg2))))
(defun epl-package--from-package-desc (package-desc)
"Create an `epl-package' from a PACKAGE-DESC.
PACKAGE-DESC is a `package-desc' object, from recent package.el
variants."
(if (and (fboundp 'package-desc-name)
(epl--package-desc-p package-desc))
(epl-package-create :name (package-desc-name package-desc)
:description package-desc)
(signal 'wrong-type-argument (list 'epl--package-desc-p package-desc))))
(defun epl-package--parse-info (info)
"Parse a package.el INFO."
(if (epl--package-desc-p info)
(epl-package--from-package-desc info)
;; For legacy package.el, info is a vector [NAME REQUIRES DESCRIPTION
;; VERSION COMMENTARY]. We need to re-shape this vector into the
;; `package-alist' format [VERSION REQUIRES DESCRIPTION] to attach it to the
;; new `epl-package'.
(let ((name (intern (aref info 0)))
(info (vector (aref info 3) (aref info 1) (aref info 2))))
(epl-package-create :name name :description info))))
(defun epl-package-from-buffer (&optional buffer)
"Create an `epl-package' object from BUFFER.
BUFFER defaults to the current buffer.
Signal `epl-invalid-package' if the buffer does not contain a
valid package file."
(let ((info (with-current-buffer (or buffer (current-buffer))
(condition-case err
(package-buffer-info)
(error (signal 'epl-invalid-package (cdr err)))))))
(epl-package--parse-info info)))
(defun epl-package-from-lisp-file (file-name)
"Parse the package headers the file at FILE-NAME.
Return an `epl-package' object with the header metadata."
(with-temp-buffer
(insert-file-contents file-name)
(condition-case err
(epl-package-from-buffer (current-buffer))
;; Attach file names to invalid package errors
(epl-invalid-package
(signal 'epl-invalid-package-file (cons file-name (cdr err))))
;; Forward other errors
(error (signal (car err) (cdr err))))))
(defun epl-package-from-tar-file (file-name)
"Parse the package tarball at FILE-NAME.
Return a `epl-package' object with the meta data of the tarball
package in FILE-NAME."
(condition-case nil
;; In legacy package.el, `package-tar-file-info' takes the name of the tar
;; file to parse as argument. In modern package.el, it has no arguments
;; and works on the current buffer. Hence, we just try to call the legacy
;; version, and if that fails because of a mismatch between formal and
;; actual arguments, we use the modern approach. To avoid spurious
;; signature warnings by the byte compiler, we suppress warnings when
;; calling the function.
(epl-package--parse-info (with-no-warnings
(package-tar-file-info file-name)))
(wrong-number-of-arguments
(with-temp-buffer
(insert-file-contents-literally file-name)
;; Switch to `tar-mode' to enable extraction of the file. Modern
;; `package-tar-file-info' relies on `tar-mode', and signals an error if
;; called in a buffer with a different mode.
(tar-mode)
(epl-package--parse-info (with-no-warnings
(package-tar-file-info)))))))
(defun epl-package-from-file (file-name)
"Parse the package at FILE-NAME.
Return an `epl-package' object with the meta data of the package
at FILE-NAME."
(if (string-match-p (rx ".tar" string-end) file-name)
(epl-package-from-tar-file file-name)
(epl-package-from-lisp-file file-name)))
(defun epl-package--parse-descriptor-requirement (requirement)
"Parse a REQUIREMENT in a package descriptor."
;; This function is only called on legacy package.el. On package-desc
;; package.el, we just let package.el do the work.
(cl-destructuring-bind (name version-string) requirement
(list name (version-to-list version-string))))
(defun epl-package-from-descriptor-file (descriptor-file)
"Load a `epl-package' from a package DESCRIPTOR-FILE.
A package descriptor is a file defining a new package. Its name
typically ends with -pkg.el."
(with-temp-buffer
(insert-file-contents descriptor-file)
(goto-char (point-min))
(let ((sexp (read (current-buffer))))
(unless (eq (car sexp) 'define-package)
(error "%S is no valid package descriptor" descriptor-file))
(if (and (fboundp 'package-desc-from-define)
(fboundp 'package-desc-name))
;; In Emacs snapshot, we can conveniently call a function to parse the
;; descriptor
(let ((desc (apply #'package-desc-from-define (cdr sexp))))
(epl-package-create :name (package-desc-name desc)
:description desc))
;; In legacy package.el, we must manually deconstruct the descriptor,
;; because the load function has eval's the descriptor and has a lot of
;; global side-effects.
(cl-destructuring-bind
(name version-string summary requirements) (cdr sexp)
(epl-package-create
:name (intern name)
:description
(vector (version-to-list version-string)
(mapcar #'epl-package--parse-descriptor-requirement
;; Strip the leading `quote' from the package list
(cadr requirements))
summary)))))))
;;; Package database access
(defun epl-package-installed-p (package)
"Determine whether a PACKAGE is installed.
PACKAGE is either a package name as symbol, or a package object."
(let ((name (if (epl-package-p package)
(epl-package-name package)
package))
(version (when (epl-package-p package)
(epl-package-version package))))
(package-installed-p name version)))
(defun epl--parse-built-in-entry (entry)
"Parse an ENTRY from the list of built-in packages.
Return the corresponding `epl-package' object."
(if (fboundp 'package--from-builtin)
;; In package-desc package.el, convert the built-in package to a
;; `package-desc' and convert that to an `epl-package'
(epl-package--from-package-desc (package--from-builtin entry))
(epl-package-create :name (car entry) :description (cdr entry))))
(defun epl-built-in-packages ()
"Get all built-in packages.
Return a list of `epl-package' objects."
;; This looks mighty strange, but it's the only way to force package.el to
;; build the list of built-in packages. Without this, `package--builtins'
;; might be empty.
(package-built-in-p 'foo)
(mapcar #'epl--parse-built-in-entry package--builtins))
(defun epl-find-built-in-package (name)
"Find a built-in package with NAME.
NAME is a package name, as symbol.
Return the built-in package as `epl-package' object, or nil if
there is no built-in package with NAME."
(when (package-built-in-p name)
;; We must call `package-built-in-p' *before* inspecting
;; `package--builtins', because otherwise `package--builtins' might be
;; empty.
(epl--parse-built-in-entry (assq name package--builtins))))
(defun epl-package-outdated-p (package)
"Determine whether a PACKAGE is outdated.
A package is outdated, if there is an available package with a
higher version.
PACKAGE is either a package name as symbol, or a package object.
In the former case, test the installed or built-in package with
the highest version number, in the later case, test the package
object itself.
Return t, if the package is outdated, or nil otherwise."
(let* ((package (if (epl-package-p package)
package
(or (car (epl-find-installed-packages package))
(epl-find-built-in-package package))))
(available (car (epl-find-available-packages
(epl-package-name package)))))
(and package available (version-list-< (epl-package-version package)
(epl-package-version available)))))
(defun epl--parse-package-list-entry (entry)
"Parse a list of packages from ENTRY.
ENTRY is a single entry in a package list, e.g. `package-alist',
`package-archive-contents', etc. Typically it is a cons cell,
but the exact format varies between package.el versions. This
function tries to parse all known variants.
Return a list of `epl-package' objects parsed from ENTRY."
(let ((descriptions (cdr entry)))
(cond
((listp descriptions)
(sort (mapcar #'epl-package--from-package-desc descriptions)
#'epl-package-->=))
;; Legacy package.el has just a single package in an entry, which is a
;; standard description vector
((vectorp descriptions)
(list (epl-package-create :name (car entry)
:description descriptions)))
(:else (error "Cannot parse entry %S" entry)))))
(defun epl-installed-packages ()
"Get all installed packages.
Return a list of package objects."
(apply #'append (mapcar #'epl--parse-package-list-entry package-alist)))
(defsubst epl--filter-outdated-packages (packages)
"Filter outdated packages from PACKAGES."
(let (res)
(dolist (package packages)
(when (epl-package-outdated-p package)
(push package res)))
(nreverse res)))
(defun epl-outdated-packages ()
"Get all outdated packages, as in `epl-package-outdated-p'.
Return a list of package objects."
(epl--filter-outdated-packages (epl-installed-packages)))
(defsubst epl--find-package-in-list (name list)
"Find a package by NAME in a package LIST.
Return a list of corresponding `epl-package' objects."
(let ((entry (assq name list)))
(when entry
(epl--parse-package-list-entry entry))))
(defun epl-find-installed-package (name)
"Find the latest installed package by NAME.
NAME is a package name, as symbol.
Return the installed package with the highest version number as
`epl-package' object, or nil, if no package with NAME is
installed."
(car (epl-find-installed-packages name)))
(make-obsolete 'epl-find-installed-package 'epl-find-installed-packages "0.7")
(defun epl-find-installed-packages (name)
"Find all installed packages by NAME.
NAME is a package name, as symbol.
Return a list of all installed packages with NAME, sorted by
version number in descending order. Return nil, if there are no
packages with NAME."
(epl--find-package-in-list name package-alist))
(defun epl-available-packages ()
"Get all packages available for installation.
Return a list of package objects."
(apply #'append (mapcar #'epl--parse-package-list-entry
package-archive-contents)))
(defun epl-find-available-packages (name)
"Find available packages for NAME.
NAME is a package name, as symbol.
Return a list of available packages for NAME, sorted by version
number in descending order. Return nil, if there are no packages
for NAME."
(epl--find-package-in-list name package-archive-contents))
(cl-defstruct (epl-upgrade
(:constructor epl-upgrade-create))
"Structure describing an upgradable package.
Slots:
`installed' The installed package
`available' The package available for installation."
installed
available)
(defun epl-find-upgrades (&optional packages)
"Find all upgradable PACKAGES.
PACKAGES is a list of package objects to upgrade, defaulting to
all installed packages.
Return a list of `epl-upgrade' objects describing all upgradable
packages."
(let ((packages (or packages (epl-installed-packages)))
upgrades)
(dolist (pkg packages)
(let* ((version (epl-package-version pkg))
(name (epl-package-name pkg))
;; Find the latest available package for NAME
(available-pkg (car (epl-find-available-packages name)))
(available-version (when available-pkg
(epl-package-version available-pkg))))
(when (and available-version (version-list-< version available-version))
(push (epl-upgrade-create :installed pkg
:available available-pkg)
upgrades))))
(nreverse upgrades)))
(defalias 'epl-built-in-p 'package-built-in-p)
;;; Package operations
(defalias 'epl-install-file 'package-install-file)
(defun epl-package-install (package &optional force)
"Install a PACKAGE.
PACKAGE is a `epl-package' object. If FORCE is given and
non-nil, install PACKAGE, even if it is already installed."
(when (or force (not (epl-package-installed-p package)))
(if (epl-package--package-desc-p package)
(package-install (epl-package-description package))
;; The legacy API installs by name. We have no control over versioning,
;; etc.
(package-install (epl-package-name package)))))
(defun epl-package-delete (package)
"Delete a PACKAGE.
PACKAGE is a `epl-package' object to delete."
;; package-delete allows for packages being trashed instead of fully deleted.
;; Let's prevent his silly behavior
(let ((delete-by-moving-to-trash nil))
;; The byte compiler will warn us that we are calling `package-delete' with
;; the wrong number of arguments, since it can't infer that we guarantee to
;; always call the correct version. Thus we suppress all warnings when
;; calling `package-delete'. I wish there was a more granular way to
;; disable just that specific warning, but it is what it is.
(if (epl-package--package-desc-p package)
(with-no-warnings
(package-delete (epl-package-description package)))
;; The legacy API deletes by name (as string!) and version instead by
;; descriptor. Hence `package-delete' takes two arguments. For some
;; insane reason, the arguments are strings here!
(let ((name (symbol-name (epl-package-name package)))
(version (epl-package-version-string package)))
(with-no-warnings
(package-delete name version))
;; Legacy package.el does not remove the deleted package
;; from the `package-alist', so we do it manually here.
(let ((pkg (assq (epl-package-name package) package-alist)))
(when pkg
(setq package-alist (delq pkg package-alist))))))))
(defun epl-upgrade (&optional packages preserve-obsolete)
"Upgrade PACKAGES.
PACKAGES is a list of package objects to upgrade, defaulting to
all installed packages.
The old versions of the updated packages are deleted, unless
PRESERVE-OBSOLETE is non-nil.
Return a list of all performed upgrades, as a list of
`epl-upgrade' objects."
(let ((upgrades (epl-find-upgrades packages)))
(dolist (upgrade upgrades)
(epl-package-install (epl-upgrade-available upgrade) 'force)
(unless preserve-obsolete
(epl-package-delete (epl-upgrade-installed upgrade))))
upgrades))
(provide 'epl)
;;; epl.el ends here

View File

@ -0,0 +1,75 @@
;;; helm-ag-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "helm-ag" "helm-ag.el" (22297 53346 754924
;;;;;; 211000))
;;; Generated autoloads from helm-ag.el
(autoload 'helm-ag-pop-stack "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-ag-clear-stack "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-ag-mode "helm-ag" "\
Major mode to provide actions in helm grep saved buffer.
Special commands:
\\{helm-ag-mode-map}
\(fn)" t nil)
(autoload 'helm-ag-this-file "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-ag "helm-ag" "\
\(fn &optional BASEDIR)" t nil)
(autoload 'helm-do-ag-this-file "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-do-ag "helm-ag" "\
\(fn &optional BASEDIR TARGETS)" t nil)
(autoload 'helm-ag-project-root "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-do-ag-project-root "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-ag-buffers "helm-ag" "\
\(fn)" t nil)
(autoload 'helm-do-ag-buffers "helm-ag" "\
\(fn)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; helm-ag-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "helm-ag" "20160411.417" "the silver searcher with helm interface" '((emacs "24.3") (helm "1.7.7")) :url "https://github.com/syohex/emacs-helm-ag")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
;;; helm-flyspell-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "helm-flyspell" "helm-flyspell.el" (22297 53346
;;;;;; 154923 870000))
;;; Generated autoloads from helm-flyspell.el
(autoload 'helm-flyspell-correct "helm-flyspell" "\
Use helm for flyspell correction.
Adapted from `flyspell-correct-word-before-point'.
\(fn)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; helm-flyspell-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "helm-flyspell" "20151026.912" "Helm extension for correcting words with flyspell" '((helm "1.6.5")))

View File

@ -0,0 +1,146 @@
;;; helm-flyspell.el --- Helm extension for correcting words with flyspell
;; Package-Version: 20151026.912
;; Copyright (C) 2014 Andrzej Pronobis <a.pronobis@gmail.com>
;; Package-Requires: ((helm "1.6.5"))
;; 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:
;; To use, just put your cursor on or after the misspelled word and
;; run helm-flyspell-correct. You can of course bind it to a key as
;; well by adding this to your `~/.emacs` file:
;; (define-key flyspell-mode-map (kbd "C-;") 'helm-flyspell-correct)
;;
;; When invoked, it will show the list of corrections suggested by
;; Flyspell and options to save the word in your personal dictionary
;; or accept it in the buffer or the session. If a pattern is typed,
;; it will be used to filter the corrections. It can also be directly
;; saved to the dictionary, even if it is different from the initial
;; word. The new typed word will also replace the word typed in the
;; buffer.
;;; Code:
;; For lexical-let
(eval-when-compile
(require 'cl))
;; Requires
(require 'helm)
(require 'flyspell)
(defun helm-flyspell--always-match (candidate)
"Return true for any CANDIDATE."
t
)
(defun helm-flyspell--option-candidates (word)
"Return a set of options for the given WORD."
(let ((opts (list (cons (format "Save \"%s\"" word) (cons 'save word))
(cons (format "Accept (session) \"%s\"" word) (cons 'session word))
(cons (format "Accept (buffer) \"%s\"" word) (cons 'buffer word)))))
(unless (string= helm-pattern "")
(setq opts (append opts (list (cons (format "Save \"%s\"" helm-pattern) (cons 'save helm-pattern))
(cons (format "Accept (session) \"%s\"" helm-pattern) (cons 'session helm-pattern))
(cons (format "Accept (buffer) \"%s\"" helm-pattern) (cons 'buffer helm-pattern))))))
opts
))
(defun helm-flyspell (candidates word)
"Run helm for the given CANDIDATES given by flyspell for the WORD.
Return a selected word to use as a replacement or
a tuple of (command, word) to be used by flyspell-do-correct."
(helm :sources (list (helm-build-sync-source (format "Suggestions for \"%s\" in dictionary \"%s\""
word (or ispell-local-dictionary
ispell-dictionary
"Default"))
:candidates candidates
:action 'identity
:candidate-number-limit 9999
:fuzzy-match t
)
(helm-build-sync-source "Options"
:candidates '(lambda ()
(lexical-let ((tmp word))
(helm-flyspell--option-candidates tmp)))
:action 'identity
:candidate-number-limit 9999
:match 'helm-flyspell--always-match
:volatile t
)
)
:buffer "*Helm Flyspell*"
:prompt "Correction: "))
;;;###autoload
(defun helm-flyspell-correct ()
"Use helm for flyspell correction.
Adapted from `flyspell-correct-word-before-point'."
(interactive)
;; use the correct dictionary
(flyspell-accept-buffer-local-defs)
(let ((cursor-location (point))
(word (flyspell-get-word))
(opoint (point)))
(if (consp word)
(let ((start (car (cdr word)))
(end (car (cdr (cdr word))))
(word (car word))
poss ispell-filter)
;; now check spelling of word.
(ispell-send-string "%\n") ;put in verbose mode
(ispell-send-string (concat "^" word "\n"))
;; wait until ispell has processed word
(while (progn
(accept-process-output ispell-process)
(not (string= "" (car ispell-filter)))))
;; Remove leading empty element
(setq ispell-filter (cdr ispell-filter))
;; ispell process should return something after word is sent.
;; Tag word as valid (i.e., skip) otherwise
(or ispell-filter
(setq ispell-filter '(*)))
(if (consp ispell-filter)
(setq poss (ispell-parse-output (car ispell-filter))))
(cond
((or (eq poss t) (stringp poss))
;; don't correct word
t)
((null poss)
;; ispell error
(error "Ispell: error in Ispell process"))
(t
;; The word is incorrect, we have to propose a replacement.
(let ((res (helm-flyspell (third poss) word)))
(cond ((stringp res)
(flyspell-do-correct res poss word cursor-location start end opoint))
(t
(let ((cmd (car res))
(wrd (cdr res)))
(if (string= wrd word)
(flyspell-do-correct cmd poss wrd cursor-location start end opoint)
(progn
(flyspell-do-correct cmd poss wrd cursor-location start end opoint)
(flyspell-do-correct wrd poss word cursor-location start end opoint)))))))))
(ispell-pdict-save t)))))
(provide 'helm-flyspell)
;;; helm-flyspell.el ends here

View File

@ -0,0 +1,39 @@
;;; helm-make-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "helm-make" "helm-make.el" (22297 53345 558923
;;;;;; 533000))
;;; Generated autoloads from helm-make.el
(autoload 'helm-make "helm-make" "\
Call \"make -j ARG target\". Target is selected with completion.
\(fn &optional ARG)" t nil)
(autoload 'helm-make-reset-cache "helm-make" "\
Reset cache, see `helm-make-cache-targets'.
\(fn)" t nil)
(autoload 'helm-make-projectile "helm-make" "\
Call `helm-make' for `projectile-project-root'.
ARG specifies the number of cores.
By default `helm-make-projectile' will look in `projectile-project-root'
followed by `projectile-project-root'/build, for a makefile.
You can specify an additional directory to search for a makefile by
setting the buffer local variable `helm-make-build-dir'.
\(fn &optional ARG)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; helm-make-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "helm-make" "20160331.754" "Select a Makefile target with helm" '((helm "1.5.3") (projectile "0.11.0")) :url "https://github.com/abo-abo/helm-make" :keywords '("makefile"))

View File

@ -0,0 +1,294 @@
;;; helm-make.el --- Select a Makefile target with helm
;; Copyright (C) 2014 Oleh Krehel
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
;; URL: https://github.com/abo-abo/helm-make
;; Package-Version: 20160331.754
;; Version: 0.2.0
;; Package-Requires: ((helm "1.5.3") (projectile "0.11.0"))
;; Keywords: makefile
;; This file is not part of GNU Emacs
;; This file 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, 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.
;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; A call to `helm-make' will give you a `helm' selection of this directory
;; Makefile's targets. Selecting a target will call `compile' on it.
;;; Code:
(require 'helm)
(require 'helm-multi-match)
(declare-function ivy-read "ext:ivy")
(defgroup helm-make nil
"Select a Makefile target with helm."
:group 'convenience)
(defcustom helm-make-do-save nil
"If t, save all open buffers visiting files from Makefile's directory."
:type 'boolean
:group 'helm-make)
(defcustom helm-make-build-dir ""
"Specify a build directory for an out of source build.
The path should be relative to the project root.
When non-nil `helm-make-projectile' will first look in that directory for a
makefile."
:type '(string)
:group 'helm-make)
(make-variable-buffer-local 'helm-make-build-dir)
(defcustom helm-make-sort-targets nil
"Whether targets shall be sorted.
If t, targets will be sorted as a final step before calling the
completion method.
HINT: If you are facing performance problems set this to nil.
This might be the case, if there are thousand of targets."
:type 'boolean
:group 'helm-make)
(defcustom helm-make-cache-targets nil
"Whether to cache the targets or not.
If t, cache targets of Makefile. If `helm-make' or `helm-make-projectile'
gets called for the same Makefile again, and the Makefile hasn't changed
meanwhile, i.e. the modification time is `equal' to the cached one, reuse
the cached targets, instead of recomputing them. If nil do nothing.
You can reset the cache by calling `helm-make-reset-db'."
:type 'boolean
:group 'helm-make)
(defcustom helm-make-executable "make"
"Store the name of make executable."
:type 'string
:group 'helm-make)
(defcustom helm-make-require-match t
"When non-nil, don't allow selecting a target that's not on the list."
:type 'boolean)
(defvar helm-make-command nil
"Store the make command.")
(defvar helm-make-target-history nil
"Holds the recently used targets.")
(defvar helm-make-makefile-names '("Makefile" "makefile" "GNUmakefile")
"List of Makefile names which make recognizes.
An exception is \"GNUmakefile\", only GNU make unterstand it.")
(defun helm--make-action (target)
"Make TARGET."
(compile (format helm-make-command target)))
(defcustom helm-make-completion-method 'helm
"Method to select a candidate from a list of strings."
:type '(choice
(const :tag "Helm" helm)
(const :tag "Ido" ido)
(const :tag "Ivy" ivy)))
;;;###autoload
(defun helm-make (&optional arg)
"Call \"make -j ARG target\". Target is selected with completion."
(interactive "p")
(setq helm-make-command (format "%s -j%d %%s" helm-make-executable arg))
(let ((makefile (helm--make-makefile-exists default-directory)))
(if makefile
(helm--make makefile)
(error "No Makefile in %s" default-directory))))
(defun helm--make-target-list-qp (makefile)
"Return the target list for MAKEFILE by parsing the output of \"make -nqp\"."
(let ((default-directory (file-name-directory
(expand-file-name makefile)))
targets target)
(with-temp-buffer
(insert
(shell-command-to-string
"make -nqp __BASH_MAKE_COMPLETION__=1 .DEFAULT 2>/dev/null"))
(goto-char (point-min))
(unless (re-search-forward "^# Files" nil t)
(error "Unexpected \"make -nqp\" output"))
(while (re-search-forward "^\\([^%$:#\n\t ]+\\):\\([^=]\\|$\\)" nil t)
(setq target (match-string 1))
(unless (or (save-excursion
(goto-char (match-beginning 0))
(forward-line -1)
(looking-at "^# Not a target:"))
(string-match "^\\([/a-zA-Z0-9_. -]+/\\)?\\." target))
(push target targets))))
targets))
(defun helm--make-target-list-default (makefile)
"Return the target list for MAKEFILE by parsing it."
(let (targets)
(with-temp-buffer
(insert-file-contents makefile)
(goto-char (point-min))
(while (re-search-forward "^\\([^: \n]+\\):" nil t)
(let ((str (match-string 1)))
(unless (string-match "^\\." str)
(push str targets)))))
targets))
(defcustom helm-make-list-target-method 'default
"Method of obtaining the list of Makefile targets."
:type '(choice
(const :tag "Default" default)
(const :tag "make -qp" qp)))
(defun helm--make-makefile-exists (base-dir &optional dir-list)
"Check if one of `helm-make-makefile-names' exist in BASE-DIR.
Returns the absolute filename to the Makefile, if one exists,
otherwise nil.
If DIR-LIST is non-nil, also search for `helm-make-makefile-names'."
(let* ((default-directory (file-truename base-dir))
(makefiles
(progn
(unless (and dir-list (listp dir-list))
(setq dir-list (list "")))
(let (result)
(dolist (dir dir-list)
(dolist (makefile helm-make-makefile-names)
(push (expand-file-name makefile dir) result)))
(reverse result)))))
(cl-find-if 'file-exists-p makefiles)))
(defvar helm-make-db (make-hash-table :test 'equal)
"An alist of Makefile and corresponding targets.")
(cl-defstruct helm-make-dbfile
targets
modtime
sorted)
(defun helm--make-cached-targets (makefile)
"Return cached targets of MAKEFILE.
If there are no cached targets for MAKEFILE, the MAKEFILE modification
time has changed, or `helm-make-cache-targets' is nil, parse the MAKEFILE,
and cache targets of MAKEFILE, if `helm-make-cache-targets' is t."
(let* ((att (file-attributes makefile 'integer))
(modtime (if att (nth 5 att) nil))
(entry (gethash makefile helm-make-db nil))
(new-entry (make-helm-make-dbfile))
(targets (cond
((and helm-make-cache-targets
entry
(equal modtime (helm-make-dbfile-modtime entry))
(helm-make-dbfile-targets entry))
(helm-make-dbfile-targets entry))
(t
(delete-dups (if (eq helm-make-list-target-method 'default)
(helm--make-target-list-default makefile)
(helm--make-target-list-qp makefile)))))))
(when helm-make-sort-targets
(unless (and helm-make-cache-targets
entry
(helm-make-dbfile-sorted entry))
(setq targets (sort targets 'string<)))
(setf (helm-make-dbfile-sorted new-entry) t))
(when helm-make-cache-targets
(setf (helm-make-dbfile-targets new-entry) targets
(helm-make-dbfile-modtime new-entry) modtime)
(puthash makefile new-entry helm-make-db))
targets))
;;;###autoload
(defun helm-make-reset-cache ()
"Reset cache, see `helm-make-cache-targets'."
(interactive)
(clrhash helm-make-db))
(defun helm--make (makefile)
"Call make for MAKEFILE."
(when helm-make-do-save
(let* ((regex (format "^%s" default-directory))
(buffers
(cl-remove-if-not
(lambda (b)
(let ((name (buffer-file-name b)))
(and name
(string-match regex (expand-file-name name)))))
(buffer-list))))
(mapc
(lambda (b)
(with-current-buffer b
(save-buffer)))
buffers)))
(let ((targets (helm--make-cached-targets makefile))
(default-directory (file-name-directory makefile)))
(delete-dups helm-make-target-history)
(cl-case helm-make-completion-method
(helm
(helm :sources
`((name . "Targets")
(candidates . ,targets)
(action . helm--make-action))
:history 'helm-make-target-history
:preselect (when helm-make-target-history
(format "^%s$" (car helm-make-target-history)))))
(ivy
(ivy-read "Target: "
targets
:history 'helm-make-target-history
:preselect (car helm-make-target-history)
:action 'helm--make-action
:require-match helm-make-require-match))
(ido
(let ((target (ido-completing-read
"Target: " targets
nil nil nil
'helm-make-target-history)))
(when target
(helm--make-action target)))))))
;;;###autoload
(defun helm-make-projectile (&optional arg)
"Call `helm-make' for `projectile-project-root'.
ARG specifies the number of cores.
By default `helm-make-projectile' will look in `projectile-project-root'
followed by `projectile-project-root'/build, for a makefile.
You can specify an additional directory to search for a makefile by
setting the buffer local variable `helm-make-build-dir'."
(interactive "p")
(require 'projectile)
(setq helm-make-command (format "%s -j%d %%s" helm-make-executable arg))
(let ((makefile (helm--make-makefile-exists
(projectile-project-root)
(if (and (stringp helm-make-build-dir)
(not (string-match-p "\\`[ \t\n\r]*\\'" helm-make-build-dir)))
`(,helm-make-build-dir "" "build")
`(,@helm-make-build-dir "" "build")))))
(if makefile
(helm--make makefile)
(error "No Makefile found for project %s" (projectile-project-root)))))
(provide 'helm-make)
;;; helm-make.el ends here

View File

@ -1,34 +0,0 @@
This package provides two commands which manipulate author and
committer dates. You could use it to make yourself look like
a rockstar programmer who hammers out commits at one commit per
minute. But the real purpose is to recover from heavy
re-arrangements of commits, that have causes the existing author
and committer dates to become meaningless.
I add these commands to the appropriate popups like this:
(magit-define-popup-action 'magit-rebase-popup
?R "Rockstar" 'magit-rockstar)
(magit-define-popup-action 'magit-commit-popup
?n "Reshelve" 'magit-reshelve)
Also included are tools that are either only useful for people
working on Magit itself and/or that aren't ready to be added to
Magit yet. These tools might change at any time, without prior
notice or way to appeal. This is a staging ground. It's okay
if things ain't perfect, or if they only do what *I currently*
need but not what you (or I) think they should (eventually) be
doing instead.
Currently my init file also contains this:
(magit-define-popup-action 'magit-fetch-popup
?P "Pull request" 'magit-branch-pull-request)
To use the "anti-stage" feature add this:
(setq magit-unstage-use-anti-stage t)
(magit-define-popup-action 'magit-revert-popup
?e "Revert & edit HEAD" 'magit-uncommit-extend)

View File

@ -0,0 +1,122 @@
;;; pkg-info-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "pkg-info" "pkg-info.el" (22297 53343 954922
;;;;;; 640000))
;;; Generated autoloads from pkg-info.el
(autoload 'pkg-info-library-original-version "pkg-info" "\
Get the original version in the header of LIBRARY.
The original version is stored in the X-Original-Version header.
This header is added by the MELPA package archive to preserve
upstream version numbers.
LIBRARY is either a symbol denoting a named feature, or a library
name as string.
If SHOW is non-nil, show the version in the minibuffer.
Return the version from the header of LIBRARY as list. Signal an
error if the LIBRARY was not found or had no X-Original-Version
header.
See Info node `(elisp)Library Headers' for more information
about library headers.
\(fn LIBRARY &optional SHOW)" t nil)
(autoload 'pkg-info-library-version "pkg-info" "\
Get the version in the header of LIBRARY.
LIBRARY is either a symbol denoting a named feature, or a library
name as string.
If SHOW is non-nil, show the version in the minibuffer.
Return the version from the header of LIBRARY as list. Signal an
error if the LIBRARY was not found or had no proper header.
See Info node `(elisp)Library Headers' for more information
about library headers.
\(fn LIBRARY &optional SHOW)" t nil)
(autoload 'pkg-info-defining-library-original-version "pkg-info" "\
Get the original version of the library defining FUNCTION.
The original version is stored in the X-Original-Version header.
This header is added by the MELPA package archive to preserve
upstream version numbers.
If SHOW is non-nil, show the version in mini-buffer.
This function is mainly intended to find the version of a major
or minor mode, i.e.
(pkg-info-defining-library-version 'flycheck-mode)
Return the version of the library defining FUNCTION. Signal an
error if FUNCTION is not a valid function, if its defining
library was not found, or if the library had no proper version
header.
\(fn FUNCTION &optional SHOW)" t nil)
(autoload 'pkg-info-defining-library-version "pkg-info" "\
Get the version of the library defining FUNCTION.
If SHOW is non-nil, show the version in mini-buffer.
This function is mainly intended to find the version of a major
or minor mode, i.e.
(pkg-info-defining-library-version 'flycheck-mode)
Return the version of the library defining FUNCTION. Signal an
error if FUNCTION is not a valid function, if its defining
library was not found, or if the library had no proper version
header.
\(fn FUNCTION &optional SHOW)" t nil)
(autoload 'pkg-info-package-version "pkg-info" "\
Get the version of an installed PACKAGE.
If SHOW is non-nil, show the version in the minibuffer.
Return the version as list, or nil if PACKAGE is not installed.
\(fn PACKAGE &optional SHOW)" t nil)
(autoload 'pkg-info-version-info "pkg-info" "\
Obtain complete version info for LIBRARY and PACKAGE.
LIBRARY is a symbol denoting a named feature, or a library name
as string. PACKAGE is a symbol denoting an ELPA package. If
omitted or nil, default to LIBRARY.
If SHOW is non-nil, show the version in the minibuffer.
When called interactively, prompt for LIBRARY. When called
interactively with prefix argument, prompt for PACKAGE as well.
Return a string with complete version information for LIBRARY.
This version information contains the version from the headers of
LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
part of. If PACKAGE is not installed, or if the PACKAGE version
is the same as the LIBRARY version, do not include a package
version.
\(fn LIBRARY &optional PACKAGE SHOW)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; pkg-info-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "pkg-info" "20150517.443" "Information about packages" '((epl "0.8")) :url "https://github.com/lunaryorn/pkg-info.el" :keywords '("convenience"))

View File

@ -0,0 +1,331 @@
;;; pkg-info.el --- Information about packages -*- lexical-binding: t; -*-
;; Copyright (C) 2013-2015 Sebastian Wiesner <swiesner@lunaryorn.com>
;; Author: Sebastian Wiesner <swiesner@lunaryorn.com>
;; URL: https://github.com/lunaryorn/pkg-info.el
;; Package-Version: 20150517.443
;; Keywords: convenience
;; Version: 0.7-cvs
;; Package-Requires: ((epl "0.8"))
;; This file is not part of GNU Emacs.
;; 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 extracts information from installed packages.
;;;; Functions:
;; `pkg-info-library-version' extracts the version from the header of a library.
;;
;; `pkg-info-defining-library-version' extracts the version from the header of a
;; library defining a function.
;;
;; `pkg-info-package-version' gets the version of an installed package.
;;
;; `pkg-info-format-version' formats a version list as human readable string.
;;
;; `pkg-info-version-info' returns complete version information for a specific
;; package.
;;
;; `pkg-info-get-melpa-recipe' gets the MELPA recipe for a package.
;;
;; `pkg-info-get-melpa-fetcher' gets the fetcher used to build a package on
;; MELPA.
;;
;; `pkg-info-wiki-package-p' determines whether a package was build from
;; EmacsWiki on MELPA.
;;; Code:
(require 'epl)
(require 'lisp-mnt)
(require 'find-func)
(require 'json) ; `json-read'
(require 'url-http) ; `url-http-parse-response'
(defvar url-http-end-of-headers)
;;; Version information
(defun pkg-info-format-version (version)
"Format VERSION as human-readable string.
Return a human-readable string representing VERSION."
;; XXX: Find a better, more flexible way of formatting?
(package-version-join version))
(defsubst pkg-info--show-version-and-return (version show)
"Show and return VERSION.
When SHOW is non-nil, show VERSION in minibuffer.
Return VERSION."
(when show
(message (if (listp version) (pkg-info-format-version version) version)))
version)
(defun pkg-info--read-library ()
"Read a library from minibuffer."
(completing-read "Load library: "
(apply-partially 'locate-file-completion-table
load-path
(get-load-suffixes))))
(defun pkg-info--read-function ()
"Read a function name from minibuffer."
(let ((input (completing-read "Function: " obarray #'boundp :require-match)))
(if (string= input "") nil (intern input))))
(defun pkg-info--read-package ()
"Read a package name from minibuffer."
(let* ((installed (epl-installed-packages))
(names (sort (mapcar (lambda (pkg)
(symbol-name (epl-package-name pkg)))
installed)
#'string<))
(default (car names)))
(completing-read "Installed package: " names nil 'require-match
nil nil default)))
(defun pkg-info-library-source (library)
"Get the source file of LIBRARY.
LIBRARY is either a symbol denoting a named feature, or a library
name as string.
Return the source file of LIBRARY as string."
(find-library-name (if (symbolp library) (symbol-name library) library)))
(defun pkg-info-defining-library (function)
"Get the source file of the library defining FUNCTION.
FUNCTION is a function symbol.
Return the file name of the library as string. Signal an error
if the library does not exist, or if the definition of FUNCTION
was not found."
(unless (functionp function)
(signal 'wrong-type-argument (list 'functionp function)))
(let ((library (symbol-file function 'defun)))
(unless library
(error "Can't find definition of %s" function))
library))
(defun pkg-info-x-original-version (file)
"Read the X-Original-Version header from FILE.
Return the value as version list, or return nil if FILE lacks
this header. Signal an error, if the value of the header is not
a valid version."
(let ((version-str (with-temp-buffer
(insert-file-contents file)
(lm-header "X-Original-Version"))))
(when version-str
(version-to-list version-str))))
;;;###autoload
(defun pkg-info-library-original-version (library &optional show)
"Get the original version in the header of LIBRARY.
The original version is stored in the X-Original-Version header.
This header is added by the MELPA package archive to preserve
upstream version numbers.
LIBRARY is either a symbol denoting a named feature, or a library
name as string.
If SHOW is non-nil, show the version in the minibuffer.
Return the version from the header of LIBRARY as list. Signal an
error if the LIBRARY was not found or had no X-Original-Version
header.
See Info node `(elisp)Library Headers' for more information
about library headers."
(interactive (list (pkg-info--read-library) t))
(let ((version (pkg-info-x-original-version
(pkg-info-library-source library))))
(if version
(pkg-info--show-version-and-return version show)
(error "Library %s has no original version" library))))
;;;###autoload
(defun pkg-info-library-version (library &optional show)
"Get the version in the header of LIBRARY.
LIBRARY is either a symbol denoting a named feature, or a library
name as string.
If SHOW is non-nil, show the version in the minibuffer.
Return the version from the header of LIBRARY as list. Signal an
error if the LIBRARY was not found or had no proper header.
See Info node `(elisp)Library Headers' for more information
about library headers."
(interactive (list (pkg-info--read-library) t))
(let* ((source (pkg-info-library-source library))
(version (epl-package-version (epl-package-from-file source))))
(pkg-info--show-version-and-return version show)))
;;;###autoload
(defun pkg-info-defining-library-original-version (function &optional show)
"Get the original version of the library defining FUNCTION.
The original version is stored in the X-Original-Version header.
This header is added by the MELPA package archive to preserve
upstream version numbers.
If SHOW is non-nil, show the version in mini-buffer.
This function is mainly intended to find the version of a major
or minor mode, i.e.
(pkg-info-defining-library-version 'flycheck-mode)
Return the version of the library defining FUNCTION. Signal an
error if FUNCTION is not a valid function, if its defining
library was not found, or if the library had no proper version
header."
(interactive (list (pkg-info--read-function) t))
(pkg-info-library-original-version (pkg-info-defining-library function) show))
;;;###autoload
(defun pkg-info-defining-library-version (function &optional show)
"Get the version of the library defining FUNCTION.
If SHOW is non-nil, show the version in mini-buffer.
This function is mainly intended to find the version of a major
or minor mode, i.e.
(pkg-info-defining-library-version 'flycheck-mode)
Return the version of the library defining FUNCTION. Signal an
error if FUNCTION is not a valid function, if its defining
library was not found, or if the library had no proper version
header."
(interactive (list (pkg-info--read-function) t))
(pkg-info-library-version (pkg-info-defining-library function) show))
;;;###autoload
(defun pkg-info-package-version (package &optional show)
"Get the version of an installed PACKAGE.
If SHOW is non-nil, show the version in the minibuffer.
Return the version as list, or nil if PACKAGE is not installed."
(interactive (list (pkg-info--read-package) t))
(let* ((name (if (stringp package) (intern package) package))
(package (car (epl-find-installed-packages name))))
(unless package
(error "Can't find installed package %s" name))
(pkg-info--show-version-and-return (epl-package-version package) show)))
;;;###autoload
(defun pkg-info-version-info (library &optional package show)
"Obtain complete version info for LIBRARY and PACKAGE.
LIBRARY is a symbol denoting a named feature, or a library name
as string. PACKAGE is a symbol denoting an ELPA package. If
omitted or nil, default to LIBRARY.
If SHOW is non-nil, show the version in the minibuffer.
When called interactively, prompt for LIBRARY. When called
interactively with prefix argument, prompt for PACKAGE as well.
Return a string with complete version information for LIBRARY.
This version information contains the version from the headers of
LIBRARY, and the version of the installed PACKAGE, the LIBRARY is
part of. If PACKAGE is not installed, or if the PACKAGE version
is the same as the LIBRARY version, do not include a package
version."
(interactive (list (pkg-info--read-library)
(when current-prefix-arg
(pkg-info--read-package))
t))
(let* ((package (or package (if (stringp library) (intern library) library)))
(orig-version (condition-case nil
(pkg-info-library-original-version library)
(error nil)))
;; If we have X-Original-Version, we assume that MELPA replaced the
;; library version with its generated version, so we use the
;; X-Original-Version header instead, and ignore the library version
;; header
(lib-version (or orig-version (pkg-info-library-version library)))
(pkg-version (condition-case nil
(pkg-info-package-version package)
(error nil)))
(version (if (and pkg-version
(not (version-list-= lib-version pkg-version)))
(format "%s (package: %s)"
(pkg-info-format-version lib-version)
(pkg-info-format-version pkg-version))
(pkg-info-format-version lib-version))))
(pkg-info--show-version-and-return version show)))
(defconst pkg-info-melpa-recipe-url "http://melpa.org/recipes.json"
"The URL from which to fetch MELPA recipes.")
(defvar pkg-info-melpa-recipes nil
"An alist of MELPA recipes.")
(defun pkg-info-retrieve-melpa-recipes ()
"Retrieve MELPA recipes from MELPA archive."
(let ((buffer (url-retrieve-synchronously pkg-info-melpa-recipe-url)))
(with-current-buffer buffer
(unwind-protect
(let ((response-code (url-http-parse-response)))
(unless (equal response-code 200)
(error "Failed to retrieve MELPA recipes from %s (code %s)"
pkg-info-melpa-recipe-url response-code))
(goto-char url-http-end-of-headers)
(json-read))
(when (and buffer (buffer-live-p buffer))
(kill-buffer buffer))))))
(defun pkg-info-get-melpa-recipes ()
"Get MELPA recipes."
(setq pkg-info-melpa-recipes
(or pkg-info-melpa-recipes
(pkg-info-retrieve-melpa-recipes))))
(defun pkg-info-get-melpa-recipe (package)
"Get the MELPA recipe for PACKAGE.
Return nil if PACKAGE is not on MELPA."
(cdr (assq package (pkg-info-get-melpa-recipes))))
(defun pkg-info-get-melpa-fetcher (package)
"Get the MELPA fetcher for PACKAGE."
(cdr (assq 'fetcher (pkg-info-get-melpa-recipe package))))
(defun pkg-info-wiki-package-p (package)
"Determine whether PACKAGE is build from the EmacsWiki."
(equal (pkg-info-get-melpa-fetcher package) "wiki"))
(provide 'pkg-info)
;; Local Variables:
;; indent-tabs-mode: nil
;; coding: utf-8
;; End:
;;; pkg-info.el ends here

View File

@ -0,0 +1,15 @@
;;; pos-tip-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil nil ("pos-tip.el") (22297 53347 971569 117000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; pos-tip-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "pos-tip" "20150318.813" "Show tooltip at point" 'nil :keywords '("tooltip"))

View File

@ -0,0 +1,980 @@
;;; pos-tip.el --- Show tooltip at point -*- coding: utf-8 -*-
;; Copyright (C) 2010 S. Irie
;; Author: S. Irie
;; Maintainer: S. Irie
;; Keywords: Tooltip
;; Package-Version: 20150318.813
(defconst pos-tip-version "0.4.6")
;; 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 2, or
;; (at your option) any later version.
;; It 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, write to the Free
;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
;; MA 02110-1301 USA
;;; Commentary:
;; The standard library tooltip.el provides the function for displaying
;; a tooltip at mouse position which allows users to easily show it.
;; However, locating tooltip at arbitrary buffer position in window
;; is not easy. This program provides such function to be used by other
;; frontend programs.
;; This program is tested on GNU Emacs 22, 23 under X window system and
;; Emacs 23 for MS-Windows.
;;
;; Installation:
;;
;; First, save this file as pos-tip.el and byte-compile in
;; a directory that is listed in load-path.
;;
;; Put the following in your .emacs file:
;;
;; (require 'pos-tip)
;;
;; To use the full features of this program on MS-Windows,
;; put the additional setting in .emacs file:
;;
;; (pos-tip-w32-max-width-height) ; Maximize frame temporarily
;;
;; or
;;
;; (pos-tip-w32-max-width-height t) ; Keep frame maximized
;;
;; Examples:
;;
;; We can display a tooltip at the current position by the following:
;;
;; (pos-tip-show "foo bar")
;;
;; If you'd like to specify the tooltip color, use an expression as:
;;
;; (pos-tip-show "foo bar" '("white" . "red"))
;;
;; Here, "white" and "red" are the foreground color and background
;; color, respectively.
;;; History:
;; 2013-07-16 P. Kalinowski
;; * Adjusted `pos-tip-show' to correctly set tooltip text foreground
;; color when using custom color themes.
;; * Version 0.4.6
;;
;; 2010-09-27 S. Irie
;; * Simplified implementation of `pos-tip-window-system'
;; * Version 0.4.5
;;
;; 2010-08-20 S. Irie
;; * Changed to use `window-line-height' to calculate tooltip position
;; * Changed `pos-tip-string-width-height' to ignore last empty line
;; * Version 0.4.4
;;
;; 2010-07-25 S. Irie
;; * Bug fix
;; * Version 0.4.3
;;
;; 2010-06-09 S. Irie
;; * Bug fix
;; * Version 0.4.2
;;
;; 2010-06-04 S. Irie
;; * Added support for text-scale-mode
;; * Version 0.4.1
;;
;; 2010-05-04 S. Irie
;; * Added functions:
;; `pos-tip-x-display-width', `pos-tip-x-display-height'
;; `pos-tip-normalize-natnum', `pos-tip-frame-relative-position'
;; * Fixed the supports for multi-displays and multi-frames
;; * Version 0.4.0
;;
;; 2010-04-29 S. Irie
;; * Modified to avoid byte-compile warning
;; * Bug fix
;; * Version 0.3.6
;;
;; 2010-04-29 S. Irie
;; * Renamed argument MAX-HEIGHT of `pos-tip-fill-string' to MAX-ROWS
;; * Modified old FSF address
;; * Version 0.3.5
;;
;; 2010-04-29 S. Irie
;; * Modified `pos-tip-show' to truncate string exceeding display size
;; * Added function `pos-tip-truncate-string'
;; * Added optional argument MAX-ROWS to `pos-tip-split-string'
;; * Added optional argument MAX-HEIGHT to `pos-tip-fill-string'
;; * Version 0.3.4
;;
;; 2010-04-16 S. Irie
;; * Changed `pos-tip-show' not to fill paragraph unless exceeding WIDTH
;; * Version 0.3.3
;;
;; 2010-04-08 S. Irie
;; * Bug fix
;; * Version 0.3.2
;;
;; 2010-03-31 S. Irie
;; * Bug fix
;; * Version 0.3.1
;;
;; 2010-03-30 S. Irie
;; * Added support for MS-Windows
;; * Added option `pos-tip-use-relative-coordinates'
;; * Bug fixes
;; * Version 0.3.0
;;
;; 2010-03-23 S. Irie
;; * Changed argument WORD-WRAP to JUSTIFY
;; * Added optional argument SQUEEZE
;; * Added function `pos-tip-fill-string'
;; * Added option `pos-tip-tab-width' used to expand tab characters
;; * Bug fixes
;; * Version 0.2.0
;;
;; 2010-03-22 S. Irie
;; * Added optional argument WORD-WRAP to `pos-tip-split-string'
;; * Changed `pos-tip-show' to perform word wrap or kinsoku shori
;; * Version 0.1.8
;;
;; 2010-03-20 S. Irie
;; * Added optional argument DY
;; * Bug fix
;; * Modified docstrings
;; * Version 0.1.7
;;
;; 2010-03-18 S. Irie
;; * Added/modifed docstrings
;; * Changed working buffer name to " *xwininfo*"
;; * Version 0.1.6
;;
;; 2010-03-17 S. Irie
;; * Fixed typos in docstrings
;; * Version 0.1.5
;;
;; 2010-03-16 S. Irie
;; * Added support for multi-display environment
;; * Bug fix
;; * Version 0.1.4
;;
;; 2010-03-16 S. Irie
;; * Bug fix
;; * Changed calculation for `x-max-tooltip-size'
;; * Modified docstring
;; * Version 0.1.3
;;
;; 2010-03-11 S. Irie
;; * Modified commentary
;; * Version 0.1.2
;;
;; 2010-03-11 S. Irie
;; * Re-implemented `pos-tip-string-width-height'
;; * Added indicator variable `pos-tip-upperside-p'
;; * Version 0.1.1
;;
;; 2010-03-09 S. Irie
;; * Re-implemented `pos-tip-show' (*incompatibly changed*)
;; - Use frame default font
;; - Automatically calculate tooltip pixel size
;; - Added optional arguments: TIP-COLOR, MAX-WIDTH
;; * Added utility functions:
;; `pos-tip-split-string', `pos-tip-string-width-height'
;; * Bug fixes
;; * Version 0.1.0
;;
;; 2010-03-08 S. Irie
;; * Added optional argument DX
;; * Version 0.0.4
;;
;; 2010-03-08 S. Irie
;; * Bug fix
;; * Version 0.0.3
;;
;; 2010-03-08 S. Irie
;; * Modified to move out mouse pointer
;; * Version 0.0.2
;;
;; 2010-03-07 S. Irie
;; * First release
;; * Version 0.0.1
;; ToDo:
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgroup pos-tip nil
"Show tooltip at point"
:group 'faces
:prefix "pos-tip-")
(defcustom pos-tip-border-width 1
"Outer border width of pos-tip's tooltip."
:type 'integer
:group 'pos-tip)
(defcustom pos-tip-internal-border-width 2
"Text margin of pos-tip's tooltip."
:type 'integer
:group 'pos-tip)
(defcustom pos-tip-foreground-color nil
"Default foreground color of pos-tip's tooltip.
When `nil', look up the foreground color of the `tooltip' face."
:type '(choice (const :tag "Default" nil)
string)
:group 'pos-tip)
(defcustom pos-tip-background-color nil
"Default background color of pos-tip's tooltip.
When `nil', look up the background color of the `tooltip' face."
:type '(choice (const :tag "Default" nil)
string)
:group 'pos-tip)
(defcustom pos-tip-tab-width nil
"Tab width used for `pos-tip-split-string' and `pos-tip-fill-string'
to expand tab characters. nil means use default value of `tab-width'."
:type '(choice (const :tag "Default" nil)
integer)
:group 'pos-tip)
(defcustom pos-tip-use-relative-coordinates nil
"Non-nil means tooltip location is calculated as a coordinates
relative to the top left corner of frame. In this case the tooltip
will always be displayed within the frame.
Note that this variable is automatically set to non-nil if absolute
coordinates can't be obtained by `pos-tip-compute-pixel-position'."
:type 'boolean
:group 'pos-tip)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun pos-tip-window-system (&optional frame)
"The name of the window system that FRAME is displaying through.
The value is a symbol---for instance, 'x' for X windows.
The value is nil if Emacs is using a text-only terminal.
FRAME defaults to the currently selected frame."
(let ((type (framep (or frame (selected-frame)))))
(if type
(and (not (eq type t))
type)
(signal 'wrong-type-argument (list 'framep frame)))))
(defun pos-tip-normalize-natnum (object &optional n)
"Return a Nth power of 2 if OBJECT is a positive integer.
Otherwise return 0. Omitting N means return 1 for a positive integer."
(ash (if (and (natnump object) (> object 0)) 1 0)
(or n 0)))
(defvar pos-tip-saved-frame-coordinates '(0 . 0)
"The latest result of `pos-tip-frame-top-left-coordinates'.")
(defvar pos-tip-frame-offset nil
"The latest result of `pos-tip-calibrate-frame-offset'. This value
is used for non-X graphical environment.")
(defvar pos-tip-frame-offset-array [nil nil nil nil]
"Array of the results of `pos-tip-calibrate-frame-offset'. They are
recorded only when `pos-tip-frame-top-left-coordinates' is called for a
non-X but graphical frame.
The 2nd and 4th elements are the values for frames having a menu bar.
The 3rd and 4th elements are the values for frames having a tool bar.")
(defun pos-tip-frame-top-left-coordinates (&optional frame)
"Return the pixel coordinates of FRAME as a cons cell (LEFT . TOP),
which are relative to top left corner of screen.
Return nil if failing to acquire the coordinates.
If FRAME is omitted, use selected-frame.
Users can also get the frame coordinates by referring the variable
`pos-tip-saved-frame-coordinates' just after calling this function."
(let ((winsys (pos-tip-window-system frame)))
(cond
((null winsys)
(error "text-only frame: %S" frame))
((eq winsys 'x)
(condition-case nil
(with-current-buffer (get-buffer-create " *xwininfo*")
(let ((case-fold-search nil))
(buffer-disable-undo)
(erase-buffer)
(call-process shell-file-name nil t nil shell-command-switch
(format "xwininfo -display %s -id %s"
(frame-parameter frame 'display)
(frame-parameter frame 'window-id)))
(goto-char (point-min))
(search-forward "\n Absolute")
(setq pos-tip-saved-frame-coordinates
(cons (string-to-number (buffer-substring-no-properties
(search-forward "X: ")
(line-end-position)))
(string-to-number (buffer-substring-no-properties
(search-forward "Y: ")
(line-end-position)))))))
(error nil)))
(t
(let* ((index (+ (pos-tip-normalize-natnum
(frame-parameter frame 'menu-bar-lines) 0)
(pos-tip-normalize-natnum
(frame-parameter frame 'tool-bar-lines) 1)))
(offset (or (aref pos-tip-frame-offset-array index)
(aset pos-tip-frame-offset-array index
(pos-tip-calibrate-frame-offset frame)))))
(if offset
(setq pos-tip-saved-frame-coordinates
(cons (+ (eval (frame-parameter frame 'left))
(car offset))
(+ (eval (frame-parameter frame 'top))
(cdr offset))))))))))
(defun pos-tip-frame-relative-position
(frame1 frame2 &optional w32-frame frame-coord1 frame-coord2)
"Return the pixel coordinates of FRAME1 relative to FRAME2
as a cons cell (LEFT . TOP).
W32-FRAME non-nil means both of frames are under `w32' window system.
FRAME-COORD1 and FRAME-COORD2, if given, specify the absolute
coordinates of FRAME1 and FRAME2, respectively, which make the
calculations faster if the frames have different heights of menu bars
and tool bars."
(if (and (eq (pos-tip-normalize-natnum
(frame-parameter frame1 'menu-bar-lines))
(pos-tip-normalize-natnum
(frame-parameter frame2 'menu-bar-lines)))
(or w32-frame
(eq (pos-tip-normalize-natnum
(frame-parameter frame1 'tool-bar-lines))
(pos-tip-normalize-natnum
(frame-parameter frame2 'tool-bar-lines)))))
(cons (- (eval (frame-parameter frame1 'left))
(eval (frame-parameter frame2 'left)))
(- (eval (frame-parameter frame1 'top))
(eval (frame-parameter frame2 'top))))
(unless frame-coord1
(setq frame-coord1 (let (pos-tip-saved-frame-coordinates)
(pos-tip-frame-top-left-coordinates frame1))))
(unless frame-coord2
(setq frame-coord2 (let (pos-tip-saved-frame-coordinates)
(pos-tip-frame-top-left-coordinates frame2))))
(cons (- (car frame-coord1) (car frame-coord2))
(- (cdr frame-coord1) (cdr frame-coord2)))))
(defvar pos-tip-upperside-p nil
"Non-nil indicates the latest result of `pos-tip-compute-pixel-position'
was upper than the location specified by the arguments.")
(defvar pos-tip-w32-saved-max-width-height nil
"Display pixel size effective for showing tooltip in MS-Windows desktop.
This doesn't include the taskbar area, so isn't same as actual display size.")
(defun pos-tip-compute-pixel-position
(&optional pos window pixel-width pixel-height frame-coordinates dx dy)
"Return pixel position of POS in WINDOW like (X . Y), which indicates
the absolute or relative coordinates of bottom left corner of the object.
Omitting POS and WINDOW means use current position and selected window,
respectively.
If PIXEL-WIDTH and PIXEL-HEIGHT are given, this function assumes these
values as the size of small window like tooltip which is located around the
object at POS. These values are used to adjust the location in order that
the tooltip won't disappear by sticking out of the display. By referring
the variable `pos-tip-upperside-p' after calling this function, user can
examine whether the tooltip will be located above the specified position.
If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute
coordinates of the top left corner of frame which WINDOW is on. Here,
`top left corner of frame' represents the origin of `window-pixel-edges'
and its coordinates are essential for calculating the return value as
absolute coordinates. If a cons cell like (LEFT . TOP), specifies the
frame absolute location and makes the calculation slightly faster, but can
be used only when it's clear that frame is in the specified position. Users
can get the latest values of frame coordinates for using in the next call
by referring the variable `pos-tip-saved-frame-coordinates' just after
calling this function. Otherwise, FRAME-COORDINATES `relative' means return
pixel coordinates of the object relative to the top left corner of the frame.
This is the same effect as `pos-tip-use-relative-coordinates' is non-nil.
DX specifies horizontal offset in pixel.
DY specifies vertical offset in pixel. This makes the calculations done
without considering the height of object at POS, so the object might be
hidden by the tooltip."
(let* ((frame (window-frame (or window (selected-window))))
(w32-frame (eq (pos-tip-window-system frame) 'w32))
(relative (or pos-tip-use-relative-coordinates
(eq frame-coordinates 'relative)
(and w32-frame
(null pos-tip-w32-saved-max-width-height))))
(frame-coord (or (and relative '(0 . 0))
frame-coordinates
(pos-tip-frame-top-left-coordinates frame)
(progn
(setq relative t
pos-tip-use-relative-coordinates t)
'(0 . 0))))
(posn (posn-at-point (or pos (window-point window)) window))
(line (cdr (posn-actual-col-row posn)))
(line-height (and line
(or (window-line-height line window)
(and (redisplay t)
(window-line-height line window)))))
(x-y (or (posn-x-y posn)
(let ((geom (pos-visible-in-window-p
(or pos (window-point window)) window t)))
(and geom (cons (car geom) (cadr geom))))
'(0 . 0)))
(x (+ (car frame-coord)
(car (window-inside-pixel-edges window))
(car x-y)
(or dx 0)))
(y0 (+ (cdr frame-coord)
(cadr (window-pixel-edges window))
(or (nth 2 line-height) (cdr x-y))))
(y (+ y0
(or dy
(car line-height)
(with-current-buffer (window-buffer window)
(cond
;; `posn-object-width-height' returns an incorrect value
;; when the header line is displayed (Emacs bug #4426).
((and posn
(null header-line-format))
(cdr (posn-object-width-height posn)))
((and (bound-and-true-p text-scale-mode)
(not (zerop (with-no-warnings
text-scale-mode-amount))))
(round (* (frame-char-height frame)
(with-no-warnings
(expt text-scale-mode-step
text-scale-mode-amount)))))
(t
(frame-char-height frame)))))))
xmax ymax)
(cond
(relative
(setq xmax (frame-pixel-width frame)
ymax (frame-pixel-height frame)))
(w32-frame
(setq xmax (car pos-tip-w32-saved-max-width-height)
ymax (cdr pos-tip-w32-saved-max-width-height)))
(t
(setq xmax (x-display-pixel-width frame)
ymax (x-display-pixel-height frame))))
(setq pos-tip-upperside-p (> (+ y (or pixel-height 0))
ymax))
(cons (max 0 (min x (- xmax (or pixel-width 0))))
(max 0 (if pos-tip-upperside-p
(- (if dy ymax y0) (or pixel-height 0))
y)))))
(defun pos-tip-cancel-timer ()
"Cancel timeout of tooltip."
(mapc (lambda (timer)
(if (eq (aref timer 5) 'x-hide-tip)
(cancel-timer timer)))
timer-list))
(defun pos-tip-avoid-mouse (left right top bottom &optional frame)
"Move out mouse pointer if it is inside region (LEFT RIGHT TOP BOTTOM)
in FRAME. Return new mouse position like (FRAME . (X . Y))."
(unless frame
(setq frame (selected-frame)))
(let* ((mpos (with-selected-window (frame-selected-window frame)
(mouse-pixel-position)))
(mframe (pop mpos))
(mx (car mpos))
(my (cdr mpos)))
(when (and (eq mframe frame)
(numberp mx))
(let* ((large-number (+ (frame-pixel-width frame) (frame-pixel-height frame)))
(dl (if (> left 2)
(1+ (- mx left))
large-number))
(dr (if (< (1+ right) (frame-pixel-width frame))
(- right mx)
large-number))
(dt (if (> top 2)
(1+ (- my top))
large-number))
(db (if (< (1+ bottom) (frame-pixel-height frame))
(- bottom my)
large-number))
(d (min dl dr dt db)))
(when (> d -2)
(cond
((= d dl)
(setq mx (- left 2)))
((= d dr)
(setq mx (1+ right)))
((= d dt)
(setq my (- top 2)))
(t
(setq my (1+ bottom))))
(set-mouse-pixel-position frame mx my)
(sit-for 0.0001))))
(cons mframe (and mpos (cons mx my)))))
(defun pos-tip-compute-foreground-color (tip-color)
"Compute the foreground color to use for tooltip.
TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR).
If it is nil, use `pos-tip-foreground-color' or the foreground color of the
`tooltip' face."
(or (and (facep tip-color)
(face-attribute tip-color :foreground))
(car-safe tip-color)
pos-tip-foreground-color
(face-foreground 'tooltip)))
(defun pos-tip-compute-background-color (tip-color)
"Compute the background color to use for tooltip.
TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR).
If it is nil, use `pos-tip-background-color' or the background color of the
`tooltip' face."
(or (and (facep tip-color)
(face-attribute tip-color :background))
(cdr-safe tip-color)
pos-tip-background-color
(face-background 'tooltip)))
(defun pos-tip-show-no-propertize
(string &optional tip-color pos window timeout pixel-width pixel-height frame-coordinates dx dy)
"Show STRING in a tooltip at POS in WINDOW.
Analogous to `pos-tip-show' except don't propertize STRING by `pos-tip' face.
PIXEL-WIDTH and PIXEL-HEIGHT specify the size of tooltip, if given. These
are used to adjust the tooltip position in order that it doesn't disappear by
sticking out of the display, and also used to prevent it from vanishing by
overlapping with mouse pointer.
Note that this function itself doesn't calculate tooltip size because the
character width and height specified by faces are unknown. So users should
calculate PIXEL-WIDTH and PIXEL-HEIGHT by using `pos-tip-tooltip-width' and
`pos-tip-tooltip-height', or use `pos-tip-show' instead, which can
automatically calculate tooltip size.
See `pos-tip-show' for details.
Example:
\(defface my-tooltip
'((t
:background \"gray85\"
:foreground \"black\"
:inherit variable-pitch))
\"Face for my tooltip.\")
\(defface my-tooltip-highlight
'((t
:background \"blue\"
:foreground \"white\"
:inherit my-tooltip))
\"Face for my tooltip highlighted.\")
\(let ((str (propertize \" foo \\n bar \\n baz \" 'face 'my-tooltip)))
(put-text-property 6 11 'face 'my-tooltip-highlight str)
(pos-tip-show-no-propertize str 'my-tooltip))"
(unless window
(setq window (selected-window)))
(let* ((frame (window-frame window))
(winsys (pos-tip-window-system frame))
(x-frame (eq winsys 'x))
(w32-frame (eq winsys 'w32))
(relative (or pos-tip-use-relative-coordinates
(eq frame-coordinates 'relative)
(and w32-frame
(null pos-tip-w32-saved-max-width-height))))
(x-y (prog1
(pos-tip-compute-pixel-position pos window
pixel-width pixel-height
frame-coordinates dx dy)
(if pos-tip-use-relative-coordinates
(setq relative t))))
(ax (car x-y))
(ay (cdr x-y))
(rx (if relative ax (- ax (car pos-tip-saved-frame-coordinates))))
(ry (if relative ay (- ay (cdr pos-tip-saved-frame-coordinates))))
(retval (cons rx ry))
(fg (pos-tip-compute-foreground-color tip-color))
(bg (pos-tip-compute-background-color tip-color))
(use-dxdy (or relative
(not x-frame)))
(spacing (frame-parameter frame 'line-spacing))
(border (ash (+ pos-tip-border-width
pos-tip-internal-border-width)
1))
(x-max-tooltip-size
(cons (+ (if x-frame 1 0)
(/ (- (or pixel-width
(cond
(relative
(frame-pixel-width frame))
(w32-frame
(car pos-tip-w32-saved-max-width-height))
(t
(x-display-pixel-width frame))))
border)
(frame-char-width frame)))
(/ (- (or pixel-height
(x-display-pixel-height frame))
border)
(frame-char-height frame))))
(mpos (with-selected-window window (mouse-pixel-position)))
(mframe (car mpos))
default-frame-alist)
(if (or relative
(and use-dxdy
(null (cadr mpos))))
(unless (and (cadr mpos)
(eq mframe frame))
(let* ((edges (window-inside-pixel-edges (cadr (window-list frame))))
(mx (ash (+ (pop edges) (cadr edges)) -1))
(my (ash (+ (pop edges) (cadr edges)) -1)))
(setq mframe frame)
(set-mouse-pixel-position mframe mx my)
(sit-for 0.0001)))
(when (and (cadr mpos)
(not (eq mframe frame)))
(let ((rel-coord (pos-tip-frame-relative-position frame mframe w32-frame
frame-coordinates)))
(setq rx (+ rx (car rel-coord))
ry (+ ry (cdr rel-coord))))))
(and pixel-width pixel-height
(setq mpos (pos-tip-avoid-mouse rx (+ rx pixel-width
(if w32-frame 3 0))
ry (+ ry pixel-height)
mframe)))
(x-show-tip string mframe
`((border-width . ,pos-tip-border-width)
(internal-border-width . ,pos-tip-internal-border-width)
,@(and (not use-dxdy) `((left . ,ax)
(top . ,ay)))
(font . ,(frame-parameter frame 'font))
,@(and spacing `((line-spacing . ,spacing)))
,@(and (stringp fg) `((foreground-color . ,fg)))
,@(and (stringp bg) `((background-color . ,bg))))
(and timeout (> timeout 0) timeout)
(and use-dxdy (- rx (cadr mpos)))
(and use-dxdy (- ry (cddr mpos))))
(if (and timeout (<= timeout 0))
(pos-tip-cancel-timer))
retval))
(defun pos-tip-split-string (string &optional width margin justify squeeze max-rows)
"Split STRING into fixed width strings. Return a list of these strings.
WIDTH specifies the width of filling each paragraph. WIDTH nil means use
the width of currently selected frame. Note that this function doesn't add any
padding characters at the end of each row.
MARGIN, if non-nil, specifies left margin width which is the number of spece
characters to add at the beginning of each row.
The optional fourth argument JUSTIFY specifies which kind of justification
to do: `full', `left', `right', `center', or `none'. A value of t means handle
each paragraph as specified by its text properties. Omitting JUSTIFY means
don't perform justification, word wrap and kinsoku shori (禁則処理).
SQUEEZE nil means leave whitespaces other than line breaks untouched.
MAX-ROWS, if given, specifies maximum number of elements of return value.
The elements exceeding this number are discarded."
(with-temp-buffer
(let* ((tab-width (or pos-tip-tab-width tab-width))
(fill-column (or width (frame-width)))
(left-margin (or margin 0))
(kinsoku-limit 1)
indent-tabs-mode
row rows)
(insert string)
(untabify (point-min) (point-max))
(if justify
(fill-region (point-min) (point-max) justify (not squeeze))
(setq margin (make-string left-margin ?\s)))
(goto-char (point-min))
(while (prog2
(let ((line (buffer-substring
(point) (progn (end-of-line) (point)))))
(if justify
(push line rows)
(while (progn
(setq line (concat margin line)
row (truncate-string-to-width line fill-column))
(push row rows)
(if (not (= (length row) (length line)))
(setq line (substring line (length row))))))))
(< (point) (point-max))
(beginning-of-line 2)))
(nreverse (if max-rows
(last rows max-rows)
rows)))))
(defun pos-tip-fill-string (string &optional width margin justify squeeze max-rows)
"Fill each of the paragraphs in STRING.
WIDTH specifies the width of filling each paragraph. WIDTH nil means use
the width of currently selected frame. Note that this function doesn't add any
padding characters at the end of each row.
MARGIN, if non-nil, specifies left margin width which is the number of spece
characters to add at the beginning of each row.
The optional fourth argument JUSTIFY specifies which kind of justification
to do: `full', `left', `right', `center', or `none'. A value of t means handle
each paragraph as specified by its text properties. Omitting JUSTIFY means
don't perform justification, word wrap and kinsoku shori (禁則処理).
SQUEEZE nil means leave whitespaces other than line breaks untouched.
MAX-ROWS, if given, specifies maximum number of rows. The rows exceeding
this number are discarded."
(if justify
(with-temp-buffer
(let* ((tab-width (or pos-tip-tab-width tab-width))
(fill-column (or width (frame-width)))
(left-margin (or margin 0))
(kinsoku-limit 1)
indent-tabs-mode)
(insert string)
(untabify (point-min) (point-max))
(fill-region (point-min) (point-max) justify (not squeeze))
(if max-rows
(buffer-substring (goto-char (point-min))
(line-end-position max-rows))
(buffer-string))))
(mapconcat 'identity
(pos-tip-split-string string width margin nil nil max-rows)
"\n")))
(defun pos-tip-truncate-string (string width height)
"Truncate each line of STRING to WIDTH and discard lines exceeding HEIGHT."
(with-temp-buffer
(insert string)
(goto-char (point-min))
(let ((nrow 0)
rows)
(while (and (< nrow height)
(prog2
(push (truncate-string-to-width
(buffer-substring (point) (progn (end-of-line) (point)))
width)
rows)
(< (point) (point-max))
(beginning-of-line 2)
(setq nrow (1+ nrow)))))
(mapconcat 'identity (nreverse rows) "\n"))))
(defun pos-tip-string-width-height (string)
"Count columns and rows of STRING. Return a cons cell like (WIDTH . HEIGHT).
The last empty line of STRING is ignored.
Example:
\(pos-tip-string-width-height \"abc\\nあいう\\n123\")
;; => (6 . 3)"
(with-temp-buffer
(insert string)
(goto-char (point-min))
(end-of-line)
(let ((width (current-column))
(height (if (eq (char-before (point-max)) ?\n) 0 1)))
(while (< (point) (point-max))
(end-of-line 2)
(setq width (max (current-column) width)
height (1+ height)))
(cons width height))))
(defun pos-tip-x-display-width (&optional frame)
"Return maximum column number in tooltip which occupies the full width
of display. Omitting FRAME means use display that selected frame is in."
(1+ (/ (x-display-pixel-width frame) (frame-char-width frame))))
(defun pos-tip-x-display-height (&optional frame)
"Return maximum row number in tooltip which occupies the full height
of display. Omitting FRAME means use display that selected frame is in."
(1+ (/ (x-display-pixel-height frame) (frame-char-height frame))))
(defun pos-tip-tooltip-width (width char-width)
"Calculate tooltip pixel width."
(+ (* width char-width)
(ash (+ pos-tip-border-width
pos-tip-internal-border-width)
1)))
(defun pos-tip-tooltip-height (height char-height &optional frame)
"Calculate tooltip pixel height."
(let ((spacing (or (default-value 'line-spacing)
(frame-parameter frame 'line-spacing))))
(+ (* height (+ char-height
(cond
((integerp spacing)
spacing)
((floatp spacing)
(truncate (* (frame-char-height frame)
spacing)))
(t 0))))
(ash (+ pos-tip-border-width
pos-tip-internal-border-width)
1))))
(defun pos-tip-show
(string &optional tip-color pos window timeout width frame-coordinates dx dy)
"Show STRING in a tooltip, which is a small X window, at POS in WINDOW
using frame's default font with TIP-COLOR.
Return pixel position of tooltip relative to top left corner of frame as
a cons cell like (X . Y).
TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR)
used to specify *only* foreground-color and background-color of tooltip. If
omitted, use `pos-tip-foreground-color' and `pos-tip-background-color' or the
foreground and background color of the `tooltip' face instead.
Omitting POS and WINDOW means use current position and selected window,
respectively.
Automatically hide the tooltip after TIMEOUT seconds. Omitting TIMEOUT means
use the default timeout of 5 seconds. Non-positive TIMEOUT means don't hide
tooltip automatically.
WIDTH, if non-nil, specifies the width of filling each paragraph.
If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute
coordinates of the top left corner of frame which WINDOW is on. Here,
`top left corner of frame' represents the origin of `window-pixel-edges'
and its coordinates are essential for calculating the absolute coordinates
of the tooltip. If a cons cell like (LEFT . TOP), specifies the frame
absolute location and makes the calculation slightly faster, but can be
used only when it's clear that frame is in the specified position. Users
can get the latest values of frame coordinates for using in the next call
by referring the variable `pos-tip-saved-frame-coordinates' just after
calling this function. Otherwise, FRAME-COORDINATES `relative' means use
the pixel coordinates relative to the top left corner of the frame for
displaying the tooltip. This is the same effect as
`pos-tip-use-relative-coordinates' is non-nil.
DX specifies horizontal offset in pixel.
DY specifies vertical offset in pixel. This makes the calculations done
without considering the height of object at POS, so the object might be
hidden by the tooltip.
See also `pos-tip-show-no-propertize'."
(unless window
(setq window (selected-window)))
(let* ((frame (window-frame window))
(max-width (pos-tip-x-display-width frame))
(max-height (pos-tip-x-display-height frame))
(w-h (pos-tip-string-width-height string))
(fg (pos-tip-compute-foreground-color tip-color))
(bg (pos-tip-compute-background-color tip-color))
(frame-font (find-font (font-spec :name (frame-parameter frame 'font))))
(tip-face-attrs (list :font frame-font :foreground fg :background bg)))
(cond
((and width
(> (car w-h) width))
(setq string (pos-tip-fill-string string width nil 'none nil max-height)
w-h (pos-tip-string-width-height string)))
((or (> (car w-h) max-width)
(> (cdr w-h) max-height))
(setq string (pos-tip-truncate-string string max-width max-height)
w-h (pos-tip-string-width-height string))))
(pos-tip-show-no-propertize
(propertize string 'face tip-face-attrs)
tip-color pos window timeout
(pos-tip-tooltip-width (car w-h) (frame-char-width frame))
(pos-tip-tooltip-height (cdr w-h) (frame-char-height frame) frame)
frame-coordinates dx dy)))
(defalias 'pos-tip-hide 'x-hide-tip
"Hide pos-tip's tooltip.")
(defun pos-tip-calibrate-frame-offset (&optional frame)
"Return coordinates of FRAME orign relative to the top left corner of
the FRAME extent, like (LEFT . TOP). The return value is recorded to
`pos-tip-frame-offset'.
Note that this function does't correctly work for X frame and Emacs 22."
(setq pos-tip-frame-offset nil)
(let* ((window (frame-first-window frame))
(delete-frame-functions
'((lambda (frame)
(if (equal (frame-parameter frame 'name) "tooltip")
(setq pos-tip-frame-offset
(cons (eval (frame-parameter frame 'left))
(eval (frame-parameter frame 'top))))))))
(pos-tip-border-width 0)
(pos-tip-internal-border-width 1)
(rpos (pos-tip-show ""
`(nil . ,(frame-parameter frame 'background-color))
(window-start window) window
nil nil 'relative nil 0)))
(sit-for 0)
(pos-tip-hide)
(and pos-tip-frame-offset
(setq pos-tip-frame-offset
(cons (- (car pos-tip-frame-offset)
(car rpos)
(eval (frame-parameter frame 'left)))
(- (cdr pos-tip-frame-offset)
(cdr rpos)
(eval (frame-parameter frame 'top))))))))
(defun pos-tip-w32-max-width-height (&optional keep-maximize)
"Maximize the currently selected frame temporarily and set
`pos-tip-w32-saved-max-width-height' the effective display size in order
to become possible to calculate the absolute location of tooltip.
KEEP-MAXIMIZE non-nil means leave the frame maximized.
Note that this function is usable only in Emacs 23 for MS-Windows."
(interactive)
(unless (eq window-system 'w32)
(error "`pos-tip-w32-max-width-height' can be used only in w32 frame."))
;; Maximize frame
(with-no-warnings (w32-send-sys-command 61488))
(sit-for 0)
(let ((offset (pos-tip-calibrate-frame-offset)))
(prog1
(setq pos-tip-w32-saved-max-width-height
(cons (frame-pixel-width)
(+ (frame-pixel-height)
(- (cdr offset) (car offset)))))
(if (called-interactively-p 'interactive)
(message "%S" pos-tip-w32-saved-max-width-height))
(unless keep-maximize
;; Restore frame
(with-no-warnings (w32-send-sys-command 61728))))))
(provide 'pos-tip)
;;;
;;; pos-tip.el ends here

View File

@ -0,0 +1,447 @@
;;; projectile-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "projectile" "projectile.el" (22297 53344 702923
;;;;;; 54000))
;;; Generated autoloads from projectile.el
(autoload 'projectile-version "projectile" "\
Get the Projectile version as string.
If called interactively or if SHOW-VERSION is non-nil, show the
version in the echo area and the messages buffer.
The returned string includes both, the version from package.el
and the library version, if both a present and different.
If the version number could not be determined, signal an error,
if called interactively, or if SHOW-VERSION is non-nil, otherwise
just return nil.
\(fn &optional SHOW-VERSION)" t nil)
(autoload 'projectile-invalidate-cache "projectile" "\
Remove the current project's files from `projectile-projects-cache'.
With a prefix argument ARG prompts for the name of the project whose cache
to invalidate.
\(fn ARG)" t nil)
(autoload 'projectile-purge-file-from-cache "projectile" "\
Purge FILE from the cache of the current project.
\(fn FILE)" t nil)
(autoload 'projectile-purge-dir-from-cache "projectile" "\
Purge DIR from the cache of the current project.
\(fn DIR)" t nil)
(autoload 'projectile-cache-current-file "projectile" "\
Add the currently visited file to the cache.
\(fn)" t nil)
(autoload 'projectile-switch-to-buffer "projectile" "\
Switch to a project buffer.
\(fn)" t nil)
(autoload 'projectile-switch-to-buffer-other-window "projectile" "\
Switch to a project buffer and show it in another window.
\(fn)" t nil)
(autoload 'projectile-display-buffer "projectile" "\
Display a project buffer in another window without selecting it.
\(fn)" t nil)
(autoload 'projectile-project-buffers-other-buffer "projectile" "\
Switch to the most recently selected buffer project buffer.
Only buffers not visible in windows are returned.
\(fn)" t nil)
(autoload 'projectile-multi-occur "projectile" "\
Do a `multi-occur' in the project's buffers.
\(fn)" t nil)
(autoload 'projectile-find-other-file "projectile" "\
Switch between files with the same name but different extensions.
With FLEX-MATCHING, match any file that contains the base name of current file.
Other file extensions can be customized with the variable `projectile-other-file-alist'.
\(fn &optional FLEX-MATCHING)" t nil)
(autoload 'projectile-find-other-file-other-window "projectile" "\
Switch between files with the same name but different extensions in other window.
With FLEX-MATCHING, match any file that contains the base name of current file.
Other file extensions can be customized with the variable `projectile-other-file-alist'.
\(fn &optional FLEX-MATCHING)" t nil)
(autoload 'projectile-find-file-dwim "projectile" "\
Jump to a project's files using completion based on context.
With a prefix ARG invalidates the cache first.
If point is on a filename, Projectile first tries to search for that
file in project:
- If it finds just a file, it switches to that file instantly. This works even
if the filename is incomplete, but there's only a single file in the current project
that matches the filename at point. For example, if there's only a single file named
\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
`projectile-find-file' still switches to \"projectile/projectile.el\" immediately
because this is the only filename that matches.
- If it finds a list of files, the list is displayed for selecting. A list of
files is displayed when a filename appears more than one in the project or the
filename at point is a prefix of more than two files in a project. For example,
if `projectile-find-file' is executed on a filepath like \"projectile/\", it lists
the content of that directory. If it is executed on a partial filename like
\"projectile/a\", a list of files with character 'a' in that directory is presented.
- If it finds nothing, display a list of all files in project for selecting.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-file-dwim-other-window "projectile" "\
Jump to a project's files using completion based on context in other window.
With a prefix ARG invalidates the cache first.
If point is on a filename, Projectile first tries to search for that
file in project:
- If it finds just a file, it switches to that file instantly. This works even
if the filename is incomplete, but there's only a single file in the current project
that matches the filename at point. For example, if there's only a single file named
\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete),
`projectile-find-file' still switches to \"projectile/projectile.el\"
immediately because this is the only filename that matches.
- If it finds a list of files, the list is displayed for selecting. A list of
files is displayed when a filename appears more than one in the project or the
filename at point is a prefix of more than two files in a project. For example,
if `projectile-find-file' is executed on a filepath like \"projectile/\", it lists
the content of that directory. If it is executed on a partial filename
like \"projectile/a\", a list of files with character 'a' in that directory
is presented.
- If it finds nothing, display a list of all files in project for selecting.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-file "projectile" "\
Jump to a project's file using completion.
With a prefix ARG invalidates the cache first.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-file-other-window "projectile" "\
Jump to a project's file using completion and show it in another window.
With a prefix ARG invalidates the cache first.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-dir "projectile" "\
Jump to a project's directory using completion.
With a prefix ARG invalidates the cache first.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-dir-other-window "projectile" "\
Jump to a project's directory in other window using completion.
With a prefix ARG invalidates the cache first.
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-test-file "projectile" "\
Jump to a project's test file using completion.
With a prefix ARG invalidates the cache first.
\(fn &optional ARG)" t nil)
(autoload 'projectile-project-info "projectile" "\
Display info for current project.
\(fn)" t nil)
(autoload 'projectile-find-implementation-or-test-other-window "projectile" "\
Open matching implementation or test file in other window.
\(fn)" t nil)
(autoload 'projectile-toggle-between-implementation-and-test "projectile" "\
Toggle between an implementation file and its test file.
\(fn)" t nil)
(autoload 'projectile-grep "projectile" "\
Perform rgrep in the project.
With a prefix ARG asks for files (globbing-aware) which to grep in.
With prefix ARG of `-' (such as `M--'), default the files (without prompt),
to `projectile-grep-default-files'.
With REGEXP given, don't query the user for a regexp.
\(fn &optional REGEXP ARG)" t nil)
(autoload 'projectile-ag "projectile" "\
Run an ag search with SEARCH-TERM in the project.
With an optional prefix argument ARG SEARCH-TERM is interpreted as a
regular expression.
\(fn SEARCH-TERM &optional ARG)" t nil)
(autoload 'projectile-regenerate-tags "projectile" "\
Regenerate the project's [e|g]tags.
\(fn)" t nil)
(autoload 'projectile-find-tag "projectile" "\
Find tag in project.
\(fn)" t nil)
(autoload 'projectile-run-command-in-root "projectile" "\
Invoke `execute-extended-command' in the project's root.
\(fn)" t nil)
(autoload 'projectile-run-shell-command-in-root "projectile" "\
Invoke `shell-command' in the project's root.
\(fn)" t nil)
(autoload 'projectile-run-async-shell-command-in-root "projectile" "\
Invoke `async-shell-command' in the project's root.
\(fn)" t nil)
(autoload 'projectile-run-shell "projectile" "\
Invoke `shell' in the project's root.
\(fn)" t nil)
(autoload 'projectile-run-eshell "projectile" "\
Invoke `eshell' in the project's root.
\(fn)" t nil)
(autoload 'projectile-run-term "projectile" "\
Invoke `term' in the project's root.
\(fn PROGRAM)" t nil)
(autoload 'projectile-replace "projectile" "\
Replace literal string in project using non-regexp `tags-query-replace'.
With a prefix argument ARG prompts you for a directory on which
to run the replacement.
\(fn &optional ARG)" t nil)
(autoload 'projectile-replace-regexp "projectile" "\
Replace a regexp in the project using `tags-query-replace'.
With a prefix argument ARG prompts you for a directory on which
to run the replacement.
\(fn &optional ARG)" t nil)
(autoload 'projectile-kill-buffers "projectile" "\
Kill all project buffers.
\(fn)" t nil)
(autoload 'projectile-save-project-buffers "projectile" "\
Save all project buffers.
\(fn)" t nil)
(autoload 'projectile-dired "projectile" "\
Open `dired' at the root of the project.
\(fn)" t nil)
(autoload 'projectile-vc "projectile" "\
Open `vc-dir' at the root of the project.
For git projects `magit-status-internal' is used if available.
For hg projects `monky-status' is used if available.
\(fn &optional PROJECT-ROOT)" t nil)
(autoload 'projectile-recentf "projectile" "\
Show a list of recently visited files in a project.
\(fn)" t nil)
(autoload 'projectile-compile-project "projectile" "\
Run project compilation command.
Normally you'll be prompted for a compilation command, unless
variable `compilation-read-command'. You can force the prompt
with a prefix ARG.
\(fn ARG &optional DIR)" t nil)
(autoload 'projectile-test-project "projectile" "\
Run project test command.
Normally you'll be prompted for a compilation command, unless
variable `compilation-read-command'. You can force the prompt
with a prefix ARG.
\(fn ARG)" t nil)
(autoload 'projectile-run-project "projectile" "\
Run project run command.
Normally you'll be prompted for a compilation command, unless
variable `compilation-read-command'. You can force the prompt
with a prefix ARG.
\(fn ARG)" t nil)
(autoload 'projectile-switch-project "projectile" "\
Switch to a project we have visited before.
Invokes the command referenced by `projectile-switch-project-action' on switch.
With a prefix ARG invokes `projectile-commander' instead of
`projectile-switch-project-action.'
\(fn &optional ARG)" t nil)
(autoload 'projectile-switch-open-project "projectile" "\
Switch to a project we have currently opened.
Invokes the command referenced by `projectile-switch-project-action' on switch.
With a prefix ARG invokes `projectile-commander' instead of
`projectile-switch-project-action.'
\(fn &optional ARG)" t nil)
(autoload 'projectile-find-file-in-directory "projectile" "\
Jump to a file in a (maybe regular) DIRECTORY.
This command will first prompt for the directory the file is in.
\(fn &optional DIRECTORY)" t nil)
(autoload 'projectile-find-file-in-known-projects "projectile" "\
Jump to a file in any of the known projects.
\(fn)" t nil)
(autoload 'projectile-cleanup-known-projects "projectile" "\
Remove known projects that don't exist anymore.
\(fn)" t nil)
(autoload 'projectile-clear-known-projects "projectile" "\
Clear both `projectile-known-projects' and `projectile-known-projects-file'.
\(fn)" t nil)
(autoload 'projectile-remove-known-project "projectile" "\
Remove PROJECT from the list of known projects.
\(fn &optional PROJECT)" t nil)
(autoload 'projectile-remove-current-project-from-known-projects "projectile" "\
Remove the current project from the list of known projects.
\(fn)" t nil)
(autoload 'projectile-ibuffer "projectile" "\
Open an IBuffer window showing all buffers in the current project.
Let user choose another project when PREFIX is supplied.
\(fn PREFIX)" t nil)
(autoload 'projectile-commander "projectile" "\
Execute a Projectile command with a single letter.
The user is prompted for a single character indicating the action to invoke.
The `?' character describes then
available actions.
See `def-projectile-commander-method' for defining new methods.
\(fn)" t nil)
(autoload 'projectile-edit-dir-locals "projectile" "\
Edit or create a .dir-locals.el file of the project.
\(fn)" t nil)
(defvar projectile-mode-line '(:eval (if (file-remote-p default-directory) " Projectile" (format " Projectile[%s]" (projectile-project-name)))) "\
Mode line lighter for Projectile.
The value of this variable is a mode line template as in
`mode-line-format'. See Info Node `(elisp)Mode Line Format' for
details about mode line templates.
Customize this variable to change how Projectile displays its
status in the mode line. The default value displays the project
name. Set this variable to nil to disable the mode line
entirely.")
(custom-autoload 'projectile-mode-line "projectile" t)
(autoload 'projectile-mode "projectile" "\
Minor mode to assist project management and navigation.
When called interactively, toggle `projectile-mode'. With prefix
ARG, enable `projectile-mode' if ARG is positive, otherwise disable
it.
When called from Lisp, enable `projectile-mode' if ARG is omitted,
nil or positive. If ARG is `toggle', toggle `projectile-mode'.
Otherwise behave as if called interactively.
\\{projectile-mode-map}
\(fn &optional ARG)" t nil)
(defvar projectile-global-mode nil "\
Non-nil if Projectile-Global mode is enabled.
See the command `projectile-global-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 `projectile-global-mode'.")
(custom-autoload 'projectile-global-mode "projectile" nil)
(autoload 'projectile-global-mode "projectile" "\
Toggle Projectile mode in all buffers.
With prefix ARG, enable Projectile-Global mode if ARG is positive;
otherwise, disable it. If called from Lisp, enable the mode if
ARG is omitted or nil.
Projectile mode is enabled in all buffers where
`projectile-mode' would do it.
See `projectile-mode' for more information on Projectile mode.
\(fn &optional ARG)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; projectile-autoloads.el ends here

View File

@ -0,0 +1 @@
(define-package "projectile" "20160420.1508" "Manage and navigate projects in Emacs easily" '((dash "2.11.0") (pkg-info "0.4")) :url "https://github.com/bbatsov/projectile" :keywords '("project" "convenience"))

File diff suppressed because it is too large Load Diff