Remove old packages

This commit is contained in:
Mateus Pinto Rodrigues
2018-10-04 13:59:08 -03:00
parent d272c43bcd
commit f7abffa844
788 changed files with 0 additions and 364705 deletions

View File

@@ -1,174 +0,0 @@
;;; async-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "async" "async.el" (0 0 0 0))
;;; Generated autoloads from async.el
(autoload 'async-start-process "async" "\
Start the executable PROGRAM asynchronously. See `async-start'.
PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
process object when done. If FINISH-FUNC is nil, the future
object will return the process object when the program is
finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
working directory.
\(fn NAME PROGRAM FINISH-FUNC &rest PROGRAM-ARGS)" nil nil)
(autoload 'async-start "async" "\
Execute START-FUNC (often a lambda) in a subordinate Emacs process.
When done, the return value is passed to FINISH-FUNC. Example:
(async-start
;; What to do in the child process
(lambda ()
(message \"This is a test\")
(sleep-for 3)
222)
;; What to do when it finishes
(lambda (result)
(message \"Async process done, result should be 222: %s\"
result)))
If FINISH-FUNC is nil or missing, a future is returned that can
be inspected using `async-get', blocking until the value is
ready. Example:
(let ((proc (async-start
;; What to do in the child process
(lambda ()
(message \"This is a test\")
(sleep-for 3)
222))))
(message \"I'm going to do some work here\") ;; ....
(message \"Waiting on async process, result should be 222: %s\"
(async-get proc)))
If you don't want to use a callback, and you don't care about any
return value from the child process, pass the `ignore' symbol as
the second argument (if you don't, and never call `async-get', it
will leave *emacs* process buffers hanging around):
(async-start
(lambda ()
(delete-file \"a remote file on a slow link\" nil))
'ignore)
Note: Even when FINISH-FUNC is present, a future is still
returned except that it yields no value (since the value is
passed to FINISH-FUNC). Call `async-get' on such a future always
returns nil. It can still be useful, however, as an argument to
`async-ready' or `async-wait'.
\(fn START-FUNC &optional FINISH-FUNC)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "async" '("async-")))
;;;***
;;;### (autoloads nil "async-bytecomp" "async-bytecomp.el" (0 0 0
;;;;;; 0))
;;; Generated autoloads from async-bytecomp.el
(autoload 'async-byte-recompile-directory "async-bytecomp" "\
Compile all *.el files in DIRECTORY asynchronously.
All *.elc files are systematically deleted before proceeding.
\(fn DIRECTORY &optional QUIET)" nil nil)
(defvar async-bytecomp-package-mode nil "\
Non-nil if Async-Bytecomp-Package mode is enabled.
See the `async-bytecomp-package-mode' command
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 `async-bytecomp-package-mode'.")
(custom-autoload 'async-bytecomp-package-mode "async-bytecomp" nil)
(autoload 'async-bytecomp-package-mode "async-bytecomp" "\
Byte compile asynchronously packages installed with package.el.
Async compilation of packages can be controlled by
`async-bytecomp-allowed-packages'.
\(fn &optional ARG)" t nil)
(autoload 'async-byte-compile-file "async-bytecomp" "\
Byte compile Lisp code FILE asynchronously.
Same as `byte-compile-file' but asynchronous.
\(fn FILE)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "async-bytecomp" '("async-byte")))
;;;***
;;;### (autoloads nil "dired-async" "dired-async.el" (0 0 0 0))
;;; Generated autoloads from dired-async.el
(defvar dired-async-mode nil "\
Non-nil if Dired-Async mode is enabled.
See the `dired-async-mode' command
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 `dired-async-mode'.")
(custom-autoload 'dired-async-mode "dired-async" nil)
(autoload 'dired-async-mode "dired-async" "\
Do dired actions asynchronously.
\(fn &optional ARG)" t nil)
(autoload 'dired-async-do-copy "dired-async" "\
Run dired-do-copy asynchronously.
\(fn &optional ARG)" t nil)
(autoload 'dired-async-do-symlink "dired-async" "\
Run dired-do-symlink asynchronously.
\(fn &optional ARG)" t nil)
(autoload 'dired-async-do-hardlink "dired-async" "\
Run dired-do-hardlink asynchronously.
\(fn &optional ARG)" t nil)
(autoload 'dired-async-do-rename "dired-async" "\
Run dired-do-rename asynchronously.
\(fn &optional ARG)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "dired-async" '("dired-async-")))
;;;***
;;;### (autoloads nil "smtpmail-async" "smtpmail-async.el" (0 0 0
;;;;;; 0))
;;; Generated autoloads from smtpmail-async.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "smtpmail-async" '("async-smtpmail-")))
;;;***
;;;### (autoloads nil nil ("async-pkg.el") (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; async-autoloads.el ends here

View File

@@ -1,219 +0,0 @@
;;; async-bytecomp.el --- Compile elisp files asynchronously -*- lexical-binding: t -*-
;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
;; Authors: John Wiegley <jwiegley@gmail.com>
;; Thierry Volpiatto <thierry.volpiatto@gmail.com>
;; Keywords: dired async byte-compile
;; X-URL: https://github.com/jwiegley/dired-async
;; 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.
;; 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;
;; This package provide the `async-byte-recompile-directory' function
;; which allows, as the name says to recompile a directory outside of
;; your running emacs.
;; The benefit is your files will be compiled in a clean environment without
;; the old *.el files loaded.
;; Among other things, this fix a bug in package.el which recompile
;; the new files in the current environment with the old files loaded, creating
;; errors in most packages after upgrades.
;;
;; NB: This package is advicing the function `package--compile'.
;;; Code:
(require 'cl-lib)
(require 'async)
(defcustom async-bytecomp-allowed-packages
'(async helm helm-core helm-ls-git helm-ls-hg magit)
"Packages in this list will be compiled asynchronously by `package--compile'.
All the dependencies of these packages will be compiled async too,
so no need to add dependencies to this list.
The value of this variable can also be a list with a single element,
the symbol `all', in this case packages are always compiled asynchronously."
:group 'async
:type '(repeat (choice symbol)))
(defvar async-byte-compile-log-file
(concat user-emacs-directory "async-bytecomp.log"))
;;;###autoload
(defun async-byte-recompile-directory (directory &optional quiet)
"Compile all *.el files in DIRECTORY asynchronously.
All *.elc files are systematically deleted before proceeding."
(cl-loop with dir = (directory-files directory t "\\.elc\\'")
unless dir return nil
for f in dir
when (file-exists-p f) do (delete-file f))
;; Ensure async is reloaded when async.elc is deleted.
;; This happen when recompiling its own directory.
(load "async")
(let ((call-back
(lambda (&optional _ignore)
(if (file-exists-p async-byte-compile-log-file)
(let ((buf (get-buffer-create byte-compile-log-buffer))
(n 0))
(with-current-buffer buf
(goto-char (point-max))
(let ((inhibit-read-only t))
(insert-file-contents async-byte-compile-log-file)
(compilation-mode))
(display-buffer buf)
(delete-file async-byte-compile-log-file)
(unless quiet
(save-excursion
(goto-char (point-min))
(while (re-search-forward "^.*:Error:" nil t)
(cl-incf n)))
(if (> n 0)
(message "Failed to compile %d files in directory `%s'" n directory)
(message "Directory `%s' compiled asynchronously with warnings" directory)))))
(unless quiet
(message "Directory `%s' compiled asynchronously with success" directory))))))
(async-start
`(lambda ()
(require 'bytecomp)
,(async-inject-variables "\\`\\(load-path\\)\\|byte\\'")
(let ((default-directory (file-name-as-directory ,directory))
error-data)
(add-to-list 'load-path default-directory)
(byte-recompile-directory ,directory 0 t)
(when (get-buffer byte-compile-log-buffer)
(setq error-data (with-current-buffer byte-compile-log-buffer
(buffer-substring-no-properties (point-min) (point-max))))
(unless (string= error-data "")
(with-temp-file ,async-byte-compile-log-file
(erase-buffer)
(insert error-data))))))
call-back)
(unless quiet (message "Started compiling asynchronously directory %s" directory))))
(defvar package-archive-contents)
(defvar package-alist)
(declare-function package-desc-reqs "package.el" (cl-x))
(defun async-bytecomp--get-package-deps (pkg &optional only)
;; Same as `package--get-deps' but parse instead `package-archive-contents'
;; because PKG is not already installed and not present in `package-alist'.
;; However fallback to `package-alist' in case PKG no more present
;; in `package-archive-contents' due to modification to `package-archives'.
;; See issue #58.
(let* ((pkg-desc (cadr (or (assq pkg package-archive-contents)
(assq pkg package-alist))))
(direct-deps (cl-loop for p in (package-desc-reqs pkg-desc)
for name = (car p)
when (or (assq name package-archive-contents)
(assq name package-alist))
collect name))
(indirect-deps (unless (eq only 'direct)
(delete-dups
(cl-loop for p in direct-deps append
(async-bytecomp--get-package-deps p))))))
(cl-case only
(direct direct-deps)
(separate (list direct-deps indirect-deps))
(indirect indirect-deps)
(t (delete-dups (append direct-deps indirect-deps))))))
(defun async-bytecomp-get-allowed-pkgs ()
(when (and async-bytecomp-allowed-packages
(listp async-bytecomp-allowed-packages))
(if package-archive-contents
(cl-loop for p in async-bytecomp-allowed-packages
when (assq p package-archive-contents)
append (async-bytecomp--get-package-deps p) into reqs
finally return
(delete-dups
(append async-bytecomp-allowed-packages reqs)))
async-bytecomp-allowed-packages)))
(defadvice package--compile (around byte-compile-async)
(let ((cur-package (package-desc-name pkg-desc))
(pkg-dir (package-desc-dir pkg-desc)))
(if (or (equal async-bytecomp-allowed-packages '(all))
(memq cur-package (async-bytecomp-get-allowed-pkgs)))
(progn
(when (eq cur-package 'async)
(fmakunbound 'async-byte-recompile-directory))
;; Add to `load-path' the latest version of async and
;; reload it when reinstalling async.
(when (string= cur-package "async")
(cl-pushnew pkg-dir load-path)
(load "async-bytecomp"))
;; `async-byte-recompile-directory' will add directory
;; as needed to `load-path'.
(async-byte-recompile-directory (package-desc-dir pkg-desc) t))
ad-do-it)))
;;;###autoload
(define-minor-mode async-bytecomp-package-mode
"Byte compile asynchronously packages installed with package.el.
Async compilation of packages can be controlled by
`async-bytecomp-allowed-packages'."
:group 'async
:global t
(if async-bytecomp-package-mode
(ad-activate 'package--compile)
(ad-deactivate 'package--compile)))
;;;###autoload
(defun async-byte-compile-file (file)
"Byte compile Lisp code FILE asynchronously.
Same as `byte-compile-file' but asynchronous."
(interactive "fFile: ")
(let ((call-back
(lambda (&optional _ignore)
(let ((bn (file-name-nondirectory file)))
(if (file-exists-p async-byte-compile-log-file)
(let ((buf (get-buffer-create byte-compile-log-buffer))
start)
(with-current-buffer buf
(goto-char (setq start (point-max)))
(let ((inhibit-read-only t))
(insert-file-contents async-byte-compile-log-file)
(compilation-mode))
(display-buffer buf)
(delete-file async-byte-compile-log-file)
(save-excursion
(goto-char start)
(if (re-search-forward "^.*:Error:" nil t)
(message "Failed to compile `%s'" bn)
(message "`%s' compiled asynchronously with warnings" bn)))))
(message "`%s' compiled asynchronously with success" bn))))))
(async-start
`(lambda ()
(require 'bytecomp)
,(async-inject-variables "\\`load-path\\'")
(let ((default-directory ,(file-name-directory file)))
(add-to-list 'load-path default-directory)
(byte-compile-file ,file)
(when (get-buffer byte-compile-log-buffer)
(setq error-data (with-current-buffer byte-compile-log-buffer
(buffer-substring-no-properties (point-min) (point-max))))
(unless (string= error-data "")
(with-temp-file ,async-byte-compile-log-file
(erase-buffer)
(insert error-data))))))
call-back)))
(provide 'async-bytecomp)
;;; async-bytecomp.el ends here

View File

@@ -1,6 +0,0 @@
(define-package "async" "20180527.1030" "Asynchronous processing in Emacs" 'nil :keywords
'("async")
:url "https://github.com/jwiegley/emacs-async")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -1,392 +0,0 @@
;;; async.el --- Asynchronous processing in Emacs -*- lexical-binding: t -*-
;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
;; Author: John Wiegley <jwiegley@gmail.com>
;; Created: 18 Jun 2012
;; Version: 1.9.3
;; Keywords: async
;; X-URL: https://github.com/jwiegley/emacs-async
;; 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.
;; 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Adds the ability to call asynchronous functions and process with ease. See
;; the documentation for `async-start' and `async-start-process'.
;;; Code:
(eval-when-compile (require 'cl-lib))
(defgroup async nil
"Simple asynchronous processing in Emacs"
:group 'emacs)
(defcustom async-variables-noprops-function #'async-variables-noprops
"Default function to remove text properties in variables."
:group 'async
:type 'function)
(defvar async-debug nil)
(defvar async-send-over-pipe t)
(defvar async-in-child-emacs nil)
(defvar async-callback nil)
(defvar async-callback-for-process nil)
(defvar async-callback-value nil)
(defvar async-callback-value-set nil)
(defvar async-current-process nil)
(defvar async--procvar nil)
(defun async-variables-noprops (sequence)
"Remove text properties in SEQUENCE.
Argument SEQUENCE may be a list or a string, if anything else it
is returned unmodified.
Note that this is a naive function that doesn't remove text properties
in SEQUENCE recursively, only at the first level which suffice in most
cases."
(cond ((stringp sequence)
(substring-no-properties sequence))
((listp sequence)
(cl-loop for elm in sequence
if (stringp elm)
collect (substring-no-properties elm)
else collect elm))
(t sequence)))
(defun async-inject-variables
(include-regexp &optional predicate exclude-regexp noprops)
"Return a `setq' form that replicates part of the calling environment.
It sets the value for every variable matching INCLUDE-REGEXP and
also PREDICATE. It will not perform injection for any variable
matching EXCLUDE-REGEXP (if present) or representing a syntax-table
i.e. ending by \"-syntax-table\".
When NOPROPS is non nil it tries to strip out text properties of each
variable's value with `async-variables-noprops-function'.
It is intended to be used as follows:
(async-start
`(lambda ()
(require 'smtpmail)
(with-temp-buffer
(insert ,(buffer-substring-no-properties (point-min) (point-max)))
;; Pass in the variable environment for smtpmail
,(async-inject-variables \"\\`\\(smtpmail\\|\\(user-\\)?mail\\)-\")
(smtpmail-send-it)))
'ignore)"
`(setq
,@(let (bindings)
(mapatoms
(lambda (sym)
(let* ((sname (and (boundp sym) (symbol-name sym)))
(value (and sname (symbol-value sym))))
(when (and sname
(or (null include-regexp)
(string-match include-regexp sname))
(or (null exclude-regexp)
(not (string-match exclude-regexp sname)))
(not (string-match "-syntax-table\\'" sname)))
(unless (or (stringp value)
(memq value '(nil t))
(numberp value)
(vectorp value))
(setq value `(quote ,value)))
(when noprops
(setq value (funcall async-variables-noprops-function
value)))
(when (or (null predicate)
(funcall predicate sym))
(setq bindings (cons value bindings)
bindings (cons sym bindings)))))))
bindings)))
(defalias 'async-inject-environment 'async-inject-variables)
(defun async-handle-result (func result buf)
(if (null func)
(progn
(set (make-local-variable 'async-callback-value) result)
(set (make-local-variable 'async-callback-value-set) t))
(unwind-protect
(if (and (listp result)
(eq 'async-signal (nth 0 result)))
(signal (car (nth 1 result))
(cdr (nth 1 result)))
(funcall func result))
(unless async-debug
(kill-buffer buf)))))
(defun async-when-done (proc &optional _change)
"Process sentinel used to retrieve the value from the child process."
(when (eq 'exit (process-status proc))
(with-current-buffer (process-buffer proc)
(let ((async-current-process proc))
(if (= 0 (process-exit-status proc))
(if async-callback-for-process
(if async-callback
(prog1
(funcall async-callback proc)
(unless async-debug
(kill-buffer (current-buffer))))
(set (make-local-variable 'async-callback-value) proc)
(set (make-local-variable 'async-callback-value-set) t))
(goto-char (point-max))
(backward-sexp)
(async-handle-result async-callback (read (current-buffer))
(current-buffer)))
(set (make-local-variable 'async-callback-value)
(list 'error
(format "Async process '%s' failed with exit code %d"
(process-name proc) (process-exit-status proc))))
(set (make-local-variable 'async-callback-value-set) t))))))
(defun async--receive-sexp (&optional stream)
(let ((sexp (decode-coding-string (base64-decode-string
(read stream)) 'utf-8-auto))
;; Parent expects UTF-8 encoded text.
(coding-system-for-write 'utf-8-auto))
(if async-debug
(message "Received sexp {{{%s}}}" (pp-to-string sexp)))
(setq sexp (read sexp))
(if async-debug
(message "Read sexp {{{%s}}}" (pp-to-string sexp)))
(eval sexp)))
(defun async--insert-sexp (sexp)
(let (print-level
print-length
(print-escape-nonascii t)
(print-circle t))
(prin1 sexp (current-buffer))
;; Just in case the string we're sending might contain EOF
(encode-coding-region (point-min) (point-max) 'utf-8-auto)
(base64-encode-region (point-min) (point-max) t)
(goto-char (point-min)) (insert ?\")
(goto-char (point-max)) (insert ?\" ?\n)))
(defun async--transmit-sexp (process sexp)
(with-temp-buffer
(if async-debug
(message "Transmitting sexp {{{%s}}}" (pp-to-string sexp)))
(async--insert-sexp sexp)
(process-send-region process (point-min) (point-max))))
(defun async-batch-invoke ()
"Called from the child Emacs process' command-line."
;; Make sure 'message' and 'prin1' encode stuff in UTF-8, as parent
;; process expects.
(let ((coding-system-for-write 'utf-8-auto))
(setq async-in-child-emacs t
debug-on-error async-debug)
(if debug-on-error
(prin1 (funcall
(async--receive-sexp (unless async-send-over-pipe
command-line-args-left))))
(condition-case err
(prin1 (funcall
(async--receive-sexp (unless async-send-over-pipe
command-line-args-left))))
(error
(prin1 (list 'async-signal err)))))))
(defun async-ready (future)
"Query a FUTURE to see if it is ready.
I.e., if no blocking
would result from a call to `async-get' on that FUTURE."
(and (memq (process-status future) '(exit signal))
(let ((buf (process-buffer future)))
(if (buffer-live-p buf)
(with-current-buffer buf
async-callback-value-set)
t))))
(defun async-wait (future)
"Wait for FUTURE to become ready."
(while (not (async-ready future))
(sleep-for 0.05)))
(defun async-get (future)
"Get the value from process FUTURE when it is ready.
FUTURE is returned by `async-start' or `async-start-process' when
its FINISH-FUNC is nil."
(and future (async-wait future))
(let ((buf (process-buffer future)))
(when (buffer-live-p buf)
(with-current-buffer buf
(async-handle-result
#'identity async-callback-value (current-buffer))))))
(defun async-message-p (value)
"Return true of VALUE is an async.el message packet."
(and (listp value)
(plist-get value :async-message)))
(defun async-send (&rest args)
"Send the given messages to the asychronous Emacs PROCESS."
(let ((args (append args '(:async-message t))))
(if async-in-child-emacs
(if async-callback
(funcall async-callback args))
(async--transmit-sexp (car args) (list 'quote (cdr args))))))
(defun async-receive ()
"Send the given messages to the asychronous Emacs PROCESS."
(async--receive-sexp))
;;;###autoload
(defun async-start-process (name program finish-func &rest program-args)
"Start the executable PROGRAM asynchronously. See `async-start'.
PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
process object when done. If FINISH-FUNC is nil, the future
object will return the process object when the program is
finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
working directory."
(let* ((buf (generate-new-buffer (concat "*" name "*")))
(proc (let ((process-connection-type nil))
(apply #'start-process name buf program program-args))))
(with-current-buffer buf
(set (make-local-variable 'async-callback) finish-func)
(set-process-sentinel proc #'async-when-done)
(unless (string= name "emacs")
(set (make-local-variable 'async-callback-for-process) t))
proc)))
(defvar async-quiet-switch "-Q"
"The Emacs parameter to use to call emacs without config.
Can be one of \"-Q\" or \"-q\".
Default is \"-Q\" but it is sometimes useful to use \"-q\" to have a
enhanced config or some more variables loaded.")
;;;###autoload
(defun async-start (start-func &optional finish-func)
"Execute START-FUNC (often a lambda) in a subordinate Emacs process.
When done, the return value is passed to FINISH-FUNC. Example:
(async-start
;; What to do in the child process
(lambda ()
(message \"This is a test\")
(sleep-for 3)
222)
;; What to do when it finishes
(lambda (result)
(message \"Async process done, result should be 222: %s\"
result)))
If FINISH-FUNC is nil or missing, a future is returned that can
be inspected using `async-get', blocking until the value is
ready. Example:
(let ((proc (async-start
;; What to do in the child process
(lambda ()
(message \"This is a test\")
(sleep-for 3)
222))))
(message \"I'm going to do some work here\") ;; ....
(message \"Waiting on async process, result should be 222: %s\"
(async-get proc)))
If you don't want to use a callback, and you don't care about any
return value from the child process, pass the `ignore' symbol as
the second argument (if you don't, and never call `async-get', it
will leave *emacs* process buffers hanging around):
(async-start
(lambda ()
(delete-file \"a remote file on a slow link\" nil))
'ignore)
Note: Even when FINISH-FUNC is present, a future is still
returned except that it yields no value (since the value is
passed to FINISH-FUNC). Call `async-get' on such a future always
returns nil. It can still be useful, however, as an argument to
`async-ready' or `async-wait'."
(let ((sexp start-func)
;; Subordinate Emacs will send text encoded in UTF-8.
(coding-system-for-read 'utf-8-auto))
(setq async--procvar
(async-start-process
"emacs" (file-truename
(expand-file-name invocation-name
invocation-directory))
finish-func
async-quiet-switch "-l"
;; Using `locate-library' ensure we use the right file
;; when the .elc have been deleted.
(locate-library "async")
"-batch" "-f" "async-batch-invoke"
(if async-send-over-pipe
"<none>"
(with-temp-buffer
(async--insert-sexp (list 'quote sexp))
(buffer-string)))))
(if async-send-over-pipe
(async--transmit-sexp async--procvar (list 'quote sexp)))
async--procvar))
(defmacro async-sandbox(func)
"Evaluate FUNC in a separate Emacs process, synchronously."
`(async-get (async-start ,func)))
(defun async--fold-left (fn forms bindings)
(let ((res forms))
(dolist (binding bindings)
(setq res (funcall fn res
(if (listp binding)
binding
(list binding)))))
res))
(defmacro async-let (bindings &rest forms)
"Implements `let', but each binding is established asynchronously.
For example:
(async-let ((x (foo))
(y (bar)))
(message \"%s %s\" x y))
expands to ==>
(async-start (foo)
(lambda (x)
(async-start (bar)
(lambda (y)
(message \"%s %s\" x y)))))"
(declare (indent 1))
(async--fold-left
(lambda (acc binding)
(let ((fun (pcase (cadr binding)
((and (pred functionp) f) f)
(f `(lambda () ,f)))))
`(async-start ,fun
(lambda (,(car binding))
,acc))))
`(progn ,@forms)
(reverse bindings)))
(provide 'async)
;;; async.el ends here

View File

@@ -1,405 +0,0 @@
;;; dired-async.el --- Asynchronous dired actions -*- lexical-binding: t -*-
;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
;; Authors: John Wiegley <jwiegley@gmail.com>
;; Thierry Volpiatto <thierry.volpiatto@gmail.com>
;; Keywords: dired async network
;; X-URL: https://github.com/jwiegley/dired-async
;; 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.
;; 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; This file provide a redefinition of `dired-create-file' function,
;; performs copies, moves and all what is handled by `dired-create-file'
;; in the background using a slave Emacs process,
;; by means of the async.el module.
;; To use it, put this in your .emacs:
;; (dired-async-mode 1)
;; This will enable async copy/rename etc...
;; in dired and helm.
;;; Code:
(require 'cl-lib)
(require 'dired-aux)
(require 'async)
(eval-when-compile
(defvar async-callback))
(defgroup dired-async nil
"Copy rename files asynchronously from dired."
:group 'dired)
(defcustom dired-async-env-variables-regexp
"\\`\\(tramp-\\(default\\|connection\\|remote\\)\\|ange-ftp\\)-.*"
"Variables matching this regexp will be loaded on Child Emacs."
:type 'regexp
:group 'dired-async)
(defcustom dired-async-message-function 'dired-async-mode-line-message
"Function to use to notify result when operation finish.
Should take same args as `message'."
:group 'dired-async
:type 'function)
(defcustom dired-async-log-file "/tmp/dired-async.log"
"File use to communicate errors from Child Emacs to host Emacs."
:group 'dired-async
:type 'string)
(defcustom dired-async-mode-lighter '(:eval
(when (eq major-mode 'dired-mode)
" Async"))
"Mode line lighter used for `dired-async-mode'."
:group 'dired-async
:risky t
:type 'sexp)
(defface dired-async-message
'((t (:foreground "yellow")))
"Face used for mode-line message."
:group 'dired-async)
(defface dired-async-failures
'((t (:foreground "red")))
"Face used for mode-line message."
:group 'dired-async)
(defface dired-async-mode-message
'((t (:foreground "Gold")))
"Face used for `dired-async--modeline-mode' lighter."
:group 'dired-async)
(define-minor-mode dired-async--modeline-mode
"Notify mode-line that an async process run."
:group 'dired-async
:global t
:lighter (:eval (propertize (format " [%s Async job(s) running]"
(length (dired-async-processes)))
'face 'dired-async-mode-message))
(unless dired-async--modeline-mode
(let ((visible-bell t)) (ding))))
(defun dired-async-mode-line-message (text face &rest args)
"Notify end of operation in `mode-line'."
(message nil)
(let ((mode-line-format (concat
" " (propertize
(if args
(apply #'format text args)
text)
'face face))))
(force-mode-line-update)
(sit-for 3)
(force-mode-line-update)))
(defun dired-async-processes ()
(cl-loop for p in (process-list)
when (cl-loop for c in (process-command p) thereis
(string= "async-batch-invoke" c))
collect p))
(defun dired-async-kill-process ()
(interactive)
(let* ((processes (dired-async-processes))
(proc (car (last processes))))
(and proc (delete-process proc))
(unless (> (length processes) 1)
(dired-async--modeline-mode -1))))
(defun dired-async-after-file-create (total operation failures skipped)
"Callback function used for operation handled by `dired-create-file'."
(unless (dired-async-processes)
;; Turn off mode-line notification
;; only when last process end.
(dired-async--modeline-mode -1))
(when operation
(if (file-exists-p dired-async-log-file)
(progn
(pop-to-buffer (get-buffer-create dired-log-buffer))
(goto-char (point-max))
(setq inhibit-read-only t)
(insert "Error: ")
(insert-file-contents dired-async-log-file)
(special-mode)
(shrink-window-if-larger-than-buffer)
(delete-file dired-async-log-file))
(run-with-timer
0.1 nil
(lambda ()
;; First send error messages.
(cond (failures
(funcall dired-async-message-function
"%s failed for %d of %d file%s -- See *Dired log* buffer"
'dired-async-failures
(car operation) (length failures)
total (dired-plural-s total)))
(skipped
(funcall dired-async-message-function
"%s: %d of %d file%s skipped -- See *Dired log* buffer"
'dired-async-failures
(car operation) (length skipped) total
(dired-plural-s total))))
(when dired-buffers
(cl-loop for (_f . b) in dired-buffers
when (buffer-live-p b)
do (with-current-buffer b (revert-buffer nil t))))
;; Finally send the success message.
(funcall dired-async-message-function
"Asynchronous %s of %s on %s file%s done"
'dired-async-message
(car operation) (cadr operation)
total (dired-plural-s total)))))))
(defun dired-async-maybe-kill-ftp ()
"Return a form to kill ftp process in child emacs."
(quote
(progn
(require 'cl-lib)
(let ((buf (cl-loop for b in (buffer-list)
thereis (and (string-match
"\\`\\*ftp.*"
(buffer-name b)) b))))
(when buf (kill-buffer buf))))))
(defvar overwrite-query)
(defun dired-async-create-files (file-creator operation fn-list name-constructor
&optional _marker-char)
"Same as `dired-create-files' but asynchronous.
See `dired-create-files' for the behavior of arguments."
(setq overwrite-query nil)
(let ((total (length fn-list))
failures async-fn-list skipped callback
async-quiet-switch)
(let (to)
(dolist (from fn-list)
(setq to (funcall name-constructor from))
(if (and (equal to from)
(null (eq file-creator 'backup-file)))
(progn
(setq to nil)
(dired-log "Cannot %s to same file: %s\n"
(downcase operation) from)))
(if (not to)
(setq skipped (cons (dired-make-relative from) skipped))
(let* ((overwrite (and (null (eq file-creator 'backup-file))
(file-exists-p to)))
(dired-overwrite-confirmed ; for dired-handle-overwrite
(and overwrite
(let ((help-form `(format "\
Type SPC or `y' to overwrite file `%s',
DEL or `n' to skip to next,
ESC or `q' to not overwrite any of the remaining files,
`!' to overwrite all remaining files with no more questions." ,to)))
(dired-query 'overwrite-query "Overwrite `%s'?" to)))))
;; Handle the `dired-copy-file' file-creator specially
;; When copying a directory to another directory or
;; possibly to itself or one of its subdirectories.
;; e.g "~/foo/" => "~/test/"
;; or "~/foo/" =>"~/foo/"
;; or "~/foo/ => ~/foo/bar/")
;; In this case the 'name-constructor' have set the destination
;; TO to "~/test/foo" because the old emacs23 behavior
;; of `copy-directory' was to not create the subdirectory
;; and instead copy the contents.
;; With the new behavior of `copy-directory'
;; (similar to the `cp' shell command) we don't
;; need such a construction of the target directory,
;; so modify the destination TO to "~/test/" instead of "~/test/foo/".
(let ((destname (file-name-directory to)))
(when (and (file-directory-p from)
(file-directory-p to)
(eq file-creator 'dired-copy-file))
(setq to destname))
;; If DESTNAME is a subdirectory of FROM, not a symlink,
;; and the method in use is copying, signal an error.
(and (eq t (car (file-attributes destname)))
(eq file-creator 'dired-copy-file)
(file-in-directory-p destname from)
(error "Cannot copy `%s' into its subdirectory `%s'"
from to)))
(if overwrite
(or (and dired-overwrite-confirmed
(push (cons from to) async-fn-list))
(progn
(push (dired-make-relative from) failures)
(dired-log "%s `%s' to `%s' failed\n"
operation from to)))
(push (cons from to) async-fn-list)))))
;; Fix tramp issue #80 with emacs-26, use "-q" only when needed.
(setq async-quiet-switch
(if (and (boundp 'tramp-cache-read-persistent-data)
async-fn-list
(cl-loop for (_from . to) in async-fn-list
thereis (file-remote-p to)))
"-q" "-Q"))
;; When failures have been printed to dired log add the date at bob.
(when (or failures skipped) (dired-log t))
;; When async-fn-list is empty that's mean only one file
;; had to be copied and user finally answer NO.
;; In this case async process will never start and callback
;; will have no chance to run, so notify failures here.
(unless async-fn-list
(cond (failures
(funcall dired-async-message-function
"%s failed for %d of %d file%s -- See *Dired log* buffer"
'dired-async-failures
operation (length failures)
total (dired-plural-s total)))
(skipped
(funcall dired-async-message-function
"%s: %d of %d file%s skipped -- See *Dired log* buffer"
'dired-async-failures
operation (length skipped) total
(dired-plural-s total)))))
;; Setup callback.
(setq callback
(lambda (&optional _ignore)
(dired-async-after-file-create
total (list operation (length async-fn-list)) failures skipped)
(when (string= (downcase operation) "rename")
(cl-loop for (file . to) in async-fn-list
for bf = (get-file-buffer file)
for destp = (file-exists-p to)
do (and bf destp
(with-current-buffer bf
(set-visited-file-name to t t))))))))
;; Start async process.
(when async-fn-list
(async-start `(lambda ()
(require 'cl-lib) (require 'dired-aux) (require 'dired-x)
,(async-inject-variables dired-async-env-variables-regexp)
(let ((dired-recursive-copies (quote always))
(dired-copy-preserve-time
,dired-copy-preserve-time))
(setq overwrite-backup-query nil)
;; Inline `backup-file' as long as it is not
;; available in emacs.
(defalias 'backup-file
;; Same feature as "cp -f --backup=numbered from to"
;; Symlinks are copied as file from source unlike
;; `dired-copy-file' which is same as cp -d.
;; Directories are omitted.
(lambda (from to ok)
(cond ((file-directory-p from) (ignore))
(t (let ((count 0))
(while (let ((attrs (file-attributes to)))
(and attrs (null (nth 0 attrs))))
(cl-incf count)
(setq to (concat (file-name-sans-versions to)
(format ".~%s~" count)))))
(condition-case err
(copy-file from to ok dired-copy-preserve-time)
(file-date-error
(dired-log "Can't set date on %s:\n%s\n" from err)))))))
;; Now run the FILE-CREATOR function on files.
(cl-loop with fn = (quote ,file-creator)
for (from . dest) in (quote ,async-fn-list)
do (condition-case err
(funcall fn from dest t)
(file-error
(dired-log "%s: %s\n" (car err) (cdr err)))
nil))
(when (get-buffer dired-log-buffer)
(dired-log t)
(with-current-buffer dired-log-buffer
(write-region (point-min) (point-max)
,dired-async-log-file))))
,(dired-async-maybe-kill-ftp))
callback)
;; Run mode-line notifications while process running.
(dired-async--modeline-mode 1)
(message "%s proceeding asynchronously..." operation))))
(defvar wdired-use-interactive-rename)
(defun dired-async-wdired-do-renames (old-fn &rest args)
;; Perhaps a better fix would be to ask for renaming BEFORE starting
;; OLD-FN when `wdired-use-interactive-rename' is non-nil. For now
;; just bind it to nil to ensure no questions will be asked between
;; each rename.
(let (wdired-use-interactive-rename)
(apply old-fn args)))
(defadvice wdired-do-renames (around wdired-async)
(let (wdired-use-interactive-rename)
ad-do-it))
(defadvice dired-create-files (around dired-async)
(dired-async-create-files file-creator operation fn-list
name-constructor marker-char))
;;;###autoload
(define-minor-mode dired-async-mode
"Do dired actions asynchronously."
:group 'dired-async
:lighter dired-async-mode-lighter
:global t
(if dired-async-mode
(if (fboundp 'advice-add)
(progn (advice-add 'dired-create-files :override #'dired-async-create-files)
(advice-add 'wdired-do-renames :around #'dired-async-wdired-do-renames))
(ad-activate 'dired-create-files)
(ad-activate 'wdired-do-renames))
(if (fboundp 'advice-remove)
(progn (advice-remove 'dired-create-files #'dired-async-create-files)
(advice-remove 'wdired-do-renames #'dired-async-wdired-do-renames))
(ad-deactivate 'dired-create-files)
(ad-deactivate 'wdired-do-renames))))
(defmacro dired-async--with-async-create-files (&rest body)
"Evaluate BODY with dired-create-files set to dired-async-create-files."
(declare (indent 0))
`(cl-letf (((symbol-function 'dired-create-files) #'dired-async-create-files))
,@body))
;;;###autoload
(defun dired-async-do-copy (&optional arg)
"Run dired-do-copy asynchronously."
(interactive "P")
(dired-async--with-async-create-files
(dired-do-copy arg)))
;;;###autoload
(defun dired-async-do-symlink (&optional arg)
"Run dired-do-symlink asynchronously."
(interactive "P")
(dired-async--with-async-create-files
(dired-do-symlink arg)))
;;;###autoload
(defun dired-async-do-hardlink (&optional arg)
"Run dired-do-hardlink asynchronously."
(interactive "P")
(dired-async--with-async-create-files
(dired-do-hardlink arg)))
;;;###autoload
(defun dired-async-do-rename (&optional arg)
"Run dired-do-rename asynchronously."
(interactive "P")
(dired-async--with-async-create-files
(dired-do-rename arg)))
(provide 'dired-async)
;;; dired-async.el ends here

View File

@@ -1,73 +0,0 @@
;;; smtpmail-async.el --- Send e-mail with smtpmail.el asynchronously -*- lexical-binding: t -*-
;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
;; Author: John Wiegley <jwiegley@gmail.com>
;; Created: 18 Jun 2012
;; Keywords: email async
;; X-URL: https://github.com/jwiegley/emacs-async
;; 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.
;; 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Send e-mail with smtpmail.el asynchronously. To use:
;;
;; (require 'smtpmail-async)
;;
;; (setq send-mail-function 'async-smtpmail-send-it
;; message-send-mail-function 'async-smtpmail-send-it)
;;
;; This assumes you already have smtpmail.el working.
;;; Code:
(defgroup smtpmail-async nil
"Send e-mail with smtpmail.el asynchronously"
:group 'smptmail)
(require 'async)
(require 'smtpmail)
(require 'message)
(defvar async-smtpmail-before-send-hook nil
"Hook running in the child emacs in `async-smtpmail-send-it'.
It is called just before calling `smtpmail-send-it'.")
(defun async-smtpmail-send-it ()
(let ((to (message-field-value "To"))
(buf-content (buffer-substring-no-properties
(point-min) (point-max))))
(message "Delivering message to %s..." to)
(async-start
`(lambda ()
(require 'smtpmail)
(with-temp-buffer
(insert ,buf-content)
(set-buffer-multibyte nil)
;; Pass in the variable environment for smtpmail
,(async-inject-variables
"\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-\\|auth-sources\\|epg\\|nsm"
nil "\\`\\(mail-header-format-function\\|smtpmail-address-buffer\\|mail-mode-abbrev-table\\)")
(run-hooks 'async-smtpmail-before-send-hook)
(smtpmail-send-it)))
(lambda (&optional _ignore)
(message "Delivering message to %s...done" to)))))
(provide 'smtpmail-async)
;;; smtpmail-async.el ends here

View File

@@ -1,65 +0,0 @@
;;; auto-complete-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "auto-complete" "auto-complete.el" (23210 30599
;;;;;; 700508 498000))
;;; Generated autoloads from auto-complete.el
(autoload 'auto-complete "auto-complete" "\
Start auto-completion at current point.
\(fn &optional SOURCES)" t nil)
(autoload 'auto-complete-mode "auto-complete" "\
AutoComplete mode
\(fn &optional ARG)" t nil)
(defvar global-auto-complete-mode nil "\
Non-nil if Global Auto-Complete mode is enabled.
See the `global-auto-complete-mode' command
for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `global-auto-complete-mode'.")
(custom-autoload 'global-auto-complete-mode "auto-complete" nil)
(autoload 'global-auto-complete-mode "auto-complete" "\
Toggle Auto-Complete mode in all buffers.
With prefix ARG, enable Global Auto-Complete mode if ARG is positive;
otherwise, disable it. If called from Lisp, enable the mode if
ARG is omitted or nil.
Auto-Complete mode is enabled in all buffers where
`auto-complete-mode-maybe' would do it.
See `auto-complete-mode' for more information on Auto-Complete mode.
\(fn &optional ARG)" t nil)
;;;***
;;;### (autoloads nil "auto-complete-config" "auto-complete-config.el"
;;;;;; (23210 30599 960508 879000))
;;; Generated autoloads from auto-complete-config.el
(autoload 'ac-config-default "auto-complete-config" "\
\(fn)" nil nil)
;;;***
;;;### (autoloads nil nil ("auto-complete-pkg.el") (23210 30599 700508
;;;;;; 498000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; auto-complete-autoloads.el ends here

View File

@@ -1,551 +0,0 @@
;;; auto-complete-config.el --- auto-complete additional configuations
;; Copyright (C) 2009, 2010 Tomohiro Matsuyama
;; Author: Tomohiro Matsuyama <m2ym.pub@gmail.com>
;; Keywords: convenience
;; Version: 1.5.0
;; 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:
;;
;;; Code:
(require 'cl-lib)
(require 'auto-complete)
(declare-function semantic-analyze-current-context "semantic/analyze")
(declare-function semantic-tag-class "semantic/tag")
(declare-function semantic-tag-function-arguments "semantic/tag")
(declare-function semantic-format-tag-type "semantic/format")
(declare-function semantic-format-tag-name "semantic/format")
(declare-function yas-expand-snippet "yasnippet")
(declare-function oref "eieio" (obj slot))
;;;; Additional sources
;; imenu
(defvar ac-imenu-index nil)
(ac-clear-variable-every-10-minutes 'ac-imenu-index)
(defun ac-imenu-candidates ()
(cl-loop with i = 0
with stack = (progn
(unless (local-variable-p 'ac-imenu-index)
(make-local-variable 'ac-imenu-index))
(or ac-imenu-index
(setq ac-imenu-index
(ignore-errors
(with-no-warnings
(imenu--make-index-alist))))))
with result
while (and stack (or (not (integerp ac-limit))
(< i ac-limit)))
for node = (pop stack)
if (consp node)
do
(let ((car (car node))
(cdr (cdr node)))
(if (consp cdr)
(mapc (lambda (child)
(push child stack))
cdr)
(when (and (stringp car)
(string-match (concat "^" (regexp-quote ac-prefix)) car))
;; Remove extra characters
(if (string-match "^.*\\(()\\|=\\|<>\\)$" car)
(setq car (substring car 0 (match-beginning 1))))
(push car result)
(cl-incf i))))
finally return (nreverse result)))
(ac-define-source imenu
'((depends imenu)
(candidates . ac-imenu-candidates)
(symbol . "s")))
;; gtags
(defface ac-gtags-candidate-face
'((t (:inherit ac-candidate-face :foreground "navy")))
"Face for gtags candidate"
:group 'auto-complete)
(defface ac-gtags-selection-face
'((t (:inherit ac-selection-face :background "navy")))
"Face for the gtags selected candidate."
:group 'auto-complete)
(defun ac-gtags-candidate ()
(ignore-errors
(split-string (shell-command-to-string (format "global -ciq %s" ac-prefix)) "\n")))
(ac-define-source gtags
'((candidates . ac-gtags-candidate)
(candidate-face . ac-gtags-candidate-face)
(selection-face . ac-gtags-selection-face)
(requires . 3)
(symbol . "s")))
;; yasnippet
(defface ac-yasnippet-candidate-face
'((t (:inherit ac-candidate-face
:background "sandybrown" :foreground "black")))
"Face for yasnippet candidate."
:group 'auto-complete)
(defface ac-yasnippet-selection-face
'((t (:inherit ac-selection-face :background "coral3")))
"Face for the yasnippet selected candidate."
:group 'auto-complete)
(defun ac-yasnippet-table-hash (table)
(cond
((fboundp 'yas/snippet-table-hash)
(yas/snippet-table-hash table))
((fboundp 'yas/table-hash)
(yas/table-hash table))))
(defun ac-yasnippet-table-parent (table)
(cond
((fboundp 'yas/snippet-table-parent)
(yas/snippet-table-parent table))
((fboundp 'yas/table-parent)
(yas/table-parent table))))
(defun ac-yasnippet-candidate-1 (table)
(with-no-warnings
(let ((hashtab (ac-yasnippet-table-hash table))
(parent (ac-yasnippet-table-parent table))
candidates)
(maphash (lambda (key value)
(push key candidates))
hashtab)
(setq candidates (all-completions ac-prefix (nreverse candidates)))
(if parent
(setq candidates
(append candidates (ac-yasnippet-candidate-1 parent))))
candidates)))
(defun ac-yasnippet-candidates ()
(with-no-warnings
(cond (;; 0.8 onwards
(fboundp 'yas-active-keys)
(all-completions ac-prefix (yas-active-keys)))
(;; >0.6.0
(fboundp 'yas/get-snippet-tables)
(apply 'append (mapcar 'ac-yasnippet-candidate-1
(condition-case nil
(yas/get-snippet-tables major-mode)
(wrong-number-of-arguments
(yas/get-snippet-tables)))))
)
(t
(let ((table
(if (fboundp 'yas/snippet-table)
;; <0.6.0
(yas/snippet-table major-mode)
;; 0.6.0
(yas/current-snippet-table))))
(if table
(ac-yasnippet-candidate-1 table)))))))
(ac-define-source yasnippet
'((depends yasnippet)
(candidates . ac-yasnippet-candidates)
(action . yas/expand)
(candidate-face . ac-yasnippet-candidate-face)
(selection-face . ac-yasnippet-selection-face)
(symbol . "a")))
;; semantic
(defun ac-semantic-candidates (prefix)
(with-no-warnings
(delete "" ; semantic sometimes returns an empty string
(mapcar (lambda (elem)
(cons (semantic-tag-name elem)
(semantic-tag-clone elem)))
(ignore-errors
(or (semantic-analyze-possible-completions
(semantic-analyze-current-context))
(senator-find-tag-for-completion prefix)))))))
(defun ac-semantic-doc (symbol)
(with-no-warnings
(let* ((proto (semantic-format-tag-summarize-with-file symbol nil t))
(doc (semantic-documentation-for-tag symbol))
(res proto))
(when doc
(setq res (concat res "\n\n" doc)))
res)))
(defun ac-semantic-action ()
(when (and (boundp 'yas-minor-mode) yas-minor-mode)
(let* ((tag (car (last (oref (semantic-analyze-current-context) prefix))))
(class (semantic-tag-class tag))
(args))
(when (eq class 'function)
(setq args (semantic-tag-function-arguments tag))
(yas-expand-snippet
(concat "("
(mapconcat
(lambda (arg)
(let ((arg-type (semantic-format-tag-type arg nil))
(arg-name (semantic-format-tag-name arg nil)))
(concat "${"
(if (string= arg-name "")
arg-type
(concat arg-type " " arg-name))
"}")))
args
", ")
")$0"))))))
(ac-define-source semantic
'((available . (or (require 'semantic-ia nil t)
(require 'semantic/ia nil t)))
(candidates . (ac-semantic-candidates ac-prefix))
(document . ac-semantic-doc)
(action . ac-semantic-action)
(prefix . cc-member)
(requires . 0)
(symbol . "m")))
(ac-define-source semantic-raw
'((available . (or (require 'semantic-ia nil t)
(require 'semantic/ia nil t)))
(candidates . (ac-semantic-candidates ac-prefix))
(document . ac-semantic-doc)
(action . ac-semantic-action)
(symbol . "s")))
;; eclim
(defun ac-eclim-candidates ()
(with-no-warnings
(cl-loop for c in (eclim/java-complete)
collect (nth 1 c))))
(ac-define-source eclim
'((candidates . ac-eclim-candidates)
(prefix . c-dot)
(requires . 0)
(symbol . "f")))
;; css
;; Copied from company-css.el
(defconst ac-css-property-alist
;; see http://www.w3.org/TR/CSS21/propidx.html
'(("azimuth" angle "left-side" "far-left" "left" "center-left" "center"
"center-right" "right" "far-right" "right-side" "behind" "leftwards"
"rightwards")
("background" background-color background-image background-repeat
background-attachment background-position)
("background-attachment" "scroll" "fixed")
("background-color" color "transparent")
("background-image" uri "none")
("background-position" percentage length "left" "center" "right" percentage
length "top" "center" "bottom" "left" "center" "right" "top" "center"
"bottom")
("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat")
("border" border-width border-style border-color)
("border-bottom" border)
("border-bottom-color" border-color)
("border-bottom-style" border-style)
("border-bottom-width" border-width)
("border-collapse" "collapse" "separate")
("border-color" color "transparent")
("border-left" border)
("border-left-color" border-color)
("border-left-style" border-style)
("border-left-width" border-width)
("border-right" border)
("border-right-color" border-color)
("border-right-style" border-style)
("border-right-width" border-width)
("border-spacing" length length)
("border-style" border-style)
("border-top" border)
("border-top-color" border-color)
("border-top-style" border-style)
("border-top-width" border-width)
("border-width" border-width)
("bottom" length percentage "auto")
("caption-side" "top" "bottom")
("clear" "none" "left" "right" "both")
("clip" shape "auto")
("color" color)
("content" "normal" "none" string uri counter "attr()" "open-quote"
"close-quote" "no-open-quote" "no-close-quote")
("counter-increment" identifier integer "none")
("counter-reset" identifier integer "none")
("cue" cue-before cue-after)
("cue-after" uri "none")
("cue-before" uri "none")
("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize"
"ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize"
"w-resize" "text" "wait" "help" "progress")
("direction" "ltr" "rtl")
("display" "inline" "block" "list-item" "run-in" "inline-block" "table"
"inline-table" "table-row-group" "table-header-group" "table-footer-group"
"table-row" "table-column-group" "table-column" "table-cell"
"table-caption" "none")
("elevation" angle "below" "level" "above" "higher" "lower")
("empty-cells" "show" "hide")
("float" "left" "right" "none")
("font" font-style font-variant font-weight font-size "/" line-height
font-family "caption" "icon" "menu" "message-box" "small-caption"
"status-bar")
("font-family" family-name generic-family)
("font-size" absolute-size relative-size length percentage)
("font-style" "normal" "italic" "oblique")
("font-variant" "normal" "small-caps")
("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400"
"500" "600" "700" "800" "900")
("height" length percentage "auto")
("left" length percentage "auto")
("letter-spacing" "normal" length)
("line-height" "normal" number length percentage)
("list-style" list-style-type list-style-position list-style-image)
("list-style-image" uri "none")
("list-style-position" "inside" "outside")
("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero"
"lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin"
"armenian" "georgian" "lower-alpha" "upper-alpha" "none")
("margin" margin-width)
("margin-bottom" margin-width)
("margin-left" margin-width)
("margin-right" margin-width)
("margin-top" margin-width)
("max-height" length percentage "none")
("max-width" length percentage "none")
("min-height" length percentage)
("min-width" length percentage)
("orphans" integer)
("outline" outline-color outline-style outline-width)
("outline-color" color "invert")
("outline-style" border-style)
("outline-width" border-width)
("overflow" "visible" "hidden" "scroll" "auto")
("padding" padding-width)
("padding-bottom" padding-width)
("padding-left" padding-width)
("padding-right" padding-width)
("padding-top" padding-width)
("page-break-after" "auto" "always" "avoid" "left" "right")
("page-break-before" "auto" "always" "avoid" "left" "right")
("page-break-inside" "avoid" "auto")
("pause" time percentage)
("pause-after" time percentage)
("pause-before" time percentage)
("pitch" frequency "x-low" "low" "medium" "high" "x-high")
("pitch-range" number)
("play-during" uri "mix" "repeat" "auto" "none")
("position" "static" "relative" "absolute" "fixed")
("quotes" string string "none")
("richness" number)
("right" length percentage "auto")
("speak" "normal" "none" "spell-out")
("speak-header" "once" "always")
("speak-numeral" "digits" "continuous")
("speak-punctuation" "code" "none")
("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster"
"slower")
("stress" number)
("table-layout" "auto" "fixed")
("text-align" "left" "right" "center" "justify")
("text-decoration" "none" "underline" "overline" "line-through" "blink")
("text-indent" length percentage)
("text-transform" "capitalize" "uppercase" "lowercase" "none")
("top" length percentage "auto")
("unicode-bidi" "normal" "embed" "bidi-override")
("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle"
"bottom" "text-bottom" percentage length)
("visibility" "visible" "hidden" "collapse")
("voice-family" specific-voice generic-voice "*" specific-voice
generic-voice)
("volume" number percentage "silent" "x-soft" "soft" "medium" "loud"
"x-loud")
("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line")
("widows" integer)
("width" length percentage "auto")
("word-spacing" "normal" length)
("z-index" "auto" integer))
"A list of CSS properties and their possible values.")
(defconst ac-css-value-classes
'((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large"
"xx-large")
(border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove"
"ridge" "inset" "outset")
(color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy"
"olive" "orange" "purple" "red" "silver" "teal" "white" "yellow"
"rgb")
(counter "counter")
(family-name "Courier" "Helvetica" "Times")
(generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace")
(generic-voice "male" "female" "child")
(margin-width "auto") ;; length percentage
(relative-size "larger" "smaller")
(shape "rect")
(uri "url"))
"A list of CSS property value classes and their contents.")
(defconst ac-css-pseudo-classes
'("active" "after" "before" "first" "first-child" "first-letter" "first-line"
"focus" "hover" "lang" "left" "link" "right" "visited")
"Identifiers for CSS pseudo-elements and pseudo-classes.")
(defvar ac-css-property nil
"Current editing property.")
(defun ac-css-prefix ()
(when (save-excursion (re-search-backward "\\_<\\(.+?\\)\\_>\\s *:[^;]*\\=" nil t))
(setq ac-css-property (match-string 1))
(or (ac-prefix-symbol) (point))))
(defun ac-css-property-candidates ()
(let ((list (assoc-default ac-css-property ac-css-property-alist)))
(if list
(cl-loop with seen
with value
while (setq value (pop list))
if (symbolp value)
do (unless (memq value seen)
(push value seen)
(setq list
(append list
(or (assoc-default value ac-css-value-classes)
(assoc-default (symbol-name value) ac-css-property-alist)))))
else collect value)
ac-css-pseudo-classes)))
(ac-define-source css-property
'((candidates . ac-css-property-candidates)
(prefix . ac-css-prefix)
(requires . 0)))
;; slime
(ac-define-source slime
'((depends slime)
(candidates . (car (slime-simple-completions ac-prefix)))
(symbol . "s")
(cache)))
;; ghc-mod
(ac-define-source ghc-mod
'((depends ghc)
(candidates . (ghc-select-completion-symbol))
(symbol . "s")
(cache)))
;;;; Not maintained sources
;; ropemacs
(defvar ac-ropemacs-loaded nil)
(defun ac-ropemacs-require ()
(with-no-warnings
(unless ac-ropemacs-loaded
(pymacs-load "ropemacs" "rope-")
(if (boundp 'ropemacs-enable-autoimport)
(setq ropemacs-enable-autoimport t))
(setq ac-ropemacs-loaded t))))
(defun ac-ropemacs-setup ()
(ac-ropemacs-require)
;(setq ac-sources (append (list 'ac-source-ropemacs) ac-sources))
(setq ac-omni-completion-sources '(("\\." ac-source-ropemacs))))
(defun ac-ropemacs-initialize ()
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(add-hook 'python-mode-hook 'ac-ropemacs-setup)
t)
(defvar ac-ropemacs-completions-cache nil)
(defvar ac-source-ropemacs
'((init
. (lambda ()
(setq ac-ropemacs-completions-cache
(mapcar
(lambda (completion)
(concat ac-prefix completion))
(ignore-errors
(rope-completions))))))
(candidates . ac-ropemacs-completions-cache)))
;; rcodetools
(defvar ac-source-rcodetools
'((init . (lambda ()
(require 'rcodetools)
(condition-case x
(save-excursion
(rct-exec-and-eval rct-complete-command-name "--completion-emacs-icicles"))
(error) (setq rct-method-completion-table nil))))
(candidates . (lambda ()
(all-completions
ac-prefix
(mapcar
(lambda (completion)
(replace-regexp-in-string "\t.*$" "" (car completion)))
rct-method-completion-table))))))
;;;; Default settings
(defun ac-common-setup ()
;(add-to-list 'ac-sources 'ac-source-filename)
)
(defun ac-emacs-lisp-mode-setup ()
(setq ac-sources (append '(ac-source-features ac-source-functions ac-source-yasnippet ac-source-variables ac-source-symbols) ac-sources)))
(defun ac-cc-mode-setup ()
(setq ac-sources (append '(ac-source-yasnippet ac-source-gtags) ac-sources)))
(defun ac-ruby-mode-setup ())
(defun ac-css-mode-setup ()
(setq ac-sources (append '(ac-source-css-property) ac-sources)))
;;;###autoload
(defun ac-config-default ()
(setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))
(add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup)
(add-hook 'c-mode-common-hook 'ac-cc-mode-setup)
(add-hook 'ruby-mode-hook 'ac-ruby-mode-setup)
(add-hook 'css-mode-hook 'ac-css-mode-setup)
(add-hook 'auto-complete-mode-hook 'ac-common-setup)
(global-auto-complete-mode t))
(provide 'auto-complete-config)
;;; auto-complete-config.el ends here

View File

@@ -1,6 +0,0 @@
(define-package "auto-complete" "20170124.1845" "Auto Completion for GNU Emacs"
'((popup "0.5.0")
(cl-lib "0.5")))
;; Local Variables:
;; no-byte-compile: t
;; End:

File diff suppressed because it is too large Load Diff

View File

@@ -1,72 +0,0 @@
abort
abs
abstract
accept
access
aliased
all
and
array
at
begin
body
case
constant
declare
delay
delta
digits
do
else
elsif
end
entry
exception
exit
for
function
generic
goto
if
in
interface
is
limited
loop
mod
new
not
null
of
or
others
out
overriding
package
pragma
private
procedure
protected
raise
range
record
rem
renames
requeue
return
reverse
select
separate
subtype
synchronized
tagged
task
terminate
then
type
until
use
when
while
with
xor

View File

@@ -1,99 +0,0 @@
alignas
alignof
and
and_eq
asm
auto
bitand
bitor
bool
break
case
catch
char
char16_t
char32_t
class
compl
concept
const
const_cast
constexpr
continue
decltype
default
define
defined
delete
do
double
dynamic_cast
elif
else
endif
enum
error
explicit
export
extern
false
final
float
for
friend
goto
if
ifdef
ifndef
include
inline
int
line
long
mutable
namespace
new
noexcept
not
not_eq
nullptr
operator
or
or_eq
override
pragma
_Pragma
private
protected
public
register
reinterpret_cast
requires
return
short
signed
sizeof
static
static_assert
static_cast
struct
switch
template
this
thread_local
throw
true
try
typedef
typeid
typename
union
unsigned
using
virtual
void
volatile
wchar_t
while
xor
xor_eq

View File

@@ -1,55 +0,0 @@
auto
_Alignas
_Alignof
_Atomic
_Bool
break
case
char
_Complex
const
continue
default
define
defined
do
double
elif
else
endif
enum
error
extern
float
for
goto
_Generic
if
ifdef
ifndef
_Imaginary
include
inline
int
line
long
_Noreturn
pragma
register
restrict
return
short
signed
sizeof
static
struct
switch
_Static_assert
typedef
_Thread_local
undef
union
unsigned
void
volatile
while

View File

@@ -1,231 +0,0 @@
# OCaml 3.12.1
# Keywords
and
as
assert
begin
class
constraint
do
done
downto
else
end
exception
external
false
for
fun
function
functor
if
in
include
inherit
initializer
lazy
let
match
method
module
mutable
new
object
of
open
or
private
rec
sig
struct
then
to
true
try
type
val
virtual
when
while
with
# Pervasives
!
!=
&
&&
*
**
*.
+
+.
-
-.
/
/.
:=
<
<=
<>
=
==
>
>=
@
FP_infinite
FP_nan
FP_normal
FP_subnormal
FP_zero
LargeFile
Open_append
Open_binary
Open_creat
Open_nonblock
Open_rdonly
Open_text
Open_trunc
Open_wronly
Oupen_excl
^
^^
abs
abs_float
acos
asin
asr
at_exit
atan
atan2
bool_of_string
ceil
char_of_int
classify_float
close_in
close_in_noerr
close_out
close_out_noerr
compare
cos
cosh
decr
do_at_exit
epsilon_float
exit
exp
expm1
failwith
float
float_of_int
float_of_string
floor
flush
flush_all
format
format4
format_of_string
fpclass
frexp
fst
ignore
in_channel
in_channel_length
incr
infinity
input
input_binary_int
input_byte
input_char
input_line
input_value
int_of_char
int_of_float
int_of_string
invalid_arg
land
ldexp
lnot
log
log10
log1p
lor
lsl
lsr
lxor
max
max_float
max_int
min
min_float
min_int
mod
mod_float
modf
nan
neg_infinity
not
open_flag
open_in
open_in_bin
open_in_gen
open_out
open_out_bin
open_out_gen
or
out_channel
out_channel_length
output
output_binary_int
output_byte
output_char
output_string
output_value
pos_in
pos_out
pred
prerr_char
prerr_endline
prerr_float
prerr_int
prerr_newline
prerr_string
print_char
print_endline
print_float
print_int
print_newline
print_string
raise
read_float
read_int
read_line
really_input
ref
seek_in
seek_out
set_binary_mode_in
set_binary_mode_out
sin
sinh
snd
sqrt
stderr
stdin
stdout
string_of_bool
string_of_float
string_of_format
string_of_int
succ
tan
tanh
truncate
unsafe_really_input
valid_float_lexem
||
~
~+
~+.
~-
~-.

View File

@@ -1,580 +0,0 @@
*agent*
*allow-unresolved-vars*
*assert*
*clojure-version*
*command-line-args*
*compile-files*
*compile-path*
*compiler-options*
*data-readers*
*default-data-reader-fn*
*err*
*file*
*flush-on-newline*
*fn-loader*
*in*
*math-context*
*ns*
*out*
*print-dup*
*print-length*
*print-level*
*print-meta*
*print-readably*
*read-eval*
*source-path*
*unchecked-math*
*use-context-classloader*
*verbose-defrecords*
*warn-on-reflection*
->ArrayChunk
->Vec
->VecNode
->VecSeq
-cache-protocol-fn
-reset-methods
accessor
aclone
add-classpath
add-watch
agent
agent-error
agent-errors
aget
alength
alias
all-ns
alter
alter-meta!
alter-var-root
amap
ancestors
and
apply
areduce
array-map
as->
aset
aset-boolean
aset-byte
aset-char
aset-double
aset-float
aset-int
aset-long
aset-short
assert
assoc
assoc!
assoc-in
associative?
atom
await
await-for
await1
bases
bean
bigdec
bigint
biginteger
binding
bit-and
bit-and-not
bit-clear
bit-flip
bit-not
bit-or
bit-set
bit-shift-left
bit-shift-right
bit-test
bit-xor
boolean
boolean-array
booleans
bound-fn
bound-fn*
bound?
butlast
byte
byte-array
bytes
case
cast
char
char-array
char-escape-string
char-name-string
char?
chars
chunk
chunk-append
chunk-buffer
chunk-cons
chunk-first
chunk-next
chunk-rest
chunked-seq?
class
class?
clear-agent-errors
clojure-version
coll?
comment
commute
comp
comparator
compare
compare-and-set!
compile
complement
concat
cond
cond->
cond->>
condp
conj
conj!
cons
constantly
construct-proxy
contains?
count
counted?
create-ns
create-struct
cycle
dec
dec'
decimal?
declare
default-data-readers
definline
definterface
defmacro
defmethod
defmulti
defn
defn-
defonce
defprotocol
defrecord
defstruct
deftype
delay
delay?
deliver
denominator
deref
derive
descendants
destructure
disj
disj!
dissoc
dissoc!
distinct
distinct?
doall
doc
dorun
doseq
dosync
dotimes
doto
double
double-array
doubles
drop
drop-last
drop-while
dtype
empty
empty?
ensure
enumeration-seq
error-handler
error-mode
eval
even?
every-pred
every?
ex-data
ex-info
extend
extend-class
extend-protocol
extend-type
extenders
extends?
false?
ffirst
file-seq
filter
filterv
find
find-doc
find-keyword
find-ns
find-protocol-impl
find-protocol-method
find-var
first
flatten
float
float-array
float?
floats
flush
fn
fn?
fnext
fnil
for
force
format
frequencies
future
future-call
future-cancel
future-cancelled?
future-done?
future?
gen-class
gen-interface
gensym
get
get-in
get-method
get-proxy-class
get-thread-bindings
get-validator
group-by
hash
hash-combine
hash-map
hash-set
identical?
identity
if-let
if-not
ifn?
import
in-ns
inc
inc'
init-proxy
instance?
int
int-array
integer?
interleave
intern
interpose
into
into-array
ints
io!
isa?
iterate
iterator-seq
juxt
keep
keep-indexed
key
keys
keyword
keyword?
last
lazy-cat
lazy-seq
let
letfn
line-seq
list
list*
list?
load
load-file
load-reader
load-string
loaded-libs
locking
long
long-array
longs
loop
macroexpand
macroexpand-1
make-array
make-hierarchy
map
map-indexed
map?
mapcat
mapv
max
max-key
memfn
memoize
merge
merge-with
meta
method-sig
methods
min
min-key
mod
munge
name
namespace
namespace-munge
neg?
newline
next
nfirst
nil?
nnext
not
not-any?
not-empty
not-every?
not=
ns
ns-aliases
ns-imports
ns-interns
ns-map
ns-name
ns-publics
ns-refers
ns-resolve
ns-unalias
ns-unmap
nth
nthnext
nthrest
num
number?
numerator
object-array
odd?
or
parents
partial
partition
partition-all
partition-by
pcalls
peek
persistent!
pmap
pop
pop!
pop-thread-bindings
pos?
pr
pr-str
prefer-method
prefers
primitives-classnames
print
print-ctor
print-dup
print-method
print-namespace-doc
print-simple
print-str
printf
println
println-str
prn
prn-str
promise
proxy
proxy-call-with-super
proxy-mappings
proxy-name
proxy-super
push-thread-bindings
pvalues
quot
rand
rand-int
rand-nth
range
ratio?
rational?
rationalize
re-find
re-groups
re-matcher
re-matches
re-pattern
re-seq
read
read-line
read-string
realized?
reduce
reduce-kv
reduced
reduced?
reductions
ref
ref-history-count
ref-max-history
ref-min-history
ref-set
refer
refer-clojure
reify
release-pending-sends
rem
remove
remove-all-methods
remove-method
remove-ns
remove-watch
repeat
repeatedly
replace
replicate
require
reset!
reset-meta!
resolve
rest
restart-agent
resultset-seq
reverse
reversible?
rseq
rsubseq
satisfies?
second
select-keys
send
send-off
send-via
seq
seq?
seque
sequence
sequential?
set
set-agent-send-executor!
set-agent-send-off-executor!
set-error-handler!
set-error-mode!
set-validator!
set?
short
short-array
shorts
shuffle
shutdown-agents
slurp
some
some->
some->>
some-fn
sort
sort-by
sorted-map
sorted-map-by
sorted-set
sorted-set-by
sorted?
special-form-anchor
special-symbol?
spit
split-at
split-with
str
stream?
string?
struct
struct-map
subs
subseq
subvec
supers
swap!
symbol
symbol?
sync
syntax-symbol-anchor
take
take-last
take-nth
take-while
test
the-ns
thread-bound?
time
to-array
to-array-2d
trampoline
transient
tree-seq
true?
type
unchecked-add
unchecked-add-int
unchecked-byte
unchecked-char
unchecked-dec
unchecked-dec-int
unchecked-divide
unchecked-divide-int
unchecked-double
unchecked-float
unchecked-inc
unchecked-inc-int
unchecked-int
unchecked-long
unchecked-multiply
unchecked-multiply-int
unchecked-negate
unchecked-negate-int
unchecked-remainder
unchecked-remainder-int
unchecked-short
unchecked-subtract
unchecked-subtract-int
underive
unquote
unquote-splicing
update-in
update-proxy
use
val
vals
var-get
var-set
var?
vary-meta
vec
vector
vector-of
vector?
when
when-first
when-let
when-not
while
with-bindings
with-bindings*
with-in-str
with-loading-context
with-local-vars
with-meta
with-open
with-out-str
with-precision
with-redefs
with-redefs-fn
xml-seq
zero?
zipmap

View File

@@ -1,475 +0,0 @@
*agent*
*clojure-version*
*command-line-args*
*compile-files*
*compile-path*
*err*
*file*
*flush-on-newline*
*in*
*ns*
*out*
*print-dup*
*print-length*
*print-level*
*print-meta*
*print-readably*
*read-eval*
*warn-on-reflection*
accessor
aclone
add-classpath
add-watch
agent
agent-error
agent-errors
aget
alength
alias
all-ns
alter
alter-meta!
alter-var-root
amap
ancestors
and
apply
areduce
array-map
aset
aset-boolean
aset-byte
aset-char
aset-double
aset-float
aset-int
aset-long
aset-short
assert
assoc
assoc!
assoc-in
associative?
atom
await
await-for
bases
bean
bigdec
bigint
binding
bit-and
bit-and-not
bit-clear
bit-flip
bit-not
bit-or
bit-set
bit-shift-left
bit-shift-right
bit-test
bit-xor
boolean
boolean-array
booleans
bound-fn
bound-fn*
butlast
byte
byte-array
bytes
case
cast
char
char-array
char-escape-string
char-name-string
char?
chars
class
class?
clear-agent-errors
clojure-version
coll?
comment
commute
comp
comparator
compare
compare-and-set!
compile
complement
concat
cond
condp
conj
conj!
cons
constantly
construct-proxy
contains?
count
counted?
create-ns
create-struct
cycle
dec
decimal?
declare
definline
defmacro
defmethod
defmulti
defn
defn-
defonce
defprotocol
defstruct
deftype
delay
delay?
deliver
deref
derive
descendants
disj
disj!
dissoc
dissoc!
distinct
distinct?
doall
doc
dorun
doseq
dosync
dotimes
doto
double
double-array
doubles
drop
drop-last
drop-while
dtype
empty
empty?
ensure
enumeration-seq
error-handler
error-mode
eval
even?
every?
extend
extend-class
extend-protocol
extend-type
extenders
extends?
false?
ffirst
file-seq
filter
find
find-doc
find-ns
find-var
first
float
float-array
float?
floats
flush
fn
fn?
fnext
for
force
format
future
future-call
future-cancel
future-cancelled?
future-done?
future?
gen-class
gen-interface
gensym
get
get-in
get-method
get-proxy-class
get-thread-bindings
get-validator
hash
hash-map
hash-set
identical?
identity
if-let
if-not
ifn?
import
in-ns
inc
init-proxy
instance?
int
int-array
integer?
interleave
intern
interpose
into
into-array
ints
io!
isa?
iterate
iterator-seq
juxt
key
keys
keyword
keyword?
last
lazy-cat
lazy-seq
let
letfn
line-seq
list
list*
list?
load
load-file
load-reader
load-string
loaded-libs
locking
long
long-array
longs
loop
macroexpand
macroexpand-1
make-array
make-hierarchy
map
map?
mapcat
max
max-key
memfn
memoize
merge
merge-with
meta
methods
min
min-key
mod
name
namespace
neg?
newline
next
nfirst
nil?
nnext
not
not-any?
not-empty
not-every?
not=
ns
ns-aliases
ns-imports
ns-interns
ns-map
ns-name
ns-publics
ns-refers
ns-resolve
ns-unalias
ns-unmap
nth
nthnext
num
number?
object-array
odd?
or
parents
partial
partition
pcalls
peek
persistent!
pmap
pop
pop!
pop-thread-bindings
pos?
pr
pr-str
prefer-method
prefers
print
print-namespace-doc
print-str
printf
println
println-str
prn
prn-str
promise
proxy
proxy-mappings
proxy-super
push-thread-bindings
pvalues
quot
rand
rand-int
range
ratio?
rationalize
re-find
re-groups
re-matcher
re-matches
re-pattern
re-seq
read
read-line
read-string
reduce
ref
ref-history-count
ref-max-history
ref-min-history
ref-set
refer
refer-clojure
reify
release-pending-sends
rem
remove
remove-method
remove-ns
remove-watch
repeat
repeatedly
replace
replicate
require
reset!
reset-meta!
resolve
rest
restart-agent
resultset-seq
reverse
reversible?
rseq
rsubseq
satisfies?
second
select-keys
send
send-off
seq
seq?
seque
sequence
sequential?
set
set-error-handler!
set-error-mode!
set-validator!
set?
short
short-array
shorts
shutdown-agents
slurp
some
sort
sort-by
sorted-map
sorted-map-by
sorted-set
sorted-set-by
sorted?
special-form-anchor
special-symbol?
split-at
split-with
str
stream?
string?
struct
struct-map
subs
subseq
subvec
supers
swap!
symbol
symbol?
sync
syntax-symbol-anchor
take
take-last
take-nth
take-while
test
the-ns
time
to-array
to-array-2d
trampoline
transient
tree-seq
true?
type
unchecked-add
unchecked-dec
unchecked-divide
unchecked-inc
unchecked-multiply
unchecked-negate
unchecked-remainder
unchecked-subtract
underive
update-in
update-proxy
use
val
vals
var-get
var-set
var?
vary-meta
vec
vector
vector-of
vector?
when
when-first
when-let
when-not
while
with-bindings
with-bindings*
with-in-str
with-local-vars
with-meta
with-open
with-out-str
with-precision
xml-seq
zero?
zipmap

View File

@@ -1,278 +0,0 @@
# Generated by the following form.
# (loop for regexp in (append
# coq-solve-tactics
# coq-keywords
# coq-reserved
# coq-tactics
# coq-tacticals
# (list "Set" "Type" "Prop"))
# append (split-string regexp (regexp-quote "\\s-+")) into words
# finally (loop initially (goto-char (point-max))
# for word in (delete-dups (sort words 'string<))
# do (insert word) (newline)))
Abort
About
Abstract
Add
Admit
Admitted
All
Arguments
AutoInline
Axiom
Bind
Canonical
Cd
Chapter
Check
Close
CoFixpoint
CoInductive
Coercion
Coercions
Comments
Conjecture
Constant
Constructors
Corollary
Declare
Defined
Definition
Delimit
Dependent
Depth
Derive
End
Eval
Export
Extern
Extract
Extraction
Fact
False
Field
File
Fixpoint
Focus
Function
Functional
Goal
Hint
Hypotheses
Hypothesis
Hyps
Identity
If
Immediate
Implicit
Import
Inductive
Infix
Inline
Inlined
Inspect
Inversion
Language
Lemma
Let
Library
Limit
LoadPath
Local
Locate
Ltac
ML
Module
Morphism
Next Obligation
NoInline
Notation
Notations
Obligation
Obligations
Off
On
Opaque
Open
Optimize
Parameter
Parameters
Path
Print
Printing
Program
Proof
Prop
Pwd
Qed
Rec
Record
Recursive
Remark
Remove
Require
Reserved
Reset
Resolve
Rewrite
Ring
Save
Scheme
Scope
Search
SearchAbout
SearchPattern
SearchRewrite
Section
Semi
Set
Setoid
Show
Solve
Sort
Strict
Structure
Synth
Tactic
Test
Theorem
Time
Transparent
True
Type
Undo
Unfocus
Unfold
Unset
Variable
Variables
Width
Wildcard
abstract
absurd
after
apply
as
assert
assumption
at
auto
autorewrite
beta
by
case
cbv
change
clear
clearbody
cofix
coinduction
compare
compute
congruence
constructor
contradiction
cut
cutrewrite
decide
decompose
delta
dependent
dest
destruct
discrR
discriminate
do
double
eapply
eauto
econstructor
eexists
eleft
elim
else
end
equality
esplit
exact
exists
fail
field
first
firstorder
fix
fold
forall
fourier
fun
functional
generalize
hnf
idtac
if
in
induction
info
injection
instantiate
into
intro
intros
intuition
inversion
inversion_clear
iota
lapply
lazy
left
let
linear
load
match
move
omega
pattern
pose
progress
prolog
quote
record
red
refine
reflexivity
rename
repeat
replace
return
rewrite
right
ring
set
setoid
setoid_replace
setoid_rewrite
simpl
simple
simplify_eq
solve
specialize
split
split_Rabs
split_Rmult
stepl
stepr
struct
subst
sum
symmetry
tauto
then
transitivity
trivial
try
unfold
until
using
with
zeta

View File

@@ -1,874 +0,0 @@
!important
@font-face
@font-feature-values
@keyframes
ActiveBorder
ActiveCaption
Alpha
AppWorkspace
Background
Barn
BasicImage
Blinds
Blur
ButtonFace
ButtonHighlight
ButtonShadow
ButtonText
CaptionText
CheckerBoard
Chroma
Compositor
CradientWipe
DXImageTransform
DropShadow
Emboss
Engrave
Fade
FlipH
FlipV
Glow
Gray
GrayText
Highlight
HighlightText
Hz
ICMFilter
InactiveBorder
InactiveCaption
InactiveCaptionText
InfoBackground
InfoText
Inset
Invert
Iris
Light
MaskFilter
Matrix
Menu
MenuText
Microsoft
MotionBlur
Pixelate
RadialWipe
RandomBars
RandomDissolve
RevealTrans
Scrollbar
Shadow
Slide
Spiral
Stretch
Strips
ThreeDDarkShadow
ThreeDFace
ThreeDHighlight
ThreeDLightShadow
ThreeDShadow
Wave
Wheel
Window
WindowFrame
WindowText
Xray
Zigzag
_azimuth
_background
_background-position-x
_background-position-y
_border
_bottom
_caption
_clear
_clip
_color
_content
_counter
_cue
_cursor
_direction
_display
_elevation
_empty
_filter
_filter:progid:DXImageTransform.Microsoft
_float
_font
_height
_ime
_ime-mode
_layout
_layout-flow
_layout-grid
_layout-grid-char
_layout-grid-line
_layout-grid-mode
_layout-grid-type
_left
_letter
_line
_line-break
_list
_margin
_orphans
_outline
_overflow
_overflow-x
_overflow-y
_padding
_page
_pause
_pitch
_play
_position
_quotes
_richness
_right
_ruby
_ruby-align
_ruby-overhang
_ruby-position
_scrollbar
_scrollbar-3dlight-color
_scrollbar-arrow-color
_scrollbar-base-color
_scrollbar-darkshadow-color
_scrollbar-face-color
_scrollbar-highlight-color
_scrollbar-track-color
_speak
_speech
_stress
_table
_text
_text-align-last
_text-autospace
_text-justify
_text-kashida-space
_text-overflow
_text-underline-position
_top
_unicode
_vertical
_visibility
_voice
_volume
_white
_widows
_width
_word
_word-break
_word-wrap
_writing
_writing-mode
_z
_zoom
above
active
adjust
after
aliceblue
align
align-content
align-items
align-self
always
animation
animation-delay
animation-direction
animation-duration
animation-fill-mode
animation-iteration-count
animation-name
animation-play-state
animation-timing-function
antiquewhite
aqua
aquamarine
armenian
arrow
attachment
auto
autospace
avoid
azimuth
azure
backface-visibility
background
background-attachment
background-clip
background-color
background-image
background-origin
background-position
background-repeat
background-size
bar
base
baseline
before
behind
beige
below
bidi
bidi-override
bisque
black
blanchedalmond
blink
block
blue
blueviolet
bold
bolder
border
border-bottom
border-bottom-color
border-bottom-left-radius
border-bottom-right-radius
border-bottom-style
border-bottom-width
border-collapse
border-color
border-image
border-image-outset
border-image-repeat
border-image-slice
border-image-source
border-image-width
border-left
border-left-color
border-left-style
border-left-width
border-radius
border-right
border-right-color
border-right-style
border-right-width
border-spacing
border-style
border-top
border-top-color
border-top-left-radius
border-top-right-radius
border-top-style
border-top-width
border-width
both
bottom
box
box-decoration-break
box-shadow
box-sizing
break
break-after
break-before
break-inside
brown
burlwood
cadetblue
capitalize
caps
caption
caption-side
cell
cells
center
center-left
center-right
char
chartreuse
chocolate
circle
cjk
cjk-ideographic
clear
clip
close
close-quote
cm
code
collapse
color
column
column-count
column-fill
column-gap
column-rule
column-rule-color
column-rule-style
column-rule-width
column-span
column-width
columns
compact
condensed
content
continuous
coral
cornflowerblue
cornsilk
counter
counter-increment
counter-reset
crimson
crop
cross
crosshair
cue
cue-after
cue-before
cursive
cursor
cyan
darkblue
darkcyan
darkgoldenrod
darkgray
darkgreen
darkkhaki
darkmagenta
darkolivegreen
darkorange
darkorchid
darkred
darksalmon
darkseagreen
darkshadow
darkslateblue
darkslategray
darkturquoise
darkviolet
dashed
decimal
decimal-leading-zero
decoration
deeppink
deepskyblue
default
deg
digits
dimgray
direction
disc
display
dodgerblue
dotted
double
during
e
e-resize
elevation
em
embed
empty
empty-cells
ex
expanded
extra
extra-condensed
extra-expanded
face
family
fantasy
far
far-left
far-right
fast
faster
filter
firebrick
first
first-child
first-letter
first-line
fixed
flex
flex-basis
flex-direction
flex-flow
flex-grow
flex-shrink
flex-wrap
float
floralwhite
flow
focus
font
font-family
font-feature-setting
font-kerning
font-language-override
font-size
font-size-adjust
font-stretch
font-style
font-synthesis
font-variant
font-variant-alternates
font-variant-caps
font-variant-east-asian
font-variant-ligatures
font-variant-numeric
font-variant-position
font-weight
footer
forestgreen
fuchsia
gainsboro
georgian
ghostwhite
gold
goldenrod
gray
greek
green
greenyellow
grid
groove
group
hanging-punctuation
header
hebrew
height
help
hidden
hide
high
higher
hiragana
hiragana-iroha
honeydew
hotpink
hover
hyphens
icon
ideographic
image
image-orientation
image-rendering
image-resolution
ime-mode
in
increment
indent
index
indianred
indigo
inherit
inline
inline-block
inline-table
inset
inside
iroha
italic
item
ivory
justify
justify-content
kHz
kashida
katakana
katakana-iroha
khaki
landscape
lang()
large
larger
last
latin
lavender
lavenderblush
lawngreen
layout
leading
left
left-side
leftwards
lenonchiffon
letter
letter-spacing
level
lightblue
lightcoral
lightcyan
lighter
lightgoldenrodyellow
lightgray
lightgreen
lightgrey
lightpink
lightsalmon
lightseagreen
lightskyblue
lightslategray
lightsteelblue
lightyellow
lime
limegreen
line
line-break
line-height
line-through
linen
link
list
list-item
list-style
list-style-image
list-style-position
list-style-type
loud
low
lower
lower-alpha
lower-greek
lower-latin
lower-roman
lowercase
ltr
magenta
margin
margin-bottom
margin-left
margin-right
margin-top
mark
mark-after
mark-before
marker
marker-offset
marks
maroon
marquee-direction
marquee-play-count
marquee-speed
marquee-style
mask
mask-type
max
max-height
max-width
medium
mediumaquamarine
mediumblue
mediumorchid
mediumpurple
mediumseagreen
mediumslateblue
mediumspringgreen
mediumturquoise
mediumvioletred
menu
message
message-box
middle
midnightblue
min
min-height
min-width
mintcream
mistyrose
mix
mm
moccasin
mode
monospace
move
ms
n
n-resize
naby
narrower
nav-down
nav-index
nav-left
nav-right
nav-up
navajowhite
ne
ne-resize
no
no-close-quote
no-open-quote
no-repeat
none
normal
nowrap
number
numeral
nw
nw-resize
object-fit
object-position
oblique
offset
oldlace
olive
olivedrab
once
opacity
open
open-quote
orange
orangered
orchid
order
orphans
out
outline
outline-color
outline-offset
outline-style
outline-width
outset
outside
overflow
overflow-wrap
overflow-x
overflow-y
overhang
overline
override
padding
padding-bottom
padding-left
padding-right
padding-top
page
page-break-after
page-break-before
page-break-inside
palegoldenrod
palegreen
paleturquoise
palevioletred
papayawhip
pause
pause-after
pause-before
pc
peachpuff
perspective
perspective-origin
peru
phonemes
pink
pitch
pitch-range
play
play-during
plum
pointer
portrait
position
powderblue
pre
pre-line
pre-wrap
progid
progress
pt
punctuation
purple
px
quote
quotes
rad
range
rate
red
relative
repeat
repeat-x
repeat-y
reset
resize
rest
rest-after
rest-before
richness
ridge
right
right-side
rightwards
roman
rosybrown
row
royalblue
rtl
run
run-in
s
s-resize
saddlebrown
salmon
sandybrown
sans-serif
scroll
se
se-resize
seagreen
seashell
semi
semi-condensed
semi-expanded
separate
serif
shadow
show
side
sienna
silent
silever
silver
size
skyblue
slateblue
slategray
slow
slower
small
small-caps
small-caption
smaller
snow
soft
solid
space
spacing
speak
speak-header
speak-numeral
speak-punctuation
specific
specific-voice
speech
speech-rate
spell
spell-out
springgreen
square
static
status
status-bar
steelblue
stress
stretch
style
sub
super
sw
sw-resize
tab-size
table
table-caption
table-cell
table-column
table-column-group
table-footer-group
table-header-group
table-layout
table-row
table-row-group
tan
teal
text
text-align
text-align-last
text-bottom
text-combine-horizontal
text-decoration
text-decoration-color
text-decoration-line
text-decoration-style
text-indent
text-justify
text-orientation
text-overflow
text-shadow
text-top
text-transform
text-underline-position
thick
thin
thistle
through
tomato
top
track
transform
transform-origin
transform-style
transition
transition-delay
transition-duration
transition-property
transition-timing-function
transparent
turquoise
type
ultra
ultra-condensed
ultra-expanded
underline
unicode
unicode-bidi
upper
upper-alpha
upper-latin
upper-roman
uppercase
variant
vertical
vertical-align
violet
visibility
visible
visited
voice
voice-balance
voice-duration
voice-family
voice-pitch
voice-pitch-range
voice-rate
voice-stress
voice-volume
volume
w
w-resize
wait
weight
wheat
white
white-space
whitesmoke
wider
widows
width
word
word-break
word-spacing
word-wrap
wrap
writing-mode
x
x-fast
x-high
x-large
x-loud
x-low
x-slow
x-small
x-soft
xx
xx-large
xx-small
y
yellow
yellowgreen
z
z-index
zero

View File

@@ -1,216 +0,0 @@
after
begin
catch
case
cond
end
fun
if
let
of
query
receive
try
when
and
andalso
band
bnot
bor
bsl
bsr
bxor
div
not
or
orelse
rem
xor
is_atom
is_binary
is_bitstring
is_boolean
is_float
is_function
is_integer
is_list
is_number
is_pid
is_port
is_record
is_reference
is_tuple
atom
binary
bitstring
boolean
function
integer
list
number
pid
port
record
reference
tuple
abs
adler32
adler32_combine
alive
apply
atom_to_binary
atom_to_list
binary_to_atom
binary_to_existing_atom
binary_to_list
binary_to_term
bit_size
bitstring_to_list
byte_size
check_process_code
contact_binary
crc32
crc32_combine
date
decode_packet
delete_module
disconnect_node
element
erase
exit
float
float_to_list
garbage_collect
get
get_keys
group_leader
halt
hd
integer_to_list
internal_bif
iolist_size
iolist_to_binary
is_alive
is_atom
is_binary
is_bitstring
is_boolean
is_float
is_function
is_integer
is_list
is_number
is_pid
is_port
is_process_alive
is_record
is_reference
is_tuple
length
link
list_to_atom
list_to_binary
list_to_bitstring
list_to_existing_atom
list_to_float
list_to_integer
list_to_pid
list_to_tuple
load_module
make_ref
module_loaded
monitor_node
node
node_link
node_unlink
nodes
notalive
now
open_port
pid_to_list
port_close
port_command
port_connect
port_control
pre_loaded
process_flag
process_info
processes
purge_module
put
register
registered
round
self
setelement
size
spawn
spawn_link
spawn_monitor
spawn_opt
split_binary
statistics
term_to_binary
time
throw
tl
trunc
tuple_size
tuple_to_list
unlink
unregister
whereis
append_element
bump_reductions
cancel_timer
demonitor
display
fun_info
fun_to_list
function_exported
get_cookie
get_stacktrace
hash
integer_to_list
is_builtin
list_to_integer
loaded
localtime
localtime_to_universaltime
make_tuple
max
md5
md5_final
md5_init
md5_update
memory
min
monitor
monitor_node
phash
phash2
port_call
port_info
port_to_list
ports
process_display
read_timer
ref_to_list
resume_process
send
send_after
send_nosuspend
set_cookie
start_timer
suspend_process
system_flag
system_info
system_monitor
system_profile
trace
trace_delivered
trace_info
trace_pattern
universaltime
universaltime_to_localtime
yield

View File

@@ -1,37 +0,0 @@
abstract
break
case
catch
const
continue
do
else
elseif
end
eval
export
false
finally
for
function
global
if
ifelse
immutable
import
importall
in
let
macro
module
otherwise
quote
return
switch
throw
true
try
type
typealias
using
while

View File

@@ -1,25 +0,0 @@
break
case
chan
const
continue
default
defer
else
fallthrough
for
func
go
goto
if
import
interface
map
package
range
return
select
struct
switch
type
var

View File

@@ -1,679 +0,0 @@
Arrows
BangPatterns
Bool
Bounded
CPP
Char
Complex
ConstrainedClassMethods
Control.Applicative
Control.Arrow
Control.Category
Control.Concurrent
Control.Concurrent.MVar
Control.Concurrent.QSem
Control.Concurrent.QSemN
Control.Concurrent.STM
Control.Concurrent.STM.TArray
Control.Concurrent.STM.TChan
Control.Concurrent.STM.TMVar
Control.Concurrent.STM.TVar
Control.Concurrent.SampleVar
Control.Exception
Control.Exception.Base
Control.Monad
Control.Monad.Cont
Control.Monad.Cont.Class
Control.Monad.Error
Control.Monad.Error.Class
Control.Monad.Fix
Control.Monad.Identity
Control.Monad.Instances
Control.Monad.List
Control.Monad.RWS
Control.Monad.RWS.Class
Control.Monad.RWS.Lazy
Control.Monad.RWS.Strict
Control.Monad.Reader
Control.Monad.Reader.Class
Control.Monad.ST
Control.Monad.ST.Lazy
Control.Monad.ST.Strict
Control.Monad.STM
Control.Monad.State
Control.Monad.State.Class
Control.Monad.State.Lazy
Control.Monad.State.Strict
Control.Monad.Trans
Control.Monad.Writer
Control.Monad.Writer.Class
Control.Monad.Writer.Lazy
Control.Monad.Writer.Strict
Control.OldException
Control.Parallel
Control.Parallel.Strategies
DEPRECATED
Data.Array
Data.Array.Diff
Data.Array.IArray
Data.Array.IO
Data.Array.IO.Internals
Data.Array.MArray
Data.Array.Paralell
Data.Array.Paralell.Arr
Data.Array.Paralell.Base
Data.Array.Paralell.Int
Data.Array.Paralell.Lifted
Data.Array.Paralell.PArray
Data.Array.Paralell.Prelude
Data.Array.Paralell.Prelude.Double
Data.Array.Paralell.Stream
Data.Array.Paralell.Unlifted
Data.Array.Paralell.Unlifted.Distributed
Data.Array.Paralell.Unlifted.Paralell
Data.Array.Paralell.Unlifted.Sqeuential
Data.Array.Paralell.Word8
Data.Array.ST
Data.Array.Storable
Data.Array.Unboxed
Data.Bits
Data.Bool
Data.ByteString
Data.ByteString.Char8
Data.ByteString.Fusion
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Char8
Data.ByteString.Lazy.Fusion
Data.ByteString.Lazy.Internal
Data.ByteString.Unsafe
Data.Char
Data.Complex
Data.Data
Data.Dynamic
Data.Either
Data.Eq
Data.Fixed
Data.Foldable
Data.Function
Data.Generics
Data.Generics.Aliases
Data.Generics.Basics
Data.Generics.Instances
Data.Generics.Schemes
Data.Generics.Text
Data.Generics.Twins
Data.Graph
Data.HashTable
Data.IORef
Data.Int
Data.IntMap
Data.IntSet
Data.Ix
Data.List
Data.Map
Data.Maybe
Data.Monoid
Data.Ord
Data.Ratio
Data.STRef
Data.STRef.Lazy
Data.STRef.Strict
Data.Sequence
Data.Set
Data.String
Data.Time
Data.Time.Calendar
Data.Time.Calendar.Easter
Data.Time.Calendar.Julian
Data.Time.Calendar.MonthDay
Data.Time.Calendar.OrdinalDate
Data.Time.Calendar.WeekDate
Data.Time.Clock
Data.Time.Clock.POSIX
Data.Time.Clock.TAI
Data.Time.Format
Data.Time.LocalTime
Data.Traversable
Data.Tree
Data.Tuple
Data.Typeable
Data.Unique
Data.Version
Data.Word
Debug.Trace
DeriveDataTypeable
DisambiguateRecordFields
Distribution.Compat.ReadP
Distribution.Compiler
Distribution.InstalledPackageInfo
Distribution.License
Distribution.Make
Distribution.ModuleName
Distribution.Package
Distribution.PackageDescription
Distribution.PackageDescription.Check
Distribution.PackageDescription.Configuration
Distribution.PackageDescription.Parse
Distribution.ParseUtils
Distribution.ReadE
Distribution.Simple
Distribution.Simple.Build
Distribution.Simple.Build.Macros
Distribution.Simple.Build.PathsModule
Distribution.Simple.BuildPaths
Distribution.Simple.Command
Distribution.Simple.Compiler
Distribution.Simple.Configure
Distribution.Simple.GHC
Distribution.Simple.Haddock
Distribution.Simple.Hugs
Distribution.Simple.Install
Distribution.Simple.InstallDirs
Distribution.Simple.JHC
Distribution.Simple.LocalBuildInfo
Distribution.Simple.NHC
Distribution.Simple.PackageIndex
Distribution.Simple.PreProcess
Distribution.Simple.PreProcess.Unlit
Distribution.Simple.Program
Distribution.Simple.Register
Distribution.Simple.Setup
Distribution.Simple.SrcDist
Distribution.Simple.UserHooks
Distribution.Simple.Utils
Distribution.System
Distribution.Text
Distribution.Verbosity
Distribution.Version
Double
EQ
Either
EmptyDataDecls
Enum
Eq
ExistentialQuantification
ExtendedDefaultRules
False
FilePath
FlexibleContexts
FlexibleInstances
Float
Floating
Foreign
Foreign.C
Foreign.C.Error
Foreign.C.String
Foreign.C.Types
Foreign.Concurrent
Foreign.ForeignPtr
Foreign.Marshal
Foreign.Marshal.Alloc
Foreign.Marshal.Array
Foreign.Marshal.Error
Foreign.Marshal.Pool
Foreign.Marshal.Utils
Foreign.Ptr
Foreign.StablePtr
Foreign.Storable
ForeignFunctionInterface
Fractional
FunctionnalDependencies
Functor
GADTs
GHC.Arr
GHC.Bool
GHC.Conc
GHC.ConsoleHandler
GHC.Desugar
GHC.Environment
GHC.Err
GHC.Exts
GHC.Generics
GHC.Handle
GHC.Ordering
GHC.PArr
GHC.Prim
GHC.PrimopWrappers
GHC.Tuple
GHC.Types
GHC.Unicode
GHC.Unit
GT
GeneralizedNewtypeDeriving
Generics
INCLUDE
INLINE
IO
IOError
IOException
ImplicitParams
ImplicitPrelude
ImpredicativeTypes
IncoherentInstances
Int
Integer
Integral
Just
KindSignatures
LANGUAGE
LINE
LT
Language.Haskell.Extension
Language.Haskell.Lexer
Language.Haskell.ParseMonad
Language.Haskell.ParseUtils
Language.Haskell.Parser
Language.Haskell.Pretty
Language.Haskell.Syntax
Language.Haskell.TH
Language.Haskell.TH.Lib
Language.Haskell.TH.Ppr
Language.Haskell.TH.PprLib
Language.Haskell.TH.Quote
Language.Haskell.TH.Syntax
Left
LiberalTypeSynonyms
MagicHash
Maybe
Monad
MonoPatBinds
MonomorphismRestriction
MultiParamTypeClasses
NOINLINE
NamedFieldPuns
Network
Network.BSD
Network.Socket
Network.URI
NewQualifiedOperators
NoArrows
NoBangPatterns
NoCPP
NoConstrainedClassMethods
NoDeriveDataTypeable
NoDisambiguateRecordFields
NoEmptyDataDecls
NoExistentialQuantification
NoExtendedDefaultRules
NoFlexibleContexts
NoFlexibleInstances
NoForeignFunctionInterface
NoFunctionnalDependencies
NoGADTs
NoGeneralizedNewtypeDeriving
NoGenerics
NoImplicitParams
NoImplicitPrelude
NoImpredicativeTypes
NoIncoherentInstances
NoKindSignatures
NoLiberalTypeSynonyms
NoMagicHash
NoMonoPatBinds
NoMonomorphismRestriction
NoMultiParamTypeClasses
NoNamedFieldPuns
NoNewQualifiedOperators
NoOverlappingInstances
NoOverloadedStrings
NoPArr
NoPackageImports
NoParallelListComp
NoPatternGuards
NoPolymorphicComponents
NoQuasiQuotes
NoRank2Types
NoRankNTypes
NoRecordWildCards
NoRecursiveDo
NoRelaxedPolyRec
NoScopedTypeVariables
NoStandaloneDeriving
NoTemplateHaskell
NoTransformListComp
NoTypeFamilies
NoTypeOperators
NoTypeSynonymInstances
NoUnboxedTuples
NoUndecidableInstances
NoUnicodeSyntax
NoUnliftedFFITypes
NoViewPatterns
Nothing
Num
Numeric
OPTIONS_GHC
Ord
Ordering
OverlappingInstances
OverloadedStrings
PArr
PackageImports
ParallelListComp
PatternGuards
PolymorphicComponents
Prelude
QuasiQuotes
RULES
Rank2Types
RankNTypes
Ratio
Read
ReadS
Real
RealFloat
RealFrac
RecordWildCards
RecursiveDo
RelaxedPolyRec
Right
SOURCE
SPECIALIZE
ScopedTypeVariables
ShowS
StandaloneDeriving
String
System.CPUTime
System.Cmd
System.Console.Editline
System.Console.GetOpt
System.Console.Readline
System.Directory
System.Environment
System.Exit
System.FilePath
System.FilePath.Posix
System.FilePath.Windows
System.IO
System.IO.Error
System.IO.Unsafe
System.Info
System.Locale
System.Mem
System.Mem.StableName
System.Mem.Weak
System.Posix
System.Posix.Directory
System.Posix.DynamicLinker
System.Posix.DynamicLinker.Module
System.Posix.DynamicLinker.Prim
System.Posix.Env
System.Posix.Error
System.Posix.Files
System.Posix.IO
System.Posix.Process
System.Posix.Process.Internals
System.Posix.Resource
System.Posix.Semaphore
System.Posix.SharedMem
System.Posix.Signals
System.Posix.Signals.Exts
System.Posix.Temp
System.Posix.Terminal
System.Posix.Time
System.Posix.Types
System.Posix.Unistd
System.Posix.User
System.Process
System.Random
System.Time
System.Timeout
TemplateHaskell
Test.HUnit
Test.HUnit.Base
Test.HUnit.Lang
Test.HUnit.Terminal
Test.HUnit.Text
Test.QuickCheck
Test.QuickCheck.Batch
Test.QuickCheck.Poly
Test.QuickCheck.Utils
Text.Html
Text.Html.BlockTable
Text.ParserCombinators.Parsec
Text.ParserCombinators.Parsec.Char
Text.ParserCombinators.Parsec.Combinator
Text.ParserCombinators.Parsec.Error
Text.ParserCombinators.Parsec.Expr
Text.ParserCombinators.Parsec.Language
Text.ParserCombinators.Parsec.Perm
Text.ParserCombinators.Parsec.Pos
Text.ParserCombinators.Parsec.Prim
Text.ParserCombinators.Parsec.Token
Text.ParserCombinators.ReadP
Text.ParserCombinators.ReadPrec
Text.PrettyPrint
Text.PrettyPrint.HughesPJ
Text.Printf
Text.Read
Text.Read.Lex
Text.Regex.Base
Text.Regex.Base.Context
Text.Regex.Base.Impl
Text.Regex.Base.RegexLike
Text.Regex.Posix
Text.Regex.Posix.ByteString
Text.Regex.Posix.String
Text.Regex.Posix.Wrap
Text.Show
Text.Show.Functions
Text.XHtml
Text.XHtml.Debug
Text.XHtml.Frameset
Text.XHtml.Strict
Text.XHtml.Table
Text.XHtml.Transitional
Trace.Hpc.Mix
Trace.Hpc.Reflect
Trace.Hpc.Tix
Trace.Hpc.Util
TransformListComp
True
TypeFamilies
TypeOperators
TypeSynonymInstances
UNPACK
UnboxedTuples
UndecidableInstances
UnicodeSyntax
UnliftedFFITypes
Unsafe.Coerce
ViewPatterns
WARNING
abs
acos
acosh
all
and
any
appendFile
as
asTypeOf
asin
asinh
atan
atan2
atanh
break
case
catch
ceiling
class
compare
concat
concatMap
const
cos
cosh
curry
cycle
data
decodeFloat
default
deriving
div
divMod
do
drop
dropWhile
either
elem
else
encodeFloat
enumFrom
enumFromThen
enumFromThenTo
enumFromTo
error
exp
exponent
fail
filter
flip
floatDigits
floatRadix
floatRange
floor
fmap
fold
fold1
foldr
foldr1
fromEnum
fromInteger
fromIntegral
fromRational
fst
gcd
getChar
getContents
getLine
head
hiding
id
if
import
in
infix
infixl
infixr
init
instance
intract
ioError
isDenormalized
isIEEE
isInfinite
isNan
isNegativeZero
iterate
last
lcm
length
let
lex
lines
log
logBase
lookup
map
mapM
mapM_
max
maxBound
maximum
maybe
min
minBound
minimum
mod
module
negate
newtype
not
notElem
null
odd
of
or
otherwise
pi
pred
print
product
properFraction
putChar
putStr
putStrLn
qualified
quot
quotRem
read
readFile
readIO
readList
readLn
readParen
reads
readsPrec
realtoFrac
recip
rem
repeat
replicate
return
reverse
round
scaleFloat
scanl
scanl1
scanr
scanr1
seq
sequence
sequence_
show
showChar
showList
showParen
showString
shows
showsPrec
significand
signum
sin
sinh
snd
span
splitAt
sqrt
subtract
succ
sum
tail
take
takeWhile
tan
tanh
then
toEnum
toInteger
toRational
truncate
type
uncurry
undefined
unlines
until
unwords
unzip
unzip3
userError
where
words
writeFile
zip
zip3
zipWith
zipWith3

View File

@@ -1,53 +0,0 @@
abstract
assert
boolean
break
byte
case
catch
char
class
const
continue
default
do
double
else
enum
extends
final
finally
float
for
goto
if
implements
import
instanceof
int
interface
long
native
new
package
private
protected
public
return
short
static
strictfp
super
switch
synchronized
this
throw
throws
transient
try
void
volatile
while
@Override
@Deprecated
@SuppressWarnings

View File

@@ -1,148 +0,0 @@
Anchor
Area
Array
Boolean
Button
Checkbox
Date
Document
Element
FileUpload
Form
Frame
Function
Hidden
History
Image
Infinity
JavaArray
JavaClass
JavaObject
JavaPackage
Link
Location
Math
MimeType
NaN
Navigator
Number
Object
Option
Packages
Password
Plugin
Radio
RegExp
Reset
Select
String
Submit
Text
Textarea
Window
alert
arguments
assign
blur
break
callee
caller
captureEvents
case
clearInterval
clearTimeout
close
closed
comment
confirm
constructor
continue
default
defaultStatus
delete
do
document
else
escape
eval
export
find
focus
for
frames
function
getClass
history
home
if
import
in
innerHeight
innerWidth
isFinite
isNan
java
label
length
location
locationbar
menubar
moveBy
moveTo
name
navigate
navigator
netscape
new
onBlur
onError
onFocus
onLoad
onUnload
open
opener
outerHeight
outerWidth
pageXoffset
pageYoffset
parent
parseFloat
parseInt
personalbar
print
prompt
prototype
ref
releaseEvents
resizeBy
resizeTo
return
routeEvent
scroll
scrollBy
scrollTo
scrollbars
self
setInterval
setTimeout
status
statusbar
stop
sun
switch
taint
this
toString
toolbar
top
typeof
unescape
untaint
unwatch
valueOf
var
void
watch
while
window
with

View File

@@ -1,37 +0,0 @@
abstract
break
case
catch
const
continue
do
else
elseif
end
eval
export
false
finally
for
function
global
if
ifelse
immutable
import
importall
in
let
macro
module
otherwise
quote
return
switch
throw
true
try
type
typealias
using
while

View File

@@ -1,21 +0,0 @@
and
break
do
else
elseif
end
false
for
function
if
in
local
nil
not
or
repeat
return
then
true
until
while

View File

@@ -1,70 +0,0 @@
addr
and
as
asm
atomic
bind
block
break
case
cast
concept
const
continue
converter
defer
discard
distinct
div
do
elif
else
end
enum
except
export
finally
for
from
func
generic
if
import
in
include
interface
is
isnot
iterator
let
macro
method
mixin
mod
nil
not
notin
object
of
or
out
proc
ptr
raise
ref
return
shl
shr
static
template
try
tuple
type
using
var
when
while
with
without
xor
yield

View File

@@ -1,161 +0,0 @@
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
_Alignas
_Alignof
_Atomic
_Bool
_Complex
_Generic
_Imaginary
_Noreturn
_Static_assert
_Thread_local
alignas
alignof
atomic_
bool
complex
imaginary
noreturn
static_assert
thread_local
#if
#elif
#else
#endif
defined
#ifdef
#ifndef
#define
#undef
#include
#line
#error
#pragma
_Pragma
asm
fortran
#import
self
_cmd
instancetype
__bridge
__bridge_transfer
__bridge_retained
__bridge_retain
@not_keyword
@class
@compatibility_alias
@defs
@encode
@end
@implementation
@interface
@private
@protected
@protocol
@public
@selector
@throw
@try
@catch
@finally
@synchronized
@autoreleasepool
@property
@package
@required
@optional
@synthesize
@dynamic
@import
@available
__attribute__((visibility("default")))
__attribute__((visibility("hidden")))
__attribute__((deprecated))
__attribute__((unavailable))
__attribute__((objc_exception))
__attribute__((objc_root_class))
__covariant
__contravariant
__kindof
getter=
setter=
readonly
readwrite
assign
retain
copy
nonatomic
atomic
strong
weak
unsafe_unretained
nonnull
nullable
null_unspecified
null_resettable
class
__attribute__((deprecated))
in
out
inout
oneway
bycopy
byref
nonnull
nullable
null_unspecified
__attribute__((unused))
super
true
false
__objc_yes
__objc_no
Class
id
SEL
IMP
BOOL
STR
NSInteger
NSUInteger
YES
NO
Nil
nil
__strong
__unsafe_unretained
__autoreleasing

View File

@@ -1,46 +0,0 @@
# GNU Octave, and probably proprietary MATLAB
# https://www.gnu.org/software/octave/doc/interpreter/Keywords.html
__FILE__
__LINE__
break
case
catch
classdef
continue
do
else
elseif
end
end_try_catch
end_unwind_protect
endclassdef
endenumeration
endevents
endfor
endfunction
endif
endmethods
endparfor
endproperties
endswitch
endwhile
enumeration
events
for
function
global
if
methods
otherwise
parfor
persistent
properties
return
static
switch
try
unitl
unwind_protect
unwind_protect_cleanup
while

File diff suppressed because it is too large Load Diff

View File

@@ -1,379 +0,0 @@
ArithmeticError
AssertionError
AttributeError
BaseException
BufferError
BytesWarning
DeprecationWarning
EOFError
Ellipsis
EnvironmentError
Exception
False
FloatingPointError
FutureWarning
GeneratorExit
IOError
ImportError
ImportWarning
IndentationError
IndexError
KeyError
KeyboardInterrupt
LookupError
MemoryError
NameError
None
NotImplemented
NotImplementedError
OSError
OverflowError
PendingDeprecationWarning
ReferenceError
RuntimeError
RuntimeWarning
StandardError
StopIteration
SyntaxError
SyntaxWarning
SystemError
SystemExit
TabError
True
TypeError
UnboundLocalError
UnicodeDecodeError
UnicodeEncodeError
UnicodeError
UnicodeTranslateError
UnicodeWarning
UserWarning
ValueError
Warning
ZeroDivisionError
__builtins__
__debug__
__doc__
__file__
__future__
__import__
__init__
__main__
__name__
__package__
_dummy_thread
_thread
abc
abs
aifc
all
and
any
apply
argparse
array
as
assert
ast
asynchat
asyncio
asyncore
atexit
audioop
base64
basestring
bdb
bin
binascii
binhex
bisect
bool
break
buffer
builtins
bytearray
bytes
bz2
calendar
callable
cgi
cgitb
chr
chuck
class
classmethod
cmath
cmd
cmp
code
codecs
codeop
coerce
collections
colorsys
compile
compileall
complex
concurrent
configparser
contextlib
continue
copy
copyreg
copyright
credits
crypt
csv
ctypes
curses
datetime
dbm
decimal
def
del
delattr
dict
difflib
dir
dis
distutils
divmod
doctest
dummy_threading
elif
else
email
enumerate
ensurepip
enum
errno
eval
except
exec
execfile
exit
faulthandler
fcntl
file
filecmp
fileinput
filter
finally
float
fnmatch
for
format
formatter
fpectl
fractions
from
frozenset
ftplib
functools
gc
getattr
getopt
getpass
gettext
glob
global
globals
grp
gzip
hasattr
hash
hashlib
heapq
help
hex
hmac
html
http
id
if
imghdr
imp
impalib
import
importlib
in
input
inspect
int
intern
io
ipaddress
is
isinstance
issubclass
iter
itertools
json
keyword
lambda
len
license
linecache
list
locale
locals
logging
long
lzma
macpath
mailbox
mailcap
map
marshal
math
max
memoryview
mimetypes
min
mmap
modulefinder
msilib
msvcrt
multiprocessing
netrc
next
nis
nntplib
not
numbers
object
oct
open
operator
optparse
or
ord
os
ossaudiodev
parser
pass
pathlib
pdb
pickle
pickletools
pipes
pkgutil
platform
plistlib
poplib
posix
pow
pprint
print
profile
property
pty
pwd
py_compiler
pyclbr
pydoc
queue
quit
quopri
raise
random
range
raw_input
re
readline
reduce
reload
repr
reprlib
resource
return
reversed
rlcompleter
round
runpy
sched
select
selectors
self
set
setattr
shelve
shlex
shutil
signal
site
slice
smtpd
smtplib
sndhdr
socket
socketserver
sorted
spwd
sqlite3
ssl
stat
staticmethod
statistics
str
string
stringprep
struct
subprocess
sum
sunau
super
symbol
symtable
sys
sysconfig
syslog
tabnanny
tarfile
telnetlib
tempfile
termios
test
textwrap
threading
time
timeit
tkinter
token
tokenize
trace
traceback
tracemalloc
try
tty
tuple
turtle
type
types
unichr
unicode
unicodedata
unittest
urllib
uu
uuid
vars
venv
warnings
wave
weakref
webbrowser
while
winsound
winreg
with
wsgiref
xdrlib
xml
xmlrpc
xrange
yield
zip
zipfile
zipimport
zlib

View File

@@ -1,183 +0,0 @@
AlignBottom
AlignCenter
AlignHCenter
AlignLeft
AlignRight
AlignTop
AlignVCenter
AnchorAnimation
AnchorChanges
Audio
Behavior
Binding
BorderImage
ColorAnimation
Column
Component
Connections
Easing
Flickable
Flipable
Flow
FocusScope
GestureArea
Grid
GridView
Horizontal
Image
InBack
InBounce
InCirc
InCubic
InElastic
InExpo
InOutBack
InOutBounce
InOutCirc
InOutCubic
InOutElastic
InOutExpo
InOutQuad
InOutQuart
InOutQuint
InQuad
InQuart
InQuint
InQuint
InSine
Item
LayoutItem
LeftButton
Linear
ListElement
ListModel
ListView
Loader
MidButton
MiddleButton
MouseArea
NoButton
NumberAnimation
OutBack
OutBounce
OutCirc
OutCubic
OutElastic
OutExpo
OutInBack
OutInBounce
OutInCirc
OutInCubic
OutInElastic
OutInExpo
OutInQuad
OutInQuart
OutInQuint
OutQuad
OutQuart
OutQuint
OutSine
Package
ParallelAnimation
ParentAnimation
ParentChange
ParticleMotionGravity
ParticleMotionLinear
ParticleMotionWander
Particles
Path
PathAttribute
PathCubic
PathLine
PathPercent
PathQuad
PathView
PauseAnimation
PropertyAction
PropertyAnimation
PropertyChanges
Qt
QtObject
Rectangle
Repeater
RightButton
Rotation
RotationAnimation
Row
Scale
ScriptAction
SequentialAnimation
SmoothedAnimation
SoundEffect
SpringFollow
State
StateChangeScript
StateGroup
SystemPalette
Text
TextEdit
TextInput
Timer
Transition
Translate
Vertical
Video
ViewsPositionersMediaEffects
VisualDataModel
VisualItemModel
WebView
WorkerScript
XmlListModel
XmlRole
alias
as
bool
break
case
catch
color
const
continue
date
debugger
default
delete
do
double
else
enum
false
false
finally
for
function
if
import
import
in
instanceof
int
let
new
null
on
parent
property
real
return
signal
string
switch
this
throw
true
try
typeof
undefined
url
var
variant
void
while
with
yield

View File

@@ -1,181 +0,0 @@
$!
$"
$$
$&
$'
$*
$+
$,
$-0
$-F
$-I
$-K
$-a
$-d
$-i
$-l
$-p
$-v
$-w
$.
$/
$0
$1
$10
$11
$2
$3
$4
$5
$6
$7
$8
$9
$:
$;
$<
$=
$>
$?
$@
$DEBUG
$FILENAME
$KCODE
$LOADED_FEATURES
$LOAD_PATH
$PROGRAM_NAME
$SAFE
$VERBOSE
$\
$_
$`
$deferr
$defout
$stderr
$stdin
$stdout
$~
ARGF
ARGV
Array
BEGIN
DATA
END
ENV
FALSE
Float
Integer
NIL
PLATFORM
RELEASE_DATE
RUBY_COPYRIGHT
RUBY_DESCRIPTION
RUBY_PATCHLEVEL
RUBY_PLATFORM
RUBY_RELEASE_DATE
RUBY_VERSION
SCRIPT_LINES__
STDERR
STDIN
STDOUT
String
TOPLEVEL_BINDING
TRUE
VERSION
__method__
`
abort
alias
and
at_exit
autoload
autoload?
begin
binding
block_given
break
callcc
caller
case
catch
chomp
chomp!
chop
chop
class
def
defined?
do
else
elsif
end
ensure
eval
exec
exit
exit!
fail
false
for
fork
format
getc
gets
global_variables
gsub
gsub!
if
in
iterator?
lambda
load
local_variables
loop
module
next
nil
not
open
or
p
printf
proc
putc
puts
raise
rand
readline
readlines
redo
require
require_relative
rescue
retry
return
scan
select
self
set_trace_func
sleep
split
sprintf
srand
sub
sub!
super
syscall
system
test
then
throw
trace_var
trap
true
undef
unless
until
untrace_var
warn
when
while
yield

File diff suppressed because it is too large Load Diff

View File

@@ -1,216 +0,0 @@
case-lambda
call/cc
class
define-class
exit-handler
field
import
inherit
init-field
interface
let*-values
let-values
let/ec
mixin
opt-lambda
override
protect
provide
public
rename
require
require-for-syntax
syntax
syntax-case
syntax-error
unit/sig
unless
when
with-syntax
and
begin
call-with-current-continuation
call-with-input-file
call-with-output-file
case
cond
define
define-syntax
delay
do
dynamic-wind
else
for-each
if
lambda
let
let*
let-syntax
letrec
letrec-syntax
map
or
syntax-rules
abs
acos
angle
append
apply
asin
assoc
assq
assv
atan
boolean?
caar
cadr
call-with-input-file
call-with-output-file
call-with-values
car
cdddar
cddddr
cdr
ceiling
char->integer
char-alphabetic?
char-ci<=?
char-ci<?
char-ci=?
char-ci>=?
char-ci>?
char-downcase
char-lower-case?
char-numeric?
char-ready?
char-upcase
char-upper-case?
char-whitespace?
char<=?
char<?
char=?
char>=?
char>?
char?
close-input-port
close-output-port
complex?
cons
cos
current-input-port
current-output-port
denominator
display
eof-object?
eq?
equal?
eqv?
eval
even?
exact->inexact
exact?
exp
expt
#f
floor
force
gcd
imag-part
inexact->exact
inexact?
input-port?
integer->char
integer?
interaction-environment
lcm
length
list
list->string
list->vector
list-ref
list-tail
list?
load
log
magnitude
make-polar
make-rectangular
make-string
make-vector
max
member
memq
memv
min
modulo
negative?
newline
not
null-environment
null?
number->string
number?
numerator
odd?
open-input-file
open-output-file
output-port?
pair?
peek-char
port?
positive?
procedure?
quasiquote
quote
quotient
rational?
rationalize
read
read-char
real-part
real?
remainder
reverse
round
scheme-report-environment
set!
set-car!
set-cdr!
sin
sqrt
string
string->list
string->number
string->symbol
string-append
string-ci<=?
string-ci<?
string-ci=?
string-ci>=?
string-ci>?
string-copy
string-fill!
string-length
string-ref
string-set!
string<=?
string<?
string=?
string>=?
string>?
string?
substring
symbol->string
symbol?
#t
tan
transcript-off
transcript-on
truncate
values
vector
vector->list
vector-fill!
vector-length
vector-ref
vector-set!

File diff suppressed because it is too large Load Diff

View File

@@ -1,182 +0,0 @@
# Bash Family Shell Dictionary
# http://www.gnu.org/software/bash/manual/bash.html
.
:
[
alias
bg
bind
break
builtin
caller
cd
command
compgen
complete
compopt
continue
declare
dirs
disown
echo
enable
eval
exec
exit
export
fc
fg
getopts
hash
help
history
jobs
kill
let
local
logout
mapfile
popd
printf
pushd
pwd
read
readarray
readonly
return
set
shift
shopt
source
suspend
test
times
trap
type
typeset
ulimit
umask
unalias
unset
wait
!
[[
]]
case
do
done
elif
else
esac
fi
for
function
if
in
select
then
time
until
while
{
}
!
#
$
*
-
0
?
@
_
BASH
BASH_ALIASES
BASH_ARGC
BASH_ARGV
BASH_CMDS
BASH_COMMAND
BASH_ENV
BASH_EXECUTION_STRING
BASH_LINENO
BASH_REMATCH
BASH_SOURCE
BASH_SUBSHELL
BASH_VERSINFO
BASH_VERSION
BASH_XTRACEFD
BASHOPTS
BASHPID
CDPATH
COLUMNS
COMP_CWORD
COMP_KEY
COMP_LINE
COMP_POINT
COMP_TYPE
COMP_WORDBREAKS
COMP_WORDS
COMPREPLY
DIRSTACK
EMACS
EUID
FCEDIT
FIGNORE
FUNCNAME
GLOBIGNORE
GROUPS
HISTCMD
HISTCONTROL
HISTFILE
HISTFILESIZE
HISTIGNORE
HISTSIZE
HISTTIMEFORMAT
HOME
HOSTFILE
HOSTNAME
HOSTTYPE
IFS
IGNOREEOF
INPUTRC
LANG
LC_ALL
LC_COLLATE
LC_CTYPE
LC_MESSAGES
LC_MESSAGES
LC_NUMERIC
LINENO
LINES
MACHTYPE
MAIL
MAILCHECK
MAILPATH
OLDPWD
OPTARG
OPTERR
OPTIND
OSTYPE
PATH
PIPESTATUS
POSIXLY_CORRECT
PPID
PROMPT_COMMAND
PROMPT_DIRTRIM
PS1
PS2
PS3
PS4
PWD
RANDOM
REPLY
SECONDS
SHELL
SHELLOPTS
SHLVL
TEXTDOMAIN
TEXTDOMAINDIR
TIMEFORMAT
TMOUT
TMPDIR
UID

View File

@@ -1,87 +0,0 @@
associatedtype
class
deinit
enum
extension
func
import
init
inout
let
operator
precedencegroup
protocol
struct
subscript
typealias
var
fileprivate
internal
private
public
static
undef
sil
sil_stage
sil_vtable
sil_global
sil_witness_table
sil_default_witness_table
sil_coverage_map
sil_scope
defer
if
guard
do
repeat
else
for
in
while
return
break
continue
fallthrough
switch
case
default
where
catch
as
Any
false
is
nil
rethrows
super
self
Self
throw
true
try
throws
__FILE__
__LINE__
__COLUMN__
__FUNCTION__
__DSO_HANDLE__
_
#if
#else
#elseif
#endif
#keyPath
#line
#sourceLocation
#selector
#available
#fileLiteral
#imageLiteral
#colorLiteral
#FileReference
#Image
#Color
#file
#column
#function
#dsohandle

View File

@@ -1,172 +0,0 @@
after
append
apply
array
auto_execok
auto_import
auto_load
auto_load_index
auto_mkindex
auto_mkindex_old
auto_qualify
auto_reset
bell
binary
bind
bindtags
break
button
canvas
case
catch
cd
chan
checkbutton
clipboard
clock
close
concat
continue
destroy
dict
encoding
entry
eof
error
eval
event
exec
exit
expr
fblocked
fconfigure
fcopy
file
fileevent
flush
focus
font
for
foreach
format
frame
gets
glob
global
grab
grid
if
image
incr
info
interp
join
label
labelframe
lappend
lassign
lindex
linsert
list
listbox
llength
load
lower
lrange
lrepeat
lreplace
lreverse
lsearch
lset
lsort
menu
menubutton
message
namespace
open
option
pack
package
panedwindow
pid
pkg_mkIndex
place
proc
puts
pwd
radiobutton
raise
read
regexp
registry
regsub
rename
return
scale
scan
scrollbar
seek
selection
set
socket
source
spinbox
split
string
subst
switch
tclLog
tclPkgSetup
tclPkgUnknown
tcl_findLibrary
tell
text
time
tk
tk_chooseColor
tk_chooseDirectory
tk_getOpenFile
tk_getSaveFile
tk_menuSetFocus
tk_messageBox
tk_popup
tk_textCopy
tk_textCut
tk_textPaste
tkwait
toplevel
ttk::button
ttk::checkbutton
ttk::combobox
ttk::entry
ttk::focusFirst
ttk::frame
ttk::label
ttk::labelframe
ttk::menubutton
ttk::notebook
ttk::paned
ttk::panedwindow
ttk::progressbar
ttk::radiobutton
ttk::scale
ttk::scrollbar
ttk::separator
ttk::setTheme
ttk::sizegrip
ttk::style
ttk::takefocus
ttk::themes
ttk::treeview
trace
unknown
unload
unset
update
uplevel
upvar
variable
vwait
while
winfo
wm

View File

@@ -1,797 +0,0 @@
absRefPrefix
accessibility
accessibilityWrap
accessKey
ACT
ACTIFSUB
ACTIVSUBRO
ACTRO
addAttributes
addExtUrlsAndShortCuts
additionalHeaders
additionalParams
addParams
addQueryString
addQueryString
adjustItemsH
adjustSubItemsH
adminPanelStyles
after
age
align
align.field
all
allowedAttribs
allowedGroups
allowEdit
allowNew
allowTags
allStdWrap
allWrap
alternativeSortingField
alternativeTempPath
altImgResource
altTarget
altText
alwaysActivePIDlist
alwaysLink
andWhere
angle
antiAlias
append
applyTotalH
applyTotalW
arrayReturnMode
arrowACT
arrowImgParams
arrowNO
ATagBeforeWrap
ATagParams
ATagTitle
atLeast
atMost
authcodeFields
autoInsertPID
autostart
backColor
badMess
base64
baseURL
beforeImg
beforeImgLink
beforeImgTagParams
beforeROImg
beforeWrap
begin
begin
beginAtLevel
beLoginLinkIPList
beLoginLinkIPList_login
beLoginLinkIPList_logout
beUserLogin
bgImg
blankStrEqFalse
blur
bm
bodyTag
bodyTag
bodyTagAdd
bodyTagCObject
bodyTagMargins
border
border
borderCol
bordersWithin
borderThick
bottomContent
bottomHeight
br
breakSpace
breakWidth
brTag
bytes
c
cache_clearAtMidnight
cached
cache_period
caption
captionAlign
captionSplit
case
case
CASE
casesensitiveComp
cellpadding
cellspacing
char
charcoal
clearCacheOfPages
cMargins
COA
COA_INT
cObject
cObjNum
code
collapse
color
color1
color2
color3
color.default
color.field
colRelations
cols
cols
colSpace
COLUMNS
COMMENT
commentWrap
compensateFieldWidth
compX
compY
concatenateJsAndCss
conf
config
config
CONFIG
constants
CONTENT
content_fallback
content_from_pid_allowOutsideDomain
controllerActionName
controllerExtensionName
controllerName
crop
cropHTML
csConv
cssInline
CSS_inlineStyle
CTABLE
CUR
CURIFSUB
CURIFSUBRO
current
CURRO
cWidth
data
dataArray
dataWrap
date
debug
debugData
debugFunc
debugItemConf
debugRenumberedObject
decimals
dec_point
default
defaultAlign
defaultCmd
defaultCode
defaultGetVars
delete
denyTags
depth
dimensions
directImageLink
directionLeft
directionUp
directReturn
disableAllHeaderCode
disableAltText
disableCharsetHeader
disableImgBorderAttr
disablePageExternalUrl
disablePrefixComment
disablePreviewNotification
displayActiveOnLoad
displayActiveOnLoad
displayrecord
distributeX
distributeY
doctype
doctypeSwitch
doNotLinkIt
doNotShowLink
doNotStripHTML
dontCheckPid
dontFollowMouse
dontHideOnMouseUp
dontLinkIfSubmenu
dontMd5FieldNames
dontWrapInTable
doubleBrTag
doublePostCheck
dWorkArea
edge
edit
editIcons
editIcons
editPanel
EDITPANEL
EDITPANEL
effects
email
emailMess
emboss
emptyTitleHandling
emptyTitleHandling
emptyTitleHandling
enable
enableContentLengthHeader
encapsLines
encapsLinesStdWrap
encapsTagList
entryLevel
equalH
equals
evalErrors
evalFunc
excludeDoktypes
excludeNoSearchPages
excludeUidList
expAll
explode
ext
extbase
externalBlocks
extOnReady
extTarget
face.default
face.field
FEData
fe_userEditSelf
fe_userOwnSelf
field
fieldPrefix
fieldRequired
fieldWrap
file
FILE
filelink
fileList
fileTarget
firstLabel
firstLabelGeneral
flip
flop
foldSpeed
foldTimer
fontFile
fontSize
fontSizeMultiplicator
fontTag
footerData
forceAbsoluteUrl
forceTypeValue
FORM
format
formName
formurl
frame
frameReloadIfNotInFrameset
frameSet
freezeMouseover
ftu
gamma
gapBgCol
gapLineCol
gapLineThickness
gapWidth
gif
GIFBUILDER
globalNesting
GMENU
goodMess
gray
gr_list
groupBy
headerComment
headerData
headTag
height
hiddenFields
hide
hideButCreateMap
hideMenuTimer
hideMenuWhenNotOver
hideNonTranslated
highColor
HMENU
hover
hoverStyle
HRULER
HTML
html5
htmlmail
HTMLparser
htmlSpecialChars
htmlTag_dir
htmlTag_langKey
htmlTag_setParams
http
icon
iconCObject
icon_image_ext_list
icon_link
icon_thumbSize
if
ifBlank
ifEmpty
IFSUB
IFSUBRO
ignore
IMAGE
image_compression
image_effects
image_frames
imgList
imgMap
imgMapExtras
imgMax
imgNameNotRandom
imgNamePrefix
imgObjNum
imgParams
imgPath
imgStart
IMGTEXT
import
inBranch
includeCSS
includeJS
includeJSFooter
includeJSFooterlibs
includeJSlibs
includeLibrary
includeLibs
includeNotInMenu
incT3Lib_htmlmail
index_descrLgd
index_enable
index_externals
index_metatags
infomail
inlineJS
inlineLanguageLabel
inlineSettings
inlineStyle2TempFile
innerStdWrap_all
innerWrap
innerWrap2
inputLevels
insertClassesFromRTE
insertData
intensity
intTarget
intval
invert
IProcFunc
isFalse
isGreaterThan
isInList
isLessThan
isPositive
isTrue
itemArrayProcFunc
items
iterations
javascriptLibs
join
jpg
jsFooterInline
jsInline
JSMENU
JSwindow
JSwindow.altUrl
JSwindow.altUrl_noDefaultParams
JSwindow.expand
JSwindow.newWindow
JSwindow_params
jumpurl
jumpurl_enable
jumpurl_mailto_disable
keep
keepNonMatchedTags
keywords
keywordsField
labelStdWrap
labelWrap
lang
language
language_alt
languageField
layer_menu_id
layerStyle
layout
layoutRootPath
leftjoin
leftOffset
levels
limit
lineColor
lineThickness
linkAccessRestrictedPages
linkParams
linkVars
linkWrap
list
listNum
lm
LOAD_REGISTER
locale_all
localNesting
locationData
lockFilePath
lockPosition
lockPosition_addSelf
lockPosition_adjust
loginUser
longdescURL
loop
lowColor
lower
mailto
main
mainScript
makelinks
markers
markerWrap
mask
max
maxAge
maxH
maxHeight
maxItems
maxW
maxWidth
maxWInText
m.bgImg
m.bottomImg
m.bottomImg_mask
md5
meaningfulTempFilePrefix
menuBackColor
menuHeight
menuOffset
menuWidth
message_page_is_being_generated
message_preview
message_preview_workspace
meta
metaCharset
method
minH
minifyCSS
minifyJS
minItems
minItems
minW
m.mask
moveJsFromHeaderToFooter
MP_defaults
MP_disableTypolinkClosestMPvalue
MP_mapRootPoints
MULTIMEDIA
name
namespaces
negate
newRecordFromTable
newRecordInPid
next
niceText
NO
noAttrib
noBlur
no_cache
noCols
noLink
noLinkUnderline
nonCachedSubst
none
nonTypoTagStdWrap
nonTypoTagUserFunc
nonWrappedTag
noOrderBy
noPageTitle
noResultObj
normalWhenNoLanguage
noRows
noScale
noScaleUp
noscript
noStretchAndMarginCells
notification_email_charset
notification_email_encoding
notification_email_urlmode
noTrimWrap
noValueInsert
noWrapAttr
numberFormat
numRows
obj
offset
offset
_offset
offsetWrap
onlyCurrentPid
opacity
options
orderBy
OTABLE
outerWrap
outline
output
outputLevels
override
overrideAttribs
overrideEdit
overrideId
PAGE
pageGenScript
pageRendererTemplateFile
pageTitleFirst
parameter
params
parseFunc
parseFunc
parseValues
partialRootPath
path
pidInList
pixelSpaceFontSizeRef
plainTextStdWrap
pluginNames
png
postCObject
postUserFunc
postUserFunkInt
preCObject
prefixComment
prefixLocalAnchors
prefixLocalAnchors
prefixRelPathWith
preIfEmptyListNum
prepend
preUserFunc
prev
previewBorder
printBeforeContent
prioriCalc
processScript
properties
protect
protectLvar
quality
quality
radioInputWrap
radioWrap
range
range
rawUrlEncode
recipient
RECORDS
recursive
redirect
reduceColors
relativeToParentLayer
relativeToTriggerItem
relPathPrefix
remap
remapTag
removeBadHTML
removeDefaultJS
removeIfEquals
removeIfFalse
removeObjectsOfDummy
removePrependedNumbers
removeTags
removeWrapping
renderCharset
renderObj
renderWrap
REQ
required
required
resources
resultObj
returnKey
returnLast
reverseOrder
rightjoin
rm
rmTagIfNoAttrib
RO_chBgColor
rootline
rotate
rows
rowSpace
sample
sample
section
sectionIndex
select
sendCacheHeaders
sendCacheHeaders_onlyWhenLoginDeniedInBranch
separator
setContentToCurrent
setCurrent
setfixed
setFixedHeight
setFixedWidth
setJS_mouseOver
setJS_openPic
setKeywords
shadow
sharpen
shear
short
shortcutIcon
showAccessRestrictedPages
showActive
showFirst
simulateStaticDocuments
simulateStaticDocuments_addTitle
simulateStaticDocuments_dontRedirectPathInfoError
simulateStaticDocuments_noTypeIfNoTitle
simulateStaticDocuments_pEnc
simulateStaticDocuments_pEnc_onlyP
simulateStaticDocuments_replacementChar
sitetitle
size
size.default
size.field
slide
smallFormFields
solarize
source
space
spaceAfter
spaceBefore
spaceBelowAbove
spaceLeft
spaceRight
spacing
spamProtectEmailAddresses
spamProtectEmailAddresses_atSubst
spamProtectEmailAddresses_lastDotSubst
SPC
special
split
splitRendering
src
stat
stat_apache
stat_apache_logfile
stat_apache_niceTitle
stat_apache_noHost
stat_apache_noRoot
stat_apache_notExtended
stat_apache_pagenames
stat_excludeBEuserHits
stat_excludeIPList
stat_mysql
stat_pageLen
stat_titleLen
stat_typeNumList
stayFolded
stdWrap
stdWrap2
strftime
stripHtml
stripProfile
stylesheet
submenuObjSuffixes
subMenuOffset
subparts
subst_elementUid
subst_elementUid
substMarksSeparately
substring
swirl
sword
sword_noMixedCase
sword_standAlone
sys_language_mode
sys_language_overlay
sys_language_softExclude
sys_language_softMergeIfNotBlank
sys_language_uid
sys_page
table
tableParams
tables
tableStdWrap
tableStyle
tags
target
TCAselectItem
TDparams
template
TEMPLATE
templateFile
text
TEXT
textMargin
textMargin_outOfText
textMaxLength
textObjNum
textPos
textStyle
thickness
thousands_sep
title
titleTagFunction
titleText
titleText
tm
TMENU
token
topOffset
totalWidth
transparentBackground
transparentColor
trim
twice
typeNum
types
typolink
typolinkCheckRootline
typolinkEnableLinksAcrossDomains
typolinkLinkAccessRestrictedPages
typolinkLinkAccessRestrictedPages_addParams
uid
uidInList
uniqueGlobal
uniqueLinkVars
uniqueLocal
unset
unsetEmpty
upper
url
useCacheHash
useLargestItemX
useLargestItemY
USER
USERDEF1
USERDEF1RO
USERDEF2RO
USERFEF2
userFunc
userFunc_updateArray
userIdColumn
USER_INT
USERNAME_substToken
USERUID_substToken
USR
USRRO
value
variables
wave
where
width
wordSpacing
workArea
workOnSubpart
wrap
wrap2
wrap3
wrapAlign
wrapFieldName
wrapItemAndSub
wrapNoWrappedLines
wraps
xhtml_11
xhtml_2
xhtml_basic
xhtml_cleaning
xhtmlDoctype
xhtml_frames
xhtml+rdfa_10
xhtml_strict
xhtml_trans
xml_10
xml_11
xmlprologue
xPosOffset
yPosOffset

View File

@@ -1,231 +0,0 @@
# OCaml 3.12.1
# Keywords
and
as
assert
begin
class
constraint
do
done
downto
else
end
exception
external
false
for
fun
function
functor
if
in
include
inherit
initializer
lazy
let
match
method
module
mutable
new
object
of
open
or
private
rec
sig
struct
then
to
true
try
type
val
virtual
when
while
with
# Pervasives
!
!=
&
&&
*
**
*.
+
+.
-
-.
/
/.
:=
<
<=
<>
=
==
>
>=
@
FP_infinite
FP_nan
FP_normal
FP_subnormal
FP_zero
LargeFile
Open_append
Open_binary
Open_creat
Open_nonblock
Open_rdonly
Open_text
Open_trunc
Open_wronly
Oupen_excl
^
^^
abs
abs_float
acos
asin
asr
at_exit
atan
atan2
bool_of_string
ceil
char_of_int
classify_float
close_in
close_in_noerr
close_out
close_out_noerr
compare
cos
cosh
decr
do_at_exit
epsilon_float
exit
exp
expm1
failwith
float
float_of_int
float_of_string
floor
flush
flush_all
format
format4
format_of_string
fpclass
frexp
fst
ignore
in_channel
in_channel_length
incr
infinity
input
input_binary_int
input_byte
input_char
input_line
input_value
int_of_char
int_of_float
int_of_string
invalid_arg
land
ldexp
lnot
log
log10
log1p
lor
lsl
lsr
lxor
max
max_float
max_int
min
min_float
min_int
mod
mod_float
modf
nan
neg_infinity
not
open_flag
open_in
open_in_bin
open_in_gen
open_out
open_out_bin
open_out_gen
or
out_channel
out_channel_length
output
output_binary_int
output_byte
output_char
output_string
output_value
pos_in
pos_out
pred
prerr_char
prerr_endline
prerr_float
prerr_int
prerr_newline
prerr_string
print_char
print_endline
print_float
print_int
print_newline
print_string
raise
read_float
read_int
read_line
really_input
ref
seek_in
seek_out
set_binary_mode_in
set_binary_mode_out
sin
sinh
snd
sqrt
stderr
stdin
stdout
string_of_bool
string_of_float
string_of_format
string_of_int
succ
tan
tanh
truncate
unsafe_really_input
valid_float_lexem
||
~
~+
~+.
~-
~-.

View File

@@ -1,313 +0,0 @@
`define
`else
`endif
`ifdef
`ifndef
`macromodule
`module
`primitive
`timescale
above
abs
absdelay
ac_stim
acos
acosh
alias
aliasparam
always
always_comb
always_ff
always_latch
analog
analysis
and
asin
asinh
assert
assign
assume
atan
atan2
atanh
automatic
before
begin
bind
bins
binsof
bit
branch
break
buf
bufif0
bufif1
byte
case
casex
casez
cell
chandle
class
clocking
cmos
config
connectmodule
connectrules
const
constraint
context
continue
cos
cosh
cover
covergroup
coverpoint
cross
ddt
ddx
deassign
default
define
defparam
design
disable
discipline
dist
do
driver_update
edge
else
end
endcase
endclass
endclocking
endconfig
endconnectrules
enddiscipline
endfunction
endgenerate
endgroup
endif
endinterface
endmodule
endnature
endpackage
endparamset
endprimitive
endprogram
endproperty
endsequence
endspecify
endtable
endtask
enum
event
exclude
exp
expect
export
extends
extern
final
final_step
first_match
flicker_noise
floor
flow
for
force
foreach
forever
fork
forkjoin
from
function
generate
genvar
ground
highz0
highz1
hypot
idt
idtmod
if
ifdef
iff
ifndef
ifnone
ignore_bins
illegal_bins
import
incdir
include
inf
initial
initial_step
inout
input
inside
instance
int
integer
interface
intersect
join
join_any
join_none
laplace_nd
laplace_np
laplace_zd
laplace_zp
large
last_crossing
liblist
library
limexp
ln
local
localparam
log
logic
longint
macromodule
mailbox
matches
max
medium
min
modport
module
nand
nand
nature
negedge
net_resolution
new
nmos
nmos
noise_table
nor
noshowcancelled
not
notif0
notif1
null
or
output
package
packed
parameter
paramset
pmos
pmos
posedge
potential
pow
primitive
priority
program
property
protected
pull0
pull1
pullup
pulsestyle_ondetect
pulsestyle_onevent
pure
rand
randc
randcase
randcase
randsequence
rcmos
real
realtime
ref
reg
release
repeat
return
rnmos
rpmos
rtran
rtranif0
rtranif1
scalared
semaphore
sequence
shortint
shortreal
showcancelled
signed
sin
sinh
slew
small
solve
specify
specparam
sqrt
static
string
strong0
strong1
struct
super
supply
supply0
supply1
table
tagged
tan
tanh
task
then
this
throughout
time
timeprecision
timer
timescale
timeunit
tran
tran
tranif0
tranif1
transition
tri
tri
tri0
tri1
triand
trior
trireg
type
typedef
union
unique
unsigned
use
uwire
var
vectored
virtual
void
wait
wait_order
wand
weak0
weak1
while
white_noise
wildcard
wire
with
within
wor
wreal
xnor
xor
zi_nd
zi_np
zi_zd

View File

@@ -1,147 +0,0 @@
;;; biblio-arxiv.el --- Lookup and import bibliographic entries from arXiv -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Lookup and download bibliographic records from arXiv using `arxiv-lookup'.
;; When a DOI is available, the metadata is fetched from the DOI's issuer;
;; otherwise, this package uses arXiv's metadata to generate an entry.
;;
;; This package uses `biblio-selection-mode', and plugs into the more general
;; `biblio' package (which see for more documentation).
;;; Code:
(require 'biblio-core)
(require 'biblio-doi)
(require 'timezone)
(defgroup biblio-arxiv nil
"arXiv support in biblio.el"
:group 'biblio)
(defcustom biblio-arxiv-bibtex-header "online"
"Which header to use for BibTeX entries generated from arXiv metadata."
:group 'biblio
:type 'string)
(defun biblio-arxiv--build-bibtex-1 (metadata)
"Create an unformated BibTeX record for METADATA."
(let-alist metadata
(format "@%s{NO_KEY,
author = {%s},
title = {{%s}},
year = {%s},
archivePrefix = {arXiv},
eprint = {%s},
primaryClass = {%s}}"
biblio-arxiv-bibtex-header
(biblio-join-1 " AND " .authors)
.title .year .identifier .category)))
(defun biblio-arxiv--build-bibtex (metadata)
"Create a BibTeX record for METADATA."
(let-alist metadata
(message "Auto-generating a BibTeX entry for %S." .id)
(biblio-format-bibtex (biblio-arxiv--build-bibtex-1 metadata) t)))
(defun biblio-arxiv--forward-bibtex (metadata forward-to)
"Forward BibTeX for arXiv entry METADATA to FORWARD-TO."
(let-alist metadata
(if (seq-empty-p .doi)
(funcall forward-to (biblio-arxiv--build-bibtex metadata))
(biblio-doi-forward-bibtex .doi forward-to))))
(defun biblio-arxiv--format-author (author)
"Format AUTHOR for arXiv search results."
(when (eq (car-safe author) 'author)
(let-alist (cdr author)
(biblio-join " "
(cadr .name)
(biblio-parenthesize (cadr .arxiv:affiliation))))))
(defun biblio-arxiv--extract-id (id)
"Extract identifier from ID, the URL of an arXiv abstract."
(replace-regexp-in-string "https?://arxiv.org/abs/" "" id))
(defun biblio-arxiv--pdf-url (id)
"Extract PDF url from ID of an arXiv entry."
(when id
(concat "http://arxiv.org/pdf/" id)))
(defun biblio-arxiv--extract-interesting-fields (entry)
"Prepare an arXiv search result ENTRY for display."
(let-alist entry
(let ((id (biblio-arxiv--extract-id (cadr .id))))
(list (cons 'doi (cadr .arxiv:doi))
(cons 'identifier id)
(cons 'year (aref (timezone-parse-date (cadr .published)) 0))
(cons 'title (cadr .title))
(cons 'authors (seq-map #'biblio-arxiv--format-author entry))
(cons 'container (cadr .arxiv:journal_ref))
(cons 'category
(biblio-alist-get 'term (car .arxiv:primary_category)))
(cons 'references (list (cadr .arxiv:doi) id))
(cons 'type "eprint")
(cons 'url (biblio-alist-get 'href (car .link)))
(cons 'direct-url (biblio-arxiv--pdf-url id))))))
(defun biblio-arxiv--entryp (entry)
"Check if ENTRY is an arXiv entry."
(eq (car-safe entry) 'entry))
(defun biblio-arxiv--parse-search-results ()
"Extract search results from arXiv response."
(biblio-decode-url-buffer 'utf-8)
(let-alist (xml-parse-region (point-min) (point-max))
(seq-map #'biblio-arxiv--extract-interesting-fields
(seq-filter #'biblio-arxiv--entryp .feed))))
(defun biblio-arxiv--url (query)
"Create an arXiv url to look up QUERY."
(format "http://export.arxiv.org/api/query?search_query=%s"
(url-encode-url query)))
;;;###autoload
(defun biblio-arxiv-backend (command &optional arg &rest more)
"A arXiv backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'."
(pcase command
(`name "arXiv")
(`prompt "arXiv query: ")
(`url (biblio-arxiv--url arg))
(`parse-buffer (biblio-arxiv--parse-search-results))
(`forward-bibtex (biblio-arxiv--forward-bibtex arg (car more)))
(`register (add-to-list 'biblio-backends #'biblio-arxiv-backend))))
;;;###autoload
(add-hook 'biblio-init-hook #'biblio-arxiv-backend)
;;;###autoload
(defun biblio-arxiv-lookup (&optional query)
"Start an arXiv search for QUERY, prompting if needed."
(interactive)
(biblio-lookup #'biblio-arxiv-backend query))
;;;###autoload
(defalias 'arxiv-lookup 'biblio-arxiv-lookup)
(provide 'biblio-arxiv)
;;; biblio-arxiv.el ends here

View File

@@ -1,146 +0,0 @@
;;; biblio-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "biblio-arxiv" "biblio-arxiv.el" (23017 2297
;;;;;; 812757 96000))
;;; Generated autoloads from biblio-arxiv.el
(autoload 'biblio-arxiv-backend "biblio-arxiv" "\
A arXiv backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'.
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
(add-hook 'biblio-init-hook #'biblio-arxiv-backend)
(autoload 'biblio-arxiv-lookup "biblio-arxiv" "\
Start an arXiv search for QUERY, prompting if needed.
\(fn &optional QUERY)" t nil)
(defalias 'arxiv-lookup 'biblio-arxiv-lookup)
;;;***
;;;### (autoloads nil "biblio-crossref" "biblio-crossref.el" (23017
;;;;;; 2297 832757 134000))
;;; Generated autoloads from biblio-crossref.el
(autoload 'biblio-crossref-backend "biblio-crossref" "\
A CrossRef backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'.
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
(add-hook 'biblio-init-hook #'biblio-crossref-backend)
(autoload 'biblio-crossref-lookup "biblio-crossref" "\
Start a CrossRef search for QUERY, prompting if needed.
\(fn &optional QUERY)" t nil)
(defalias 'crossref-lookup 'biblio-crossref-lookup)
;;;***
;;;### (autoloads nil "biblio-dblp" "biblio-dblp.el" (23017 2297
;;;;;; 842757 144000))
;;; Generated autoloads from biblio-dblp.el
(autoload 'biblio-dblp-backend "biblio-dblp" "\
A DBLP backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'.
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
(add-hook 'biblio-init-hook #'biblio-dblp-backend)
(autoload 'biblio-dblp-lookup "biblio-dblp" "\
Start a DBLP search for QUERY, prompting if needed.
\(fn &optional QUERY)" t nil)
(defalias 'dblp-lookup 'biblio-dblp-lookup)
;;;***
;;;### (autoloads nil "biblio-dissemin" "biblio-dissemin.el" (23017
;;;;;; 2297 872757 184000))
;;; Generated autoloads from biblio-dissemin.el
(autoload 'biblio-dissemin-lookup "biblio-dissemin" "\
Retrieve a record by DOI from Dissemin, and display it.
Interactively, or if CLEANUP is non-nil, pass DOI through
`biblio-cleanup-doi'.
\(fn DOI &optional CLEANUP)" t nil)
(defalias 'dissemin-lookup 'biblio-dissemin-lookup)
(autoload 'biblio-dissemin--register-action "biblio-dissemin" "\
Add Dissemin to list of `biblio-selection-mode' actions.
\(fn)" nil nil)
(add-hook 'biblio-selection-mode-hook #'biblio-dissemin--register-action)
;;;***
;;;### (autoloads nil "biblio-doi" "biblio-doi.el" (23017 2297 822757
;;;;;; 113000))
;;; Generated autoloads from biblio-doi.el
(autoload 'doi-insert-bibtex "biblio-doi" "\
Insert BibTeX entry matching DOI.
\(fn DOI)" t nil)
;;;***
;;;### (autoloads nil "biblio-download" "biblio-download.el" (23017
;;;;;; 2297 852757 159000))
;;; Generated autoloads from biblio-download.el
(autoload 'biblio-download--register-action "biblio-download" "\
Add download to list of `biblio-selection-mode' actions.
\(fn)" nil nil)
(add-hook 'biblio-selection-mode-hook #'biblio-download--register-action)
;;;***
;;;### (autoloads nil "biblio-hal" "biblio-hal.el" (23017 2297 822757
;;;;;; 113000))
;;; Generated autoloads from biblio-hal.el
(autoload 'biblio-hal-backend "biblio-hal" "\
A HAL backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'.
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
(add-hook 'biblio-init-hook #'biblio-hal-backend)
(autoload 'biblio-hal-lookup "biblio-hal" "\
Start a HAL search for QUERY, prompting if needed.
\(fn &optional QUERY)" t nil)
(defalias 'hal-lookup 'biblio-hal-lookup)
;;;***
;;;### (autoloads nil nil ("biblio-pkg.el" "biblio.el") (23017 2297
;;;;;; 862757 177000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; biblio-autoloads.el ends here

View File

@@ -1,99 +0,0 @@
;;; biblio-crossref.el --- Lookup and import bibliographic entries from CrossRef -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Lookup and download bibliographic records from CrossRef (a very nicely
;; curated metadata engine) using `crossref-lookup'.
;;
;; This package uses `biblio-selection-mode', and plugs into the more general
;; `biblio' package (which see for more documentation).
;;; Code:
(require 'biblio-core)
(require 'biblio-doi)
(defun biblio-crossref--forward-bibtex (metadata forward-to)
"Forward BibTeX for CrossRef entry METADATA to FORWARD-TO."
(biblio-doi-forward-bibtex (biblio-alist-get 'doi metadata) forward-to))
(defun biblio-crossref--format-affiliation (affiliation)
"Format AFFILIATION for CrossRef search results."
(mapconcat (apply-partially #'biblio-alist-get 'name) affiliation ", "))
(defun biblio-crossref--format-author (author)
"Format AUTHOR for CrossRef search results."
(let-alist author
(biblio-join " "
.given .family (biblio-parenthesize (biblio-crossref--format-affiliation .affiliation)))))
(defun biblio-crossref--extract-interesting-fields (item)
"Prepare a CrossRef search result ITEM for display."
(let-alist item
(list (cons 'doi .DOI)
(cons 'title (biblio-join " "
(biblio-join-1 ", " .title)
(biblio-parenthesize (biblio-join-1 ", " .subtitle))))
(cons 'authors (seq-map #'biblio-crossref--format-author .author))
(cons 'publisher .publisher)
(cons 'container .container-title)
(cons 'references (seq-concatenate 'list (list .DOI) .isbn))
(cons 'type .type)
(cons 'url .URL))))
(defun biblio-crossref--parse-search-results ()
"Extract search results from CrossRef response."
(biblio-decode-url-buffer 'utf-8)
(let-alist (json-read)
(unless (string= .status "ok")
(display-warning 'biblio-crossref "CrossRef query failed"))
(seq-map #'biblio-crossref--extract-interesting-fields .message.items)))
(defun biblio-crossref--url (query)
"Create a CrossRef url to look up QUERY."
(format "http://api.crossref.org/works?query=%s" (url-encode-url query)))
;;;###autoload
(defun biblio-crossref-backend (command &optional arg &rest more)
"A CrossRef backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'."
(pcase command
(`name "CrossRef")
(`prompt "CrossRef query: ")
(`url (biblio-crossref--url arg))
(`parse-buffer (biblio-crossref--parse-search-results))
(`forward-bibtex (biblio-crossref--forward-bibtex arg (car more)))
(`register (add-to-list 'biblio-backends #'biblio-crossref-backend))))
;;;###autoload
(add-hook 'biblio-init-hook #'biblio-crossref-backend)
;;;###autoload
(defun biblio-crossref-lookup (&optional query)
"Start a CrossRef search for QUERY, prompting if needed."
(interactive)
(biblio-lookup #'biblio-crossref-backend query))
;;;###autoload
(defalias 'crossref-lookup 'biblio-crossref-lookup)
(provide 'biblio-crossref)
;;; biblio-crossref.el ends here

View File

@@ -1,95 +0,0 @@
;;; biblio-dblp.el --- Lookup and import bibliographic entries from DBLP -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Lookup and download bibliographic records from DBLP (a great source of
;; references for Computer Science papers) using `dblp-lookup'.
;;
;; This package uses `biblio-selection-mode', and plugs into the more general
;; `biblio' package (which see for more documentation).
;;; Code:
(require 'biblio-core)
(defun biblio-dblp--forward-bibtex (metadata forward-to)
"Forward BibTeX for DBLP entry METADATA to FORWARD-TO."
(let* ((source-url (biblio-alist-get 'url metadata))
(url (replace-regexp-in-string "/rec/" "/rec/bib2/" source-url t t)))
(biblio-url-retrieve url (biblio-generic-url-callback
(lambda () ;; No allowed errors, so no arguments
"Parse DBLP BibTeX results."
(funcall forward-to
(biblio-format-bibtex
(biblio-response-as-utf-8))))))))
(defun biblio-dblp--extract-interesting-fields (item)
"Prepare a DBLP search result ITEM for display."
(let-alist (biblio-alist-get 'info item)
(list (cons 'title (cadr .title))
(cons 'authors (seq-map #'cl-caddr (cdr .authors)))
(cons 'container (cadr .venue))
(cons 'references nil)
(cons 'type (cadr .type))
(cons 'url (cadr .url)))))
(defun biblio-dblp--hitp (item)
"Check if ITEM is a DBLP hit."
(eq (car-safe item) 'hit))
(defun biblio-dblp--parse-search-results ()
"Extract search results from DBLP response."
(biblio-decode-url-buffer 'utf-8)
(let-alist (car (xml-parse-region (point-min) (point-max)))
(unless (string= (cadr .status) "OK")
(display-warning 'biblio-dblp "DBLP query failed"))
(seq-map #'biblio-dblp--extract-interesting-fields (seq-filter #'biblio-dblp--hitp .hits))))
(defun biblio-dblp--url (query)
"Create a DBLP url to look up QUERY."
(format "http://dblp.uni-trier.de/search/publ/api?q=%s&format=xml" (url-encode-url query)))
;;;###autoload
(defun biblio-dblp-backend (command &optional arg &rest more)
"A DBLP backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'."
(pcase command
(`name "DBLP")
(`prompt "DBLP query: ")
(`url (biblio-dblp--url arg))
(`parse-buffer (biblio-dblp--parse-search-results))
(`forward-bibtex (biblio-dblp--forward-bibtex arg (car more)))
(`register (add-to-list 'biblio-backends #'biblio-dblp-backend))))
;;;###autoload
(add-hook 'biblio-init-hook #'biblio-dblp-backend)
;;;###autoload
(defun biblio-dblp-lookup (&optional query)
"Start a DBLP search for QUERY, prompting if needed."
(interactive)
(biblio-lookup #'biblio-dblp-backend query))
;;;###autoload
(defalias 'dblp-lookup 'biblio-dblp-lookup)
(provide 'biblio-dblp)
;;; biblio-dblp.el ends here

View File

@@ -1,157 +0,0 @@
;;; biblio-dissemin.el --- Lookup bibliographic information and open access records from Dissemin -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Lookup publication records on Dissemin by DOI using `dissemin-lookup'.
;;
;; This package also plugs into `biblio-selection-mode' by adding an entry to
;; the extended actions menu (`x') to quickly locate the Dissemin record of
;; e.g. a CrossRef entry.
;;; Code:
(require 'biblio-core)
(defun biblio-dissemin--format-author (author)
"Format a Dissemin AUTHOR entry."
(let-alist author
(format "%s %s" .name.first .name.last)))
(defun biblio-dissemin--insert-button (url prefix)
"Insert a button pointing to URL, prefixed by PREFIX."
(unless (seq-empty-p url)
(insert "\n" prefix)
(insert (biblio-make-url-button url))))
(defun biblio-dissemin--insert-record (record)
"Insert a Dissemin RECORD entry into the current buffer."
(let-alist record
(insert "\n\n")
(biblio-with-fontification 'font-lock-preprocessor-face
(biblio-insert-with-prefix ">> " .identifier))
(biblio-dissemin--insert-button .pdf_url " ")
(unless (string= .pdf_url .splash_url)
(biblio-dissemin--insert-button .splash_url " "))
(unless (seq-empty-p .abstract)
(insert "\n")
;; (biblio-with-fontification 'font-lock-doc-face
(biblio-insert-with-prefix " " .abstract))))
(defun biblio-dissemin--translate-classification (classification)
"Translate Dissemin's CLASSIFICATION for display."
(pcase classification
(`"OA" "Available from the publisher")
(`"OK" "Some versions may be shared by the author")
(`"UNK" "Sharing policy is unclear")
(`"CLOSED" "Subject to a restrictive sharing policy")
(_ classification)))
(defun biblio-dissemin--suggest-upload (doi)
"Insert a link to Dissemin's upload page for DOI."
(insert "\n\nDid you write this paper? ")
(biblio-with-fontification '(:weight bold)
(insert
(biblio-make-url-button (format "http://dissem.in/%s" doi) "upload it")))
(insert "!\n"))
(defun biblio-dissemin--pretty-print (paper doi)
"Pretty-print a Dissemin PAPER entry (with DOI) to current buffer."
(let-alist paper
(biblio-insert-result
(list (cons 'title .title)
(cons 'authors (seq-map #'biblio-dissemin--format-author .authors))
(cons 'open-access-status
(biblio-dissemin--translate-classification .classification)))
t)
(biblio-dissemin--insert-button .pdf_url " ")
(if (seq-empty-p .records)
(progn (insert "\n\n(no records)")
(when (member .classification '("OA" "OK"))
(biblio-dissemin--suggest-upload doi)))
(seq-do #'biblio-dissemin--insert-record .records))
(goto-char (point-min))))
(defun biblio-dissemin--print-results (paper doi)
"Create a buffer for Dissemin, and print PAPER (with DOI) into it."
(with-current-buffer (biblio-dissemin--make-buffer)
(let ((inhibit-read-only t))
(erase-buffer)
(help-mode)
(visual-line-mode)
(biblio-dissemin--pretty-print paper doi))
(setq buffer-read-only t)
(pop-to-buffer (current-buffer))))
(defun biblio-dissemin--make-buffer ()
"Create a buffer to display Dissemin results in."
(get-buffer-create "*Dissemin search results*"))
(defun biblio-dissemin--parse-buffer ()
"Extract search results from DBLP response."
(biblio-decode-url-buffer 'utf-8)
(let-alist (json-read)
(unless (string= .status "ok")
(display-warning 'biblio-dissemin "Dissemin query failed"))
.paper))
(defun biblio-dissemin--url (doi)
"Create a DBLP url to look up DOI."
(format "http://dissem.in/api/%s" (url-encode-url doi)))
(defun biblio-dissemin--callback (doi)
"Generate a callback to parse Dissemin results for DOI."
(lambda () ;; no allowed errors, so no arguments
(biblio-dissemin--print-results (biblio-dissemin--parse-buffer) doi)))
;;;###autoload
(defun biblio-dissemin-lookup (doi &optional cleanup)
"Retrieve a record by DOI from Dissemin, and display it.
Interactively, or if CLEANUP is non-nil, pass DOI through
`biblio-cleanup-doi'."
(interactive "MDOI: \nd")
(when cleanup
(setq doi (biblio-cleanup-doi doi)))
(let ((buf (biblio-dissemin--make-buffer)))
(biblio-url-retrieve (biblio-dissemin--url doi)
(biblio-generic-url-callback (biblio-dissemin--callback doi)))
buf))
;;;###autoload
(defalias 'dissemin-lookup 'biblio-dissemin-lookup)
(defun biblio-dissemin--lookup-record (record)
"Retrieve a RECORD from Dissemin, and display it.
RECORD is a formatted record as expected by `biblio-insert-result'."
(let-alist record
(if .doi (dissemin-lookup .doi)
(user-error "Dissemin needs a DOI, but this record does not contain one"))))
;;;###autoload
(defun biblio-dissemin--register-action ()
"Add Dissemin to list of `biblio-selection-mode' actions."
(add-to-list 'biblio-selection-mode-actions-alist
'("Dissemin (find open access copies of this article)" . biblio-dissemin--lookup-record)))
;;;###autoload
(add-hook 'biblio-selection-mode-hook #'biblio-dissemin--register-action)
(provide 'biblio-dissemin)
;;; biblio-dissemin.el ends here

View File

@@ -1,123 +0,0 @@
;;; biblio-doi.el --- Retrieve BibTeX entries by DOI -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Retrieve and insert BibTeX records by DOI using `doi-insert-bibtex'.
;; Information is retrieved from DOI issuing sites of each DOI using the
;; “application/x-bibtex” and “text/bibliography” request types, falling back to
;; CrossCite if unavailable.
;;
;; This package integrates with `biblio-selection-mode', and is part of the more
;; general `biblio' package (which see for more documentation).
(require 'biblio-core)
;;; Code:
(defun biblio-doi--dx-url (doi)
"Create a doi.org url for DOI."
(format "http://doi.org/%s" doi))
(defun biblio-doi--crosscite-url (doi)
"Create a crosscite URL to use as a fallback for DOI.
Not all content providers provide BibTeX formatted entries, so
instead of failing reroute the request through crosscite, which
requests a generic format and crates the BibTeX on its own."
(format "http://crosscite.org/citeproc/format?doi=%s&style=bibtex&lang=en-US" doi))
(defconst biblio-doi--dx-mime-accept
;; “Accept:” header; Zenodo recognize x-bibtex but not text/bibliography
"text/bibliography;style=bibtex, application/x-bibtex")
(defun biblio-doi--set-mime-accept ()
"Set `url-mime-accept-string' before contacting the DOI server."
;; Ugly: let-binding or buffer-locally setting `url-mime-accept-string' does
;; not work, because `url-http-create-request' can be called from a
;; sentinel, or from an entirely new buffer (after a redirection).
(setq url-mime-accept-string biblio-doi--dx-mime-accept))
(defun biblio-doi--restore-mime-accept ()
"Restore `url-mime-accept-string'."
(kill-local-variable 'url-mime-accept-string)
(setq-default url-mime-accept-string nil))
(defun biblio-doi--insert (bibtex buffer)
"Insert formatted BIBTEX into BUFFER."
(with-current-buffer buffer
(insert bibtex "\n\n")))
(defun biblio-doi--generic-url-callback-1 (errors forward-to)
"Helper function for `biblio-doi--generic-url-callback'.
ERRORS, FORWARD-TO: see there."
(funcall forward-to
(unless errors
(biblio-format-bibtex (biblio-response-as-utf-8)))))
(defun biblio-doi--generic-url-callback (cleanup-fn forward-to)
"Make an URL-ready callback.
Call CLEANUP-FN in any case, and FORWARD-TO with BibTeX source
or nil depending on whether an error occured. If error 406
occurs, forward nil; otherwise, signal the error. This is
essentially a thin wrapper around `biblio-generic-url-callback'."
(biblio-generic-url-callback
(lambda (&optional errors)
"Handle response from BibTeX server."
(biblio-doi--generic-url-callback-1 errors forward-to))
cleanup-fn '(http . 406)))
(defun biblio-doi--crosscite-callback (forward-to)
"Generate a handler for response of CrossCite server.
FORWARD-TO is the callback to call with the results of the search."
(biblio-doi--generic-url-callback #'ignore forward-to))
(defun biblio-doi--forward-bibtex-crosscite (doi forward-to)
"Forward BibTeX entry for DOI from CrossCite to FORWARD-TO."
(biblio-url-retrieve (biblio-doi--crosscite-url doi) (biblio-doi--crosscite-callback forward-to)))
(defun biblio-doi--dx-callback (forward-to)
"Generate a handler for response of DX server.
FORWARD-TO is the callback to call with the results of the search."
(biblio-doi--generic-url-callback #'biblio-doi--restore-mime-accept forward-to))
(defun biblio-doi--forward-bibtex-dx (doi forward-to)
"Forward BibTeX entry for DOI from doi.org to FORWARD-TO."
(biblio-doi--set-mime-accept)
(biblio-url-retrieve (biblio-doi--dx-url doi) (biblio-doi--dx-callback forward-to)))
(defun biblio-doi-forward-bibtex (doi forward-to)
"Pass BibTeX entry for DOI to FORWARD-TO."
(biblio-doi--forward-bibtex-dx
doi (lambda (result)
(if result (funcall forward-to result)
(biblio-doi--forward-bibtex-crosscite doi forward-to)))))
;;;###autoload
(defun doi-insert-bibtex (doi)
"Insert BibTeX entry matching DOI."
(interactive "MDOI: ")
(let ((target-buffer (current-buffer)))
(biblio-doi-forward-bibtex
(biblio-cleanup-doi doi)
(lambda (result) (biblio-doi--insert result target-buffer)))))
(provide 'biblio-doi)
;;; biblio-doi.el ends here

View File

@@ -1,58 +0,0 @@
;;; biblio-download.el --- Lookup bibliographic information and open access records from Dissemin -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Download scientific papers directly from Emacs.
;;
;; This package plugs into `biblio-selection-mode' by adding an entry to the
;; extended actions menu (`x').
;;; Code:
(require 'biblio-core)
(defcustom biblio-download-directory nil
"Where to put downloaded papers."
:group 'biblio
:type 'directory)
(defun biblio-download--action (record)
"Retrieve a RECORD from Dissemin, and display it.
RECORD is a formatted record as expected by `biblio-insert-result'."
(let-alist record
(if .direct-url
(let* ((fname (concat .identifier ".pdf"))
(target (read-file-name "Save as (see also biblio-download-directory): "
biblio-download-directory fname nil fname)))
(url-copy-file .direct-url (expand-file-name target biblio-download-directory)))
(user-error "This record does not contain a direct URL (try arXiv or HAL)"))))
;;;###autoload
(defun biblio-download--register-action ()
"Add download to list of `biblio-selection-mode' actions."
(add-to-list 'biblio-selection-mode-actions-alist
'("Download this article" . biblio-download--action)))
;;;###autoload
(add-hook 'biblio-selection-mode-hook #'biblio-download--register-action)
(provide 'biblio-download)
;;; biblio-download.el ends here

View File

@@ -1,105 +0,0 @@
;;; biblio-hal.el --- Lookup and import bibliographic entries from HAL (archives ouvertes) -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;;
;; Lookup and download bibliographic records from HAL using `hal-lookup'.
;;
;; This package uses `biblio-selection-mode', and plugs into the more general
;; `biblio' package (which see for more documentation).
;;; Code:
(require 'biblio-core)
(defun biblio-hal--forward-bibtex (metadata forward-to)
"Forward BibTeX for HAL entry METADATA to FORWARD-TO."
(funcall forward-to (biblio-alist-get 'bibtex metadata)))
;; (defun biblio-hal--format-author (author)
;; "Format AUTHOR for HAL search results."
;; (pcase author
;; (`(,author . ,affiliation)
;; (biblio-join " " author (biblio-parenthesize affiliation)))))
(defun biblio-hal--extract-interesting-fields (item)
"Prepare a HAL search result ITEM for display."
(let-alist item
(list (cons 'doi .doiId_s)
(cons 'bibtex .label_bibtex)
(cons 'title (biblio-join " "
(biblio-join-1 ", " .title_s)
(biblio-parenthesize
(biblio-join-1 ", " .subtitle_s))))
(cons 'authors .authFullName_s)
;; Too many institutions? (biblio-parenthesize (biblio-join-1 ", " .structName_s))
(cons 'publisher .journalPublisher_s)
(cons 'container .journalTitle_s)
(cons 'references (biblio-remove-empty
(list .doiId_s .halId_s .arxivId_s)))
(cons 'type .submitType_s)
(cons 'url .uri_s)
(cons 'direct-url (car (append .files_s nil))))))
(defun biblio-hal--parse-search-results ()
"Extract search results from HAL response."
(biblio-decode-url-buffer 'utf-8)
(let-alist (json-read)
(unless .response
(display-warning 'biblio-hal "HAL query failed"))
(seq-map #'biblio-hal--extract-interesting-fields .response.docs)))
(defun biblio-hal--url (query)
"Create a HAL url to look up QUERY."
(format "https://api.archives-ouvertes.fr/search/?q=%s&wt=%s&fl=%s"
(url-encode-url query) "json"
(biblio-join "," ;; Use * to show all fields
"arxivId_s" "halId_s" "doiId_s" ;; "journalIssn_s"
"title_s" "subtitle_s" "authFullName_s" "structName_s"
"journalPublisher_s" "submitType_s" ;; "abstract_s"
;; "journalTitle_s" "volume_s" "issue_s" "page_s" "writingDate_s"
"label_bibtex" "files_s" "uri_s")))
;;;###autoload
(defun biblio-hal-backend (command &optional arg &rest more)
"A HAL backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'."
(pcase command
(`name "HAL")
(`prompt "HAL (archives ouvertes) query: ")
(`url (biblio-hal--url arg))
(`parse-buffer (biblio-hal--parse-search-results))
(`forward-bibtex (biblio-hal--forward-bibtex arg (car more)))
(`register (add-to-list 'biblio-backends #'biblio-hal-backend))))
;;;###autoload
(add-hook 'biblio-init-hook #'biblio-hal-backend)
;;;###autoload
(defun biblio-hal-lookup (&optional query)
"Start a HAL search for QUERY, prompting if needed."
(interactive)
(biblio-lookup #'biblio-hal-backend query))
;;;###autoload
(defalias 'hal-lookup 'biblio-hal-lookup)
(provide 'biblio-hal)
;;; biblio-hal.el ends here

View File

@@ -1,6 +0,0 @@
(define-package "biblio" "20161014.1604" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org"
'((emacs "24.3")
(biblio-core "0.2")))
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -1,96 +0,0 @@
;;; biblio.el --- Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; Version: 0.2
;; Package-Requires: ((emacs "24.3") (biblio-core "0.2"))
;; Keywords: bib, tex, convenience, hypermedia
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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:
;; # biblio.el: An extensible Emacs package for browsing and fetching references
;;
;; biblio.el makes it easy to browse and gather bibliographic references and
;; publications from various sources, by keywords or by DOI. References are
;; automatically fetched from well-curated sources, and formatted as BibTeX.
;;
;; ## Supported sources:
;;
;; * CrossRef, an exhaustive academic search engine (recommended)
;; * arXiv, an archive of pre-prints in various scientific fields
;; * DBLP, a database of Computer Science publications
;; * HAL, a French repository of Open Access publications
;; * doi.org, a DOI resolver (to retrieve BibTeX records from DOIs)
;; * CrossCite, an alternative DOI resolver and BibTeX formatting service
;; * Dissemin, a database tracking the open access status of scholarly articles
;;
;; ## Usage
;;
;; Quick start: M-x biblio-lookup. Each source can also be accessed independently:
;;
;; * M-x crossref-lookup to query CrossRef
;; * M-x arxiv-lookup` to query arXiv
;; * `M-x dblp-lookup to query DBLP
;; * M-x doi-insert to insert a BibTeX record by DOI
;; * M-x dissemin-lookup to show information about the open access status of a
;; particular DOI
;;
;; Most of these commands work together: for example, crossref-lookup displays a
;; list of results in biblio-selection-mode. In that mode, use:
;;
;; * RET to visit the corresponding web page
;; * c or M-w to copy the BibTeX record of the current entry
;; * i or C-y to insert the BibTeX record of the current entry
;; * x to run an extended action, such as fetching a Dissemin record
;;
;; C and I do the same as c and i, but additionally close the search window.
;;
;; ## Examples
;;
;; * To insert a clean BibTeX entry for http://doi.org/10.1145/2676726.2677006
;; in the current buffer, use
;;
;; M-x crossref-lookup RET fiat deductive delaware RET i
;;
;; (the last i inserts the BibTeX record of the currently selected entry in
;; your buffer).
;;
;; * To find publications by computer scientist Leslie Lamport, use M-x
;; dblp-lookup RET author:Lamport RET (see more info about DBLP's syntax at
;; <http://dblp.uni-trier.de/search/>)
;;
;; * To check whether an article is freely available online, use x in the list
;; of results. For example M-x crossref-lookup RET Emacs stallman RET
;; followed by x Dissemin RET will help you find open access copies of
;; Stallman's paper on EMACS (spoiler: http://hdl.handle.net/1721.1/5736).
;;
;; See http://github.com/cpitclaudel/biblio.el for more information, including
;; documentation on extending this framework.
;;; Code:
(require 'biblio-core)
(require 'biblio-doi)
(require 'biblio-arxiv)
(require 'biblio-crossref)
(require 'biblio-dblp)
(require 'biblio-hal)
(require 'biblio-dissemin)
(require 'biblio-download)
(provide 'biblio)
;;; biblio.el ends here

View File

@@ -1,26 +0,0 @@
;;; biblio-core-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "biblio-core" "biblio-core.el" (23017 2296
;;;;;; 372754 984000))
;;; Generated autoloads from biblio-core.el
(autoload 'biblio-lookup "biblio-core" "\
Perform a search using BACKEND, and QUERY.
Prompt for any missing or nil arguments. BACKEND should be a
function obeying the interface described in the docstring of
`biblio-backends'. Returns the buffer in which results will be
inserted.
\(fn &optional BACKEND QUERY)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; biblio-core-autoloads.el ends here

View File

@@ -1,2 +0,0 @@
;;; -*- no-byte-compile: t -*-
(define-package "biblio-core" "20160901.1115" "A framework for looking up and displaying bibliographic entries" '((emacs "24.3") (let-alist "1.0.4") (seq "1.11") (dash "2.12.1")) :commit "a5a68fcf677f286f205f32dc7486f6c9f66aa6af" :url "http://github.com/cpitclaudel/biblio.el" :keywords '("bib" "tex" "convenience" "hypermedia"))

View File

@@ -1,862 +0,0 @@
;;; biblio-core.el --- A framework for looking up and displaying bibliographic entries -*- lexical-binding: t -*-
;; Copyright (C) 2016 Clément Pit-Claudel
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
;; Version: 0.2
;; Package-Version: 20160901.1115
;; Package-Requires: ((emacs "24.3") (let-alist "1.0.4") (seq "1.11") (dash "2.12.1"))
;; Keywords: bib, tex, convenience, hypermedia
;; URL: http://github.com/cpitclaudel/biblio.el
;; 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 framework for browsing bibliographic search results. This is the core
;; package; for user interfaces, see any of `biblio-crossref', `biblio-dblp', `biblio-doi',
;; `biblio-arxiv', `biblio-hal' and `biblio-dissemin', which are part of the `biblio' package.
;;; Code:
(require 'bibtex)
(require 'browse-url)
(require 'hl-line)
(require 'ido)
(require 'json)
(require 'url-queue)
(require 'dash)
(require 'let-alist)
(require 'seq)
(defvar-local biblio--target-buffer nil
"Buffer into which BibTeX entries should be inserted.
This variable is local to each search results buffer.")
(defvar-local biblio--search-terms nil
"Keywords that led to a page of bibliographic search results.")
(defvar-local biblio--backend nil
"Backend that produced a page of bibliographic search results.")
(defgroup biblio nil
"A browser for bibliographic information."
:group 'communication)
(defgroup biblio-core nil
"Core of the biblio package."
:group 'biblio)
(defgroup biblio-faces nil
"Faces of the biblio package."
:group 'biblio)
(defcustom biblio-synchronous nil
"Whether bibliographic queries should be synchronous."
:group 'biblio-core
:type 'boolean)
(defcustom biblio-authors-limit 10
"Maximum number of authors to display per paper."
:group 'biblio-core
:type 'integer)
;;; Compatibility
(defun biblio-alist-get (key alist)
"Copy of Emacs 25's `alist-get', minus default.
Get the value associated to KEY in ALIST, or nil."
(cdr (assq key alist)))
(defun biblio--plist-to-alist (plist)
"Copy of Emacs 25's `json--plist-to-alist'.
Return an alist of the property-value pairs in PLIST."
(let (res)
(while plist
(let ((prop (pop plist))
(val (pop plist)))
(push (cons prop val) res)))
(nreverse res)))
;;; Utilities
(defconst biblio--bibtex-entry-format
(list 'opts-or-alts 'numerical-fields 'page-dashes 'whitespace
'inherit-booktitle 'realign 'last-comma 'delimiters
'unify-case 'braces 'strings 'sort-fields)
"Format to use in `biblio-format-bibtex'.
See `bibtex-entry-format' for details; this list is all
transformations, except errors for missing fields.
Also see `biblio-cleanup-bibtex-function'.")
(defun biblio--cleanup-bibtex-1 (dialect autokey)
"Cleanup BibTeX entry starting at point.
DIALECT is `BibTeX' or `biblatex'. AUTOKEY: see `biblio-format-bibtex'."
(let ((bibtex-entry-format biblio--bibtex-entry-format)
(bibtex-align-at-equal-sign t)
(bibtex-autokey-edit-before-use nil)
(bibtex-autokey-year-title-separator ":"))
;; Use biblatex to allow for e.g. @Online
;; Use BibTeX to allow for e.g. @TechReport
(bibtex-set-dialect dialect t)
(bibtex-clean-entry autokey)))
(defun biblio--cleanup-bibtex (autokey)
"Default balue of `biblio-cleanup-bibtex-function'.
AUTOKEY: See biblio-format-bibtex."
(save-excursion
(when (search-forward "@data{" nil t)
(replace-match "@misc{")))
(ignore-errors ;; See https://github.com/crosscite/citeproc-doi-server/issues/12
(condition-case _
(biblio--cleanup-bibtex-1 'biblatex autokey)
(error (biblio--cleanup-bibtex-1 'BibTeX autokey)))))
(defcustom biblio-cleanup-bibtex-function
#'biblio--cleanup-bibtex
"Function to clean up BibTeX entries.
This function is called in a `bibtex-mode' buffer containing an
unprocessed, potentially invalid BibTeX (or BibLaTeX) entry, and
should clean it up in place. It should take a single argument,
AUTOKEY, indicating whether the entry needs a new key."
:group 'biblio
:type 'function)
(defun biblio-format-bibtex (bibtex &optional autokey)
"Format BIBTEX entry.
With non-nil AUTOKEY, automatically generate a key for BIBTEX."
(with-temp-buffer
(bibtex-mode)
(save-excursion
(insert (biblio-strip bibtex)))
(when (functionp biblio-cleanup-bibtex-function)
(funcall biblio-cleanup-bibtex-function autokey))
(if (fboundp 'font-lock-ensure) (font-lock-ensure)
(with-no-warnings (font-lock-fontify-buffer)))
(buffer-string)))
(defun biblio--beginning-of-response-body ()
"Move point to beginning of response body."
(goto-char (point-min))
(unless (re-search-forward "^\n" nil t)
(error "Invalid response from server: %S" (buffer-string))))
(defun biblio-response-as-utf-8 ()
"Extract body of response."
(set-buffer-multibyte t)
(decode-coding-region (point) (point-max) 'utf-8 t))
(defun biblio-decode-url-buffer (coding)
"Decode URL buffer with CODING."
(set-buffer-multibyte t) ;; URL buffer is unibyte
(decode-coding-region (point-min) (point-max) coding))
(defun biblio--event-error-code (event)
"Extract HTTP error code from EVENT, if any."
(pcase event
(`(:error . (error ,source ,details))
(cons source details))))
(eval-and-compile
(define-error 'biblio--url-error "URL retrieval error."))
(defun biblio--throw-on-unexpected-errors (errors allowed-errors)
"Throw an url-error for any error in ERRORS not in ALLOWED-ERRORS."
(dolist (err errors)
(cond ((eq (car err) 'url-queue-timeout)
(signal 'biblio--url-error 'timeout))
((not (member err allowed-errors))
(signal 'biblio--url-error err)))))
(defun biblio--extract-errors (events)
"Extract errors from EVENTS."
(delq nil (mapcar #'biblio--event-error-code (biblio--plist-to-alist events))))
(defun biblio-generic-url-callback (callback &optional cleanup-function &rest allowed-errors)
"Make an `url'-ready callback from CALLBACK.
CALLBACK is called with no arguments; the buffer containing the
server's response is current at the time of the call, and killed
after the call returns. Call CLEANUP-FUNCTION before checking
for errors. If the request returns one of the errors in
ALLOWED-ERRORS, CALLBACK is instead called with one argument, the
list of alowed errors that occured instead of a buffer. If the
request returns another error, an exception is raised."
(lambda (events)
(let ((target-buffer (current-buffer)))
(unwind-protect
(progn
(funcall (or cleanup-function #'ignore))
(condition-case err
(-if-let* ((errors (biblio--extract-errors events)))
(progn
(biblio--throw-on-unexpected-errors errors allowed-errors)
(funcall callback errors))
(biblio--beginning-of-response-body)
(delete-region (point-min) (point))
(funcall callback))
(error (message "Error while processing request: %S" err))))
(kill-buffer target-buffer)))))
(defun biblio-url-retrieve (url callback)
"Wrapper around `url-queue-retrieve'.
URL and CALLBACK; see `url-queue-retrieve'"
(message "Fetching %s" url)
(if biblio-synchronous
(with-current-buffer (url-retrieve-synchronously url)
(funcall callback nil))
(setq url-queue-timeout 1)
(url-queue-retrieve url callback)))
(defun biblio-strip (str)
"Remove spaces surrounding STR."
(when str
(->> str
(replace-regexp-in-string "[ \t\n\r]+\\'" "")
(replace-regexp-in-string "\\`[ \t\n\r]+" ""))))
(defun biblio-cleanup-doi (doi)
"Cleanup DOI string."
(biblio-strip (replace-regexp-in-string "https?://\\(dx\\.\\)?doi\\.org/" "" doi)))
(defun biblio-remove-empty (strs)
"Remove empty sequences from STRS."
(seq-remove #'seq-empty-p strs))
(defun biblio-join-1 (sep strs)
"Join non-empty elements of STRS with SEP."
(declare (indent 1))
(let ((strs (biblio-remove-empty strs)))
(mapconcat #'identity strs sep)))
(defun biblio-join (sep &rest strs)
"Join non-empty elements of STRS with SEP."
(declare (indent 1))
(biblio-join-1 sep strs))
(defmacro biblio--with-text-property (prop value &rest body)
"Set PROP to VALUE on text inserted by BODY."
(declare (indent 2)
(debug t))
(let ((beg-var (make-symbol "beg")))
`(let ((,beg-var (point)))
,@body
(put-text-property ,beg-var (point) ,prop ,value))))
(defmacro biblio-with-fontification (face &rest body)
"Apply FACE to text inserted by BODY."
(declare (indent 1)
(debug t))
(let ((beg-var (make-symbol "beg")))
`(let ((,beg-var (point)))
,@body
(font-lock-append-text-property ,beg-var (point) 'face ,face))))
;;; Help with major mode
(defsubst biblio--as-list (x)
"Make X a list, if it isn't."
(if (consp x) x (list x)))
(defun biblio--map-keymap (func map)
"Call `map-keymap' on FUNC and MAP, and collect the results."
(let ((out))
(map-keymap (lambda (&rest args) (push (apply func args) out)) map)
out))
(defun biblio--flatten-map (keymap &optional prefix)
"Flatten KEYMAP, prefixing its keys with PREFIX.
This should really be in Emacs core (in Elisp), instead of being
implemented in C (at least for sparse keymaps). Don't run this on
non-sparse keymaps."
(nreverse
(cond
((keymapp keymap)
(seq-map (lambda (key-value)
"Add PREFIX to key in KEY-VALUE."
(cons (append prefix (biblio--as-list (car key-value)))
(cdr key-value)))
(delq nil
(apply
#'seq-concatenate
'list (biblio--map-keymap
(lambda (k v)
"Return a list of bindings in V, prefixed by K."
(biblio--flatten-map v (biblio--as-list k)))
keymap)))))
;; This breaks if keymap is a symbol whose function cell is a keymap
((symbolp keymap)
(list (cons prefix keymap))))))
(defun biblio--group-alist (alist)
"Return a copy of ALIST whose keys are lists of keys, grouped by value.
That is, if two key map to `eq' values, they are grouped."
(let ((map (make-hash-table :test 'eq))
(new-alist nil))
(pcase-dolist (`(,key . ,value) alist)
(puthash value (cons key (gethash value map)) map))
(pcase-dolist (`(,_ . ,value) alist)
(-when-let* ((keys (gethash value map)))
(push (cons (nreverse keys) value) new-alist)
(puthash value nil map)))
(nreverse new-alist)))
(defun biblio--quote (str)
"Quote STR and call `substitute-command-keys' on it."
(if str (substitute-command-keys (concat "`" str "'")) ""))
(defun biblio--quote-keys (keys)
"Quote and concatenate keybindings in KEYS."
(mapconcat (lambda (keyseq)
(biblio--quote (ignore-errors (help-key-description keyseq nil))))
keys ", "))
(defun biblio--brief-docs (command)
"Return first line of documentation of COMMAND."
(let ((docs (or (ignore-errors (documentation command t)) "")))
(string-match "\\(.*\\)$" docs)
(match-string-no-properties 1 docs)))
(defun biblio--help-with-major-mode-1 (keyseqs-command)
"Print help on KEYSEQS-COMMAND to standard output."
;; (biblio-with-fontification 'font-lock-function-name-face
(insert (format "%s (%S)\n"
(biblio--quote-keys (car keyseqs-command))
(cdr keyseqs-command)))
(biblio-with-fontification 'font-lock-doc-face
(insert (format " %s\n\n" (biblio--brief-docs (cdr keyseqs-command))))))
(defun biblio--help-with-major-mode ()
"Display help with current major mode."
(let ((buf (format "*%S help*" major-mode)))
(with-help-window buf
(princ (format "Help with %s\n\n" (biblio--quote (symbol-name major-mode))))
(let ((bindings (nreverse
(biblio--group-alist
(biblio--flatten-map
(current-local-map))))))
(with-current-buffer buf
(seq-do #'biblio--help-with-major-mode-1 bindings))))
buf))
;;; Interaction
(defconst biblio--search-result-marker-regexp "^> "
"Indicator of a search result.")
(defun biblio--selection-move (move-fn search-fn)
"Move using MOVE-FN, then call SEARCH-FN and go to first match."
(let ((target (point)))
(save-excursion
(funcall move-fn)
(when (funcall search-fn biblio--search-result-marker-regexp nil t)
(setq target (match-end 0))))
(goto-char target)))
(defun biblio-get-url (metadata)
"Compute a url from METADATA.
Uses .url, and .doi as a fallback."
(let-alist metadata
(if .url .url
(when .doi
(concat "https://doi.org/" (url-encode-url .doi))))))
(defun biblio--selection-browse ()
"Open the web page of the current entry in a web browser."
(interactive)
(-if-let* ((url (biblio-get-url (biblio--selection-metadata-at-point))))
(browse-url url)
(user-error "This record does not contain a URL")))
(defun biblio--selection-browse-direct ()
"Open the full text of the current entry in a web browser."
(interactive)
(-if-let* ((url (biblio-alist-get 'direct-url (biblio--selection-metadata-at-point))))
(browse-url url)
(user-error "This record does not contain a direct URL (try arXiv or HAL)")))
(defun biblio--selection-next ()
"Move to next seach result."
(interactive)
(biblio--selection-move #'end-of-line #'re-search-forward))
(defun biblio--selection-first ()
"Move to first search result."
(goto-char (point-min))
(biblio--selection-move #'ignore #'re-search-forward))
(defun biblio--selection-previous ()
"Move to previous seach result."
(interactive)
(biblio--selection-move #'beginning-of-line #'re-search-backward))
(defun biblio--selection-copy-callback (bibtex entry)
"Add BIBTEX (from ENTRY) to kill ring."
(kill-new bibtex)
(message "Killed bibtex entry for %S."
(biblio--prepare-title (biblio-alist-get 'title entry))))
(defun biblio--selection-copy ()
"Copy BibTeX of current entry at point."
(interactive)
(biblio--selection-forward-bibtex #'biblio--selection-copy-callback))
(defun biblio--selection-copy-quit ()
"Copy BibTeX of current entry at point and close results."
(interactive)
(biblio--selection-forward-bibtex #'biblio--selection-copy-callback t))
(defun biblio--target-window ()
"Get the window of the source buffer."
(get-buffer-window biblio--target-buffer))
(defun biblio--selection-insert-callback (bibtex entry)
"Add BIBTEX (from ENTRY) to kill ring."
(let ((target-buffer biblio--target-buffer))
(with-selected-window (or (biblio--target-window) (selected-window))
(with-current-buffer target-buffer
(insert bibtex "\n\n"))))
(message "Inserted bibtex entry for %S."
(biblio--prepare-title (biblio-alist-get 'title entry))))
(defun biblio--selection-insert ()
"Insert BibTeX of current entry into source buffer."
(interactive)
(biblio--selection-forward-bibtex #'biblio--selection-insert-callback))
(defun biblio--selection-insert-quit ()
"Insert BibTeX of current entry into source buffer and close results."
(interactive)
(biblio--selection-forward-bibtex #'biblio--selection-insert-callback t))
(defun biblio--selection-metadata-at-point ()
"Return the metadata of the entry at point."
(or (get-text-property (point) 'biblio-metadata)
(user-error "No entry at point")))
(defun biblio--selection-forward-bibtex (forward-to &optional quit)
"Retrieve BibTeX for entry at point and pass it to FORWARD-TO.
If QUIT is set, also kill the results buffer."
(let* ((metadata (biblio--selection-metadata-at-point))
(results-buffer (current-buffer)))
(progn
(funcall (biblio-alist-get 'backend metadata)
'forward-bibtex metadata
(lambda (bibtex)
(with-current-buffer results-buffer
(funcall forward-to (biblio-format-bibtex bibtex) metadata))))
(when quit (quit-window)))))
(defun biblio--selection-change-buffer (buffer-name)
"Change buffer in which BibTeX results will be inserted.
BUFFER-NAME is the name of the new target buffer."
(interactive (list (read-buffer "Buffer to insert entries into: ")))
(let ((buffer (get-buffer buffer-name)))
(if (buffer-local-value 'buffer-read-only buffer)
(user-error "%s is read-only" (buffer-name buffer))
(setq biblio--target-buffer buffer))))
(defvar biblio-selection-mode-actions-alist nil
"An alist of extensions for `biblio-selection-mode'.
Each element should be in the for (LABEL . FUNCTION); FUNCTION
will be called with the metadata of the current item.")
(defun biblio--completing-read-function ()
"Return ido, unless user picked another completion package."
(if (eq completing-read-function #'completing-read-default)
#'ido-completing-read
completing-read-function))
(defun biblio-completing-read (prompt collection &optional predicate require-match
initial-input hist def inherit-input-method)
"Complete using `biblio-completing-read-function'.
PROMPT, COLLECTION, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT,
HIST, DEF, INHERIT-INPUT-METHOD: see `completing-read'."
(let ((completing-read-function (biblio--completing-read-function)))
(completing-read prompt collection predicate require-match
initial-input hist def inherit-input-method)))
(defun biblio-completing-read-alist (prompt collection &optional predicate require-match
initial-input hist def inherit-input-method)
"Same as `biblio-completing-read', when COLLECTION in an alist.
Complete with the `car's, and return the `cdr' of the result.
PROMPT, COLLECTION, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT,
HIST, DEF, INHERIT-INPUT-METHOD: see `completing-read'."
(let ((choices (mapcar #'car collection)))
(cdr (assoc (biblio-completing-read
prompt choices predicate require-match
initial-input hist def inherit-input-method)
collection))))
(defun biblio--read-selection-extended-action ()
"Read an action from `biblio-selection-mode-actions-alist'."
(biblio-completing-read-alist
"Action: " biblio-selection-mode-actions-alist nil t))
(defun biblio--selection-extended-action (action)
"Run an ACTION with metadata of current entry.
Interactively, query for ACTION from
`biblio-selection-mode-actions-alist'."
(interactive (list (biblio--read-selection-extended-action)))
(let* ((metadata (biblio--selection-metadata-at-point)))
(funcall action metadata)))
(defun biblio--selection-help ()
"Show help on local keymap."
(interactive)
(biblio--help-with-major-mode))
(defvar biblio-selection-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "<up>") #'biblio--selection-previous)
(define-key map (kbd "C-p") #'biblio--selection-previous)
(define-key map (kbd "<down>") #'biblio--selection-next)
(define-key map (kbd "C-n") #'biblio--selection-next)
(define-key map (kbd "RET") #'biblio--selection-browse)
(define-key map (kbd "<C-return>") #'biblio--selection-browse-direct)
(define-key map (kbd "C-RET") #'biblio--selection-browse-direct)
(define-key map (kbd "M-w") #'biblio--selection-copy)
(define-key map (kbd "c") #'biblio--selection-copy)
(define-key map (kbd "C-w") #'biblio--selection-copy-quit)
(define-key map (kbd "C") #'biblio--selection-copy-quit)
(define-key map (kbd "i") #'biblio--selection-insert)
(define-key map (kbd "C-y") #'biblio--selection-insert-quit)
(define-key map (kbd "I") #'biblio--selection-insert-quit)
(define-key map (kbd "b") #'biblio--selection-change-buffer)
(define-key map (kbd "x") #'biblio--selection-extended-action)
(define-key map (kbd "?") #'biblio--selection-help)
(define-key map (kbd "h") #'biblio--selection-help)
(define-key map (kbd "q") #'quit-window)
map)
"Keybindings for Bibliographic search results.")
(defconst biblio--selection-mode-name-base "Bibliographic search results")
(defun biblio--selection-mode-name ()
"Compute a modeline string for `biblio-selection-mode'."
(concat biblio--selection-mode-name-base
(if (bufferp biblio--target-buffer)
(format " (→ %s)"
(buffer-name biblio--target-buffer))
"")))
(define-derived-mode biblio-selection-mode fundamental-mode biblio--selection-mode-name-base
"Browse bibliographic search results.
\\{biblio-selection-mode-map}"
(hl-line-mode)
(visual-line-mode)
(setq-local truncate-lines nil)
(setq-local cursor-type nil)
(setq-local buffer-read-only t)
(setq-local mode-name '(:eval (biblio--selection-mode-name)))
(setq-local
header-line-format
`(:eval
(concat
(ignore-errors
(propertize " " 'display '(space :align-to 0) 'face 'fringe))
(substitute-command-keys
(biblio-join " "
"\\[biblio--selection-help]: Help"
"\\[biblio--selection-insert],\\[biblio--selection-insert-quit]: Insert BibTex"
"\\[biblio--selection-copy],\\[biblio--selection-copy-quit]: Copy BibTeX"
"\\[biblio--selection-extended-action]: Extended action"
"\\[biblio--selection-browse]: Open in browser"
"\\[biblio--selection-change-buffer]: Change buffer"))))))
;;; Printing search results
(defun biblio-parenthesize (str)
"Add parentheses to STR, if not empty."
(if (seq-empty-p str) ""
(concat "(" str ")")))
(defun biblio-insert-with-prefix (prefix &rest strs)
"Like INSERT with PREFIX and STRS, but set `wrap-prefix'.
That is, the inserted text gets a `wrap-prefix' made of enough
white space to align with the end of PREFIX."
(declare (indent 1))
(biblio--with-text-property 'wrap-prefix (make-string (length prefix) ?\s)
(apply #'insert prefix strs)))
(defface biblio-detail-header-face
'((t :slant normal))
"Face used for headers of details in `biblio-selection-mode'."
:group 'biblio-faces)
(defun biblio--insert-detail (prefix items newline)
"Insert PREFIX followed by ITEMS, if ITEMS has non-empty entries.
If ITEMS is a list or vector, join its entries with “, ”. If
NEWLINE is non-nil, add a newline before the main text."
(when (or (vectorp items) (listp items))
(setq items (biblio-join-1 ", " items)))
(unless (seq-empty-p items)
(when newline (insert "\n"))
(let ((fontified (propertize prefix 'face 'biblio-detail-header-face)))
(biblio-insert-with-prefix fontified items))))
(defun biblio--nonempty-string-p (str)
"Return STR if STR is non-empty."
(unless (seq-empty-p str)
str))
(defun biblio--cleanup-field (text)
"Cleanup TEXT for presentation to the user."
(when text (biblio-strip (replace-regexp-in-string "[ \r\n\t]+" " " text))))
(defun biblio--prepare-authors (authors)
"Cleanup and join list of AUTHORS."
(let* ((authors (biblio-remove-empty (seq-map #'biblio-strip authors)))
(num-authors (length authors)))
;; Only truncate when significantly above limit
(when (> num-authors (+ 2 biblio-authors-limit))
(let* ((last (nthcdr biblio-authors-limit authors)))
(setcar last (format "… (%d more)" (- num-authors biblio-authors-limit)))
(setcdr last nil)))
(if authors (biblio-join-1 ", " authors)
"(no authors)")))
(defun biblio--prepare-title (title)
"Cleanup TITLE for presentation to the user."
(or (biblio--nonempty-string-p (biblio--cleanup-field title))
"(no title)"))
(defun biblio--browse-url (button)
"Open web browser on page pointed to by BUTTON."
(browse-url (button-get button 'target)))
(defun biblio-make-url-button (url &optional label)
"Make a text button pointing to URL.
With non-nil LABEL, use that instead of URL to label the button."
(unless (seq-empty-p url)
(with-temp-buffer
(insert-text-button (or label url)
'target url
'follow-link t
'action #'biblio--browse-url)
(buffer-string))))
(defun biblio-insert-result (item &optional no-sep)
"Print a (prepared) bibliographic search result ITEM.
With NO-SEP, do not add space after the record.
This command expects ITEM to be a single alist, in the following format:
((title . \"Title of entry\")
(authors . (\"Author 1\" \"Author 2\" …))
(container . \"Where this was published (which journal, conference, …)\")
(type . \"Type of document (journal paper, proceedings, report, …)\")
(category . \"Category of this document (aka primary topic)\")
(publisher . \"Publisher of this document\")
(references . \"Identifier(s) of this document (DOI, DPLB id, Handle, …)\")
(open-access-status . \"Open access status of this document\")
(url . \"Relevant URL\")
(direct-url . \"Direct URL of paper (typically PDF)\"))
Each of `container', `type', `category', `publisher',
`references', and `open-access-status' may be a list; in that
case, entries of the list are displayed comma-separated. All
entries are optional.
`crossref--extract-interesting-fields' and `dblp--extract-interesting-fields'
provide examples of how to build such a result."
(biblio--with-text-property 'biblio-metadata item
(let-alist item
(biblio-with-fontification 'font-lock-function-name-face
(biblio-insert-with-prefix "> " (biblio--prepare-title .title)))
(insert "\n")
(biblio-with-fontification 'font-lock-doc-face
(biblio-insert-with-prefix " " (biblio--prepare-authors .authors)))
(biblio-with-fontification 'font-lock-comment-face
(biblio--insert-detail " In: " .container t)
(biblio--insert-detail " Type: " .type t)
(biblio--insert-detail " Category: " .category t)
(biblio--insert-detail " Publisher: " .publisher t)
(biblio--insert-detail " References: " .references t)
(biblio--insert-detail " Open Access: " .open-access-status t)
(biblio--insert-detail " URL: " (list (biblio-make-url-button .url)
(biblio-make-url-button .direct-url))
t))
(unless no-sep
(insert "\n\n")))))
(defface biblio-results-header-face
'((t :height 1.5 :weight bold :inherit font-lock-preprocessor-face))
"Face used for general search results header in `biblio-selection-mode'."
:group 'biblio-faces)
(defun biblio--search-results-header (&optional loading-p)
"Compute a header for the current `selection-mode' buffer.
With LOADING-P, mention that results are being loaded."
(format "%s search results for %s%s"
(funcall biblio--backend 'name)
(biblio--quote biblio--search-terms)
(if loading-p " (loading…)" "")))
(defun biblio--make-results-buffer (target-buffer search-terms backend)
"Set up the results buffer for TARGET-BUFFER, SEARCH-TERMS and BACKEND."
(with-current-buffer (get-buffer-create
(format "*%s search*" (funcall backend 'name)))
(let ((inhibit-read-only t))
(erase-buffer)
(biblio-selection-mode)
(setq biblio--target-buffer target-buffer)
(setq biblio--search-terms search-terms)
(setq biblio--backend backend)
(biblio--insert-header (biblio--search-results-header t))
(setq buffer-read-only t)
(current-buffer))))
(defun biblio--insert-header (header)
"Prettify and insert HEADER in current buffer."
(when header
(biblio--with-text-property 'line-spacing 0.5
(biblio--with-text-property 'line-height 1.75
(biblio-with-fontification 'biblio-results-header-face
(insert header "\n"))))))
(defun biblio-insert-results (items &optional header)
"Populate current buffer with ITEMS and HEADER, then display it."
(let ((inhibit-read-only t))
(erase-buffer)
(biblio--insert-header header)
(seq-do #'biblio-insert-result items))
(pop-to-buffer (current-buffer))
(biblio--selection-first)
(hl-line-highlight))
(defun biblio--tag-backend (backend items)
"Add (backend . BACKEND) to each alist in ITEMS."
(seq-map (lambda (i) (cons `(backend . ,backend) i)) items))
(defun biblio--callback (results-buffer backend)
"Generate a search results callback for RESULTS-BUFFER.
Results are parsed with (BACKEND 'parse-buffer)."
(biblio-generic-url-callback
(lambda () ;; no allowed errors, so no arguments
"Parse results of bibliographic search."
(let ((results (biblio--tag-backend backend (funcall backend 'parse-buffer))))
(with-current-buffer results-buffer
(biblio-insert-results results (biblio--search-results-header)))
(message "Tip: learn to browse results with `h'")))))
;;; Searching
(defvar biblio--search-history nil)
(defvar biblio-backends nil
"List of biblio backends.
This list is generally populated through `biblio-init-hook',
which is called by `biblio-collect-backends'.
Each backend is a function that take a variable number of
arguments. The first argument is a command; the rest are
arguments to this specific command. The command is one of the
following:
`name': (no arguments) The name of the backend, displayed when picking a
backend from a list.
`prompt': (no arguments) The string used when querying the user for a search
term to feed this backend.
`url': (one argument, QUERY) Create a URL to query the backend's API.
`parse-buffer': (no arguments) Parse the contents of the current
buffer and return a list of results. At the time of the call,
the current buffer contains the results of querying a url
returned by (THIS-BACKEND `url' QUERY). The format of individual
results is described in the docstring of `biblio-insert-result').
`forward-bibtex': (two arguments, METADATA and FORWARD-TO)
Produce a BibTeX record from METADATA (one of the elements of the
list produced by `parse-buffer') and call FORWARD-TO on it.
For examples of backends, see one of `biblio-crossref-backend',
`biblio-dblp-backend', `biblio-arxiv-backend', etc.
To register your backend automatically, you may want to add a
`register' command:
`register': Add the current backend to `biblio-backends'.
Something like (add-to-list \\='biblio-backends \\='THIS-BACKEND).
Then it's enough to add your backend to `biblio-init-hook':
;;;###autoload
\(add-hook \\='biblio-init-hook \\='YOUR-BACKEND-HERE).")
(defvar biblio-init-hook nil
"Hook run before every search.
Each function is called with one argument, `register'. This
makes it possible to register backends by adding them directly to
this hook, and making them react to `register' by adding
themselves to biblio-backends.")
(defun biblio-collect-backends ()
"Populate `biblio-backends' and return that."
(run-hook-with-args 'biblio-init-hook 'register)
biblio-backends)
(defun biblio--named-backends ()
"Collect an alist of (NAME . BACKEND)."
(seq-map (lambda (b) (cons (funcall b 'name) b)) (biblio-collect-backends)))
(defun biblio--read-backend ()
"Run `biblio-init-hook', then read a backend from `biblio-backend'."
(biblio-completing-read-alist "Backend: " (biblio--named-backends) nil t))
(defun biblio--read-query (backend)
"Interactively read a query.
Get prompt string from BACKEND."
(let* ((prompt (funcall backend 'prompt)))
(read-string prompt nil 'biblio--search-history)))
(defun biblio--lookup-1 (backend query)
"Just like `biblio-lookup' on BACKEND and QUERY, but never prompt."
(let ((results-buffer (biblio--make-results-buffer (current-buffer) query backend)))
(biblio-url-retrieve
(funcall backend 'url query)
(biblio--callback results-buffer backend))
results-buffer))
;;;###autoload
(defun biblio-lookup (&optional backend query)
"Perform a search using BACKEND, and QUERY.
Prompt for any missing or nil arguments. BACKEND should be a
function obeying the interface described in the docstring of
`biblio-backends'. Returns the buffer in which results will be
inserted."
(interactive)
(unless backend (setq backend (biblio--read-backend)))
(unless query (setq query (biblio--read-query backend)))
(biblio--lookup-1 backend query))
(defun biblio-kill-buffers ()
"Kill all `biblio-selection-mode' buffers."
(interactive)
(dolist (buf (buffer-list))
(when (and (buffer-live-p buf)
(eq (buffer-local-value 'major-mode buf)
'biblio-selection-mode))
(kill-buffer buf))))
;; Local Variables:
;; nameless-current-name: "biblio"
;; checkdoc-arguments-in-order-flag: nil
;; End:
(provide 'biblio-core)
;;; biblio-core.el ends here

View File

@@ -1,178 +0,0 @@
;;; cargo-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "cargo" "cargo.el" (0 0 0 0))
;;; Generated autoloads from cargo.el
(autoload 'cargo-minor-mode "cargo" "\
Cargo minor mode. Used to hold keybindings for cargo-mode.
\\{cargo-minor-mode-map}
\(fn &optional ARG)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "cargo" '("cargo-minor-mode")))
;;;***
;;;### (autoloads nil "cargo-process" "cargo-process.el" (0 0 0 0))
;;; Generated autoloads from cargo-process.el
(autoload 'cargo-process-bench "cargo-process" "\
Run the Cargo bench command.
With the prefix argument, modify the command's invocation.
Cargo: Run the benchmarks.
\(fn)" t nil)
(autoload 'cargo-process-build "cargo-process" "\
Run the Cargo build command.
With the prefix argument, modify the command's invocation.
Cargo: Compile the current project.
\(fn)" t nil)
(autoload 'cargo-process-clean "cargo-process" "\
Run the Cargo clean command.
With the prefix argument, modify the command's invocation.
Cargo: Remove the target directory.
\(fn)" t nil)
(autoload 'cargo-process-doc "cargo-process" "\
Run the Cargo doc command.
With the prefix argument, modify the command's invocation.
Cargo: Build this project's and its dependencies' documentation.
\(fn)" t nil)
(autoload 'cargo-process-doc-open "cargo-process" "\
Run the Cargo doc command with the --open switch.
With the prefix argument, modify the command's invocation.
Cargo: Open this project's documentation.
\(fn)" t nil)
(autoload 'cargo-process-new "cargo-process" "\
Run the Cargo new command.
With the prefix argument, modify the command's invocation.
NAME is the name of your application.
If BIN is t then create a binary application, otherwise a library.
Cargo: Create a new cargo project.
\(fn NAME &optional BIN)" t nil)
(autoload 'cargo-process-init "cargo-process" "\
Run the Cargo init command.
With the prefix argument, modify the command's invocation.
DIRECTORY is the directory you want to create a cargo project in.
If BIN is t then create a binary application, otherwise a library.
Cargo: Create a new cargo project in current directory.
\(fn DIRECTORY &optional BIN)" t nil)
(autoload 'cargo-process-run "cargo-process" "\
Run the Cargo run command.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute src/main.rs.
\(fn)" t nil)
(autoload 'cargo-process-run-bin "cargo-process" "\
Run the Cargo run command --bin <name>.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute a specific binary
\(fn COMMAND)" t nil)
(autoload 'cargo-process-run-example "cargo-process" "\
Run the Cargo run command --example <name>.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute with --example <name>.
\(fn COMMAND)" t nil)
(autoload 'cargo-process-search "cargo-process" "\
Run the Cargo search command.
With the prefix argument, modify the command's invocation.
SEARCH-TERM is used as the search term for the Cargo registry.
Cargo: Search registry for crates.
\(fn SEARCH-TERM)" t nil)
(autoload 'cargo-process-test "cargo-process" "\
Run the Cargo test command.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests.
\(fn)" t nil)
(autoload 'cargo-process-current-test "cargo-process" "\
Run the Cargo test command for the current test.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests.
\(fn)" t nil)
(autoload 'cargo-process-current-file-tests "cargo-process" "\
Run the Cargo test command for the current file.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests.
\(fn)" t nil)
(autoload 'cargo-process-update "cargo-process" "\
Run the Cargo update command.
With the prefix argument, modify the command's invocation.
Cargo: Update dependencies listed in Cargo.lock.
\(fn)" t nil)
(autoload 'cargo-process-fmt "cargo-process" "\
Run the Cargo fmt command.
With the prefix argument, modify the command's invocation.
Requires Cargo Fmt to be installed.
\(fn)" t nil)
(autoload 'cargo-process-check "cargo-process" "\
Run the Cargo check command.
With the prefix argument, modify the command's invocation.
Cargo: Check compile the current project.
Requires cargo-check to be installed.
\(fn)" t nil)
(autoload 'cargo-process-clippy "cargo-process" "\
Run the Cargo clippy command.
With the prefix argument, modify the command's invocation.
Cargo: Clippy compile the current project.
Requires Cargo clippy to be installed.
\(fn)" t nil)
(autoload 'cargo-process-repeat "cargo-process" "\
Run the last cargo-process command.
\(fn)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "cargo-process" '("cargo-process-" "set-rust-backtrace" "rustc-errno")))
;;;***
;;;### (autoloads nil nil ("cargo-pkg.el") (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; cargo-autoloads.el ends here

View File

@@ -1,9 +0,0 @@
(define-package "cargo" "20180521.408" "Emacs Minor Mode for Cargo, Rust's Package Manager."
'((emacs "24.3")
(rust-mode "0.2.0")
(markdown-mode "2.4"))
:keywords
'("tools"))
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -1,521 +0,0 @@
;;; cargo-process.el --- Cargo Process Major Mode -*-lexical-binding: t-*-
;; Copyright (C) 2015 Kevin W. van Rooijen
;; Author: Kevin W. van Rooijen <kevin.van.rooijen@attichacker.com>
;; Keywords: processes, tools
;; 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:
;; Cargo Process Major mode.
;; Used to run Cargo background processes.
;; Current supported Cargo functions:
;; * cargo-process-bench - Run the benchmarks.
;; * cargo-process-build - Compile the current project.
;; * cargo-process-clean - Remove the target directory.
;; * cargo-process-doc - Build this project's and its dependencies' documentation.
;; * cargo-process-doc-open - Open this project's documentation.
;; * cargo-process-new - Create a new cargo project.
;; * cargo-process-init - Create a new cargo project inside an existing directory.
;; * cargo-process-run - Build and execute src/main.rs.
;; * cargo-process-run-example - Build and execute with --example <name>.
;; * cargo-process-run-bin - Build and execute a specific binary.
;; * cargo-process-search - Search registry for crates.
;; * cargo-process-test - Run all unit tests.
;; * cargo-process-update - Update dependencies listed in Cargo.lock.
;; * cargo-process-repeat - Run the last cargo-process command.
;; * cargo-process-current-test - Run the current unit test.
;; * cargo-process-current-file-tests - Run the current file unit tests.
;; * cargo-process-fmt - Run the optional cargo command fmt.
;; * cargo-process-check - Run the optional cargo command check.
;; * cargo-process-clippy - Run the optional cargo command clippy.
;;
;;; Code:
(require 'compile)
(require 'button)
(require 'rust-mode)
(require 'markdown-mode)
(defgroup cargo-process nil
"Cargo Process group."
:prefix "cargo-process-"
:group 'cargo)
(defcustom cargo-process--custom-path-to-bin
(or (executable-find "cargo")
(expand-file-name "cargo" "~/.cargo/bin")
"/usr/local/bin/cargo")
"Custom path to the cargo executable"
:type 'file
:group 'cargo-process)
(defcustom cargo-process--rustc-cmd
(or (executable-find "rustc")
(expand-file-name "rustc" "~/.cargo/bin")
"/usr/local/bin/rustc")
"Custom path to the rustc executable"
:type 'file
:group 'cargo-process)
(defcustom cargo-process--enable-rust-backtrace nil
"Set RUST_BACKTRACE environment variable to 1 for tasks test and run"
:group 'cargo-process)
(defcustom cargo-process--command-flags ""
"Flags to be added to every cargo command when run."
:group 'cargo-process)
(defvar cargo-process-mode-map
(nconc (make-sparse-keymap) compilation-mode-map)
"Keymap for Cargo major mode.")
(defvar cargo-process-last-command nil "Command used last for repeating.")
(make-variable-buffer-local 'cargo-process-last-command)
(defvar cargo-process--command-bench "bench")
(defvar cargo-process--command-build "build")
(defvar cargo-process--command-clean "clean")
(defvar cargo-process--command-doc "doc")
(defvar cargo-process--command-doc-open "doc --open")
(defvar cargo-process--command-new "new")
(defvar cargo-process--command-init "init")
(defvar cargo-process--command-run "run")
(defvar cargo-process--command-run-bin "run --bin")
(defvar cargo-process--command-run-example "run --example")
(defvar cargo-process--command-search "search")
(defvar cargo-process--command-test "test")
(defvar cargo-process--command-current-test "test")
(defvar cargo-process--command-current-file-tests "test")
(defvar cargo-process--command-update "update")
(defvar cargo-process--command-fmt "fmt")
(defvar cargo-process--command-check "check")
(defvar cargo-process--command-clippy "clippy")
(defface cargo-process--ok-face
'((t (:foreground "#00ff00")))
"Ok face"
:group 'cargo-process)
(defface cargo-process--error-face
'((t (:foreground "#FF0000")))
"Error face"
:group 'cargo-process)
(defface cargo-process--warning-face
'((t (:foreground "#eeee00")))
"Warning face"
:group 'cargo-process)
(defface cargo-process--pointer-face
'((t (:foreground "#ff00ff")))
"Pointer face"
:group 'cargo-process)
(defface cargo-process--standard-face
'((t (:foreground "#ffa500")))
"Standard face"
:group 'cargo-process)
(defface cargo-process--errno-face
'((t :foreground "#7777ff"
:underline t))
"Error number face"
:group 'cargo-process)
(defconst cargo-process--rust-backtrace "RUST_BACKTRACE")
(defconst cargo-process-test-regexp "^[[:space:]]*fn[[:space:]]*"
"Regex to find Rust unit test function.")
(defconst cargo-process-test-mod-regexp "^[[:space:]]*mod[[:space:]]*\\w+[[:space:]]*{")
(defconst cargo-process-font-lock-keywords
'(("^error\\:?" . 'cargo-process--error-face)
("^warning\\:?" . 'cargo-process--warning-face)
("^\s*\\^\\~*\s*$" . 'cargo-process--pointer-face)
("^\s*Compiling.*" . 'cargo-process--standard-face)
("^\s*Running.*" . 'cargo-process--standard-face)
("^\s*Updating.*" . 'cargo-process--standard-face)
("test result: FAILED." . 'cargo-process--error-face)
("test result: ok." . 'cargo-process--ok-face)
("test\s.*\sFAILED" . 'cargo-process--error-face)
("test\s.*\sok" . 'cargo-process--ok-face))
"Minimal highlighting expressions for cargo-process mode.")
;; Bind `case-fold-search' to nil before using the regex.
(defconst cargo-process--errno-regex "\\bE[0-9]\\{4\\}\\b"
"A regular expression to match Rust error number.")
(define-button-type 'rustc-errno
'follow-link t
'face 'cargo-process--errno-face
'action #'cargo-process--explain-action)
(defun cargo-process--defun-at-point-p ()
(string-match cargo-process-test-regexp
(buffer-substring-no-properties (line-beginning-position)
(line-end-position))))
(defun cargo-process--project-root ()
"Find the root of the current Cargo project."
(let ((root (locate-dominating-file (or buffer-file-name default-directory) "Cargo.toml")))
(and root (file-truename root))))
(define-derived-mode cargo-process-mode compilation-mode "Cargo-Process."
"Major mode for the Cargo process buffer."
(use-local-map cargo-process-mode-map)
(setq major-mode 'cargo-process-mode)
(setq mode-name "Cargo-Process")
(setq-local truncate-lines t)
(run-hooks 'cargo-process-mode-hook)
(add-hook 'compilation-filter-hook #'cargo-process--add-errno-buttons)
(font-lock-add-keywords nil cargo-process-font-lock-keywords))
(defun cargo-process--finished-sentinel (process event)
"Execute after PROCESS return and EVENT is 'finished'."
(compilation-sentinel process event)
(when (equal event "finished\n")
(message "Cargo Process finished.")))
(defun cargo-process--activate-mode (buffer)
"Execute commands BUFFER at process start."
(with-current-buffer buffer
(funcall 'cargo-process-mode)
(setq-local window-point-insertion-type t)))
(defun set-rust-backtrace (command)
"Set RUST_BACKTRACE variable depending on the COMMAND used.
Always set to nil if cargo-process--enable-rust-backtrace is nil"
(when cargo-process--enable-rust-backtrace
(if (string-match "cargo \\(test\\|run\\)" command)
(setenv cargo-process--rust-backtrace "1")
(setenv cargo-process--rust-backtrace nil))))
(defun cargo-process--workspace-root ()
"Find the worksapce root using `cargo metadata`."
(let* ((metadata-text (shell-command-to-string
(concat cargo-process--custom-path-to-bin " metadata --format-version 1 --no-deps")))
(metadata-json (json-read-from-string metadata-text))
(workspace-root (alist-get 'workspace_root metadata-json)))
workspace-root))
(defun cargo-process--start (name command &optional last-cmd)
"Start the Cargo process NAME with the cargo command COMMAND."
(set-rust-backtrace command)
(let* ((buffer (concat "*Cargo " name "*"))
(project-root (cargo-process--project-root))
(cmd
(or last-cmd
(cargo-process--maybe-read-command
(mapconcat #'identity (list cargo-process--custom-path-to-bin
command
"--manifest-path" (concat project-root "Cargo.toml")
cargo-process--command-flags)
" "))))
(default-directory (or project-root default-directory)))
(save-some-buffers (not compilation-ask-about-save)
(lambda ()
(and project-root
buffer-file-name
(string-prefix-p project-root (file-truename buffer-file-name)))))
(setq cargo-process-last-command (list name command cmd))
(let ((default-directory (cargo-process--workspace-root)))
(compilation-start cmd 'cargo-process-mode (lambda(_) buffer)))
(set-process-sentinel (get-buffer-process buffer) 'cargo-process--finished-sentinel)))
(defun cargo-process--explain-action (button)
"Action called when the user activates Rust errno BUTTON."
(cargo-process--explain-help (button-label button)))
(defun cargo-process--explain-help (errno)
"Display a detailed explaination of ERRNO in a markdown buffer."
(pop-to-buffer
(let ((current-window (selected-window))
(inhibit-message t))
(with-current-buffer (get-buffer-create "*rust errno*")
(let ((buffer-read-only nil))
(erase-buffer)
(insert (shell-command-to-string
(concat cargo-process--rustc-cmd " --explain=" errno))))
(markdown-view-mode)
(setq-local markdown-fontify-code-blocks-natively t)
(setq-local markdown-fontify-code-block-default-mode 'rust-mode)
(setq-local kill-buffer-hook (lambda ()
(when (window-live-p current-window)
(select-window current-window))))
(setq
header-line-format
(concat (propertize " " 'display
`(space :align-to (- right-fringe ,(1+ (length errno)))))
(propertize errno 'face 'error)))
(markdown-toggle-markup-hiding 1)
(goto-char 1)
(current-buffer)))))
(defun cargo-process--add-errno-buttons ()
"Turn error numbers into clickable links in Cargo process output.
Meant to be run as a `compilation-filter-hook'."
(save-excursion
(let ((start compilation-filter-start)
(end (point))
(case-fold-search nil))
(goto-char start)
(while (re-search-forward cargo-process--errno-regex end t)
(make-button (match-beginning 0)
(match-end 0)
:type 'rustc-errno)))))
(defun cargo-process--get-current-test ()
"Return the current test."
(save-excursion
(unless (cargo-process--defun-at-point-p)
(rust-beginning-of-defun))
(beginning-of-line)
(search-forward "fn ")
(let* ((line (buffer-substring-no-properties (point)
(line-end-position)))
(lines (split-string line "("))
(function-name (car lines)))
function-name)))
(defun cargo-process--get-current-mod ()
"Return the current mod."
(save-excursion
(when (search-backward-regexp cargo-process-test-mod-regexp nil t)
(let* ((line (buffer-substring-no-properties (line-beginning-position)
(line-end-position)))
(line (string-trim-left line))
(lines (split-string line " "))
(mod (cadr lines)))
mod))))
(defun cargo-process--get-current-test-fullname ()
(if (cargo-process--get-current-mod)
(concat (cargo-process--get-current-mod)
"::"
(cargo-process--get-current-test))
(cargo-process--get-current-test)))
(defun cargo-process--maybe-read-command (default)
"Prompt to modify the DEFAULT command when the prefix argument is present.
Without the prefix argument, return DEFAULT immediately."
(if current-prefix-arg
(read-shell-command "Cargo command: " default)
default))
;;;###autoload
(defun cargo-process-bench ()
"Run the Cargo bench command.
With the prefix argument, modify the command's invocation.
Cargo: Run the benchmarks."
(interactive)
(cargo-process--start "Bench" cargo-process--command-bench))
;;;###autoload
(defun cargo-process-build ()
"Run the Cargo build command.
With the prefix argument, modify the command's invocation.
Cargo: Compile the current project."
(interactive)
(cargo-process--start "Build" cargo-process--command-build))
;;;###autoload
(defun cargo-process-clean ()
"Run the Cargo clean command.
With the prefix argument, modify the command's invocation.
Cargo: Remove the target directory."
(interactive)
(cargo-process--start "Clean" cargo-process--command-clean))
;;;###autoload
(defun cargo-process-doc ()
"Run the Cargo doc command.
With the prefix argument, modify the command's invocation.
Cargo: Build this project's and its dependencies' documentation."
(interactive)
(cargo-process--start "Doc" cargo-process--command-doc))
;;;###autoload
(defun cargo-process-doc-open ()
"Run the Cargo doc command with the --open switch.
With the prefix argument, modify the command's invocation.
Cargo: Open this project's documentation."
(interactive)
(cargo-process--start "Doc" cargo-process--command-doc-open))
;;;###autoload
(defun cargo-process-new (name &optional bin)
"Run the Cargo new command.
With the prefix argument, modify the command's invocation.
NAME is the name of your application.
If BIN is t then create a binary application, otherwise a library.
Cargo: Create a new cargo project."
(interactive "sProject name: ")
(let ((bin (when (or bin
(y-or-n-p "Create Bin Project? "))
" --bin")))
(cargo-process--start "New" (concat cargo-process--command-new
" "
name
bin))))
;;;###autoload
(defun cargo-process-init (directory &optional bin)
"Run the Cargo init command.
With the prefix argument, modify the command's invocation.
DIRECTORY is the directory you want to create a cargo project in.
If BIN is t then create a binary application, otherwise a library.
Cargo: Create a new cargo project in current directory."
(interactive
(list (read-directory-name "Directory: " nil default-directory t)))
(let ((bin (when (or bin (y-or-n-p "Create Bin Project? ")) " --bin")))
(cargo-process--start "Init" (concat cargo-process--command-init
" "
directory
bin))))
;;;###autoload
(defun cargo-process-run ()
"Run the Cargo run command.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute src/main.rs."
(interactive)
(cargo-process--start "Run" cargo-process--command-run))
;;;###autoload
(defun cargo-process-run-bin (command)
"Run the Cargo run command --bin <name>.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute a specific binary"
(interactive "sBinary name: ")
(cargo-process--start (concat "Run " command)
(concat cargo-process--command-run-bin " " command)))
;;;###autoload
(defun cargo-process-run-example (command)
"Run the Cargo run command --example <name>.
With the prefix argument, modify the command's invocation.
Cargo: Build and execute with --example <name>."
(interactive "sExample name: ")
(cargo-process--start (concat "Example " command)
(concat cargo-process--command-run-example " " command)))
;;;###autoload
(defun cargo-process-search (search-term)
"Run the Cargo search command.
With the prefix argument, modify the command's invocation.
SEARCH-TERM is used as the search term for the Cargo registry.
Cargo: Search registry for crates."
(interactive "sSearch: ")
(cargo-process--start "Search"
(concat cargo-process--command-search " " search-term)))
;;;###autoload
(defun cargo-process-test ()
"Run the Cargo test command.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests."
(interactive)
(cargo-process--start "Test" cargo-process--command-test))
;;;###autoload
(defun cargo-process-current-test ()
"Run the Cargo test command for the current test.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests."
(interactive)
(cargo-process--start "Test"
(concat cargo-process--command-current-test
" "
(cargo-process--get-current-test-fullname))))
;;;###autoload
(defun cargo-process-current-file-tests ()
"Run the Cargo test command for the current file.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests."
(interactive)
(cargo-process--start "Test" (concat cargo-process--command-current-file-tests
" "
(cargo-process--get-current-mod))))
;;;###autoload
(defun cargo-process-update ()
"Run the Cargo update command.
With the prefix argument, modify the command's invocation.
Cargo: Update dependencies listed in Cargo.lock."
(interactive)
(cargo-process--start "Update" cargo-process--command-update))
;;;###autoload
(defun cargo-process-fmt ()
"Run the Cargo fmt command.
With the prefix argument, modify the command's invocation.
Requires Cargo Fmt to be installed."
(interactive)
(cargo-process--start "Fmt" cargo-process--command-fmt))
;;;###autoload
(defun cargo-process-check ()
"Run the Cargo check command.
With the prefix argument, modify the command's invocation.
Cargo: Check compile the current project.
Requires cargo-check to be installed."
(interactive)
(cargo-process--start "Check" cargo-process--command-check))
;;;###autoload
(defun cargo-process-clippy ()
"Run the Cargo clippy command.
With the prefix argument, modify the command's invocation.
Cargo: Clippy compile the current project.
Requires Cargo clippy to be installed."
(interactive)
(cargo-process--start "Clippy" cargo-process--command-clippy))
;;;###autoload
(defun cargo-process-repeat ()
"Run the last cargo-process command."
(interactive)
(if cargo-process-last-command
(apply 'cargo-process--start cargo-process-last-command)
(message "No last Cargo command.")))
(define-key cargo-process-mode-map (kbd "n") 'forward-button)
(define-key cargo-process-mode-map (kbd "p") 'backward-button)
(provide 'cargo-process)
;;; cargo-process.el ends here

View File

@@ -1,87 +0,0 @@
;;; cargo.el --- Emacs Minor Mode for Cargo, Rust's Package Manager.
;; Copyright (C) 2015 Kevin W. van Rooijen
;; Author: Kevin W. van Rooijen <kevin.van.rooijen@attichacker.com>
;; Version : 0.4.0
;; Keywords: tools
;; Package-Requires: ((emacs "24.3") (rust-mode "0.2.0") (markdown-mode "2.4"))
;; 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:
;;
;; Cargo Minor mode.
;; Provides a number of key combinations and functions for managing Cargo.
;; Current supported Cargo Key Combinations:
;; * C-c C-c C-e - cargo-process-bench
;; * C-c C-c C-b - cargo-process-build
;; * C-c C-c C-l - cargo-process-clean
;; * C-c C-c C-d - cargo-process-doc
;; * C-c C-c C-v - cargo-process-doc-open
;; * C-c C-c C-n - cargo-process-new
;; * C-c C-c C-i - cargo-process-init
;; * C-c C-c C-r - cargo-process-run
;; * C-c C-c C-x - cargo-process-run-example
;; * C-c C-c C-s - cargo-process-search
;; * C-c C-c C-t - cargo-process-test
;; * C-c C-c C-u - cargo-process-update
;; * C-c C-c C-c - cargo-process-repeat
;; * C-c C-c C-f - cargo-process-current-test
;; * C-c C-c C-o - cargo-process-current-file-tests
;; * C-c C-c C-m - cargo-process-fmt
;; * C-c C-c C-k - cargo-process-check
;; * C-c C-c C-K - cargo-process-clippy
;;
;;; Code:
(require 'cargo-process)
(defgroup cargo nil
"Cargo group."
:prefix "cargo-"
:group 'tools)
(defvar cargo-minor-mode-map (make-keymap) "Cargo-mode keymap.")
(defvar cargo-minor-mode nil)
;;;###autoload
(define-minor-mode cargo-minor-mode
"Cargo minor mode. Used to hold keybindings for cargo-mode.
\\{cargo-minor-mode-map}"
nil " cargo" cargo-minor-mode-map)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-e") 'cargo-process-bench)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-b") 'cargo-process-build)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-l") 'cargo-process-clean)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-d") 'cargo-process-doc)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-v") 'cargo-process-doc-open)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-n") 'cargo-process-new)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-i") 'cargo-process-init)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-r") 'cargo-process-run)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-x") 'cargo-process-run-example)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-s") 'cargo-process-search)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-t") 'cargo-process-test)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-u") 'cargo-process-update)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-c") 'cargo-process-repeat)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-f") 'cargo-process-current-test)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-o") 'cargo-process-current-file-tests)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-m") 'cargo-process-fmt)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-k") 'cargo-process-check)
(define-key cargo-minor-mode-map (kbd "C-c C-c C-S-k") 'cargo-process-clippy)
(provide 'cargo)
;;; cargo.el ends here

View File

@@ -1,50 +0,0 @@
;;; company-abbrev.el --- company-mode completion backend for abbrev
;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(require 'abbrev)
(defun company-abbrev-insert (match)
"Replace MATCH with the expanded abbrev."
(expand-abbrev))
;;;###autoload
(defun company-abbrev (command &optional arg &rest ignored)
"`company-mode' completion backend for abbrev."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-abbrev
'company-abbrev-insert))
(prefix (company-grab-symbol))
(candidates (nconc
(delete "" (all-completions arg global-abbrev-table))
(delete "" (all-completions arg local-abbrev-table))))
(meta (abbrev-expansion arg))))
(provide 'company-abbrev)
;;; company-abbrev.el ends here

View File

@@ -1,383 +0,0 @@
;;; company-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "company" "company.el" (0 0 0 0))
;;; Generated autoloads from company.el
(autoload 'company-mode "company" "\
\"complete anything\"; is an in-buffer completion framework.
Completion starts automatically, depending on the values
`company-idle-delay' and `company-minimum-prefix-length'.
Completion can be controlled with the commands:
`company-complete-common', `company-complete-selection', `company-complete',
`company-select-next', `company-select-previous'. If these commands are
called before `company-idle-delay', completion will also start.
Completions can be searched with `company-search-candidates' or
`company-filter-candidates'. These can be used while completion is
inactive, as well.
The completion data is retrieved using `company-backends' and displayed
using `company-frontends'. If you want to start a specific backend, call
it interactively or use `company-begin-backend'.
By default, the completions list is sorted alphabetically, unless the
backend chooses otherwise, or `company-transformers' changes it later.
regular keymap (`company-mode-map'):
\\{company-mode-map}
keymap during active completions (`company-active-map'):
\\{company-active-map}
\(fn &optional ARG)" t nil)
(defvar global-company-mode nil "\
Non-nil if Global Company mode is enabled.
See the `global-company-mode' command
for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `global-company-mode'.")
(custom-autoload 'global-company-mode "company" nil)
(autoload 'global-company-mode "company" "\
Toggle Company mode in all buffers.
With prefix ARG, enable Global Company mode if ARG is positive;
otherwise, disable it. If called from Lisp, enable the mode if
ARG is omitted or nil.
Company mode is enabled in all buffers where
`company-mode-on' would do it.
See `company-mode' for more information on Company mode.
\(fn &optional ARG)" t nil)
(autoload 'company-manual-begin "company" "\
\(fn)" t nil)
(autoload 'company-complete "company" "\
Insert the common part of all candidates or the current selection.
The first time this is called, the common part is inserted, the second
time, or when the selection has been changed, the selected candidate is
inserted.
\(fn)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company" '("company-")))
;;;***
;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (0 0 0
;;;;;; 0))
;;; Generated autoloads from company-abbrev.el
(autoload 'company-abbrev "company-abbrev" "\
`company-mode' completion backend for abbrev.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-abbrev" '("company-abbrev-insert")))
;;;***
;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (0 0 0 0))
;;; Generated autoloads from company-bbdb.el
(autoload 'company-bbdb "company-bbdb" "\
`company-mode' completion backend for BBDB.
\(fn COMMAND &optional ARG &rest IGNORE)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-bbdb" '("company-bbdb-")))
;;;***
;;;### (autoloads nil "company-capf" "company-capf.el" (0 0 0 0))
;;; Generated autoloads from company-capf.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-capf" '("company-")))
;;;***
;;;### (autoloads nil "company-clang" "company-clang.el" (0 0 0 0))
;;; Generated autoloads from company-clang.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-clang" '("company-clang")))
;;;***
;;;### (autoloads nil "company-cmake" "company-cmake.el" (0 0 0 0))
;;; Generated autoloads from company-cmake.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-cmake" '("company-cmake")))
;;;***
;;;### (autoloads nil "company-css" "company-css.el" (0 0 0 0))
;;; Generated autoloads from company-css.el
(autoload 'company-css "company-css" "\
`company-mode' completion backend for `css-mode'.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-css" '("company-css-")))
;;;***
;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (0 0
;;;;;; 0 0))
;;; Generated autoloads from company-dabbrev.el
(autoload 'company-dabbrev "company-dabbrev" "\
dabbrev-like `company-mode' completion backend.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-dabbrev" '("company-dabbrev-")))
;;;***
;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from company-dabbrev-code.el
(autoload 'company-dabbrev-code "company-dabbrev-code" "\
dabbrev-like `company-mode' backend for code.
The backend looks for all symbols in the current buffer that aren't in
comments or strings.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-dabbrev-code" '("company-dabbrev-code-")))
;;;***
;;;### (autoloads nil "company-eclim" "company-eclim.el" (0 0 0 0))
;;; Generated autoloads from company-eclim.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-eclim" '("company-eclim")))
;;;***
;;;### (autoloads nil "company-elisp" "company-elisp.el" (0 0 0 0))
;;; Generated autoloads from company-elisp.el
(autoload 'company-elisp "company-elisp" "\
`company-mode' completion backend for Emacs Lisp.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-elisp" '("company-elisp-")))
;;;***
;;;### (autoloads nil "company-etags" "company-etags.el" (0 0 0 0))
;;; Generated autoloads from company-etags.el
(autoload 'company-etags "company-etags" "\
`company-mode' completion backend for etags.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-etags" '("company-etags-")))
;;;***
;;;### (autoloads nil "company-files" "company-files.el" (0 0 0 0))
;;; Generated autoloads from company-files.el
(autoload 'company-files "company-files" "\
`company-mode' completion backend existing file names.
Completions works for proper absolute and relative files paths.
File paths with spaces are only supported inside strings.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-files" '("company-file")))
;;;***
;;;### (autoloads nil "company-gtags" "company-gtags.el" (0 0 0 0))
;;; Generated autoloads from company-gtags.el
(autoload 'company-gtags "company-gtags" "\
`company-mode' completion backend for GNU Global.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-gtags" '("company-gtags-")))
;;;***
;;;### (autoloads nil "company-ispell" "company-ispell.el" (0 0 0
;;;;;; 0))
;;; Generated autoloads from company-ispell.el
(autoload 'company-ispell "company-ispell" "\
`company-mode' completion backend using Ispell.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-ispell" '("company-ispell-")))
;;;***
;;;### (autoloads nil "company-keywords" "company-keywords.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from company-keywords.el
(autoload 'company-keywords "company-keywords" "\
`company-mode' backend for programming language keywords.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-keywords" '("company-keywords-")))
;;;***
;;;### (autoloads nil "company-nxml" "company-nxml.el" (0 0 0 0))
;;; Generated autoloads from company-nxml.el
(autoload 'company-nxml "company-nxml" "\
`company-mode' completion backend for `nxml-mode'.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-nxml" '("company-nxml-")))
;;;***
;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (0 0
;;;;;; 0 0))
;;; Generated autoloads from company-oddmuse.el
(autoload 'company-oddmuse "company-oddmuse" "\
`company-mode' completion backend for `oddmuse-mode'.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-oddmuse" '("company-oddmuse-")))
;;;***
;;;### (autoloads nil "company-semantic" "company-semantic.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from company-semantic.el
(autoload 'company-semantic "company-semantic" "\
`company-mode' completion backend using CEDET Semantic.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-semantic" '("company-semantic-")))
;;;***
;;;### (autoloads nil "company-template" "company-template.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from company-template.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-template" '("company-template-")))
;;;***
;;;### (autoloads nil "company-tempo" "company-tempo.el" (0 0 0 0))
;;; Generated autoloads from company-tempo.el
(autoload 'company-tempo "company-tempo" "\
`company-mode' completion backend for tempo.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-tempo" '("company-tempo-")))
;;;***
;;;### (autoloads nil "company-tng" "company-tng.el" (0 0 0 0))
;;; Generated autoloads from company-tng.el
(autoload 'company-tng-frontend "company-tng" "\
When the user changes the selection at least once, this
frontend will display the candidate in the buffer as if it's
already there and any key outside of `company-active-map' will
confirm the selection and finish the completion.
\(fn COMMAND)" nil nil)
(autoload 'company-tng-configure-default "company-tng" "\
Applies the default configuration to enable company-tng.
\(fn)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-tng" '("company-tng--")))
;;;***
;;;### (autoloads nil "company-xcode" "company-xcode.el" (0 0 0 0))
;;; Generated autoloads from company-xcode.el
(autoload 'company-xcode "company-xcode" "\
`company-mode' completion backend for Xcode projects.
\(fn COMMAND &optional ARG &rest IGNORED)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-xcode" '("company-xcode-")))
;;;***
;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from company-yasnippet.el
(autoload 'company-yasnippet "company-yasnippet" "\
`company-mode' backend for `yasnippet'.
This backend should be used with care, because as long as there are
snippets defined for the current major mode, this backend will always
shadow backends that come after it. Recommended usages:
* In a buffer-local value of `company-backends', grouped with a backend or
several that provide actual text completions.
(add-hook 'js-mode-hook
(lambda ()
(set (make-local-variable 'company-backends)
'((company-dabbrev-code company-yasnippet)))))
* After keyword `:with', grouped with other backends.
(push '(company-semantic :with company-yasnippet) company-backends)
* Not in `company-backends', just bound to a key.
(global-set-key (kbd \"C-c y\") 'company-yasnippet)
\(fn COMMAND &optional ARG &rest IGNORE)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "company-yasnippet" '("company-yasnippet--")))
;;;***
;;;### (autoloads nil nil ("company-pkg.el") (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; company-autoloads.el ends here

View File

@@ -1,61 +0,0 @@
;;; company-bbdb.el --- company-mode completion backend for BBDB in message-mode
;; Copyright (C) 2013-2014, 2016 Free Software Foundation, Inc.
;; Author: Jan Tatarik <jan.tatarik@gmail.com>
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
(require 'company)
(require 'cl-lib)
(declare-function bbdb-record-get-field "bbdb")
(declare-function bbdb-records "bbdb")
(declare-function bbdb-dwim-mail "bbdb-com")
(declare-function bbdb-search "bbdb-com")
(defgroup company-bbdb nil
"Completion backend for BBDB."
:group 'company)
(defcustom company-bbdb-modes '(message-mode)
"Major modes in which `company-bbdb' may complete."
:type '(repeat (symbol :tag "Major mode"))
:package-version '(company . "0.8.8"))
(defun company-bbdb--candidates (arg)
(cl-mapcan (lambda (record)
(mapcar (lambda (mail) (bbdb-dwim-mail record mail))
(bbdb-record-get-field record 'mail)))
(eval '(bbdb-search (bbdb-records) arg nil arg))))
;;;###autoload
(defun company-bbdb (command &optional arg &rest ignore)
"`company-mode' completion backend for BBDB."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-bbdb))
(prefix (and (memq major-mode company-bbdb-modes)
(featurep 'bbdb-com)
(looking-back "^\\(To\\|Cc\\|Bcc\\): *.*? *\\([^,;]*\\)"
(line-beginning-position))
(match-string-no-properties 2)))
(candidates (company-bbdb--candidates arg))
(sorted t)
(no-cache t)))
(provide 'company-bbdb)
;;; company-bbdb.el ends here

View File

@@ -1,189 +0,0 @@
;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*-
;; Copyright (C) 2013-2018 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; The CAPF back-end provides a bridge to the standard
;; completion-at-point-functions facility, and thus can support any major mode
;; that defines a proper completion function, including emacs-lisp-mode,
;; css-mode and nxml-mode.
;;; Code:
(require 'company)
(require 'cl-lib)
(defvar company--capf-cache nil)
(defun company--capf-data ()
(let ((cache company--capf-cache))
(if (and (equal (current-buffer) (car cache))
(equal (point) (car (setq cache (cdr cache))))
(equal (buffer-chars-modified-tick) (car (setq cache (cdr cache)))))
(cadr cache)
(let ((data (company--capf-data-real)))
(setq company--capf-cache
(list (current-buffer) (point) (buffer-chars-modified-tick) data))
data))))
(defun company--capf-data-real ()
(cl-letf* (((default-value 'completion-at-point-functions)
;; Ignore tags-completion-at-point-function because it subverts
;; company-etags in the default value of company-backends, where
;; the latter comes later.
(remove 'tags-completion-at-point-function
(default-value 'completion-at-point-functions)))
(completion-at-point-functions (company--capf-workaround))
(data (run-hook-wrapped 'completion-at-point-functions
;; Ignore misbehaving functions.
#'completion--capf-wrapper 'optimist)))
(when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data)))
(declare-function python-shell-get-process "python")
(defun company--capf-workaround ()
;; For http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18067
(if (or (not (listp completion-at-point-functions))
(not (memq 'python-completion-complete-at-point completion-at-point-functions))
(python-shell-get-process))
completion-at-point-functions
(remq 'python-completion-complete-at-point completion-at-point-functions)))
(defun company-capf (command &optional arg &rest _args)
"`company-mode' backend using `completion-at-point-functions'."
(interactive (list 'interactive))
(pcase command
(`interactive (company-begin-backend 'company-capf))
(`prefix
(let ((res (company--capf-data)))
(when res
(let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
(prefix (buffer-substring-no-properties (nth 1 res) (point))))
(cond
((> (nth 2 res) (point)) 'stop)
(length (cons prefix length))
(t prefix))))))
(`candidates
(let ((res (company--capf-data)))
(when res
(let* ((table (nth 3 res))
(pred (plist-get (nthcdr 4 res) :predicate))
(meta (completion-metadata
(buffer-substring (nth 1 res) (nth 2 res))
table pred))
(sortfun (cdr (assq 'display-sort-function meta)))
(candidates (completion-all-completions arg table pred (length arg)))
(last (last candidates))
(base-size (and (numberp (cdr last)) (cdr last))))
(when base-size
(setcdr last nil))
(when sortfun
(setq candidates (funcall sortfun candidates)))
(if (not (zerop (or base-size 0)))
(let ((before (substring arg 0 base-size)))
(mapcar (lambda (candidate)
(concat before candidate))
candidates))
candidates)))))
(`sorted
(let ((res (company--capf-data)))
(when res
(let ((meta (completion-metadata
(buffer-substring (nth 1 res) (nth 2 res))
(nth 3 res) (plist-get (nthcdr 4 res) :predicate))))
(cdr (assq 'display-sort-function meta))))))
(`match
;; Ask the for the `:company-match' function. If that doesn't help,
;; fallback to sniffing for face changes to get a suitable value.
(let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-match)))
(if f (funcall f arg)
(let* ((match-start nil) (pos -1)
(prop-value nil) (faces nil)
(has-face-p nil) chunks
(limit (length arg)))
(while (< pos limit)
(setq pos
(if (< pos 0) 0 (next-property-change pos arg limit)))
(setq prop-value (or
(get-text-property pos 'face arg)
(get-text-property pos 'font-lock-face arg))
faces (if (listp prop-value) prop-value (list prop-value))
has-face-p (memq 'completions-common-part faces))
(cond ((and (not match-start) has-face-p)
(setq match-start pos))
((and match-start (not has-face-p))
(push (cons match-start pos) chunks)
(setq match-start nil))))
(nreverse chunks)))))
(`duplicates t)
(`no-cache t) ;Not much can be done here, as long as we handle
;non-prefix matches.
(`meta
(let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-docsig)))
(when f (funcall f arg))))
(`doc-buffer
(let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-doc-buffer)))
(when f (funcall f arg))))
(`location
(let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-location)))
(when f (funcall f arg))))
(`annotation
(save-excursion
;; FIXME: `company-begin' sets `company-point' after calling
;; `company--begin-new'. We shouldn't rely on `company-point' here,
;; better to cache the capf-data value instead. However: we can't just
;; save the last capf-data value in `prefix', because that command can
;; get called more often than `candidates', and at any point in the
;; buffer (https://github.com/company-mode/company-mode/issues/153).
;; We could try propertizing the returned prefix string, but it's not
;; passed to `annotation', and `company-prefix' is set only after
;; `company--strip-duplicates' is called.
(when company-point
(goto-char company-point))
(let ((f (plist-get (nthcdr 4 (company--capf-data)) :annotation-function)))
(when f (funcall f arg)))))
(`require-match
(plist-get (nthcdr 4 (company--capf-data)) :company-require-match))
(`init nil) ;Don't bother: plenty of other ways to initialize the code.
(`post-completion
(company--capf-post-completion arg))
))
(defun company--capf-post-completion (arg)
(let* ((res (company--capf-data))
(exit-function (plist-get (nthcdr 4 res) :exit-function))
(table (nth 3 res))
(pred (plist-get (nthcdr 4 res) :predicate)))
(if exit-function
;; Follow the example of `completion--done'.
(funcall exit-function arg
;; FIXME: Should probably use an additional heuristic:
;; completion-at-point doesn't know when the user picked a
;; particular candidate explicitly (it only checks whether
;; futher completions exist). Whereas company user can press
;; RET (or use implicit completion with company-tng).
(if (eq (try-completion arg table pred) t)
'finished 'sole)))))
(provide 'company-capf)
;;; company-capf.el ends here

View File

@@ -1,350 +0,0 @@
;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*-
;; Copyright (C) 2009, 2011, 2013-2017 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'company-template)
(require 'cl-lib)
(defgroup company-clang nil
"Completion backend for Clang."
:group 'company)
(defcustom company-clang-executable
(executable-find "clang")
"Location of clang executable."
:type 'file)
(defcustom company-clang-begin-after-member-access t
"When non-nil, automatic completion will start whenever the current
symbol is preceded by \".\", \"->\" or \"::\", ignoring
`company-minimum-prefix-length'.
If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
and `c-electric-colon', for automatic completion right after \">\" and
\":\"."
:type 'boolean)
(defcustom company-clang-arguments nil
"Additional arguments to pass to clang when completing.
Prefix files (-include ...) can be selected with `company-clang-set-prefix'
or automatically through a custom `company-clang-prefix-guesser'."
:type '(repeat (string :tag "Argument")))
(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix
"A function to determine the prefix file for the current buffer."
:type '(function :tag "Guesser function" nil))
(defvar company-clang-modes '(c-mode c++-mode objc-mode)
"Major modes which clang may complete.")
(defcustom company-clang-insert-arguments t
"When non-nil, insert function arguments as a template after completion."
:type 'boolean
:package-version '(company . "0.8.0"))
;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar company-clang--prefix nil)
(defsubst company-clang--guess-pch-file (file)
(let ((dir (directory-file-name (file-name-directory file))))
(when (equal (file-name-nondirectory dir) "Classes")
(setq dir (file-name-directory dir)))
(car (directory-files dir t "\\([^.]h\\|[^h]\\).pch\\'" t))))
(defsubst company-clang--file-substring (file beg end)
(with-temp-buffer
(insert-file-contents-literally file nil beg end)
(buffer-string)))
(defun company-clang-guess-prefix ()
"Try to guess the prefix file for the current buffer."
;; Prefixes seem to be called .pch. Pre-compiled headers do, too.
;; So we look at the magic number to rule them out.
(let* ((file (company-clang--guess-pch-file buffer-file-name))
(magic-number (and file (company-clang--file-substring file 0 4))))
(unless (member magic-number '("CPCH" "gpch"))
file)))
(defun company-clang-set-prefix (&optional prefix)
"Use PREFIX as a prefix (-include ...) file for clang completion."
(interactive (let ((def (funcall company-clang-prefix-guesser)))
(unless (stringp def)
(setq def default-directory))
(list (read-file-name "Prefix file: "
(when def (file-name-directory def))
def t (when def (file-name-nondirectory def))))))
;; TODO: pre-compile?
(setq company-clang--prefix (and (stringp prefix)
(file-regular-p prefix)
prefix)))
;; Clean-up on exit.
(add-hook 'kill-emacs-hook 'company-clang-set-prefix)
;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; TODO: Handle Pattern (syntactic hints would be neat).
;; Do we ever see OVERLOAD (or OVERRIDE)?
(defconst company-clang--completion-pattern
"^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?: : \\(.*\\)$\\)?$")
(defconst company-clang--error-buffer-name "*clang-error*")
(defun company-clang--lang-option ()
(if (eq major-mode 'objc-mode)
(if (string= "m" (file-name-extension buffer-file-name))
"objective-c" "objective-c++")
(substring (symbol-name major-mode) 0 -5)))
(defun company-clang--parse-output (prefix _objc)
(goto-char (point-min))
(let ((pattern (format company-clang--completion-pattern
(regexp-quote prefix)))
(case-fold-search nil)
lines match)
(while (re-search-forward pattern nil t)
(setq match (match-string-no-properties 1))
(unless (equal match "Pattern")
(save-match-data
(when (string-match ":" match)
(setq match (substring match 0 (match-beginning 0)))))
(let ((meta (match-string-no-properties 2)))
(when (and meta (not (string= match meta)))
(put-text-property 0 1 'meta
(company-clang--strip-formatting meta)
match)))
(push match lines)))
lines))
(defun company-clang--meta (candidate)
(get-text-property 0 'meta candidate))
(defun company-clang--annotation (candidate)
(let ((ann (company-clang--annotation-1 candidate)))
(if (not (and ann (string-prefix-p "(*)" ann)))
ann
(with-temp-buffer
(insert ann)
(search-backward ")")
(let ((pt (1+ (point))))
(re-search-forward ".\\_>" nil t)
(delete-region pt (point)))
(buffer-string)))))
(defun company-clang--annotation-1 (candidate)
(let ((meta (company-clang--meta candidate)))
(cond
((null meta) nil)
((string-match "[^:]:[^:]" meta)
(substring meta (1+ (match-beginning 0))))
((string-match "(anonymous)" meta) nil)
((string-match "\\((.*)[ a-z]*\\'\\)" meta)
(let ((paren (match-beginning 1)))
(if (not (eq (aref meta (1- paren)) ?>))
(match-string 1 meta)
(with-temp-buffer
(insert meta)
(goto-char paren)
(substring meta (1- (search-backward "<"))))))))))
(defun company-clang--strip-formatting (text)
(replace-regexp-in-string
"#]" " "
(replace-regexp-in-string "[<{[]#\\|#[>}]" "" text t)
t))
(defun company-clang--handle-error (res args)
(goto-char (point-min))
(let* ((buf (get-buffer-create company-clang--error-buffer-name))
(cmd (concat company-clang-executable " " (mapconcat 'identity args " ")))
(pattern (format company-clang--completion-pattern ""))
(message-truncate-lines t)
(err (if (re-search-forward pattern nil t)
(buffer-substring-no-properties (point-min)
(1- (match-beginning 0)))
;; Warn the user more aggressively if no match was found.
(message "clang failed with error %d: %s" res cmd)
(buffer-string))))
(with-current-buffer buf
(let ((inhibit-read-only t))
(erase-buffer)
(insert (current-time-string)
(format "\nclang failed with error %d:\n" res)
cmd "\n\n")
(insert err)
(setq buffer-read-only t)
(goto-char (point-min))))))
(defun company-clang--start-process (prefix callback &rest args)
(let* ((objc (derived-mode-p 'objc-mode))
(buf (get-buffer-create "*clang-output*"))
;; Looks unnecessary in Emacs 25.1 and later.
(process-adaptive-read-buffering nil)
(existing-process (get-buffer-process buf)))
(when existing-process
(kill-process existing-process))
(with-current-buffer buf
(erase-buffer)
(setq buffer-undo-list t))
(let* ((process-connection-type nil)
(process (apply #'start-file-process "company-clang" buf
company-clang-executable args)))
(set-process-sentinel
process
(lambda (proc status)
(unless (string-match-p "hangup\\|killed" status)
(funcall
callback
(let ((res (process-exit-status proc)))
(with-current-buffer buf
(unless (eq 0 res)
(company-clang--handle-error res args))
;; Still try to get any useful input.
(company-clang--parse-output prefix objc)))))))
(unless (company-clang--auto-save-p)
(send-region process (point-min) (point-max))
(send-string process "\n")
(process-send-eof process)))))
(defsubst company-clang--build-location (pos)
(save-excursion
(goto-char pos)
(format "%s:%d:%d"
(if (company-clang--auto-save-p) buffer-file-name "-")
(line-number-at-pos)
(1+ (length
(encode-coding-region
(line-beginning-position)
(point)
'utf-8
t))))))
(defsubst company-clang--build-complete-args (pos)
(append '("-fsyntax-only" "-Xclang" "-code-completion-macros")
(unless (company-clang--auto-save-p)
(list "-x" (company-clang--lang-option)))
company-clang-arguments
(when (stringp company-clang--prefix)
(list "-include" (expand-file-name company-clang--prefix)))
(list "-Xclang" (format "-code-completion-at=%s"
(company-clang--build-location pos)))
(list (if (company-clang--auto-save-p) buffer-file-name "-"))))
(defun company-clang--candidates (prefix callback)
(and (company-clang--auto-save-p)
(buffer-modified-p)
(basic-save-buffer))
(when (null company-clang--prefix)
(company-clang-set-prefix (or (funcall company-clang-prefix-guesser)
'none)))
(apply 'company-clang--start-process
prefix
callback
(company-clang--build-complete-args
(if (company-clang--check-version 4.0 9.0)
(point)
(- (point) (length prefix))))))
(defun company-clang--prefix ()
(if company-clang-begin-after-member-access
(company-grab-symbol-cons "\\.\\|->\\|::" 2)
(company-grab-symbol)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst company-clang-required-version 1.1)
(defvar company-clang--version nil)
(defun company-clang--auto-save-p ()
(not
(company-clang--check-version 2.9 3.1)))
(defun company-clang--check-version (min apple-min)
(pcase company-clang--version
(`(apple . ,ver) (>= ver apple-min))
(`(normal . ,ver) (>= ver min))
(_ (error "pcase-exhaustive is not in Emacs 24.3!"))))
(defsubst company-clang-version ()
"Return the version of `company-clang-executable'."
(with-temp-buffer
(call-process company-clang-executable nil t nil "--version")
(goto-char (point-min))
(if (re-search-forward "\\(clang\\|Apple LLVM\\) version \\([0-9.]+\\)" nil t)
(cons
(if (equal (match-string-no-properties 1) "Apple LLVM")
'apple
'normal)
(string-to-number (match-string-no-properties 2)))
0)))
(defun company-clang (command &optional arg &rest ignored)
"`company-mode' completion backend for Clang.
Clang is a parser for C and ObjC. Clang version 1.1 or newer is required.
Additional command line arguments can be specified in
`company-clang-arguments'. Prefix files (-include ...) can be selected
with `company-clang-set-prefix' or automatically through a custom
`company-clang-prefix-guesser'.
With Clang versions before 2.9, we have to save the buffer before
performing completion. With Clang 2.9 and later, buffer contents are
passed via standard input."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-clang))
(init (when (memq major-mode company-clang-modes)
(unless company-clang-executable
(error "Company found no clang executable"))
(setq company-clang--version (company-clang-version))
(unless (company-clang--check-version
company-clang-required-version
company-clang-required-version)
(error "Company requires clang version %s"
company-clang-required-version))))
(prefix (and (memq major-mode company-clang-modes)
buffer-file-name
company-clang-executable
(not (company-in-string-or-comment))
(or (company-clang--prefix) 'stop)))
(candidates (cons :async
(lambda (cb) (company-clang--candidates arg cb))))
(meta (company-clang--meta arg))
(annotation (company-clang--annotation arg))
(post-completion (let ((anno (company-clang--annotation arg)))
(when (and company-clang-insert-arguments anno)
(insert anno)
(if (string-match "\\`:[^:]" anno)
(company-template-objc-templatify anno)
(company-template-c-like-templatify
(concat arg anno))))))))
(provide 'company-clang)
;;; company-clang.el ends here

View File

@@ -1,206 +0,0 @@
;;; company-cmake.el --- company-mode completion backend for CMake
;; Copyright (C) 2013-2014, 2017-2018 Free Software Foundation, Inc.
;; Author: Chen Bin <chenbin DOT sh AT gmail>
;; Version: 0.2
;; 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:
;;
;; company-cmake offers completions for module names, variable names and
;; commands used by CMake. And their descriptions.
;;; Code:
(require 'company)
(require 'cl-lib)
(defgroup company-cmake nil
"Completion backend for CMake."
:group 'company)
(defcustom company-cmake-executable
(executable-find "cmake")
"Location of cmake executable."
:type 'file)
(defvar company-cmake-executable-arguments
'("--help-command-list"
"--help-module-list"
"--help-variable-list")
"The arguments we pass to cmake, separately.
They affect which types of symbols we get completion candidates for.")
(defvar company-cmake--completion-pattern
"^\\(%s[a-zA-Z0-9_<>]%s\\)$"
"Regexp to match the candidates.")
(defvar company-cmake-modes '(cmake-mode)
"Major modes in which cmake may complete.")
(defvar company-cmake--candidates-cache nil
"Cache for the raw candidates.")
(defvar company-cmake--meta-command-cache nil
"Cache for command arguments to retrieve descriptions for the candidates.")
(defun company-cmake--replace-tags (rlt)
(setq rlt (replace-regexp-in-string
"\\(.*?\\(IS_GNU\\)?\\)<LANG>\\(.*\\)"
(lambda (_match)
(mapconcat 'identity
(if (match-beginning 2)
'("\\1CXX\\3" "\\1C\\3" "\\1G77\\3")
'("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3"))
"\n"))
rlt t))
(setq rlt (replace-regexp-in-string
"\\(.*\\)<CONFIG>\\(.*\\)"
(mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2"
"\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2")
"\n")
rlt))
rlt)
(defun company-cmake--fill-candidates-cache (arg)
"Fill candidates cache if needed."
(let (rlt)
(unless company-cmake--candidates-cache
(setq company-cmake--candidates-cache (make-hash-table :test 'equal)))
;; If hash is empty, fill it.
(unless (gethash arg company-cmake--candidates-cache)
(with-temp-buffer
(let ((res (call-process company-cmake-executable nil t nil arg)))
(unless (zerop res)
(message "cmake executable exited with error=%d" res)))
(setq rlt (buffer-string)))
(setq rlt (company-cmake--replace-tags rlt))
(puthash arg rlt company-cmake--candidates-cache))
))
(defun company-cmake--parse (prefix content cmd)
(let ((start 0)
(pattern (format company-cmake--completion-pattern
(regexp-quote prefix)
(if (zerop (length prefix)) "+" "*")))
(lines (split-string content "\n"))
match
rlt)
(dolist (line lines)
(when (string-match pattern line)
(let ((match (match-string 1 line)))
(when match
(puthash match cmd company-cmake--meta-command-cache)
(push match rlt)))))
rlt))
(defun company-cmake--candidates (prefix)
(let (results
cmd-opts
str)
(unless company-cmake--meta-command-cache
(setq company-cmake--meta-command-cache (make-hash-table :test 'equal)))
(dolist (arg company-cmake-executable-arguments)
(company-cmake--fill-candidates-cache arg)
(setq cmd-opts (replace-regexp-in-string "-list$" "" arg) )
(setq str (gethash arg company-cmake--candidates-cache))
(when str
(setq results (nconc results
(company-cmake--parse prefix str cmd-opts)))))
results))
(defun company-cmake--unexpand-candidate (candidate)
(cond
((string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" candidate)
(setq candidate (concat "CMAKE_<LANG>" (match-string 2 candidate))))
;; C flags
((string-match "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" candidate)
(setq candidate (concat (match-string 1 candidate) "IS_GNU<LANG>")))
;; C flags
((string-match "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" candidate)
(setq candidate (concat (match-string 1 candidate) "OVERRIDE_<LANG>")))
((string-match "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" candidate)
(setq candidate (concat (match-string 1 candidate)
"_<CONFIG>"
(match-string 3 candidate)))))
candidate)
(defun company-cmake--meta (candidate)
(let ((cmd-opts (gethash candidate company-cmake--meta-command-cache))
result)
(setq candidate (company-cmake--unexpand-candidate candidate))
;; Don't cache the documentation of every candidate (command)
;; Cache in this case will cost too much memory.
(with-temp-buffer
(call-process company-cmake-executable nil t nil cmd-opts candidate)
;; Go to the third line, trim it and return the result.
;; Tested with cmake 2.8.9.
(goto-char (point-min))
(forward-line 2)
(setq result (buffer-substring-no-properties (line-beginning-position)
(line-end-position)))
(setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
result)))
(defun company-cmake--doc-buffer (candidate)
(let ((cmd-opts (gethash candidate company-cmake--meta-command-cache)))
(setq candidate (company-cmake--unexpand-candidate candidate))
(with-temp-buffer
(call-process company-cmake-executable nil t nil cmd-opts candidate)
;; Go to the third line, trim it and return the doc buffer.
;; Tested with cmake 2.8.9.
(goto-char (point-min))
(forward-line 2)
(company-doc-buffer
(buffer-substring-no-properties (line-beginning-position)
(point-max))))))
(defun company-cmake-prefix-dollar-brace-p ()
"Test if the current symbol follows ${."
(save-excursion
(skip-syntax-backward "w_")
(and (eq (char-before (point)) ?\{)
(eq (char-before (1- (point))) ?$))))
(defun company-cmake (command &optional arg &rest ignored)
"`company-mode' completion backend for CMake.
CMake is a cross-platform, open-source make system."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-cmake))
(init (when (memq major-mode company-cmake-modes)
(unless company-cmake-executable
(error "Company found no cmake executable"))))
(prefix (and (memq major-mode company-cmake-modes)
(or (not (company-in-string-or-comment))
(company-cmake-prefix-dollar-brace-p))
(company-grab-symbol)))
(candidates (company-cmake--candidates arg))
(meta (company-cmake--meta arg))
(doc-buffer (company-cmake--doc-buffer arg))
))
(provide 'company-cmake)
;;; company-cmake.el ends here

View File

@@ -1,446 +0,0 @@
;;; company-css.el --- company-mode completion backend for css-mode -*- lexical-binding: t -*-
;; Copyright (C) 2009, 2011, 2014, 2018 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; In Emacs >= 26, company-capf is used instead.
;;; Code:
(require 'company)
(require 'cl-lib)
(declare-function web-mode-language-at-pos "web-mode" (&optional pos))
(defconst company-css-property-alist
;; see http://www.w3.org/TR/CSS21/propidx.html
'(("azimuth" angle "left-side" "far-left" "left" "center-left" "center"
"center-right" "right" "far-right" "right-side" "behind" "leftwards"
"rightwards")
("background" background-color background-image background-repeat
background-attachment background-position
background-clip background-origin background-size)
("background-attachment" "scroll" "fixed")
("background-color" color "transparent")
("background-image" uri "none")
("background-position" percentage length "left" "center" "right" percentage
length "top" "center" "bottom" "left" "center" "right" "top" "center"
"bottom")
("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat")
("border" border-width border-style border-color)
("border-bottom" border)
("border-bottom-color" border-color)
("border-bottom-style" border-style)
("border-bottom-width" border-width)
("border-collapse" "collapse" "separate")
("border-color" color "transparent")
("border-left" border)
("border-left-color" border-color)
("border-left-style" border-style)
("border-left-width" border-width)
("border-right" border)
("border-right-color" border-color)
("border-right-style" border-style)
("border-right-width" border-width)
("border-spacing" length length)
("border-style" border-style)
("border-top" border)
("border-top-color" border-color)
("border-top-style" border-style)
("border-top-width" border-width)
("border-width" border-width)
("bottom" length percentage "auto")
("caption-side" "top" "bottom")
("clear" "none" "left" "right" "both")
("clip" shape "auto")
("color" color)
("content" "normal" "none" string uri counter "attr()" "open-quote"
"close-quote" "no-open-quote" "no-close-quote")
("counter-increment" identifier integer "none")
("counter-reset" identifier integer "none")
("cue" cue-before cue-after)
("cue-after" uri "none")
("cue-before" uri "none")
("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize"
"ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize"
"w-resize" "text" "wait" "help" "progress")
("direction" "ltr" "rtl")
("display" "inline" "block" "list-item" "run-in" "inline-block" "table"
"inline-table" "table-row-group" "table-header-group" "table-footer-group"
"table-row" "table-column-group" "table-column" "table-cell"
"table-caption" "none")
("elevation" angle "below" "level" "above" "higher" "lower")
("empty-cells" "show" "hide")
("float" "left" "right" "none")
("font" font-style font-weight font-size "/" line-height
font-family "caption" "icon" "menu" "message-box" "small-caption"
"status-bar" "normal" "small-caps"
;; CSS3
font-stretch)
("font-family" family-name generic-family)
("font-size" absolute-size relative-size length percentage)
("font-style" "normal" "italic" "oblique")
("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400"
"500" "600" "700" "800" "900")
("height" length percentage "auto")
("left" length percentage "auto")
("letter-spacing" "normal" length)
("line-height" "normal" number length percentage)
("list-style" list-style-type list-style-position list-style-image)
("list-style-image" uri "none")
("list-style-position" "inside" "outside")
("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero"
"lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin"
"armenian" "georgian" "lower-alpha" "upper-alpha" "none")
("margin" margin-width)
("margin-bottom" margin-width)
("margin-left" margin-width)
("margin-right" margin-width)
("margin-top" margin-width)
("max-height" length percentage "none")
("max-width" length percentage "none")
("min-height" length percentage)
("min-width" length percentage)
("orphans" integer)
("outline" outline-color outline-style outline-width)
("outline-color" color "invert")
("outline-style" border-style)
("outline-width" border-width)
("overflow" "visible" "hidden" "scroll" "auto"
;; CSS3:
"no-display" "no-content")
("padding" padding-width)
("padding-bottom" padding-width)
("padding-left" padding-width)
("padding-right" padding-width)
("padding-top" padding-width)
("page-break-after" "auto" "always" "avoid" "left" "right")
("page-break-before" "auto" "always" "avoid" "left" "right")
("page-break-inside" "avoid" "auto")
("pause" time percentage)
("pause-after" time percentage)
("pause-before" time percentage)
("pitch" frequency "x-low" "low" "medium" "high" "x-high")
("pitch-range" number)
("play-during" uri "mix" "repeat" "auto" "none")
("position" "static" "relative" "absolute" "fixed")
("quotes" string string "none")
("richness" number)
("right" length percentage "auto")
("speak" "normal" "none" "spell-out")
("speak-header" "once" "always")
("speak-numeral" "digits" "continuous")
("speak-punctuation" "code" "none")
("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster"
"slower")
("stress" number)
("table-layout" "auto" "fixed")
("text-align" "left" "right" "center" "justify")
("text-indent" length percentage)
("text-transform" "capitalize" "uppercase" "lowercase" "none")
("top" length percentage "auto")
("unicode-bidi" "normal" "embed" "bidi-override")
("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle"
"bottom" "text-bottom" percentage length)
("visibility" "visible" "hidden" "collapse")
("voice-family" specific-voice generic-voice "*" specific-voice
generic-voice)
("volume" number percentage "silent" "x-soft" "soft" "medium" "loud"
"x-loud")
("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line")
("widows" integer)
("width" length percentage "auto")
("word-spacing" "normal" length)
("z-index" "auto" integer)
;; CSS3
("align-content" align-stretch "space-between" "space-around")
("align-items" align-stretch "baseline")
("align-self" align-items "auto")
("animation" animation-name animation-duration animation-timing-function
animation-delay animation-iteration-count animation-direction
animation-fill-mode)
("animation-delay" time)
("animation-direction" "normal" "reverse" "alternate" "alternate-reverse")
("animation-duration" time)
("animation-fill-mode" "none" "forwards" "backwards" "both")
("animation-iteration-count" integer "infinite")
("animation-name" "none")
("animation-play-state" "paused" "running")
("animation-timing-function" transition-timing-function
"step-start" "step-end" "steps(,)")
("backface-visibility" "visible" "hidden")
("background-clip" background-origin)
("background-origin" "border-box" "padding-box" "content-box")
("background-size" length percentage "auto" "cover" "contain")
("border-image" border-image-outset border-image-repeat border-image-source
border-image-slice border-image-width)
("border-image-outset" length)
("border-image-repeat" "stretch" "repeat" "round" "space")
("border-image-source" uri "none")
("border-image-slice" length)
("border-image-width" length percentage)
("border-radius" length)
("border-top-left-radius" length)
("border-top-right-radius" length)
("border-bottom-left-radius" length)
("border-bottom-right-radius" length)
("box-decoration-break" "slice" "clone")
("box-shadow" length color)
("box-sizing" "content-box" "border-box")
("break-after" "auto" "always" "avoid" "left" "right" "page" "column"
"avoid-page" "avoid-column")
("break-before" break-after)
("break-inside" "avoid" "auto")
("columns" column-width column-count)
("column-count" integer)
("column-fill" "auto" "balance")
("column-gap" length "normal")
("column-rule" column-rule-width column-rule-style column-rule-color)
("column-rule-color" color)
("column-rule-style" border-style)
("column-rule-width" border-width)
("column-span" "all" "none")
("column-width" length "auto")
("filter" url "blur()" "brightness()" "contrast()" "drop-shadow()"
"grayscale()" "hue-rotate()" "invert()" "opacity()" "saturate()" "sepia()")
("flex" flex-grow flex-shrink flex-basis)
("flex-basis" percentage length "auto")
("flex-direction" "row" "row-reverse" "column" "column-reverse")
("flex-flow" flex-direction flex-wrap)
("flex-grow" number)
("flex-shrink" number)
("flex-wrap" "nowrap" "wrap" "wrap-reverse")
("font-feature-setting" normal string number)
("font-kerning" "auto" "normal" "none")
("font-language-override" "normal" string)
("font-size-adjust" "none" number)
("font-stretch" "normal" "ultra-condensed" "extra-condensed" "condensed"
"semi-condensed" "semi-expanded" "expanded" "extra-expanded" "ultra-expanded")
("font-synthesis" "none" "weight" "style")
("font-variant" font-variant-alternates font-variant-caps
font-variant-east-asian font-variant-ligatures font-variant-numeric
font-variant-position)
("font-variant-alternates" "normal" "historical-forms" "stylistic()"
"styleset()" "character-variant()" "swash()" "ornaments()" "annotation()")
("font-variant-caps" "normal" "small-caps" "all-small-caps" "petite-caps"
"all-petite-caps" "unicase" "titling-caps")
("font-variant-east-asian" "jis78" "jis83" "jis90" "jis04" "simplified"
"traditional" "full-width" "proportional-width" "ruby")
("font-variant-ligatures" "normal" "none" "common-ligatures"
"no-common-ligatures" "discretionary-ligatures" "no-discretionary-ligatures"
"historical-ligatures" "no-historical-ligatures" "contextual" "no-contextual")
("font-variant-numeric" "normal" "ordinal" "slashed-zero"
"lining-nums" "oldstyle-nums" "proportional-nums" "tabular-nums"
"diagonal-fractions" "stacked-fractions")
("font-variant-position" "normal" "sub" "super")
("hyphens" "none" "manual" "auto")
("justify-content" align-common "space-between" "space-around")
("line-break" "auto" "loose" "normal" "strict")
("marquee-direction" "forward" "reverse")
("marquee-play-count" integer "infinite")
("marquee-speed" "slow" "normal" "fast")
("marquee-style" "scroll" "slide" "alternate")
("opacity" number)
("order" number)
("outline-offset" length)
("overflow-x" overflow)
("overflow-y" overflow)
("overflow-style" "auto" "marquee-line" "marquee-block")
("overflow-wrap" "normal" "break-word")
("perspective" "none" length)
("perspective-origin" percentage length "left" "center" "right" "top" "bottom")
("resize" "none" "both" "horizontal" "vertical")
("tab-size" integer length)
("text-align-last" "auto" "start" "end" "left" "right" "center" "justify")
("text-decoration" text-decoration-color text-decoration-line text-decoration-style)
("text-decoration-color" color)
("text-decoration-line" "none" "underline" "overline" "line-through" "blink")
("text-decoration-style" "solid" "double" "dotted" "dashed" "wavy")
("text-overflow" "clip" "ellipsis")
("text-shadow" color length)
("text-underline-position" "auto" "under" "left" "right")
("transform" "matrix(,,,,,)" "translate(,)" "translateX()" "translateY()"
"scale()" "scaleX()" "scaleY()" "rotate()" "skewX()" "skewY()" "none")
("transform-origin" perspective-origin)
("transform-style" "flat" "preserve-3d")
("transition" transition-property transition-duration
transition-timing-function transition-delay)
("transition-delay" time)
("transition-duration" time)
("transition-timing-function"
"ease" "linear" "ease-in" "ease-out" "ease-in-out" "cubic-bezier(,,,)")
("transition-property" "none" "all" identifier)
("word-wrap" overflow-wrap)
("word-break" "normal" "break-all" "keep-all"))
"A list of CSS properties and their possible values.")
(defconst company-css-value-classes
'((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large"
"xx-large")
(align-common "flex-start" "flex-end" "center")
(align-stretch align-common "stretch")
(border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove"
"ridge" "inset" "outset")
(border-width "thick" "medium" "thin")
(color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy"
"olive" "orange" "purple" "red" "silver" "teal" "white" "yellow")
(counter "counter(,)")
(family-name "Courier" "Helvetica" "Times")
(generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace")
(generic-voice "male" "female" "child")
(margin-width "auto") ;; length percentage
(relative-size "larger" "smaller")
(shape "rect(,,,)")
(uri "url()"))
"A list of CSS property value classes and their contents.")
;; missing, because not completable
;; <angle><frequency><identifier><integer><length><number><padding-width>
;; <percentage><specific-voice><string><time><uri>
(defconst company-css-html-tags
'("a" "abbr" "acronym" "address" "applet" "area" "b" "base" "basefont" "bdo"
"big" "blockquote" "body" "br" "button" "caption" "center" "cite" "code"
"col" "colgroup" "dd" "del" "dfn" "dir" "div" "dl" "dt" "em" "fieldset"
"font" "form" "frame" "frameset" "h1" "h2" "h3" "h4" "h5" "h6" "head" "hr"
"html" "i" "iframe" "img" "input" "ins" "isindex" "kbd" "label" "legend"
"li" "link" "map" "menu" "meta" "noframes" "noscript" "object" "ol"
"optgroup" "option" "p" "param" "pre" "q" "s" "samp" "script" "select"
"small" "span" "strike" "strong" "style" "sub" "sup" "table" "tbody" "td"
"textarea" "tfoot" "th" "thead" "title" "tr" "tt" "u" "ul" "var"
;; HTML5
"section" "article" "aside" "header" "footer" "nav" "figure" "figcaption"
"time" "mark" "main")
"A list of HTML tags for use in CSS completion.")
(defconst company-css-pseudo-classes
'("active" "after" "before" "first" "first-child" "first-letter" "first-line"
"focus" "hover" "lang" "left" "link" "right" "visited")
"Identifiers for CSS pseudo-elements and pseudo-classes.")
(defconst company-css-property-cache (make-hash-table :size 115 :test 'equal))
(defun company-css-property-values (attribute)
"Access the `company-css-property-alist' cached and flattened."
(or (gethash attribute company-css-property-cache)
(let (results)
(dolist (value (cdr (assoc attribute company-css-property-alist)))
(if (symbolp value)
(dolist (child (or (cdr (assoc value company-css-value-classes))
(company-css-property-values
(symbol-name value))))
(push child results))
(push value results)))
(setq results (sort results 'string<))
(puthash attribute
(if (fboundp 'delete-consecutive-dups)
(delete-consecutive-dups results)
(delete-dups results))
company-css-property-cache)
results)))
;;; bracket detection
(defconst company-css-braces-syntax-table
(let ((table (make-syntax-table)))
(setf (aref table ?{) '(4 . 125))
(setf (aref table ?}) '(5 . 123))
table)
"A syntax table giving { and } paren syntax.")
(defun company-css-inside-braces-p ()
"Return non-nil, if point is within matched { and }."
(ignore-errors
(with-syntax-table company-css-braces-syntax-table
(let ((parse-sexp-ignore-comments t))
(scan-lists (point) -1 1)))))
;;; tags
(defconst company-css-tag-regexp
(concat "\\(?:\\`\\|}\\)[[:space:]]*"
;; multiple
"\\(?:"
;; previous tags:
"\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
;; space or selectors
"\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
"\\)*"
"\\(\\(?:#\\|\\_<[[:alpha:]]\\)\\(?:[[:alnum:]-#]*\\_>\\)?\\_>\\|\\)"
"\\=")
"A regular expression matching CSS tags.")
;;; pseudo id
(defconst company-css-pseudo-regexp
(concat "\\(?:\\`\\|}\\)[[:space:]]*"
;; multiple
"\\(?:"
;; previous tags:
"\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
;; space or delimiters
"\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
"\\)*"
"\\(?:\\(?:\\#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\):"
"\\([[:alpha:]-]+\\_>\\|\\)\\_>\\=")
"A regular expression matching CSS pseudo classes.")
;;; properties
(defun company-css-grab-property ()
"Return the CSS property before point, if any.
Returns \"\" if no property found, but feasible at this position."
(when (company-css-inside-braces-p)
(company-grab-symbol)))
;;; values
(defconst company-css-property-value-regexp
"\\_<\\([[:alpha:]-]+\\):\\(?:[^{};]*[[:space:]]+\\)?\\([^{};]*\\_>\\|\\)\\="
"A regular expression matching CSS tags.")
;;;###autoload
(defun company-css (command &optional arg &rest ignored)
"`company-mode' completion backend for `css-mode'."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-css))
(prefix (and (or (derived-mode-p 'css-mode)
(and (derived-mode-p 'web-mode)
(string= (web-mode-language-at-pos) "css")))
(or (company-grab company-css-tag-regexp 1)
(company-grab company-css-pseudo-regexp 1)
(company-grab company-css-property-value-regexp 2
(line-beginning-position))
(company-css-grab-property))))
(candidates
(cond
((company-grab company-css-tag-regexp 1)
(all-completions arg company-css-html-tags))
((company-grab company-css-pseudo-regexp 1)
(all-completions arg company-css-pseudo-classes))
((company-grab company-css-property-value-regexp 2
(line-beginning-position))
(all-completions arg
(company-css-property-values
(company-grab company-css-property-value-regexp 1))))
((company-css-grab-property)
(all-completions arg company-css-property-alist))))
(sorted t)))
(provide 'company-css)
;;; company-css.el ends here

View File

@@ -1,104 +0,0 @@
;;; company-dabbrev-code.el --- dabbrev-like company-mode backend for code -*- lexical-binding: t -*-
;; Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'company-dabbrev)
(require 'cl-lib)
(defgroup company-dabbrev-code nil
"dabbrev-like completion backend for code."
:group 'company)
(defcustom company-dabbrev-code-modes
'(prog-mode
batch-file-mode csharp-mode css-mode erlang-mode haskell-mode jde-mode
lua-mode python-mode)
"Modes that use `company-dabbrev-code'.
In all these modes (and their derivatives) `company-dabbrev-code' will
complete only symbols, not text in comments or strings. In other modes
`company-dabbrev-code' will pass control to other backends
\(e.g. `company-dabbrev'\). Value t means complete in all modes."
:type '(choice (repeat :tag "Some modes" (symbol :tag "Major mode"))
(const :tag "All modes" t)))
(defcustom company-dabbrev-code-other-buffers t
"Determines whether `company-dabbrev-code' should search other buffers.
If `all', search all other buffers, except the ignored ones. If t, search
buffers with the same major mode. If `code', search all buffers with major
modes in `company-dabbrev-code-modes', or derived from one of them. See
also `company-dabbrev-code-time-limit'."
:type '(choice (const :tag "Off" nil)
(const :tag "Same major mode" t)
(const :tag "Code major modes" code)
(const :tag "All" all)))
(defcustom company-dabbrev-code-time-limit .1
"Determines how long `company-dabbrev-code' should look for matches."
:type '(choice (const :tag "Off" nil)
(number :tag "Seconds")))
(defcustom company-dabbrev-code-everywhere nil
"Non-nil to offer completions in comments and strings."
:type 'boolean)
(defcustom company-dabbrev-code-ignore-case nil
"Non-nil to ignore case when collecting completion candidates."
:type 'boolean)
(defun company-dabbrev-code--make-regexp (prefix)
(concat "\\_<" (if (equal prefix "")
"\\([a-zA-Z]\\|\\s_\\)"
(regexp-quote prefix))
"\\(\\sw\\|\\s_\\)*\\_>"))
;;;###autoload
(defun company-dabbrev-code (command &optional arg &rest ignored)
"dabbrev-like `company-mode' backend for code.
The backend looks for all symbols in the current buffer that aren't in
comments or strings."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-dabbrev-code))
(prefix (and (or (eq t company-dabbrev-code-modes)
(apply #'derived-mode-p company-dabbrev-code-modes))
(or company-dabbrev-code-everywhere
(not (company-in-string-or-comment)))
(or (company-grab-symbol) 'stop)))
(candidates (let ((case-fold-search company-dabbrev-code-ignore-case))
(company-dabbrev--search
(company-dabbrev-code--make-regexp arg)
company-dabbrev-code-time-limit
(pcase company-dabbrev-code-other-buffers
(`t (list major-mode))
(`code company-dabbrev-code-modes)
(`all `all))
(not company-dabbrev-code-everywhere))))
(ignore-case company-dabbrev-code-ignore-case)
(duplicates t)))
(provide 'company-dabbrev-code)
;;; company-dabbrev-code.el ends here

View File

@@ -1,206 +0,0 @@
;;; company-dabbrev.el --- dabbrev-like company-mode completion backend -*- lexical-binding: t -*-
;; Copyright (C) 2009, 2011, 2014, 2015, 2016 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(defgroup company-dabbrev nil
"dabbrev-like completion backend."
:group 'company)
(defcustom company-dabbrev-other-buffers 'all
"Determines whether `company-dabbrev' should search other buffers.
If `all', search all other buffers, except the ignored ones. If t, search
buffers with the same major mode. See also `company-dabbrev-time-limit'."
:type '(choice (const :tag "Off" nil)
(const :tag "Same major mode" t)
(const :tag "All" all)))
(defcustom company-dabbrev-ignore-buffers "\\`[ *]"
"Regexp matching the names of buffers to ignore.
Or a function that returns non-nil for such buffers."
:type '(choice (regexp :tag "Regexp")
(function :tag "Predicate"))
:package-version '(company . "0.9.0"))
(defcustom company-dabbrev-time-limit .1
"Determines how many seconds `company-dabbrev' should look for matches."
:type '(choice (const :tag "Off" nil)
(number :tag "Seconds")))
(defcustom company-dabbrev-char-regexp "\\sw"
"A regular expression matching the characters `company-dabbrev' looks for."
:type 'regexp)
(defcustom company-dabbrev-ignore-case 'keep-prefix
"Non-nil to ignore case when collecting completion candidates.
When it's `keep-prefix', the text before point will remain unchanged after
candidate is inserted, even some of its characters have different case."
:type '(choice
(const :tag "Don't ignore case" nil)
(const :tag "Ignore case" t)
(const :tag "Keep case before point" keep-prefix)))
(defcustom company-dabbrev-downcase 'case-replace
"Whether to downcase the returned candidates.
The value of nil means keep them as-is.
`case-replace' means use the value of `case-replace'.
Any other value means downcase.
If you set this value to nil, you may also want to set
`company-dabbrev-ignore-case' to any value other than `keep-prefix'."
:type '(choice
(const :tag "Keep as-is" nil)
(const :tag "Downcase" t)
(const :tag "Use case-replace" case-replace)))
(defcustom company-dabbrev-minimum-length 4
"The minimum length for the completion candidate to be included.
This variable affects both `company-dabbrev' and `company-dabbrev-code'."
:type 'integer
:package-version '(company . "0.8.3"))
(defcustom company-dabbrev-ignore-invisible nil
"Non-nil to skip invisible text."
:type 'boolean
:package-version '(company . "0.9.0"))
(defmacro company-dabbrev--time-limit-while (test start limit freq &rest body)
(declare (indent 3) (debug t))
`(let ((company-time-limit-while-counter 0))
(catch 'done
(while ,test
,@body
(and ,limit
(= (cl-incf company-time-limit-while-counter) ,freq)
(setq company-time-limit-while-counter 0)
(> (float-time (time-since ,start)) ,limit)
(throw 'done 'company-time-out))))))
(defun company-dabbrev--make-regexp ()
(concat "\\(?:" company-dabbrev-char-regexp "\\)+"))
(defun company-dabbrev--search-buffer (regexp pos symbols start limit
ignore-comments)
(save-excursion
(cl-labels ((maybe-collect-match
()
(let ((match (match-string-no-properties 0)))
(when (and (>= (length match) company-dabbrev-minimum-length)
(not (and company-dabbrev-ignore-invisible
(invisible-p (match-beginning 0)))))
(push match symbols)))))
(goto-char (if pos (1- pos) (point-min)))
;; Search before pos.
(let ((tmp-end (point)))
(company-dabbrev--time-limit-while (and (not (input-pending-p))
(> tmp-end (point-min)))
start limit 1
(ignore-errors
(forward-char -10000))
(forward-line 0)
(save-excursion
;; Before, we used backward search, but it matches non-greedily, and
;; that forced us to use the "beginning/end of word" anchors in
;; `company-dabbrev--make-regexp'. It's also about 2x slower.
(while (and (not (input-pending-p))
(re-search-forward regexp tmp-end t))
(if (and ignore-comments (save-match-data (company-in-string-or-comment)))
(re-search-forward "\\s>\\|\\s!\\|\\s\"" tmp-end t)
(maybe-collect-match))))
(setq tmp-end (point))))
(goto-char (or pos (point-min)))
;; Search after pos.
(company-dabbrev--time-limit-while (and (not (input-pending-p))
(re-search-forward regexp nil t))
start limit 25
(if (and ignore-comments (save-match-data (company-in-string-or-comment)))
(re-search-forward "\\s>\\|\\s!\\|\\s\"" nil t)
(maybe-collect-match)))
symbols)))
(defun company-dabbrev--search (regexp &optional limit other-buffer-modes
ignore-comments)
(let* ((start (current-time))
(symbols (company-dabbrev--search-buffer regexp (point) nil start limit
ignore-comments)))
(when other-buffer-modes
(cl-dolist (buffer (delq (current-buffer) (buffer-list)))
(unless (if (stringp company-dabbrev-ignore-buffers)
(string-match-p company-dabbrev-ignore-buffers
(buffer-name buffer))
(funcall company-dabbrev-ignore-buffers buffer))
(with-current-buffer buffer
(when (or (eq other-buffer-modes 'all)
(apply #'derived-mode-p other-buffer-modes))
(setq symbols
(company-dabbrev--search-buffer regexp nil symbols start
limit ignore-comments)))))
(and limit
(> (float-time (time-since start)) limit)
(cl-return))))
symbols))
(defun company-dabbrev--prefix ()
;; Not in the middle of a word.
(unless (looking-at company-dabbrev-char-regexp)
;; Emacs can't do greedy backward-search.
(company-grab-line (format "\\(?:^\\| \\)[^ ]*?\\(\\(?:%s\\)*\\)"
company-dabbrev-char-regexp)
1)))
(defun company-dabbrev--filter (prefix candidates)
(let ((completion-ignore-case company-dabbrev-ignore-case))
(all-completions prefix candidates)))
;;;###autoload
(defun company-dabbrev (command &optional arg &rest ignored)
"dabbrev-like `company-mode' completion backend."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-dabbrev))
(prefix (company-dabbrev--prefix))
(candidates
(let* ((case-fold-search company-dabbrev-ignore-case)
(words (company-dabbrev--search (company-dabbrev--make-regexp)
company-dabbrev-time-limit
(pcase company-dabbrev-other-buffers
(`t (list major-mode))
(`all `all))))
(downcase-p (if (eq company-dabbrev-downcase 'case-replace)
case-replace
company-dabbrev-downcase)))
(setq words (company-dabbrev--filter arg words))
(if downcase-p
(mapcar 'downcase words)
words)))
(ignore-case company-dabbrev-ignore-case)
(duplicates t)))
(provide 'company-dabbrev)
;;; company-dabbrev.el ends here

View File

@@ -1,186 +0,0 @@
;;; company-eclim.el --- company-mode completion backend for Eclim
;; Copyright (C) 2009, 2011, 2013, 2015 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Using `emacs-eclim' together with (or instead of) this backend is
;; recommended, as it allows you to use other Eclim features.
;;
;; The alternative backend provided by `emacs-eclim' uses `yasnippet'
;; instead of `company-template' to expand function calls, and it supports
;; some languages other than Java.
;;; Code:
(require 'company)
(require 'company-template)
(require 'cl-lib)
(defgroup company-eclim nil
"Completion backend for Eclim."
:group 'company)
(defun company-eclim-executable-find ()
(let (file)
(cl-dolist (eclipse-root '("/Applications/eclipse" "/usr/lib/eclipse"
"/usr/local/lib/eclipse"))
(and (file-exists-p (setq file (expand-file-name "plugins" eclipse-root)))
(setq file (car (last (directory-files file t "^org.eclim_"))))
(file-exists-p (setq file (expand-file-name "bin/eclim" file)))
(cl-return file)))))
(defcustom company-eclim-executable
(or (bound-and-true-p eclim-executable)
(executable-find "eclim")
(company-eclim-executable-find))
"Location of eclim executable."
:type 'file)
(defcustom company-eclim-auto-save t
"Determines whether to save the buffer when retrieving completions.
eclim can only complete correctly when the buffer has been saved."
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar-local company-eclim--project-dir 'unknown)
(defvar-local company-eclim--project-name nil)
(declare-function json-read "json")
(defvar json-array-type)
(defun company-eclim--call-process (&rest args)
(let ((coding-system-for-read 'utf-8)
res)
(require 'json)
(with-temp-buffer
(if (= 0 (setq res (apply 'call-process company-eclim-executable nil t nil
"-command" args)))
(let ((json-array-type 'list))
(goto-char (point-min))
(unless (eobp)
(json-read)))
(message "Company-eclim command failed with error %d:\n%s" res
(buffer-substring (point-min) (point-max)))
nil))))
(defun company-eclim--project-list ()
(company-eclim--call-process "project_list"))
(defun company-eclim--project-dir ()
(if (eq company-eclim--project-dir 'unknown)
(let ((dir (locate-dominating-file buffer-file-name ".project")))
(when dir
(setq company-eclim--project-dir
(directory-file-name
(expand-file-name dir)))))
company-eclim--project-dir))
(defun company-eclim--project-name ()
(or company-eclim--project-name
(let ((dir (company-eclim--project-dir)))
(when dir
(setq company-eclim--project-name
(cl-loop for project in (company-eclim--project-list)
when (equal (cdr (assoc 'path project)) dir)
return (cdr (assoc 'name project))))))))
(defun company-eclim--candidates (prefix)
(interactive "d")
(let ((project-file (file-relative-name buffer-file-name
(company-eclim--project-dir)))
completions)
(when company-eclim-auto-save
(when (buffer-modified-p)
(basic-save-buffer))
;; FIXME: Sometimes this isn't finished when we complete.
(company-eclim--call-process "java_src_update"
"-p" (company-eclim--project-name)
"-f" project-file))
(dolist (item (cdr (assoc 'completions
(company-eclim--call-process
"java_complete" "-p" (company-eclim--project-name)
"-f" project-file
"-o" (number-to-string
(company-eclim--search-point prefix))
"-e" "utf-8"
"-l" "standard"))))
(let* ((meta (cdr (assoc 'info item)))
(completion meta))
(when (string-match " ?[(:-]" completion)
(setq completion (substring completion 0 (match-beginning 0))))
(put-text-property 0 1 'meta meta completion)
(push completion completions)))
(let ((completion-ignore-case nil))
(all-completions prefix completions))))
(defun company-eclim--search-point (prefix)
(if (or (cl-plusp (length prefix)) (eq (char-before) ?.))
(1- (point))
(point)))
(defun company-eclim--meta (candidate)
(get-text-property 0 'meta candidate))
(defun company-eclim--annotation (candidate)
(let ((meta (company-eclim--meta candidate)))
(when (string-match "\\(([^-]*\\) -" meta)
(substring meta (match-beginning 1) (match-end 1)))))
(defun company-eclim--prefix ()
(let ((prefix (company-grab-symbol)))
(when prefix
;; Completion candidates for annotations don't include '@'.
(when (eq ?@ (string-to-char prefix))
(setq prefix (substring prefix 1)))
prefix)))
(defun company-eclim (command &optional arg &rest ignored)
"`company-mode' completion backend for Eclim.
Eclim provides access to Eclipse Java IDE features for other editors.
Eclim version 1.7.13 or newer (?) is required.
Completions only work correctly when the buffer has been saved.
`company-eclim-auto-save' determines whether to do this automatically."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-eclim))
(prefix (and (derived-mode-p 'java-mode 'jde-mode)
buffer-file-name
company-eclim-executable
(company-eclim--project-name)
(not (company-in-string-or-comment))
(or (company-eclim--prefix) 'stop)))
(candidates (company-eclim--candidates arg))
(meta (company-eclim--meta arg))
;; because "" doesn't return everything
(no-cache (equal arg ""))
(annotation (company-eclim--annotation arg))
(post-completion (let ((anno (company-eclim--annotation arg)))
(when anno
(insert anno)
(company-template-c-like-templatify anno))))))
(provide 'company-eclim)
;;; company-eclim.el ends here

View File

@@ -1,226 +0,0 @@
;;; company-elisp.el --- company-mode completion backend for Emacs Lisp -*- lexical-binding: t -*-
;; Copyright (C) 2009, 2011-2013, 2017 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; In newer versions of Emacs, company-capf is used instead.
;;; Code:
(require 'company)
(require 'cl-lib)
(require 'help-mode)
(require 'find-func)
(defgroup company-elisp nil
"Completion backend for Emacs Lisp."
:group 'company)
(defcustom company-elisp-detect-function-context t
"If enabled, offer Lisp functions only in appropriate contexts.
Functions are offered for completion only after ' and \(."
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
(defcustom company-elisp-show-locals-first t
"If enabled, locally bound variables and functions are displayed
first in the candidates list."
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
(defun company-elisp--prefix ()
(let ((prefix (company-grab-symbol)))
(if prefix
(when (if (company-in-string-or-comment)
(= (char-before (- (point) (length prefix))) ?`)
(company-elisp--should-complete))
prefix)
'stop)))
(defun company-elisp--predicate (symbol)
(or (boundp symbol)
(fboundp symbol)
(facep symbol)
(featurep symbol)))
(defun company-elisp--fns-regexp (&rest names)
(concat "\\_<\\(?:cl-\\)?" (regexp-opt names) "\\*?\\_>"))
(defvar company-elisp-parse-limit 30)
(defvar company-elisp-parse-depth 100)
(defvar company-elisp-defun-names '("defun" "defmacro" "defsubst"))
(defvar company-elisp-var-binding-regexp
(apply #'company-elisp--fns-regexp "let" "lambda" "lexical-let"
company-elisp-defun-names)
"Regular expression matching head of a multiple variable bindings form.")
(defvar company-elisp-var-binding-regexp-1
(company-elisp--fns-regexp "dolist" "dotimes")
"Regular expression matching head of a form with one variable binding.")
(defvar company-elisp-fun-binding-regexp
(company-elisp--fns-regexp "flet" "labels")
"Regular expression matching head of a function bindings form.")
(defvar company-elisp-defuns-regexp
(concat "([ \t\n]*"
(apply #'company-elisp--fns-regexp company-elisp-defun-names)))
(defun company-elisp--should-complete ()
(let ((start (point))
(depth (car (syntax-ppss))))
(not
(when (> depth 0)
(save-excursion
(up-list (- depth))
(when (looking-at company-elisp-defuns-regexp)
(forward-char)
(forward-sexp 1)
(unless (= (point) start)
(condition-case nil
(let ((args-end (scan-sexps (point) 2)))
(or (null args-end)
(> args-end start)))
(scan-error
t)))))))))
(defun company-elisp--locals (prefix functions-p)
(let ((regexp (concat "[ \t\n]*\\(\\_<" (regexp-quote prefix)
"\\(?:\\sw\\|\\s_\\)*\\_>\\)"))
(pos (point))
res)
(condition-case nil
(save-excursion
(dotimes (_ company-elisp-parse-depth)
(up-list -1)
(save-excursion
(when (eq (char-after) ?\()
(forward-char 1)
(when (ignore-errors
(save-excursion (forward-list)
(<= (point) pos)))
(skip-chars-forward " \t\n")
(cond
((looking-at (if functions-p
company-elisp-fun-binding-regexp
company-elisp-var-binding-regexp))
(down-list 1)
(condition-case nil
(dotimes (_ company-elisp-parse-limit)
(save-excursion
(when (looking-at "[ \t\n]*(")
(down-list 1))
(when (looking-at regexp)
(cl-pushnew (match-string-no-properties 1) res)))
(forward-sexp))
(scan-error nil)))
((unless functions-p
(looking-at company-elisp-var-binding-regexp-1))
(down-list 1)
(when (looking-at regexp)
(cl-pushnew (match-string-no-properties 1) res)))))))))
(scan-error nil))
res))
(defun company-elisp-candidates (prefix)
(let* ((predicate (company-elisp--candidates-predicate prefix))
(locals (company-elisp--locals prefix (eq predicate 'fboundp)))
(globals (company-elisp--globals prefix predicate))
(locals (cl-loop for local in locals
when (not (member local globals))
collect local)))
(if company-elisp-show-locals-first
(append (sort locals 'string<)
(sort globals 'string<))
(append locals globals))))
(defun company-elisp--globals (prefix predicate)
(all-completions prefix obarray predicate))
(defun company-elisp--candidates-predicate (prefix)
(let* ((completion-ignore-case nil)
(beg (- (point) (length prefix)))
(before (char-before beg)))
(if (and company-elisp-detect-function-context
(not (memq before '(?' ?`))))
(if (and (eq before ?\()
(not
(save-excursion
(ignore-errors
(goto-char (1- beg))
(or (company-elisp--before-binding-varlist-p)
(progn
(up-list -1)
(company-elisp--before-binding-varlist-p)))))))
'fboundp
'boundp)
'company-elisp--predicate)))
(defun company-elisp--before-binding-varlist-p ()
(save-excursion
(and (prog1 (search-backward "(")
(forward-char 1))
(looking-at company-elisp-var-binding-regexp))))
(defun company-elisp--doc (symbol)
(let* ((symbol (intern symbol))
(doc (if (fboundp symbol)
(documentation symbol t)
(documentation-property symbol 'variable-documentation t))))
(and (stringp doc)
(string-match ".*$" doc)
(match-string 0 doc))))
;;;###autoload
(defun company-elisp (command &optional arg &rest ignored)
"`company-mode' completion backend for Emacs Lisp."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-elisp))
(prefix (and (derived-mode-p 'emacs-lisp-mode 'inferior-emacs-lisp-mode)
(company-elisp--prefix)))
(candidates (company-elisp-candidates arg))
(sorted company-elisp-show-locals-first)
(meta (company-elisp--doc arg))
(doc-buffer (let ((symbol (intern arg)))
(save-window-excursion
(ignore-errors
(cond
((fboundp symbol) (describe-function symbol))
((boundp symbol) (describe-variable symbol))
((featurep symbol) (describe-package symbol))
((facep symbol) (describe-face symbol))
(t (signal 'user-error nil)))
(help-buffer)))))
(location (let ((sym (intern arg)))
(cond
((fboundp sym) (find-definition-noselect sym nil))
((boundp sym) (find-definition-noselect sym 'defvar))
((featurep sym) (cons (find-file-noselect (find-library-name
(symbol-name sym)))
0))
((facep sym) (find-definition-noselect sym 'defface)))))))
(provide 'company-elisp)
;;; company-elisp.el ends here

View File

@@ -1,108 +0,0 @@
;;; company-etags.el --- company-mode completion backend for etags
;; Copyright (C) 2009-2011, 2014 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(require 'etags)
(defgroup company-etags nil
"Completion backend for etags."
:group 'company)
(defcustom company-etags-use-main-table-list t
"Always search `tags-table-list' if set.
If this is disabled, `company-etags' will try to find the one table for each
buffer automatically."
:type '(choice (const :tag "off" nil)
(const :tag "on" t)))
(defcustom company-etags-ignore-case nil
"Non-nil to ignore case in completion candidates."
:type 'boolean
:package-version '(company . "0.7.3"))
(defcustom company-etags-everywhere nil
"Non-nil to offer completions in comments and strings.
Set it to t or to a list of major modes."
:type '(choice (const :tag "Off" nil)
(const :tag "Any supported mode" t)
(repeat :tag "Some major modes"
(symbol :tag "Major mode")))
:package-version '(company . "0.9.0"))
(defvar company-etags-modes '(prog-mode c-mode objc-mode c++-mode java-mode
jde-mode pascal-mode perl-mode python-mode))
(defvar-local company-etags-buffer-table 'unknown)
(defun company-etags-find-table ()
(let ((file (expand-file-name
"TAGS"
(locate-dominating-file (or buffer-file-name
default-directory)
"TAGS"))))
(when (and file (file-regular-p file))
(list file))))
(defun company-etags-buffer-table ()
(or (and company-etags-use-main-table-list tags-table-list)
(if (eq company-etags-buffer-table 'unknown)
(setq company-etags-buffer-table (company-etags-find-table))
company-etags-buffer-table)))
(defun company-etags--candidates (prefix)
(let ((tags-table-list (company-etags-buffer-table))
(tags-file-name tags-file-name)
(completion-ignore-case company-etags-ignore-case))
(and (or tags-file-name tags-table-list)
(fboundp 'tags-completion-table)
(save-excursion
(visit-tags-table-buffer)
(all-completions prefix (tags-completion-table))))))
;;;###autoload
(defun company-etags (command &optional arg &rest ignored)
"`company-mode' completion backend for etags."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-etags))
(prefix (and (apply #'derived-mode-p company-etags-modes)
(or (eq t company-etags-everywhere)
(apply #'derived-mode-p company-etags-everywhere)
(not (company-in-string-or-comment)))
(company-etags-buffer-table)
(or (company-grab-symbol) 'stop)))
(candidates (company-etags--candidates arg))
(location (let ((tags-table-list (company-etags-buffer-table)))
(when (fboundp 'find-tag-noselect)
(save-excursion
(let ((buffer (find-tag-noselect arg)))
(cons buffer (with-current-buffer buffer (point))))))))
(ignore-case company-etags-ignore-case)))
(provide 'company-etags)
;;; company-etags.el ends here

View File

@@ -1,148 +0,0 @@
;;; company-files.el --- company-mode completion backend for file names
;; Copyright (C) 2009-2011, 2014-2015 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(defgroup company-files nil
"Completion backend for file names."
:group 'company)
(defcustom company-files-exclusions nil
"File name extensions and directory names to ignore.
The values should use the same format as `completion-ignored-extensions'."
:type '(const string)
:package-version '(company . "0.9.1"))
(defun company-files--directory-files (dir prefix)
;; Don't use directory-files. It produces directories without trailing /.
(condition-case err
(let ((comp (sort (file-name-all-completions prefix dir)
(lambda (s1 s2) (string-lessp (downcase s1) (downcase s2))))))
(when company-files-exclusions
(setq comp (company-files--exclusions-filtered comp)))
(if (equal prefix "")
(delete "../" (delete "./" comp))
comp))
(file-error nil)))
(defun company-files--exclusions-filtered (completions)
(let* ((dir-exclusions (cl-delete-if-not #'company-files--trailing-slash-p
company-files-exclusions))
(file-exclusions (cl-set-difference company-files-exclusions
dir-exclusions)))
(cl-loop for c in completions
unless (if (company-files--trailing-slash-p c)
(member c dir-exclusions)
(cl-find-if (lambda (exclusion)
(string-suffix-p exclusion c))
file-exclusions))
collect c)))
(defvar company-files--regexps
(let* ((root (if (eq system-type 'windows-nt)
"[a-zA-Z]:/"
"/"))
(begin (concat "\\(?:\\.\\{1,2\\}/\\|~/\\|" root "\\)")))
(list (concat "\"\\(" begin "[^\"\n]*\\)")
(concat "\'\\(" begin "[^\'\n]*\\)")
(concat "\\(?:[ \t=]\\|^\\)\\(" begin "[^ \t\n]*\\)"))))
(defun company-files--grab-existing-name ()
;; Grab the file name.
;; When surrounded with quotes, it can include spaces.
(let (file dir)
(and (cl-dolist (regexp company-files--regexps)
(when (setq file (company-grab-line regexp 1))
(cl-return file)))
(company-files--connected-p file)
(setq dir (file-name-directory file))
(not (string-match "//" dir))
(file-exists-p dir)
file)))
(defun company-files--connected-p (file)
(or (not (file-remote-p file))
(file-remote-p file nil t)))
(defun company-files--trailing-slash-p (file)
;; `file-directory-p' is very expensive on remotes. We are relying on
;; `file-name-all-completions' returning directories with trailing / instead.
(let ((len (length file)))
(and (> len 0) (eq (aref file (1- len)) ?/))))
(defvar company-files--completion-cache nil)
(defun company-files--complete (prefix)
(let* ((dir (file-name-directory prefix))
(file (file-name-nondirectory prefix))
(key (list file
(expand-file-name dir)
(nth 5 (file-attributes dir))))
(completion-ignore-case read-file-name-completion-ignore-case))
(unless (company-file--keys-match-p key (car company-files--completion-cache))
(let* ((candidates (mapcar (lambda (f) (concat dir f))
(company-files--directory-files dir file)))
(directories (unless (file-remote-p dir)
(cl-remove-if-not (lambda (f)
(and (company-files--trailing-slash-p f)
(not (file-remote-p f))
(company-files--connected-p f)))
candidates)))
(children (and directories
(cl-mapcan (lambda (d)
(mapcar (lambda (c) (concat d c))
(company-files--directory-files d "")))
directories))))
(setq company-files--completion-cache
(cons key (append candidates children)))))
(all-completions prefix
(cdr company-files--completion-cache))))
(defun company-file--keys-match-p (new old)
(and (equal (cdr old) (cdr new))
(string-prefix-p (car old) (car new))))
;;;###autoload
(defun company-files (command &optional arg &rest ignored)
"`company-mode' completion backend existing file names.
Completions works for proper absolute and relative files paths.
File paths with spaces are only supported inside strings."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-files))
(prefix (company-files--grab-existing-name))
(candidates (company-files--complete arg))
(location (cons (dired-noselect
(file-name-directory (directory-file-name arg))) 1))
(post-completion (when (company-files--trailing-slash-p arg)
(delete-char -1)))
(sorted t)
(no-cache t)))
(provide 'company-files)
;;; company-files.el ends here

View File

@@ -1,117 +0,0 @@
;;; company-gtags.el --- company-mode completion backend for GNU Global
;; Copyright (C) 2009-2011, 2014 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'company-template)
(require 'cl-lib)
(defgroup company-gtags nil
"Completion backend for GNU Global."
:group 'company)
(defcustom company-gtags-executable
(executable-find "global")
"Location of GNU global executable."
:type 'string)
(define-obsolete-variable-alias
'company-gtags-gnu-global-program-name
'company-gtags-executable "earlier")
(defcustom company-gtags-insert-arguments t
"When non-nil, insert function arguments as a template after completion."
:type 'boolean
:package-version '(company . "0.8.1"))
(defvar-local company-gtags--tags-available-p 'unknown)
(defcustom company-gtags-modes '(prog-mode jde-mode)
"Modes that use `company-gtags'.
In all these modes (and their derivatives) `company-gtags' will perform
completion."
:type '(repeat (symbol :tag "Major mode"))
:package-version '(company . "0.8.4"))
(defun company-gtags--tags-available-p ()
(if (eq company-gtags--tags-available-p 'unknown)
(setq company-gtags--tags-available-p
(locate-dominating-file buffer-file-name "GTAGS"))
company-gtags--tags-available-p))
(defun company-gtags--fetch-tags (prefix)
(with-temp-buffer
(let (tags)
(when (= 0 (process-file company-gtags-executable nil
;; "-T" goes through all the tag files listed in GTAGSLIBPATH
(list (current-buffer) nil) nil "-xGqT" (concat "^" prefix)))
(goto-char (point-min))
(cl-loop while
(re-search-forward (concat
"^"
"\\([^ ]*\\)" ;; completion
"[ \t]+\\([[:digit:]]+\\)" ;; linum
"[ \t]+\\([^ \t]+\\)" ;; file
"[ \t]+\\(.*\\)" ;; definition
"$"
) nil t)
collect
(propertize (match-string 1)
'meta (match-string 4)
'location (cons (expand-file-name (match-string 3))
(string-to-number (match-string 2)))
))))))
(defun company-gtags--annotation (arg)
(let ((meta (get-text-property 0 'meta arg)))
(when (string-match (concat arg "\\((.*)\\).*") meta)
(match-string 1 meta))))
;;;###autoload
(defun company-gtags (command &optional arg &rest ignored)
"`company-mode' completion backend for GNU Global."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-gtags))
(prefix (and company-gtags-executable
buffer-file-name
(apply #'derived-mode-p company-gtags-modes)
(not (company-in-string-or-comment))
(company-gtags--tags-available-p)
(or (company-grab-symbol) 'stop)))
(candidates (company-gtags--fetch-tags arg))
(sorted t)
(duplicates t)
(annotation (company-gtags--annotation arg))
(meta (get-text-property 0 'meta arg))
(location (get-text-property 0 'location arg))
(post-completion (let ((anno (company-gtags--annotation arg)))
(when (and company-gtags-insert-arguments anno)
(insert anno)
(company-template-c-like-templatify anno))))))
(provide 'company-gtags)
;;; company-gtags.el ends here

View File

@@ -1,82 +0,0 @@
;;; company-ispell.el --- company-mode completion backend using Ispell
;; Copyright (C) 2009-2011, 2013-2016 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(require 'ispell)
(defgroup company-ispell nil
"Completion backend using Ispell."
:group 'company)
(defcustom company-ispell-dictionary nil
"Dictionary to use for `company-ispell'.
If nil, use `ispell-complete-word-dict'."
:type '(choice (const :tag "default (nil)" nil)
(file :tag "dictionary" t)))
(defvar company-ispell-available 'unknown)
(defalias 'company-ispell--lookup-words
(if (fboundp 'ispell-lookup-words)
'ispell-lookup-words
'lookup-words))
(defun company-ispell-available ()
(when (eq company-ispell-available 'unknown)
(condition-case err
(progn
(company-ispell--lookup-words "WHATEVER")
(setq company-ispell-available t))
(error
(message "Company: ispell-look-command not found")
(setq company-ispell-available nil))))
company-ispell-available)
;;;###autoload
(defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion backend using Ispell."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-ispell))
(prefix (when (company-ispell-available)
(company-grab-word)))
(candidates
(let ((words (company-ispell--lookup-words
arg
(or company-ispell-dictionary ispell-complete-word-dict)))
(completion-ignore-case t))
(if (string= arg "")
;; Small optimization.
words
;; Work around issue #284.
(all-completions arg words))))
(sorted t)
(ignore-case 'keep-prefix)))
(provide 'company-ispell)
;;; company-ispell.el ends here

View File

@@ -1,300 +0,0 @@
;;; company-keywords.el --- A company backend for programming language keywords
;; Copyright (C) 2009-2011, 2016 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(defun company-keywords-upper-lower (&rest lst)
;; Upcase order is different for _.
(nconc (sort (mapcar 'upcase lst) 'string<) lst))
(defvar company-keywords-alist
;; Please contribute corrections or additions.
`((c++-mode
"alignas" "alignof" "asm" "auto" "bool" "break" "case" "catch" "char"
"char16_t" "char32_t" "class" "const" "const_cast" "constexpr" "continue"
"decltype" "default" "delete" "do" "double" "dynamic_cast" "else" "enum"
"explicit" "export" "extern" "false" "final" "float" "for" "friend"
"goto" "if" "inline" "int" "long" "mutable" "namespace" "new" "noexcept"
"nullptr" "operator" "override"
"private" "protected" "public" "register" "reinterpret_cast"
"return" "short" "signed" "sizeof" "static" "static_assert"
"static_cast" "struct" "switch" "template" "this" "thread_local"
"throw" "true" "try" "typedef" "typeid" "typename"
"union" "unsigned" "using" "virtual" "void" "volatile" "wchar_t" "while")
(c-mode
"auto" "break" "case" "char" "const" "continue" "default" "do"
"double" "else" "enum" "extern" "float" "for" "goto" "if" "int" "long"
"register" "return" "short" "signed" "sizeof" "static" "struct"
"switch" "typedef" "union" "unsigned" "void" "volatile" "while")
(csharp-mode
"abstract" "add" "alias" "as" "base" "bool" "break" "byte" "case"
"catch" "char" "checked" "class" "const" "continue" "decimal" "default"
"delegate" "do" "double" "else" "enum" "event" "explicit" "extern"
"false" "finally" "fixed" "float" "for" "foreach" "get" "global" "goto"
"if" "implicit" "in" "int" "interface" "internal" "is" "lock" "long"
"namespace" "new" "null" "object" "operator" "out" "override" "params"
"partial" "private" "protected" "public" "readonly" "ref" "remove"
"return" "sbyte" "sealed" "set" "short" "sizeof" "stackalloc" "static"
"string" "struct" "switch" "this" "throw" "true" "try" "typeof" "uint"
"ulong" "unchecked" "unsafe" "ushort" "using" "value" "var" "virtual"
"void" "volatile" "where" "while" "yield")
(d-mode
;; from http://www.digitalmars.com/d/2.0/lex.html
"abstract" "alias" "align" "asm"
"assert" "auto" "body" "bool" "break" "byte" "case" "cast" "catch"
"cdouble" "cent" "cfloat" "char" "class" "const" "continue" "creal"
"dchar" "debug" "default" "delegate" "delete" "deprecated" "do"
"double" "else" "enum" "export" "extern" "false" "final" "finally"
"float" "for" "foreach" "foreach_reverse" "function" "goto" "idouble"
"if" "ifloat" "import" "in" "inout" "int" "interface" "invariant"
"ireal" "is" "lazy" "long" "macro" "mixin" "module" "new" "nothrow"
"null" "out" "override" "package" "pragma" "private" "protected"
"public" "pure" "real" "ref" "return" "scope" "short" "static" "struct"
"super" "switch" "synchronized" "template" "this" "throw" "true" "try"
"typedef" "typeid" "typeof" "ubyte" "ucent" "uint" "ulong" "union"
"unittest" "ushort" "version" "void" "volatile" "wchar" "while" "with")
(f90-mode .
;; from f90.el
;; ".AND." ".GE." ".GT." ".LT." ".LE." ".NE." ".OR." ".TRUE." ".FALSE."
,(company-keywords-upper-lower
"abs" "abstract" "achar" "acos" "adjustl" "adjustr" "aimag" "aint"
"align" "all" "all_prefix" "all_scatter" "all_suffix" "allocatable"
"allocate" "allocated" "and" "anint" "any" "any_prefix" "any_scatter"
"any_suffix" "asin" "assign" "assignment" "associate" "associated"
"asynchronous" "atan" "atan2" "backspace" "bind" "bit_size" "block"
"btest" "c_alert" "c_associated" "c_backspace" "c_bool"
"c_carriage_return" "c_char" "c_double" "c_double_complex" "c_f_pointer"
"c_f_procpointer" "c_float" "c_float_complex" "c_form_feed" "c_funloc"
"c_funptr" "c_horizontal_tab" "c_int" "c_int16_t" "c_int32_t" "c_int64_t"
"c_int8_t" "c_int_fast16_t" "c_int_fast32_t" "c_int_fast64_t"
"c_int_fast8_t" "c_int_least16_t" "c_int_least32_t" "c_int_least64_t"
"c_int_least8_t" "c_intmax_t" "c_intptr_t" "c_loc" "c_long"
"c_long_double" "c_long_double_complex" "c_long_long" "c_new_line"
"c_null_char" "c_null_funptr" "c_null_ptr" "c_ptr" "c_short"
"c_signed_char" "c_size_t" "c_vertical_tab" "call" "case" "ceiling"
"char" "character" "character_storage_size" "class" "close" "cmplx"
"command_argument_count" "common" "complex" "conjg" "contains" "continue"
"copy_prefix" "copy_scatter" "copy_suffix" "cos" "cosh" "count"
"count_prefix" "count_scatter" "count_suffix" "cpu_time" "cshift"
"cycle" "cyclic" "data" "date_and_time" "dble" "deallocate" "deferred"
"digits" "dim" "dimension" "distribute" "do" "dot_product" "double"
"dprod" "dynamic" "elemental" "else" "elseif" "elsewhere" "end" "enddo"
"endfile" "endif" "entry" "enum" "enumerator" "eoshift" "epsilon" "eq"
"equivalence" "eqv" "error_unit" "exit" "exp" "exponent" "extends"
"extends_type_of" "external" "extrinsic" "false" "file_storage_size"
"final" "floor" "flush" "forall" "format" "fraction" "function" "ge"
"generic" "get_command" "get_command_argument" "get_environment_variable"
"goto" "grade_down" "grade_up" "gt" "hpf_alignment" "hpf_distribution"
"hpf_template" "huge" "iachar" "iall" "iall_prefix" "iall_scatter"
"iall_suffix" "iand" "iany" "iany_prefix" "iany_scatter" "iany_suffix"
"ibclr" "ibits" "ibset" "ichar" "ieee_arithmetic" "ieee_exceptions"
"ieee_features" "ieee_get_underflow_mode" "ieee_set_underflow_mode"
"ieee_support_underflow_control" "ieor" "if" "ilen" "implicit"
"import" "include" "independent" "index" "inherit" "input_unit"
"inquire" "int" "integer" "intent" "interface" "intrinsic" "ior"
"iostat_end" "iostat_eor" "iparity" "iparity_prefix" "iparity_scatter"
"iparity_suffix" "ishft" "ishftc" "iso_c_binding" "iso_fortran_env"
"kind" "lbound" "le" "leadz" "len" "len_trim" "lge" "lgt" "lle" "llt"
"log" "log10" "logical" "lt" "matmul" "max" "maxexponent" "maxloc"
"maxval" "maxval_prefix" "maxval_scatter" "maxval_suffix" "merge"
"min" "minexponent" "minloc" "minval" "minval_prefix" "minval_scatter"
"minval_suffix" "mod" "module" "modulo" "move_alloc" "mvbits" "namelist"
"ne" "nearest" "neqv" "new" "new_line" "nint" "non_intrinsic"
"non_overridable" "none" "nopass" "not" "null" "nullify"
"number_of_processors" "numeric_storage_size" "only" "onto" "open"
"operator" "optional" "or" "output_unit" "pack" "parameter" "parity"
"parity_prefix" "parity_scatter" "parity_suffix" "pass" "pause"
"pointer" "popcnt" "poppar" "precision" "present" "print" "private"
"procedure" "processors" "processors_shape" "product" "product_prefix"
"product_scatter" "product_suffix" "program" "protected" "public"
"pure" "radix" "random_number" "random_seed" "range" "read" "real"
"realign" "recursive" "redistribute" "repeat" "reshape" "result"
"return" "rewind" "rrspacing" "same_type_as" "save" "scale" "scan"
"select" "selected_char_kind" "selected_int_kind" "selected_real_kind"
"sequence" "set_exponent" "shape" "sign" "sin" "sinh" "size" "spacing"
"spread" "sqrt" "stop" "subroutine" "sum" "sum_prefix" "sum_scatter"
"sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then"
"tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpack"
"use" "value" "verify" "volatile" "wait" "where" "while" "with" "write"))
(java-mode
"abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" "class"
"continue" "default" "do" "double" "else" "enum" "extends" "final"
"finally" "float" "for" "if" "implements" "import" "instanceof" "int"
"interface" "long" "native" "new" "package" "private" "protected" "public"
"return" "short" "static" "strictfp" "super" "switch" "synchronized"
"this" "throw" "throws" "transient" "try" "void" "volatile" "while")
(javascript-mode
;; https://tc39.github.io/ecma262/ + async, static and undefined
"async" "await" "break" "case" "catch" "class" "const" "continue"
"debugger" "default" "delete" "do" "else" "enum" "export" "extends" "false"
"finally" "for" "function" "if" "import" "in" "instanceof" "let" "new"
"null" "return" "static" "super" "switch" "this" "throw" "true" "try"
"typeof" "undefined" "var" "void" "while" "with" "yield")
(kotlin-mode
"abstract" "annotation" "as" "break" "by" "catch" "class" "companion"
"const" "constructor" "continue" "data" "do" "else" "enum" "false" "final"
"finally" "for" "fun" "if" "import" "in" "init" "inner" "interface"
"internal" "is" "lateinit" "nested" "null" "object" "open" "out" "override"
"package" "private" "protected" "public" "return" "super" "this" "throw"
"trait" "true" "try" "typealias" "val" "var" "when" "while")
(objc-mode
"@catch" "@class" "@encode" "@end" "@finally" "@implementation"
"@interface" "@private" "@protected" "@protocol" "@public"
"@selector" "@synchronized" "@throw" "@try" "alloc" "autorelease"
"bycopy" "byref" "in" "inout" "oneway" "out" "release" "retain")
(perl-mode
;; from cperl.el
"AUTOLOAD" "BEGIN" "CHECK" "CORE" "DESTROY" "END" "INIT" "__END__"
"__FILE__" "__LINE__" "abs" "accept" "alarm" "and" "atan2" "bind"
"binmode" "bless" "caller" "chdir" "chmod" "chomp" "chop" "chown" "chr"
"chroot" "close" "closedir" "cmp" "connect" "continue" "cos"
"crypt" "dbmclose" "dbmopen" "defined" "delete" "die" "do" "dump" "each"
"else" "elsif" "endgrent" "endhostent" "endnetent" "endprotoent"
"endpwent" "endservent" "eof" "eq" "eval" "exec" "exists" "exit" "exp"
"fcntl" "fileno" "flock" "for" "foreach" "fork" "format" "formline"
"ge" "getc" "getgrent" "getgrgid" "getgrnam" "gethostbyaddr"
"gethostbyname" "gethostent" "getlogin" "getnetbyaddr" "getnetbyname"
"getnetent" "getpeername" "getpgrp" "getppid" "getpriority"
"getprotobyname" "getprotobynumber" "getprotoent" "getpwent" "getpwnam"
"getpwuid" "getservbyname" "getservbyport" "getservent" "getsockname"
"getsockopt" "glob" "gmtime" "goto" "grep" "gt" "hex" "if" "index" "int"
"ioctl" "join" "keys" "kill" "last" "lc" "lcfirst" "le" "length"
"link" "listen" "local" "localtime" "lock" "log" "lstat" "lt" "map"
"mkdir" "msgctl" "msgget" "msgrcv" "msgsnd" "my" "ne" "next" "no"
"not" "oct" "open" "opendir" "or" "ord" "our" "pack" "package" "pipe"
"pop" "pos" "print" "printf" "push" "q" "qq" "quotemeta" "qw" "qx"
"rand" "read" "readdir" "readline" "readlink" "readpipe" "recv" "redo"
"ref" "rename" "require" "reset" "return" "reverse" "rewinddir" "rindex"
"rmdir" "scalar" "seek" "seekdir" "select" "semctl" "semget" "semop"
"send" "setgrent" "sethostent" "setnetent" "setpgrp" "setpriority"
"setprotoent" "setpwent" "setservent" "setsockopt" "shift" "shmctl"
"shmget" "shmread" "shmwrite" "shutdown" "sin" "sleep" "socket"
"socketpair" "sort" "splice" "split" "sprintf" "sqrt" "srand" "stat"
"study" "sub" "substr" "symlink" "syscall" "sysopen" "sysread" "system"
"syswrite" "tell" "telldir" "tie" "time" "times" "tr" "truncate" "uc"
"ucfirst" "umask" "undef" "unless" "unlink" "unpack" "unshift" "untie"
"until" "use" "utime" "values" "vec" "wait" "waitpid"
"wantarray" "warn" "while" "write" "x" "xor" "y")
(php-mode
"__CLASS__" "__DIR__" "__FILE__" "__FUNCTION__" "__LINE__" "__METHOD__"
"__NAMESPACE__" "_once" "abstract" "and" "array" "as" "break" "case"
"catch" "cfunction" "class" "clone" "const" "continue" "declare"
"default" "die" "do" "echo" "else" "elseif" "empty" "enddeclare"
"endfor" "endforeach" "endif" "endswitch" "endwhile" "eval" "exception"
"exit" "extends" "final" "for" "foreach" "function" "global"
"goto" "if" "implements" "include" "instanceof" "interface"
"isset" "list" "namespace" "new" "old_function" "or" "php_user_filter"
"print" "private" "protected" "public" "require" "require_once" "return"
"static" "switch" "this" "throw" "try" "unset" "use" "var" "while" "xor")
(python-mode
;; https://docs.python.org/3/reference/lexical_analysis.html#keywords
"False" "None" "True" "and" "as" "assert" "break" "class" "continue" "def"
"del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if"
"import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "raise"
"return" "try" "while" "with" "yield")
(ruby-mode
"BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "defined?"
"do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
"next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
"then" "true" "undef" "unless" "until" "when" "while" "yield")
;; From https://doc.rust-lang.org/grammar.html#keywords
;; but excluding unused reserved words: https://www.reddit.com/r/rust/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj
(go-mode
"break" "case" "chan" "const" "continue" "default" "defer" "else" "fallthrough"
"for" "func" "go" "goto" "if" "import" "interface" "map" "package" "range"
"return" "select" "struct" "switch" "type" "var")
(rust-mode
"Self"
"as" "box" "break" "const" "continue" "crate" "else" "enum" "extern"
"false" "fn" "for" "if" "impl" "in" "let" "loop" "macro" "match" "mod"
"move" "mut" "pub" "ref" "return" "self" "static" "struct" "super"
"trait" "true" "type" "unsafe" "use" "where" "while")
(scala-mode
"abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
"final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
"new" "null" "object" "override" "package" "private" "protected"
"return" "sealed" "super" "this" "throw" "trait" "true" "try" "type" "val"
"var" "while" "with" "yield")
(swift-mode
"Protocol" "Self" "Type" "and" "as" "assignment" "associatedtype"
"associativity" "available" "break" "case" "catch" "class" "column" "continue"
"convenience" "default" "defer" "deinit" "didSet" "do" "dynamic" "dynamicType"
"else" "elseif" "endif" "enum" "extension" "fallthrough" "false" "file"
"fileprivate" "final" "for" "func" "function" "get" "guard" "higherThan" "if"
"import" "in" "indirect" "infix" "init" "inout" "internal" "is" "lazy" "left"
"let" "line" "lowerThan" "mutating" "nil" "none" "nonmutating" "open"
"operator" "optional" "override" "postfix" "precedence" "precedencegroup"
"prefix" "private" "protocol" "public" "repeat" "required" "rethrows" "return"
"right" "selector" "self" "set" "static" "struct" "subscript" "super" "switch"
"throw" "throws" "true" "try" "typealias" "unowned" "var" "weak" "where"
"while" "willSet")
(julia-mode
"abstract" "break" "case" "catch" "const" "continue" "do" "else" "elseif"
"end" "eval" "export" "false" "finally" "for" "function" "global" "if"
"ifelse" "immutable" "import" "importall" "in" "let" "macro" "module"
"otherwise" "quote" "return" "switch" "throw" "true" "try" "type"
"typealias" "using" "while"
)
;; From https://github.com/apache/thrift/blob/master/contrib/thrift.el
(thrift-mode
"binary" "bool" "byte" "const" "double" "enum" "exception" "extends"
"i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "required"
"service" "set" "string" "struct" "throws" "typedef" "void"
)
;; aliases
(js2-mode . javascript-mode)
(js2-jsx-mode . javascript-mode)
(espresso-mode . javascript-mode)
(js-mode . javascript-mode)
(js-jsx-mode . javascript-mode)
(rjsx-mode . javascript-mode)
(cperl-mode . perl-mode)
(jde-mode . java-mode)
(ess-julia-mode . julia-mode)
(enh-ruby-mode . ruby-mode))
"Alist mapping major-modes to sorted keywords for `company-keywords'.")
;;;###autoload
(defun company-keywords (command &optional arg &rest ignored)
"`company-mode' backend for programming language keywords."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-keywords))
(prefix (and (assq major-mode company-keywords-alist)
(not (company-in-string-or-comment))
(or (company-grab-symbol) 'stop)))
(candidates
(let ((completion-ignore-case nil)
(symbols (cdr (assq major-mode company-keywords-alist))))
(all-completions arg (if (consp symbols)
symbols
(cdr (assq symbols company-keywords-alist))))))
(sorted t)))
(provide 'company-keywords)
;;; company-keywords.el ends here

View File

@@ -1,143 +0,0 @@
;;; company-nxml.el --- company-mode completion backend for nxml-mode
;; Copyright (C) 2009-2011, 2013, 2018 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; In Emacs >= 26, company-capf is used instead.
;;; Code:
(require 'company)
(require 'cl-lib)
(defvar rng-open-elements)
(defvar rng-validate-mode)
(defvar rng-in-attribute-regex)
(defvar rng-in-attribute-value-regex)
(declare-function rng-set-state-after "rng-nxml")
(declare-function rng-match-possible-start-tag-names "rng-match")
(declare-function rng-adjust-state-for-attribute "rng-nxml")
(declare-function rng-match-possible-attribute-names "rng-match")
(declare-function rng-adjust-state-for-attribute-value "rng-nxml")
(declare-function rng-match-possible-value-strings "rng-match")
(defconst company-nxml-token-regexp
"\\(?:[_[:alpha:]][-._[:alnum:]]*\\_>\\)")
(defvar company-nxml-in-attribute-value-regexp
(replace-regexp-in-string "w" company-nxml-token-regexp
"<w\\(?::w\\)?\
\\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
\[ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
\[ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
\\(\"\\([^\"]*\\>\\)\\|'\\([^']*\\>\\)\\)\\="
t t))
(defvar company-nxml-in-tag-name-regexp
(replace-regexp-in-string "w" company-nxml-token-regexp
"<\\(/?w\\(?::w?\\)?\\)?\\=" t t))
(defun company-nxml-all-completions (prefix alist)
(let ((candidates (mapcar 'cdr alist))
(case-fold-search nil)
filtered)
(when (cdar rng-open-elements)
(push (concat "/" (cdar rng-open-elements)) candidates))
(setq candidates (sort (all-completions prefix candidates) 'string<))
(while candidates
(unless (equal (car candidates) (car filtered))
(push (car candidates) filtered))
(pop candidates))
(nreverse filtered)))
(defmacro company-nxml-prepared (&rest body)
(declare (indent 0) (debug t))
`(let ((lt-pos (save-excursion (search-backward "<" nil t)))
xmltok-dtd)
(when (and lt-pos (= (rng-set-state-after lt-pos) lt-pos))
,@body)))
(defun company-nxml-tag (command &optional arg &rest ignored)
(cl-case command
(prefix (and (derived-mode-p 'nxml-mode)
rng-validate-mode
(company-grab company-nxml-in-tag-name-regexp 1)))
(candidates (company-nxml-prepared
(company-nxml-all-completions
arg (rng-match-possible-start-tag-names))))
(sorted t)))
(defun company-nxml-attribute (command &optional arg &rest ignored)
(cl-case command
(prefix (and (derived-mode-p 'nxml-mode)
rng-validate-mode
(memq (char-after) '(?\ ?\t ?\n)) ;; outside word
(company-grab rng-in-attribute-regex 1)))
(candidates (company-nxml-prepared
(and (rng-adjust-state-for-attribute
lt-pos (- (point) (length arg)))
(company-nxml-all-completions
arg (rng-match-possible-attribute-names)))))
(sorted t)))
(defun company-nxml-attribute-value (command &optional arg &rest ignored)
(cl-case command
(prefix (and (derived-mode-p 'nxml-mode)
rng-validate-mode
(and (memq (char-after) '(?' ?\" ?\ ?\t ?\n)) ;; outside word
(looking-back company-nxml-in-attribute-value-regexp nil)
(or (match-string-no-properties 4)
(match-string-no-properties 5)
""))))
(candidates (company-nxml-prepared
(let (attr-start attr-end colon)
(and (looking-back rng-in-attribute-value-regex lt-pos)
(setq colon (match-beginning 2)
attr-start (match-beginning 1)
attr-end (match-end 1))
(rng-adjust-state-for-attribute lt-pos attr-start)
(rng-adjust-state-for-attribute-value
attr-start colon attr-end)
(all-completions
arg (rng-match-possible-value-strings))))))))
;;;###autoload
(defun company-nxml (command &optional arg &rest ignored)
"`company-mode' completion backend for `nxml-mode'."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-nxml))
(prefix (or (company-nxml-tag 'prefix)
(company-nxml-attribute 'prefix)
(company-nxml-attribute-value 'prefix)))
(candidates (cond
((company-nxml-tag 'prefix)
(company-nxml-tag 'candidates arg))
((company-nxml-attribute 'prefix)
(company-nxml-attribute 'candidates arg))
((company-nxml-attribute-value 'prefix)
(sort (company-nxml-attribute-value 'candidates arg)
'string<))))
(sorted t)))
(provide 'company-nxml)
;;; company-nxml.el ends here

View File

@@ -1,57 +0,0 @@
;;; company-oddmuse.el --- company-mode completion backend for oddmuse-mode
;; Copyright (C) 2009-2011, 2014 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(eval-when-compile (require 'yaoddmuse nil t))
(eval-when-compile (require 'oddmuse nil t))
(defvar company-oddmuse-link-regexp
"\\(\\<[A-Z][[:alnum:]]*\\>\\)\\|\\[\\[\\([[:alnum:]]+\\>\\|\\)")
(defun company-oddmuse-get-page-table ()
(cl-case major-mode
(yaoddmuse-mode (with-no-warnings
(yaoddmuse-get-pagename-table yaoddmuse-wikiname)))
(oddmuse-mode (with-no-warnings
(oddmuse-make-completion-table oddmuse-wiki)))))
;;;###autoload
(defun company-oddmuse (command &optional arg &rest ignored)
"`company-mode' completion backend for `oddmuse-mode'."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-oddmuse))
(prefix (let ((case-fold-search nil))
(and (memq major-mode '(oddmuse-mode yaoddmuse-mode))
(looking-back company-oddmuse-link-regexp (point-at-bol))
(or (match-string 1)
(match-string 2)))))
(candidates (all-completions arg (company-oddmuse-get-page-table)))))
(provide 'company-oddmuse)
;;; company-oddmuse.el ends here

View File

@@ -1,8 +0,0 @@
(define-package "company" "20180704.701" "Modular text completion framework"
'((emacs "24.3"))
:keywords
'("abbrev" "convenience" "matching")
:url "http://company-mode.github.io/")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -1,168 +0,0 @@
;;; company-semantic.el --- company-mode completion backend using Semantic
;; Copyright (C) 2009-2011, 2013-2016 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'company-template)
(require 'cl-lib)
(defvar semantic-idle-summary-function)
(declare-function semantic-documentation-for-tag "semantic/doc" )
(declare-function semantic-analyze-current-context "semantic/analyze")
(declare-function semantic-analyze-possible-completions "semantic/complete")
(declare-function semantic-analyze-find-tags-by-prefix "semantic/analyze/fcn")
(declare-function semantic-tag-class "semantic/tag")
(declare-function semantic-tag-name "semantic/tag")
(declare-function semantic-tag-start "semantic/tag")
(declare-function semantic-tag-buffer "semantic/tag")
(declare-function semantic-active-p "semantic")
(declare-function semantic-format-tag-prototype "semantic/format")
(defgroup company-semantic nil
"Completion backend using Semantic."
:group 'company)
(defcustom company-semantic-metadata-function 'company-semantic-summary-and-doc
"The function turning a semantic tag into doc information."
:type 'function)
(defcustom company-semantic-begin-after-member-access t
"When non-nil, automatic completion will start whenever the current
symbol is preceded by \".\", \"->\" or \"::\", ignoring
`company-minimum-prefix-length'.
If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
and `c-electric-colon', for automatic completion right after \">\" and
\":\"."
:type 'boolean)
(defcustom company-semantic-insert-arguments t
"When non-nil, insert function arguments as a template after completion."
:type 'boolean
:package-version '(company . "0.9.0"))
(defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode))
(defvar-local company-semantic--current-tags nil
"Tags for the current context.")
(defun company-semantic-documentation-for-tag (tag)
(when (semantic-tag-buffer tag)
;; When TAG's buffer is unknown, the function below raises an error.
(semantic-documentation-for-tag tag)))
(defun company-semantic-doc-or-summary (tag)
(or (company-semantic-documentation-for-tag tag)
(and (require 'semantic-idle nil t)
(require 'semantic/idle nil t)
(funcall semantic-idle-summary-function tag nil t))))
(defun company-semantic-summary-and-doc (tag)
(let ((doc (company-semantic-documentation-for-tag tag))
(summary (funcall semantic-idle-summary-function tag nil t)))
(and (stringp doc)
(string-match "\n*\\(.*\\)$" doc)
(setq doc (match-string 1 doc)))
(concat summary
(when doc
(if (< (+ (length doc) (length summary) 4) (window-width))
" -- "
"\n"))
doc)))
(defun company-semantic-doc-buffer (tag)
(let ((doc (company-semantic-documentation-for-tag tag)))
(when doc
(company-doc-buffer
(concat (funcall semantic-idle-summary-function tag nil t)
"\n"
doc)))))
(defsubst company-semantic-completions (prefix)
(ignore-errors
(let ((completion-ignore-case nil)
(context (semantic-analyze-current-context)))
(setq company-semantic--current-tags
(semantic-analyze-possible-completions context 'no-unique))
(all-completions prefix company-semantic--current-tags))))
(defun company-semantic-completions-raw (prefix)
(setq company-semantic--current-tags nil)
(dolist (tag (semantic-analyze-find-tags-by-prefix prefix))
(unless (eq (semantic-tag-class tag) 'include)
(push tag company-semantic--current-tags)))
(delete "" (mapcar 'semantic-tag-name company-semantic--current-tags)))
(defun company-semantic-annotation (argument tags)
(let* ((tag (assq argument tags))
(kind (when tag (elt tag 1))))
(cl-case kind
(function (let* ((prototype (semantic-format-tag-prototype tag nil nil))
(par-pos (string-match "(" prototype)))
(when par-pos (substring prototype par-pos)))))))
(defun company-semantic--prefix ()
(if company-semantic-begin-after-member-access
(company-grab-symbol-cons "\\.\\|->\\|::" 2)
(company-grab-symbol)))
;;;###autoload
(defun company-semantic (command &optional arg &rest ignored)
"`company-mode' completion backend using CEDET Semantic."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-semantic))
(prefix (and (featurep 'semantic)
(semantic-active-p)
(memq major-mode company-semantic-modes)
(not (company-in-string-or-comment))
(or (company-semantic--prefix) 'stop)))
(candidates (if (and (equal arg "")
(not (looking-back "->\\|\\.\\|::" (- (point) 2))))
(company-semantic-completions-raw arg)
(company-semantic-completions arg)))
(meta (funcall company-semantic-metadata-function
(assoc arg company-semantic--current-tags)))
(annotation (company-semantic-annotation arg
company-semantic--current-tags))
(doc-buffer (company-semantic-doc-buffer
(assoc arg company-semantic--current-tags)))
;; Because "" is an empty context and doesn't return local variables.
(no-cache (equal arg ""))
(duplicates t)
(location (let ((tag (assoc arg company-semantic--current-tags)))
(when (buffer-live-p (semantic-tag-buffer tag))
(cons (semantic-tag-buffer tag)
(semantic-tag-start tag)))))
(post-completion (let ((anno (company-semantic-annotation
arg company-semantic--current-tags)))
(when (and company-semantic-insert-arguments anno)
(insert anno)
(company-template-c-like-templatify (concat arg anno)))
))))
(provide 'company-semantic)
;;; company-semantic.el ends here

View File

@@ -1,260 +0,0 @@
;;; company-template.el --- utility library for template expansion
;; Copyright (C) 2009, 2010, 2014-2017 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(require 'cl-lib)
(defface company-template-field
'((((background dark)) (:background "yellow" :foreground "black"))
(((background light)) (:background "orange" :foreground "black")))
"Face used for editable text in template fields."
:group 'company)
(defvar company-template-nav-map
(let ((keymap (make-sparse-keymap)))
(define-key keymap [tab] 'company-template-forward-field)
(define-key keymap (kbd "TAB") 'company-template-forward-field)
keymap))
(defvar company-template-field-map
(let ((keymap (make-sparse-keymap)))
(set-keymap-parent keymap company-template-nav-map)
(define-key keymap (kbd "C-d") 'company-template-clear-field)
keymap))
(defvar-local company-template--buffer-templates nil)
;; interactive ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-template-templates-at (pos)
(let (os)
(dolist (o (overlays-at pos))
;; FIXME: Always return the whole list of templates?
;; We remove templates not at point after every command.
(when (memq o company-template--buffer-templates)
(push o os)))
os))
(defun company-template-move-to-first (templ)
(interactive)
(goto-char (overlay-start templ))
(company-template-forward-field))
(defun company-template-forward-field ()
(interactive)
(let ((start (point))
(next-field-start (company-template-find-next-field)))
(push-mark)
(goto-char next-field-start)
(company-template-remove-field (company-template-field-at start))))
(defun company-template-clear-field ()
"Clear the field at point."
(interactive)
(let ((ovl (company-template-field-at (point))))
(when ovl
(company-template-remove-field ovl t)
(let ((after-clear-fn
(overlay-get ovl 'company-template-after-clear)))
(when (functionp after-clear-fn)
(funcall after-clear-fn))))))
(defun company-template--after-clear-c-like-field ()
"Function that can be called after deleting a field of a c-like template.
For c-like templates it is set as `after-post-fn' property on fields in
`company-template-add-field'. If there is a next field, delete everything
from point to it. If there is no field after point, remove preceding comma
if present."
(let* ((pos (point))
(next-field-start (company-template-find-next-field))
(last-field-p (not (company-template-field-at next-field-start))))
(cond ((and (not last-field-p)
(< pos next-field-start)
(string-match "^[ ]*,+[ ]*$" (buffer-substring-no-properties
pos next-field-start)))
(delete-region pos next-field-start))
((and last-field-p
(looking-back ",+[ ]*" (line-beginning-position)))
(delete-region (match-beginning 0) pos)))))
(defun company-template-find-next-field ()
(let* ((start (point))
(templates (company-template-templates-at start))
(minimum (apply 'max (mapcar 'overlay-end templates)))
(fields (cl-loop for templ in templates
append (overlay-get templ 'company-template-fields))))
(dolist (pos (mapcar 'overlay-start fields) minimum)
(and pos
(> pos start)
(< pos minimum)
(setq minimum pos)))))
(defun company-template-field-at (&optional point)
(cl-loop for ovl in (overlays-at (or point (point)))
when (overlay-get ovl 'company-template-parent)
return ovl))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-template-declare-template (beg end)
(let ((ov (make-overlay beg end)))
;; (overlay-put ov 'face 'highlight)
(overlay-put ov 'keymap company-template-nav-map)
(overlay-put ov 'priority 101)
(overlay-put ov 'evaporate t)
(push ov company-template--buffer-templates)
(add-hook 'post-command-hook 'company-template-post-command nil t)
ov))
(defun company-template-remove-template (templ)
(mapc 'company-template-remove-field
(overlay-get templ 'company-template-fields))
(setq company-template--buffer-templates
(delq templ company-template--buffer-templates))
(delete-overlay templ))
(defun company-template-add-field (templ beg end &optional display after-clear-fn)
"Add new field to template TEMPL spanning from BEG to END.
When DISPLAY is non-nil, set the respective property on the overlay.
Leave point at the end of the field.
AFTER-CLEAR-FN is a function that can be used to apply custom behavior
after deleting a field in `company-template-remove-field'."
(cl-assert templ)
(when (> end (overlay-end templ))
(move-overlay templ (overlay-start templ) end))
(let ((ov (make-overlay beg end))
(siblings (overlay-get templ 'company-template-fields)))
;; (overlay-put ov 'evaporate t)
(overlay-put ov 'intangible t)
(overlay-put ov 'face 'company-template-field)
(when display
(overlay-put ov 'display display))
(overlay-put ov 'company-template-parent templ)
(overlay-put ov 'insert-in-front-hooks '(company-template-insert-hook))
(when after-clear-fn
(overlay-put ov 'company-template-after-clear after-clear-fn))
(overlay-put ov 'keymap company-template-field-map)
(overlay-put ov 'priority 101)
(push ov siblings)
(overlay-put templ 'company-template-fields siblings)))
(defun company-template-remove-field (ovl &optional clear)
(when (overlayp ovl)
(when (overlay-buffer ovl)
(when clear
(delete-region (overlay-start ovl) (overlay-end ovl)))
(delete-overlay ovl))
(let* ((templ (overlay-get ovl 'company-template-parent))
(siblings (overlay-get templ 'company-template-fields)))
(setq siblings (delq ovl siblings))
(overlay-put templ 'company-template-fields siblings))))
(defun company-template-clean-up (&optional pos)
"Clean up all templates that don't contain POS."
(let ((local-ovs (overlays-at (or pos (point)))))
(dolist (templ company-template--buffer-templates)
(unless (memq templ local-ovs)
(company-template-remove-template templ)))))
;; hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-template-insert-hook (ovl after-p &rest _ignore)
"Called when a snippet input prompt is modified."
(unless after-p
(company-template-remove-field ovl t)))
(defun company-template-post-command ()
(company-template-clean-up)
(unless company-template--buffer-templates
(remove-hook 'post-command-hook 'company-template-post-command t)))
;; common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-template-c-like-templatify (call)
(let* ((end (point-marker))
(beg (- (point) (length call)))
(templ (company-template-declare-template beg end))
paren-open paren-close)
(with-syntax-table (make-syntax-table (syntax-table))
(modify-syntax-entry ?< "(")
(modify-syntax-entry ?> ")")
(when (search-backward ")" beg t)
(setq paren-close (point-marker))
(forward-char 1)
(delete-region (point) end)
(backward-sexp)
(forward-char 1)
(setq paren-open (point-marker)))
(when (search-backward ">" beg t)
(let ((angle-close (point-marker)))
(forward-char 1)
(backward-sexp)
(forward-char)
(company-template--c-like-args templ angle-close)))
(when (looking-back "\\((\\*)\\)(" (line-beginning-position))
(delete-region (match-beginning 1) (match-end 1)))
(when paren-open
(goto-char paren-open)
(company-template--c-like-args templ paren-close)))
(if (overlay-get templ 'company-template-fields)
(company-template-move-to-first templ)
(company-template-remove-template templ)
(goto-char end))))
(defun company-template--c-like-args (templ end)
(let ((last-pos (point)))
(while (re-search-forward "\\([^,]+\\),?" end 'move)
(when (zerop (car (parse-partial-sexp last-pos (point))))
(company-template-add-field templ last-pos (match-end 1) nil
#'company-template--after-clear-c-like-field)
(skip-chars-forward " ")
(setq last-pos (point))))))
;; objc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-template-objc-templatify (selector)
(let* ((end (point-marker))
(beg (- (point) (length selector) 1))
(templ (company-template-declare-template beg end))
(cnt 0))
(save-excursion
(goto-char beg)
(catch 'stop
(while (search-forward ":" end t)
(if (looking-at "\\(([^)]*)\\) ?")
(company-template-add-field templ (point) (match-end 1))
;; Not sure which conditions this case manifests under, but
;; apparently it did before, when I wrote the first test for this
;; function. FIXME: Revisit it.
(company-template-add-field templ (point)
(progn
(insert (format "arg%d" cnt))
(point)))
(when (< (point) end)
(insert " "))
(cl-incf cnt))
(when (>= (point) end)
(throw 'stop t)))))
(company-template-move-to-first templ)))
(provide 'company-template)
;;; company-template.el ends here

View File

@@ -1,71 +0,0 @@
;;; company-tempo.el --- company-mode completion backend for tempo
;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(require 'tempo)
(defgroup company-tempo nil
"Tempo completion backend."
:group 'company)
(defcustom company-tempo-expand nil
"Whether to expand a tempo tag after completion."
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
(defsubst company-tempo-lookup (match)
(cdr (assoc match (tempo-build-collection))))
(defun company-tempo-insert (match)
"Replace MATCH with the expanded tempo template."
(search-backward match)
(goto-char (match-beginning 0))
(replace-match "")
(call-interactively (company-tempo-lookup match)))
(defsubst company-tempo-meta (match)
(let ((templ (company-tempo-lookup match))
doc)
(and templ
(setq doc (documentation templ t))
(car (split-string doc "\n" t)))))
;;;###autoload
(defun company-tempo (command &optional arg &rest ignored)
"`company-mode' completion backend for tempo."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-tempo))
(prefix (or (car (tempo-find-match-string tempo-match-finder)) ""))
(candidates (all-completions arg (tempo-build-collection)))
(meta (company-tempo-meta arg))
(post-completion (when company-tempo-expand (company-tempo-insert arg)))
(sorted t)))
(provide 'company-tempo)
;;; company-tempo.el ends here

View File

@@ -1,174 +0,0 @@
;;; company-tng.el --- company-mode configuration for single-button interaction
;; Copyright (C) 2017 Free Software Foundation, Inc.
;; Author: Nikita Leshenko
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; company-tng (Tab and Go) allows you to perform completion using just TAB.
;; Pressing it will both select the next completion candidate in the list and
;; insert it into the buffer (or make it look like it's inserted, in fact).
;;
;; It cycles the candidates like `yank-pop' or `dabbrev-expand' or Vim:
;; Pressing TAB selects the first item in the completion menu and inserts it in
;; the buffer. Pressing TAB again selects the second item and replaces the
;; "inserted" item with the second one. This can continue as long as the user
;; wishes to cycle through the menu. You can also press S-TAB to select the
;; previous candidate, of course.
;;
;; The benefits are that you only have to use one shortcut key and there is no
;; need to confirm the entry.
;;
;; Usage:
;;
;; To apply the default configuration for company-tng call
;; `company-tng-configure-default' from your init script.
;;
;; You can also configure company-tng manually:
;;
;; Add `company-tng-frontend' to `company-frontends':
;;
;; (add-to-list 'company-frontends 'company-tng-frontend)
;;
;; We recommend to bind TAB to `company-select-next', S-TAB to
;; `company-select-previous', and unbind RET and other now-unnecessary
;; keys from `company-active-map':
;;
;; (define-key company-active-map (kbd "TAB") 'company-select-next)
;; (define-key company-active-map (kbd "<backtab>") 'company-select-previous)
;; (define-key company-active-map (kbd "RET") nil)
;;
;; Note that it's not necessary to rebind keys to use this frontend,
;; you can use the arrow keys or M-n/M-p to select and insert
;; candidates. You also need to decide which keys to unbind, depending
;; on whether you want them to do the Company action or the default
;; Emacs action (for example C-s or C-w).
;;
;; We recommend to disable `company-require-match' to allow free typing at any
;; point.
;;; Code:
(require 'company)
(require 'cl-lib)
(defvar-local company-tng--overlay nil)
;;;###autoload
(defun company-tng-frontend (command)
"When the user changes the selection at least once, this
frontend will display the candidate in the buffer as if it's
already there and any key outside of `company-active-map' will
confirm the selection and finish the completion."
(cl-case command
(show
(let ((ov (make-overlay (point) (point))))
(setq company-tng--overlay ov)
(overlay-put ov 'priority 2))
(advice-add 'company-select-next :before-until 'company-tng--allow-unselected)
(advice-add 'company-fill-propertize :filter-args 'company-tng--adjust-tooltip-highlight))
(update
(let ((ov company-tng--overlay)
(selected (nth company-selection company-candidates))
(prefix (length company-prefix)))
(move-overlay ov (- (point) prefix) (point))
(overlay-put ov
(if (= prefix 0) 'after-string 'display)
(and company-selection-changed selected))))
(hide
(when company-tng--overlay
(delete-overlay company-tng--overlay)
(kill-local-variable 'company-tng--overlay))
(advice-remove 'company-select-next 'company-tng--allow-unselected)
(advice-remove 'company-fill-propertize 'company-tng--adjust-tooltip-highlight))
(pre-command
(when (and company-selection-changed
(not (company--company-command-p (this-command-keys))))
(company--unread-this-command-keys)
(setq this-command 'company-complete-selection)
(advice-add 'company-call-backend :before-until 'company-tng--supress-post-completion)))))
;;;###autoload
(defun company-tng-configure-default ()
"Applies the default configuration to enable company-tng."
(setq company-require-match nil)
(setq company-frontends '(company-tng-frontend
company-pseudo-tooltip-frontend
company-echo-metadata-frontend))
(let ((keymap company-active-map))
(define-key keymap [return] nil)
(define-key keymap (kbd "RET") nil)
(define-key keymap [tab] 'company-select-next)
(define-key keymap (kbd "TAB") 'company-select-next)
(define-key keymap [backtab] 'company-select-previous)
(define-key keymap (kbd "S-TAB") 'company-select-previous)))
(defun company-tng--allow-unselected (&optional arg)
"Advice `company-select-next' to allow for an 'unselected'
state. Unselected means that no user interaction took place on the
completion candidates and it's marked by setting
`company-selection-changed' to nil. This advice will call the underlying
`company-select-next' unless we need to transition to or from an unselected
state.
Possible state transitions:
- (arg > 0) unselected -> first candidate selected
- (arg < 0) first candidate selected -> unselected
- (arg < 0 wrap-round) unselected -> last candidate selected
- (arg < 0 no wrap-round) unselected -> unselected
There is no need to advice `company-select-previous' because it calls
`company-select-next' internally."
(cond
;; Selecting next
((or (not arg) (> arg 0))
(unless company-selection-changed
(company-set-selection (1- (or arg 1)) 'force-update)
t))
;; Selecting previous
((< arg 0)
(when (and company-selection-changed
(< (+ company-selection arg) 0))
(company-set-selection 0)
(setq company-selection-changed nil)
(company-call-frontends 'update)
t)
)))
(defun company-tng--adjust-tooltip-highlight (args)
"Prevent the tooltip from highlighting the current selection if it wasn't
made explicitly (i.e. `company-selection-changed' is true)"
(unless company-selection-changed
;; The 4th arg of `company-fill-propertize' is selected
(setf (nth 3 args) nil))
args)
(defun company-tng--supress-post-completion (command &rest args)
"Installed as a :before-until advice on `company-call-backend' and
prevents the 'post-completion command from being delivered to the backend
for the next iteration. post-completion do things like expand snippets
which are undesirable because completions are implicit in company-tng and
visible side-effects after the completion are surprising."
(when (eq command 'post-completion)
(advice-remove 'company-call-backend 'company-tng--supress-post-completion)
t))
(provide 'company-tng)
;;; company-tng.el ends here

View File

@@ -1,123 +0,0 @@
;;; company-xcode.el --- company-mode completion backend for Xcode projects
;; Copyright (C) 2009-2011, 2014 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(defgroup company-xcode nil
"Completion backend for Xcode projects."
:group 'company)
(defcustom company-xcode-xcodeindex-executable (executable-find "xcodeindex")
"Location of xcodeindex executable."
:type 'file)
(defvar company-xcode-tags nil)
(defun company-xcode-reset ()
"Reset the cached tags."
(interactive)
(setq company-xcode-tags nil))
(defcustom company-xcode-types
'("Class" "Constant" "Enum" "Macro" "Modeled Class" "Structure"
"Type" "Union" "Function")
"The types of symbols offered by `company-xcode'.
No context-enabled completion is available. Types like methods will be
offered regardless of whether the class supports them. The defaults should be
valid in most contexts."
:set (lambda (variable value)
(set variable value)
(company-xcode-reset))
:type '(set (const "Category") (const "Class") (const "Class Method")
(const "Class Variable") (const "Constant") (const "Enum")
(const "Field") (const "Instance Method")
(const "Instance Variable") (const "Macro")
(const "Modeled Class") (const "Modeled Method")
(const "Modeled Property") (const "Property") (const "Protocol")
(const "Structure") (const "Type") (const "Union")
(const "Variable") (const "Function")))
(defvar-local company-xcode-project 'unknown)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun company-xcode-fetch (project-bundle)
(setq project-bundle (directory-file-name project-bundle))
(message "Retrieving dump from %s..." project-bundle)
(with-temp-buffer
(let ((default-directory (file-name-directory project-bundle)))
(call-process company-xcode-xcodeindex-executable nil (current-buffer)
nil "dump" "-project"
(file-name-nondirectory project-bundle) "-quiet")
(goto-char (point-min))
(let ((regexp (concat "^\\([^\t\n]*\\)\t[^\t\n]*\t"
(regexp-opt company-xcode-types)
"\t[^\t\n]*\t[^\t\n]*"))
candidates)
(while (re-search-forward regexp nil t)
(cl-pushnew (match-string 1) candidates :test #'equal))
(message "Retrieving dump from %s...done" project-bundle)
candidates))))
(defun company-xcode-find-project ()
(let ((dir (if buffer-file-name
(file-name-directory buffer-file-name)
(expand-file-name default-directory)))
(prev-dir nil)
file)
(while (not (or file (equal dir prev-dir)))
(setq file (car (directory-files dir t ".xcodeproj\\'" t))
prev-dir dir
dir (file-name-directory (directory-file-name dir))))
file))
(defun company-xcode-tags ()
(when (eq company-xcode-project 'unknown)
(setq company-xcode-project (company-xcode-find-project)))
(when company-xcode-project
(cdr (or (assoc company-xcode-project company-xcode-tags)
(car (push (cons company-xcode-project
(company-xcode-fetch company-xcode-project))
company-xcode-tags))))))
;;;###autoload
(defun company-xcode (command &optional arg &rest ignored)
"`company-mode' completion backend for Xcode projects."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-xcode))
(prefix (and company-xcode-xcodeindex-executable
(company-xcode-tags)
(not (company-in-string-or-comment))
(or (company-grab-symbol) 'stop)))
(candidates (let ((completion-ignore-case nil))
(company-xcode-tags)
(all-completions arg (company-xcode-tags))))))
(provide 'company-xcode)
;;; company-xcode.el ends here

View File

@@ -1,147 +0,0 @@
;;; company-yasnippet.el --- company-mode completion backend for Yasnippet
;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
;; Author: Dmitry Gutov
;; This file is part of GNU Emacs.
;; GNU Emacs 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.
;; GNU Emacs 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'company)
(require 'cl-lib)
(declare-function yas--table-hash "yasnippet")
(declare-function yas--get-snippet-tables "yasnippet")
(declare-function yas-expand-snippet "yasnippet")
(declare-function yas--template-content "yasnippet")
(declare-function yas--template-expand-env "yasnippet")
(declare-function yas--warning "yasnippet")
(defun company-yasnippet--key-prefixes ()
;; Mostly copied from `yas--templates-for-key-at-point'.
(defvar yas-key-syntaxes)
(save-excursion
(let ((original (point))
(methods yas-key-syntaxes)
prefixes
method)
(while methods
(unless (eq method (car methods))
(goto-char original))
(setq method (car methods))
(cond ((stringp method)
(skip-syntax-backward method)
(setq methods (cdr methods)))
((functionp method)
(unless (eq (funcall method original)
'again)
(setq methods (cdr methods))))
(t
(setq methods (cdr methods))
(yas--warning "Invalid element `%s' in `yas-key-syntaxes'" method)))
(let ((prefix (buffer-substring-no-properties (point) original)))
(unless (equal prefix (car prefixes))
(push prefix prefixes))))
prefixes)))
(defun company-yasnippet--candidates (prefix)
;; Process the prefixes in reverse: unlike Yasnippet, we look for prefix
;; matches, so the longest prefix with any matches should be the most useful.
(cl-loop with tables = (yas--get-snippet-tables)
for key-prefix in (company-yasnippet--key-prefixes)
;; Only consider keys at least as long as the symbol at point.
when (>= (length key-prefix) (length prefix))
thereis (company-yasnippet--completions-for-prefix prefix
key-prefix
tables)))
(defun company-yasnippet--completions-for-prefix (prefix key-prefix tables)
(cl-mapcan
(lambda (table)
(let ((keyhash (yas--table-hash table))
res)
(when keyhash
(maphash
(lambda (key value)
(when (and (stringp key)
(string-prefix-p key-prefix key))
(maphash
(lambda (name template)
(push
(propertize key
'yas-annotation name
'yas-template template
'yas-prefix-offset (- (length key-prefix)
(length prefix)))
res))
value)))
keyhash))
res))
tables))
;;;###autoload
(defun company-yasnippet (command &optional arg &rest ignore)
"`company-mode' backend for `yasnippet'.
This backend should be used with care, because as long as there are
snippets defined for the current major mode, this backend will always
shadow backends that come after it. Recommended usages:
* In a buffer-local value of `company-backends', grouped with a backend or
several that provide actual text completions.
(add-hook 'js-mode-hook
(lambda ()
(set (make-local-variable 'company-backends)
'((company-dabbrev-code company-yasnippet)))))
* After keyword `:with', grouped with other backends.
(push '(company-semantic :with company-yasnippet) company-backends)
* Not in `company-backends', just bound to a key.
(global-set-key (kbd \"C-c y\") 'company-yasnippet)
"
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-yasnippet))
(prefix
;; Should probably use `yas--current-key', but that's bound to be slower.
;; How many trigger keys start with non-symbol characters anyway?
(and (bound-and-true-p yas-minor-mode)
(company-grab-symbol)))
(annotation
(concat
(unless company-tooltip-align-annotations " -> ")
(get-text-property 0 'yas-annotation arg)))
(candidates (company-yasnippet--candidates arg))
(no-cache t)
(post-completion
(let ((template (get-text-property 0 'yas-template arg))
(prefix-offset (get-text-property 0 'yas-prefix-offset arg)))
(yas-expand-snippet (yas--template-content template)
(- (point) (length arg) prefix-offset)
(point)
(yas--template-expand-env template))))))
(provide 'company-yasnippet)
;;; company-yasnippet.el ends here

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +0,0 @@
;;; company-tern-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "company-tern" "company-tern.el" (23216 11576
;;;;;; 45153 912000))
;;; Generated autoloads from company-tern.el
(autoload 'company-tern "company-tern" "\
Tern backend for company-mode.
See `company-backends' for more info about COMMAND and ARG.
\(fn COMMAND &optional ARG &rest ARGS)" t nil)
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; company-tern-autoloads.el ends here

View File

@@ -1,2 +0,0 @@
;;; -*- no-byte-compile: t -*-
(define-package "company-tern" "20161004.1147" "Tern backend for company-mode" '((company "0.8.0") (tern "0.0.1") (dash "2.8.0") (dash-functional "2.8.0") (s "1.9.0") (cl-lib "0.5.0")) :commit "10ac058b065ae73c1f30e9fb7d969dd1a79387be" :url "https://github.com/proofit404/company-tern")

View File

@@ -1,172 +0,0 @@
;;; company-tern.el --- Tern backend for company-mode -*- lexical-binding: t -*-
;; Copyright (C) 2013-2016 by Artem Malyshev
;; Author: Artem Malyshev <proofit404@gmail.com>
;; URL: https://github.com/proofit404/company-tern
;; Package-Version: 20161004.1147
;; Version: 0.3.0
;; Package-Requires: ((company "0.8.0") (tern "0.0.1") (dash "2.8.0") (dash-functional "2.8.0") (s "1.9.0") (cl-lib "0.5.0"))
;; 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:
;; See the README for more details.
;;; Code:
(require 'cl-lib)
(require 'company)
(require 'tern)
(require 'dash)
(require 'dash-functional)
(require 's)
(defgroup company-tern nil
"Tern backend for company-mode"
:group 'languages
:prefix "company-tern-")
(defcustom company-tern-property-marker ""
"A string to indicate an object's own properties.
This also can be nil to disable property markers."
:type '(choice (string :tag "Property suffix")
(const :tag "None" nil))
:group 'company-tern)
(defcustom company-tern-meta-as-single-line nil
"Trim candidate type information to frame width?"
:type 'boolean
:group 'company-tern)
(defun company-tern-prefix ()
"Grab prefix for tern."
(and tern-mode
(not (company-in-string-or-comment))
(or (company-grab-symbol-cons "\\." 1)
'stop)))
(defun company-tern-candidates-query (prefix callback)
"Retrieve PREFIX completion candidates from tern.
Use CALLBACK function to display candidates."
(tern-run-query
(lambda (data)
(funcall callback
(company-tern-sort-by-depth
(company-tern-format-candidates data))))
'((type . "completions")
(includeKeywords . t)
(depths . t)
(types . t)
(docs . t))
(point)))
(defun company-tern-format-candidates (data)
"Grab candidates with properties from tern DATA."
(let ((completions (cdr (assq 'completions data)))
(property-p (assq 'isProperty data)))
(mapcar
(lambda (completion)
(let ((candidate (cdr (assq 'name completion))))
(dolist (prop (push property-p completion))
(put-text-property 0 1 (car prop) (cdr prop) candidate))
candidate))
completions)))
(defun company-tern-sort-by-depth (candidates)
"Sort CANDIDATES list by completion depth."
(-sort (-on '< 'company-tern-depth) candidates))
(defun company-tern-depth (candidate)
"Return depth attribute for CANDIDATE."
(get-text-property 0 'depth candidate))
(defun company-tern-property-p (candidate)
"Return t if CANDIDATE is object own property."
(and (null (eq json-false (get-text-property 0 'isProperty candidate)))
(eq 0 (company-tern-depth candidate))))
(defun company-tern-keyword-p (candidate)
"Return t if CANDIDATE is a keyword."
(get-text-property 0 'isKeyword candidate))
(defun company-tern-function-p (candidate)
"Return t if CANDIDATE is a function."
(--when-let (get-text-property 0 'type candidate)
(s-starts-with? "fn(" it)))
(defun company-tern-doc (candidate)
"Return documentation buffer for CANDIDATE."
(--when-let (get-text-property 0 'doc candidate)
(company-doc-buffer it)))
(defun company-tern-meta (candidate)
"Return short documentation string for chosen CANDIDATE."
(--when-let (get-text-property 0 'type candidate)
(if company-tern-meta-as-single-line
(s-left (frame-width) it)
it)))
(defun company-tern-annotation (candidate)
"Return type annotation for chosen CANDIDATE."
(--when-let (company-tern-get-type candidate)
(concat it (and (company-tern-property-p candidate)
company-tern-property-marker))))
(defun company-tern-get-type (candidate)
"Analyze CANDIDATE type."
(unless (company-tern-keyword-p candidate)
(if (company-tern-function-p candidate)
(company-tern-function-type candidate)
(company-tern-variable-type candidate))))
(defun company-tern-function-type (candidate)
"Get CANDIDATE type as a function."
(-when-let* ((type (get-text-property 0 'type candidate))
(annot (if company-tooltip-align-annotations "fn(%s)" "(%s)")))
(->> (list (cons 'type type))
(tern-parse-function-type)
(cadr)
(--map (car it))
(-interpose ", ")
(apply 'concat)
(format annot))))
(defun company-tern-variable-type (candidate)
"Get CANDIDATE type as a variable."
(-when-let* ((type (get-text-property 0 'type candidate))
(annot (if company-tooltip-align-annotations "%s" " -> %s")))
(format annot type)))
;;;###autoload
(defun company-tern (command &optional arg &rest _args)
"Tern backend for company-mode.
See `company-backends' for more info about COMMAND and ARG."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-tern))
(prefix (company-tern-prefix))
(annotation (company-tern-annotation arg))
(meta (company-tern-meta arg))
(doc-buffer (company-tern-doc arg))
(ignore-case t)
(sorted t)
(candidates (cons :async
(lambda (callback)
(company-tern-candidates-query arg callback))))))
(provide 'company-tern)
;;; company-tern.el ends here

View File

@@ -1,435 +0,0 @@
;;; counsel-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "counsel" "counsel.el" (0 0 0 0))
;;; Generated autoloads from counsel.el
(autoload 'counsel-el "counsel" "\
Elisp completion at point.
\(fn)" t nil)
(autoload 'counsel-cl "counsel" "\
Common Lisp completion at point.
\(fn)" t nil)
(autoload 'counsel-clj "counsel" "\
Clojure completion at point.
\(fn)" t nil)
(autoload 'counsel-company "counsel" "\
Complete using `company-candidates'.
\(fn)" t nil)
(autoload 'counsel-irony "counsel" "\
Inline C/C++ completion using Irony.
\(fn)" t nil)
(autoload 'counsel-describe-variable "counsel" "\
Forward to `describe-variable'.
Variables declared using `defcustom' are highlighted according to
`ivy-highlight-face'.
\(fn)" t nil)
(autoload 'counsel-describe-function "counsel" "\
Forward to `describe-function'.
Interactive functions (i.e., commands) are highlighted according
to `ivy-highlight-face'.
\(fn)" t nil)
(autoload 'counsel-set-variable "counsel" "\
Set a variable, with completion.
When the selected variable is a `defcustom' with the type boolean
or radio, offer completion of all possible values.
Otherwise, offer a variant of `eval-expression', with the initial
input corresponding to the chosen variable.
With a prefix arg, restrict list to variables defined using
`defcustom'.
\(fn SYM)" t nil)
(autoload 'counsel-apropos "counsel" "\
Show all matching symbols.
See `apropos' for further information about what is considered
a symbol and how to search for them.
\(fn)" t nil)
(autoload 'counsel-info-lookup-symbol "counsel" "\
Forward to `info-lookup-symbol' with ivy completion.
\(fn SYMBOL &optional MODE)" t nil)
(autoload 'counsel-M-x "counsel" "\
Ivy version of `execute-extended-command'.
Optional INITIAL-INPUT is the initial input in the minibuffer.
This function integrates with either the `amx' or `smex' package
when available, in that order of precedence.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-load-library "counsel" "\
Load a selected the Emacs Lisp library.
The libraries are offered from `load-path'.
\(fn)" t nil)
(autoload 'counsel-find-library "counsel" "\
Visit a selected the Emacs Lisp library.
The libraries are offered from `load-path'.
\(fn)" t nil)
(autoload 'counsel-load-theme "counsel" "\
Forward to `load-theme'.
Usable with `ivy-resume', `ivy-next-line-and-call' and
`ivy-previous-line-and-call'.
\(fn)" t nil)
(autoload 'counsel-descbinds "counsel" "\
Show a list of all defined keys and their definitions.
If non-nil, show only bindings that start with PREFIX.
BUFFER defaults to the current one.
\(fn &optional PREFIX BUFFER)" t nil)
(autoload 'counsel-faces "counsel" "\
Complete faces with preview.
Actions are provided by default for describing or customizing the
selected face.
\(fn)" t nil)
(autoload 'counsel-git "counsel" "\
Find file in the current Git repository.
INITIAL-INPUT can be given as the initial minibuffer input.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-git-grep "counsel" "\
Grep for a string in the current git repository.
When CMD is a string, use it as a \"git grep\" command.
When CMD is non-nil, prompt for a specific \"git grep\" command.
INITIAL-INPUT can be given as the initial minibuffer input.
\(fn &optional CMD INITIAL-INPUT)" t nil)
(autoload 'counsel-git-stash "counsel" "\
Search through all available git stashes.
\(fn)" t nil)
(autoload 'counsel-git-change-worktree "counsel" "\
Find the file corresponding to the current buffer on a different worktree.
\(fn)" t nil)
(autoload 'counsel-git-checkout "counsel" "\
Call the \"git checkout\" command.
\(fn)" t nil)
(autoload 'counsel-git-log "counsel" "\
Call the \"git log --grep\" shell command.
\(fn)" t nil)
(autoload 'counsel-find-file "counsel" "\
Forward to `find-file'.
When INITIAL-INPUT is non-nil, use it in the minibuffer during completion.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-recentf "counsel" "\
Find a file on `recentf-list'.
\(fn)" t nil)
(autoload 'counsel-bookmark "counsel" "\
Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist.
\(fn)" t nil)
(autoload 'counsel-file-register "counsel" "\
Search file in register.
You cannot use Emacs' normal register commands to create file
registers. Instead you must use the `set-register' function like
so: `(set-register ?i \"/home/eric/.emacs.d/init.el\")'. Now you
can use `C-x r j i' to open that file.
\(fn)" t nil)
(autoload 'counsel-locate "counsel" "\
Call the \"locate\" shell command.
INITIAL-INPUT can be given as the initial minibuffer input.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-fzf "counsel" "\
Open a file using the fzf shell command.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt argument.
\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY FZF-PROMPT)" t nil)
(autoload 'counsel-dpkg "counsel" "\
Call the \"dpkg\" shell command.
\(fn)" t nil)
(autoload 'counsel-rpm "counsel" "\
Call the \"rpm\" shell command.
\(fn)" t nil)
(autoload 'counsel-file-jump "counsel" "\
Jump to a file below the current directory.
List all files within the current directory or any of its subdirectories.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil)
(autoload 'counsel-dired-jump "counsel" "\
Jump to a directory (in dired) below the current directory.
List all subdirectories within the current directory.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil)
(autoload 'counsel-ag "counsel" "\
Grep for a string in the current directory using ag.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
EXTRA-AG-ARGS string, if non-nil, is appended to `counsel-ag-base-command'.
AG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument.
\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-AG-ARGS AG-PROMPT)" t nil)
(autoload 'counsel-pt "counsel" "\
Grep for a string in the current directory using pt.
INITIAL-INPUT can be given as the initial minibuffer input.
This uses `counsel-ag' with `counsel-pt-base-command' instead of
`counsel-ag-base-command'.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-ack "counsel" "\
Grep for a string in the current directory using ack.
INITIAL-INPUT can be given as the initial minibuffer input.
This uses `counsel-ag' with `counsel-ack-base-command' replacing
`counsel-ag-base-command'.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-rg "counsel" "\
Grep for a string in the current directory using rg.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
EXTRA-RG-ARGS string, if non-nil, is appended to `counsel-rg-base-command'.
RG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument.
\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-RG-ARGS RG-PROMPT)" t nil)
(autoload 'counsel-grep "counsel" "\
Grep for a string in the file visited by the current buffer.
When non-nil, INITIAL-INPUT is the initial search pattern.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-grep-or-swiper "counsel" "\
Call `swiper' for small buffers and `counsel-grep' for large ones.
When non-nil, INITIAL-INPUT is the initial search pattern.
\(fn &optional INITIAL-INPUT)" t nil)
(autoload 'counsel-org-tag "counsel" "\
Add or remove tags in `org-mode'.
\(fn)" t nil)
(autoload 'counsel-org-tag-agenda "counsel" "\
Set tags for the current agenda item.
\(fn)" t nil)
(autoload 'counsel-org-goto "counsel" "\
Go to a different location in the current file.
\(fn)" t nil)
(autoload 'counsel-org-goto-all "counsel" "\
Go to a different location in any org file.
\(fn)" t nil)
(autoload 'counsel-org-file "counsel" "\
Browse all attachments for current Org file.
\(fn)" t nil)
(autoload 'counsel-org-entity "counsel" "\
Complete Org entities using Ivy.
\(fn)" t nil)
(autoload 'counsel-org-capture "counsel" "\
Capture something.
\(fn)" t nil)
(autoload 'counsel-org-agenda-headlines "counsel" "\
Choose from headers of `org-mode' files in the agenda.
\(fn)" t nil)
(autoload 'counsel-tmm "counsel" "\
Text-mode emulation of looking and choosing from a menubar.
\(fn)" t nil)
(autoload 'counsel-yank-pop "counsel" "\
Ivy replacement for `yank-pop'.
ARG has the same meaning as in `yank-pop', but its default value
can be controlled with `counsel-yank-pop-preselect-last', which
see. See also `counsel-yank-pop-filter' for how to filter
candidates.
Note: Duplicate elements of `kill-ring' are always deleted.
\(fn &optional ARG)" t nil)
(autoload 'counsel-imenu "counsel" "\
Jump to a buffer position indexed by imenu.
\(fn)" t nil)
(autoload 'counsel-list-processes "counsel" "\
Offer completion for `process-list'.
The default action deletes the selected process.
An extra action allows to switch to the process buffer.
\(fn)" t nil)
(autoload 'counsel-expression-history "counsel" "\
Select an element of `read-expression-history'.
And insert it into the minibuffer. Useful during `eval-expression'.
\(fn)" t nil)
(autoload 'counsel-shell-command-history "counsel" "\
Browse shell command history.
\(fn)" t nil)
(autoload 'counsel-minibuffer-history "counsel" "\
Browse minibuffer history.
\(fn)" t nil)
(autoload 'counsel-esh-history "counsel" "\
Browse Eshell history.
\(fn)" t nil)
(autoload 'counsel-shell-history "counsel" "\
Browse shell history.
\(fn)" t nil)
(autoload 'counsel-outline "counsel" "\
Jump to outline with completion.
\(fn)" t nil)
(autoload 'counsel-ibuffer "counsel" "\
Use ibuffer to switch to another buffer.
NAME specifies the name of the buffer (defaults to \"*Ibuffer*\").
\(fn &optional NAME)" t nil)
(autoload 'counsel-switch-to-shell-buffer "counsel" "\
Switch to a shell buffer, or create one.
\(fn)" t nil)
(autoload 'counsel-unicode-char "counsel" "\
Insert COUNT copies of a Unicode character at point.
COUNT defaults to 1.
\(fn &optional COUNT)" t nil)
(autoload 'counsel-colors-emacs "counsel" "\
Show a list of all supported colors for a particular frame.
You can insert or kill the name or hexadecimal RGB value of the
selected color.
\(fn)" t nil)
(autoload 'counsel-colors-web "counsel" "\
Show a list of all W3C web colors for use in CSS.
You can insert or kill the name or hexadecimal RGB value of the
selected color.
\(fn)" t nil)
(autoload 'counsel-rhythmbox "counsel" "\
Choose a song from the Rhythmbox library to play or enqueue.
\(fn)" t nil)
(autoload 'counsel-linux-app "counsel" "\
Launch a Linux desktop application, similar to Alt-<F2>.
\(fn)" t nil)
(defvar counsel-mode nil "\
Non-nil if Counsel mode is enabled.
See the `counsel-mode' command
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 `counsel-mode'.")
(custom-autoload 'counsel-mode "counsel" nil)
(autoload 'counsel-mode "counsel" "\
Toggle Counsel mode on or off.
Turn Counsel mode on if ARG is positive, off otherwise. Counsel
mode remaps built-in emacs functions that have counsel
replacements.
\(fn &optional ARG)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "counsel" '("counsel-" "tmm-km-list" "ivy-function-called-at-point")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; counsel-autoloads.el ends here

View File

@@ -1,2 +0,0 @@
;;; -*- no-byte-compile: t -*-
(define-package "counsel" "20180717.845" "Various completion functions using Ivy" '((emacs "24.3") (swiper "0.9.0")))

File diff suppressed because it is too large Load Diff

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
;;; dash-functional-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil nil ("dash-functional.el") (23216 11517 695068
;;;;;; 328000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; dash-functional-autoloads.el ends here

View File

@@ -1,2 +0,0 @@
;;; -*- no-byte-compile: t -*-
(define-package "dash-functional" "20180107.818" "Collection of useful combinators for Emacs Lisp" '((dash "2.0.0") (emacs "24")) :commit "48a5015dd1314a8bcad48f2ad8866dd911001b01" :keywords '("lisp" "functions" "combinators"))

View File

@@ -1,219 +0,0 @@
;;; dash-functional.el --- Collection of useful combinators for Emacs Lisp -*- lexical-binding: t -*-
;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
;; Authors: Matus Goljer <matus.goljer@gmail.com>
;; Magnar Sveen <magnars@gmail.com>
;; Version: 1.2.0
;; Package-Version: 20180107.818
;; Package-Requires: ((dash "2.0.0") (emacs "24"))
;; Keywords: lisp functions combinators
;; 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:
;; Collection of useful combinators for Emacs Lisp
;;
;; See documentation on https://github.com/magnars/dash.el#functions
;;; Code:
(require 'dash)
(defun -partial (fn &rest args)
"Takes a function FN and fewer than the normal arguments to FN,
and returns a fn that takes a variable number of additional ARGS.
When called, the returned function calls FN with ARGS first and
then additional args."
(apply 'apply-partially fn args))
(defun -rpartial (fn &rest args)
"Takes a function FN and fewer than the normal arguments to FN,
and returns a fn that takes a variable number of additional ARGS.
When called, the returned function calls FN with the additional
args first and then ARGS."
(lambda (&rest args-before) (apply fn (append args-before args))))
(defun -juxt (&rest fns)
"Takes a list of functions and returns a fn that is the
juxtaposition of those fns. The returned fn takes a variable
number of args, and returns a list containing the result of
applying each fn to the args (left-to-right)."
(lambda (&rest args) (mapcar (lambda (x) (apply x args)) fns)))
(defun -compose (&rest fns)
"Takes a list of functions and returns a fn that is the
composition of those fns. The returned fn takes a variable
number of arguments, and returns the result of applying
each fn to the result of applying the previous fn to
the arguments (right-to-left)."
(lambda (&rest args)
(car (-reduce-r-from (lambda (fn xs) (list (apply fn xs)))
args fns))))
(defun -applify (fn)
"Changes an n-arity function FN to a 1-arity function that
expects a list with n items as arguments"
(apply-partially 'apply fn))
(defun -on (operator transformer)
"Return a function of two arguments that first applies
TRANSFORMER to each of them and then applies OPERATOR on the
results (in the same order).
In types: (b -> b -> c) -> (a -> b) -> a -> a -> c"
(lambda (x y) (funcall operator (funcall transformer x) (funcall transformer y))))
(defun -flip (func)
"Swap the order of arguments for binary function FUNC.
In types: (a -> b -> c) -> b -> a -> c"
(lambda (x y) (funcall func y x)))
(defun -const (c)
"Return a function that returns C ignoring any additional arguments.
In types: a -> b -> a"
(lambda (&rest _) c))
(defmacro -cut (&rest params)
"Take n-ary function and n arguments and specialize some of them.
Arguments denoted by <> will be left unspecialized.
See SRFI-26 for detailed description."
(let* ((i 0)
(args (mapcar (lambda (_) (setq i (1+ i)) (make-symbol (format "D%d" i)))
(-filter (-partial 'eq '<>) params))))
`(lambda ,args
,(let ((body (--map (if (eq it '<>) (pop args) it) params)))
(if (eq (car params) '<>)
(cons 'funcall body)
body)))))
(defun -not (pred)
"Take a unary predicate PRED and return a unary predicate
that returns t if PRED returns nil and nil if PRED returns
non-nil."
(lambda (x) (not (funcall pred x))))
(defun -orfn (&rest preds)
"Take list of unary predicates PREDS and return a unary
predicate with argument x that returns non-nil if at least one of
the PREDS returns non-nil on x.
In types: [a -> Bool] -> a -> Bool"
(lambda (x) (-any? (-cut funcall <> x) preds)))
(defun -andfn (&rest preds)
"Take list of unary predicates PREDS and return a unary
predicate with argument x that returns non-nil if all of the
PREDS returns non-nil on x.
In types: [a -> Bool] -> a -> Bool"
(lambda (x) (-all? (-cut funcall <> x) preds)))
(defun -iteratefn (fn n)
"Return a function FN composed N times with itself.
FN is a unary function. If you need to use a function of higher
arity, use `-applify' first to turn it into a unary function.
With n = 0, this acts as identity function.
In types: (a -> a) -> Int -> a -> a.
This function satisfies the following law:
(funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n)))."
(lambda (x) (--dotimes n (setq x (funcall fn x))) x))
(defun -counter (&optional beg end inc)
"Return a closure that counts from BEG to END, with increment INC.
The closure will return the next value in the counting sequence
each time it is called, and nil after END is reached. BEG
defaults to 0, INC defaults to 1, and if END is nil, the counter
will increment indefinitely.
The closure accepts any number of arguments, which are discarded."
(let ((inc (or inc 1))
(n (or beg 0)))
(lambda (&rest _)
(when (or (not end) (< n end))
(prog1 n
(setq n (+ n inc)))))))
(defvar -fixfn-max-iterations 1000
"The default maximum number of iterations performed by `-fixfn'
unless otherwise specified.")
(defun -fixfn (fn &optional equal-test halt-test)
"Return a function that computes the (least) fixpoint of FN.
FN must be a unary function. The returned lambda takes a single
argument, X, the initial value for the fixpoint iteration. The
iteration halts when either of the following conditions is satisified:
1. Iteration converges to the fixpoint, with equality being
tested using EQUAL-TEST. If EQUAL-TEST is not specified,
`equal' is used. For functions over the floating point
numbers, it may be necessary to provide an appropriate
appoximate comparsion test.
2. HALT-TEST returns a non-nil value. HALT-TEST defaults to a
simple counter that returns t after `-fixfn-max-iterations',
to guard against infinite iteration. Otherwise, HALT-TEST
must be a function that accepts a single argument, the
current value of X, and returns non-nil as long as iteration
should continue. In this way, a more sophisticated
convergence test may be supplied by the caller.
The return value of the lambda is either the fixpoint or, if
iteration halted before converging, a cons with car `halted' and
cdr the final output from HALT-TEST.
In types: (a -> a) -> a -> a."
(let ((eqfn (or equal-test 'equal))
(haltfn (or halt-test
(-not
(-counter 0 -fixfn-max-iterations)))))
(lambda (x)
(let ((re (funcall fn x))
(halt? (funcall haltfn x)))
(while (and (not halt?) (not (funcall eqfn x re)))
(setq x re
re (funcall fn re)
halt? (funcall haltfn re)))
(if halt? (cons 'halted halt?)
re)))))
(defun -prodfn (&rest fns)
"Take a list of n functions and return a function that takes a
list of length n, applying i-th function to i-th element of the
input list. Returns a list of length n.
In types (for n=2): ((a -> b), (c -> d)) -> (a, c) -> (b, d)
This function satisfies the following laws:
(-compose (-prodfn f g ...) (-prodfn f\\=' g\\=' ...)) = (-prodfn (-compose f f\\=') (-compose g g\\=') ...)
(-prodfn f g ...) = (-juxt (-compose f (-partial \\='nth 0)) (-compose g (-partial \\='nth 1)) ...)
(-compose (-prodfn f g ...) (-juxt f\\=' g\\=' ...)) = (-juxt (-compose f f\\=') (-compose g g\\=') ...)
(-compose (-partial \\='nth n) (-prod f1 f2 ...)) = (-compose fn (-partial \\='nth n))"
(lambda (x) (-zip-with 'funcall fns x)))
(provide 'dash-functional)
;;; dash-functional.el ends here

View File

@@ -1,10 +0,0 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((nil
(bug-reference-bug-regexp . "#\\(?2:[0-9]+\\)")
(bug-reference-url-format . "https://github.com/emacs-ess/ess/issues/%s")
(sentence-end-double-space))
(emacs-lisp-mode
(outline-regexp . "\f\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*")
(indent-tabs-mode)))

File diff suppressed because it is too large Load Diff

View File

@@ -1,468 +0,0 @@
This is announc.info, produced by makeinfo version 6.1 from
announc.texi.

File: announc.info, Node: Announce
1 ANNOUNCING ESS
****************
The ESS Developers proudly announce the release of ESS 17.11
Emacs Speaks Statistics (ESS) provides an intelligent, consistent
interface between the user and the software. ESS interfaces with
R/S-PLUS, SAS, BUGS/JAGS, Stata and other statistical analysis packages
under the UNIX, GNU Linux, Microsoft Windows, macOS and other operating
systems. ESS is a package for the GNU Emacs and XEmacs text editors
whose features ESS uses to streamline the creation and use of
statistical software. ESS knows the syntax and grammar of statistical
analysis packages and provides consistent display and editing features
based on that knowledge. ESS assists in interactive and batch execution
of statements written in these statistical analysis languages.
ESS is freely available under the GNU General Public License (GPL).
Please read the file COPYING which comes with the distribution, for more
information about the license. For more detailed information, please
read the README files that come with ESS.
* Menu:
* Latest Version::
* Current Features::
* Requirements::
* Stability::
* Mailing List::
* Reporting Bugs::
* Authors::
* License::
* New Features::

File: announc.info, Node: Latest Version, Next: Current Features, Prev: Announce, Up: Announce
1.1 Getting the Latest Version
==============================
1.1.1 Source code
-----------------
You may download the latest ESS release source code from the ESS web
page (http://ess.r-project.org) or StatLib
(http://lib.stat.cmu.edu/general/ESS/)
1.1.2 Git for ESS development
-----------------------------
Developers and experimentation on ESS mainly happens through git. ESS
is currently hosted on Github: <https://github.com/emacs-ess/ESS>.

File: announc.info, Node: Current Features, Next: Requirements, Prev: Latest Version, Up: Announce
1.2 Current Features
====================
* Languages Supported:
* S family (R, S, and S+ AKA S-PLUS)
* SAS
* BUGS/JAGS
* Stata
* Julia
* Editing source code (S family, SAS, BUGS/JAGS, Stata, Julia)
* Syntactic indentation and highlighting of source code
* Partial evaluation of code
* Loading and error-checking of code
* Source code revision maintenance
* Batch execution (SAS, BUGS/JAGS)
* Use of imenu to provide links to appropriate functions
* Interacting with the process (R family, SAS, Stata, Julia)
* Command-line editing
* Searchable Command history
* Command-line completion of R family object names and file
names
* Quick access to object lists and search lists
* Transcript recording
* Interface to the help system
* Transcript manipulation (S family, Stata)
* Recording and saving transcript files
* Manipulating and editing saved transcripts
* Re-evaluating commands from transcript files
* Interaction with Help Pages and other Documentation (R)
* Fast Navigation
* Sending Examples to running ESS process.
* Fast Transfer to Further Help Pages
* Help File Editing (R)
* Syntactic indentation and highlighting of source code.
* Sending Examples to running ESS process.
* Previewing

File: announc.info, Node: Requirements, Next: Stability, Prev: Current Features, Up: Announce
1.3 Requirements
================
ESS is most likely to work with current/recent versions of the following
statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS.
ESS supports current, and recent, stable versions of GNU Emacs
(currently, 24.3 or higher; alpha/beta/pre-release versions are NOT
SUPPORTED).
Due to XEmacs lacking some features that ESS requires, ESS support of
XEmacs ended with ESS 12.04-4.
To build the PDF documentation, you will need a version of TeX Live
or texinfo that includes texi2dvi (BEWARE: recent TeX Live, and some
texinfo RPMs, do NOT include texi2dvi).

File: announc.info, Node: Stability, Next: Mailing List, Prev: Requirements, Up: Announce
1.4 Stability
=============
All recent released versions are meant to be release-quality versions.
While some new features are being introduced, we are cleaning up and
improving the interface. We know that there are many remaining
opportunities for documentation improvements, but all contributors are
volunteers and time is precious. Patches or suggested fixes with bug
reports are much appreciated!

File: announc.info, Node: Mailing List, Next: Reporting Bugs, Prev: Stability, Up: Announce
1.5 Mailing List
================
There is a mailing list for discussions and announcements relating to
ESS. Join the list by sending an e-mail with "subscribe ess-help" (or
"help") in the body to <ess-help-request@r-project.org>; contributions
to the list may be mailed to <ess-help@r-project.org>. Rest assured,
this is a fairly low-volume mailing list.
The purposes of the mailing list include
* helping users of ESS to get along with it.
* discussing aspects of using ESS on Emacs and XEmacs.
* suggestions for improvements.
* announcements of new releases of ESS.
* posting small patches to ESS.

File: announc.info, Node: Reporting Bugs, Next: Authors, Prev: Mailing List, Up: Announce
1.6 Reporting Bugs
==================
Please send bug reports, suggestions etc. to <ESS-bugs@r-project.org>,
or post them on our github issue tracker
(https://github.com/emacs-ess/ESS/issues)
The easiest way to do this is within Emacs by typing
'M-x ess-submit-bug-report'
This also gives the maintainers valuable information about your
installation which may help us to identify or even fix the bug.
If Emacs reports an error, backtraces can help us debug the problem.
Type "M-x set-variable RET debug-on-error RET t RET". Then run the
command that causes the error and you should see a *Backtrace* buffer
containing debug information; send us that buffer.
Note that comments, suggestions, words of praise and large cash
donations are also more than welcome.

File: announc.info, Node: Authors, Next: License, Prev: Reporting Bugs, Up: Announce
1.7 Authors
===========
* A.J. Rossini (mailto:blindglobe@gmail.com)
* Richard M. Heiberger (mailto:rmh@temple.edu)
* Kurt Hornik (mailto:Kurt.Hornik@R-project.org)
* Martin Maechler (mailto:maechler@stat.math.ethz.ch)
* Rodney A. Sparapani (mailto:rsparapa@mcw.edu)
* Stephen Eglen (mailto:stephen@gnu.org)
* Sebastian P. Luque (mailto:spluque@gmail.com)
* Henning Redestig (mailto:henning.red@googlemail.com)
* Vitalie Spinu (mailto:spinuvit@gmail.com)
* Lionel Henry (mailto:lionel.hry@gmail.com)

File: announc.info, Node: License, Next: New Features, Prev: Authors, Up: Announce
1.8 License
===========
The source and documentation of ESS 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.
ESS 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 in
the file COPYING in the same directory as this file for more details.

File: announc.info, Node: New Features, Prev: License, Up: Announce
1.9 New Features
================
Changes and New Features in development version:
* ESS[R]: Interaction with inferior process in non-R files within
packages (for instance C or C++ files) has been improved. This is
a work in progress.
* ESS[R]: 'ess-r-package-use-dir' (which sets the working directory
to the root of the current package) now works with any mode (e.g.
in C or C++ files within '/src').
* This is the last release to support Emacs older than 25.1 Going
forward, only GNU Emacs 25.1 and newer will be supported. Soon
after this release, support for older Emacs versions will be
dropped from the git master branch. Note that MELPA uses the git
master branch to produce ESS snapshots, so if you are using Emacs <
25.1 from MELPA and are unable to upgrade, you should switch to
MELPA-stable.
* ESS[R]: Long + + prompts in the inferior no longer offset output.
New option 'strip' for 'inferior-ess-replace-long+' strips the
entire + + sequence.
* ESS[R]: Fontification of roxygen '@param' keywords now supports
comma-separated parameters.
* ESS[R]: Function-like keywords such as 'if ()' or 'stop()' are no
longer fontified as keyword if not followed by an opening
parenthesis. The same holds for search path modifiers like
'library()' or 'require()'. This feature is only available in
Emacs >= 25.
* ESS[R]: We have improved fontification of keywords so they better
reflect the semantics of the R language. 'ess-R-keywords' now only
contains words reserved by the R parser.
'ess-R-control-flow-keywords' contains words of base functions that
cause non-contiguous control flow, such as 'return()' and 'stop()'.
It includes the following variables that were previously not
fontified: 'on.exit()', 'tryCatch()', 'withRestarts()',
'invokeRestart()', 'recover()' and 'browser()'
Finally, 'ess-R-signal-keywords' contains functions part of the
condition system that only potentially impact control flow:
'message()', 'warning()' (moved from 'ess-R-keywords'),
'signalCondition()' and 'withCallingHandlers()'. These keywords
inherit from 'ess-modifiers-face' (the face used for 'library()'
etc).
* ESS modes now inherit from 'prog-mode'.
* ESS[R]: The package development minor mode now only activates
within editing buffers by default, i.e. ones that inherit from
'prog-mode' or 'text-mode'. If you want to restore the old
behaviour and activate the package mode in all buffers (that have a
'default-directory' that is part of a package path), set
'ess-r-package-auto-activate' to 't'.
* ESS now provides support for flymake in R buffers for Emacs 26 and
newer. Users need to install the 'lintr' package (available on
CRAN) to use it. Customizable options include 'ess-use-flymake',
'ess-r-flymake-linters', and 'ess-r-flymake-lintr-cache'.
* Improved customization for faces. ESS now provides custom faces
for (nearly) all faces used and places face customization options
into their own group. Users can customize these options using 'M-x
customize-group RET ess-faces'.
* ESS[R]: Gained support for xref in Emacs 25+. *Note (emacs)Xref::
* ESS[R]: Changing the working directory is now always reflected in
the process buffer.
* ESS[R]: The startup screen has been cleaned up and displays the
startup directory with an explicit 'setwd()'.
* ESS now displays the language dialect in the mode-line So, for
example, R buffers will now show ESS[R] rather than ESS[S].
* The ESS manual has been updated and revised.
* ESS[R]: 'Makevars' files are now automatically opened with
'makefile-mode'.
* New varaible 'ess-write-to-dribble'. This allows users to disable
the dribble ('*ESS*') buffer if they wish.
* ESS now respects Emacs conventions for keybindings. This means
that The 'C-c [letter]' bindings have been removed. This affects
'C-c h', which was bound to 'ess-eval-line-and-step-invisibly' in
'sas-mode-local-map'; 'C-c f', which was bound to
'ess-insert-function-outline' in 'ess-add-MM-keys'; and 'C-c h',
which was bound to 'ess-handy-commands' in 'Rd-mode-map',
'ess-noweb-minor-mode-map', and 'ess-help-mode-map'
* prettify-symbols-mode no longer breaks indentation This is
accomplished by having the pretty symbols occupy the same number of
characters as their non-pretty cousins. You may customize the new
variable 'ess-r-prettify-symbols' to control this behavior.
* Variable 'ess-s-versions-list' is obsolete and ignored. Use
'ess-s-versions' instead. You may pass arguments by starting the
inferior process with the universal argument.
* The 'ess-r-args.el' library has obsoleted and will be removed in a
future release. Use 'eldoc-mode' instead, which is on by default.
* All of the '*-program-name' variables have been renamed to
'*-program'. Users who previously customized e.g.
'inferior-ess-R-program-name' will need to update their
customization to 'inferior-ess-R-program'. These variables are
treated as risky variables.
* 'ess-smart-S-assign' changed name to 'ess-insert-S-assign'. By
default, it provides similar functionality. Since many users
dislike this functionality, it is easier to disable; set
'ess-smart-S-assign-key' to nil. The following functions have been
made obsolete and will be removed in the next release of ESS:
ess-smart-S-assign, ess-toggle-S-assign, ess-toggle-S-assign-key,
ess-disable-smart-S-assign.
* The option ess-S-assign has been removed. Customize new option
'ess-assign-list' instead.
* 'C-c C-=' is now bound to 'ess-cycle-assignment' by default See the
docstring for details. New user customization option
'ess-assign-list' controls what assignment operators are cycled
through.
* The ESS initialization process has been further streamlined. If
you update the autoloads (which installation from 'package-install'
does), you should not need to '(require 'ess-site)' at all, as
autoloads should automatically load ESS when it is needed (e.g.
the first time an R buffer is opened). In order to defer loading
your ESS config, you may want to do something like
'(with-require-after-load "ess" <ess-config-here>)' in your Emacs
init file. Users of the popular 'use-package' Emacs package can
now do '(use-package ess :defer t)' to take advantage of this
behavior.
Changes and New Features in 17.11:
* The ESS initialisation process has been streamlined. You can now
load the R and Stata modes independently from the rest of ESS. Just
put '(require 'ess-r-mode)' or '(require 'ess-stata-mode)' in your
init file. This is for experienced Emacs users as this requires
setting up autoloads for '.R' files manually. We will keep
maintaining 'ess-site' for easy loading of all ESS features.
* Reloading and quitting the process is now more robust. If no
process is attached, ESS now switches automatically to one
(prompting you for selection if there are several running).
Reloading and quitting will now work during a debug session or when
R is prompting for input (for instance after a crash). Finally,
the window configuration is saved and restored after reloading to
prevent the buffer of the new process from capturing the cursor.
* ESS[R]: New command 'ess-r-package-use-dir'. It sets the working
directory of the current process to the current package directory.
* ESS[R] Lookup for references in inferior buffers has been improved.
New variable 'ess-r-package-source-roots' contains package
sub-directories which are searched recursively during the file
lookup point. Directories in 'ess-tracebug-search-path' are now
also searched recursively.
* ESS[R] Namespaced evaluation is now automatically enabled only in
the 'R/' directory. This way ESS will not attempt to update
function definitions from a package if you are working from e.g. a
test file.
Changes and New Features in 16.10:
* ESS[R]: Syntax highlighting is now more consistent. Backquoted
names are not fontified as strings (since they really are
identifiers). Furthermore they are now correctly recognised when
they are function definitions or function calls.
* ESS[R]: Backquoted names and '%op%' operators are recognised as
sexp. This is useful for code navigation, e.g. with 'C-M-f' and
'C-M-b'.
* ESS[R]: Integration of outline mode with roxygen examples fields.
You can use outline mode's code folding commands to fold the
examples field. This is especially nice to use with well
documented packages with long examples set. Set
'ess-roxy-fold-examples' to non-nil to automatically fold the
examples field when you open a buffer.
* ESS[R]: New experimental feature: syntax highlighting in roxygen
examples fields. This is turned off by default. Set
'ess-roxy-fontify-examples' to non-nil to try it out.
* ESS[R]: New package development command 'ess-r-devtools-ask' bound
to 'C-c C-w C-a'. It asks with completion for any devtools command
that takes 'pkg' as argument.
* ESS[R]: New command 'C-c C-e C-r' to reload the inferior process.
Currently only implemented for R. The R method runs
'inferior-ess-r-reload-hook' on reloading.
* ESS[R]: 'ess-r-package-mode' is now activated in non-file buffers
as well.
Bug fixes in 16.10:
* ESS[R]: Fix broken (un)flagging for debugging inside packages
* ESS[R]: Fixes (and improvements) in Package development
* ESS[R]: Completion no longer produces '...=' inside 'list( )'.
* ESS[R]: Better debugging and tracing in packages.
* ESS[R]: Better detection of symbols at point.
* ESS[R]: No more spurious warnings on deletion of temporary files.
* ESS[julia]: help and completion work (better)
* ESS[julia]: available via 'ess-remote'
Changes and New Features in 16.04:
* ESS[R]: 'developer' functionality has been refactored. The new
user interface consists of a single command
'ess-r-set-evaluation-env' bound by default to 'C-c C-t C-s'. Once
an evaluation environment has been set with, all subsequent ESS
evaluation will source the code into that environment. By default,
for file within R packages the evaluation environment is set to the
package environment. Set 'ess-r-package-auto-set-evaluation-env'
to 'nil' to disable this.
* ESS[R]: New 'ess-r-package-mode' This development mode provides
features to make package development easier. Currently, most of
the commands are based on the 'devtools' packages and are
accessible with 'C-c C-w' prefix. See the documentation of
'ess-r-package-mode' function for all available commands. With
'C-u' prefix each command asks for extra arguments to the
underlying devtools function. This mode is automatically enabled
in all files within R packages and is indicated with '[pkg:NAME]'
in the mode-line.
* ESS[R]: Help lookup has been improved. It is now possible to get
help for namespaced objects such as pkg::foobar. Furthermore, ESS
recognizes more reliably when you change 'options('html_type')'.
* ESS[R]: New specialized breakpoints for debugging magrittr pipes
* ESS: ESS now implements a simple message passing interface to
communicate between ESS and inferior process.
Bug fixes in 16.04:
* ESS[R]: Roxygen blocks with backtics are now correctly filled
* ESS[R]: Don't skip breakpoints in magrittr's 'debug_pipe'
* ESS[R]: Error highlighting now understands 'testthat' type errors
* ESS[Julia]: Added getwd and setwd generic commands

Tag Table:
Node: Announce75
Node: Latest Version1315
Node: Current Features1869
Node: Requirements3412
Node: Stability4118
Node: Mailing List4620
Node: Reporting Bugs5343
Node: Authors6223
Node: License6847
Node: New Features7495

End Tag Table

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