From 2aa757325c2a0730df99ac8367f82723304c5ddd Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Fri, 3 Jan 2014 11:34:20 -0500 Subject: [PATCH] change settings for linux environment --- emacs | 20 - emacs.d/elpa/ack-1.2/ChangeLog | 73 - emacs.d/elpa/ack-1.2/README | 34 - emacs.d/elpa/ack-1.2/ack-autoloads.el | 49 - emacs.d/elpa/ack-1.2/ack-pkg.el | 1 - emacs.d/elpa/ack-1.2/ack-pkg.elc | Bin 619 -> 0 bytes emacs.d/elpa/ack-1.2/ack.el | 387 -- emacs.d/elpa/ack-1.2/ack.elc | Bin 14246 -> 0 bytes emacs.d/elpa/ack-1.2/pcmpl-ack.el | 141 - emacs.d/elpa/ack-1.2/pcmpl-ack.elc | Bin 4267 -> 0 bytes emacs.d/elpa/elpy-1.2.1/LICENSE | 674 -- emacs.d/elpa/elpy-1.2.1/README | 57 - emacs.d/elpa/elpy-1.2.1/elpy-autoloads.el | 54 - emacs.d/elpa/elpy-1.2.1/elpy-pkg.el | 12 - emacs.d/elpa/elpy-1.2.1/elpy-pkg.elc | Bin 807 -> 0 bytes emacs.d/elpa/elpy-1.2.1/elpy-refactor.el | 284 - emacs.d/elpa/elpy-1.2.1/elpy-refactor.elc | Bin 10195 -> 0 bytes emacs.d/elpa/elpy-1.2.1/elpy.el | 1601 ----- emacs.d/elpa/elpy-1.2.1/elpy.elc | Bin 48887 -> 0 bytes .../elpy-1.2.1/snippets/python-mode/__enter__ | 10 - .../elpy-1.2.1/snippets/python-mode/__exit__ | 6 - .../elpy-1.2.1/snippets/python-mode/super | 7 - emacs.d/elpa/erlang-2.4.1/erlang-autoloads.el | 131 - emacs.d/elpa/erlang-2.4.1/erlang-pkg.el | 1 - emacs.d/elpa/erlang-2.4.1/erlang-pkg.elc | Bin 632 -> 0 bytes emacs.d/elpa/erlang-2.4.1/erlang.el | 5449 ----------------- emacs.d/elpa/erlang-2.4.1/erlang.elc | Bin 143171 -> 0 bytes .../go-mode-autoloads.el | 101 - .../go-mode-20130809.1442/go-mode-load.el | 96 - .../elpa/go-mode-20130809.1442/go-mode-pkg.el | 2 - .../go-mode-20130809.1442/go-mode-pkg.elc | Bin 656 -> 0 bytes emacs.d/elpa/go-mode-20130809.1442/go-mode.el | 1080 ---- .../elpa/go-mode-20130809.1442/go-mode.elc | Bin 41582 -> 0 bytes emacs.d/elpa/nose-0.1.1/nose-autoloads.el | 17 - emacs.d/elpa/nose-0.1.1/nose-pkg.el | 1 - emacs.d/elpa/nose-0.1.1/nose-pkg.elc | Bin 617 -> 0 bytes emacs.d/elpa/nose-0.1.1/nose.el | 185 - emacs.d/elpa/nose-0.1.1/nose.elc | Bin 4218 -> 0 bytes .../virtualenv-1.2/virtualenv-autoloads.el | 44 - emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.el | 1 - .../elpa/virtualenv-1.2/virtualenv-pkg.elc | Bin 642 -> 0 bytes emacs.d/elpa/virtualenv-1.2/virtualenv.el | 429 -- emacs.d/elpa/virtualenv-1.2/virtualenv.elc | Bin 10735 -> 0 bytes gitconfig | 2 +- postactivate | 11 - setup.sh | 24 - zshrc | 14 +- 47 files changed, 3 insertions(+), 10995 deletions(-) delete mode 100644 emacs.d/elpa/ack-1.2/ChangeLog delete mode 100644 emacs.d/elpa/ack-1.2/README delete mode 100644 emacs.d/elpa/ack-1.2/ack-autoloads.el delete mode 100644 emacs.d/elpa/ack-1.2/ack-pkg.el delete mode 100644 emacs.d/elpa/ack-1.2/ack-pkg.elc delete mode 100644 emacs.d/elpa/ack-1.2/ack.el delete mode 100644 emacs.d/elpa/ack-1.2/ack.elc delete mode 100644 emacs.d/elpa/ack-1.2/pcmpl-ack.el delete mode 100644 emacs.d/elpa/ack-1.2/pcmpl-ack.elc delete mode 100644 emacs.d/elpa/elpy-1.2.1/LICENSE delete mode 100644 emacs.d/elpa/elpy-1.2.1/README delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy-autoloads.el delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy-pkg.el delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy-pkg.elc delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy-refactor.el delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy-refactor.elc delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy.el delete mode 100644 emacs.d/elpa/elpy-1.2.1/elpy.elc delete mode 100644 emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__enter__ delete mode 100644 emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__exit__ delete mode 100644 emacs.d/elpa/elpy-1.2.1/snippets/python-mode/super delete mode 100644 emacs.d/elpa/erlang-2.4.1/erlang-autoloads.el delete mode 100644 emacs.d/elpa/erlang-2.4.1/erlang-pkg.el delete mode 100644 emacs.d/elpa/erlang-2.4.1/erlang-pkg.elc delete mode 100644 emacs.d/elpa/erlang-2.4.1/erlang.el delete mode 100644 emacs.d/elpa/erlang-2.4.1/erlang.elc delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode-autoloads.el delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode-load.el delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.el delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.elc delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode.el delete mode 100644 emacs.d/elpa/go-mode-20130809.1442/go-mode.elc delete mode 100644 emacs.d/elpa/nose-0.1.1/nose-autoloads.el delete mode 100644 emacs.d/elpa/nose-0.1.1/nose-pkg.el delete mode 100644 emacs.d/elpa/nose-0.1.1/nose-pkg.elc delete mode 100644 emacs.d/elpa/nose-0.1.1/nose.el delete mode 100644 emacs.d/elpa/nose-0.1.1/nose.elc delete mode 100644 emacs.d/elpa/virtualenv-1.2/virtualenv-autoloads.el delete mode 100644 emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.el delete mode 100644 emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.elc delete mode 100644 emacs.d/elpa/virtualenv-1.2/virtualenv.el delete mode 100644 emacs.d/elpa/virtualenv-1.2/virtualenv.elc delete mode 100755 postactivate diff --git a/emacs b/emacs index e33be29..e8dd625 100644 --- a/emacs +++ b/emacs @@ -51,13 +51,6 @@ (setq projectile-enable-caching t) (projectile-global-mode t) -(elpy-enable) - -;call gofmt on the script when saving -(add-hook 'go-mode-hook - '(lambda () - (add-hook 'before-save-hook 'gofmt))) - ;js-mode overwrites json-mode when loading .json files, so this is ; to force json-mode for .json files (add-to-list 'auto-mode-alist '("\\.json$" . json-mode)) @@ -69,16 +62,3 @@ (color-theme-clarity) (require 'powerline) (powerline-default-theme) - -; http://blog.lathi.net/articles/2007/11/07/sharing-the-mac-clipboard-with-emacs -(defun copy-from-osx () - (shell-command-to-string "pbpaste")) - -(defun paste-to-osx (text &optional push) - (let ((process-connection-type nil)) - (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) - (process-send-string proc text) - (process-send-eof proc)))) - -(setq interprogram-cut-function 'paste-to-osx) -(setq interprogram-paste-function 'copy-from-osx) diff --git a/emacs.d/elpa/ack-1.2/ChangeLog b/emacs.d/elpa/ack-1.2/ChangeLog deleted file mode 100644 index a687261..0000000 --- a/emacs.d/elpa/ack-1.2/ChangeLog +++ /dev/null @@ -1,73 +0,0 @@ -2013-05-04 Leo Liu - - * ack: bump to version 1.2 to make the archiver happy - - Fix http://debbugs.gnu.org/14338 - -2013-04-21 Leo Liu - - * ack: doc fix and release 1.01 - - Support the silver search (ag) - https://github.com/ggreer/the_silver_searcher which is an order of - magnitude faster than ack. - -2013-04-20 Leo Liu - - * ack: Release v1.0 - -2013-02-26 Leo Liu - - * ack.el: work around bug http://debbugs.gnu.org/13811 - - Use setq-local and enhance minibuffer prompt update feature. - -2013-02-07 Leo Liu - - * ack: release v0.9 - - - remove emacs 23 support - - add a new command ack-mode-display-match - -2013-01-13 Leo Liu - - New command ack-yank-symbol-at-point and bind it to M-Y - - Thanks to scottj@irc.freenode.net for request and testing. - Also update copyright years. - -2012-11-19 Leo Liu - - * ack.el (ack-buffer-name-function): New user variable - - Thanks to scottj@irc.freenode.net for request and testing. - -2012-10-21 Leo Liu - - * ack.el: Make minibuffer prompt more informative - -2012-10-08 Leo Liu - - * README (Usage): Doc fix - -2012-10-08 Chong Yidong - - Fix copyright headers for ack package - -2012-10-08 Chong Yidong - - Convert packages/ack/README.rst to a package.el compatible README. - Tweak the description of the ack package in packages/ack/ack-pkg.el. - -2012-10-04 Leo Liu - - Add file ack-pkg.el - -2012-10-04 Leo Liu - - Sync ack.el and pcmpl-ack.el to version 0.8 - -2012-10-01 Leo Liu - - Add ack - diff --git a/emacs.d/elpa/ack-1.2/README b/emacs.d/elpa/ack-1.2/README deleted file mode 100644 index 35503de..0000000 --- a/emacs.d/elpa/ack-1.2/README +++ /dev/null @@ -1,34 +0,0 @@ -This package provides an interface to ack http://beyondgrep.com -- a -tool like grep, designed for programmers with large trees of -heterogeneous source code. It builds on standard packages `compile.el' -and `ansi-color.el' and lets you seamlessly run `ack' with its large -set of options. - -Ack-like tools such as the silver search (ag) and git/hg/bzr grep are -well supported too. - -Usage: -Type `M-x ack' and provide a pattern to search. -Type `C-u M-x ack' to search from current project root. -Type `C-u C-u M-x ack' to interactively choose a directory to search. - -While reading ack command and args from the minibuffer, the following -key bindings may be useful: - -- `M-I' inserts a template for case-insensitive file name search -- `M-G' inserts a template for `git grep', `hg grep' or `bzr grep' -- `M-Y' inserts the symbol at point from the window before entering - the minibuffer -- `TAB' completes ack options - -This package does not require `--nogroup' nor `--noheading'. -Coloring is performed using the standard library ansi-color.el. - -Screenshots: -http://i.imgur.com/VwWyzAe.png -http://i.imgur.com/rwjC4pa.png - -Bugs: -https://github.com/leoliu/ack-el/issues - -ack.el was written by Leo Liu, with contributions from Phillip Lord. diff --git a/emacs.d/elpa/ack-1.2/ack-autoloads.el b/emacs.d/elpa/ack-1.2/ack-autoloads.el deleted file mode 100644 index 92a9ebc..0000000 --- a/emacs.d/elpa/ack-1.2/ack-autoloads.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; ack-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (ack) "ack" "ack.el" (20884 64193)) -;;; Generated autoloads from ack.el - -(autoload 'ack "ack" "\ -Run ack using COMMAND-ARGS and collect output in a buffer. -When called interactively, the value of DIRECTORY is provided by -`ack-default-directory-function'. - -The following keys are available while reading from the -minibuffer: - -\\{ack-minibuffer-local-map} - -\(fn COMMAND-ARGS &optional DIRECTORY)" t nil) - -;;;*** - -;;;### (autoloads (pcomplete/ack) "pcmpl-ack" "pcmpl-ack.el" (20884 -;;;;;; 64193)) -;;; Generated autoloads from pcmpl-ack.el - -(autoload 'pcomplete/ack "pcmpl-ack" "\ -Completion for the `ack' command. -Start an argument with '-' to complete short options and '--' for -long options. - -\(fn)" nil nil) - -(defalias 'pcomplete/ack-grep 'pcomplete/ack) - -;;;*** - -;;;### (autoloads nil nil ("ack-pkg.el") (20884 64193 379608)) - -;;;*** - -(provide 'ack-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; ack-autoloads.el ends here diff --git a/emacs.d/elpa/ack-1.2/ack-pkg.el b/emacs.d/elpa/ack-1.2/ack-pkg.el deleted file mode 100644 index dc627cb..0000000 --- a/emacs.d/elpa/ack-1.2/ack-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "ack" "1.2" "Interface to ack-like source code search tools") diff --git a/emacs.d/elpa/ack-1.2/ack-pkg.elc b/emacs.d/elpa/ack-1.2/ack-pkg.elc deleted file mode 100644 index e3e212fa6454a9f811ec9e629883851f646c94ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmbtR!A`?44Bfduz}4Cbq&1}-47Ofi(+-nBLSlS?m!xadG_H~iG`=3ULkPriKE#Rr z@}8euuAf#HqtPfS%Mw=9cE)N2yCdwpj?tpqD{>FZ{t?n=luM!}eeonLNwh!?w)Fv? z@d)`0@_bRu7Pog$T<6n)vGUYH#hj461?@xjn>G`=MHz(3wCylM*`&EBhTJuKq3u9n z9ISg7yz_sgcdF5){c0y>a_6 z;jRx6P$~BOqm$1?G5^P*h&dcZkmMpV_zGR}&AfO8{Bl1rs4<8<2bYH+V%%y|rBUJ{=h$6hOx c8X`fzJ8K%vjt`zok`&+Bo2 -;; Version: 1.2 -;; Keywords: tools, processes, convenience -;; Created: 2012-03-24 -;; URL: https://github.com/leoliu/ack-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 . - -;;; Commentary: - -;; This package provides an interface to ack http://beyondgrep.com -- -;; a tool like grep, designed for programmers with large trees of -;; heterogeneous source code. It builds on standard packages -;; `compile.el' and `ansi-color.el' and lets you seamlessly run `ack' -;; with its large set of options. -;; -;; Ack-like tools such as the silver search (ag) and git/hg/bzr grep -;; are well supported too. - -;;; Usage: - -;; + Type `M-x ack' and provide a pattern to search. -;; + Type `C-u M-x ack' to search from current project root. -;; + Type `C-u C-u M-x ack' to interactively choose a directory to -;; search. -;; -;; Note: use `ack-default-directory-function' for customised -;; behaviour. -;; -;; When in the minibuffer the following key bindings may be useful: -;; -;; + `M-I' inserts a template for case-insensitive file name search -;; + `M-G' inserts a template for `git grep', `hg grep' or `bzr grep' -;; + `M-Y' inserts the symbol at point from the window before entering -;; the minibuffer -;; + `TAB' completes ack options - -;;; Bugs: https://github.com/leoliu/ack-el/issues - -;;; Code: - -(require 'compile) -(require 'ansi-color) -(autoload 'shell-completion-vars "shell") - -(eval-when-compile - (unless (fboundp 'setq-local) - (defmacro setq-local (var val) - (list 'set (list 'make-local-variable (list 'quote var)) val)))) - -(defgroup ack nil - "Run `ack' and display the results." - :group 'tools - :group 'processes) - -;; Used implicitly by `define-compilation-mode' -(defcustom ack-scroll-output nil - "Similar to `compilation-scroll-output' but for the *Ack* buffer." - :type 'boolean - :group 'ack) - -(defcustom ack-command - ;; Note: on GNU/Linux ack may be renamed to ack-grep - (concat (file-name-nondirectory (or (executable-find "ack-grep") - (executable-find "ack") - (executable-find "ag") - "ack")) " ") - "The default command for \\[ack]. - -Note also options to ack can be specified in ACK_OPTIONS -environment variable and .ackrc, which you can disable by the ---noenv switch." - :type 'string - :safe 'stringp - :group 'ack) - -(defcustom ack-buffer-name-function nil - "If non-nil, a function to compute the name of an ack buffer. -See `compilation-buffer-name-function' for details." - :type '(choice function (const nil)) - :group 'ack) - -(defcustom ack-vc-grep-commands - '((".git" . "git --no-pager grep --color -n -i") - (".hg" . "hg grep -n -i") - ;; Plugin bzr-grep required for bzr < 2.6 - (".bzr" . "bzr grep --color=always -n -i")) - "An alist of vc grep commands for `ack-skel-vc-grep'. -Each element is of the form (VC_DIR . CMD)." - :type '(repeat (cons string string)) - :group 'ack) - -(defcustom ack-default-directory-function 'ack-default-directory - "A function to return the default directory for `ack'. -It is called with one arg, the prefix arg to `ack'." - :type 'function - :group 'ack) - -(defcustom ack-project-root-patterns - (list (concat "\\`" (regexp-quote dir-locals-file) "\\'") - "\\`Project\\.ede\\'" - "\\.xcodeproj\\'" ; xcode - "\\`\\.ropeproject\\'" ; python rope - "\\`\\.\\(?:CVS\\|bzr\\|git\\|hg\\|svn\\)\\'") - "A list of regexps to match files in a project root. -Used by `ack-guess-project-root'." - :type '(repeat string) - :group 'ack) - -(defcustom ack-minibuffer-setup-hook nil - "Ack-specific hook for `minibuffer-setup-hook'." - :type 'hook - :group 'ack) - -;;; ======== END of USER OPTIONS ======== - -(defvar ack-history nil "History list for ack.") - -(defvar ack-first-column 0 - "Value to use for `compilation-first-column' in ack buffers.") - -(defvar ack-error-screen-columns nil - "Value to use for `compilation-error-screen-columns' in ack buffers.") - -(defvar ack-error "ack match" - "Stem of message to print when no matches are found.") - -(defun ack-filter () - "Handle match highlighting escape sequences inserted by the ack process. -This function is called from `compilation-filter-hook'." - (save-excursion - (let ((ansi-color-apply-face-function - (lambda (beg end face) - (when face - (ansi-color-apply-overlay-face beg end face) - (put-text-property beg end 'ack-color t))))) - (ansi-color-apply-on-region compilation-filter-start (point))))) - -(defvar ack-mode-font-lock-keywords - '(("^--$" 0 'shadow) - ;; Command output lines. - (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" - 1 'compilation-error) - ;; Remove match from ack-error-regexp-alist before fontifying - ("^Ack \\(?:started\\|finished\\) at.*" - (0 '(face nil compilation-message nil message nil help-echo nil mouse-face nil) t)) - ("^Ack \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*" - (0 '(face nil compilation-message nil message nil help-echo nil mouse-face nil) t) - (1 'compilation-error) - (2 'compilation-error nil t))) - "Additional things to highlight in ack output. -This gets tacked on the end of the generated expressions.") - -(defun ack--column-start () - (or (let* ((beg (match-end 0)) - (end (save-excursion - (goto-char beg) - (line-end-position))) - (mbeg (text-property-any beg end 'ack-color t))) - (when mbeg (- mbeg beg))) - ;; Use column number from `ack' itself if available - (when (match-string 4) - (1- (string-to-number (match-string 4)))))) - -(defun ack--column-end () - (let* ((beg (match-end 0)) - (end (save-excursion - (goto-char beg) - (line-end-position))) - (mbeg (text-property-any beg end 'ack-color t)) - (mend (and mbeg (next-single-property-change - mbeg 'ack-color nil end)))) - (when mend (- mend beg)))) - -(defun ack--file () - (let (file) - (save-excursion - (while (progn - (forward-line -1) - (looking-at-p "^--$"))) - (setq file (or (get-text-property (line-beginning-position) 'ack-file) - (progn - (put-text-property (line-beginning-position) - (line-end-position) - 'font-lock-face compilation-info-face) - (buffer-substring-no-properties - (line-beginning-position) (line-end-position)))))) - (put-text-property (line-beginning-position) - (min (1+ (line-end-position)) (point-max)) 'ack-file file) - (list file))) - -;;; `compilation-mode-font-lock-keywords' -> -;;; `compilation--ensure-parse' -> `compilation--parse-region' -> -;;; `compilation-parse-errors' -> `compilation-error-properties'. -;;; `compilation-error-properties' returns nil if a previous pattern -;;; in the regexp alist has already been applied in a region. - -(defconst ack-error-regexp-alist - `(;; grouping line (--group or --heading) - ("^\\([1-9][0-9]*\\)\\(:\\|-\\)\\(?:\\(?4:[1-9][0-9]*\\)\\2\\)?" - ack--file 1 (ack--column-start . ack--column-end) - nil nil (4 compilation-column-face nil t)) - ;; none grouping line (--nogroup or --noheading) - ("^\\(.+?\\)\\(:\\|-\\)\\([1-9][0-9]*\\)\\2\\(?:\\(?4:[1-9][0-9]*\\)\\2\\)?" - 1 3 (ack--column-start . ack--column-end) - nil nil (4 compilation-column-face nil t)) - ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) - "Ack version of `compilation-error-regexp-alist' (which see).") - -(defvar ack-process-setup-function 'ack-process-setup) - -(defun ack-process-setup () - ;; Handle `hg grep' output - (when (string-match-p "^[ \t]*hg[ \t]" (car compilation-arguments)) - (setq compilation-error-regexp-alist - '(("^\\(.+?:[0-9]+:\\)\\(?:\\([0-9]+\\):\\)?" 1 2))) - (setq-local compilation-parse-errors-filename-function - (lambda (file) - (save-match-data - (if (string-match "\\(.+\\):\\([0-9]+\\):" file) - (match-string 1 file) - file))))) - ;; Handle `bzr grep' output - (when (string-match-p "^[ \t]*bzr[ \t]" (car compilation-arguments)) - (setq-local compilation-parse-errors-filename-function - (lambda (file) - (save-match-data - ;; 'bzr grep -r' has files like `termcolor.py~147' - (if (string-match "\\(.+\\)~\\([0-9]+\\)" file) - (match-string 1 file) - file)))))) - -(define-compilation-mode ack-mode "Ack" - "A compilation mode tailored for ack." - (setq-local compilation-disable-input t) - (setq-local compilation-error-face 'compilation-info) - (add-hook 'compilation-filter-hook 'ack-filter nil t)) - -;;; `compilation-display-error' is introduced in 24.4 -(unless (fboundp 'compilation-display-error) - (defun ack-mode-display-match () - "Display in another window the match in current line." - (interactive) - (setq compilation-current-error (point)) - (next-error-no-select 0)) - (define-key ack-mode-map "\C-o" #'ack-mode-display-match)) - -(defun ack-skel-file () - "Insert a template for case-insensitive file name search." - (interactive) - (delete-minibuffer-contents) - (let ((ack (or (car (split-string ack-command nil t)) "ack"))) - (if (equal ack "ag") - (skeleton-insert `(nil ,ack " -ig '" _ "'")) - (skeleton-insert `(nil ,ack " -g '(?i:" _ ")'"))))) - -;; Work around bug http://debbugs.gnu.org/13811 -(defvar ack--project-root nil) ; dynamically bound in `ack' - -(defun ack-skel-vc-grep () - "Insert a template for vc grep search." - (interactive) - (let* ((regexp (concat "\\`" (regexp-opt - (mapcar 'car ack-vc-grep-commands)) - "\\'")) - (root (or (ack-guess-project-root default-directory regexp) - (error "Cannot locate vc project root"))) - (which (car (directory-files root nil regexp))) - (backend (downcase (substring which 1))) - (cmd (or (cdr (assoc which ack-vc-grep-commands)) - (error "No command provided for `%s grep'" backend)))) - (setq ack--project-root root) - (delete-minibuffer-contents) - (skeleton-insert `(nil ,cmd " '" _ "'")))) - -(defun ack-yank-symbol-at-point () - "Yank the symbol from the window before entering the minibuffer." - (interactive) - (let ((symbol (and (minibuffer-selected-window) - (with-current-buffer - (window-buffer (minibuffer-selected-window)) - (thing-at-point 'symbol))))) - (if symbol (insert symbol) - (minibuffer-message "No symbol found")))) - -(defvar ack-minibuffer-local-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map minibuffer-local-map) - (define-key map "\t" 'completion-at-point) - (define-key map "\M-I" 'ack-skel-file) - (define-key map "\M-G" 'ack-skel-vc-grep) - (define-key map "\M-Y" 'ack-yank-symbol-at-point) - (define-key map "'" 'skeleton-pair-insert-maybe) - map) - "Keymap used for reading `ack' command and args in minibuffer.") - -(defun ack-guess-project-root (start-directory &optional regexp) - (let ((regexp (or regexp - (mapconcat 'identity ack-project-root-patterns "\\|"))) - (parent (file-name-directory - (directory-file-name (expand-file-name start-directory))))) - (if (directory-files start-directory nil regexp) - start-directory - (unless (equal parent start-directory) - (ack-guess-project-root parent regexp))))) - -(defun ack-default-directory (arg) - "A function for `ack-default-directory-function'. -With no \\[universal-argument], return `default-directory'; -With one \\[universal-argument], find the project root according to -`ack-project-root-patterns'; -Otherwise, interactively choose a directory." - (cond - ((not arg) default-directory) - ((= (prefix-numeric-value arg) 4) - (or (ack-guess-project-root default-directory) - (ack-default-directory '(16)))) - (t (read-directory-name "In directory: " nil nil t)))) - -(defun ack-update-minibuffer-prompt (&optional _beg _end _len) - (when (minibufferp) - (let ((inhibit-read-only t)) - (save-excursion - (goto-char (minibuffer-prompt-end)) - (when (looking-at "\\(\\w+\\)\\s-") - (put-text-property - (point-min) (minibuffer-prompt-end) - 'display - (format "Run %s in `%s': " - (match-string-no-properties 1) - (file-name-nondirectory - (directory-file-name ack--project-root))))))))) - -(defun ack-minibuffer-setup-function () - (shell-completion-vars) - (add-hook 'after-change-functions - #'ack-update-minibuffer-prompt nil t) - (ack-update-minibuffer-prompt) - (run-hooks 'ack-minibuffer-setup-hook)) - -;;;###autoload -(defun ack (command-args &optional directory) - "Run ack using COMMAND-ARGS and collect output in a buffer. -When called interactively, the value of DIRECTORY is provided by -`ack-default-directory-function'. - -The following keys are available while reading from the -minibuffer: - -\\{ack-minibuffer-local-map}" - (interactive - (let ((ack--project-root (or (funcall ack-default-directory-function - current-prefix-arg) - default-directory)) - ;; Disable completion cycling; see http://debbugs.gnu.org/12221 - (completion-cycle-threshold nil)) - (list (minibuffer-with-setup-hook 'ack-minibuffer-setup-function - (read-from-minibuffer "Ack: " - ack-command - ack-minibuffer-local-map - nil 'ack-history)) - ack--project-root))) - (let ((default-directory (expand-file-name - (or directory default-directory)))) - ;; Change to the compilation buffer so that `ack-buffer-name-function' can - ;; make use of `compilation-arguments'. - (with-current-buffer (compilation-start command-args 'ack-mode) - (when ack-buffer-name-function - (rename-buffer (funcall ack-buffer-name-function "ack")))))) - -(provide 'ack) -;;; ack.el ends here diff --git a/emacs.d/elpa/ack-1.2/ack.elc b/emacs.d/elpa/ack-1.2/ack.elc deleted file mode 100644 index 8644b26b2afc1a59fac187b4f31786dca4bfd43a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14246 zcmd^G`FGpanU$BOHgn=>XHL~@ZJ!{gq!fcDz|E3Rk1fk?;*-SA*lya6sYD$lu*d%FAR^TS_nY;08S-o2|1qv;`;(b>+Z(*Hox01Q{M}2@A*om7;fryQ=ym6bpQzzk=uLxx8b*U8jf3zc zxrL{3k}7XF#Ch{|oV~icw=%~t!W?0gszDT{9y-s{k$nd(p?&cD@bP0c7<;idNU_OV zvb+}#RT8Oz7plImCXrWK#2hA3z86mdKUV1&9o?p07mWB(|G0r4`>#@|)cR+sZx5oO zudH6P(ZI{u>bVZT@a1Mdn)uPetKGBA;|_jxdrfwA9K2k-&`UmBzyEp9ZFDX5GWNfn z2eA*DiqI)9OaiPoiDKo=Q+#@$;n<%{&^VnX?b~1<~Y%H3mvw2!o{duZJ*f%HNJs7;&MayX9$MxS; zYD=5M0RpcNeW+q<<#|+X54%QrYb)Pr>|plJh-J^kAuNjokeq*3PhK)0!~1h zifxAxW>5)KcQC$?IN8?Mk);Mr9C)d!5nF61H{POf2zeT$QGBLqIBv~<;}7O3cVLeK zY|_FeAtnCI+FAc_eftTTIn)9pEQR-+AA5HiIX^V6sQttnfjj!wY=t{cOFbS5aDcJ5 zl&41Xa6lH21C+2iI72bwkyJE->)_=PG0#F`*a{2 ztJW)zJV=&5@kRK6?ifo#q5D+TzB>Ho;p1mek;5+@?p%0eGbw?E%8{%+Znajk>L)>J zVO9&DisEa}yb}Pn?ASJFWrxZRC^}Ysd?LNaC#J{ZN&oM$Ji=#b^dG#*Yws*kW|D$% zIh}TML1B={r@WJ}%E+4jfH*Eu*lBdt!Gal(EST?k3>hl`!$Mawf`i77Qw7Sxu+s?; z0~>`viumM~jGe{)D0su)f{0*J^+H-3AhPrI>`YA8Q=Ob&8M9D1x6xQ&U_R3l0q*ep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~jNS>&7e=L32k9ZxNSA_qtbr?==(UAr#O z`tuEhrr6&Hk_zkD*p!%iJ8y< diff --git a/emacs.d/elpa/ack-1.2/pcmpl-ack.el b/emacs.d/elpa/ack-1.2/pcmpl-ack.el deleted file mode 100644 index 3029367..0000000 --- a/emacs.d/elpa/ack-1.2/pcmpl-ack.el +++ /dev/null @@ -1,141 +0,0 @@ -;;; pcmpl-ack.el --- completion for ack -*- lexical-binding: t; -*- - -;; Copyright (C) 2012-2013 Free Software Foundation, Inc. - -;; Author: Leo Liu -;; Keywords: tools, processes, convenience -;; Created: 2012-09-26 -;; URL: https://github.com/leoliu/ack-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 . - -;;; Commentary: - -;; Provide pcompletion support for the cli tool `ack' which can be -;; downloaded from http://beyondgrep.com. -;; -;; Install: -;; (autoload 'pcomplete/ack "pcmpl-ack") -;; -;; Usage: -;; - To complete short options type '-' first -;; - To complete long options type '--' first -;; - Color name completion is supported following -;; --color-filename=, --color-match= and --color-lineno= -;; - Type completion is supported following --type= - -;;; Code: - -(require 'pcomplete) - -(defcustom pcmpl-ack-program - (file-name-nondirectory (or (executable-find "ack-grep") - (executable-find "ack") - "ack")) - "Name of the ack program." - :type 'file - :group 'pcomplete) - -(defvar pcmpl-ack-color-options - '("clear" - "reset" - "dark" - "bold" - "underline" - "underscore" - "blink" - "reverse" - "concealed" - "black" - "red" - "green" - "yellow" - "blue" - "magenta" - "on_black" - "on_red" - "on_green" - "on_yellow" - "on_blue" - "on_magenta" - "on_cyan" - "on_white") - "Color names for the `ack' command.") - -(defun pcmpl-ack-run (buffer &rest args) - "Run ack with ARGS and send the output to BUFFER." - (condition-case nil - (apply 'call-process (or pcmpl-ack-program "ack") nil buffer nil args) - (file-error -1))) - -(defun pcmpl-ack-short-options () - "Short options for the `ack' command." - (with-temp-buffer - (let (options) - (when (zerop (pcmpl-ack-run t "--help")) - (goto-char (point-min)) - (while (re-search-forward "^ -\\([^-]\\)" nil t) - (push (match-string 1) options)) - (mapconcat 'identity (nreverse options) ""))))) - -(defun pcmpl-ack-long-options (&optional arg) - "Long options for the `ack' command." - (with-temp-buffer - (let (options) - (when (zerop (pcmpl-ack-run t (or arg "--help"))) - (goto-char (point-min)) - (while (re-search-forward - "\\(?: ?\\|, \\)\\(--\\(\\[no\\]\\)?\\([[:alnum:]-]+=?\\)\\)" - nil t) - (if (not (match-string 2)) - (push (match-string 1) options) - (push (concat "--" (match-string 3)) options) - (push (concat "--no" (match-string 3)) options))) - (nreverse options))))) - -(defun pcmpl-ack-type-options () - "A list of types for the `ack' command." - (pcmpl-ack-long-options "--help-types")) - -;;;###autoload -(defun pcomplete/ack () - "Completion for the `ack' command. -Start an argument with '-' to complete short options and '--' for -long options." - ;; No space after = - (while t - (if (pcomplete-match "^-" 0) - (cond - ((pcomplete-match "^--color-\\w+=\\(\\S-*\\)" 0) - (pcomplete-here* pcmpl-ack-color-options - (pcomplete-match-string 1 0) t)) - ((pcomplete-match "^--\\(?:no\\)?ignore-dir=\\(\\S-*\\)" 0) - (pcomplete-here* (pcomplete-dirs) - (pcomplete-match-string 1 0) t)) - ((pcomplete-match "^--type=\\(\\S-*\\)" 0) - (pcomplete-here* (mapcar (lambda (type-option) - (substring type-option 2)) - (pcmpl-ack-type-options)) - (pcomplete-match-string 1 0) t)) - ((pcomplete-match "^--" 0) - (pcomplete-here* (append (pcmpl-ack-long-options) - (pcmpl-ack-type-options)))) - (t (pcomplete-opt (pcmpl-ack-short-options)))) - (pcomplete-here* (pcomplete-dirs-or-entries))))) - -;;;###autoload -(defalias 'pcomplete/ack-grep 'pcomplete/ack) - -(provide 'pcmpl-ack) -;;; pcmpl-ack.el ends here diff --git a/emacs.d/elpa/ack-1.2/pcmpl-ack.elc b/emacs.d/elpa/ack-1.2/pcmpl-ack.elc deleted file mode 100644 index e3b3834e8d7a20455c9ea2f1e36e2d9aa3912cfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4267 zcmds4-*4MS5_SsIm+GxghvFVOrkYqvv$9B8lC25hsULQnE3SR207}c+p%Sm3RtVyh%d>5MnhduWJY(mQN< zE!VDHMfr?mjFZgsD2YDE92>G$%`RTdqO7pK$W%t*GL=abP^g0}H&Hsx9%9vGIms}@ ztygy3vr;D}YOnzi~9uSc(B zqDW70YDI_@&5fQKnY6yHHG)N!>qLYqh^0~Dy)=;=0|L-dMpl%&sS!tTe|^6Z%VZo% zN~4$>j2D4W;Y+6>tOvO^OKNCC4fUG}7CEaElL-EG7&TL)=1%kDiN1jk7=-ei>tu_Zh`l;Ta$=P!btx zSNU4J%5QLiO7Xi?ajdWG@`5E2IaNR_MmqiXI4(pmETk}~1TkF6+O1X`qb&`=QnD3H zU(KRivD2+b`^QI321fso-Y!xL2%DKt-+p&aHV+hn#qQIKe7?vj*Yxbi7cb7<0`84T zTE5VIxF{!E;)Xu-NxhM@$hu;9OCKX>FwU#z3cOiK7YH| z=eqZv${s4{^*15vVLHu*zvLqCU)} zehTk29m`?@XM>{p&;!L5w=WJZ+!1-J-SqOiSFhimJ#RXr5h%Hgkn6U4%@N1w@Q}`D z+T@lp8KECXwvEeeQOH=q3gY!);Tju_Jp-4zzv7EuZv+N&{oUO?8xxKU$HKd3;{fk* zSX>0rg;!mENBH*O&hFzKH7-v?xD>)qp7=<>Rs z`Cg}w0q@4*gCagdWQH;l(M{Er7%wIhkg!7!a+S;zj5}9MUC~oB96|8MB7=>VgC|{D}jOeI>MAs`J0X%)L)9D{U1l=!)4aFa6dK*4s zXxo5?*X@;nMSlE+0Qnq|?Cl`}E1dlNDV+RN;>2}1bcavN*KOD|d6r?rfa>nOsSpMD z+?)i=upfB02>W}13&1)V5YdV6|MwvQUziXKH{Tzo+V>f9SZfT20~x1_WH1t=Zy#d@ z8*gF}Fm|ZJXihaScwAx-sogJWsYg%AwgcQ%pf>+s#KeLdz}w`dGV9kgyam!S&4jg# z1A5f~`)#*4pzFD|Lq-$CP3SGGd7ev9D>^x8ri%nwN45~|i+!$nRTD*)Kv((36>?u- z3zXLQSk+2V9j|9u*@Of_DZF9%v=V0Pe@K|iYI*F7O1LNpMK$kl9kwV6gtX?H zlou$I7~F7E1m%9!(F#kOU{fFz&U`0O?zw~W{i|;uTfCo(2Nu(75pXiPV(a|7H-NR( z0HOx3N;66__`M8YVRp^dpn8~wy^{f_SMwyArf38OI^gY7Y=!*J%1_+Fa2Z(}0QyYC zdBhF%s*x7+5gl$FiS07(KVgQgkVO%j;lhHJx9UWg{|d0VuS;imMGv#KLl?iiITNqn zT)ce!s>~Utlw3M@$i`u4iOD;%sA_wvU1yid)NDvU)xJDJ$DvLw(y&cUz}Z+_}2< zjW*|_{pZSm+XkyJU28Y1F3-Ee)vEUuX90t|^Cgcsx!Rvuja|Fso~(AcR^lVQ$aNr4 z(JB;3+(ZSv;25EK+z7^qx)moL^*YRnjdgEaw4+rs4z{t~A0P6NPtTyi|D>XuUjfwq Y<>x - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/emacs.d/elpa/elpy-1.2.1/README b/emacs.d/elpa/elpy-1.2.1/README deleted file mode 100644 index 656cb2c..0000000 --- a/emacs.d/elpa/elpy-1.2.1/README +++ /dev/null @@ -1,57 +0,0 @@ -======================================= -Elpy, the Emacs Lisp Python Environment -======================================= - -Elpy is an Emacs package to bring powerful Python editing to Emacs. It -combines a number of other packages, both written in Emacs Lisp as -well as Python. - -.. image:: https://secure.travis-ci.org/jorgenschaefer/elpy.png - :alt: Build Status - :target: http://travis-ci.org/jorgenschaefer/elpy - :width: 77px - :height: 19px - -Documentation -============= - -You can find the documentation `on the wiki`__. - -.. __: https://github.com/jorgenschaefer/elpy/wiki - -Quick Installation -================== - -You can also read the `detailed installation instructions`__. - -.. __: https://github.com/jorgenschaefer/elpy/wiki/Installation - -First, install the required Python packages::: - - pip install elpy rope - -(Note: If you are installing the development version of elpy, do not -install the elpy Python package, but simply put the repository in your -``PYTHONPATH``.) - -Evaluate this in your ``*scratch*`` buffer: - -.. code-block:: lisp - - (require 'package) - (add-to-list 'package-archives - '("marmalade" . "http://marmalade-repo.org/packages/")) - - -Then run ``M-x package-refresh-contents`` to load the contents of the -new repository, and ``M-x package-install RET elpy RET`` to install -elpy. - -Finally, add the following to your ``.emacs``: - -.. code-block:: lisp - - (package-initialize) - (elpy-enable) - -Done. diff --git a/emacs.d/elpa/elpy-1.2.1/elpy-autoloads.el b/emacs.d/elpa/elpy-1.2.1/elpy-autoloads.el deleted file mode 100644 index 57f6e05..0000000 --- a/emacs.d/elpa/elpy-1.2.1/elpy-autoloads.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; elpy-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (elpy-mode elpy-disable elpy-enable) "elpy" "elpy.el" -;;;;;; (21139 23652 0 0)) -;;; Generated autoloads from elpy.el - -(autoload 'elpy-enable "elpy" "\ -Enable Elpy in all future Python buffers. - -When SKIP-INITIALIZE-VARIABLES is non-nil, this will NOT call -`elpy-initialize-variables' to configure various modes in a way -that the Elpy author considers sensible. If you'd rather -configure those modes yourself, pass t here. - -\(fn &optional SKIP-INITIALIZE-VARIABLES)" t nil) - -(autoload 'elpy-disable "elpy" "\ -Disable Elpy in all future Python buffers. - -\(fn)" t nil) - -(autoload 'elpy-mode "elpy" "\ -Minor mode in Python buffers for the Emacs Lisp Python Environment. - -This mode fully supports virtualenvs. Once you switch a -virtualenv using \\[virtualenv-workon], you can use -\\[elpy-rpc-restart] to make the elpy Python process use your -virtualenv. - -See https://github.com/jorgenschaefer/elpy/wiki/Keybindings for a -more structured list. - -\\{elpy-mode-map} - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("elpy-pkg.el" "elpy-refactor.el") (21139 -;;;;;; 23652 758883 0)) - -;;;*** - -(provide 'elpy-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; elpy-autoloads.el ends here diff --git a/emacs.d/elpa/elpy-1.2.1/elpy-pkg.el b/emacs.d/elpa/elpy-1.2.1/elpy-pkg.el deleted file mode 100644 index 3aa8c12..0000000 --- a/emacs.d/elpa/elpy-1.2.1/elpy-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "elpy" "1.2.1" - "Emacs Python Development Environment" - '((auto-complete "1.4") - (find-file-in-project "3.2") - (fuzzy "0.1") ;; For auto-complete - (highlight-indentation "0.5.0") - (idomenu "0.1") - (iedit "0.97") - (nose "0.1.1") - (virtualenv "1.2") - (yasnippet "0.8.0")) - ) diff --git a/emacs.d/elpa/elpy-1.2.1/elpy-pkg.elc b/emacs.d/elpa/elpy-1.2.1/elpy-pkg.elc deleted file mode 100644 index c377d77079073721ddbf0d7c77beada176eec6c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 807 zcmbu7&yLeD5XO7X3veCfLMv_DB;AEAy#S?$l~}YA@BmYLnwUCvWIILa(=$%cY7xh^ z^2g5i<@b#>-W|T~-z*l3Y`5FN-gUh;q~JKh(Nl~DZKIt1_;OJ^qWtXKxp?wU7$?zy zv+&6GH+O;h4$AF^im!K2m(^zCp1kYe#AI0i4CKT5C2uXLLm7lxlj$)%#-b9nsOD*Z zZUmVLqb(eg6)w!s99Z9qji@H=w~j5K;ad8rJAK8-h9I&@{L$(#=MRAbsL^7lB`7CD z^x8JzhE*RTpi;d1=bUOQ>g|6F<(Oez1nF!*FyMw5rwva#OGx!jglja0yEN0wzvMJH{k=uw`rA;?pka>%Df z@q6ye(->QB%NM$kaeYTN!ogm&cQ(y)c)MKU5M3epoEeIYsl;u*f+e$6kq$_qZP9!8 zi)4g+BkD;UuGbOrQdDWx>ZUb(N46@aPK{3LohXy8mE*AC*{?}yW|d<5KFQVvj%C(N b -;; URL: https://github.com/jorgenschaefer/elpy - -;; 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 . - -;;; Commentary: - -;; This file provides an interface, including a major mode, to use -;; refactoring options provided by the Rope library. - -;;; Code: - -;; We require elpy, but elpy loads us, so we shouldn't load it back. -;; (require 'elpy) - -(defvar elpy-refactor-changes nil - "Changes that will be commited on \\[elpy-refactor-commit].") -(make-variable-buffer-local 'elpy-refactor-current-changes) - -(defvar elpy-refactor-window-configuration nil - "The old window configuration. Will be restored after commit.") -(make-variable-buffer-local 'elpy-refactor-window-configuration) - -(defun elpy-refactor () - "Run the Elpy refactoring interface for Python code." - (interactive) - (save-some-buffers) - (let* ((selection (elpy-refactor-select - (elpy-refactor-rpc-get-options))) - (method (car selection)) - (args (cdr selection))) - (when method - (elpy-refactor-create-change-buffer - (elpy-refactor-rpc-get-changes method args))))) - -(defun elpy-refactor-select (options) - "Show the user the refactoring options and let her choose one. - -Depending on the chosen option, ask the user for further -arguments and build the argument. - -Return a cons cell of the name of the option and the arg list -created." - (let ((buf (get-buffer-create "*Elpy Refactor*")) - (pos (vector (1- (point)) - (ignore-errors - (1- (region-beginning))) - (ignore-errors - (1- (region-end))))) - (inhibit-read-only t) - (options (sort options - (lambda (a b) - (let ((cata (cdr (assq 'category a))) - (catb (cdr (assq 'category b)))) - (if (equal cata catb) - (string< (cdr (assq 'description a)) - (cdr (assq 'description b))) - (string< cata catb)))))) - (key ?a) - last-category - option-alist) - (with-current-buffer buf - (erase-buffer) - (dolist (option options) - (let ((category (cdr (assq 'category option))) - (description (cdr (assq 'description option))) - (name (cdr (assq 'name option))) - (args (cdr (assq 'args option)))) - (when (not (equal category last-category)) - (when last-category - (insert "\n")) - (insert (propertize category 'face 'bold) "\n") - (setq last-category category)) - (insert " (" key ") " description "\n") - (setq option-alist (cons (list key name args) - option-alist)) - (setq key (1+ key)))) - (let ((window-conf (current-window-configuration))) - (unwind-protect - (progn - (with-selected-window (display-buffer buf) - (goto-char (point-min))) - (fit-window-to-buffer (get-buffer-window buf)) - (let* ((key (read-key "Refactoring action? ")) - (entry (cdr (assoc key option-alist)))) - (kill-buffer buf) - (cons (car entry) ; name - (elpy-refactor-build-arguments (cadr entry) - pos)))) - (set-window-configuration window-conf)))))) - -(defun elpy-refactor-build-arguments (args pos) - "Translate an argument list specification to an argument list. - -POS is a vector of three elements, the current offset, the offset -of the beginning of the region, and the offset of the end of the -region. - -ARGS is a list of triples, each triple containing the name of an -argument (ignored), the type of the argument, and a possible -prompt string. - -Available types: - - offset - The offset in the buffer, (1- (point)) - start_offset - Offset of the beginning of the region - end_offset - Offset of the end of the region - string - A free-form string - filename - A non-existing file name - directory - An existing directory name - boolean - A boolean question" - (mapcar (lambda (arg) - (let ((type (cadr arg)) - (prompt (caddr arg))) - (cond - ((equal type "offset") - (aref pos 0)) - ((equal type "start_offset") - (aref pos 1)) - ((equal type "end_offset") - (aref pos 2)) - ((equal type "string") - (read-from-minibuffer prompt)) - ((equal type "filename") - (expand-file-name - (read-file-name prompt))) - ((equal type "directory") - (expand-file-name - (read-directory-name prompt))) - ((equal type "boolean") - (y-or-n-p prompt))))) - args)) - -(defun elpy-refactor-create-change-buffer (changes) - "Show the user a buffer of changes. - -The user can review the changes and confirm them with -\\[elpy-refactor-commit]." - (when (not changes) - (error "No changes for this refactoring action.")) - (with-current-buffer (get-buffer-create "*Elpy Refactor*") - (elpy-refactor-mode) - (setq elpy-refactor-changes changes - elpy-refactor-window-configuration (current-window-configuration)) - (let ((inhibit-read-only t)) - (erase-buffer) - (elpy-refactor-insert-changes changes)) - (select-window (display-buffer (current-buffer))) - (goto-char (point-min)))) - -(defun elpy-refactor-insert-changes (changes) - "Format and display the changes described in CHANGES." - (insert (propertize "Use C-c C-c to apply the following changes." - 'face 'bold) - "\n\n") - (dolist (change changes) - (let ((action (cdr (assq 'action change)))) - (cond - ((equal action "change") - (insert (cdr (assq 'diff change)) - "\n")) - ((equal action "create") - (let ((type (cdr (assq 'type change)))) - (if (equal type "file") - (insert "+++ " (cdr (assq 'file change)) "\n" - "Create file " (cdr (assq 'file change)) "\n" - "\n") - (insert "+++ " (cdr (assq 'path change)) "\n" - "Create directory " (cdr (assq 'path change)) "\n" - "\n")))) - ((equal action "move") - (insert "--- " (cdr (assq 'source change)) "\n" - "+++ " (cdr (assq 'destination change)) "\n" - "Rename " (cdr (assq 'type change)) "\n" - "\n")) - ((equal action "delete") - (let ((type (cdr (assq 'type change)))) - (if (equal type "file") - (insert "--- " (cdr (assq 'file change)) "\n" - "Delete file " (cdr (assq 'file change)) "\n" - "\n") - (insert "--- " (cdr (assq 'path change)) "\n" - "Delete directory " (cdr (assq 'path change)) "\n" - "\n")))))))) - -(defvar elpy-refactor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-c") 'elpy-refactor-commit) - (define-key map (kbd "q") 'bury-buffer) - (define-key map (kbd "h") 'describe-mode) - (define-key map (kbd "?") 'describe-mode) - map) - "The key map for `elpy-refactor-mode'.") - -(define-derived-mode elpy-refactor-mode diff-mode "Elpy Refactor" - "Mode to display refactoring actions and ask confirmation from the user. - -\\{elpy-refactor-mode-map}" - :group 'elpy - (view-mode 1)) - -(defun elpy-refactor-commit () - "Commit the changes in the current buffer." - (interactive) - (when (not elpy-refactor-changes) - (error "No changes to commit.")) - ;; Restore the window configuration as the first thing so that - ;; changes below are visible to the user. Especially the point - ;; change in possible buffer changes. - (set-window-configuration elpy-refactor-window-configuration) - (dolist (change elpy-refactor-changes) - (let ((action (cdr (assq 'action change)))) - (cond - ((equal action "change") - (with-current-buffer (find-file-noselect (cdr (assq 'file change))) - ;; This would break for save-excursion as the buffer is - ;; truncated, so all markets now point to position 1. - (let ((old-point (point))) - (undo-boundary) - (erase-buffer) - (insert (cdr (assq 'contents change))) - (undo-boundary) - (goto-char old-point)))) - ((equal action "create") - (if (equal (cdr (assq 'type change)) - "file") - (find-file-noselect (cdr (assq 'file change))) - (make-directory (cdr (assq 'path change))))) - ((equal action "move") - (let* ((source (cdr (assq 'source change))) - (dest (cdr (assq 'destination change))) - (buf (get-file-buffer source))) - (when buf - (with-current-buffer buf - (setq buffer-file-name dest) - (rename-buffer (file-name-nondirectory dest) t))) - (rename-file source dest))) - ((equal action "delete") - (if (equal (cdr (assq 'type change)) "file") - (let ((name (cdr (assq 'file change)))) - (when (y-or-n-p (format "Really delete %s? " name)) - (delete-file name t))) - (let ((name (cdr (assq 'directory change)))) - (when (y-or-n-p (format "Really delete %s? " name)) - (delete-directory name nil t)))))))) - (kill-buffer (current-buffer))) - -(defun elpy-refactor-rpc-get-options () - "Get a list of refactoring options from the Elpy RPC." - (if (use-region-p) - (elpy-rpc "get_refactor_options" - (list (elpy-project-root) - (buffer-file-name) - (1- (region-beginning)) - (1- (region-end)))) - (elpy-rpc "get_refactor_options" - (list (elpy-project-root) - (buffer-file-name) - (1- (point)))))) - -(defun elpy-refactor-rpc-get-changes (method args) - "Get a list of changes from the Elpy RPC after applying METHOD with ARGS." - (elpy-rpc "refactor" - (list (elpy-project-root) - (buffer-file-name) - method args))) - -(provide 'elpy-refactor) -;;; elpy-refactor.el ends here diff --git a/emacs.d/elpa/elpy-1.2.1/elpy-refactor.elc b/emacs.d/elpa/elpy-1.2.1/elpy-refactor.elc deleted file mode 100644 index 28b1176ebd7e7015914ababcd546cb78109fd784..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10195 zcmc&)3v=7X5!N)*sZ38elQ>bGIA+#x9h0^|<3-Yn+ldrKd9;m_iQLCbsM;V2N{C5- z0YEuQr~kd*?%jcaM5}I{nR-kLxX0e!-tM=LP112*WN~tw zZ=*NM3koL_h@f1@-RXKe7idgU&`8pP#%WT77`!Z|_CvHJ_TJ(CS6|WiB+S4#nB11- z!(>8vO5-r0QAD#etSzE9lT#FCvpCAAIKe>ASL@NevhOn`naXO#J1*C@a7=ABDXwJ=6eMj978|_InJqHHe@9*F_1#XV z(VmCTBOBx6a5RhT(Q-PCGFvI!-E$1+ZflS%r54{918 zFEde!F8xijo<%vd3#^Az9G2e6OPN))u%`+wT5&$`|4Yu-(PQ>|K7F@LAmoS+U=U=a z2|a~of>9VnMAI~*Z_kPoNPV16BF%L;i^H7iBBI;hGndxTcYGRpu7igFpB~-9n|pot zz0JM%uM9n>cYOoReS8L2hRM*nbsvobi@wjJSu|#QqIrZBA+PK>r#w83>^z;D^ML}h z{Tg;{HS1hswiw&TQDL){!amRSjIRe>vM*L*I3t9pc-?$HT{m9t`w5G{f!j`)xd6ygS$& z`kpg{`glCvWu1BN{TtUmxY@d&HShn3cW9L7iE3f2>$bLeOv{G$FlB$EY42`rV~pQK zkKfoW9avs zt5=5BUJH#q7X!Gz>3~MhYdUywTkhU&=gpzj9Zo+5H*9-GPt{)=1`anh3v(bIOyxMu z&ggk`24FaeM{xn`3nzA(%+6?$=ERn!!BZ&>S@#4}zSExdo&{gZE>;2A=!~roa3b2` z(4l4`i;iKf_6UEH1SWArZim|KD9h5UgQx#64|a5JMgf1A6+otTNF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*<=`^>PfZO^AY@!zE1shrOBdPl|?`+-0 z2(jYk9b8qygbhaE8gHw4N4@gZ^lF3tYH``~OZEr=<6W9fwAvt#v(xu`ZQOVZKR6-` z3*096m&=#y;o{Hi>}3Q*0D;d07(0DmV5`%)Du;dzs|4@xMPm>wcu5AQx)B%^t+%eN zQmLUYONwzbWlIqqRU=&1)oNF8n@XdR{<6KUC0|Q}5$KqjCho%dM*%7yMc|JcA&&n; zl)CHpX}D^T%kVOBmb$CXo+aH|<*+JaR@w2Iw3siOq=c&Ln+O(AW;fSJWpUL;Ieta6 zKrST1RElo$X;W6^l$Z-%NVz5PQT=o$=esKPB5NYTFr|Fmx@xFiW^o!XcUFqWN(Gpi zSp8h#VSp691Sk~Vz5u$0>edN$+iDzRu7JysMLCRb_bu4K4*MT?KC8kL{SD05~J8S%V|SSnlJQB{9VJx*gp Kob^1T)A%>8l4D>1 diff --git a/emacs.d/elpa/elpy-1.2.1/elpy.el b/emacs.d/elpa/elpy-1.2.1/elpy.el deleted file mode 100644 index ca17843..0000000 --- a/emacs.d/elpa/elpy-1.2.1/elpy.el +++ /dev/null @@ -1,1601 +0,0 @@ -;;; elpy.el --- Emacs Lisp Python Environment -*- lexical-binding: t -*- - -;; Copyright (C) 2012, 2013 Jorgen Schaefer - -;; Author: Jorgen Schaefer -;; URL: https://github.com/jorgenschaefer/elpy -;; Version: 1.2.1 - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License -;; as published by the Free Software Foundation; either version 3 -;; of the License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; The Emacs Lisp Python Environment in Emacs - -;; Elpy is an Emacs package to bring powerful Python editing to Emacs. -;; It combines a number of existing Emacs packages, and uses one of a -;; selection of Python packages for code introspection. - -;; To use, you need to install not only this package, but a few Python -;; packages as well. See the installation instructions on the wiki. - -;; Documentation is available there as well. - -;; https://github.com/jorgenschaefer/elpy/wiki - -;;; Code: - -(require 'auto-complete-config) -(require 'elpy-refactor) -(require 'etags) -(require 'find-file-in-project) -(require 'flymake) -(require 'highlight-indentation) -(require 'idomenu) -(require 'json) -(require 'nose) -(require 'python) -(require 'grep) -(require 'thingatpt) -(require 'virtualenv) -(require 'yasnippet) - - -;;;;;;;;;;;;;;; -;;; Elpy itself - -(defgroup elpy nil - "The Emacs Lisp Python Environment." - :prefix "elpy-" - :group 'languages) - -(defcustom elpy-rpc-python-command "python" - "The command to be used for the RPC backend." - :type 'string - :group 'elpy) - -(defcustom elpy-rpc-project-specific nil - "Whether Elpy should use a separate process for each project." - :type 'boolean - :group 'elpy) - -(defcustom elpy-rpc-backend nil - "Your preferred backend. - -Either nil, or a string. - -nil - Select a backend automatically. -rope - Use the Rope refactoring library. This will create - .ropeproject directories in your project roots. -jedi - Use the Jedi completion library. -native - Do not use any backend, use native Python methods only." - :type '(choice (const "rope") - (const "jedi") - (const "native") - (const nil)) - :group 'elpy) - -(defcustom elpy-default-minor-modes '(eldoc-mode - flymake-mode - highlight-indentation-mode - yas-minor-mode - auto-complete-mode) - "Minor modes enabled when `elpy-mode' is enabled." - :group 'elpy) - -(defcustom elpy-rgrep-ignored-directories '(".tox" "build" "dist") - "Directories ignored by `elpy-rgrep-symbol'. - -These are prepended to `grep-find-ignored-directories'." - :group 'elpy) - -(defcustom elpy-mode-hook nil - "Hook run when `elpy-mode' is enabled." - :group 'elpy) - -(defconst elpy-version "1.2.1" - "The version of the Elpy lisp code.") - -(defun elpy-version () - "Echo the version of Elpy." - (interactive) - (let ((version elpy-version) - (rpc-version (when elpy-rpc--buffer - (or (ignore-errors - (elpy-rpc "version" nil)) - "1.1")))) - (if (equal version "devel") - (setq version "development version") - (setq version (format "version %s" version))) - (when rpc-version - (if (equal rpc-version "devel") - (setq rpc-version "development version") - (setq rpc-version (format "version %s" rpc-version)))) - (if rpc-version - (message "Elpy %s using the Python backend %s" - version rpc-version) - (message "Elpy %s" version)))) - -(defvar elpy-mode-map - (let ((map (make-sparse-keymap))) - ;; Alphabetical order to make it easier to find free C-c C-X - ;; bindings in the future. Heh. - - ;; (define-key map (kbd "") 'python-indent-dedent-line-backspace) - ;; (define-key map (kbd "") 'python-indent-dedent-line) - ;; (define-key map (kbd "") 'ac-trigger-key) - - ;; (define-key map (kbd "C-M-x") 'python-shell-send-defun) - ;; (define-key map (kbd "C-c <") 'python-indent-shift-left) - ;; (define-key map (kbd "C-c >") 'python-indent-shift-right) - (define-key map (kbd "C-c C-c") 'elpy-shell-send-region-or-buffer) - (define-key map (kbd "C-c C-z") 'elpy-shell-switch-to-shell) - (define-key map (kbd "C-c C-d") 'elpy-doc) - (define-key map (kbd "C-c C-f") 'find-file-in-project) - ;; (define-key map (kbd "C-c C-i") 'yasnippet-expand) - (define-key map (kbd "C-c C-j") 'idomenu) - (define-key map (kbd "C-c C-n") 'elpy-flymake-forward-error) - (define-key map (kbd "C-c C-o") 'elpy-occur-definitions) - (define-key map (kbd "C-c C-p") 'elpy-flymake-backward-error) - (define-key map (kbd "C-c C-q") 'elpy-show-defun) - (define-key map (kbd "C-c C-r") 'elpy-refactor) - (define-key map (kbd "C-c C-s") 'elpy-rgrep-symbol) - (define-key map (kbd "C-c C-t") 'elpy-test) - (define-key map (kbd "C-c C-v") 'elpy-check) - (define-key map (kbd "C-c C-w") 'elpy-doc-websearch) - ;; (define-key map (kbd "C-c C-z") 'python-shell-switch-to-shell) - - (define-key map (kbd "") 'elpy-nav-forward-definition) - (define-key map (kbd "") 'elpy-nav-backward-definition) - ;; (define-key map (kbd "M-,") 'iedit-mode - (define-key map (kbd "M-.") 'elpy-goto-definition) - (define-key map (kbd "M-a") 'elpy-nav-backward-statement) - (define-key map (kbd "M-e") 'elpy-nav-forward-statement) - (define-key map (kbd "M-n") 'elpy-nav-forward-definition) - (define-key map (kbd "M-p") 'elpy-nav-backward-definition) - - map) - "Key map for the Emacs Lisp Python Environment.") - -;;;###autoload -(defun elpy-enable (&optional skip-initialize-variables) - "Enable Elpy in all future Python buffers. - -When SKIP-INITIALIZE-VARIABLES is non-nil, this will NOT call -`elpy-initialize-variables' to configure various modes in a way -that the Elpy author considers sensible. If you'd rather -configure those modes yourself, pass t here." - (interactive) - (when (< emacs-major-version 24) - (error "Elpy requires Emacs 24 or newer")) - (let ((filename (find-lisp-object-file-name 'python-mode - 'symbol-function))) - (when (and filename - (string-match "/python-mode\\.el\\'" - filename)) - (error (concat "You are using python-mode.el. " - "Elpy only works with python.el from " - "Emacs 24 and above")))) - (add-hook 'python-mode-hook 'elpy-mode) - (when (not skip-initialize-variables) - (elpy-initialize-variables))) - -;;;###autoload -(defun elpy-disable () - "Disable Elpy in all future Python buffers." - (interactive) - (remove-hook 'python-mode-hook 'elpy-mode)) - -;;;###autoload -(define-minor-mode elpy-mode - "Minor mode in Python buffers for the Emacs Lisp Python Environment. - -This mode fully supports virtualenvs. Once you switch a -virtualenv using \\[virtualenv-workon], you can use -\\[elpy-rpc-restart] to make the elpy Python process use your -virtualenv. - -See https://github.com/jorgenschaefer/elpy/wiki/Keybindings for a -more structured list. - -\\{elpy-mode-map}" - :lighter " Elpy" - (when (not (eq major-mode 'python-mode)) - (error "Elpy only works with `python-mode'")) - (cond - (elpy-mode - (when buffer-file-name - (set (make-local-variable 'ffip-project-root) (elpy-project-root))) - (set (make-local-variable 'eldoc-documentation-function) - 'elpy-eldoc-documentation) - (add-to-list 'ac-sources 'ac-source-elpy) - (add-to-list 'ac-sources 'ac-source-elpy-dot) - ;; Enable modes, hence the 1. - (run-hook-with-args 'elpy-default-minor-modes 1)) - (t - (kill-local-variable 'ffip-project-root) - (kill-local-variable 'eldoc-documentation-function) - (setq ac-sources - (delq 'ac-source-elpy - (delq 'ac-source-elpy-dot - ac-sources)))))) - -(defun elpy-installation-instructions (message &optional show-elpy-module) - "Display a window with installation instructions for the Python -side of elpy. - -MESSAGE is shown as the first paragraph. - -If SHOW-ELPY-MODULE is non-nil, the help buffer will first -explain how to install the elpy module." - (with-help-window "*Elpy Installation*" - (with-current-buffer "*Elpy Installation*" - (let ((inhibit-read-only t)) - (erase-buffer) - (insert "Elpy Installation Instructions\n") - (insert "\n") - (insert message) - (when (not (bolp)) - (insert "\n")) - (insert "\n") - (when show-elpy-module - (insert "Elpy requires the Python module \"elpy\". The module " - "is available from pypi, so you can install it using " - "the following command:\n") - (insert "\n") - (elpy-installation-command "elpy") - (insert "\n")) - (insert "To find possible completions, Elpy uses one of two " - "Python modules. Either \"rope\" or \"jedi\". To use " - "Elpy to its fullest potential, you should install " - "either one of them. Which one is a matter of taste. " - "You can try both and even switch at runtime using " - "M-x elpy-set-backend.\n") - (insert "\n") - (insert "Elpy also uses the Rope module for refactoring options, " - "so you likely want to install it even if you use jedi " - "for completion.\n") - (insert "\n") - (if (string-match "Python 3" (shell-command-to-string - "python --version")) - (elpy-installation-command "rope_py3k") - (elpy-installation-command "rope")) - (insert "\n") - (elpy-installation-command "jedi") - (insert "\n") - (insert "If you are using virtualenvs, you can use the " - "M-x virtualenv-workon command to switch to a virtualenv " - "of your choice. Afterwards, running the command " - "M-x elpy-rpc-restart will use the packages in " - "that virtualenv.") - (fill-region (point-min) (point-max)))))) - -(defun elpy-installation-command (python-module) - "Insert an installation command description for PYTHON-MODULE." - (let* ((do-user-install (not (or (getenv "VIRTUAL_ENV") - virtualenv-workon-session))) - (user-option (if do-user-install - "--user " - "")) - (command (cond - ((executable-find "pip") - (format "pip install %s%s" user-option python-module)) - ((executable-find "easy_install") - (format "easy_install %s%s" user-option python-module)) - (t - nil)))) - (if (not command) - (insert "... hm. It appears you have neither pip nor easy_install " - "available. You might want to get the python-pip or " - "or python-setuptools package.\n") - (insert-text-button "[run]" - 'action (lambda (button) - (async-shell-command - (button-get button 'command))) - 'command command) - (insert " " command "\n")))) - -(defun elpy-initialize-variables () - "This sets some variables in other modes we like to set. - -If you want to configure your own keys, do so after this function -is called (usually from `elpy-enable'), or override this function -using (defalias 'elpy-initialize-variables 'identity)" - ;; Local variables in `python-mode'. This is not removed when Elpy - ;; is disabled, which can cause some confusion. - (add-hook 'python-mode-hook 'elpy-initialize-local-variables) - - ;; Flymake support using flake8, including warning faces. - (when (or (executable-find "flake8") - (not (executable-find python-check-command))) - (setq python-check-command "flake8")) - - ;; `flymake-no-changes-timeout': The original value of 0.5 is too - ;; short for Python code, as that will result in the current line to - ;; be highlighted most of the time, and that's annoying. This value - ;; might be on the long side, but at least it does not, in general, - ;; interfere with normal interaction. - (setq flymake-no-changes-timeout 60) - - ;; `flymake-start-syntax-check-on-newline': This should be nil for - ;; Python, as;; most lines with a colon at the end will mean the next - ;; line is always highlighted as error, which is not helpful and - ;; mostly annoying. - (setq flymake-start-syntax-check-on-newline nil) - - ;; `ac-trigger-key': TAB is a great trigger key. We also need to - ;; tell auto-complete about the new trigger key. This is a bad - ;; interface to set the trigger key. Don't do this. Just let the - ;; user set the key in the keymap. Stop second-guessing the user, or - ;; Emacs. - (setq ac-trigger-key "TAB") - (when (fboundp 'ac-set-trigger-key) - (ac-set-trigger-key ac-trigger-key)) - - ;; `ac-auto-show-menu': Short timeout because the menu is great. - (setq ac-auto-show-menu 0.4) - - ;; `ac-quick-help-delay': I'd like to show the menu right with the - ;; completions, but this value should be greater than - ;; `ac-auto-show-menu' to show help for the first entry as well. - (setq ac-quick-help-delay 0.5) - - ;; Fix some key bindings in ac completions. Using RET when a - ;; completion is offered is not usually intended to complete (use - ;; TAB for that), but done while typing and the inputer is considere - ;; complete, with the intent to simply leave it as is and go to the - ;; next line. Much like space will not complete, but leave it as is - ;; and insert a space. - (define-key ac-completing-map (kbd "RET") nil) - (define-key ac-completing-map (kbd "") nil) - - ;; `yas-trigger-key': TAB, as is the default, conflicts with the - ;; autocompletion. We also need to tell yasnippet about the new - ;; binding. This is a bad interface to set the trigger key. Stop - ;; doing this. - (let ((old (when (boundp 'yas-trigger-key) - yas-trigger-key))) - (setq yas-trigger-key "C-c C-i") - (when (fboundp 'yas--trigger-key-reload) - (yas--trigger-key-reload old))) - - ;; We provide some YASnippet snippets. Add them. - (add-to-list - 'yas-snippet-dirs - (concat (file-name-directory (locate-library "elpy")) "snippets/") - t) - - ;; Now load yasnippets. - (yas-reload-all)) - -(defun elpy-initialize-local-variables () - "Initialize local variables in python-mode. - -This should be run from `python-mode-hook'." - ;; Set `forward-sexp-function' to nil in python-mode. See - ;; http://debbugs.gnu.org/db/13/13642.html - (setq forward-sexp-function nil) - ;; Enable warning faces for flake8 output. - (when (string-match "flake8" python-check-command) - ;; COMPAT: Obsolete variable as of 24.4 - (if (boundp 'flymake-warning-predicate) - (set (make-local-variable 'flymake-warning-predicate) "^W[0-9]") - (set (make-local-variable 'flymake-warning-re) "^W[0-9]")))) - -(defvar elpy-project-root nil - "The root of the project the current buffer is in.") -(make-variable-buffer-local 'elpy-project-root) -(put 'elpy-project-root 'safe-local-variable 'file-directory-p) - -(defun elpy-project-root () - "Return the root of the current buffer's project. - -You can set the variable `elpy-project-root' in, for example, -.dir-locals.el to configure this." - (when (not elpy-project-root) - (setq elpy-project-root (elpy-project--find-root)) - (when (equal (directory-file-name (expand-file-name default-directory)) - (directory-file-name (expand-file-name "~"))) - (display-warning 'elpy - (concat "Project root set to your home directory; " - "this can slow down operation considerably") - :warning))) - elpy-project-root) - -(defun elpy-project--find-root () - "Find the first directory in the tree not containing an __init__.py - -If there is no __init__.py in the current directory, return the -current directory." - (if (file-exists-p (format "%s/__init__.py" default-directory)) - (locate-dominating-file default-directory - (lambda (dir) - (not (file-exists-p - (format "%s/__init__.py" dir))))) - default-directory)) - -(defun elpy-set-project-root (new-root) - "Set the Elpy project root to NEW-ROOT." - (interactive "DNew project root: ") - (setq elpy-project-root new-root)) - -(defun elpy-use-ipython (&optional ipython) - "Set defaults to use IPython instead of the standard interpreter. - -With prefix arg, prompt for the command to use." - (interactive (list (when current-prefix-arg - (read-file-name "IPython command: ")))) - (when (not ipython) - (setq ipython "ipython")) - (if (boundp 'python-python-command) - ;; Emacs 24 until 24.3 - (setq python-python-command ipython) - ;; Emacs 24.3 and onwards. - - ;; This is from the python.el commentary. - ;; Settings for IPython 0.11: - (setq python-shell-interpreter ipython - python-shell-interpreter-args "" - python-shell-prompt-regexp "In \\[[0-9]+\\]: " - python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " - python-shell-completion-setup-code - "from IPython.core.completerlib import module_completion" - python-shell-completion-module-string-code - "';'.join(module_completion('''%s'''))\n" - python-shell-completion-string-code - "';'.join(get_ipython().Completer.all_completions('''%s'''))\n"))) - -(defun elpy-use-cpython (&optional cpython) - "Set defaults to use the standard interpreter instead of IPython. - -With prefix arg, prompt for the command to use." - (interactive (list (when current-prefix-arg - (read-file-name "Python command: ")))) - (when (not cpython) - (setq cpython "python")) - (if (boundp 'python-python-command) - ;; Emacs 24 until 24.3 - (setq python-python-command cpython) - ;; Emacs 24.3 and onwards. - (setq python-shell-interpreter cpython - python-shell-interpreter-args "-i" - python-shell-prompt-regexp ">>> " - python-shell-prompt-output-regexp "" - python-shell-completion-setup-code -"try: - import readline -except ImportError: - def __COMPLETER_all_completions(text): [] -else: - import rlcompleter - readline.set_completer(rlcompleter.Completer().complete) - def __COMPLETER_all_completions(text): - import sys - completions = [] - try: - i = 0 - while True: - res = readline.get_completer()(text, i) - if not res: break - i += 1 - completions.append(res) - except NameError: - pass - return completions" - python-shell-completion-module-string-code "" - python-shell-completion-string-code - "';'.join(__COMPLETER_all_completions('''%s'''))\n"))) - -(defun elpy-clean-modeline () - "Clean up the mode line by removing some lighters. - -It's not necessary to see (Python Elpy yas AC ElDoc) all the -time. Honestly." - (interactive) - (setq eldoc-minor-mode-string nil) - (dolist (mode '(elpy-mode yas-minor-mode auto-complete-mode - flymake-mode)) - (setcdr (assq mode minor-mode-alist) - (list "")))) - -(defun elpy-shell-send-region-or-buffer (&optional arg) - "Send the active region or the buffer to the Python shell. - -If there is an active region, send that. Otherwise, send the -whole buffer. - -Without prefix argument, this will escape the Python idiom of -if __name__ == '__main__' to be false to avoid accidental -execution of code. With prefix argument, this code is executed." - (interactive "P") - ;; Ensure process exists - (elpy-shell-get-or-create-process) - (if (region-active-p) - (python-shell-send-string (elpy--region-without-indentation - (region-beginning) (region-end)) - nil t) - (python-shell-send-buffer arg)) - (elpy-shell-switch-to-shell)) - -(defun elpy--region-without-indentation (beg end) - "Return the current region as a string, but without indentation." - (let ((region (buffer-substring beg end)) - (indent-level nil)) - (catch 'return - (with-temp-buffer - (insert region) - (goto-char (point-min)) - (while (< (point) (point-max)) - (cond - ((and (not indent-level) - (not (looking-at "[ \t]*$"))) - (setq indent-level (current-indentation))) - ((and indent-level - (not (looking-at "[ \t]*$")) - (< (current-indentation) - indent-level)) - (error "Can't adjust indentation, consecutive lines indented less than starting line"))) - (forward-line)) - (indent-rigidly (point-min) - (point-max) - (- indent-level)) - (buffer-string))))) - -(defun elpy-shell-switch-to-shell () - "Switch to inferior Python process buffer." - (interactive) - (pop-to-buffer (process-buffer (elpy-shell-get-or-create-process)) t)) - -(defun elpy-shell-get-or-create-process () - "Get or create an inferior Python process for current buffer and return it." - (let* ((bufname (format "*%s*" (python-shell-get-process-name nil))) - (proc (get-buffer-process bufname))) - (if proc - proc - (run-python (python-shell-parse-command)) - (get-buffer-process bufname)))) - -(defun elpy-check (&optional whole-project-p) - "Run `python-check-command' on the current buffer's file, - -or the project root if WHOLE-PROJECT-P is non-nil (interactively, -with a prefix argument)." - (interactive "P") - (when (not (buffer-file-name)) - (error "Can't check a buffer without a file.")) - (save-some-buffers (not compilation-ask-about-save) nil) - (let ((process-environment (python-shell-calculate-process-environment)) - (exec-path (python-shell-calculate-exec-path)) - (file-name-or-directory (expand-file-name - (if whole-project-p - (elpy-project-root) - (buffer-file-name)))) - (extra-args (if whole-project-p - " --exclude=.svn,CVS,.bzr,.hg,.git,.tox,build,dist" - ""))) - (compilation-start (concat python-check-command - " " - (shell-quote-argument file-name-or-directory) - extra-args) - nil - (lambda (mode-name) - "*Python Check*")))) - -(defun elpy-show-defun () - "Show the current class and method, in case they are not on -screen." - (interactive) - (let ((function (python-info-current-defun))) - (if function - (message "%s()" function) - (message "Not in a function")))) - -(defun elpy-goto-definition () - "Go to the definition of the symbol at point, if found." - (interactive) - (let ((location (elpy-rpc-get-definition))) - (if location - (elpy-goto-location (car location) (cadr location)) - (error "No definition found")))) - -(defun elpy-goto-location (filename offset) - "Show FILENAME at OFFSET to the user." - (ring-insert find-tag-marker-ring (point-marker)) - (let ((buffer (find-file filename))) - (with-current-buffer buffer - (with-selected-window (get-buffer-window buffer) - (goto-char (1+ offset)))))) - -(defun elpy-nav-forward-statement () - "Move forward one statement. - -This will go to the end of the current statement, or the end of -the next one if already at the end." - (interactive) - (let ((old (point))) - (python-nav-end-of-statement) - (when (= old (point)) - (python-nav-forward-statement) - (python-nav-end-of-statement)))) - -(defun elpy-nav-backward-statement () - "Move backward one statement. - -This will go to the beginning of the current statement, or the -beginning of the previous one if already at the beginning." - (interactive) - (let ((old (point))) - (python-nav-beginning-of-statement) - (when (= old (point)) - (python-nav-backward-statement)))) - -(defun elpy-nav-forward-definition () - "Move forward to the next definition (class or function)." - (interactive) - (if (save-excursion - (forward-char 1) - (re-search-forward "^ *\\(def\\|class\\) " nil t)) - (goto-char (match-beginning 1)) - (goto-char (point-max)))) - -(defun elpy-nav-backward-definition () - "Move backward to the previous definition (class or function)." - (interactive) - (if (save-excursion - (forward-char -1) - (re-search-backward "^ *\\(def\\|class\\) " nil t)) - (goto-char (match-beginning 1)) - (goto-char (point-min)))) - -(defun elpy-occur-definitions () - "Display an occur buffer of all definitions in the current buffer. - -Also, switch to that buffer." - (interactive) - (let ((list-matching-lines-face nil)) - (occur "^ *\\(def\\|class\\) ")) - (let ((window (get-buffer-window "*Occur*"))) - (if window - (select-window window) - (switch-to-buffer "*Occur*")))) - -(defun elpy-rgrep-symbol (symbol) - "Search for SYMBOL in the current project. - -SYMBOL defaults to the symbol at point, or the current region if -active. - -With a prefix argument, prompt for a string to search for." - (interactive - (list - (cond - (current-prefix-arg - (read-from-minibuffer "Search for symbol: ")) - ((use-region-p) - (buffer-substring-no-properties (region-beginning) - (region-end))) - (t - (or (thing-at-point 'symbol) - (read-from-minibuffer "Search for symbol: ")))))) - (grep-compute-defaults) - (let ((grep-find-ignored-directories (append elpy-rgrep-ignored-directories - grep-find-ignored-directories))) - (rgrep (format "\\b%s\\b" symbol) - "*.py" - (elpy-project-root))) - (with-current-buffer next-error-last-buffer - (let ((inhibit-read-only t)) - (save-excursion - (goto-char (point-min)) - (when (re-search-forward "^find .*" nil t) - (replace-match (format "\\1\nSearching for symbol %s\n" - symbol))))))) - -(defun elpy-test (&optional arg) - "Run nosetests on the current project. - -With no prefix arg, all tests are run. -With one prefix arg, only the current test is run. -With two prefix args, only the current module is run." - (interactive "p") - (save-some-buffers) - (cond - ((>= arg 16) (nosetests-module)) - ((>= arg 4) (nosetests-one)) - (t (nosetests-all)))) - - -;;;;;;;;;;;;;;;;; -;;; Documentation - -(defvar elpy-doc-history nil - "History for the `elpy-doc' command.") - -(defun elpy-doc-websearch (what) - "Search the Python web documentation for the string WHAT." - (interactive - (list (read-from-minibuffer "Search Python.org for: " - (symbol-name (symbol-at-point))))) - (browse-url - (format "https://www.google.com/search?q=site:docs.python.org%%20%s" - what))) - -(defun elpy-doc (&optional use-pydoc-p symbol) - "Show documentation on the thing at point. - -If USE-PYDOC is non-nil (interactively, when a prefix argument is -given), use pydoc on the symbol SYMBOL (interactively, the symbol -at point). With a single prefix argument, the user gets a -completion interface for possible symbols. With two prefix -arguments, the interface simply asks for a string." - (interactive - (list current-prefix-arg - (let ((initial (with-syntax-table python-dotty-syntax-table - (let ((symbol (symbol-at-point))) - (if symbol - (symbol-name symbol) - nil))))) - (cond - ((and initial (not current-prefix-arg)) - initial) - ((equal current-prefix-arg '(16)) - ;; C-u C-u - (read-from-minibuffer "Pydoc: " initial nil nil - 'elpy-doc-history)) - (t - (elpy-ido-recursive-completing-read "Pydoc: " - 'elpy-pydoc--completions - "." - t - initial - 'elpy-doc-history)))))) - (let ((doc (if use-pydoc-p - (elpy-rpc-get-pydoc-documentation symbol) - (or (elpy-rpc-get-docstring) - ;; This will get the right position for - ;; multiprocessing.Queue(quxqux_|_) - (ignore-errors - (save-excursion - (elpy-nav-backward-statement) - (with-syntax-table python-dotty-syntax-table - (forward-symbol 1) - (backward-char 1)) - (elpy-rpc-get-docstring))))))) - (if doc - (with-help-window "*Python Doc*" - (with-current-buffer "*Python Doc*" - (erase-buffer) - (insert doc) - (goto-char (point-min)) - (while (re-search-forward "\\(.\\)\\1" nil t) - (replace-match (propertize (match-string 1) - 'face 'bold) - t t)))) - (message "No documentation available.")))) - -(defun elpy-pydoc--completions (rcr-prefix) - "Return a list of modules available in pydoc starting with RCR-PREFIX." - (sort (if (or (not rcr-prefix) - (equal rcr-prefix "")) - (elpy-rpc "get_pydoc_completions" nil) - (elpy-rpc "get_pydoc_completions" (list rcr-prefix))) - (lambda (a b) - (if (and (string-prefix-p "_" b) - (not (string-prefix-p "_" a))) - t - (string< (downcase a) - (downcase b)))))) - - -;;;;;;;;;;;; -;;; elpy-ido - -;; This is a wrapper around ido-completing-read, which does not -;; provide for recursive reads by default. - -(defvar elpy-ido-rcr-choice-function nil - "Internal variable for `elpy-ido-recursive-completing-read'. - -Don't touch. Won't help.") - -(defvar elpy-ido-rcr-selection nil - "Internal variable for `elpy-ido-recursive-completing-read'. - -Don't touch. Won't help.") - -(defvar elpy-ido-rcr-separator nil - "Internal variable for `elpy-ido-recursive-completing-read'. - -Don't touch. Won't help.") - -(defvar elpy-ido-rcr-choices nil - "Internal variable for `elpy-ido-recursive-completing-read'. - -Don't touch. Won't help.") - -(defun elpy-ido--rcr-selected () - "Return the currently selected compound." - (mapconcat #'identity - (reverse elpy-ido-rcr-selection) - elpy-ido-rcr-separator)) - -(defun elpy-ido--rcr-setup-keymap () - "Set up the ido keymap for `elpy-ido-recursive-completing-read'." - (define-key ido-completion-map (read-kbd-macro elpy-ido-rcr-separator) - 'elpy-ido-rcr-complete) - (define-key ido-completion-map (kbd "DEL") 'elpy-ido-rcr-backspace)) - -(defun elpy-ido-rcr-complete () - "Complete the current ido completion and attempt an extension." - (interactive) - (let* ((new (car ido-matches)) - (full (concat (elpy-ido--rcr-selected) - elpy-ido-rcr-separator - new)) - (choices (funcall elpy-ido-rcr-choice-function full))) - (when choices - (setq elpy-ido-rcr-choices choices - elpy-ido-rcr-selection (cons new elpy-ido-rcr-selection)) - (throw 'continue t)))) - -(defun elpy-ido-rcr-backspace (&optional n) - "Delete the last character in the minibuffer. - -If the minibuffer is empty, recurse to the last completion." - (interactive "p") - (if (= (minibuffer-prompt-end) (point)) - (progn - (setq elpy-ido-rcr-selection (cdr elpy-ido-rcr-selection) - elpy-ido-rcr-choices (funcall elpy-ido-rcr-choice-function - (elpy-ido--rcr-selected))) - (throw 'continue t)) - (delete-char (- n)))) - -(defun elpy-ido-recursive-completing-read (prompt choice-function - separator - &optional - require-match - initial-input - hist def) - "An alternative to `ido-completing-read' supporting recursive selection. - -The CHOICE-FUNCTION is called with a prefix string and should -find all possible selections with this prefix. The user is then -prompted with those options. When the user hits RET, the -currently selected option is returned. When the user hits the -SEPARATOR key, though, the currently selected option is appended, -with the separator, to the selected prefix, and the user is -prompted for further completions returned by CHOICE-FUNCTION. - -For REQUIRE-MATCH, INITIAL-INPUT, HIST and DEF, see -`completing-read'." - (let ((ido-setup-hook (cons 'elpy-ido--rcr-setup-keymap - ido-setup-hook)) - (elpy-ido-rcr-choice-function choice-function) - (elpy-ido-rcr-separator separator) - elpy-ido-rcr-choices - elpy-ido-rcr-selection) - (when initial-input - (let ((parts (reverse (split-string initial-input - (regexp-quote separator))))) - (setq initial-input (car parts) - elpy-ido-rcr-selection (cdr parts)))) - (setq elpy-ido-rcr-choices (funcall choice-function - (elpy-ido--rcr-selected))) - (catch 'return - (while t - (catch 'continue - (throw 'return - (let ((completion (ido-completing-read - (concat prompt - (elpy-ido--rcr-selected) - (if elpy-ido-rcr-selection - elpy-ido-rcr-separator - "")) - elpy-ido-rcr-choices - nil require-match - initial-input hist def))) - (concat - (mapconcat (lambda (element) - (concat element elpy-ido-rcr-separator)) - (reverse elpy-ido-rcr-selection) - "") - completion)))) - ;; after the first run, we don't want initial and default - ;; anymore. - (setq initial-input nil - def nil))))) - - -;;;;;;;;;;;;;;;;;;;;; -;;; elpy-rpc backends - -;; elpy-rpc is a simple JSON-based RPC protocol. It's mostly JSON-RPC -;; 1.0, except we do not implement the full protocol as we do not need -;; all the features. Emacs starts a Python subprocess which runs a -;; special module. The module reads JSON-RPC requests and responds -;; with JSON-RPC responses. - -(defvar elpy-rpc--call-id 0 - "Call id of the last elpy-rpc call. - -Used to associate responses to callbacks.") -(make-variable-buffer-local 'elpy-rpc--call-id) - -(defvar elpy-rpc--buffer-p nil - "True iff the current buffer is an elpy-rpc buffer.") -(make-variable-buffer-local 'elpy-rpc--buffer-p) - -(defvar elpy-rpc--buffer nil - "The elpy-rpc buffer associated with this buffer.") -(make-variable-buffer-local 'elpy-rpc--buffer) - -(defvar elpy-rpc--backend-project-root nil - "The project root used by this backend.") -(make-variable-buffer-local 'elpy-rpc--backend-project-root) - -(defvar elpy-rpc--backend-python-command nil - "The Python interpreter used by this backend.") -(make-variable-buffer-local 'elpy-rpc--backend-python-command) - -(defvar elpy-rpc--backend-callbacks nil - "The callbacks registered for calls to the current backend. - -This maps call IDs to functions.") -(make-variable-buffer-local 'elpy-rpc--backend-callbacks) - -(defvar elpy-rpc--timeout 1 - "Number of seconds to wait for a response. - -You can dynamically bind this to a higher value if you want to -wait longer.") - -(defun elpy-rpc--process-buffer-p (buffer) - "Return non-nil when BUFFER is an elpy-rpc buffer." - (buffer-local-value 'elpy-rpc--buffer-p buffer)) - -(defun elpy-rpc--live-p (buffer) - "Return non-nil when BUFFER is a live elpy-rpc process." - (and buffer - (get-buffer-process buffer) - (process-live-p (get-buffer-process buffer)))) - -(defun elpy-rpc--get-rpc-buffer () - "Return the RPC buffer associated with the current buffer, -creating one if necessary." - (cond - (elpy-rpc--buffer-p - (current-buffer)) - ((not elpy-mode) - (error "Not an Elpy buffer")) - ((elpy-rpc--live-p elpy-rpc--buffer) - elpy-rpc--buffer) - (t - (when elpy-rpc--buffer - (kill-buffer elpy-rpc--buffer)) - (setq elpy-rpc--buffer - (or (elpy-rpc--find-buffer (elpy-project-root) - elpy-rpc-python-command) - (elpy-rpc--open (elpy-project-root) - elpy-rpc-python-command))) - elpy-rpc--buffer))) - -(defun elpy-rpc--get-rpc-process () - "Return the RPC process associated with the current buffer, -creating one if necessary." - (get-buffer-process (elpy-rpc--get-rpc-buffer))) - -(defun elpy-rpc--find-buffer (project-root python-command) - "Return an existing RPC buffer for this project root and command." - (let ((result nil)) - (dolist (buf (buffer-list)) - (when (elpy-rpc--process-buffer-p buf) - (if (not (elpy-rpc--live-p buf)) - (kill-buffer buf) - (with-current-buffer buf - (when (and (equal elpy-rpc--backend-project-root - project-root) - (equal elpy-rpc--backend-python-command - python-command)) - (when result - (kill-buffer result)) - (setq result buf)))))) - result)) - -(defun elpy-rpc--open (project-root python-command) - "Start a new RPC process and return the associated buffer." - (when (and elpy-rpc-backend - (not (stringp elpy-rpc-backend))) - (error "`elpy-rpc-backend' should be nil or a string.")) - (with-current-buffer (generate-new-buffer "*elpy-rpc*") - (setq elpy-rpc--buffer-p t - elpy-rpc--backend-project-root project-root - elpy-rpc--backend-python-command python-command - default-directory project-root) - (let ((proc (condition-case err - (let ((process-connection-type nil)) - (start-process "elpy-rpc" - (current-buffer) - python-command - "-W" "ignore" - "-m" "elpy.__main__")) - (error - (elpy-installation-instructions - (format "Could not start the Python subprocess: %s" - (cadr err)) - t) - (error (cadr err)))))) - (set-process-query-on-exit-flag proc nil) - (set-process-sentinel proc #'elpy-rpc--sentinel) - (set-process-filter proc #'elpy-rpc--filter)) - (cond - ;; User requested a specific backend - (elpy-rpc-backend - (elpy-rpc-set-backend - elpy-rpc-backend - (lambda (result) - ;; Requested backend successfully set - t) - (lambda (err) - (elpy-installation-instructions - (format (concat "The %s backend is unavailable. " - "Please install appropriate Python library,\n" - "or change the value of `elpy-rpc-backend'") - elpy-rpc-backend))))) - ;; User did not specify a backend, make sure we are not using the - ;; native one. - (t - (elpy-rpc-get-backend - (lambda (current-backend) - (when (equal current-backend "native") - (elpy-installation-instructions - (concat "Only the basic native backend is available. " - "You might want to install an appropriate " - "Python library. If you are happy with the native " - "backend, please add the following to your .emacs:" - "\n\n(setq elpy-rpc-backend \"native\")"))))))) - (current-buffer))) - -(defun elpy-rpc--sentinel (process event) - "The sentinel for the RPC process." - (when event - ;; Process sentinels are only ever called when the process - ;; finishes. - (when elpy-rpc--backend-callbacks - (maphash (lambda (call-id callbacks) - (ignore-errors - (funcall (nth 1 callbacks) - (substring event 0 -1)))) - elpy-rpc--backend-callbacks) - (setq elpy-rpc--backend-callbacks nil)))) - -(defun elpy-rpc--filter (process output) - "The filter for the RPC process." - (with-current-buffer (process-buffer process) - (goto-char (point-max)) - (insert output) - (catch 'return - (while (progn - (goto-char (point-min)) - (search-forward "\n" nil t)) - (goto-char (point-min)) - (let (json did-read-json) - (condition-case err - (setq json (let ((json-array-type 'list)) - (json-read)) - did-read-json t) - (error - (goto-char (point-min)) - (cond - ((looking-at "elpy-rpc ready\n") - (replace-match "") - (elpy-rpc--backend-version "1.1")) - ((looking-at "elpy-rpc ready (\\([^ ]*\\))\n") - (let ((rpc-version (match-string 1))) - (replace-match "") - (elpy-rpc--backend-version rpc-version))) - (t - (elpy-rpc--handle-unexpected-line) - (throw 'return nil))))) - (when did-read-json - (delete-region (point-min) (1+ (point))) - (elpy-rpc--handle-json json))))))) - -(defun elpy-rpc--backend-version (rpc-version) - "Check that we are using the right version." - (when (not (equal rpc-version elpy-version)) - (with-help-window "*Elpy Version Mismatch*" - (with-current-buffer "*Elpy Version Mismatch*" - (insert - "You are not using the same version of Elpy in Emacs Lisp\n" - "compared to Python. This can cause random problems. Please\n" - "do make sure to use compatible versions.\n" - "\n" - "Elpy Emacs Lisp version: " elpy-version "\n" - "Elpy Python version....: " rpc-version "\n"))))) - -(defun elpy-rpc--handle-json (json) - "Handle a single JSON object from the RPC backend." - (let ((call-id (cdr (assq 'id json))) - (error-string (cdr (assq 'error json))) - (result (cdr (assq 'result json))) - success-callback error-callback) - (let ((callbacks (gethash call-id elpy-rpc--backend-callbacks))) - (when (not callbacks) - (error "Received a response for unknown call-id %s" call-id)) - (setq success-callback (nth 0 callbacks) - error-callback (nth 1 callbacks) - orig-buf (nth 2 callbacks)) - (remhash call-id elpy-rpc--backend-callbacks) - (with-current-buffer orig-buf - (if error-string - (if error-callback - (funcall error-callback error-string) - (error "Error from RPC: %S" error-string)) - (funcall success-callback result)))))) - -(defun elpy-rpc--handle-unexpected-line () - "Handle an unexpected line from the backend. - -This is usually an error or backtrace." - (let ((missing-module (when (re-search-forward "No module named \\(.*\\)" - nil t) - (match-string 1)))) - (cond - ((member missing-module '("elpy" "rope" "jedi")) - (elpy-installation-instructions - (format "The %s Python module was not found." missing-module) - (equal missing-module "elpy"))) - (missing-module - (with-help-window "*Elpy Error*" - (with-current-buffer "*Elpy Error*" - (view-mode 1) - (let ((inhibit-read-only t)) - (erase-buffer) - (insert "There was an error initializing the Elpy backend,\n" - "as the " missing-module " Python module was not found.\n" - "\n" - "Please install this module to use elpy.\n")) - (pop-to-buffer (current-buffer))))) - (t - (let ((data (buffer-string))) - (with-help-window "*Elpy Error*" - (with-current-buffer "*Elpy Error*" - (view-mode 1) - (let ((inhibit-read-only t)) - (erase-buffer) - (insert "There was an error in the Elpy backend.\n" - "The following lines were received from Python, and " - "might help identifying\n" - "the problem.\n" - "\n" - data)) - (pop-to-buffer (current-buffer))))))))) - -(defun elpy-rpc--call (method-name params success &optional error) - "Call METHOD-NAME with PARAMS in the current RPC backend. - -Returns immediately. When a result is available, SUCCESS will be -called with that value as its sole argument. If an error occurs, -ERROR is called, if set." - (let ((orig-buf (current-buffer))) - (with-current-buffer (elpy-rpc--get-rpc-buffer) - (setq elpy-rpc--call-id (1+ elpy-rpc--call-id)) - (elpy-rpc--register-callback elpy-rpc--call-id success error orig-buf) - (process-send-string - (get-buffer-process (current-buffer)) - (concat (json-encode `((id . ,elpy-rpc--call-id) - (method . ,method-name) - (params . ,params))) - "\n"))))) - -(defun elpy-rpc--register-callback (call-id success error buffer) - "Register for SUCCESS and ERROR to be called when CALL-ID returns. - -Must be called in an elpy-rpc buffer." - (assert elpy-rpc--buffer-p) - (when (not elpy-rpc--backend-callbacks) - (setq elpy-rpc--backend-callbacks (make-hash-table :test #'equal))) - (puthash call-id (list success error buffer) elpy-rpc--backend-callbacks)) - -(defun elpy-rpc--call-blocking (method-name params) - "Call METHOD-NAME with PARAMS in the current RPC backend. - -Returns the result, blocking until this arrived." - (let ((result-arrived nil) - (error-occured nil) - (result-value nil) - (error-string nil)) - (elpy-rpc--call method-name params - (lambda (result) - (setq result-value result - result-arrived t)) - (lambda (err) - (setq error-string err - error-occured t))) - (let ((end-time (time-add (current-time) - (seconds-to-time elpy-rpc--timeout)))) - (while (and (time-less-p (current-time) - end-time) - (not (or result-arrived - error-occured))) - (accept-process-output (elpy-rpc--get-rpc-process) - elpy-rpc--timeout))) - (cond - (error-occured - (error error-string)) - (result-arrived - result-value) - (t - (error "Timeout in RPC call from backend"))))) - -(defun elpy-rpc (method params &optional success error) - "Call METHOD with PARAMS in the backend. - -If SUCCESS and optionally ERROR is given, return immediately and -call those when a result is available. Otherwise, wait for a -result and return that." - (if success - (elpy-rpc--call method params success error) - (elpy-rpc--call-blocking method params))) - -(defun elpy-rpc-restart () - "Restart the current RPC process." - (interactive) - (when (elpy-rpc--live-p elpy-rpc--buffer) - (kill-buffer elpy-rpc--buffer) - (setq elpy-rpc--buffer nil)) - (elpy-rpc--get-rpc-buffer)) - -(defun elpy-rpc-get-completions (&optional success error) - "Call the find_completions API function. - -Returns a list of possible completions for the Python symbol at -point." - (elpy-rpc "get_completions" - (list (expand-file-name (elpy-project-root)) - buffer-file-name - (buffer-string) - (- (point) - (point-min))) - success error)) - -(defun elpy-rpc-get-calltip (&optional success error) - "Call the get_calltip API function. - -Returns a calltip string for the function call at point." - (elpy-rpc "get_calltip" - (list (expand-file-name (elpy-project-root)) - buffer-file-name - (buffer-string) - (- (point) - (point-min))) - success error)) - -(defun elpy-rpc-get-docstring (&optional success error) - "Call the get_docstring API function. - -Returns a possible multi-line docstring for the symbol at point." - (elpy-rpc "get_docstring" - (list (expand-file-name (elpy-project-root)) - buffer-file-name - (buffer-string) - (- (point) - (point-min))) - success error)) - -(defun elpy-rpc-get-pydoc-documentation (symbol &optional success error) - "Get the Pydoc documentation for SYMBOL. - -Returns a possible multi-line docstring." - (elpy-rpc "get_pydoc_documentation" (list symbol) - success error)) - -(defun elpy-rpc-get-definition (&optional success error) - "Call the find_definition API function. - -Returns nil or a list of (filename, point)." - (elpy-rpc "get_definition" - (list (expand-file-name (elpy-project-root)) - buffer-file-name - (buffer-string) - (- (point) - (point-min))) - success error)) - -(defun elpy-rpc-get-backend (&optional success error) - "Call the get_backend API function. - -Returns the name of the backend currently in use." - (elpy-rpc "get_backend" nil success error)) - -(defun elpy-rpc-get-available-backends (&optional success error) - "Call the get_available_backends API function. - -Returns a list of names of available backends, depending on which -Python libraries are installed." - (elpy-rpc "get_available_backends" nil success error)) - -(defun elpy-rpc-set-backend (backend &optional success error) - "Call the set_backend API function. - -This changes the current backend to the named backend. Raises an -error if the backend is not supported." - (interactive - (list (completing-read - (format "Switch elpy backend (currently %s): " - (elpy-rpc-get-backend)) - (elpy-rpc-get-available-backends) - nil t))) - (elpy-rpc "set_backend" (list backend) success error)) - -(defalias 'elpy-set-backend 'elpy-rpc-set-backend) - - -;;;;;;;;; -;;; Eldoc - -(defun elpy-eldoc-documentation () - "Return a call tip for the python call at point." - (elpy-rpc-get-calltip - (lambda (calltip) - (eldoc-message - (when calltip - (with-temp-buffer - ;; multiprocessing.queues.Queue.cancel_join_thread(self) - (insert calltip) - (goto-char (point-min)) - ;; First, remove the whole path up to the second-to-last dot. We - ;; retain the class just to make it nicer. - (while (search-forward "." nil t) - nil) - (when (search-backward "." nil t 2) - (delete-region (point-min) (1+ (point)))) - ;; Then remove the occurrence of "self", that's not passed by - ;; the user. - (when (re-search-forward "(self\\(, \\)?" nil t) - (replace-match "(")) - (goto-char (point-min)) - ;; Lastly, we'd like to highlight the argument are on. - - ;; This is tricky with keyword vs. positions arguments, and - ;; possibly quite complex argument values. - - ;; Hence, we don't do anything for now. - (buffer-string)))))) - ;; Return the last message until we're done - eldoc-last-message) - - -;;;;;;;;;;; -;;; Flymake - -(eval-after-load "flymake" - '(add-to-list 'flymake-allowed-file-name-masks - '("\\.py\\'" elpy-flymake-python-init))) - -(defun elpy-flymake-python-init () - ;; Make sure it's not a remote buffer as flymake would not work - (when (not (file-remote-p buffer-file-name)) - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace))) - (list python-check-command (list temp-file))))) - -(defun elpy-flymake-forward-error () - "Move forward to the next Flymake error and show a -description." - (interactive) - (flymake-goto-next-error) - (elpy-flymake-show-error)) - -(defun elpy-flymake-backward-error () - "Move backward to the previous Flymake error and show a -description." - (interactive) - (flymake-goto-prev-error) - (elpy-flymake-show-error)) - -(defun elpy-flymake-show-error () - "Show the flymake error message at point." - (let* ((lineno (flymake-current-line-no)) - (err-info (car (flymake-find-err-info flymake-err-info - lineno))) - (text (mapconcat #'flymake-ler-text - err-info - ", "))) - (message "%s" text))) - - -;;;;;;;;;;;;; -;;; Yasnippet - -;; No added configuration needed. Nice mode. :o) - - -;;;;;;;;;;;;;;;;; -;;; Auto-Complete - -(defvar elpy--ac-cache nil - "List of current expansions and docstrings.") - -(defun elpy--ac-init () - "Initialize a completion. - -This will call Python in the background and initialize -`elpy--ac-cache' when it returns." - (elpy-rpc-get-completions - (lambda (result) - (setq elpy--ac-cache nil) - (dolist (completion result) - (let ((name (car completion)) - (doc (cadr completion))) - (when (not (string-prefix-p "_" name)) - (push (cons (concat ac-prefix name) - doc) - elpy--ac-cache)))) - (ac-start)) - (lambda (err) - (message "Can't get completions: %s" err)))) - -(defun elpy--ac-candidates () - "Return a list of possible expansions at points. - -This uses `elpy--ac-cache'." - (mapcar (lambda (info) - (popup-make-item - (car info) - :symbol "p" - :summary (when (and (cdr info) - (not (equal (cdr info) ""))) - "->"))) - elpy--ac-cache)) - -(defun elpy--ac-document (name) - "Return the documentation for the symbol NAME." - (assoc-default name elpy--ac-cache)) - -(ac-define-source elpy - '((init . elpy--ac-init) - (candidates . elpy--ac-candidates) - (document . elpy--ac-document) - (symbol . "p"))) - -(ac-define-source elpy-dot - '((init . elpy--ac-init) - (candidates . elpy--ac-candidates) - (document . elpy--ac-document) - (symbol . "p") - (prefix . c-dot) - (requires . 0))) - - -;;;;;;;;;;;;;; -;;; Virtualenv - -(defadvice virtualenv-workon (around ad-elpy-virtualenv-workon activate) - "Restart the elpy-rpc backend on virtualenv change." - (let ((old-env virtualenv-workon-session)) - ad-do-it - (when (and virtualenv-workon-starts-python - (elpy-rpc--get-rpc-buffer) - (not (equal old-env virtualenv-workon-session)) - (y-or-n-p "Virtualenv changed, restart Elpy-RPC? ")) - (elpy-rpc-restart)))) - -(defadvice virtualenv-deactivate (after ad-elpy-virtualenv-deactivate activate) - "Restart the elpy-rpc backend on virtualenv change." - (when (and virtualenv-workon-starts-python - (elpy-rpc--get-rpc-buffer) - (y-or-n-p "Virtualenv deactivated, restart Elpy-RPC? ")) - (elpy-rpc-restart))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Backwards compatibility - -;; Functions for Emacs 24 before 24.3 -(when (not (fboundp 'python-shell-send-region)) - (defalias 'python-shell-send-region 'python-send-region)) -(when (not (fboundp 'python-shell-send-buffer)) - (defalias 'python-shell-send-buffer 'python-send-buffer)) -(when (not (fboundp 'python-info-current-defun)) - (defalias 'python-info-current-defun 'python-current-defun)) -(when (not (fboundp 'python-nav-end-of-statement)) - (defalias 'python-nav-end-of-statement 'python-end-of-statement)) -(when (not (fboundp 'python-nav-beginning-of-statement)) - (require 'thingatpt) - (defalias 'python-nav-beginning-of-statement 'beginning-of-sexp)) -(when (not (fboundp 'python-nav-forward-statement)) - (defalias 'python-nav-forward-statement 'forward-sexp)) -(when (not (fboundp 'python-nav-backward-statement)) - (defalias 'python-nav-backward-statement 'backward-sexp)) - -(when (not (fboundp 'python-shell-get-process-name)) - (defun python-shell-get-process-name (dedicated) - "Compatibility function for older Emacsen." - "Python")) -(when (not (fboundp 'python-shell-parse-command)) - (defun python-shell-parse-command () - "Compatibility function for older Emacsen." - python-python-command)) -(when (not (fboundp 'python-shell-calculate-process-environment)) - (defun python-shell-calculate-process-environment () - "Compatibility function for older Emacsen." - process-environment)) -(when (not (fboundp 'python-shell-calculate-exec-path)) - (defun python-shell-calculate-exec-path () - "Compatibility function for older Emacsen." - exec-path)) - -;; Emacs 24.2 made `locate-dominating-file' accept a predicate instead -;; of a string. Simply overwrite the current one, it's -;; backwards-compatible. The code below is taken from Emacs 24.3. -(when (or (< emacs-major-version 24) - (and (= emacs-major-version 24) - (<= emacs-minor-version 2))) - (defun locate-dominating-file (file name) - "Look up the directory hierarchy from FILE for a directory containing NAME. -Stop at the first parent directory containing a file NAME, -and return the directory. Return nil if not found. -Instead of a string, NAME can also be a predicate taking one argument -\(a directory) and returning a non-nil value if that directory is the one for -which we're looking." - ;; We used to use the above locate-dominating-files code, but the - ;; directory-files call is very costly, so we're much better off doing - ;; multiple calls using the code in here. - ;; - ;; Represent /home/luser/foo as ~/foo so that we don't try to look for - ;; `name' in /home or in /. - (setq file (abbreviate-file-name file)) - (let ((root nil) - ;; `user' is not initialized outside the loop because - ;; `file' may not exist, so we may have to walk up part of the - ;; hierarchy before we find the "initial UID". Note: currently unused - ;; (user nil) - try) - (while (not (or root - (null file) - ;; FIXME: Disabled this heuristic because it is sometimes - ;; inappropriate. - ;; As a heuristic, we stop looking up the hierarchy of - ;; directories as soon as we find a directory belonging - ;; to another user. This should save us from looking in - ;; things like /net and /afs. This assumes that all the - ;; files inside a project belong to the same user. - ;; (let ((prev-user user)) - ;; (setq user (nth 2 (file-attributes file))) - ;; (and prev-user (not (equal user prev-user)))) - (string-match locate-dominating-stop-dir-regexp file))) - (setq try (if (stringp name) - (file-exists-p (expand-file-name name file)) - (funcall name file))) - (cond (try (setq root file)) - ((equal file (setq file (file-name-directory - (directory-file-name file)))) - (setq file nil)))) - (if root (file-name-as-directory root)))) - ) - -;; highlight-indentation 0.5 does not use modes yet -(when (not (fboundp 'highlight-indentation-mode)) - (defun highlight-indentation-mode (on-or-off) - (cond - ((and (= on-or-off 1) - (not highlight-indent-active)) - (highlight-indentation)) - ((and (= on-or-off 0) - highlight-indent-active) - (highlight-indentation))))) - -(provide 'elpy) -;;; elpy.el ends here diff --git a/emacs.d/elpa/elpy-1.2.1/elpy.elc b/emacs.d/elpa/elpy-1.2.1/elpy.elc deleted file mode 100644 index e685ab118b59a15d892e852173088b64cf53f43d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48887 zcmd6wiGNeqnfF-|0`8~jlD5-!=FMD0DRzn+-K)iR`eqt1PU8;S07<5UDUod%E7+1E z$q+i*zy5xI&vVXQWEsdZoj0E#OZT38?pdCFJHOw!x&C*jPMuo#{qKLDtPc-I{e#|a zvi&029`~lxgYMwT?r`u?`A7X$cjx+W__Tg^JX}5)?sN~5;UKxizuUuSN!CspYagWi z-$}AY+O&T6#>2y8kDinFKb`c(llRO0y}#T$?CwmKci-eJuWxQ9JNw;ncW25VuiERogWY5@Om@11WV@Ff47-(=gvm^jUUz)Z?~Rk`J`J;` zzn3lfPXB2D-}S$Rg@wiK7t>ySXSmx-YFo`lgMaD8tt{0S{maTfn&ls@@{e};N2mN_ zrSv0hlz)`pla}9;mfw?>-;TLoNxLTPnw`+TQE9JdLi<)j?OXaq`^^?SJ(c3Z;@!)V*E+i`l0ax=XvHtXo^ZLLh~t+7%|9*%oo9ree(qIO$EhPlR2A-MY}b-XGLQQBbQqmd0P8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aPC3BJQQXG!YghOUVI-5a3b%N^d_O@&(U`Oe& zThY#->sk1)oolPab50k6(DNKjrqn*SdzDUo$jcGTZP%R?O)WwHCdYxt(!BYjR5&7V zm&5Ns8Onj$v7m-C-K1!vs&`#<0-QIdr*McAbBqT)?)Aq+;VEec+@Jf9pW18B61*$! zna8=H79j-h=vZ$uy9wcL(J={H9E0qK`RBi+uspO zn|3V{O$B;luqXM`rD?$o^O0z3$P&cV>D?YKYVH=SMEL*}5GqAZT|(ow2Ij^h8}AB! ztB{|VQx_eb>Z%;nMP;N8l%t1b-Vp5 zyUibgXS6HKzQTEX56U!q$7(7hjk0kwxpTXI=U$ytUX3b^htG%^HuX==k%j*U_V$X2 diff --git a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__enter__ b/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__enter__ deleted file mode 100644 index 4c74b66..0000000 --- a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__enter__ +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# name: __enter__ -# key: __enter__ -# expand-env: ((yas-indent-line nil)) -# -- -__enter__(self): - $1 - - def __exit__(self, exc_type, exc_value, traceback): - $2 diff --git a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__exit__ b/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__exit__ deleted file mode 100644 index e04a433..0000000 --- a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/__exit__ +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: __exit__ -# key: __exit__ -# -- -__exit__(self, exc_type, exc_value, traceback): - $0 diff --git a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/super b/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/super deleted file mode 100644 index 6361b45..0000000 --- a/emacs.d/elpa/elpy-1.2.1/snippets/python-mode/super +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: super -# key: super -# expand-env: ((class (lambda () (let ((info (python-info-current-defun))) (if info (car (split-string info "\\.")) "class")))) (method (lambda () (let ((info (python-info-current-defun))) (if info (cadr (split-string info "\\.")) "method")))) (object (lambda () (if (and (python-nav-beginning-of-defun) (re-search-forward "(\\([^),=]*\\)" nil t)) (match-string-no-properties 1) "self")))) -# -- -super(`(funcall class)`, `(funcall object)`).`(funcall method)`($1) - $0 \ No newline at end of file diff --git a/emacs.d/elpa/erlang-2.4.1/erlang-autoloads.el b/emacs.d/elpa/erlang-2.4.1/erlang-autoloads.el deleted file mode 100644 index 6e67393..0000000 --- a/emacs.d/elpa/erlang-2.4.1/erlang-autoloads.el +++ /dev/null @@ -1,131 +0,0 @@ -;;; erlang-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (inferior-erlang erlang-compile erlang-shell erlang-find-tag-other-window -;;;;;; erlang-find-tag erlang-mode) "erlang" "erlang.el" (20941 -;;;;;; 53852 0 0)) -;;; Generated autoloads from erlang.el - -(autoload 'erlang-mode "erlang" "\ -Major mode for editing Erlang source files in Emacs. -It knows about syntax and comment, it can indent code, it is capable -of fontifying the source file, the TAGS commands are aware of Erlang -modules, and the Erlang man pages can be accessed. - -Should this module, \"erlang.el\", be installed properly, Erlang mode -is activated whenever an Erlang source or header file is loaded into -Emacs. To indicate this, the mode line should contain the word -\"Erlang\". - -The main feature of Erlang mode is indentation, press TAB and the -current line will be indented correctly. - -Comments starting with only one `%' are indented to the column stored -in the variable `comment-column'. Comments starting with two `%':s -are indented with the same indentation as code. Comments starting -with at least three `%':s are indented to the first column. - -However, Erlang mode contains much more, this is a list of the most -useful commands: - TAB - Indent the line. - C-c C-q - Indent current function. - M-; - Create a comment at the end of the line. - M-q - Fill a comment, i.e. wrap lines so that they (hopefully) - will look better. - M-a - Goto the beginning of an Erlang clause. - M-C-a - Ditto for function. - M-e - Goto the end of an Erlang clause. - M-C-e - Ditto for function. - M-h - Mark current Erlang clause. - M-C-h - Ditto for function. - C-c C-z - Start, or switch to, an inferior Erlang shell. - C-c C-k - Compile current file. - C-x ` - Next error. - , - Electric comma. - ; - Electric semicolon. - -Erlang mode check the name of the file against the module name when -saving, whenever a mismatch occurs Erlang mode offers to modify the -source. - -The variable `erlang-electric-commands' controls the electric -commands. To deactivate all of them, set it to nil. - -There exists a large number of commands and variables in the Erlang -module. Please press `M-x apropos RET erlang RET' to see a complete -list. Press `C-h f name-of-function RET' and `C-h v name-of-variable -RET'to see the full description of functions and variables, -respectively. - -On entry to this mode the contents of the hook `erlang-mode-hook' is -executed. - -Please see the beginning of the file `erlang.el' for more information -and examples of hooks. - -Other commands: -\\{erlang-mode-map} - -\(fn)" t nil) - -(autoload 'erlang-find-tag "erlang" "\ -Like `find-tag'. Capable of retreiving Erlang modules. - -Tags can be given on the forms `tag', `module:', `module:tag'. - -\(fn MODTAGNAME &optional NEXT-P REGEXP-P)" t nil) - -(autoload 'erlang-find-tag-other-window "erlang" "\ -Like `find-tag-other-window' but aware of Erlang modules. - -\(fn TAGNAME &optional NEXT-P REGEXP-P)" t nil) - -(autoload 'erlang-shell "erlang" "\ -Start a new Erlang shell. - -The variable `erlang-shell-function' decides which method to use, -default is to start a new Erlang host. It is possible that, in the -future, a new shell on an already running host will be started. - -\(fn)" t nil) - (autoload 'run-erlang "erlang" "Start a new Erlang shell." t) - -(autoload 'erlang-compile "erlang" "\ -Compile Erlang module in current buffer. - -\(fn)" t nil) - -(autoload 'inferior-erlang "erlang" "\ -Run an inferior Erlang. - -This is just like running Erlang in a normal shell, except that -an Emacs buffer is used for input and output. - -The command line history can be accessed with M-p and M-n. -The history is saved between sessions. - -Entry to this mode calls the functions in the variables -`comint-mode-hook' and `erlang-shell-mode-hook' with no arguments. - -The following commands imitate the usual Unix interrupt and -editing control characters: -\\{erlang-shell-mode-map} - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("erlang-pkg.el") (20941 53852 201917 0)) - -;;;*** - -(provide 'erlang-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; erlang-autoloads.el ends here diff --git a/emacs.d/elpa/erlang-2.4.1/erlang-pkg.el b/emacs.d/elpa/erlang-2.4.1/erlang-pkg.el deleted file mode 100644 index 1ba978c..0000000 --- a/emacs.d/elpa/erlang-2.4.1/erlang-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "erlang" "2.4.1" "Major modes for editing and running Erlang" (quote nil)) diff --git a/emacs.d/elpa/erlang-2.4.1/erlang-pkg.elc b/emacs.d/elpa/erlang-2.4.1/erlang-pkg.elc deleted file mode 100644 index 620df07bd6b3324b61e98627b03fad5a9493c2df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 632 zcmbtR!A`?44Bfduz}4yrq&21Okhb*#n}#$55)$wMUXr$9X;LLAXnZ|x2MEM*zQm57 z-n0G6&HegpGMPkWS;E@3ozhak?f^R{L(phyVa@ewD17pOd}ZxEd32U(%Ta?haO)J@ z^#<}eWV2;fEUya4FSBA~tekD3B2GwOymUVOO`9^=BKJ(BQg@h2H^?P9o3ZS>==L>} zdZbbYHUk{qh)0odK4S&T#@@RM4WOoZx}aM1fq?*?MPu{1QT{kX@1+NEFxV;%!g3#+ zGPR#l*ZBY_1nvH#lPy@j_{SkEaTptbTN9ALeW;Q-{g~wDX}#S7Z_ptRG~{%YM' -is typed. Each function in the list is called with no arguments, -and should return one of the following values: - - nil -- no determination made, continue checking - 'stop -- do not create prototype for next line - (anything else) -- insert prototype, and stop checking - -If every function in the list is called with no determination made, -then no prototype is inserted. - -The test is performed by the function `erlang-test-criteria-list'.") - -(defvar erlang-electric-newline-criteria - '(t) - "*List of functions controlling `erlang-electric-newline'. - -The electric newline commands indents the next line. Should the -current line begin with a comment the comment start is copied to -the newly created line. - -The functions in this list are called, in order, whenever a comma -is typed. Each function in the list is called with no arguments, -and should return one of the following values: - - nil -- no determination made, continue checking - 'stop -- do not create prototype for next line - (anything else) -- trigger the electric command. - -If every function in the list is called with no determination made, -then no prototype is inserted. Should the atom t be a member of the -list, it is treated as a function triggering the electric command. - -The test is performed by the function `erlang-test-criteria-list'.") - -(defvar erlang-next-lines-empty-threshold 2 - "*Number of blank lines required to activate an electric command. - -Actually, this value controls the behaviour of the function -`erlang-next-lines-empty-p' which normally is a member of the -criteria lists controlling the electric commands. (Please see -the variables `erlang-electric-semicolon-criteria' and -`erlang-electric-comma-criteria'.) - -The variable is bound to a threshold value, a number, representing the -number of lines which must be empty. - -Setting this variable to zero, electric commands will always be -triggered by `erlang-next-lines-empty-p', unless inhibited by other -rules. - -Should this variable be `nil', `erlang-next-lines-empty-p' will never -trigger an electric command. The same effect would be reached if the -function `erlang-next-lines-empty-p' would be removed from the criteria -lists. - -Note that even if `erlang-next-lines-empty-p' should not trigger an -electric command, other functions in the criteria list could.") - -(defvar erlang-new-clause-with-arguments nil - "*Non-nil means that the arguments are cloned when a clause is generated. - -A new function header can be generated by calls to the function -`erlang-generate-new-clause' and by use of the electric semicolon.") - -(defvar erlang-compile-use-outdir t - "*When nil, go to the directory containing source file when compiling. - -This is a workaround for a bug in the `outdir' option of compile. If the -outdir is not in the current load path, Erlang doesn't load the object -module after it has been compiled. - -To activate the workaround, place the following in your `~/.emacs' file: - (setq erlang-compile-use-outdir nil)") - -(defvar erlang-indent-level 4 - "*Indentation of Erlang calls/clauses within blocks.") - -(defvar erlang-indent-guard 2 - "*Indentation of Erlang guards.") - -(defvar erlang-argument-indent 2 - "*Indentation of the first argument in a function call. -When nil, indent to the column after the `(' of the -function.") - -(defvar erlang-tab-always-indent t - "*Non-nil means TAB in Erlang mode should always reindent the current line, -regardless of where in the line point is when the TAB command is used.") - -(defvar erlang-error-regexp-alist - '(("^\\([^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" . (1 2))) - "*Patterns for matching Erlang errors.") - -(defvar erlang-man-inhibit (eq system-type 'windows-nt) - "Inhibit the creation of the Erlang Manual Pages menu. - -The Windows distribution of Erlang does not include man pages, hence -there is no idea to create the menu.") - -(defvar erlang-man-dirs - '(("Man - Commands" "/man/man1" t) - ("Man - Modules" "/man/man3" t) - ("Man - Unsupported" "/uc/man/man3" t)) - "*The man directories displayed in the Erlang menu. - -Each item in the list should be a list with three elements, the first -the name of the menu, the second the directory, and the last a flag. -Should the flag the nil, the directory is absolute, should it be non-nil -the directory is relative to the variable `erlang-root-dir'.") - -(defvar erlang-man-max-menu-size 20 - "*The maximum number of menu items in one menu allowed.") - -(defvar erlang-man-display-function 'erlang-man-display - "*Function used to display man page. - -The function is called with one argument, the name of the file -containing the man page. Use this variable when the default -function, erlang-man-display, does not work on your system.") - -(defconst erlang-atom-regexp "\\([a-z][a-zA-Z0-9_]*\\|'[^\n']*[^\\]'\\)" - "Regexp which should match an Erlang atom. - -The regexp must be surrounded with a pair of regexp parentheses.") -(defconst erlang-atom-regexp-matches 1 - "Number of regexp parenthesis pairs in `erlang-atom-regexp'. - -This is used to determine parenthesis matches in complex regexps which -contains `erlang-atom-regexp'.") - -(defconst erlang-variable-regexp "\\([A-Z_][a-zA-Z0-9_]*\\)" - "Regexp which should match an Erlang variable. - -The regexp must be surrounded with a pair of regexp parenthesis.") -(defconst erlang-variable-regexp-matches 1 - "Number of regexp parenthesis pairs in `erlang-variable-regexp'. - -This is used to determine matches in complex rexeps which contains -`erlang-variable-regexp'.") - -(defvar erlang-defun-prompt-regexp (concat "^" erlang-atom-regexp "\\s *(") - "*Regexp which should match beginning of a clause.") - -(defvar erlang-file-name-extension-regexp "\\.[eh]rl$" - "*Regexp which should match an erlang file name. - -This regexp is used when an Erlang module name is extracted from the -name of an Erlang source file. - -The regexp should only match the section of the file name which should -be excluded from the module name. - -To match all files set this variable to \"\\\\(\\\\..*\\\\|\\\\)$\". -The matches all except the extension. This is useful if the Erlang -tags system should interpretate tags on the form `module:tag' for -files written in other languages than Erlang.") - -(defvar erlang-mode-map nil - "*Keymap used in Erlang mode.") -(defvar erlang-mode-abbrev-table nil - "Abbrev table in use in Erlang-mode buffers.") -(defvar erlang-mode-syntax-table nil - "Syntax table in use in Erlang-mode buffers.") - -(defconst erlang-emacs-major-version - (if (boundp 'emacs-major-version) - emacs-major-version - (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 1) (match-end 1)))) - "Major version number of Emacs.") - -(defconst erlang-emacs-minor-version - (if (boundp 'emacs-minor-version) - emacs-minor-version - (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version) - (string-to-int (substring emacs-version - (match-beginning 2) (match-end 2)))) - "Minor version number of Emacs.") - -(defconst erlang-xemacs-p (string-match "Lucid\\|XEmacs" emacs-version) - "Non-nil when running under XEmacs or Lucid Emacs.") - -(defvar erlang-xemacs-popup-menu '("Erlang Mode Commands" . nil) - "Common popup menu for all buffers in Erlang mode. - -This variable is destructively modified every time the Erlang menu -is modified. The effect is that all changes take effekt in all -buffers in Erlang mode, just like under GNU Emacs. - -Never EVER set this variable!") - - -;; Tempo skeleton templates: - -(defvar erlang-skel - '(("If" "if" erlang-skel-if) - ("Case" "case" erlang-skel-case) - ("Receive" "receive" erlang-skel-receive) - ("Receive After" "after" erlang-skel-receive-after) - ("Receive Loop" "loop" erlang-skel-receive-loop) - ("Module" "module" erlang-skel-module) - ("Author" "author" erlang-skel-author) - () - ("Small Header" "small-header" - erlang-skel-small-header erlang-skel-header) - ("Normal Header" "normal-header" - erlang-skel-normal-header erlang-skel-header) - ("Large Header" "large-header" - erlang-skel-large-header erlang-skel-header) - () - ("Small Server" "small-server" - erlang-skel-small-server erlang-skel-header) - () - ("Application" "application" - erlang-skel-application erlang-skel-header) - ("Supervisor" "supervisor" - erlang-skel-supervisor erlang-skel-header) - ("supervisor_bridge" "supervisor-bridge" - erlang-skel-supervisor-bridge erlang-skel-header) - ("gen_server" "generic-server" - erlang-skel-generic-server erlang-skel-header) - ("gen_event" "gen-event" - erlang-skel-gen-event erlang-skel-header) - ("gen_fsm" "gen-fsm" - erlang-skel-gen-fsm erlang-skel-header) - ("Library module" "gen-lib" - erlang-skel-lib erlang-skel-header) - ("Corba callback" "gen-corba-cb" - erlang-skel-corba-callback erlang-skel-header)) - "*Description of all skeletons templates. -Both functions and menu entries will be created. - -Each entry in `erlang-skel' should be a list with three or four -elements, or the empty list. - -The first element is the name which shows up in the menu. The second -is the `tempo' identfier (The string \"erlang-\" will be added in -front of it). The third is the skeleton descriptor, a variable -containing `tempo' attributes as described in the function -`tempo-define-template'. The optional fourth elements denotes a -function which should be called when the menu is selected. - -Functions corresponding to every template will be created. The name -of the function will be `tempo-template-erlang-X' where `X' is the -tempo identifier as specified in the second argument of the elements -in this list. - -A list with zero elements means that the a horisontal line should -be placed in the menu.") - -;; In XEmacs `user-mail-address' returns "x@y.z (Foo Bar)" ARGH! -;; What's wrong with that? RFC 822 says it's legal. [sverkerw] -(defvar erlang-skel-mail-address - (concat (user-login-name) "@" - (or (and (boundp 'mail-host-address) - (symbol-value 'mail-host-address)) - (system-name))) - "Mail address of the user.") - -;; Expression templates: -(defvar erlang-skel-case - '((erlang-skel-skip-blank) o > - "case " p " of" n> p "_ ->" n> p "ok" n> "end" p) - "*The skeleton of a `case' expression. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-if - '((erlang-skel-skip-blank) o > - "if" n> p " ->" n> p "ok" n> "end" p) - "The skeleton of an `if' expression. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-receive - '((erlang-skel-skip-blank) o > - "receive" n> p "_ ->" n> p "ok" n> "end" p) - "*The skeleton of a `receive' expression. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-receive-after - '((erlang-skel-skip-blank) o > - "receive" n> p "_ ->" n> p "ok" n> "after " p "T ->" n> - p "ok" n> "end" p) - "*The skeleton of a `receive' expression with an `after' clause. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-receive-loop - '(& o "loop(" p ") ->" n> "receive" n> p "_ ->" n> - "loop(" p ")" n> "end.") - "*The skeleton of a simple `recieve' loop. -Please see the function `tempo-define-template'.") - - -;; Attribute templates - -(defvar erlang-skel-module - '(& "-module(" - (erlang-add-quotes-if-needed (erlang-get-module-from-file-name)) - ")." n) - "*The skeleton of a `module' attribute. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-author - '(& "-author('" erlang-skel-mail-address "')." n) - "*The skeleton of a `author' attribute. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-vc nil - "*The skeleton template to generate a version control attribute. -The default is to insert nothing. Example of usage: - - (setq erlang-skel-vc '(& \"-rcs(\\\"$\Id: $ \\\").\") n) - -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-export - '(& "-export([" n> "])." n) - "*The skeleton of an `export' attribute. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-import - '(& "%%-import(Module, [Function/Arity, ...])." n) - "*The skeleton of an `import' attribute. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-compile nil - ;; '(& "%%-compile(export_all)." n) - "*The skeleton of a `compile' attribute. -Please see the function `tempo-define-template'.") - - -;; Comment templates. - -(defvar erlang-skel-date-function 'erlang-skel-dd-mmm-yyyy - "*Function which returns date string. -Look in the module `time-stamp' for a battery of functions.") - -(defvar erlang-skel-copyright-comment '() - "*The template for a copyright line in the header, normally empty. -This variable should be bound to a `tempo' template, for example: - '(& \"%%% Copyright (C) 2000, Yoyodyne, Inc.\" n) - -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-created-comment - '(& "%%% Created : " (funcall erlang-skel-date-function) " by " - (user-full-name) " <" erlang-skel-mail-address ">" n) - "*The template for the \"Created:\" comment line.") - -(defvar erlang-skel-author-comment - '(& "%%% Author : " (user-full-name) " <" erlang-skel-mail-address ">" n) - "*The template for creating the \"Author:\" line in the header. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-file-comment - '(& "%%% File : " (file-name-nondirectory buffer-file-name) n) - "*The template for creating the \"Module:\" line in the header. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-small-header - '(o (erlang-skel-include erlang-skel-module) - ;; erlang-skel-author) - n - (erlang-skel-include erlang-skel-compile - ;; erlang-skel-export - erlang-skel-vc)) - "*The template of a small header without any comments. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-normal-header - '(o (erlang-skel-include erlang-skel-copyright-comment - erlang-skel-file-comment - erlang-skel-author-comment) - "%%% Description : " p n - (erlang-skel-include erlang-skel-created-comment) n - (erlang-skel-include erlang-skel-small-header) n) - "*The template of a normal header. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-large-header - '(o (erlang-skel-separator) - (erlang-skel-include erlang-skel-copyright-comment - erlang-skel-file-comment - erlang-skel-author-comment) - "%%% Description : " p n - "%%%" n - (erlang-skel-include erlang-skel-created-comment) - (erlang-skel-separator) - (erlang-skel-include erlang-skel-small-header) ) - "*The template of a large header. -Please see the function `tempo-define-template'.") - - -;; Server templates. - -(defvar erlang-skel-small-server - '((erlang-skel-include erlang-skel-large-header) - "-export([start/0,init/1])." n n n - "start() ->" n> "spawn(" (erlang-get-module-from-file-name) - ", init, [self()])." n n - "init(From) ->" n> - "loop(From)." n n - "loop(From) ->" n> - "receive" n> - p "_ ->" n> - "loop(From)" n> - "end." - ) - "*Template of a small server. -Please see the function `tempo-define-template'.") - -;; Behaviour templates. - -(defvar erlang-skel-application - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(application)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - (erlang-skel-separator 2) - "-export([" n> "start/2," n> - "stop/1" n - " ])." n - n - (erlang-skel-separator 2) - "%% Internal exports" n - (erlang-skel-separator 2) - "-export([" n - " ])." n - n - (erlang-skel-separator 2) - "%% Macros" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% Records" n - (erlang-skel-separator 2) - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Func: start/2" n - "%% Returns: {ok, Pid} |" n - "%% {ok, Pid, State} |" n - "%% {error, Reason} " n - (erlang-skel-separator 2) - "start(Type, StartArgs) ->" n> - "case 'TopSupervisor':start_link(StartArgs) of" n> - "{ok, Pid} -> " n> - "{ok, Pid};" n> - "Error ->" n> - "Error" n> - "end." n - n - (erlang-skel-separator 2) - "%% Func: stop/1" n - "%% Returns: any "n - (erlang-skel-separator 2) - "stop(State) ->" n> - "ok." n - n - (erlang-skel-double-separator 2) - "%% Internal functions" n - (erlang-skel-double-separator 2) - ) - "*The template of an application behaviour. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-supervisor - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(supervisor)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - (erlang-skel-separator 2) - "-export([" n> "start_link/0" n - " ])." n - n - (erlang-skel-separator 2) - "%% Internal exports" n - (erlang-skel-separator 2) - "-export([" n> "init/1" n - " ])." n - n - (erlang-skel-separator 2) - "%% Macros" n - (erlang-skel-separator 2) - "-define(SERVER, ?MODULE)." n - n - (erlang-skel-separator 2) - "%% Records" n - (erlang-skel-separator 2) - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: start_link/0" n - "%% Description: Starts the supervisor" n - (erlang-skel-separator 2) - "start_link() ->" n> - "supervisor:start_link({local, ?SERVER}, ?MODULE, [])." n - n - (erlang-skel-double-separator 2) - "%% Server functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Func: init/1" n - "%% Returns: {ok, {SupFlags, [ChildSpec]}} |" n - "%% ignore |" n - "%% {error, Reason} " n - (erlang-skel-separator 2) - "init([]) ->" n> - "AChild = {'AName',{'AModule',start_link,[]}," n> - "permanent,2000,worker,['AModule']}," n> - "{ok,{{one_for_all,0,1}, [AChild]}}." n - n - (erlang-skel-double-separator 2) - "%% Internal functions" n - (erlang-skel-double-separator 2) - ) - "*The template of an supervisor behaviour. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-supervisor-bridge - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(supervisor_bridge)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - (erlang-skel-separator 2) - "-export([" n> "start_link/0" n - " ])." n - n - (erlang-skel-separator 2) - "%% Internal exports" n - (erlang-skel-separator 2) - "-export([" n> "init/1, " n> "terminate/2" n - " ])." n - n - (erlang-skel-separator 2) - "%% Macros" n - (erlang-skel-separator 2) - "-define(SERVER, ?MODULE)." n - n - (erlang-skel-separator 2) - "%% Records" n - (erlang-skel-separator 2) - "-record(state, {})." n - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: start_link/0" n - "%% Description: Starts the supervisor bridge" n - (erlang-skel-separator 2) - "start_link() ->" n> - "supervisor_bridge:start_link({local, ?SERVER}, ?MODULE, [])." n - n - (erlang-skel-double-separator 2) - "%% Server functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Func: init/1" n - "%% Returns: {ok, Pid, State} |" n - "%% ignore |" n - "%% {error, Reason} " n - (erlang-skel-separator 2) - "init([]) ->" n> - "case 'AModule':start_link() of" n> - "{ok, Pid} ->" n> - "{ok, Pid, #state{}};" n> - "Error ->" n> - "Error" n> - "end." n - n - (erlang-skel-separator 2) - "%% Func: terminate/2" n - "%% Purpose: Synchronized shutdown of the underlying sub system." n - "%% Returns: any" n - (erlang-skel-separator 2) - "terminate(Reason, State) ->" n> - "'AModule':stop()," n> - "ok." n - n - (erlang-skel-double-separator 2) - "%% Internal functions" n - (erlang-skel-double-separator 2) - ) - "*The template of an supervisor_bridge behaviour. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-generic-server - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(gen_server)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - "-export([start_link/0])." n - n - "%% gen_server callbacks" n - "-export([init/1, handle_call/3, handle_cast/2, " - "handle_info/2, terminate/2, code_change/3])." n n - "-record(state, {})." n - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: start_link/0" n - "%% Description: Starts the server" n - (erlang-skel-separator 2) - "start_link() ->" n> - "gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])." n - n - (erlang-skel-double-separator 2) - "%% Server functions" n - (erlang-skel-double-separator 2) - n - (erlang-skel-separator 2) - "%% Function: init/1" n - "%% Description: Initiates the server" n - "%% Returns: {ok, State} |" n - "%% {ok, State, Timeout} |" n - "%% ignore |" n - "%% {stop, Reason}" n - (erlang-skel-separator 2) - "init([]) ->" n> - "{ok, #state{}}." n - n - (erlang-skel-separator 2) - "%% Function: handle_call/3" n - "%% Description: Handling call messages" n - "%% Returns: {reply, Reply, State} |" n - "%% {reply, Reply, State, Timeout} |" n - "%% {noreply, State} |" n - "%% {noreply, State, Timeout} |" n - "%% {stop, Reason, Reply, State} | (terminate/2 is called)" n - "%% {stop, Reason, State} (terminate/2 is called)" n - (erlang-skel-separator 2) - "handle_call(Request, From, State) ->" n> - "Reply = ok," n> - "{reply, Reply, State}." n - n - (erlang-skel-separator 2) - "%% Function: handle_cast/2" n - "%% Description: Handling cast messages" n - "%% Returns: {noreply, State} |" n - "%% {noreply, State, Timeout} |" n - "%% {stop, Reason, State} (terminate/2 is called)" n - (erlang-skel-separator 2) - "handle_cast(Msg, State) ->" n> - "{noreply, State}." n - n - (erlang-skel-separator 2) - "%% Function: handle_info/2" n - "%% Description: Handling all non call/cast messages" n - "%% Returns: {noreply, State} |" n - "%% {noreply, State, Timeout} |" n - "%% {stop, Reason, State} (terminate/2 is called)" n - (erlang-skel-separator 2) - "handle_info(Info, State) ->" n> - "{noreply, State}." n - n - (erlang-skel-separator 2) - "%% Function: terminate/2" n - "%% Description: Shutdown the server" n - "%% Returns: any (ignored by gen_server)" n - (erlang-skel-separator 2) - "terminate(Reason, State) ->" n> - "ok." n - n - (erlang-skel-separator 2) - "%% Func: code_change/3" n - "%% Purpose: Convert process state when code is changed" n - "%% Returns: {ok, NewState}" n - (erlang-skel-separator 2) - "code_change(OldVsn, State, Extra) ->" n> - "{ok, State}." n - n - (erlang-skel-separator 2) - "%%% Internal functions" n - (erlang-skel-separator 2) - ) - "*The template of a generic server. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-gen-event - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(gen_event)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - "-export([start_link/0, add_handler/0])." n - n - "%% gen_event callbacks" n - "-export([init/1, handle_event/2, handle_call/2, " - "handle_info/2, terminate/2, code_change/3])." n n - "-record(state, {})." n - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: start_link/0" n - "%% Description: Starts the server" n - (erlang-skel-separator 2) - "start_link() ->" n> - "gen_event:start_link({local, ?SERVER}). " n - n - (erlang-skel-separator 2) - "%% Function: add_handler/0" n - "%% Description: Adds an event handler" n - (erlang-skel-separator 2) - "add_handler() ->" n> - "gen_event:add_handler(?SERVER, ?MODULE, [])." n - n - (erlang-skel-double-separator 2) - "%% Server functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Func: init/1" n - "%% Returns: {ok, State} |" n - "%% Other" n - (erlang-skel-separator 2) - "init([]) ->" n> - "{ok, #state{}}." n - n - (erlang-skel-separator 2) - "%% Func: handle_event/2" n - "%% Returns: {ok, State} |" n - "%% {swap_handler, Args1, State1, Mod2, Args2} |" n - "%% remove_handler " n - (erlang-skel-separator 2) - "handle_event(Event, State) ->" n> - "{ok, State}." n - n - (erlang-skel-separator 2) - "%% Func: handle_call/2" n - "%% Returns: {ok, Reply, State} |" n - "%% {swap_handler, Reply, Args1, State1, Mod2, Args2} |" n - "%% {remove_handler, Reply} " n - (erlang-skel-separator 2) - "handle_call(Request, State) ->" n> - "Reply = ok," n> - "{ok, Reply, State}." n - n - (erlang-skel-separator 2) - "%% Func: handle_info/2" n - "%% Returns: {ok, State} |" n - "%% {swap_handler, Args1, State1, Mod2, Args2} |" n - "%% remove_handler " n - (erlang-skel-separator 2) - "handle_info(Info, State) ->" n> - "{ok, State}." n - n - (erlang-skel-separator 2) - "%% Func: terminate/2" n - "%% Purpose: Shutdown the server" n - "%% Returns: any" n - (erlang-skel-separator 2) - "terminate(Reason, State) ->" n> - "ok." n - n - (erlang-skel-separator 2) - "%% Func: code_change/3" n - "%% Purpose: Convert process state when code is changed" n - "%% Returns: {ok, NewState}" n - (erlang-skel-separator 2) - "code_change(OldVsn, State, Extra) ->" n> - "{ok, State}." n - n - (erlang-skel-separator 2) - "%%% Internal functions" n - (erlang-skel-separator 2) - ) - "*The template of a gen_event. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-gen-fsm - '((erlang-skel-include erlang-skel-large-header) - "-behaviour(gen_fsm)." n - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - "-export([start_link/0])." n - n - "%% gen_fsm callbacks" n - "-export([init/1, state_name/2, state_name/3, handle_event/3," n> - "handle_sync_event/4, handle_info/3, terminate/3, code_change/4])." n n - "-record(state, {})." n - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: start_link/0" n - "%% Description: Starts the server" n - (erlang-skel-separator 2) - "start_link() ->" n> - "gen_fsm:start_link({local, ?SERVER}, ?MODULE, [], [])." n - n - (erlang-skel-double-separator 2) - "%% Server functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Func: init/1" n - "%% Returns: {ok, StateName, StateData} |" n - "%% {ok, StateName, StateData, Timeout} |" n - "%% ignore |" n - "%% {stop, StopReason} " n - (erlang-skel-separator 2) - "init([]) ->" n> - "{ok, state_name, #state{}}." n - n - (erlang-skel-separator 2) - "%% Func: StateName/2" n - "%% Returns: {next_state, NextStateName, NextStateData} |" n - "%% {next_state, NextStateName, NextStateData, Timeout} |" n - "%% {stop, Reason, NewStateData} " n - (erlang-skel-separator 2) - "state_name(Event, StateData) ->" n> - "{next_state, state_name, StateData}." n - n - (erlang-skel-separator 2) - "%% Func: StateName/3" n - "%% Returns: {next_state, NextStateName, NextStateData} |" n - "%% {next_state, NextStateName, NextStateData, Timeout} |" n - "%% {reply, Reply, NextStateName, NextStateData} |" n - "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n - "%% {stop, Reason, NewStateData} |" n - "%% {stop, Reason, Reply, NewStateData} " n - (erlang-skel-separator 2) - "state_name(Event, From, StateData) ->" n> - "Reply = ok," n> - "{reply, Reply, state_name, StateData}." n - n - (erlang-skel-separator 2) - "%% Func: handle_event/3" n - "%% Returns: {next_state, NextStateName, NextStateData} |" n - "%% {next_state, NextStateName, NextStateData, Timeout} |" n - "%% {stop, Reason, NewStateData} " n - (erlang-skel-separator 2) - "handle_event(Event, StateName, StateData) ->" n> - "{next_state, StateName, StateData}." n - n - (erlang-skel-separator 2) - "%% Func: handle_sync_event/4" n - "%% Returns: {next_state, NextStateName, NextStateData} |" n - "%% {next_state, NextStateName, NextStateData, Timeout} |" n - "%% {reply, Reply, NextStateName, NextStateData} |" n - "%% {reply, Reply, NextStateName, NextStateData, Timeout} |" n - "%% {stop, Reason, NewStateData} |" n - "%% {stop, Reason, Reply, NewStateData} " n - (erlang-skel-separator 2) - "handle_sync_event(Event, From, StateName, StateData) ->" n> - "Reply = ok," n> - "{reply, Reply, StateName, StateData}." n - n - (erlang-skel-separator 2) - "%% Func: handle_info/3" n - "%% Returns: {next_state, NextStateName, NextStateData} |" n - "%% {next_state, NextStateName, NextStateData, Timeout} |" n - "%% {stop, Reason, NewStateData} " n - (erlang-skel-separator 2) - "handle_info(Info, StateName, StateData) ->" n> - "{next_state, StateName, StateData}." n - n - (erlang-skel-separator 2) - "%% Func: terminate/3" n - "%% Purpose: Shutdown the fsm" n - "%% Returns: any" n - (erlang-skel-separator 2) - "terminate(Reason, StateName, StatData) ->" n> - "ok." n - n - (erlang-skel-separator 2) - "%% Func: code_change/4" n - "%% Purpose: Convert process state when code is changed" n - "%% Returns: {ok, NewState, NewStateData}" n - (erlang-skel-separator 2) - "code_change(OldVsn, StateName, StateData, Extra) ->" n> - "{ok, StateName, StateData}." n - n - (erlang-skel-separator 2) - "%%% Internal functions" n - (erlang-skel-separator 2) - ) - "*The template of a gen_fsm. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-lib - '((erlang-skel-include erlang-skel-large-header) - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - (erlang-skel-separator 2) - "-export([" n - " ])." n - n - (erlang-skel-separator 2) - "%% Internal exports" n - (erlang-skel-separator 2) - "-export([" n - " ])." n - n - (erlang-skel-separator 2) - "%% Macros" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% Records" n - (erlang-skel-separator 2) - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: " n - "%% Description:" n - (erlang-skel-separator 2) - n - (erlang-skel-double-separator 2) - "%% Internal functions" n - (erlang-skel-double-separator 2) - ) - "*The template of a library module. -Please see the function `tempo-define-template'.") - -(defvar erlang-skel-corba-callback - '((erlang-skel-include erlang-skel-large-header) - (erlang-skel-separator 2) - "%% Include files" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% External exports" n - (erlang-skel-separator 2) - "-export([" n> "init/1, " n> "terminate/2," n> "code_change/3" n - " ])." n - n - (erlang-skel-separator 2) - "%% Internal exports" n - (erlang-skel-separator 2) - "-export([" n - " ])." n - n - (erlang-skel-separator 2) - "%% Macros" n - (erlang-skel-separator 2) - n - (erlang-skel-separator 2) - "%% Records" n - (erlang-skel-separator 2) - "-record(state, {})." n - n - (erlang-skel-double-separator 2) - "%% External functions" n - (erlang-skel-double-separator 2) - (erlang-skel-separator 2) - "%% Function: init/1" n - "%% Description: Initiates the server" n - "%% Returns: {ok, State} |" n - "%% {ok, State, Timeout} |" n - "%% ignore |" n - "%% {stop, Reason}" n - (erlang-skel-separator 2) - "init([]) ->" n> - "{ok, #state{}}." n - n - (erlang-skel-separator 2) - "%% Function: terminate/2" n - "%% Description: Shutdown the server" n - "%% Returns: any (ignored by gen_server)" n - (erlang-skel-separator 2) - "terminate(Reason, State) ->" n> - "ok." n - n - (erlang-skel-separator 2) - "%% Function: code_change/3" n - "%% Description: Convert process state when code is changed" n - "%% Returns: {ok, NewState}" n - (erlang-skel-separator 2) - "code_change(OldVsn, State, Extra) ->" n> - "{ok, State}." n - n - (erlang-skel-double-separator 2) - "%% Internal functions" n - (erlang-skel-double-separator 2) - ) - "*The template of a library module. -Please see the function `tempo-define-template'.") - - - -;; Font-lock variables - -(defvar erlang-font-lock-modern-p - (cond ((>= erlang-emacs-major-version 20) t) - (erlang-xemacs-p (>= erlang-emacs-minor-version 14)) - ((= erlang-emacs-major-version 19) (>= erlang-emacs-minor-version 29)) - (t nil)) - "Non-nil when this version of Emacs uses a modern version of Font Lock. - -This is determinated by checking the version of Emacs used, the actual -font-lock code is not loaded.") - - -;; The next few variables define different Erlang font-lock patterns. -;; They could be appended to form a custom font-lock appearence. -;; -;; The function `erlang-font-lock-set-face' could be used to change -;; the face of a pattern. -;; -;; Note that Erlang strings and atoms are hightlighted with using -;; syntactix analysis. - -(defvar erlang-font-lock-keywords-func - (list - (list (concat "^" erlang-atom-regexp "\\s *(") - 1 'font-lock-function-name-face t)) - "Font lock keyword highlighting a function header.") - -(defvar erlang-font-lock-keywords-dollar - (list - (list "\\(\\$\\([^\\]\\|\\\\\\([^0-7^\n]\\|[0-7]+\\|\\^[a-zA-Z]\\)\\)\\)" - 1 'font-lock-string-face)) - "Font lock keyword highlighting numbers in ascii-form (e.g. $A).") - -(defvar erlang-font-lock-keywords-arrow - (list - (list "\\(->\\|:-\\)\\(\\s \\|$\\)" 2 'font-lock-function-name-face)) - "Font lock keyword highlighting clause arrow.") - -(defvar erlang-font-lock-keywords-lc - (list - (list "\\(<-\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face) - (list "\\(||\\)\\(\\s \\|$\\)" 1 'font-lock-keyword-face)) - "Font lock keyword highlighting list comprehension operators.") - -(defvar erlang-font-lock-keywords-keywords - (list - (list (concat "\\<\\(after\\|begin\\|c\\(atch\\|ase\\)\\|end\\|fun\\|if" - "\\|of\\|receive\\|when\\|andalso\\|orelse\\|query\\)\\([^a-zA-Z0-9_]\\|$\\)") - 1 'font-lock-keyword-face)) - "Font lock keyword highlighting Erlang keywords.") - -(defvar erlang-font-lock-keywords-attr - (list - (list (concat "^\\(-" erlang-atom-regexp "\\)\\s *\\(\\.\\|(\\)") - 1 'font-lock-function-name-face)) - "Font lock keyword highlighting attribues.") - -(defvar erlang-font-lock-keywords-quotes - (list - (list "`\\([-+a-zA-Z0-9_:*][-+a-zA-Z0-9_:*]+\\)'" - 1 - (if erlang-font-lock-modern-p - 'font-lock-reference-face - 'font-lock-keyword-face) - t)) - "Font lock keyword highlighting words in single quotes in comments. - -This is not the keyword hightlighting Erlang strings and atoms, they -are highlighted by syntactic analysis.") - -;; Note: The guard `float' collides with the bif `float'. -(defvar erlang-font-lock-keywords-guards - (list - (list - (concat "\\<\\(" - "\\(is_\\)*\\(atom\\|function\\|binary\\|constant\\|float" - "\\|integer\\|list\\|number\\|p\\(id\\|ort\\)\\|" - "re\\(ference\\|cord\\)\\|tuple" - "\\)\\)\\s *(") - - 1 - (if erlang-font-lock-modern-p - 'font-lock-reference-face - 'font-lock-keyword-face))) - "Font lock keyword highlighting guards.") - -(defvar erlang-font-lock-keywords-bifs - (list - (list - (concat - "\\<\\(" - "a\\(bs\\|live\\|pply\\|tom_to_list\\)\\|" - "binary_to_\\(list\\|term\\)\\|" - "concat_binary\\|d\\(ate\\|isconnect_node\\)\\|" - "e\\(lement\\|rase\\|xit\\)\\|" - "float\\(\\|_to_list\\)\\|" - "g\\(arbage_collect\\|et\\(\\|_keys\\)\\|roup_leader\\)\\|" - "h\\(alt\\|d\\)\\|" - "i\\(nte\\(ger_to_list\\|rnal_bif\\)\\|s_alive\\)\\|" - "l\\(ength\\|i\\(nk\\|st_to_\\(atom\\|binary\\|float\\|integer" - "\\|pid\\|tuple\\)\\)\\)\\|" - "make_ref\\|no\\(de\\(\\|_\\(link\\|unlink\\)\\|s\\)\\|talive\\)\\|" - "open_port\\|" - "p\\(id_to_list\\|rocess\\(_\\(flag\\|info\\)\\|es\\)\\|ut\\)\\|" - "r\\(egister\\(\\|ed\\)\\|ound\\)\\|" - "s\\(e\\(lf\\|telement\\)\\|ize\\|" - "p\\(awn\\(\\|_link\\)\\|lit_binary\\)\\|tatistics\\)\\|" - "t\\(erm_to_binary\\|hrow\\|ime\\|l\\|" - "r\\(ace\\|unc\\)\\|uple_to_list\\)\\|" - "un\\(link\\|register\\)\\|whereis" - "\\)\\s *(") - 1 - 'font-lock-keyword-face)) - "Font lock keyword highlighting built in functions.") - -(defvar erlang-font-lock-keywords-macros - (list - (list (concat "?\\s *\\(" erlang-atom-regexp - "\\|" erlang-variable-regexp "\\)\\>") - 1 (if erlang-font-lock-modern-p - 'font-lock-reference-face - 'font-lock-type-face)) - (list (concat "^-\\(define\\|ifn?def\\)\\s *(\\s *\\(" erlang-atom-regexp - "\\|" erlang-variable-regexp "\\)\\>") - 2 (if erlang-font-lock-modern-p - 'font-lock-reference-face - 'font-lock-type-face))) - "Font lock keyword highlighting macros. -This must be placed in front of `erlang-font-lock-keywords-vars'.") - -(defvar erlang-font-lock-keywords-records - (list - (list (concat "#\\s *" erlang-atom-regexp "\\>") - 1 'font-lock-type-face) - ;; Don't highlight numerical constants. - (list "\\<[0-9][0-9]?#\\([0-9a-fA_F]+\\)\\>" - 1 nil t) - (list (concat "^-record(\\s *" erlang-atom-regexp "\\>") - 1 'font-lock-type-face)) - "Font lock keyword highlighting Erlang records. -This must be placed in front of `erlang-font-lock-keywords-vars'.") - -(defvar erlang-font-lock-keywords-vars - (list - (list (concat "\\<" erlang-variable-regexp "\\>") - 1 (if erlang-font-lock-modern-p - 'font-lock-variable-name-face - 'font-lock-type-face))) - "Font lock keyword highlighting Erlang variables. -Must be preceded by `erlang-font-lock-keywords-macros' and `-records' -to work properly.") - - -(defvar erlang-font-lock-keywords-1 - (append erlang-font-lock-keywords-func - erlang-font-lock-keywords-dollar - erlang-font-lock-keywords-arrow - erlang-font-lock-keywords-keywords) - ;; DocStringOrig: erlang-font-lock-keywords - "Font-lock keywords used by Erlang Mode. - -There exists three levels of Font Lock keywords for Erlang: - `erlang-font-lock-keywords-1' - Function headers and reserved keywords. - `erlang-font-lock-keywords-2' - Bifs, guards and `singel quotes'. - `erlang-font-lock-keywords-3' - Variables, macros and records. - -To use a specific level, please set the variable -`font-lock-maximum-decoration' to the appropriate level. Note that the -variable must be set before Erlang mode is activated. - -Example: - (setq font-lock-maximum-decoration 2)") - - -(defvar erlang-font-lock-keywords-2 - (append erlang-font-lock-keywords-1 - erlang-font-lock-keywords-attr - erlang-font-lock-keywords-quotes - erlang-font-lock-keywords-guards - erlang-font-lock-keywords-bifs) - ;; DocStringCopy: erlang-font-lock-keywords - "Font-lock keywords used by Erlang Mode. - -There exists three levels of Font Lock keywords for Erlang: - `erlang-font-lock-keywords-1' - Function headers and reserved keywords. - `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. - `erlang-font-lock-keywords-3' - Variables, macros and records. - -To use a specific level, please set the variable -`font-lock-maximum-decoration' to the appropriate level. Note that the -variable must be set before Erlang mode is activated. - -Example: - (setq font-lock-maximum-decoration 2)") - - -(defvar erlang-font-lock-keywords-3 - (append erlang-font-lock-keywords-2 - erlang-font-lock-keywords-macros - erlang-font-lock-keywords-records - erlang-font-lock-keywords-vars) - ;; DocStringCopy: erlang-font-lock-keywords - "Font-lock keywords used by Erlang Mode. - -There exists three levels of Font Lock keywords for Erlang: - `erlang-font-lock-keywords-1' - Function headers and reserved keywords. - `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. - `erlang-font-lock-keywords-3' - Variables, macros and records. - -To use a specific level, please set the variable -`font-lock-maximum-decoration' to the appropriate level. Note that the -variable must be set before Erlang mode is activated. - -Example: - (setq font-lock-maximum-decoration 2)") - - -(defvar erlang-font-lock-keywords erlang-font-lock-keywords-3 - ;; DocStringCopy: erlang-font-lock-keywords - "Font-lock keywords used by Erlang Mode. - -There exists three levels of Font Lock keywords for Erlang: - `erlang-font-lock-keywords-1' - Function headers and reserved keywords. - `erlang-font-lock-keywords-2' - Bifs, guards and `single quotes'. - `erlang-font-lock-keywords-3' - Variables, macros and records. - -To use a specific level, please set the variable -`font-lock-maximum-decoration' to the appropriate level. Note that the -variable must be set before Erlang mode is activated. - -Example: - (setq font-lock-maximum-decoration 2)") - - -(defvar erlang-font-lock-syntax-table nil - "Syntax table used by Font Lock mode. - -The difference between this and the standard Erlang Mode -syntax table is that `_' is treated as part of words by -this syntax table. - -Unfortuantely, XEmacs hasn't got support for a special Font -Lock syntax table. The effect is that `apply' in the atom -`foo_apply' will be highlighted as a bif.") - - -;;; Avoid errors while compiling this file. - -;; `eval-when-compile' is not defined in Emacs 18. We define it as a -;; no-op. -(or (fboundp 'eval-when-compile) - (defmacro eval-when-compile (&rest rest) nil)) - -;; These umm...functions are new in Emacs 20. And, yes, until version -;; 19.27 Emacs backquotes were this ugly. - -(or (fboundp 'unless) - (defmacro unless (condition &rest body) - "(unless CONDITION BODY...): If CONDITION is false, do BODY, else return nil." - (` (if (, condition) - nil - (,@ body))))) - -(or (fboundp 'when) - (defmacro when (condition &rest body) - "(when CONDITION BODY...): If CONDITION is true, do BODY, else return nil." - (` (if (, condition) - (progn (,@ body)) - nil)))) - -(or (fboundp 'char-before) - (defmacro char-before (&optional pos) - "Return the character in the current buffer just before POS." - (` (char-after (1- (or (, pos) (point))))))) - -(or (fboundp 'regexp-opt) - (defun regexp-opt (strings &optional paren) - "Return a regular expression that matches any string in -STRINGS. If PAREN is true, it will always enclose the regular -expression in parentheses. - -Unlike its Emacs-20 namesake, it will not optimize the generated -expression." - ;; This stop-gap definition is taken from - ;; _GNU_Emacs_Lisp_Reference_Manual_, ed 2.5, for Emacs 20.3. - (let ((open (if paren "\\(" "")) - (close (if paren "\\)" ""))) - (concat open - (mapconcat 'regexp-quote strings "\\|") - close)))) - -(eval-when-compile - (if (or (featurep 'bytecomp) - (featurep 'byte-compile)) - (progn - (cond ((string-match "Lucid\\|XEmacs" emacs-version) - (put 'comment-indent-hook 'byte-obsolete-variable nil) - ;; Do not warn for unused variables - ;; when compiling under XEmacs. - (setq byte-compile-warnings - '(free-vars unresolved callargs redefine)))) - (require 'comint) - (require 'compile)))) - - -(defun erlang-version () - "Return the current version of Erlang mode." - (interactive) - (if (interactive-p) - (message "Erlang mode version %s, written by Anders Lindgren" - erlang-version)) - erlang-version) - - -;;;###autoload -(defun erlang-mode () - "Major mode for editing Erlang source files in Emacs. -It knows about syntax and comment, it can indent code, it is capable -of fontifying the source file, the TAGS commands are aware of Erlang -modules, and the Erlang man pages can be accessed. - -Should this module, \"erlang.el\", be installed properly, Erlang mode -is activated whenever an Erlang source or header file is loaded into -Emacs. To indicate this, the mode line should contain the word -\"Erlang\". - -The main feature of Erlang mode is indentation, press TAB and the -current line will be indented correctly. - -Comments starting with only one `%' are indented to the column stored -in the variable `comment-column'. Comments starting with two `%':s -are indented with the same indentation as code. Comments starting -with at least three `%':s are indented to the first column. - -However, Erlang mode contains much more, this is a list of the most -useful commands: - TAB - Indent the line. - C-c C-q - Indent current function. - M-; - Create a comment at the end of the line. - M-q - Fill a comment, i.e. wrap lines so that they (hopefully) - will look better. - M-a - Goto the beginning of an Erlang clause. - M-C-a - Ditto for function. - M-e - Goto the end of an Erlang clause. - M-C-e - Ditto for function. - M-h - Mark current Erlang clause. - M-C-h - Ditto for function. - C-c C-z - Start, or switch to, an inferior Erlang shell. - C-c C-k - Compile current file. - C-x ` - Next error. - , - Electric comma. - ; - Electric semicolon. - -Erlang mode check the name of the file against the module name when -saving, whenever a mismatch occurs Erlang mode offers to modify the -source. - -The variable `erlang-electric-commands' controls the electric -commands. To deactivate all of them, set it to nil. - -There exists a large number of commands and variables in the Erlang -module. Please press `M-x apropos RET erlang RET' to see a complete -list. Press `C-h f name-of-function RET' and `C-h v name-of-variable -RET'to see the full description of functions and variables, -respectively. - -On entry to this mode the contents of the hook `erlang-mode-hook' is -executed. - -Please see the beginning of the file `erlang.el' for more information -and examples of hooks. - -Other commands: -\\{erlang-mode-map}" - (interactive) - (kill-all-local-variables) - (setq major-mode 'erlang-mode) - (setq mode-name "Erlang") - (erlang-syntax-table-init) - (erlang-keymap-init) - (erlang-electric-init) - (erlang-menu-init) - (erlang-mode-variables) - (erlang-check-module-name-init) - (erlang-add-compilation-alist erlang-error-regexp-alist) - (erlang-man-init) - (erlang-tags-init) - (erlang-font-lock-init) - (erlang-skel-init) - (run-hooks 'erlang-mode-hook) - (if (zerop (buffer-size)) - (run-hooks 'erlang-new-file-hook))) - - -(defun erlang-syntax-table-init () - (if (null erlang-mode-syntax-table) - (let ((table (make-syntax-table))) - (modify-syntax-entry ?\n ">" table) - (modify-syntax-entry ?\" "\"" table) - (modify-syntax-entry ?# "." table) - (modify-syntax-entry ?$ "/" table) - (modify-syntax-entry ?% "<" table) - (modify-syntax-entry ?& "." table) - (modify-syntax-entry ?\' "\"" table) - (modify-syntax-entry ?* "." table) - (modify-syntax-entry ?+ "." table) - (modify-syntax-entry ?- "." table) - (modify-syntax-entry ?/ "." table) - (modify-syntax-entry ?: "." table) - (modify-syntax-entry ?< "." table) - (modify-syntax-entry ?= "." table) - (modify-syntax-entry ?> "." table) - (modify-syntax-entry ?\\ "\\" table) - (modify-syntax-entry ?_ "_" table) - (modify-syntax-entry ?| "." table) - (modify-syntax-entry ?^ "/" table) - - ;; Pseudo bit-syntax: Latin1 double angle quotes as parens. - ;;(modify-syntax-entry ?\253 "(?\273" table) - ;;(modify-syntax-entry ?\273 ")?\253" table) - - (setq erlang-mode-syntax-table table))) - - (set-syntax-table erlang-mode-syntax-table)) - - -(defun erlang-keymap-init () - (if erlang-mode-map - nil - (setq erlang-mode-map (make-sparse-keymap)) - (erlang-mode-commands erlang-mode-map)) - (use-local-map erlang-mode-map)) - - -(defun erlang-mode-commands (map) - (define-key map "\t" 'erlang-indent-command) - (define-key map ";" 'erlang-electric-semicolon) - (define-key map "," 'erlang-electric-comma) - (define-key map "<" 'erlang-electric-lt) - (define-key map ">" 'erlang-electric-gt) - (define-key map "\C-m" 'erlang-electric-newline) - (define-key map "\177" 'backward-delete-char-untabify) - (define-key map "\M-q" 'erlang-fill-paragraph) - (define-key map "\M-\C-a" 'erlang-beginning-of-function) - (define-key map "\M-\C-e" 'erlang-end-of-function) - (define-key map "\M-\C-h" 'erlang-mark-function) - (define-key map "\M-\t" 'erlang-complete-tag) - (define-key map "\C-c\M-\t" 'tempo-complete-tag) - (define-key map "\C-c\M-a" 'erlang-beginning-of-clause) - (define-key map "\C-c\M-b" 'tempo-backward-mark) - (define-key map "\C-c\M-e" 'erlang-end-of-clause) - (define-key map "\C-c\M-f" 'tempo-forward-mark) - (define-key map "\C-c\M-h" 'erlang-mark-clause) - (define-key map "\C-c\C-c" 'comment-region) - (define-key map "\C-c\C-j" 'erlang-generate-new-clause) - (define-key map "\C-c\C-k" 'erlang-compile) - (define-key map "\C-c\C-l" 'erlang-compile-display) - (define-key map "\C-c\C-s" 'erlang-show-syntactic-information) - (define-key map "\C-c\C-q" 'erlang-indent-function) - (define-key map "\C-c\C-u" 'erlang-uncomment-region) - (define-key map "\C-c\C-y" 'erlang-clone-arguments) - (define-key map "\C-c\C-z" 'erlang-shell-display) - (define-key map "\C-x`" 'erlang-next-error)) - - -(defun erlang-electric-init () - ;; Set up electric character functions to work with - ;; delsel/pending-del mode. Also, set up text properties for bit - ;; syntax handling. - (mapcar #'(lambda (cmd) - (put cmd 'delete-selection t) ;for delsel (Emacs) - (put cmd 'pending-delete t)) ;for pending-del (XEmacs) - '(erlang-electric-semicolon - erlang-electric-comma - erlang-electric-gt)) - - (put 'bitsyntax-open-outer 'syntax-table '(4 . ?>)) - (put 'bitsyntax-open-outer 'rear-nonsticky '(category)) - (put 'bitsyntax-open-inner 'rear-nonsticky '(category)) - (put 'bitsyntax-close-inner 'rear-nonsticky '(category)) - (put 'bitsyntax-close-outer 'syntax-table '(5 . ?<)) - (put 'bitsyntax-close-outer 'rear-nonsticky '(category)) - (setq parse-sexp-lookup-properties 't)) - - - -(defun erlang-mode-variables () - (or erlang-mode-abbrev-table - (define-abbrev-table 'erlang-mode-abbrev-table ())) - (setq local-abbrev-table erlang-mode-abbrev-table) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "^$\\|" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'paragraph-ignore-fill-prefix) - (setq paragraph-ignore-fill-prefix t) - (make-local-variable 'require-final-newline) - (setq require-final-newline t) - (make-local-variable 'defun-prompt-regexp) - (setq defun-prompt-regexp erlang-defun-prompt-regexp) - (make-local-variable 'comment-start) - (setq comment-start "%") - (make-local-variable 'comment-start-skip) - (setq comment-start-skip "%+\\s *") - (make-local-variable 'comment-column) - (setq comment-column 48) - (make-local-variable 'indent-line-function) - (setq indent-line-function 'erlang-indent-command) - (make-local-variable 'indent-region-function) - (setq indent-region-function 'erlang-indent-region) - (set (make-local-variable 'comment-indent-function) 'erlang-comment-indent) - (if (<= erlang-emacs-major-version 18) - (set (make-local-variable 'comment-indent-hook) 'erlang-comment-indent)) - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'dabbrev-case-fold-search) nil) - (set (make-local-variable 'imenu-prev-index-position-function) - 'erlang-beginning-of-function) - (set (make-local-variable 'imenu-extract-index-name-function) - 'erlang-get-function-name) - (set (make-local-variable 'tempo-match-finder) - "[^-a-zA-Z0-9_]\\([-a-zA-Z0-9_]*\\)\\=")) - - -;; Compilation. -;; -;; The following code is compatible with the standard package `compilation', -;; making it possible to go to errors using `erlang-next-error'. -;; -;; The normal `compile' command works ofcourse. For best result, please -;; execute `make' with the `-w' flag. -;; -;; Please see the variables named `compiling-..' above. - -(defun erlang-add-compilation-alist (alist) - (require 'compile) - (cond ((boundp 'compilation-error-regexp-alist) ; Emacs 19 - (while alist - (or (assoc (car (car alist)) compilation-error-regexp-alist) - (setq compilation-error-regexp-alist - (cons (car alist) compilation-error-regexp-alist))) - (setq alist (cdr alist)))) - ((boundp 'compilation-error-regexp) - ;; Emacs 18, Only one regexp is allowed. - (funcall (symbol-function 'set) - 'compilation-error-regexp (car (car alist)))))) - -(defun erlang-font-lock-init () - "Initialize Font Lock for Erlang mode." - (or erlang-font-lock-syntax-table - (setq erlang-font-lock-syntax-table - (let ((table (copy-syntax-table erlang-mode-syntax-table))) - (modify-syntax-entry ?_ "w" table) - table))) - (set (make-local-variable 'font-lock-syntax-table) - erlang-font-lock-syntax-table) - (set (make-local-variable 'font-lock-beginning-of-syntax-function) - 'erlang-beginning-of-clause) - (make-local-variable 'font-lock-keywords) - (let ((level (cond ((boundp 'font-lock-maximum-decoration) - (symbol-value 'font-lock-maximum-decoration)) - ((boundp 'font-lock-use-maximal-decoration) - (symbol-value 'font-lock-use-maximal-decoration)) - (t nil)))) - (if (consp level) - (setq level (cdr-safe (or (assq 'erlang-mode level) - (assq t level))))) - ;; `level' can here be: - ;; A number - The fontification level - ;; nil - Use the default - ;; t - Use maximum - (cond ((eq level nil) - (set 'font-lock-keywords erlang-font-lock-keywords)) - ((eq level 1) - (set 'font-lock-keywords erlang-font-lock-keywords-1)) - ((eq level 2) - (set 'font-lock-keywords erlang-font-lock-keywords-2)) - (t - (set 'font-lock-keywords erlang-font-lock-keywords-3)))) - - ;; Modern font-locks can handle the above much more elegant: - (set (make-local-variable 'font-lock-defaults) - '((erlang-font-lock-keywords erlang-font-lock-keywords-1 - erlang-font-lock-keywords-2 erlang-font-lock-keywords-3) - nil nil ((?_ . "w")) erlang-beginning-of-clause - (font-lock-mark-block-function . erlang-mark-clause)))) - - - -;; Useful when definig yout own keywords. -(defun erlang-font-lock-set-face (ks &rest faces) - "Replace the face components in a list of keywords. - -The first argument, KS, is a list of keywords. The rest of the -arguments are expressions to replace the face information with. The -first expression replaces the face of the first keyword, the second -expression the second keyword etc. - -Should an expression be nil, the face of the corresponding keyword is -not changed. - -Should fewer expressions than keywords be given, the last expression -is used for all remaining keywords. - -Normally, the expressions are just atoms representing the new face. -They could however be more complex, returning different faces in -different situations. - -This function does only handle keywords with elements on the forms: - (REGEXP NUMBER FACE) - (REGEXP NUMBER FACE OVERWRITE) - -This could be used when defining your own special font-lock setup, e.g: - -\(setq my-font-lock-keywords - (append erlang-font-lock-keywords-func - erlang-font-lock-keywords-dollar - (erlang-font-lock-set-face - erlang-font-lock-keywords-macros 'my-neon-green-face) - (erlang-font-lock-set-face - erlang-font-lock-keywords-lc 'my-deep-red 'my-light-red) - erlang-font-lock-keywords-attr)) - -For a more elaborate example, please see the beginning of the file -`erlang.el'." - (let ((res '())) - (while ks - (let* ((regexp (car (car ks))) - (number (car (cdr (car ks)))) - (new-face (if (and faces (car faces)) - (car faces) - (car (cdr (cdr (car ks)))))) - (overwrite (car (cdr (cdr (cdr (car ks)))))) - (new-keyword (list regexp number new-face))) - (if overwrite (nconc new-keyword (list overwrite))) - (setq res (cons new-keyword res)) - (setq ks (cdr ks)) - (if (and faces (cdr faces)) - (setq faces (cdr faces))))) - (nreverse res))) - - -(defun erlang-font-lock-level-0 () - ;; DocStringOrig: font-cmd - "Fontify current buffer. Level ranges from 0 (off) to 3 (Christmas Tree). - -The following fontification level exists: - 0 - No fontification - 1 - Function headers, reserved keywords, strings and comments. - 2 - Bifs, guards and `single quotes'. - 3 - Variables, macros and records. - -To automatically activate font lock mode, place the following lines -in your ~/.emacs file: - -\(defun my-erlang-mode-hook () - (cond (window-system - (font-lock-mode 1)))) -\(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) -\(setq font-lock-maximum-decoration t)" - (interactive) - (font-lock-mode 0)) - - -(defun erlang-font-lock-level-1 () - ;; DocStringCopy: font-cmd - "Fontify current buffer. Level ranges from 0 (off) to 3 (Christmas Tree). - -The following fontification level exists: - 0 - No fontification - 1 - Function headers, reserved keywords, strings and comments. - 2 - Bifs, guards and `single quotes'. - 3 - Variables, macros and records. - -To automatically activate font lock mode, place the following lines -in your ~/.emacs file: - -\(defun my-erlang-mode-hook () - (cond (window-system - (font-lock-mode 1)))) -\(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) -\(setq font-lock-maximum-decoration t)" - (interactive) - (require 'font-lock) - (set 'font-lock-keywords erlang-font-lock-keywords-1) - (font-lock-mode 1) - (funcall (symbol-function 'font-lock-fontify-buffer))) - - -(defun erlang-font-lock-level-2 () - ;; DocStringCopy: font-cmd - "Fontify current buffer. Level ranges from 0 (off) to 3 (Christmas Tree). - -The following fontification level exists: - 0 - No fontification - 1 - Function headers, reserved keywords, strings and comments. - 2 - Bifs, guards and `single quotes'. - 3 - Variables, macros and records. - -To automatically activate font lock mode, place the following lines -in your ~/.emacs file: - -\(defun my-erlang-mode-hook () - (cond (window-system - (font-lock-mode 1)))) -\(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) -\(setq font-lock-maximum-decoration t)" - (interactive) - (require 'font-lock) - (set 'font-lock-keywords erlang-font-lock-keywords-2) - (font-lock-mode 1) - (funcall (symbol-function 'font-lock-fontify-buffer))) - - -(defun erlang-font-lock-level-3 () - ;; DocStringCopy: font-cmd - "Fontify current buffer. Level ranges from 0 (off) to 3 (Christmas Tree). - -The following fontification level exists: - 0 - No fontification - 1 - Function headers, reserved keywords, strings and comments. - 2 - Bifs, guards and `single quotes'. - 3 - Variables, macros and records. - -To automatically activate font lock mode, place the following lines -in your ~/.emacs file: - -\(defun my-erlang-mode-hook () - (cond (window-system - (font-lock-mode 1)))) -\(add-hook 'erlang-mode-hook 'my-erlang-mode-hook) -\(setq font-lock-maximum-decoration t)" - (interactive) - (require 'font-lock) - (set 'font-lock-keywords erlang-font-lock-keywords-3) - (font-lock-mode 1) - (funcall (symbol-function 'font-lock-fontify-buffer))) - - -(defun erlang-menu-init () - "Init menus for Erlang mode. - -The variable `erlang-menu-items' contain a description of the Erlang -mode menu. Normally, the list contains atoms, representing variables -bound to pieces of the menu. - -Personal extentions could be added to `erlang-menu-personal-items'. - -Should any variable describing the menu configuration, this function -should be called." - (erlang-menu-install "Erlang" erlang-menu-items erlang-mode-map t)) - - -(defun erlang-menu-install (name items keymap &optional popup) - "Install a menu on Emacs 19 or XEmacs based on an abstract description. - -NAME is the name of the menu. - -ITEMS is a list. The elements are either nil representing a horisontal -line or a list with two or three elements. The first is the name of -the menu item, the second the function to call, or a submenu, on the -same same form as ITEMS. The third optional element is an expression -which is evaluated every time the menu is displayed. Should the -expression evaluate to nil the menu item is ghosted. - -KEYMAP is the keymap to add to menu to. (When using XEmacs, the menu -will only be visible when this meny is the global, the local, or an -activated minor mode keymap.) - -If POPUP is non-nil, the menu is bound to the XEmacs `mode-popup-menu' -variable, i.e. it will popup when pressing the right mouse button. - -Please see the variable `erlang-menu-base-items'." - (cond (erlang-xemacs-p - (let ((menu (erlang-menu-xemacs name items keymap))) - ;; We add the menu to the global menubar. - ;;(funcall (symbol-function 'set-buffer-menubar) - ;; (symbol-value 'current-menubar)) - (funcall (symbol-function 'add-submenu) nil menu) - (setcdr erlang-xemacs-popup-menu (cdr menu)) - (if (and popup (boundp 'mode-popup-menu)) - (funcall (symbol-function 'set) - 'mode-popup-menu erlang-xemacs-popup-menu)))) - ((>= erlang-emacs-major-version 19) - (define-key keymap (vector 'menu-bar (intern name)) - (erlang-menu-make-keymap name items))) - (t nil))) - - -(defun erlang-menu-make-keymap (name items) - "Build a menu for Emacs 19." - (let ((menumap (funcall (symbol-function 'make-sparse-keymap) - name)) - (count 0) - id def first second third) - (setq items (reverse items)) - (while items - ;; Replace any occurence of atoms by their value. - (while (and items (atom (car items)) (not (null (car items)))) - (if (and (boundp (car items)) - (listp (symbol-value (car items)))) - (setq items (append (reverse (symbol-value (car items))) - (cdr items))) - (setq items (cdr items)))) - (setq first (car-safe (car items))) - (setq second (car-safe (cdr-safe (car items)))) - (setq third (car-safe (cdr-safe (cdr-safe (car items))))) - (cond ((null first) - (setq count (+ count 1)) - (setq id (intern (format "separator-%d" count))) - (setq def '("--" . nil))) - ((and (consp second) (eq (car second) 'lambda)) - (setq count (+ count 1)) - (setq id (intern (format "lambda-%d" count))) - (setq def (cons first second))) - ((symbolp second) - (setq id second) - (setq def (cons first second))) - (t - (setq count (+ count 1)) - (setq id (intern (format "submenu-%d" count))) - (setq def (erlang-menu-make-keymap first second)))) - (define-key menumap (vector id) def) - (if third - (put id 'menu-enable third)) - (setq items (cdr items))) - (cons name menumap))) - - -(defun erlang-menu-xemacs (name items &optional keymap) - "Build a menu for XEmacs." - (let ((res '()) - first second third entry) - (while items - ;; Replace any occurence of atoms by their value. - (while (and items (atom (car items)) (not (null (car items)))) - (if (and (boundp (car items)) - (listp (symbol-value (car items)))) - (setq items (append (reverse (symbol-value (car items))) - (cdr items))) - (setq items (cdr items)))) - (setq first (car-safe (car items))) - (setq second (car-safe (cdr-safe (car items)))) - (setq third (car-safe (cdr-safe (cdr-safe (car items))))) - (cond ((null first) - (setq res (cons "------" res))) - ((symbolp second) - (setq res (cons (vector first second (or third t)) res))) - ((and (consp second) (eq (car second) 'lambda)) - (setq res (cons (vector first (list 'call-interactively second) - (or third t)) res))) - (t - (setq res (cons (cons first - (cdr (erlang-menu-xemacs - first second))) - res)))) - (setq items (cdr items))) - (setq res (reverse res)) - ;; When adding a menu to a minor-mode keymap under Emacs 19, - ;; it disappears when the mode is disabled. The expression - ;; generated below imitates this behaviour. - ;; (This could be expressed much clearer using backquotes, - ;; but I don't want to pull in every package.) - (if keymap - (let ((expr (list 'or - (list 'eq keymap 'global-map) - (list 'eq keymap (list 'current-local-map)) - (list 'symbol-value - (list 'car-safe - (list 'rassq - keymap - 'minor-mode-map-alist)))))) - (setq res (cons ':included (cons expr res))))) - (cons name res))) - - -(defun erlang-menu-substitute (items alist) - "Substitute functions in menu described by ITEMS. - -The menu ITEMS is updated destructively. - -ALIST is list of pairs where the car is the old function and cdr the new." - (let (first second pair) - (while items - (setq first (car-safe (car items))) - (setq second (car-safe (cdr-safe (car items)))) - (cond ((null first)) - ((symbolp second) - (setq pair (and second (assq second alist))) - (if pair - (setcar (cdr (car items)) (cdr pair)))) - ((and (consp second) (eq (car second) 'lambda))) - (t - (erlang-menu-substitute second alist))) - (setq items (cdr items))))) - - -(defun erlang-menu-add-above (entry above items) - "Add menu ENTRY above menu entry ABOVE in menu ITEMS. -Do nothing if the items already should be in the menu. -Should ABOVE not be in the list, the entry is added at -the bottom of the menu. - -The new menu is returned. No guarantee is given that the original -menu is left unchanged. - -The equality test is performed by `eq'. - -Example: (erlang-menu-add-above 'my-erlang-menu-items - 'erlang-menu-man-items)" - (erlang-menu-add-below entry above items t)) - - -(defun erlang-menu-add-below (entry below items &optional above-p) - "Add menu ENTRY below menu items BELOW in the Erlang menu. -Do nothing if the items already should be in the menu. -Should BELOW not be in the list, items is added at the bottom -of the menu. - -The new menu is returned. No guarantee is given that the original -menu is left unchanged. - -The equality test is performed by `eq'. - -Example: - -\(setq erlang-menu-items - (erlang-menu-add-below 'my-erlang-menu-items - 'erlang-menu-base-items - erlang-menu-items))" - (if (memq entry items) - items ; Return the original menu. - (let ((head '()) - (done nil) - res) - (while (not done) - (cond ((null items) - (setq res (append head (list entry))) - (setq done t)) - ((eq below (car items)) - (setq res - (if above-p - (append head (cons entry items)) - (append head (cons (car items) - (cons entry (cdr items)))))) - (setq done t)) - (t - (setq head (append head (list (car items)))) - (setq items (cdr items))))) - res))) - -(defun erlang-menu-delete (entry items) - "Delete ENTRY from menu ITEMS. - -The new menu is returned. No guarantee is given that the original -menu is left unchanged." - (delq entry items)) - -;; Man code: - -(defun erlang-man-init () - "Add menus containing the manual pages of the Erlang. - -The variable `erlang-man-dirs' contains entries describing -the location of the manual pages." - (interactive) - (if erlang-man-inhibit - () - (setq erlang-menu-man-items - '(nil - ("Man - Function" erlang-man-function))) - (if erlang-man-dirs - (setq erlang-menu-man-items - (append erlang-menu-man-items - (erlang-man-make-top-menu erlang-man-dirs)))) - (setq erlang-menu-items - (erlang-menu-add-above 'erlang-menu-man-items - 'erlang-menu-version-items - erlang-menu-items)) - (erlang-menu-init))) - - -(defun erlang-man-uninstall () - "Remove the man pages from the Erlang mode." - (interactive) - (setq erlang-menu-items - (erlang-menu-delete 'erlang-menu-man-items erlang-menu-items)) - (erlang-menu-init)) - - -;; The man menu is a hierarchal structure, with the manual sections -;; at the top, described by `erlang-man-dirs'. The next level could -;; either be the manual pages if not to many, otherwise it is an index -;; menu whose submenus will contain up to `erlang-man-max-menu-size' -;; manual pages. - -(defun erlang-man-make-top-menu (dir-list) - "Create one menu entry per element of DIR-LIST. -The format is described in the documentation of `erlang-man-dirs'." - (let ((menu '()) - dir) - (while dir-list - (setq dir (cond ((nth 2 (car dir-list)) - ;; Relative to `erlang-root-dir'. - (and (stringp erlang-root-dir) - (concat erlang-root-dir (nth 1 (car dir-list))))) - (t - ;; Absolute - (nth 1 (car dir-list))))) - (if (and dir - (file-readable-p dir)) - (setq menu (cons (list (car (car dir-list)) - (erlang-man-make-middle-menu - (erlang-man-get-files dir))) - menu))) - (setq dir-list (cdr dir-list))) - ;; Should no menus be found, generate a menu item which - ;; will display a help text, when selected. - (if menu - (nreverse menu) - '(("Man Pages" - (("Error! Why?" erlang-man-describe-error))))))) - - -;; Should the menu be to long, let's split it into a number of -;; smaller menus. Warning, this code contains beatiful -;; destructive operations! -(defun erlang-man-make-middle-menu (filelist) - "Create the second level menu from FILELIST. - -Should the list be longer than `erlang-man-max-menu-size', a tree of -menus is created." - (if (<= (length filelist) erlang-man-max-menu-size) - (erlang-man-make-menu filelist) - (let ((menu '()) - (filelist (copy-sequence filelist)) - segment submenu pair) - (while filelist - (setq pair (nthcdr (- erlang-man-max-menu-size 1) filelist)) - (setq segment filelist) - (if (null pair) - (setq filelist nil) - (setq filelist (cdr pair)) - (setcdr pair nil)) - (setq submenu (erlang-man-make-menu segment)) - (setq menu (cons (list (concat (car (car submenu)) - " -- " - (car (car (reverse submenu)))) - submenu) - menu))) - (nreverse menu)))) - - -(defun erlang-man-make-menu (filelist) - "Make a leaf menu based on FILELIST." - (let ((menu '()) - item) - (while filelist - (setq item (erlang-man-make-menu-item (car filelist))) - (if item - (setq menu (cons item menu))) - (setq filelist (cdr filelist))) - (nreverse menu))) - - -(defun erlang-man-make-menu-item (file) - "Create a menu item containing the name of the man page." - (and (string-match ".*/\\([^/]+\\)\\.[^.]$" file) - (let ((page (substring file (match-beginning 1) (match-end 1)))) - (list (capitalize page) - (list 'lambda '() - '(interactive) - (list 'funcall 'erlang-man-display-function - file)))))) - - -(defun erlang-man-get-files (dir) - "Return files in directory DIR." - (directory-files dir t ".*\\.[0-9]\\'")) - - -(defun erlang-man-module (&optional module) - "Find manual page for MODULE, defaults to module of function under point. -This function is aware of imported functions." - (interactive - (list (let* ((mod (car-safe (erlang-get-function-under-point))) - (input (read-string - (format "Manual entry for module%s: " - (if (or (null mod) (string= mod "")) - "" - (format " (default %s)" mod)))))) - (if (string= input "") - mod - input)))) - (or module (setq module (car (erlang-get-function-under-point)))) - (if (or (null module) (string= module "")) - (error "No Erlang module name given")) - (let ((dir-list erlang-man-dirs) - (pat (concat "\\b" (regexp-quote module) "\\.[^.]$")) - (file nil) - file-list) - (while (and dir-list (null file)) - (setq file-list (erlang-man-get-files - (if (nth 2 (car dir-list)) - (concat erlang-root-dir (nth 1 (car dir-list))) - (nth 1 (car dir-list))))) - (while (and file-list (null file)) - (if (string-match pat (car file-list)) - (setq file (car file-list))) - (setq file-list (cdr file-list))) - (setq dir-list (cdr dir-list))) - (if file - (funcall erlang-man-display-function file) - (error "No manual page for module %s found." module)))) - - -;; Warning, the function `erlang-man-function' is a hack! -;; It links itself into the man code in a non-clean way. I have -;; choosed to keep it since it provides a very useful functionality -;; which is not possible to achive using a clean approach. -;; / AndersL - -(defvar erlang-man-function-name nil - "Name of function for last `erlang-man-function' call. -Used for commnication between `erlang-man-function' and the -patch to `Man-notify-when-ready'.") - -(defun erlang-man-function (&optional name) - "Find manual page for NAME, where NAME is module:function. -The entry for `function' is displayed. - -This function is aware of imported functions." - (interactive - (list (let* ((mod-func (erlang-get-function-under-point)) - (mod (car-safe mod-func)) - (func (nth 1 mod-func)) - (input (read-string - (format - "Manual entry for `module:func' or `module'%s: " - (if (or (null mod) (string= mod "")) - "" - (format " (default %s:%s)" mod func)))))) - (if (string= input "") - (if (and mod func) - (concat mod ":" func) - mod) - input)))) - ;; Emacs 18 doesn't provide `man'... - (condition-case nil - (require 'man) - (error nil)) - (let ((modname nil) - (funcname nil)) - (cond ((null name) - (let ((mod-func (erlang-get-function-under-point))) - (setq modname (car-safe mod-func)) - (setq funcname (nth 1 mod-func)))) - ((string-match ":" name) - (setq modname (substring name 0 (match-beginning 0))) - (setq funcname (substring name (match-end 0) nil))) - ((stringp name) - (setq modname name))) - (if (or (null modname) (string= modname "")) - (error "No Erlang module name given")) - (cond ((fboundp 'Man-notify-when-ready) - ;; Emacs 19: The man command could possibly start an - ;; asyncronous process, i.e. we must hook ourselves into - ;; the system to be activated when the man-process - ;; terminates. - (if (null funcname) - () - (erlang-man-patch-notify) - (setq erlang-man-function-name funcname)) - (condition-case nil - (erlang-man-module modname) - (error (setq erlang-man-function-name nil)))) - (t - (erlang-man-module modname) - (if funcname - (erlang-man-find-function - (or (get-buffer "*Manual Entry*") ; Emacs 18 - (current-buffer)) ; XEmacs - funcname)))))) - - -;; Should the defadvice be at the top level, the package `advice' would -;; be required. Now it is only required when this functionality -;; is used. (Emacs 19 specific.) -(defun erlang-man-patch-notify () - "Patch the function `Man-notify-when-ready' to search for function. -The variable `erlang-man-function-name' is assumed to be bound to -the function name, or to nil. - -The reason for patching a function is that under Emacs 19, the man -command is executed asynchronously." - (condition-case nil - (require 'advice) - ;; This should never happend since this is only called when - ;; running under Emacs 19. - (error (error (concat "This commands needs the package `advice', " - "please upgrade your Emacs.")))) - (require 'man) - (defadvice Man-notify-when-ready - (after erlang-Man-notify-when-ready activate) - "Sets point at the documentation of the function name in -erlang-man-function-name when the man-page is displayed." - (if erlang-man-function-name - (erlang-man-find-function (ad-get-arg 0) erlang-man-function-name)) - (setq erlang-man-function-name nil))) - - -(defun erlang-man-find-function (buf func) - "Find manual page for function in `erlang-man-function-name' in buffer BUF." - (if func - (let ((win (get-buffer-window buf))) - (if win - (progn - (set-buffer buf) - (goto-char (point-min)) - (if (re-search-forward - (concat "^[ \t]+" func " ?(") - (point-max) t) - (progn - (forward-word -1) - (set-window-point win (point))) - (message "Could not find function `%s'" func))))))) - - -(defun erlang-man-display (file) - "Display FILE as a `man' file. -This is de default manual page display function. -The variables `erlang-man-display-function' contains the function -to be used." - ;; Emacs 18 doesn't `provide' man. - (condition-case nil - (require 'man) - (error nil)) - (if file - (let ((process-environment (copy-sequence process-environment))) - (if (string-match "\\(.*\\)/man[^/]*/\\([^/]+\\)\\.[^.]$" file) - (let ((dir (substring file (match-beginning 1) (match-end 1))) - (page (substring file (match-beginning 2) (match-end 2)))) - (if (fboundp 'setenv) - (setenv "MANPATH" dir) - ;; Emacs 18 - (setq process-environment (cons (concat "MANPATH=" dir) - process-environment))) - (cond ((not (and (not erlang-xemacs-p) - (= erlang-emacs-major-version 19) - (< erlang-emacs-minor-version 29))) - (manual-entry page)) - (t - ;; Emacs 19.28 and earlier versions of 19: - ;; The manual-entry command unconditionally prompts - ;; the user :-( - (funcall (symbol-function 'Man-getpage-in-background) - page)))) - (error "Can't find man page for %s\n" file))))) - - -(defun erlang-man-describe-error () - "Describe why the manual pages weren't found." - (interactive) - (with-output-to-temp-buffer "*Erlang Man Error*" - (princ "Normally, this menu should contain Erlang manual pages. - -In order to find the manual pages, the variable `erlang-root-dir' -should be bound to the name of the directory containing the Erlang -installation. The name should not include the final slash. - -Practically, you should add a line on the following form to -your ~/.emacs, or ask your system administrator to add it to -the site init file: - (setq erlang-root-dir \"/the/erlang/root/dir/goes/here\") - -For example: - (setq erlang-root-dir \"/usr/local/erlang\") - -After installing the line, kill and restart Emacs, or restart Erlang -mode with the command `M-x erlang-mode RET'."))) - -;; Skeleton code: - -;; This code is based on the package `tempo' which is part of modern -;; Emacsen. (GNU Emacs 19.25 (?) and XEmacs 19.14.) - -(defun erlang-skel-init () - "Generate the skeleton functions and menu items. -The variable `erlang-skel' contains the name and descriptions of -all skeletons. - -The skeleton routines are based on the `tempo' package. Should this -package not be present, this function does nothing." - (interactive) - (condition-case nil - (require 'tempo) - (error t)) - (if (featurep 'tempo) - (let ((skel erlang-skel) - (menu '())) - (while skel - (cond ((null (car skel)) - (setq menu (cons nil menu))) - (t - (funcall (symbol-function 'tempo-define-template) - (concat "erlang-" (nth 1 (car skel))) - ;; The tempo template used contains an `include' - ;; function call only, hence changes to the - ;; variables describing the templates take effect - ;; immdiately. - (list (list 'erlang-skel-include (nth 2 (car skel)))) - (nth 1 (car skel))) - (setq menu (cons (erlang-skel-make-menu-item - (car skel)) menu)))) - (setq skel (cdr skel))) - (setq erlang-menu-skel-items - (list nil (list "Skeletons" (nreverse menu)))) - (setq erlang-menu-items - (erlang-menu-add-above 'erlang-menu-skel-items - 'erlang-menu-version-items - erlang-menu-items)) - (erlang-menu-init)))) - -(defun erlang-skel-make-menu-item (skel) - (let ((func (intern (concat "tempo-template-erlang-" (nth 1 skel))))) - (cond ((null (nth 3 skel)) - (list (car skel) func)) - (t - (list (car skel) - (list 'lambda '() - '(interactive) - (list 'funcall - (list 'quote (nth 3 skel)) - (list 'quote func)))))))) - -;; Functions designed to be added to the skeleton menu. -;; (Not normally used) -(defun erlang-skel-insert (func) - "Insert skeleton generated by FUNC and goto first tempo mark." - (save-excursion (funcall func)) - (funcall (symbol-function 'tempo-forward-mark))) - -(defun erlang-skel-header (func) - "Insert the header generated by FUNC at the beginning of the buffer." - (goto-char (point-min)) - (save-excursion (funcall func)) - (funcall (symbol-function 'tempo-forward-mark))) - - -;; Functions used inside the skeleton descriptions. -(defun erlang-skel-skip-blank () - (skip-chars-backward " \t") - nil) - -(defun erlang-skel-include (&rest args) - "Include a template inside another template. - -Example of use, assuming that `erlang-skel-func' is defined: - - (defvar foo-skeleton '(\"%%% New function:\" - (erlang-skel-include erlang-skel-func))) - -Techically, this function returns the `tempo' attribute`(l ...)' which -can contain other `tempo' attributes. Please see the function -`tempo-define-template' for a description of the `(l ...)' attribute." - (let ((res '()) - entry) - (while args - (setq entry (car args)) - (while entry - (setq res (cons (car entry) res)) - (setq entry (cdr entry))) - (setq args (cdr args))) - (cons 'l (nreverse res)))) - -(defun erlang-skel-separator (&optional percent) - "Return a comment separator." - (let ((percent (or percent 3))) - (concat (make-string percent ?%) - (make-string (- 70 percent) ?-) - "\n"))) - -(defun erlang-skel-double-separator (&optional percent) - "Return a comment separator." - (let ((percent (or percent 3))) - (concat (make-string percent ?%) - (make-string (- 70 percent) ?=) - "\n"))) - -(defun erlang-skel-dd-mmm-yyyy () - "Return the current date as a string in \"DD Mon YYYY\" form. -The first character of DD is space if the value is less than 10." - (let ((date (current-time-string))) - (format "%2d %s %s" - (string-to-int (substring date 8 10)) - (substring date 4 7) - (substring date -4)))) - -;; Indentation code: - -(defun erlang-indent-command (&optional whole-exp) - "Indent current line as Erlang code. -With argument, indent any additional lines of the same clause -rigidly along with this one." - (interactive "P") - (if whole-exp - ;; If arg, always indent this line as Erlang - ;; and shift remaining lines of clause the same amount. - (let ((shift-amt (erlang-indent-line)) - beg end) - (save-excursion - (if erlang-tab-always-indent - (beginning-of-line)) - (setq beg (point)) - (erlang-end-of-clause 1) - (setq end (point)) - (goto-char beg) - (forward-line 1) - (setq beg (point))) - (if (> end beg) - (indent-code-rigidly beg end shift-amt "\n"))) - (if (and (not erlang-tab-always-indent) - (save-excursion - (skip-chars-backward " \t") - (not (bolp)))) - (insert-tab) - (erlang-indent-line)))) - - -(defun erlang-indent-line () - "Indent current line as Erlang code. -Return the amount the indentation changed by." - (let ((pos (- (point-max) (point))) - indent beg - shift-amt) - (beginning-of-line 1) - (setq beg (point)) - (skip-chars-forward " \t") - (cond ((looking-at "%") - (setq indent (funcall comment-indent-function)) - (setq shift-amt (- indent (current-column)))) - (t - (setq indent (erlang-calculate-indent)) - (cond ((null indent) - (setq indent (current-indentation))) - ((eq indent t) - ;; This should never occur here. - (error "Erlang mode error")) - ((= (char-syntax (following-char)) ?\)) - (setq indent (1- indent)))) - (setq shift-amt (- indent (current-column))))) - (if (zerop shift-amt) - nil - (delete-region beg (point)) - (indent-to indent)) - ;; If initial point was within line's indentation, position - ;; after the indentation. Else stay at same point in text. - (if (> (- (point-max) pos) (point)) - (goto-char (- (point-max) pos))) - shift-amt)) - - -(defun erlang-indent-region (beg end) - "Indent region of erlang code. - -This is automagically called by the user level function `indent-region'." - (interactive "r") - (save-excursion - (let ((case-fold-search nil) - (continue t) - (from-end (- (point-max) end)) - indent-point;; The beginning of the current line - indent;; The indent amount - state) - (goto-char beg) - (beginning-of-line) - (setq indent-point (point)) - (erlang-beginning-of-clause) - ;; Parse the Erlang code from the beginning of the clause to - ;; the beginning of the region. - (while (< (point) indent-point) - (setq state (erlang-partial-parse (point) indent-point state))) - ;; Indent every line in the region - (while continue - (goto-char indent-point) - (skip-chars-forward " \t") - (cond ((looking-at "%") - ;; Do not use our stack to help the user to customize - ;; comment indentation. - (setq indent (funcall comment-indent-function))) - ((looking-at "$") - ;; Don't indent empty lines. - (setq indent 0)) - (t - (setq indent - (save-excursion - (erlang-calculate-stack-indent (point) state))) - (cond ((null indent) - (setq indent (current-indentation))) - ((eq indent t) - ;; This should never occur here. - (error "Erlang mode error")) - ((= (char-syntax (following-char)) ?\)) - (setq indent (1- indent)))))) - (if (zerop (- indent (current-column))) - nil - (delete-region indent-point (point)) - (indent-to indent)) - ;; Find the next line in the region - (goto-char indent-point) - (save-excursion - (forward-line 1) - (setq indent-point (point))) - (if (>= from-end (- (point-max) indent-point)) - (setq continue nil) - (while (< (point) indent-point) - (setq state (erlang-partial-parse - (point) indent-point state)))))))) - - -(defun erlang-indent-current-buffer () - "Indent current buffer as Erlang code." - (interactive) - (save-excursion - (save-restriction - (widen) - (erlang-indent-region (point-min) (point-max))))) - - -(defun erlang-indent-function () - "Indent current Erlang function." - (interactive) - (save-excursion - (let ((end (progn (erlang-end-of-function 1) (point))) - (beg (progn (erlang-beginning-of-function 1) (point)))) - (erlang-indent-region beg end)))) - - -(defun erlang-indent-clause () - "Indent current Erlang clause." - (interactive) - (save-excursion - (let ((end (progn (erlang-end-of-clause 1) (point))) - (beg (progn (erlang-beginning-of-clause 1) (point)))) - (erlang-indent-region beg end)))) - - -(defmacro erlang-push (x stack) (list 'setq stack (list 'cons x stack))) -(defmacro erlang-pop (stack) (list 'setq stack (list 'cdr stack))) -;; Would much prefer to make caddr a macro but this clashes. -(defun erlang-caddr (x) (car (cdr (cdr x)))) - - -(defun erlang-calculate-indent (&optional parse-start) - "Compute appropriate indentation for current line as Erlang code. -Return nil if line starts inside string, t if in a comment." - (save-excursion - (let ((indent-point (point)) - (case-fold-search nil) - (state nil)) - (if parse-start - (goto-char parse-start) - (erlang-beginning-of-clause)) - (while (< (point) indent-point) - (setq state (erlang-partial-parse (point) indent-point state))) - (erlang-calculate-stack-indent indent-point state)))) - -(defun erlang-show-syntactic-information () - "Show syntactic information for current line." - - (interactive) - - (save-excursion - (let ((starting-point (point)) - (case-fold-search nil) - (state nil)) - (erlang-beginning-of-clause) - (while (< (point) starting-point) - (setq state (erlang-partial-parse (point) starting-point state))) - (message "%S" state)))) - - -(defun erlang-partial-parse (from to &optional state) - "Parse Erlang syntax starting at FROM until TO, with an optional STATE. -Value is list (stack token-start token-type in-what)." - (goto-char from) ; Start at the beginning - (erlang-skip-blank to) - (let ((cs (char-syntax (following-char))) - (stack (car state)) - (token (point)) - in-what) - (cond - - ;; Done: Return previous state. - ((>= token to) - (setq token (nth 1 state)) - (setq cs (nth 2 state)) - (setq in-what (nth 3 state))) - - ;; Word constituent: check and handle keywords. - ((= cs ?w) - (if (looking-at "\\(end\\|after\\)[^_a-zA-Z0-9]") - ;; Must pop top icr layer, `after' will push a new - ;; layer next. - (progn - (while (and stack (eq (car (car stack)) '->)) - (erlang-pop stack)) - (if (and stack (memq (car (car stack)) '(icr begin))) - (erlang-pop stack)))) - (cond ((looking-at - "\\(if\\|case\\|receive\\|after\\)[^_a-zA-Z0-9]") - ;; Must push a new icr (if/case/receive) layer. - (erlang-push (list 'icr token (current-column)) stack)) - ((looking-at "\\(fun\\)[^_a-zA-Z0-9]") - ;; Puch a new icr layer if we are defining a `fun' - ;; expression, not when we are refering an existing - ;; function. - (if (save-excursion - (goto-char (match-end 1)) - (erlang-skip-blank to) - (eq (following-char) ?\()) - (erlang-push (list 'icr token (current-column)) stack))) - ((looking-at "\\(begin\\|query\\)[^_a-zA-Z0-9]") - (erlang-push (list 'begin token (current-column)) stack)) - ((looking-at "when[^_a-zA-Z0-9][^->\.]*->") - (erlang-push (list 'when token (current-column)) stack))) - (forward-sexp 1)) - - ;; String: Try to skip over it. (Catch error if not complete.) - ((= cs ?\") - (condition-case nil - (progn - (forward-sexp 1) - (if (> (point) to) - (progn - (setq in-what 'string) - (goto-char to)))) - (error - (setq in-what 'string) - (goto-char to)))) - - ;; Symbol constituent, punctuation, or expression prefix? - ((memq cs '(?. ?_ ?')) - (cond - - ;; Clause end - ((= (following-char) ?\;) - (if (and stack (eq (car (car stack)) '->)) - (erlang-pop stack)) - (forward-char 1)) - - ;; Function end - ((looking-at "\\.\\(\\s \\|\n\\|\\s<\\)") - (setq stack nil) - (forward-char 1)) - - ;; Function head - ((looking-at "->\\|:-") - (if (and stack (eq (car (car stack)) 'when)) - (erlang-pop stack)) - (erlang-push (list '-> token (current-column)) stack) - (forward-char 2)) - - ;; List-comprehension divider - ((looking-at "||") - (erlang-push (list '|| token (current-column)) stack) - (forward-char 2)) - - ;; Parameter separator - ((looking-at ",") - (forward-char 1)) - - ;; Bit-syntax open paren - ((looking-at "<<") - (erlang-push (list '\( token (current-column)) stack) - (forward-char 2)) - - ;; Bbit-syntax close paren - ((looking-at ">>") - (while (memq (car (car stack)) '(|| ->)) - (erlang-pop stack)) - (cond ((eq (car (car stack)) '\() - (erlang-pop stack)) - ((memq (car (car stack)) '(icr begin)) - (error "Missing `end'")) - (t - (error "Unbalanced parentheses"))) - (forward-char 2)) - - ;; Macro - ((= (following-char) ??) - ;; Skip over macro name and any following whitespace. - (forward-word 1) - (skip-syntax-forward "-" to) - ;; Macro might have an argument list. Should be handled like - ;; an ordinary function argument list in consecutive calls - ;; to erlang-partial-parse. - ) - - ;; Other punctuation: Skip over it and any following punctuation - ((= cs ?.) - ;; Skip over all characters in the operand. - (skip-syntax-forward ".")) - - ;; Other char: Skip over it. - (t - (forward-char 1)))) - - ;; Open parenthesis - ((= cs ?\() - (erlang-push (list '\( token (current-column)) stack) - (forward-char 1)) - - ;; Close parenthesis - ((= cs ?\)) - (while (memq (car (car stack)) '(|| ->)) - (erlang-pop stack)) - (cond ((eq (car (car stack)) '\() - (erlang-pop stack)) - ((memq (car (car stack)) '(icr begin)) - (error "Missing `end'")) - (t - (error "Unbalanced parenthesis"))) - (forward-char 1)) - - ;; Character quote: Skip it and the quoted char. - ((= cs ?/) - (forward-char 2)) - - ;; Character escape: Skip it and the escape sequence. - ((= cs ?\\) - (forward-char 1) - (skip-syntax-forward "w")) - - ;; Everything else - (t - (forward-char 1))) - (list stack token cs in-what))) - -(defun erlang-calculate-stack-indent (indent-point state) - "From the given last position and state (stack) calculate indentation. -Return nil if inside string, t if in a comment." - (let* ((stack (and state (car state))) - (token (nth 1 state)) - (stack-top (and stack (car stack)))) - (cond ((null state) ;No state - 0) - ((nth 3 state) - ;; Return nil or t. - (eq (nth 3 state) 'comment)) - ((null stack) - (if (looking-at "when[^_a-zA-Z0-9]") - erlang-indent-guard - 0)) - ((eq (car stack-top) '\() - ;; Element of list, tuple or part of an expression, - (if (null erlang-argument-indent) - ;; indent to next column. - (1+ (nth 2 stack-top)) - (goto-char (nth 1 stack-top)) - (cond ((looking-at "[({]\\s *\\($\\|%\\)") - ;; Line ends with parenthesis. - (+ (erlang-indent-find-preceding-expr) - erlang-argument-indent)) - (t - ;; Indent to the same column as the first - ;; argument. - (goto-char (1+ (nth 1 stack-top))) - (skip-chars-forward " \t") - (current-column))))) - ((eq (car stack-top) 'icr) - ;; The default indentation is the column of the option - ;; directly following the keyword. (This does not apply to - ;; `case'.) Should no option be on the same line, the - ;; indentation is the indentation of the keyword + - ;; `erlang-indent-level'. - ;; - ;; `after' should be indentated to the save level as the - ;; corresponding receive. - (if (looking-at "after[^_a-zA-Z0-9]") - (nth 2 stack-top) - (save-excursion - (goto-char (nth 1 stack-top)) - (if (looking-at "case[^_a-zA-Z0-9]") - (+ (nth 2 stack-top) erlang-indent-level) - (skip-chars-forward "a-z") - (skip-chars-forward " \t") - (if (memq (following-char) '(?% ?\n)) - (+ (nth 2 stack-top) erlang-indent-level) - (current-column)))))) - ;; Real indentation, where operators create extra indentation etc. - ((memq (car stack-top) '(-> || begin)) - (goto-char (nth 1 stack-top)) - ;; Check if there is more code after the '->' on the - ;; same line. If so use this indentation as base, else - ;; use parent indentation + 2 * level as base. - (let ((off erlang-indent-level) - (skip 2)) - (cond ((null (cdr stack))) ; Top level in function. - ((eq (car stack-top) 'begin) - (setq skip 5)) - ((eq (car stack-top) '->) - (setq off (* 2 erlang-indent-level)))) - (let ((base (erlang-indent-find-base stack indent-point off skip))) - ;; Look at last thing to see how we are to move relative - ;; to the base. - (goto-char token) - (cond ((looking-at "||\\|,\\|->\\|:-") - base) - ((erlang-at-keyword) - (+ (current-column) erlang-indent-level)) - ((or (= (char-syntax (following-char)) ?.) - (erlang-at-operator)) - (+ base erlang-indent-level)) - (t - (goto-char indent-point) - (cond ((memq (following-char) '(?\( ?{)) - ;; Function application or record. - (+ (erlang-indent-find-preceding-expr) - erlang-argument-indent)) - ;; Empty line, or end; treat it as the end of - ;; the block. (Here we have a choice: should - ;; the user be forced to reindent continued - ;; lines, or should the "end" be reindented?) - ((looking-at "\\(end\\|after\\)[^_a-zA-Z0-9]\\|$") - (if (eq (car (car stack)) '->) - (erlang-pop stack)) - (if stack - (erlang-caddr (car stack)) - 0)) - ;; Avoid trating comments a continued line. - ((= (following-char) ?%) - base) - ;; Continued line (e.g. line beginning - ;; with an operator.) - (t (+ base erlang-indent-level)))))))) - ((eq (car stack-top) 'when) - (goto-char (nth 1 stack-top)) - (if (looking-at "when\\s *\\($\\|%\\)") - (progn - (erlang-pop stack) - (if (and stack (eq (nth 0 (car stack)) 'icr)) - (progn - (goto-char (nth 1 (car stack))) - (+ (nth 2 (car stack)) erlang-indent-guard - ;; receive XYZ or receive - ;; XYZ - (if (looking-at "[a-z]+\\s *\\($\\|%\\)") - erlang-indent-level - (* 2 erlang-indent-level)))) - erlang-indent-guard)) - ;; "when" is followed by code, let's indent to the same - ;; column. - (forward-char 4) ; Skip "when" - (skip-chars-forward " \t") - (current-column)))))) - - -(defun erlang-indent-find-base (stack indent-point &optional offset skip) - "Find the base column for current stack." - (or skip (setq skip 2)) - (or offset (setq offset erlang-indent-level)) - (save-excursion - (let* ((stack-top (car stack))) - (goto-char (nth 1 stack-top)) - (forward-char skip) - (if (looking-at "\\s *\\($\\|%\\)") - (progn - (if (memq (car stack-top) '(-> ||)) - (erlang-pop stack)) - ;; Take parent identation + offset, - ;; else just erlang-indent-level if no parent - (if stack - (+ (erlang-caddr (car stack)) - offset) - erlang-indent-level)) - (erlang-skip-blank indent-point) - (current-column))))) - - -;; Does not handle `begin' .. `end'. -(defun erlang-indent-find-preceding-expr () - "Return the first column of the preceding expression. -This assumes that the preceding expression is either simple -\(i.e. an atom) or parenthesized." - (save-excursion - (forward-sexp -1) - (let ((col (current-column))) - (skip-chars-backward " \t") - ;; Needed to match the colon in "'foo':'bar'". - (if (not (memq (preceding-char) '(?# ?:))) - col - (backward-char 1) - (forward-sexp -1) - (current-column))))) - - -(defun erlang-skip-blank (&optional lim) - "Skip over whitespace and comments until limit reached." - (or lim (setq lim (point-max))) - (let (stop) - (while (and (not stop) (< (point) lim)) - (cond ((= (following-char) ?%) - (skip-chars-forward "^\n" lim)) - ((= (following-char) ?\n) - (skip-chars-forward "\n" lim)) - ((looking-at "\\s ") - (if (re-search-forward "\\S " lim 'move) - (forward-char -1))) - (t - (setq stop t)))) - stop)) - -(defun erlang-at-keyword () - "Are we looking at an Erlang keyword which will increase indentation?" - (looking-at (concat "\\(when\\|if\\|fun\\|case\\|begin\\|query\\|" - "of\\|receive\\|after\\|catch\\)[^_a-zA-Z0-9]"))) - -(defun erlang-at-operator () - "Are we looking at an Erlang operator?" - (looking-at - "\\(bnot\\|div\\|mod\\|band\\|bor\\|bxor\\|bsl\\|bsr\\)[^_a-zA-Z0-9]")) - -(defun erlang-comment-indent () - "Compute erlang comment indentation. - -Used both by `indent-for-comment' and the erlang specific indentation -commands." - (cond ((looking-at "%%%") 0) - ((looking-at "%%") - (or (erlang-calculate-indent) - (current-indentation))) - (t - (save-excursion - (skip-chars-backward " \t") - (max (if (bolp) 0 (1+ (current-column))) - comment-column))))) - -;;; Erlang movement commands - -;; All commands below work as movement commands. I.e. if the point is -;; at the end of the clause, and the command `erlang-end-of-clause' is -;; executed, the point is moved to the end of the NEXT clause. (This -;; mimics the behaviour of `end-of-defun'.) -;; -;; Personally I would like to rewrite them to be "pure", and add a set -;; of movement functions, like `erlang-next-clause', -;; `erlang-previous-clause', and the same for functions. -;; -;; The current implementation makes it hopeless to use the functions as -;; subroutines in more complex commands. /andersl - -(defun erlang-beginning-of-clause (&optional arg) - "Move backward to previous start of clause. -With argument, do this that many times. -Return t unless search stops due to end of buffer." - (interactive "p") - (or arg (setq arg 1)) - (if (< arg 0) - ;; Step back to the end of the previous line, unless we are at - ;; the beginning of the buffer. The reason for this move is - ;; that the regexp below includes the last character of the - ;; previous line. - (if (bobp) - (or (looking-at "\n") - (forward-char 1)) - (forward-char -1) - (if (looking-at "\\`\n") - (forward-char 1)))) - ;; The regexp matches a function header that isn't - ;; included in a string. - (and (re-search-forward "\\(\\`\\|\\`\n\\|[^\\]\n\\)\\([a-z]\\|'\\|-\\)" - nil 'move (- arg)) - (let ((beg (match-beginning 2))) - (and beg (goto-char beg)) - t))) - -(defun erlang-end-of-clause (&optional arg) - "Move to the end of the current clause. -With argument, do this that many times." - (interactive "p") - (or arg (setq arg 1)) - (while (and (looking-at "[ \t]*[%\n]") - (zerop (forward-line 1)))) - ;; Move to the next clause. - (erlang-beginning-of-clause (- arg)) - (beginning-of-line);; Just to be sure... - (let ((continue t)) - (while (and (not (bobp)) continue) - (forward-line -1) - (skip-chars-forward " \t") - (if (looking-at "[%\n]") - nil - (end-of-line) - (setq continue nil))))) - -(defun erlang-mark-clause () - "Put mark at end of clause, point at beginning." - (interactive) - (push-mark (point)) - (erlang-end-of-clause 1) - ;; Sets the region. In Emacs 19 and XEmacs, we wants to activate - ;; the region. - (condition-case nil - (push-mark (point) nil t) - (error (push-mark (point)))) - (erlang-beginning-of-clause 1) - ;; The above function deactivates the mark. - (if (boundp 'deactivate-mark) - (funcall (symbol-function 'set) 'deactivate-mark nil))) - -(defun erlang-beginning-of-function (&optional arg) - "Move backward to previous start of function. -With positive argument, do this that many times. -With negative argument, search forward. - -Return t unless search stops due to end of buffer." - (interactive "p") - (or arg (setq arg 1)) - (cond - ;; Search backward - ((> arg 0) - (while (and (> arg 0) - (and (erlang-beginning-of-clause 1) - (let ((start (point)) - (name (erlang-name-of-function)) - (arity (erlang-get-function-arity))) - ;; Note: "arity" is nil for e.g. "-import", hence - ;; two "-import" clauses are not considered to - ;; be part of the same function. - (while (and (erlang-beginning-of-clause 1) - (string-equal name - (erlang-name-of-function)) - arity - (equal arity - (erlang-get-function-arity))) - (setq start (point))) - (goto-char start) - t))) - (setq arg (1- arg)))) - ;; Search forward - ((< arg 0) - (end-of-line) - (erlang-beginning-of-clause 1) - ;; Step -arg functions forward. - (while (and (< arg 0) - ;; Step one function forward, or stop if the end of - ;; the buffer was reached. Return t if we found the - ;; function. - (let ((name (erlang-name-of-function)) - (arity (erlang-get-function-arity)) - (found (erlang-beginning-of-clause -1))) - (while (and found - (string-equal name (erlang-name-of-function)) - arity - (equal arity - (erlang-get-function-arity))) - (setq found (erlang-beginning-of-clause -1))) - found)) - (setq arg (1+ arg))))) - (zerop arg)) - - -(defun erlang-end-of-function (&optional arg) - "Move forward to next end of function. - -With argument, do this that many times. -With negative argument go towards the beginning of the buffer." - (interactive "p") - (or arg (setq arg 1)) - (let ((first t)) - ;; Forward - (while (and (> arg 0) (< (point) (point-max))) - (let ((pos (point))) - (while (progn - (if (and first - (progn - (forward-char 1) - (erlang-beginning-of-clause 1))) - nil - (or (bobp) (forward-char -1)) - (erlang-beginning-of-clause -1)) - (setq first nil) - (erlang-pass-over-function) - (skip-chars-forward " \t") - (if (looking-at "[%\n]") - (forward-line 1)) - (<= (point) pos)))) - (setq arg (1- arg))) - ;; Backward - (while (< arg 0) - (let ((pos (point))) - (erlang-beginning-of-clause 1) - (erlang-pass-over-function) - (forward-line 1) - (if (>= (point) pos) - (if (erlang-beginning-of-function 2) - (progn - (erlang-pass-over-function) - (skip-chars-forward " \t") - (if (looking-at "[%\n]") - (forward-line 1))) - (goto-char (point-min))))) - (setq arg (1+ arg))))) - -(defun erlang-mark-function () - "Put mark at end of function, point at beginning." - (interactive) - (push-mark (point)) - (erlang-end-of-function 1) - ;; Sets the region. In Emacs 19 and XEmacs, we wants to activate - ;; the region. - (condition-case nil - (push-mark (point) nil t) - (error (push-mark (point)))) - (erlang-beginning-of-function 1) - ;; The above function deactivates the mark. - (if (boundp 'deactivate-mark) - (funcall (symbol-function 'set) 'deactivate-mark nil))) - -(defun erlang-pass-over-function () - (while (progn - (erlang-skip-blank) - (and (not (looking-at "\\.\\(\\s \\|\n\\|\\s<\\)")) - (not (eobp)))) - (forward-sexp 1)) - (if (not (eobp)) - (forward-char 1))) - -(defun erlang-name-of-function () - (save-excursion - ;; Skip over attribute leader. - (if (looking-at "-[ \t]*") - (re-search-forward "-[ \t]*" nil 'move)) - (let ((start (point))) - (forward-sexp 1) - (buffer-substring start (point))))) - - -;;; Miscellaneous - -(defun erlang-fill-paragraph (&optional justify) - "Like \\[fill-paragraph], but handle Erlang comments. -If any of the current line is a comment, fill the comment or the -paragraph of it that point is in, preserving the comment's indentation -and initial `%':s." - (interactive "P") - (let ((has-comment nil) - ;; If has-comment, the appropriate fill-prefix for the comment. - comment-fill-prefix) - ;; Figure out what kind of comment we are looking at. - (save-excursion - (beginning-of-line) - (cond - ;; Find the command prefix. - ((looking-at (concat "\\s *" comment-start-skip)) - (setq has-comment t) - (setq comment-fill-prefix (buffer-substring (match-beginning 0) - (match-end 0)))) - ;; A line with some code, followed by a comment? Remember that the - ;; % which starts the comment shouldn't be part of a string or - ;; character. - ((progn - (while (not (looking-at "%\\|$")) - (skip-chars-forward "^%\n\"\\\\") - (cond - ((eq (char-after (point)) ?\\) (forward-char 2)) - ((eq (char-after (point)) ?\") (forward-sexp 1)))) - (looking-at comment-start-skip)) - (setq has-comment t) - (setq comment-fill-prefix - (concat (make-string (current-column) ? ) - (buffer-substring (match-beginning 0) (match-end 0))))))) - (if (not has-comment) - (fill-paragraph justify) - ;; Narrow to include only the comment, and then fill the region. - (save-restriction - (narrow-to-region - ;; Find the first line we should include in the region to fill. - (save-excursion - (while (and (zerop (forward-line -1)) - (looking-at "^\\s *%"))) - ;; We may have gone to far. Go forward again. - (or (looking-at "^\\s *%") - (forward-line 1)) - (point)) - ;; Find the beginning of the first line past the region to fill. - (save-excursion - (while (progn (forward-line 1) - (looking-at "^\\s *%"))) - (point))) - ;; Lines with only % on them can be paragraph boundaries. - (let ((paragraph-start (concat paragraph-start "\\|^[ \t%]*$")) - (paragraph-separate (concat paragraph-start "\\|^[ \t%]*$")) - (fill-prefix comment-fill-prefix)) - (fill-paragraph justify)))))) - - -(defun erlang-uncomment-region (beg end) - "Uncomment all commented lines in the region." - (interactive "r") - (comment-region beg end -1)) - - -(defun erlang-generate-new-clause () - "Create additional Erlang clause header. - -Parses the source file for the name of the current Erlang function. -Create the header containing the name, A pair of parentheses, -and an arrow. The space between the function name and the -first parenthesis is preserved. The point is placed between -the parentheses." - (interactive) - (let ((name (save-excursion - (and (erlang-beginning-of-clause) - (erlang-get-function-name t)))) - (arrow (save-excursion - (and (erlang-beginning-of-clause) - (erlang-get-function-arrow))))) - (if (or (null arrow) (null name)) - (error "Can't find name of current Erlang function.")) - (if (and (bolp) (eolp)) - nil - (end-of-line) - (newline)) - (insert name) - (save-excursion - (insert (concat ") " arrow))) - (if erlang-new-clause-with-arguments - (erlang-clone-arguments)))) - - -(defun erlang-clone-arguments () - "Insert, at the point, the argument list of the previous clause. - -The mark is set at the beginning of the inserted text, the point -at the end." - (interactive) - (let ((args (save-excursion - (beginning-of-line) - (and (erlang-beginning-of-clause) - (erlang-get-function-arguments)))) - (p (point))) - (if (null args) - (error "Can't clone argument list.")) - (insert args) - (set-mark p))) - -;;; Information retreival functions. - -(defun erlang-buffer-substring (beg end) - "Like `buffer-substring-no-properties'. -Although, this function works on all versions of Emacs." - (if (fboundp 'buffer-substring-no-properties) - (funcall (symbol-function 'buffer-substring-no-properties) beg end) - (buffer-substring beg end))) - - -(defun erlang-get-module () - "Return the name of the module as specified by `-module'. - -Return nil if file contains no `-module' attribute." - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (let ((md (match-data))) - (unwind-protect - (if (re-search-forward - (concat "^-module\\s *(\\s *\\(\\(" - erlang-atom-regexp - "\\)?\\)\\s *)\\s *\\.") - (point-max) t) - (erlang-remove-quotes - (erlang-buffer-substring (match-beginning 1) - (match-end 1))) - nil) - (store-match-data md)))))) - - -(defun erlang-get-module-from-file-name (&optional file) - "Extract the module name from a file name. - -First, the directory part is removed. Second, the part of the file name -matching `erlang-file-name-extension-regexp' is removed. - -Should the match fail, nil is returned. - -By modifying `erlang-file-name-extension-regexp' to match files other -than Erlang source files, Erlang specific functions could be applied on -non-Erlang files. Most notably; the support for Erlang modules in the -tags system could be used by files written in other languages." - (or file (setq file buffer-file-name)) - (if (null file) - nil - (setq file (file-name-nondirectory file)) - (if (string-match erlang-file-name-extension-regexp file) - (substring file 0 (match-beginning 0)) - nil))) - - -;; Used by `erlang-get-export' and `erlang-get-import'. - -(defun erlang-get-function-arity-list () - "Parses list of `function/arity' as used by `-import' and `-export'. - -The point must be placed at before the opening bracket. When the -function returns the point will be placed after the closing bracket. - -The function does not return an error if the list is incorrectly -formatted. - -Return list of (function . arity). The order of the returned list -corresponds to the order of the parsed Erlang list." - (let ((res '())) - (erlang-skip-blank) - (forward-char 1) - (if (not (eq (preceding-char) ?\[)) - '() ; Not looking at an Erlang list. - (while ; Note: `while' has no body. - (progn - (erlang-skip-blank) - (and (looking-at (concat erlang-atom-regexp - "/\\([0-9]+\\)\\>")) - (progn - (setq res (cons - (cons - (erlang-remove-quotes - (erlang-buffer-substring - (match-beginning 1) (match-end 1))) - (string-to-int - (erlang-buffer-substring - (match-beginning - (+ 1 erlang-atom-regexp-matches)) - (match-end - (+ 1 erlang-atom-regexp-matches))))) - res)) - (goto-char (match-end 0)) - (erlang-skip-blank) - (forward-char 1) - ;; Test if there are more exported functions. - (eq (preceding-char) ?,)))))) - (nreverse res))) - - -;;; Note that `-export' and the open parenthesis must be written on -;;; the same line. - -(defun erlang-get-export () - "Return a list of `(function . arity)' as specified by `-export'." - (save-excursion - (goto-char (point-min)) - (let ((md (match-data)) - (res '())) - (unwind-protect - (progn - (while (re-search-forward "^-export\\s *(" (point-max) t) - (erlang-skip-blank) - (setq res (nconc res (erlang-get-function-arity-list)))) - res) - (store-match-data md))))) - - -(defun erlang-get-import () - "Parse an Erlang source file for imported functions. - -Return an alist with module name as car part and list of conses containing -function and arity as cdr part." - (save-excursion - (goto-char (point-min)) - (let ((md (match-data)) - (res '())) - (unwind-protect - (progn - (while (re-search-forward "^-import\\s *(" (point-max) t) - (erlang-skip-blank) - (if (looking-at erlang-atom-regexp) - (let ((module (erlang-remove-quotes - (erlang-buffer-substring - (match-beginning 0) - (match-end 0))))) - (goto-char (match-end 0)) - (erlang-skip-blank) - (if (eq (following-char) ?,) - (progn - (forward-char 1) - (erlang-skip-blank) - (let ((funcs (erlang-get-function-arity-list)) - (pair (assoc module res))) - (if pair - (setcdr pair (nconc (cdr pair) funcs)) - (setq res (cons (cons module funcs) - res))))))))) - (nreverse res)) - (store-match-data md))))) - - -(defun erlang-get-function-name (&optional arg) - "Return name of current function, or nil. - -If optional argument is non-nil, everything up to and including -the first `(' is returned. - -Normally used in conjuction with `erlang-beginning-of-clause', e.g.: - (save-excursion - (if (not (eobp)) (forward-char 1)) - (and (erlang-beginning-of-clause) - (erlang-get-function-name t)))" - (let ((n (if arg 0 1))) - (and (looking-at (concat "^" erlang-atom-regexp "\\s *(")) - (erlang-buffer-substring (match-beginning n) (match-end n))))) - - -(defun erlang-get-function-arrow () - "Return arrow of current function, could be \"->\", \":-\" or nil. - -The \":-\" arrow is used by mnesia queries. - -Normally used in conjuction with `erlang-beginning-of-clause', e.g.: - (save-excursion - (if (not (eobp)) (forward-char 1)) - (and (erlang-beginning-of-clause) - (erlang-get-function-arrow)))" - (and - (save-excursion - (re-search-forward "[^-:]*-\\|:" (point-max) t) - (erlang-buffer-substring (- (point) 1) (+ (point) 1))))) - -(defun erlang-get-function-arity () - "Return the number of arguments of function at point, or nil." - (and (looking-at (concat "^" erlang-atom-regexp "\\s *(")) - (save-excursion - (goto-char (match-end 0)) - (condition-case nil - (let ((res 0) - (cont t)) - (while cont - (cond ((eobp) - (setq res nil) - (setq cont nil)) - ((looking-at "\\s *)") - (setq cont nil)) - ((looking-at "\\s *\\($\\|%\\)") - (forward-line 1)) - ((looking-at "\\s *,") - (setq res (+ 1 res)) - (goto-char (match-end 0))) - (t - (when (zerop res) - (setq res (+ 1 res))) - (forward-sexp 1)))) - res) - (error nil))))) - -(defun erlang-get-function-arguments () - "Return arguments of current function, or nil." - (if (not (looking-at (concat "^" erlang-atom-regexp "\\s *("))) - nil - (save-excursion - (condition-case nil - (let ((start (match-end 0))) - (goto-char (- start 1)) - (forward-sexp) - (erlang-buffer-substring start (- (point) 1))) - (error nil))))) - - -(defun erlang-get-function-under-point () - "Return the module and function under the point, or nil. - -Should no explicit module name be present at the point, the -list of imported functions is searched. - -The following could be retured: - (\"module\" \"function\") -- Both module and function name found. - (nil \"function\") -- No module name was found. - nil -- No function name found - -In the future the list may contain more elements." - (save-excursion - (let ((md (match-data)) - (res nil)) - (if (eq (char-syntax (following-char)) ? ) - (skip-chars-backward " \t")) - (skip-chars-backward "a-zA-Z0-9_:'") - (cond ((looking-at (concat erlang-atom-regexp ":" erlang-atom-regexp)) - (setq res (list - (erlang-remove-quotes - (erlang-buffer-substring - (match-beginning 1) (match-end 1))) - (erlang-remove-quotes - (erlang-buffer-substring - (match-beginning (1+ erlang-atom-regexp-matches)) - (match-end (1+ erlang-atom-regexp-matches))))))) - ((looking-at erlang-atom-regexp) - (let ((fk (erlang-remove-quotes - (erlang-buffer-substring - (match-beginning 0) (match-end 0)))) - (mod nil) - (imports (erlang-get-import))) - (while (and imports (null mod)) - (if (assoc fk (cdr (car imports))) - (setq mod (car (car imports))) - (setq imports (cdr imports)))) - (setq res (list mod fk))))) - (store-match-data md) - res))) - - -;; TODO: Escape single quotes inside the string. -(defun erlang-add-quotes-if-needed (str) - "Return STR, possibly with quotes." - (if (and (stringp str) - (not (string-match (concat "\\`" erlang-atom-regexp "\\'") str))) - (concat "'" str "'") - str)) - - -(defun erlang-remove-quotes (str) - "Return STR without quotes, if present." - (let ((md (match-data))) - (prog1 - (if (string-match "\\`'\\(.*\\)'\\'" str) - (substring str (match-beginning 1) (match-end 1)) - str) - (store-match-data md)))) - - -;;; Check module name - -;; I don't want to use `advice' since it is not part of Emacs 18. -;; -;; The function `write-file', bound to C-x C-w, calls -;; `set-visited-file-name' which clears the hook. :-( -;; To make sure that the hook always is present, we add a piece of -;; code to the function `set-visited-file-name'. -(defun erlang-check-module-name-init () - "Initialize the functionality to compare file and module names. - -We redefines the function `set-visited-file-name' since it clears -the variable `local-write-file-hooks'. The original function definition -is stored in `erlang-orig-set-visited-file-name'." - (if (fboundp 'erlang-orig-set-visited-file-name) - () - (fset 'erlang-orig-set-visited-file-name - (symbol-function 'set-visited-file-name)) - (defun set-visited-file-name (&rest args) - "Please see the function `erlang-orig-set-visited-file-name'." - (interactive "FSet visited file name: ") - (apply (symbol-function 'erlang-orig-set-visited-file-name) args) - (if (eq major-mode 'erlang-mode) - (add-hook 'local-write-file-hooks 'erlang-check-module-name)))) - (add-hook 'local-write-file-hooks 'erlang-check-module-name)) - - -(defun erlang-check-module-name () - "If the module name doesn't match file name, ask for permission to change. - -The variable `erlang-check-module-name' controls the behaviour of this -function. It it is nil, this function does nothing. If it is t, the -source is silently changed. If it is set to the atom `ask', the user -is prompted. - -This function is normally placed in the hook `local-write-file-hook'." - (if erlang-check-module-name - (let ((mn (erlang-get-module)) - (fn (erlang-get-module-from-file-name (buffer-file-name)))) - (if (and (stringp mn) (stringp fn)) - (or (string-equal mn fn) - (if (or (eq erlang-check-module-name t) - (y-or-n-p - "Module does not match file name. Modify source? ")) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (if (re-search-forward - (concat "^-module\\s *(\\s *\\(\\(" - erlang-atom-regexp - "\\)?\\)\\s *)\\s *\\.") - (point-max) t) - (progn - (goto-char (match-beginning 1)) - (delete-region (match-beginning 1) - (match-end 1)) - (insert fn)))))))))) - ;; Must return nil since it is added to `local-write-file-hook'. - nil) - - -;;; Electric functions. - -(defun erlang-electric-semicolon (&optional arg) - "Insert a semicolon character and possibly a prototype for the next line. - -The variable `erlang-electric-semicolon-criteria' states a critera, -when fulfilled a newline is inserted, the next line is indented and a -prototype for the next line is inserted. Normally the prototype -consists of \" ->\". Should the semicolon end the clause a new clause -header is generated. - -The variable `erlang-electric-semicolon-insert-blank-lines' controls -the number of blank lines inserted between the current line and new -function header. - -Behaves just like the normal semicolon when supplied with a -numerical arg, point is inside string or comment, or when there are -non-whitespace characters following the point on the current line." - (interactive "P") - (self-insert-command (prefix-numeric-value arg)) - (if (or arg - (and (listp erlang-electric-commands) - (not (memq 'erlang-electric-semicolon - erlang-electric-commands))) - (erlang-in-literal) - (not (looking-at "\\s *\\(%.*\\)?$")) - (null (erlang-test-criteria-list - erlang-electric-semicolon-criteria))) - (setq erlang-electric-newline-inhibit nil) - (setq erlang-electric-newline-inhibit t) - (undo-boundary) - (end-of-line) - (newline) - (if (condition-case nil - (progn (erlang-indent-line) t) - (error (if (bolp) (delete-backward-char 1)))) - (if (not (bolp)) - (save-excursion - (insert " ->")) - (condition-case nil - (progn - (erlang-generate-new-clause) - (if erlang-electric-semicolon-insert-blank-lines - (save-excursion - (beginning-of-line) - (newline - erlang-electric-semicolon-insert-blank-lines)))) - (error (if (bolp) (delete-backward-char 1)))))))) - - -(defun erlang-electric-comma (&optional arg) - "Insert a comma character and possibly a new indented line. -The variable `erlang-electric-comma-criteria' states a critera, -when fulfilled a newline is inserted and the next line is indeted. - -Behaves just like the normal comma when supplied with a -numerical arg, point is inside string or comment, or when there are -non-whitespace characters following the point on the current line." - (interactive "P") - - (self-insert-command (prefix-numeric-value arg)) - - (if (or arg - (and (listp erlang-electric-commands) - (not (memq 'erlang-electric-comma erlang-electric-commands))) - (erlang-in-literal) - (not (looking-at "\\s *\\(%.*\\)?$")) - (null (erlang-test-criteria-list - erlang-electric-comma-criteria))) - (setq erlang-electric-newline-inhibit nil) - (setq erlang-electric-newline-inhibit t) - (undo-boundary) - (end-of-line) - (newline) - (condition-case nil - (erlang-indent-line) - (error (if (bolp) (delete-backward-char 1)))))) - -(defun erlang-electric-lt (&optional arg) - "Insert a less-than sign, and optionally mark it as an open paren." - - (interactive "p") - - (self-insert-command arg) - - ;; Was this the second char in bit-syntax open (`<<')? - (unless (< (point) 2) - (save-excursion - (backward-char 2) - (when (and (eq (char-after (point)) ?<) - (not (eq (get-text-property (point) 'category) - 'bitsyntax-open-inner))) - ;; Then mark the two chars... - (put-text-property (point) (1+ (point)) - 'category 'bitsyntax-open-outer) - (forward-char 1) - (put-text-property (point) (1+ (point)) - 'category 'bitsyntax-open-inner) - ;;...and unmark any subsequent less-than chars. - (forward-char 1) - (while (eq (char-after (point)) ?<) - (remove-text-properties (point) (1+ (point)) - '(category nil)) - (forward-char 1)))))) - -(defun erlang-after-bitsyntax-close () - "Returns true if point is placed immediately after a bit-syntax close parenthesis (`>>')." - (and (>= (point) 2) - (save-excursion - (backward-char 2) - (and (eq (char-after (point)) ?>) - (not (eq (get-text-property (point) 'category) - 'bitsyntax-close-outer)))))) - -(defun erlang-after-arrow () - "Returns true if point is placed immediately after a function arrow (`->')." - (and (>= (point) 2) - (and - (save-excursion - (backward-char) - (eq (char-before (point)) ?-)) - (or (not (listp erlang-electric-commands)) - (memq 'erlang-electric-gt - erlang-electric-commands)) - (not (erlang-in-literal)) - (looking-at "\\s *\\(%.*\\)?$") - (erlang-test-criteria-list erlang-electric-arrow-criteria)))) - - -(defun erlang-electric-gt (&optional arg) - "Insert a greater-than sign, and optionally mark it as a close paren." - - (interactive "p") - - (self-insert-command arg) - - (cond - ;; Did we just write a bit-syntax close (`>>')? - ((erlang-after-bitsyntax-close) - (save-excursion - ;; Then mark the two chars... - (backward-char 2) - (put-text-property (point) (1+ (point)) - 'category 'bitsyntax-close-inner) - (forward-char) - (put-text-property (point) (1+ (point)) - 'category 'bitsyntax-close-outer) - ;;...and unmark any subsequent greater-than chars. - (forward-char) - (while (eq (char-after (point)) ?>) - (remove-text-properties (point) (1+ (point)) - '(category nil)) - (forward-char)))) - - ;; Did we just write a function arrow (`->')? - ((erlang-after-arrow) - (let ((erlang-electric-newline-inhibit t)) - (undo-boundary) - (end-of-line) - (newline) - (condition-case nil - (erlang-indent-line) - (error (if (bolp) (delete-backward-char 1)))))) - - ;; Then it's just a plain greater-than. - (t - nil))) - - -(defun erlang-electric-arrow\ off (&optional arg) - "Insert a '>'-sign and possible a new indented line. - -This command is only `electric' when the `>' is part of an `->' arrow. -The variable `erlang-electric-arrow-criteria' states a sequence of -criteria, which decides when a newline should be inserted and the next -line indented. - -It behaves just like the normal greater than sign when supplied with a -numerical arg, point is inside string or comment, or when there are -non-whitespace characters following the point on the current line. - -After being split/merged into erlang-after-arrow and -erlang-electric-gt, it is now unused and disabled." - (interactive "P") - (let ((prec (preceding-char))) - (self-insert-command (prefix-numeric-value arg)) - (if (or arg - (and (listp erlang-electric-commands) - (not (memq 'erlang-electric-arrow - erlang-electric-commands))) - (not (eq prec ?-)) - (erlang-in-literal) - (not (looking-at "\\s *\\(%.*\\)?$")) - (null (erlang-test-criteria-list - erlang-electric-arrow-criteria))) - (setq erlang-electric-newline-inhibit nil) - (setq erlang-electric-newline-inhibit t) - (undo-boundary) - (end-of-line) - (newline) - (condition-case nil - (erlang-indent-line) - (error (if (bolp) (delete-backward-char 1))))))) - - -(defun erlang-electric-newline (&optional arg) - "Break line at point and indent, continuing comment if within one. -The variable `erlang-electric-newline-criteria' states a critera, -when fulfilled a newline is inserted and the next line is indeted. - -Should the current line begin with a comment, and the variable -`comment-multi-line' be non-nil, a new comment start is inserted. - -Should the previous command be another electric command we assume that -the user pressed newline out of old habit, hence we will do nothing." - (interactive "P") - (cond ((and (not arg) - erlang-electric-newline-inhibit - (memq last-command erlang-electric-newline-inhibit-list)) - ()) ; Do nothing! - ((or arg - (and (listp erlang-electric-commands) - (not (memq 'erlang-electric-newline - erlang-electric-commands))) - (null (erlang-test-criteria-list - erlang-electric-newline-criteria))) - (newline (prefix-numeric-value arg))) - (t - (if (and comment-multi-line - (save-excursion - (beginning-of-line) - (looking-at (concat "\\s *" comment-start-skip)))) - (let ((str (buffer-substring - (or (match-end 1) (match-beginning 0)) - (min (match-end 0) (point))))) - (newline) - (undo-boundary) - (insert str)) - (newline) - (undo-boundary) - (indent-according-to-mode))))) - - -(defun erlang-test-criteria-list (criteria) - "Given a list of criteria functions, test if criteria is fulfilled. - -Each element in the criteria list can a function returning nil, t or -the atom `stop'. t means that the criteria is fulfilled, `stop' means -that it the criteria isn't fulfilled and that the search should stop, -and nil means continue searching. - -Should the list contain the atom t the criteria is assumed to be -fulfilled, unless preceded by a function returning `stop', of course. - -Should the argument be the atom t instead of a list, the criteria is -assumed to be trivially true. - -Should all function return nil, the criteria is assumed not to be -fulfilled. - -Return t if criteria fulfilled, nil otherwise." - (if (eq criteria t) - t - (save-excursion - (let ((answer nil)) - (while (and criteria (null answer)) - (if (eq (car criteria) t) - (setq answer t) - (setq answer (funcall (car criteria)))) - (setq criteria (cdr criteria))) - (if (and answer (not (eq answer 'stop))) - t - nil))))) - - -(defun erlang-in-literal (&optional lim) - "Test if point is in string, quoted atom or comment. - -Return one of the three atoms `atom', `string', and `comment'. -Should the point be inside none of the above mentioned types of -context, nil is returned." - (save-excursion - (let* ((lim (or lim (save-excursion - (erlang-beginning-of-clause) - (point)))) - (state (parse-partial-sexp lim (point)))) - (cond - ((eq (nth 3 state) ?') 'atom) - ((nth 3 state) 'string) - ((nth 4 state) 'comment) - (t nil))))) - - -(defun erlang-at-end-of-function-p () - "Test if point is at end of an Erlang function. - -This function is designed to be a member of a criteria list." - (eq (save-excursion (erlang-skip-blank) (point)) - (save-excursion - (erlang-beginning-of-function -1) (point)))) - - -(defun erlang-stop-when-inside-argument-list () - "Return `stop' if inside parenthesis list, nil otherwise. - -Knows about the list comprehension syntax. When the point is -after `||', `stop' is not returned. - -This function is designed to be a member of a criteria list." - (save-excursion - (condition-case nil - (let ((orig-point (point)) - (state nil)) - (up-list -1) - (if (not (eq (following-char) ?\[)) - 'stop - ;; Do not return `stop' when inside a list comprehension - ;; construnction. (The point must be after `||'). - (while (< (point) orig-point) - (setq state (erlang-partial-parse (point) orig-point state))) - (if (and (car state) (eq (car (car (car state))) '||)) - nil - 'stop))) - (error - nil)))) - - -(defun erlang-stop-when-at-guard () - "Return `stop' when at function guards. - -This function is designed to be a member of a criteria list." - (save-excursion - (beginning-of-line) - (if (and (looking-at (concat "^" erlang-atom-regexp "\\s *(")) - (not (looking-at - (concat "^" erlang-atom-regexp ".*\\(->\\|:-\\)")))) - 'stop - nil))) - - -(defun erlang-next-lines-empty-p () - "Return non-nil if next lines are empty. - -The variable `erlang-next-lines-empty-threshold' contains the number -of lines required to be empty. - -A line containing only spaces and tabs is considered empty. - -This function is designed to be a member of a criteria list." - (and erlang-next-lines-empty-threshold - (save-excursion - (let ((left erlang-next-lines-empty-threshold) - (cont t)) - (while (and cont (> left 0)) - (forward-line 1) - (setq cont (looking-at "\\s *$")) - (setq left (- left 1))) - cont)))) - - -(defun erlang-at-keyword-end-p () - "Test if next readable token is the keyword end. - -This function is designed to be a member of a criteria list." - (save-excursion - (erlang-skip-blank) - (looking-at "end[^_a-zA-Z0-9]"))) - - -;; Erlang tags support which is aware of erlang modules. -;; -;; Not yet implemented under XEmacs. (Hint: The Emacs 19 etags -;; package work under XEmacs.) - -(eval-when-compile - (if (or (featurep 'bytecomp) - (featurep 'byte-compile)) - (progn - (require 'etags)))) - - -;; Variables: - -(defvar erlang-tags-function-alist - '((find-tag . erlang-find-tag) - (find-tag-other-window . erlang-find-tag-other-window) - (find-tag-regexp . erlang-find-tag-regexp) - (find-tag-other-frame . erlang-find-tag-other-frame)) - "Alist of old tags commands and the replacement functions.") - -(defvar erlang-tags-installed nil - "Non-nil when the Erlang tags system is installed.") -(defvar erlang-tags-file-list '() - "List of files in tag list. Used when finding tag on form `module:'.") -(defvar erlang-tags-completion-table nil - "Like `tags-completion-table', this table contains `tag' and `module:tag'.") -(defvar erlang-tags-buffer-installed-p nil - "Non-nil when erlang module recognising functions installed.") -(defvar erlang-tags-buffer-list '() - "Temporary list of buffers.") -(defvar erlang-tags-orig-completion-table nil - "Temporary storage for `tags-completion-table'.") -(defvar erlang-tags-orig-tag-order nil - "Temporary storage for `find-tag-tag-order'.") -(defvar erlang-tags-orig-regexp-tag-order nil - "Temporary storage for `find-tag-regexp-tag-order'.") -(defvar erlang-tags-orig-search-function nil - "Temporary storage for `find-tag-search-function'.") -(defvar erlang-tags-orig-regexp-search-function nil - "Temporary storage for `find-tag-regexp-search-function'.") -(defvar erlang-tags-orig-format-hooks nil - "Temporary storage for `tags-table-format-hooks'.") - -(defun erlang-tags-init () - "Install an alternate version of tags, aware of Erlang modules. - -After calling this function, the tags functions are aware of -Erlang modules. Tags can be entered on the for `module:tag' aswell -as on the old form `tag'. - -In the completion list, `module:tag' and `module:' shows up. - -Call this function from an appropriate init file, or add it to -Erlang mode hook with the commands: - (add-hook 'erlang-mode-hook 'erlang-tags-init) - (add-hook 'erlang-shell-mode-hook 'erlang-tags-init) - -This function only works under Emacs 18 and Emacs 19. Currently, It -is not implemented under XEmacs. (Hint: The Emacs 19 etags module -works under XEmacs.)" - (interactive) - (cond ((= erlang-emacs-major-version 18) - (require 'tags) - (erlang-tags-define-keys (current-local-map)) - (setq erlang-tags-installed t)) - (t - (require 'etags) - ;; Test on a function available in the Emacs 19 version - ;; of tags but not in the XEmacs version. - (if (not (fboundp 'find-tag-noselect)) - () - (erlang-tags-define-keys (current-local-map)) - (setq erlang-tags-installed t))))) - - -;; Set all keys bound to `find-tag' et.al. in the global map and the -;; menu to `erlang-find-tag' et.al. in `map'. -;; -;; The function `substitute-key-definition' does not work properly -;; in all version of Emacs. - -(defun erlang-tags-define-keys (map) - "Bind tags commands to keymap MAP aware of Erlang modules." - (let ((alist erlang-tags-function-alist)) - (while alist - (let* ((old (car (car alist))) - (new (cdr (car alist))) - (keys (append (where-is-internal old global-map)))) - (while keys - (define-key map (car keys) new) - (setq keys (cdr keys)))) - (setq alist (cdr alist)))) - ;; Update the menu. - (erlang-menu-substitute erlang-menu-base-items erlang-tags-function-alist) - (erlang-menu-init)) - - -;; There exists a variable `find-tag-default-function'. It is not used -;; since `complete-tag' uses it to get current word under point. In that -;; situation we doesn't want the module to be prepended. - -(defun erlang-find-tag-default () - "Return the default tag, searches `-import' list of imported functions. -Single quotes has been stripped away." - (let ((mod-func (erlang-get-function-under-point))) - (cond ((null mod-func) - nil) - ((null (car mod-func)) - (nth 1 mod-func)) - (t - (concat (car mod-func) ":" (nth 1 mod-func)))))) - - -;; Return `t' since it is used inside `tags-loop-form'. -;;;###autoload -(defun erlang-find-tag (modtagname &optional next-p regexp-p) - "Like `find-tag'. Capable of retreiving Erlang modules. - -Tags can be given on the forms `tag', `module:', `module:tag'." - (interactive (erlang-tag-interactive "Find `module:tag' or `tag': ")) - (switch-to-buffer (erlang-find-tag-noselect modtagname next-p regexp-p)) - t) - - -;; Code mainly from `find-tag-other-window' in `etags.el'. -;;;###autoload -(defun erlang-find-tag-other-window (tagname &optional next-p regexp-p) - "Like `find-tag-other-window' but aware of Erlang modules." - (interactive (erlang-tag-interactive - "Find `module:tag' or `tag' other window: ")) - - ;; This is to deal with the case where the tag is found in the - ;; selected window's buffer; without this, point is moved in both - ;; windows. To prevent this, we save the selected window's point - ;; before doing find-tag-noselect, and restore it afterwards. - (let* ((window-point (window-point (selected-window))) - (tagbuf (erlang-find-tag-noselect tagname next-p regexp-p)) - (tagpoint (progn (set-buffer tagbuf) (point)))) - (set-window-point (prog1 - (selected-window) - (switch-to-buffer-other-window tagbuf) - ;; We have to set this new window's point; it - ;; might already have been displaying a - ;; different portion of tagbuf, in which case - ;; switch-to-buffer-other-window doesn't set - ;; the window's point from the buffer. - (set-window-point (selected-window) tagpoint)) - window-point))) - - -(defun erlang-find-tag-other-frame (tagname &optional next-p) - "Like `find-tag-other-frame' but aware of Erlang modules." - (interactive (erlang-tag-interactive - "Find `module:tag' or `tag' other frame: ")) - (let ((pop-up-frames t)) - (erlang-find-tag-other-window tagname next-p))) - - -(defun erlang-find-tag-regexp (regexp &optional next-p other-window) - "Like `find-tag-regexp' but aware of Erlang modules." - (interactive (if (fboundp 'find-tag-regexp) - (erlang-tag-interactive - "Find `module:regexp' or `regexp': ") - (error "This version of Emacs can't find tags by regexps."))) - (funcall (if other-window - 'erlang-find-tag-other-window - 'erlang-find-tag) - regexp next-p t)) - - -;; Just like C-u M-. This could be added to the menu. -(defun erlang-find-next-tag () - (interactive) - (let ((current-prefix-arg '(4))) - (if erlang-tags-installed - (call-interactively 'erlang-find-tag) - (call-interactively 'find-tag)))) - - -;; Mimics `find-tag-noselect' found in `etags.el', but uses `find-tag' to -;; be compatible with `tags.el'. -;; -;; Handles three cases: -;; * `module:' Loop over all possible filen-ames. Stop if a file-name -;; without extension and directory matches the module. -;; -;; * `module:tag' -;; Emacs 19: Replace testfunctions with functions aware of -;; Erlang modules. Tricky because the etags system wasn't -;; built for these kind of operations... -;; -;; Emacs 18: We loop over `find-tag' until we find a file -;; whose module matches the requested module. The -;; drawback is that a lot of files could be loaded into -;; Emacs. -;; -;; * `tag' Just give it to `find-tag'. - -(defun erlang-find-tag-noselect (modtagname &optional next-p regexp-p) - "Like `find-tag-noselect' but aware of Erlang modules." - (interactive (erlang-tag-interactive "Find `module:tag' or `tag': ")) - (or modtagname - (setq modtagname (symbol-value 'last-tag))) - (funcall (symbol-function 'set) 'last-tag modtagname) - ;; `tags.el' uses this variable to record how M-, would - ;; know where to restart a tags command. - (if (boundp 'tags-loop-form) - (funcall (symbol-function 'set) - 'tags-loop-form '(erlang-find-tag nil t))) - (save-window-excursion - (cond - ((string-match ":$" modtagname) - ;; Only the module name was given. Read all files whose file name - ;; match. - (let ((modname (substring modtagname 0 (match-beginning 0))) - (file nil)) - (if (not next-p) - (save-excursion - (visit-tags-table-buffer) - (setq erlang-tags-file-list - (funcall (symbol-function 'tags-table-files))))) - (while (null file) - (or erlang-tags-file-list - (save-excursion - (if (and (featurep 'etags) - (funcall - (symbol-function 'visit-tags-table-buffer) 'same) - (funcall - (symbol-function 'visit-tags-table-buffer) t)) - (setq erlang-tags-file-list - (funcall (symbol-function 'tags-table-files))) - (error "No %stags containing %s" (if next-p "more " "") - modtagname)))) - (if erlang-tags-file-list - (let ((this-module (erlang-get-module-from-file-name - (car erlang-tags-file-list)))) - (if (and (stringp this-module) - (string= modname this-module)) - (setq file (car erlang-tags-file-list))) - (setq erlang-tags-file-list (cdr erlang-tags-file-list))))) - (set-buffer (or (get-file-buffer file) - (find-file-noselect file))))) - - ((string-match ":" modtagname) - (if (boundp 'find-tag-tag-order) - ;; Method one: Add module-recognising functions to the - ;; list of order functions. However, the tags system - ;; from Emacs 18, and derives thereof (read: XEmacs) - ;; hasn't got this feature. - (progn - (erlang-tags-install-module-check) - (unwind-protect - (funcall (symbol-function 'find-tag) - modtagname next-p regexp-p) - (erlang-tags-remove-module-check))) - ;; Method two: Call the tags system until a file matching - ;; the module is found. This could result in that many - ;; files are read. (e.g. The tag "foo:file" will take a - ;; while to process.) - (let* ((modname (substring modtagname 0 (match-beginning 0))) - (tagname (substring modtagname (match-end 0) nil)) - (last-tag tagname) - file) - (while - (progn - (funcall (symbol-function 'find-tag) tagname next-p regexp-p) - (setq next-p t) - ;; Determine the module form the file name. (The - ;; alternative, to check `-module', would make this - ;; code useless for non-Erlang programs.) - (setq file (erlang-get-module-from-file-name buffer-file-name)) - (not (and (stringp file) - (string= modname file)))))))) - (t - (funcall (symbol-function 'find-tag) modtagname next-p regexp-p))) - (current-buffer))) ; Return the new buffer. - - -;; Process interactive arguments for erlang-find-tag-*. -;; -;; Negative arguments work only for `etags', not `tags'. This is not -;; a problem since negative arguments means step back into the -;; history list, a feature not implemented in `tags'. - -(defun erlang-tag-interactive (prompt) - (condition-case nil - (require 'etags) - (error - (require 'tags))) - (if current-prefix-arg - (list nil (if (< (prefix-numeric-value current-prefix-arg) 0) - '- - t)) - (let* ((default (erlang-find-tag-default)) - (prompt (if default - (format "%s(default %s) " prompt default) - prompt)) - (spec (if (featurep 'etags) - (completing-read prompt 'erlang-tags-complete-tag) - (read-string prompt)))) - (list (if (equal spec "") - (or default (error "There is no default tag")) - spec))))) - - -;; Search tag functions which are aware of Erlang modules. The tactic -;; is to store new search functions into the local variabels of the -;; TAGS buffers. The variables are restored directly after the -;; search. The situation is complicated by the fact that new TAGS -;; files can be loaded during the search. -;; -;; This code is Emacs 19 `etags' specific. - -(defun erlang-tags-install-module-check () - "Install our own tag search functions." - ;; Make sure our functions are installed in TAGS files loaded - ;; into Emacs while searching. - (setq erlang-tags-orig-format-hooks - (symbol-value 'tags-table-format-hooks)) - (funcall (symbol-function 'set) 'tags-table-format-hooks - (cons 'erlang-tags-recognize-tags-table - erlang-tags-orig-format-hooks)) - (setq erlang-tags-buffer-list '()) - ;; Install our functions in the TAGS files already resident. - (save-excursion - (let ((files (symbol-value 'tags-table-computed-list))) - (while files - (if (stringp (car files)) - (if (get-file-buffer (car files)) - (progn - (set-buffer (get-file-buffer (car files))) - (erlang-tags-install-local)))) - (setq files (cdr files)))))) - - -(defun erlang-tags-install-local () - "Install our tag search functions in current buffer." - (if erlang-tags-buffer-installed-p - () - ;; Mark this buffer as "installed" and record. - (set (make-local-variable 'erlang-tags-buffer-installed-p) t) - (setq erlang-tags-buffer-list - (cons (current-buffer) erlang-tags-buffer-list)) - - ;; Save the original values. - (set (make-local-variable 'erlang-tags-orig-tag-order) - (symbol-value 'find-tag-tag-order)) - (set (make-local-variable 'erlang-tags-orig-regexp-tag-order) - (symbol-value 'find-tag-regexp-tag-order)) - (set (make-local-variable 'erlang-tags-orig-search-function) - (symbol-value 'find-tag-search-function)) - (set (make-local-variable 'erlang-tags-orig-regexp-search-function) - (symbol-value 'find-tag-regexp-search-function)) - - ;; Install our own functions. - (set (make-local-variable 'find-tag-search-function) - 'erlang-tags-search-forward) - (set (make-local-variable 'find-tag-regexp-search-function) - 'erlang-tags-regexp-search-forward) - (set (make-local-variable 'find-tag-tag-order) - '(erlang-tag-match-module-p)) - (set (make-local-variable 'find-tag-regexp-tag-order) - '(erlang-tag-match-module-regexp-p)))) - - -(defun erlang-tags-remove-module-check () - "Remove our own tags search functions." - (funcall (symbol-function 'set) - 'tags-table-format-hooks - erlang-tags-orig-format-hooks) - ;; Remove our functions from the TAGS files. (Note that - ;; `tags-table-computed-list' need not be the same list as when - ;; the search was started.) - (save-excursion - (let ((buffers erlang-tags-buffer-list)) - (while buffers - (if (buffer-name (car buffers)) - (progn - (set-buffer (car buffers)) - (erlang-tags-remove-local))) - (setq buffers (cdr buffers)))))) - - -(defun erlang-tags-remove-local () - "Remove our tag search functions from current buffer." - (if (null erlang-tags-buffer-installed-p) - () - (funcall (symbol-function 'set) 'erlang-tags-buffer-installed-p nil) - (funcall (symbol-function 'set) - 'find-tag-tag-order erlang-tags-orig-tag-order) - (funcall (symbol-function 'set) - 'find-tag-regexp-tag-order erlang-tags-orig-regexp-tag-order) - (funcall (symbol-function 'set) - 'find-tag-search-function erlang-tags-orig-search-function) - (funcall (symbol-function 'set) - 'find-tag-regexp-search-function - erlang-tags-orig-regexp-search-function))) - - -(defun erlang-tags-recognize-tags-table () - "Install our functions in all loaded TAGS files. - -This function is added to `tags-table-format-hooks' when searching -for a tag on the form `module:tag'." - (if (null (funcall (symbol-function 'etags-recognize-tags-table))) - nil - (erlang-tags-install-local) - t)) - - -(defun erlang-tags-search-forward (tag &optional bound noerror count) - "Forward search function, aware of Erlang module prefix." - (if (string-match ":" tag) - (setq tag (substring tag (match-end 0) nil))) - ;; Avoid uninteded recursion. - (if (eq erlang-tags-orig-search-function 'erlang-tags-search-forward) - (search-forward tag bound noerror count) - (funcall erlang-tags-orig-search-function tag bound noerror count))) - - -(defun erlang-tags-regexp-search-forward (tag &optional bound noerror count) - "Forward regexp search function, aware of Erlang module prefix." - (if (string-match ":" tag) - (setq tag (substring tag (match-end 0) nil))) - (if (eq erlang-tags-orig-regexp-search-function - 'erlang-tags-regexp-search-forward) - (re-search-forward tag bound noerror count) - (funcall erlang-tags-orig-regexp-search-function - tag bound noerror count))) - - -;; t if point is at a tag line that matches TAG, containing -;; module information. Assumes that all other order functions -;; are stored in `erlang-tags-orig-[regex]-tag-order'. - -(defun erlang-tag-match-module-p (tag) - (erlang-tag-match-module-common-p tag erlang-tags-orig-tag-order)) - -(defun erlang-tag-match-module-regexp-p (tag) - (erlang-tag-match-module-common-p tag erlang-tags-orig-regexp-tag-order)) - -(defun erlang-tag-match-module-common-p (tag order) - (let ((mod nil) - (found nil)) - (if (string-match ":" tag) - (progn - (setq mod (substring tag 0 (match-beginning 0))) - (setq tag (substring tag (match-end 0) nil)))) - (while (and order (not found)) - (setq found - (and (not (memq (car order) - '(erlang-tag-match-module-p - erlang-tag-match-module-regexp-p))) - (funcall (car order) tag))) - (setq order (cdr order))) - (and found - (or (null mod) - (string= mod (erlang-get-module-from-file-name - (file-of-tag))))))) - - -;;; Tags completion, Emacs 19 `etags' specific. -;;; -;;; The basic idea is to create a second completion table `erlang-tags- -;;; completion-table' containing all normal tags plus tags on the form -;;; `module:tag'. - - -(defun erlang-complete-tag () - "Perform tags completion on the text around point. -Completes to the set of names listed in the current tags table. - -Should the Erlang tags system be installed this command knows -about Erlang modules." - (interactive) - (condition-case nil - (require 'etags) - (error nil)) - (cond ((and erlang-tags-installed - (fboundp 'complete-tag)) ; Emacs 19 - (let ((orig-tags-complete-tag (symbol-function 'tags-complete-tag))) - (fset 'tags-complete-tag - (symbol-function 'erlang-tags-complete-tag)) - (unwind-protect - (funcall (symbol-function 'complete-tag)) - (fset 'tags-complete-tag orig-tags-complete-tag)))) - ((fboundp 'complete-tag) ; Emacs 19 - (funcall (symbol-function 'complete-tag))) - ((fboundp 'tag-complete-symbol) ; XEmacs - (funcall (symbol-function 'tag-complete-symbol))) - (t - (error "This version of Emacs can't complete tags.")))) - - -;; Based on `tags-complete-tag', but this one uses -;; `erlang-tag-completion-table' instead of `tag-completion-table'. -;; -;; This is the entry-point called by system function `completing-read'. -(defun erlang-tags-complete-tag (string predicate what) - (save-excursion - ;; If we need to ask for the tag table, allow that. - (let ((enable-recursive-minibuffers t)) - (visit-tags-table-buffer)) - (if (eq what t) - (all-completions string (erlang-tags-completion-table) predicate) - (try-completion string (erlang-tags-completion-table) predicate)))) - - -;; `tags-completion-table' calls itself recursively, make it -;; call our own wedge instead. Note that the recursive call -;; is very rare; it only occurs when a tags-file contains -;; `include'-statements. -(defun erlang-tags-completion-table () - "Build completion table. Tags on the form `tag' or `module:tag'." - (setq erlang-tags-orig-completion-table - (symbol-function 'tags-completion-table)) - (fset 'tags-completion-table - (symbol-function 'erlang-tags-completion-table-1)) - (unwind-protect - (erlang-tags-completion-table-1) - (fset 'tags-completion-table - erlang-tags-orig-completion-table))) - - -(defun erlang-tags-completion-table-1 () - (make-local-variable 'erlang-tags-completion-table) - (or erlang-tags-completion-table - (let ((tags-completion-table nil) - (tags-completion-table-function - 'erlang-etags-tags-completion-table)) - (funcall erlang-tags-orig-completion-table) - (setq erlang-tags-completion-table tags-completion-table)))) - - -;; Based on `etags-tags-completion-table'. The difference is that we -;; adds three symbols to the vector, the tag, module: and module:tag. -;; The module is extracted from the file name of a tag. (This one -;; only works if we are looking at an `etags' file. However, this is -;; the only format supported by Emacs, so far.) -(defun erlang-etags-tags-completion-table () - (let ((table (make-vector 511 0)) - (file nil)) - (save-excursion - (goto-char (point-min)) - ;; This monster regexp matches an etags tag line. - ;; \1 is the string to match; - ;; \2 is not interesting; - ;; \3 is the guessed tag name; XXX guess should be better eg DEFUN - ;; \4 is not interesting; - ;; \5 is the explicitly-specified tag name. - ;; \6 is the line to start searching at; - ;; \7 is the char to start searching at. - (while (progn - (while (and - (eq (following-char) ?\f) - (looking-at "\f\n\\([^,\n]*\\),.*\n")) - (setq file (buffer-substring - (match-beginning 1) (match-end 1))) - (goto-char (match-end 0))) - (re-search-forward - "\ -^\\(\\([^\177]+[^-a-zA-Z0-9_$\177]+\\)?\\([-a-zA-Z0-9_$?:]+\\)\ -\[^-a-zA-Z0-9_$?:\177]*\\)\177\\(\\([^\n\001]+\\)\001\\)?\ -\\([0-9]+\\)?,\\([0-9]+\\)?\n" - nil t)) - (let ((tag (if (match-beginning 5) - ;; There is an explicit tag name. - (buffer-substring (match-beginning 5) (match-end 5)) - ;; No explicit tag name. Best guess. - (buffer-substring (match-beginning 3) (match-end 3)))) - (module (and file - (erlang-get-module-from-file-name file)))) - (intern tag table) - (if (stringp module) - (progn - (intern (concat module ":" tag) table) - ;; Only the first one will be stored in the table. - (intern (concat module ":") table)))))) - table)) - -;;; -;;; Prepare for other methods to run an Erlang slave process. -;;; - -(defvar erlang-shell-function 'inferior-erlang - "Command to execute start a new Erlang shell. - -Change this variable to use your favorite -Erlang compilation package.") - -(defvar erlang-shell-display-function 'inferior-erlang-run-or-select - "Command to execute to display Erlang shell. - -Change this variable to use your favorite -Erlang compilation package.") - -(defvar erlang-compile-function 'inferior-erlang-compile - "Command to execute to compile current buffer. - -Change this variable to use your favorite -Erlang compilation package.") - -(defvar erlang-compile-display-function 'inferior-erlang-run-or-select - "Command to execute to view last compilation. - -Change this variable to use your favorite -Erlang compilation package.") - -(defvar erlang-next-error-function 'inferior-erlang-next-error - "Command to execute to go to the next error. - -Change this variable to use your favorite -Erlang compilation package.") - - -;;;###autoload -(defun erlang-shell () - "Start a new Erlang shell. - -The variable `erlang-shell-function' decides which method to use, -default is to start a new Erlang host. It is possible that, in the -future, a new shell on an already running host will be started." - (interactive) - (call-interactively erlang-shell-function)) - - -;;;###autoload (autoload 'run-erlang "erlang" "Start a new Erlang shell." t) - -;; It is customary for Emacs packages to supply a function on this -;; form, even though it violates the `erlang-*' name convention. -(fset 'run-erlang 'erlang-shell) - - -(defun erlang-shell-display () - "Display an Erlang shell, or start a new." - (interactive) - (call-interactively erlang-shell-display-function)) - - -;;;###autoload -(defun erlang-compile () - "Compile Erlang module in current buffer." - (interactive) - (call-interactively erlang-compile-function)) - - -(defun erlang-compile-display () - "Display compilation output." - (interactive) - (call-interactively erlang-compile-display-function)) - - -(defun erlang-next-error () - "Display next error message from the latest compilation." - (interactive) - (call-interactively erlang-next-error-function)) - - - -;;; -;;; Erlang Shell Mode -- Major mode used for Erlang shells. -;;; - -;; This mode is designed to be implementation independent, -;; e.g. it does not assume that we are running an inferior -;; Erlang, there exists a lot of other possibilities. - - -(defvar erlang-shell-buffer-name "*erlang*" - "*The name of the Erlang link shell buffer.") - - -(defvar erlang-shell-mode-map nil - "*Keymap used by Erlang shells.") - - -(defvar erlang-shell-mode-hook nil - "*User functions to run when an Erlang shell is started. - -This hook is used to change the behaviour of Erlang mode. It is -normally used by the user to personalise the programming environment. -When used in a site init file, it could be used to customise Erlang -mode for all users on the system. - -The functioned added to this hook is runed every time a new Erlang -shell is started. - -See also `erlang-load-hook', a hook which is runed once, when Erlang -mode is loaded, and `erlang-mode-hook' which is runed every time a new -Erlang source file is loaded into Emacs.") - - -(defvar erlang-input-ring-file-name "~/.erlang_history" - "*When non-nil, file name used to store erlang shell history information.") - - -(defun erlang-shell-mode () - "Major mode for interacting with an Erlang shell. - -We assume that we already are in comint-mode. - -The following special commands are available: -\\{erlang-shell-mode-map}" - (interactive) - (setq major-mode 'erlang-shell-mode) - (setq mode-name "Erlang Shell") - (erlang-mode-variables) - (if erlang-shell-mode-map - nil - (setq erlang-shell-mode-map (copy-keymap comint-mode-map)) - (erlang-shell-mode-commands erlang-shell-mode-map)) - (use-local-map erlang-shell-mode-map) - (set (make-local-variable 'compilation-parsing-end) 1) - (set (make-local-variable 'compilation-error-list) nil) - (set (make-local-variable 'compilation-old-error-list) nil) - ;; Needed when compiling directly from the Erlang shell. - (setq compilation-last-buffer (current-buffer)) - (erlang-add-compilation-alist erlang-error-regexp-alist) - (setq comint-prompt-regexp "^[^>=]*> *") - (setq comint-eol-on-send t) - (setq comint-input-ignoredups t) - (setq comint-scroll-show-maximum-output t) - (setq comint-scroll-to-bottom-on-output t) - ;; In Emacs 19.30, `add-hook' has got a `local' flag, use it. If - ;; the call fails, just call the normal `add-hook'. - (condition-case nil - (progn - (funcall (symbol-function 'add-hook) 'comint-output-filter-functions - 'inferior-erlang-strip-delete nil t) - (funcall (symbol-function 'add-hook) 'comint-output-filter-functions - 'inferior-erlang-strip-ctrl-m nil t)) - (error - (add-hook 'comint-output-filter-functions 'inferior-erlang-strip-delete) - (add-hook 'comint-output-filter-functions 'inferior-erlang-strip-ctrl-m))) - ;; Some older versions of comint doesn't have an input ring. - (if (fboundp 'comint-read-input-ring) - (progn - (setq comint-input-ring-file-name erlang-input-ring-file-name) - (comint-read-input-ring t) - (make-local-variable 'kill-buffer-hook) - (add-hook 'kill-buffer-hook 'comint-write-input-ring))) - (run-hooks 'erlang-shell-mode-hook)) - - -(defun erlang-shell-mode-commands (map) - (define-key map "\M-\t" 'erlang-complete-tag) - (define-key map "\C-a" 'comint-bol) ; Normally the other way around. - (define-key map "\C-c\C-a" 'beginning-of-line) - (define-key map "\C-d" nil) ; Was `comint-delchar-or-maybe-eof' - (define-key map "\C-x`" 'erlang-next-error)) - -;;; -;;; Inferior Erlang -- Run an Erlang shell as a subprocess. -;;; - -(defvar inferior-erlang-display-buffer-any-frame nil - "*When nil, `inferior-erlang-display-buffer' use only selected frame. -When t, all frames are searched. When 'raise, the frame is raised.") - -(defvar inferior-erlang-shell-type 'newshell - "The type of Erlang shell to use. - -When this variable is set to the atom `oldshell', the old shell is used. -When set to `newshell' the new shell is used. Should the variable be -nil, the default shell is used. - -This variable influence the setting of other variables.") - -(defvar inferior-erlang-machine "erl" - "*The name of the Erlang shell.") - -(defvar inferior-erlang-machine-options '() - "*The options used when activating the Erlang shell. - -This must be a list of strings.") - -(defvar inferior-erlang-process-name "inferior-erlang" - "*The name of the inferior Erlang process.") - -(defvar inferior-erlang-buffer-name erlang-shell-buffer-name - "*The name of the inferior erlang buffer.") - -(defvar inferior-erlang-prompt-timeout 60 - "*Number of seconds before `inferior-erlang-wait-prompt' timeouts. - -The time specified is waited after every output made by the inferior -Erlang shell. When this variable is t, we assume that we always have -a prompt. When nil, we will wait forever, or until C-g.") - -(defvar inferior-erlang-process nil - "Process of last invoked inferior Erlang, or nil.") - -(defvar inferior-erlang-buffer nil - "Buffer of last invoked inferior Erlang, or nil.") - -;;;###autoload -(defun inferior-erlang () - "Run an inferior Erlang. - -This is just like running Erlang in a normal shell, except that -an Emacs buffer is used for input and output. - -The command line history can be accessed with M-p and M-n. -The history is saved between sessions. - -Entry to this mode calls the functions in the variables -`comint-mode-hook' and `erlang-shell-mode-hook' with no arguments. - -The following commands imitate the usual Unix interrupt and -editing control characters: -\\{erlang-shell-mode-map}" - (interactive) - (require 'comint) - (let ((opts inferior-erlang-machine-options)) - (cond ((eq inferior-erlang-shell-type 'oldshell) - (setq opts (cons "-oldshell" opts))) - ((eq inferior-erlang-shell-type 'newshell) - (setq opts (append '("-newshell" "-env" "TERM" "vt100") opts)))) - (setq inferior-erlang-buffer - (apply 'make-comint - inferior-erlang-process-name inferior-erlang-machine - nil opts))) - (setq inferior-erlang-process - (get-buffer-process inferior-erlang-buffer)) - (process-kill-without-query inferior-erlang-process) - (switch-to-buffer inferior-erlang-buffer) - (if (and (not (eq system-type 'windows-nt)) - (eq inferior-erlang-shell-type 'newshell)) - (setq comint-process-echoes t)) - ;; `rename-buffer' takes only one argument in Emacs 18. - (condition-case nil - (rename-buffer inferior-erlang-buffer-name t) - (error (rename-buffer inferior-erlang-buffer-name))) - (erlang-shell-mode)) - - -(defun inferior-erlang-run-or-select () - "Switch to an inferior Erlang buffer, possibly starting new process." - (interactive) - (if (null (inferior-erlang-running-p)) - (inferior-erlang) - (inferior-erlang-display-buffer t))) - - -(defun inferior-erlang-display-buffer (&optional select) - "Make the inferior Erlang process visible. -The window is returned. - -Should `inferior-erlang-display-buffer-any-frame' be nil the buffer is -displayed in the current frame. Should it be non-nil, and the buffer -already is visible in any other frame, no new window will be created. -Should it be the atom 'raise, the frame containing the window will -be raised. - -Should the optional argument SELECT be non-nil, the window is -selected. Should the window be in another frame, that frame is raised. - -Note, should the mouse pointer be places outside the raised frame, that -frame will become deselected before the next command." - (interactive) - (or (inferior-erlang-running-p) - (error "No inferior Erlang process is running.")) - (let ((win (inferior-erlang-window - inferior-erlang-display-buffer-any-frame)) - (frames-p (fboundp 'selected-frame))) - (if (null win) - (let ((old-win (selected-window))) - (save-excursion - (switch-to-buffer-other-window inferior-erlang-buffer) - (setq win (selected-window))) - (select-window old-win)) - (if (and window-system - frames-p - (or select - (eq inferior-erlang-display-buffer-any-frame 'raise)) - (not (eq (selected-frame) (window-frame win)))) - (raise-frame (window-frame win)))) - (if select - (select-window win)) - (sit-for 0) - win)) - - -(defun inferior-erlang-running-p () - "Non-nil when an inferior Erlang is running." - (and inferior-erlang-process - (memq (process-status inferior-erlang-process) '(run open)) - inferior-erlang-buffer - (buffer-name inferior-erlang-buffer))) - - -(defun inferior-erlang-window (&optional all-frames) - "Return the window containing the inferior Erlang, or nil." - (and (inferior-erlang-running-p) - (if (and all-frames (>= erlang-emacs-major-version 19)) - (get-buffer-window inferior-erlang-buffer t) - (get-buffer-window inferior-erlang-buffer)))) - - -(defun inferior-erlang-wait-prompt () - "Wait until the inferior Erlang shell prompt appear." - (if (eq inferior-erlang-prompt-timeout t) - () - (or (inferior-erlang-running-p) - (error "No inferior Erlang shell is running.")) - (save-excursion - (set-buffer inferior-erlang-buffer) - (let ((msg nil)) - (while (save-excursion - (goto-char (process-mark inferior-erlang-process)) - (forward-line 0) - (not (looking-at comint-prompt-regexp))) - (if msg - () - (setq msg t) - (message "Waiting for Erlang shell prompt (press C-g to abort).")) - (or (accept-process-output inferior-erlang-process - inferior-erlang-prompt-timeout) - (error "No Erlang shell prompt before timeout."))) - (if msg (message "")))))) - - -(defun inferior-erlang-send-command (cmd &optional hist) - "Send command CMD to the inferior Erlang. - -The contents of the current command line (if any) will -be placed at the next prompt. - -If optional second argument is non-nil the command is inserted into -the history list. - -Return the position after the newly inserted command." - (or (inferior-erlang-running-p) - (error "No inferior Erlang process is running.")) - (let ((old-buffer (current-buffer)) - (insert-point (marker-position - (process-mark inferior-erlang-process))) - (insert-length (if comint-process-echoes - 0 - (1+ (length cmd))))) - (set-buffer inferior-erlang-buffer) - (goto-char insert-point) - (insert cmd) - ;; Strange things happend if `comint-eol-on-send' is declared - ;; in the `let' expression above, but setq:d here. The - ;; `set-buffer' statement obviously makes the buffer local - ;; instance of `comint-eol-on-send' shadow this one. - ;; I'm considering this a bug in Elisp. - (let ((comint-eol-on-send nil) - (comint-input-filter (if hist comint-input-filter 'ignore))) - (comint-send-input)) - ;; Adjust all windows whose points are incorrect. - (if (null comint-process-echoes) - (walk-windows - (function - (lambda (window) - (if (and (eq (window-buffer window) inferior-erlang-buffer) - (eq (window-point window) insert-point)) - (set-window-point window - (+ insert-point insert-length))))) - nil t)) - (set-buffer old-buffer) - (+ insert-point insert-length))) - - -(defun inferior-erlang-strip-delete (&optional s) - "Remove `^H' (delete) and the characters it was supposed to remove." - (interactive) - (if (and (boundp 'comint-last-input-end) - (boundp 'comint-last-output-start)) - (save-excursion - (goto-char - (if (interactive-p) - (symbol-value 'comint-last-input-end) - (symbol-value 'comint-last-output-start))) - (while (progn (skip-chars-forward "^\C-h") - (not (eq (point) (point-max)))) - (delete-char 1) - (or (bolp) - (backward-delete-char 1)))))) - - -;; Basically `comint-strip-ctrl-m', with a few extra checks. -(defun inferior-erlang-strip-ctrl-m (&optional string) - "Strip trailing `^M' characters from the current output group." - (interactive) - (if (and (boundp 'comint-last-input-end) - (boundp 'comint-last-output-start)) - (let ((pmark (process-mark (get-buffer-process (current-buffer))))) - (save-excursion - (goto-char - (if (interactive-p) - (symbol-value 'comint-last-input-end) - (symbol-value 'comint-last-output-start))) - (while (re-search-forward "\r+$" pmark t) - (replace-match "" t t)))))) - - -(defun inferior-erlang-compile () - "Compile the file in the current buffer. - -Should Erlang return `{error, nofile}' it could not load the object -module after completing the compilation. This is due to a bug in the -compile command `c' when using the option `outdir'. - -There exists two workarounds for this bug: - - 1) Place the directory in the Erlang load path. - - 2) Set the Emacs variable `erlang-compile-use-outdir' to nil. - To do so, place the following line in your `~/.emacs'-file: - (setq erlang-compile-use-outdir nil)" - (interactive) - (save-some-buffers) - (or (inferior-erlang-running-p) - (save-excursion - (inferior-erlang))) - (or (inferior-erlang-running-p) - (error "Error starting inferior Erlang shell.")) - (let ((dir (file-name-directory (buffer-file-name))) - ;;; (file (file-name-nondirectory (buffer-file-name))) - (noext (substring (buffer-file-name) 0 -4)) - ;; Hopefully, noone else will ever use these... - (tmpvar "Tmp7236") - (tmpvar2 "Tmp8742") - end) - (inferior-erlang-display-buffer) - (inferior-erlang-wait-prompt) - (setq end (inferior-erlang-send-command - (if erlang-compile-use-outdir - (format "c(\"%s\", [{outdir, \"%s\"}])." noext dir) - (format - (concat - "f(%s), {ok, %s} = file:get_cwd(), " - "file:set_cwd(\"%s\"), " - "%s = c(\"%s\"), file:set_cwd(%s), f(%s), %s.") - tmpvar2 tmpvar - dir - tmpvar2 noext tmpvar tmpvar tmpvar2)) - nil)) - (save-excursion - (set-buffer inferior-erlang-buffer) - (setq compilation-error-list nil) - (setq compilation-parsing-end end)) - (setq compilation-last-buffer inferior-erlang-buffer))) - - -;; `next-error' only accepts buffers with major mode `compilation-mode' -;; or with the minor mode `compilation-minor-mode' activated. -;; (To activate the minor mode is out of the question, since it will -;; ruin the inferior Erlang keymap.) -(defun inferior-erlang-next-error (&optional argp) - "Just like `next-error'. -Capable of finding error messages in an inferior Erlang buffer." - (interactive "P") - (let ((done nil) - (buf (and (boundp 'compilation-last-buffer) - compilation-last-buffer))) - (if (and (bufferp buf) - (save-excursion - (set-buffer buf) - (and (eq major-mode 'erlang-shell-mode) - (setq major-mode 'compilation-mode)))) - (unwind-protect - (progn - (setq done t) - (next-error argp)) - (save-excursion - (set-buffer buf) - (setq major-mode 'erlang-shell-mode)))) - (or done - (next-error argp)))) - - -(defun inferior-erlang-change-directory (&optional dir) - "Make the inferior erlang change directory. -The default is to go to the directory of the current buffer." - (interactive) - (or dir (setq dir (file-name-directory (buffer-file-name)))) - (or (inferior-erlang-running-p) - (error "No inferior Erlang is running.")) - (inferior-erlang-display-buffer) - (inferior-erlang-wait-prompt) - (inferior-erlang-send-command (format "cd('%s')." dir) nil)) - -;; Aliases for backward compatibility with older versions of Erlang Mode. -;; -;; Unfortuantely, older versions of Emacs doesn't have `defalias' and -;; `make-obsolete' so we have to define our own `obsolete' function. - -(defun erlang-obsolete (sym newdef) - "Make the obsolete function SYM refer to the defined function NEWDEF. - -Simplified version of a combination `defalias' and `make-obsolete', -it assumes that NEWDEF is loaded." - (fset sym (symbol-function newdef)) - (if (fboundp 'make-obsolete) - (make-obsolete sym newdef))) - - -(erlang-obsolete 'calculate-erlang-indent 'erlang-calculate-indent) -(erlang-obsolete 'calculate-erlang-stack-indent - 'erlang-calculate-stack-indent) -(erlang-obsolete 'at-erlang-keyword 'erlang-at-keyword) -(erlang-obsolete 'at-erlang-operator 'erlang-at-operator) -(erlang-obsolete 'beginning-of-erlang-clause 'erlang-beginning-of-clause) -(erlang-obsolete 'end-of-erlang-clause 'erlang-end-of-clause) -(erlang-obsolete 'mark-erlang-clause 'erlang-mark-clause) -(erlang-obsolete 'beginning-of-erlang-function 'erlang-beginning-of-function) -(erlang-obsolete 'end-of-erlang-function 'erlang-end-of-function) -(erlang-obsolete 'mark-erlang-function 'erlang-mark-function) -(erlang-obsolete 'pass-over-erlang-clause 'erlang-pass-over-function) -(erlang-obsolete 'name-of-erlang-function 'erlang-name-of-function) - - -;; The end... - -(provide 'erlang) - -(run-hooks 'erlang-load-hook) - -;;; erlang.el ends here diff --git a/emacs.d/elpa/erlang-2.4.1/erlang.elc b/emacs.d/elpa/erlang-2.4.1/erlang.elc deleted file mode 100644 index bfc4ae9354dfcbc4c73f70014fbbd9272a5e6f1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 143171 zcmeFai+5Yck>{`MoZXS&V{Pmto;)U*Ysg-b4ng5fQb`<95|wCT*^VVAlQCrxBta4* z5MTgMvSMd{|N8Iqt?IrHJSf_hb23@$h$L`tKdYp679gVN&o4vl)J?ZR^*AA|C`=_1j-I2Ph z)YqD8weV%F+qY(VgJfGplc%)NqtkkGt+7_Kch7p0AcN)i-C_I2h8#U^q$k zhl5Fn!e^7i$_7scm8}Q2@7+uGk2|Bz{)9oUTKAp7K{6gD`<+3u*G>AvPN9=9nQ_wX zjQYLqD485nu-@=~S&*;wPXqY6|4OCOwVRE0^6j=~ z3K;HhR>Im>Hrj1l{Po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&1!t|f{35A~2m&SBWOmMQlh(S(@i)nqNT6uY7(_tGJsdKS_A2gu)j2vHE zO*^=<8z}}Ggu)PTA+298|C#1E8PBDf$%=Tg(e`fr0Zl}4T*^{#ZUt+yQvBg?($9#Z zM;*Tbfe<&mLt}H9kdVna1m3vOUfGj)meig~XnbR;IGwQ(A+^FIH(L2N(a#e3Mr%Ew#Nw3*+Tf#o1< zD0oVC{EOy}_qy5|L#4s~nDYMo7xlGn>FGWb$lYx%YR-v8f6PWe;S86ZJ$MOiKW>Qg zlw2DZsktyA(^dcFKW34pQl6QTA!s8KaKHbO;*&2LfrP#!HeO8AT zudNS0kURXrHdfw^Hp&B9QSJYRQ<*O&!*zls2FuY?xgo=M-jwe{W;k`hQMcu1I0^g< z`rhW!l*jryrfw`-^@|f~2*#u4$UW%yHh)8$ka3d diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode-autoloads.el b/emacs.d/elpa/go-mode-20130809.1442/go-mode-autoloads.el deleted file mode 100644 index 0d859b9..0000000 --- a/emacs.d/elpa/go-mode-20130809.1442/go-mode-autoloads.el +++ /dev/null @@ -1,101 +0,0 @@ -;;; go-mode-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (go-download-play godoc gofmt-before-save go-mode) -;;;;;; "go-mode" "go-mode.el" (20999 39437 0 0)) -;;; Generated autoloads from go-mode.el - -(autoload 'go-mode "go-mode" "\ -Major mode for editing Go source text. - -This mode provides (not just) basic editing capabilities for -working with Go code. It offers almost complete syntax -highlighting, indentation that is almost identical to gofmt and -proper parsing of the buffer content to allow features such as -navigation by function, manipulation of comments or detection of -strings. - -In addition to these core features, it offers various features to -help with writing Go code. You can directly run buffer content -through gofmt, read godoc documentation from within Emacs, modify -and clean up the list of package imports or interact with the -Playground (uploading and downloading pastes). - -The following extra functions are defined: - -- `gofmt' -- `godoc' -- `go-import-add' -- `go-remove-unused-imports' -- `go-goto-imports' -- `go-play-buffer' and `go-play-region' -- `go-download-play' -- `godef-describe' and `godef-jump' -- `go-coverage' - -If you want to automatically run `gofmt' before saving a file, -add the following hook to your emacs configuration: - -\(add-hook 'before-save-hook 'gofmt-before-save) - -If you want to use `godef-jump' instead of etags (or similar), -consider binding godef-jump to `M-.', which is the default key -for `find-tag': - -\(add-hook 'go-mode-hook (lambda () - (local-set-key (kbd \"M-.\") 'godef-jump))) - -Please note that godef is an external dependency. You can install -it with - -go get code.google.com/p/rog-go/exp/cmd/godef - - -If you're looking for even more integration with Go, namely -on-the-fly syntax checking, auto-completion and snippets, it is -recommended that you look at goflymake -\(https://github.com/dougm/goflymake), gocode -\(https://github.com/nsf/gocode) and yasnippet-go -\(https://github.com/dominikh/yasnippet-go) - -\(fn)" t nil) - -(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode)) - -(autoload 'gofmt-before-save "go-mode" "\ -Add this to .emacs to run gofmt on the current buffer when saving: - (add-hook 'before-save-hook 'gofmt-before-save). - -Note that this will cause go-mode to get loaded the first time -you save any file, kind of defeating the point of autoloading. - -\(fn)" t nil) - -(autoload 'godoc "go-mode" "\ -Show go documentation for a query, much like M-x man. - -\(fn QUERY)" t nil) - -(autoload 'go-download-play "go-mode" "\ -Downloads a paste from the playground and inserts it in a Go -buffer. Tries to look for a URL at point. - -\(fn URL)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("go-mode-load.el" "go-mode-pkg.el") (20999 -;;;;;; 39437 769035 0)) - -;;;*** - -(provide 'go-mode-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; go-mode-autoloads.el ends here diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode-load.el b/emacs.d/elpa/go-mode-20130809.1442/go-mode-load.el deleted file mode 100644 index 3fc35c1..0000000 --- a/emacs.d/elpa/go-mode-20130809.1442/go-mode-load.el +++ /dev/null @@ -1,96 +0,0 @@ -;;; go-mode-load.el --- automatically extracted autoloads -;;; Commentary: - -;; To install go-mode, add the following lines to your .emacs file: -;; (add-to-list 'load-path "PATH CONTAINING go-mode-load.el" t) -;; (require 'go-mode-load) -;; -;; After this, go-mode will be used for files ending in '.go'. -;; -;; To compile go-mode from the command line, run the following -;; emacs -batch -f batch-byte-compile go-mode.el -;; -;; See go-mode.el for documentation. -;; -;; To update this file, evaluate the following form -;; (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads "go-mode.el")) - -;;; Code: - - -;;;### (autoloads (go-download-play godoc gofmt-before-save go-mode) -;;;;;; "go-mode" "go-mode.el" (20767 50749)) -;;; Generated autoloads from go-mode.el - -(autoload 'go-mode "go-mode" "\ -Major mode for editing Go source text. - -This mode provides (not just) basic editing capabilities for -working with Go code. It offers almost complete syntax -highlighting, indentation that is almost identical to gofmt, -proper parsing of the buffer content to allow features such as -navigation by function, manipulation of comments or detection of -strings. - -Additionally to these core features, it offers various features to -help with writing Go code. You can directly run buffer content -through gofmt, read godoc documentation from within Emacs, modify -and clean up the list of package imports or interact with the -Playground (uploading and downloading pastes). - -The following extra functions are defined: - -- `gofmt' -- `godoc' -- `go-import-add' -- `go-remove-unused-imports' -- `go-goto-imports' -- `go-play-buffer' and `go-play-region' -- `go-download-play' - -If you want to automatically run `gofmt' before saving a file, -add the following hook to your emacs configuration: - -\(add-hook 'before-save-hook 'gofmt-before-save) - -If you're looking for even more integration with Go, namely -on-the-fly syntax checking, auto-completion and snippets, it is -recommended to look at goflymake -\(https://github.com/dougm/goflymake), gocode -\(https://github.com/nsf/gocode) and yasnippet-go -\(https://github.com/dominikh/yasnippet-go) - -\(fn)" t nil) - -(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode)) - -(autoload 'gofmt-before-save "go-mode" "\ -Add this to .emacs to run gofmt on the current buffer when saving: - (add-hook 'before-save-hook 'gofmt-before-save). - -Note that this will cause go-mode to get loaded the first time -you save any file, kind of defeating the point of autoloading. - -\(fn)" t nil) - -(autoload 'godoc "go-mode" "\ -Show go documentation for a query, much like M-x man. - -\(fn QUERY)" t nil) - -(autoload 'go-download-play "go-mode" "\ -Downloads a paste from the playground and inserts it in a Go -buffer. Tries to look for a URL at point. - -\(fn URL)" t nil) - -;;;*** - -(provide 'go-mode-load) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; go-mode-load.el ends here diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.el b/emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.el deleted file mode 100644 index 26938a1..0000000 --- a/emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -(define-package "go-mode" "20130809.1442" "Major mode for the Go programming language [hg]" 'nil) - diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.elc b/emacs.d/elpa/go-mode-20130809.1442/go-mode-pkg.elc deleted file mode 100644 index 972b0450e78e7ca413fa356a4f9ef9e4b5886cc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 656 zcmbtSO;6)66zn;Ffa|Cykcjiqu0-htsL%=tBqZ3=io>hzB;GoHk?pX8Uyl%qR;bHrH6u2jdo&3X#jl`!DE@^lgziZOp$csWDq7BaRyv=C%d>JL zs`a}5%npZEXgh-%hwEt&&k4~a3H4g6L^ap`n%IGCQZ_`>n^%gdA&6`)K6WO&s~Lk1 zP%n;pBcWJ^=#6W`X{!1VK}w}9eDYKqQE&dkP@FIvM@V*&Qu7#_{48Z$e)+JwxqfAuuF4>@_UY7m|<11ZeWsXph*X#(MS6o9y}4nFM_IWLb8sbYq;(2a*SB xHI^TyEwTJ!TZ-@K4|`0GqDhz7Y5Zgio?B0SpSF$Zca0Ou@2-7X!Wny#y#YSH#B%@u diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode.el b/emacs.d/elpa/go-mode-20130809.1442/go-mode.el deleted file mode 100644 index faa316a..0000000 --- a/emacs.d/elpa/go-mode-20130809.1442/go-mode.el +++ /dev/null @@ -1,1080 +0,0 @@ -;;; go-mode.el --- Major mode for the Go programming language - -;; Copyright 2013 The Go Authors. All rights reserved. -;; Use of this source code is governed by a BSD-style -;; license that can be found in the LICENSE file. - -(require 'cl) -(require 'etags) -(require 'ffap) -(require 'ring) -(require 'url) - -;; XEmacs compatibility guidelines -;; - Minimum required version of XEmacs: 21.5.32 -;; - Feature that cannot be backported: POSIX character classes in -;; regular expressions -;; - Functions that could be backported but won't because 21.5.32 -;; covers them: plenty. -;; - Features that are still partly broken: -;; - godef will not work correctly if multibyte characters are -;; being used -;; - Fontification will not handle unicode correctly -;; -;; - Do not use \_< and \_> regexp delimiters directly; use -;; go--regexp-enclose-in-symbol -;; -;; - The character `_` must not be a symbol constituent but a -;; character constituent -;; -;; - Do not use process-lines -;; -;; - Use go--old-completion-list-style when using a plain list as the -;; collection for completing-read -;; -;; - Use go--kill-whole-line instead of kill-whole-line (called -;; kill-entire-line in XEmacs) -;; -;; - Use go--position-bytes instead of position-bytes -(defmacro go--xemacs-p () - `(featurep 'xemacs)) - -(defalias 'go--kill-whole-line - (if (fboundp 'kill-whole-line) - 'kill-whole-line - 'kill-entire-line)) - -;; Delete the current line without putting it in the kill-ring. -(defun go--delete-whole-line (&optional arg) - ;; Emacs uses both kill-region and kill-new, Xemacs only uses - ;; kill-region. In both cases we turn them into operations that do - ;; not modify the kill ring. This solution does depend on the - ;; implementation of kill-line, but it's the only viable solution - ;; that does not require to write kill-line from scratch. - (flet ((kill-region (beg end) - (delete-region beg end)) - (kill-new (s) ())) - (go--kill-whole-line arg))) - - -;; XEmacs unfortunately does not offer position-bytes. We can fall -;; back to just using (point), but it will be incorrect as soon as -;; multibyte characters are being used. -(if (fboundp 'position-bytes) - (defalias 'go--position-bytes 'position-bytes) - (defun go--position-bytes (point) point)) - -(defun go--old-completion-list-style (list) - (mapcar (lambda (x) (cons x nil)) list)) - -;; GNU Emacs 24 has prog-mode, older GNU Emacs and XEmacs do not. -;; Ideally we'd use defalias instead, but that breaks in XEmacs. -;; -;; TODO: If XEmacs decides to add prog-mode, change this to use -;; defalias to alias prog-mode or fundamental-mode to go--prog-mode -;; and use that in define-derived-mode. -(if (not (fboundp 'prog-mode)) - (define-derived-mode prog-mode fundamental-mode "" "")) - -(defun go--regexp-enclose-in-symbol (s) - ;; XEmacs does not support \_<, GNU Emacs does. In GNU Emacs we make - ;; extensive use of \_< to support unicode in identifiers. Until we - ;; come up with a better solution for XEmacs, this solution will - ;; break fontification in XEmacs for identifiers such as "typeµ". - ;; XEmacs will consider "type" a keyword, GNU Emacs won't. - - (if (go--xemacs-p) - (concat "\\<" s "\\>") - (concat "\\_<" s "\\_>"))) - -;; Move up one level of parentheses. -(defun go-goto-opening-parenthesis (&optional legacy-unused) - ;; The old implementation of go-goto-opening-parenthesis had an - ;; optional argument to speed up the function. It didn't change the - ;; function's outcome. - - ;; Silently fail if there's no matching opening parenthesis. - (condition-case nil - (backward-up-list) - (scan-error nil))) - - -(defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]") -(defconst go-identifier-regexp "[[:word:][:multibyte:]]+") -(defconst go-label-regexp go-identifier-regexp) -(defconst go-type-regexp "[[:word:][:multibyte:]*]+") -(defconst go-func-regexp (concat (go--regexp-enclose-in-symbol "func") "\\s *\\(" go-identifier-regexp "\\)")) -(defconst go-func-meth-regexp (concat - (go--regexp-enclose-in-symbol "func") "\\s *\\(?:(\\s *" - "\\(" go-identifier-regexp "\\s +\\)?" go-type-regexp - "\\s *)\\s *\\)?\\(" - go-identifier-regexp - "\\)(")) -(defconst go-builtins - '("append" "cap" "close" "complex" "copy" - "delete" "imag" "len" "make" "new" - "panic" "print" "println" "real" "recover") - "All built-in functions in the Go language. Used for font locking.") - -(defconst go-mode-keywords - '("break" "default" "func" "interface" "select" - "case" "defer" "go" "map" "struct" - "chan" "else" "goto" "package" "switch" - "const" "fallthrough" "if" "range" "type" - "continue" "for" "import" "return" "var") - "All keywords in the Go language. Used for font locking.") - -(defconst go-constants '("nil" "true" "false" "iota")) -(defconst go-type-name-regexp (concat "\\(?:[*(]\\)*\\(?:" go-identifier-regexp "\\.\\)?\\(" go-identifier-regexp "\\)")) - -(defvar go-dangling-cache) -(defvar go-godoc-history nil) - -(defgroup go nil - "Major mode for editing Go code" - :group 'languages) - -(defgroup go-cover nil - "Options specific to `cover`" - :group 'go) - -(defcustom go-fontify-function-calls t - "Fontify function and method calls if this is non-nil." - :type 'boolean - :group 'go) - -(defcustom go-mode-hook nil - "Hook called by `go-mode'." - :type 'hook - :group 'go) - -(defface go-coverage-untracked - '((t (:foreground "#505050"))) - "Coverage color of untracked code." - :group 'go-cover) - -(defface go-coverage-0 - '((t (:foreground "#c00000"))) - "Coverage color for uncovered code." - :group 'go-cover) -(defface go-coverage-1 - '((t (:foreground "#808080"))) - "Coverage color for covered code with weight 1." - :group 'go-cover) -(defface go-coverage-2 - '((t (:foreground "#748c83"))) - "Coverage color for covered code with weight 2." - :group 'go-cover) -(defface go-coverage-3 - '((t (:foreground "#689886"))) - "Coverage color for covered code with weight 3." - :group 'go-cover) -(defface go-coverage-4 - '((t (:foreground "#5ca489"))) - "Coverage color for covered code with weight 4." - :group 'go-cover) -(defface go-coverage-5 - '((t (:foreground "#50b08c"))) - "Coverage color for covered code with weight 5." - :group 'go-cover) -(defface go-coverage-6 - '((t (:foreground "#44bc8f"))) - "Coverage color for covered code with weight 6." - :group 'go-cover) -(defface go-coverage-7 - '((t (:foreground "#38c892"))) - "Coverage color for covered code with weight 7." - :group 'go-cover) -(defface go-coverage-8 - '((t (:foreground "#2cd495"))) - "Coverage color for covered code with weight 8. -For mode=set, all covered lines will have this weight." - :group 'go-cover) -(defface go-coverage-9 - '((t (:foreground "#20e098"))) - "Coverage color for covered code with weight 9." - :group 'go-cover) -(defface go-coverage-10 - '((t (:foreground "#14ec9b"))) - "Coverage color for covered code with weight 10." - :group 'go-cover) -(defface go-coverage-covered - '((t (:foreground "#2cd495"))) - "Coverage color of covered code." - :group 'go-cover) - -(defvar go-mode-syntax-table - (let ((st (make-syntax-table))) - (modify-syntax-entry ?+ "." st) - (modify-syntax-entry ?- "." st) - (modify-syntax-entry ?% "." st) - (modify-syntax-entry ?& "." st) - (modify-syntax-entry ?| "." st) - (modify-syntax-entry ?^ "." st) - (modify-syntax-entry ?! "." st) - (modify-syntax-entry ?= "." st) - (modify-syntax-entry ?< "." st) - (modify-syntax-entry ?> "." st) - (modify-syntax-entry ?/ (if (go--xemacs-p) ". 1456" ". 124b") st) - (modify-syntax-entry ?* ". 23" st) - (modify-syntax-entry ?\n "> b" st) - (modify-syntax-entry ?\" "\"" st) - (modify-syntax-entry ?\' "\"" st) - (modify-syntax-entry ?` "\"" st) - (modify-syntax-entry ?\\ "\\" st) - ;; It would be nicer to have _ as a symbol constituent, but that - ;; would trip up XEmacs, which does not support the \_< anchor - (modify-syntax-entry ?_ "w" st) - - st) - "Syntax table for Go mode.") - -(defun go--build-font-lock-keywords () - ;; we cannot use 'symbols in regexp-opt because emacs <24 doesn't - ;; understand that - (append - `((,(go--regexp-enclose-in-symbol (regexp-opt go-mode-keywords t)) . font-lock-keyword-face) - (,(go--regexp-enclose-in-symbol (regexp-opt go-builtins t)) . font-lock-builtin-face) - (,(go--regexp-enclose-in-symbol (regexp-opt go-constants t)) . font-lock-constant-face) - (,go-func-regexp 1 font-lock-function-name-face)) ;; function (not method) name - - (if go-fontify-function-calls - `((,(concat "\\(" go-identifier-regexp "\\)[[:space:]]*(") 1 font-lock-function-name-face) ;; function call/method name - (,(concat "(\\(" go-identifier-regexp "\\))[[:space:]]*(") 1 font-lock-function-name-face)) ;; bracketed function call - `((,go-func-meth-regexp 1 font-lock-function-name-face))) ;; method name - - `( - (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*\\([^[:space:]]+\\)") 1 font-lock-type-face) ;; types - (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types - (,(concat "[^[:word:][:multibyte:]]\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]" go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices - (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face) - (,(concat (go--regexp-enclose-in-symbol "map") "\\[[^]]+\\]" go-type-name-regexp) 1 font-lock-type-face) ;; map value type - (,(concat (go--regexp-enclose-in-symbol "map") "\\[" go-type-name-regexp) 1 font-lock-type-face) ;; map key type - (,(concat (go--regexp-enclose-in-symbol "chan") "[[:space:]]*\\(?:<-\\)?" go-type-name-regexp) 1 font-lock-type-face) ;; channel type - (,(concat (go--regexp-enclose-in-symbol "\\(?:new\\|make\\)") "\\(?:[[:space:]]\\|)\\)*(" go-type-name-regexp) 1 font-lock-type-face) ;; new/make type - ;; TODO do we actually need this one or isn't it just a function call? - (,(concat "\\.\\s *(" go-type-name-regexp) 1 font-lock-type-face) ;; Type conversion - (,(concat (go--regexp-enclose-in-symbol "func") "[[:space:]]+(" go-identifier-regexp "[[:space:]]+" go-type-name-regexp ")") 1 font-lock-type-face) ;; Method receiver - (,(concat (go--regexp-enclose-in-symbol "func") "[[:space:]]+(" go-type-name-regexp ")") 1 font-lock-type-face) ;; Method receiver without variable name - ;; Like the original go-mode this also marks compound literal - ;; fields. There, it was marked as to fix, but I grew quite - ;; accustomed to it, so it'll stay for now. - (,(concat "^[[:space:]]*\\(" go-label-regexp "\\)[[:space:]]*:\\(\\S.\\|$\\)") 1 font-lock-constant-face) ;; Labels and compound literal fields - (,(concat (go--regexp-enclose-in-symbol "\\(goto\\|break\\|continue\\)") "[[:space:]]*\\(" go-label-regexp "\\)") 2 font-lock-constant-face)))) ;; labels in goto/break/continue - -(defvar go-mode-map - (let ((m (make-sparse-keymap))) - (define-key m "}" 'go-mode-insert-and-indent) - (define-key m ")" 'go-mode-insert-and-indent) - (define-key m "," 'go-mode-insert-and-indent) - (define-key m ":" 'go-mode-insert-and-indent) - (define-key m "=" 'go-mode-insert-and-indent) - (define-key m (kbd "C-c C-a") 'go-import-add) - (define-key m (kbd "C-c C-j") 'godef-jump) - (define-key m (kbd "C-x 4 C-c C-j") 'godef-jump-other-window) - (define-key m (kbd "C-c C-d") 'godef-describe) - m) - "Keymap used by Go mode to implement electric keys.") - -(defun go-mode-insert-and-indent (key) - "Invoke the global binding of KEY, then reindent the line." - - (interactive (list (this-command-keys))) - (call-interactively (lookup-key (current-global-map) key)) - (indent-according-to-mode)) - -(defmacro go-paren-level () - `(car (syntax-ppss))) - -(defmacro go-in-string-or-comment-p () - `(nth 8 (syntax-ppss))) - -(defmacro go-in-string-p () - `(nth 3 (syntax-ppss))) - -(defmacro go-in-comment-p () - `(nth 4 (syntax-ppss))) - -(defmacro go-goto-beginning-of-string-or-comment () - `(goto-char (nth 8 (syntax-ppss)))) - -(defun go--backward-irrelevant (&optional stop-at-string) - "Skips backwards over any characters that are irrelevant for -indentation and related tasks. - -It skips over whitespace, comments, cases and labels and, if -STOP-AT-STRING is not true, over strings." - - (let (pos (start-pos (point))) - (skip-chars-backward "\n\s\t") - (if (and (save-excursion (beginning-of-line) (go-in-string-p)) (looking-back "`") (not stop-at-string)) - (backward-char)) - (if (and (go-in-string-p) (not stop-at-string)) - (go-goto-beginning-of-string-or-comment)) - (if (looking-back "\\*/") - (backward-char)) - (if (go-in-comment-p) - (go-goto-beginning-of-string-or-comment)) - (setq pos (point)) - (beginning-of-line) - (if (or (looking-at (concat "^" go-label-regexp ":")) (looking-at "^[[:space:]]*\\(case .+\\|default\\):")) - (end-of-line 0) - (goto-char pos)) - (if (/= start-pos (point)) - (go--backward-irrelevant stop-at-string)) - (/= start-pos (point)))) - -(defun go--buffer-narrowed-p () - "Return non-nil if the current buffer is narrowed." - (/= (buffer-size) - (- (point-max) - (point-min)))) - -(defun go-previous-line-has-dangling-op-p () - "Returns non-nil if the current line is a continuation line." - (let* ((cur-line (line-number-at-pos)) - (val (gethash cur-line go-dangling-cache 'nope))) - (if (or (go--buffer-narrowed-p) (equal val 'nope)) - (save-excursion - (beginning-of-line) - (go--backward-irrelevant t) - (setq val (looking-back go-dangling-operators-regexp)) - (if (not (go--buffer-narrowed-p)) - (puthash cur-line val go-dangling-cache)))) - val)) - -(defun go--at-function-definition () - "Return non-nil if point is on the opening curly brace of a -function definition. - -We do this by first calling (beginning-of-defun), which will take -us to the start of *some* function. We then look for the opening -curly brace of that function and compare its position against the -curly brace we are checking. If they match, we return non-nil." - (if (= (char-after) ?\{) - (save-excursion - (let ((old-point (point)) - start-nesting) - (beginning-of-defun) - (when (looking-at "func ") - (setq start-nesting (go-paren-level)) - (skip-chars-forward "^{") - (while (> (go-paren-level) start-nesting) - (forward-char) - (skip-chars-forward "^{") 0) - (if (and (= (go-paren-level) start-nesting) (= old-point (point))) - t)))))) - -(defun go--indentation-for-opening-parenthesis () - "Return the semantic indentation for the current opening parenthesis. - -If point is on an opening curly brace and said curly brace -belongs to a function declaration, the indentation of the func -keyword will be returned. Otherwise the indentation of the -current line will be returned." - (save-excursion - (if (go--at-function-definition) - (progn - (beginning-of-defun) - (current-indentation)) - (current-indentation)))) - -(defun go-indentation-at-point () - (save-excursion - (let (start-nesting (outindent 0)) - (back-to-indentation) - (setq start-nesting (go-paren-level)) - - (cond - ((go-in-string-p) - (current-indentation)) - ((looking-at "[])}]") - (go-goto-opening-parenthesis) - (if (go-previous-line-has-dangling-op-p) - (- (current-indentation) tab-width) - (go--indentation-for-opening-parenthesis))) - ((progn (go--backward-irrelevant t) (looking-back go-dangling-operators-regexp)) - ;; only one nesting for all dangling operators in one operation - (if (go-previous-line-has-dangling-op-p) - (current-indentation) - (+ (current-indentation) tab-width))) - ((zerop (go-paren-level)) - 0) - ((progn (go-goto-opening-parenthesis) (< (go-paren-level) start-nesting)) - (if (go-previous-line-has-dangling-op-p) - (current-indentation) - (+ (go--indentation-for-opening-parenthesis) tab-width))) - (t - (current-indentation)))))) - -(defun go-mode-indent-line () - (interactive) - (let (indent - shift-amt - end - (pos (- (point-max) (point))) - (point (point)) - (beg (line-beginning-position))) - (back-to-indentation) - (if (go-in-string-or-comment-p) - (goto-char point) - (setq indent (go-indentation-at-point)) - (if (looking-at (concat go-label-regexp ":\\([[:space:]]*/.+\\)?$\\|case .+:\\|default:")) - (decf indent tab-width)) - (setq shift-amt (- indent (current-column))) - (if (zerop shift-amt) - nil - (delete-region beg (point)) - (indent-to indent)) - ;; If initial point was within line's indentation, - ;; position after the indentation. Else stay at same point in text. - (if (> (- (point-max) pos) (point)) - (goto-char (- (point-max) pos)))))) - -(defun go-beginning-of-defun (&optional count) - (unless count (setq count 1)) - (let ((first t) failure) - (dotimes (i (abs count)) - (while (and (not failure) - (or first (go-in-string-or-comment-p))) - (if (>= count 0) - (progn - (go--backward-irrelevant) - (if (not (re-search-backward go-func-meth-regexp nil t)) - (setq failure t))) - (if (looking-at go-func-meth-regexp) - (forward-char)) - (if (not (re-search-forward go-func-meth-regexp nil t)) - (setq failure t))) - (setq first nil))) - (if (< count 0) - (beginning-of-line)) - (not failure))) - -(defun go-end-of-defun () - (let (orig-level) - ;; It can happen that we're not placed before a function by emacs - (if (not (looking-at "func")) - (go-beginning-of-defun -1)) - (skip-chars-forward "^{") - (forward-char) - (setq orig-level (go-paren-level)) - (while (>= (go-paren-level) orig-level) - (skip-chars-forward "^}") - (forward-char)))) - -;;;###autoload -(define-derived-mode go-mode prog-mode "Go" - "Major mode for editing Go source text. - -This mode provides (not just) basic editing capabilities for -working with Go code. It offers almost complete syntax -highlighting, indentation that is almost identical to gofmt and -proper parsing of the buffer content to allow features such as -navigation by function, manipulation of comments or detection of -strings. - -In addition to these core features, it offers various features to -help with writing Go code. You can directly run buffer content -through gofmt, read godoc documentation from within Emacs, modify -and clean up the list of package imports or interact with the -Playground (uploading and downloading pastes). - -The following extra functions are defined: - -- `gofmt' -- `godoc' -- `go-import-add' -- `go-remove-unused-imports' -- `go-goto-imports' -- `go-play-buffer' and `go-play-region' -- `go-download-play' -- `godef-describe' and `godef-jump' -- `go-coverage' - -If you want to automatically run `gofmt' before saving a file, -add the following hook to your emacs configuration: - -\(add-hook 'before-save-hook 'gofmt-before-save) - -If you want to use `godef-jump' instead of etags (or similar), -consider binding godef-jump to `M-.', which is the default key -for `find-tag': - -\(add-hook 'go-mode-hook (lambda () - (local-set-key (kbd \"M-.\") 'godef-jump))) - -Please note that godef is an external dependency. You can install -it with - -go get code.google.com/p/rog-go/exp/cmd/godef - - -If you're looking for even more integration with Go, namely -on-the-fly syntax checking, auto-completion and snippets, it is -recommended that you look at goflymake -\(https://github.com/dougm/goflymake), gocode -\(https://github.com/nsf/gocode) and yasnippet-go -\(https://github.com/dominikh/yasnippet-go)" - - ;; Font lock - (set (make-local-variable 'font-lock-defaults) - '(go--build-font-lock-keywords)) - - ;; Indentation - (set (make-local-variable 'indent-line-function) 'go-mode-indent-line) - - ;; Comments - (set (make-local-variable 'comment-start) "// ") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-use-syntax) t) - (set (make-local-variable 'comment-start-skip) "\\(//+\\|/\\*+\\)\\s *") - - (set (make-local-variable 'beginning-of-defun-function) 'go-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) 'go-end-of-defun) - - (set (make-local-variable 'parse-sexp-lookup-properties) t) - (if (boundp 'syntax-propertize-function) - (set (make-local-variable 'syntax-propertize-function) 'go-propertize-syntax)) - - (set (make-local-variable 'go-dangling-cache) (make-hash-table :test 'eql)) - (add-hook 'before-change-functions (lambda (x y) (setq go-dangling-cache (make-hash-table :test 'eql))) t t) - - - (setq imenu-generic-expression - '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1) - ("func" "^func *\\(.*\\) {" 1))) - (imenu-add-to-menubar "Index") - - ;; Go style - (setq indent-tabs-mode t) - - ;; Handle unit test failure output in compilation-mode - ;; - ;; Note the final t argument to add-to-list for append, ie put these at the - ;; *ends* of compilation-error-regexp-alist[-alist]. We want go-test to be - ;; handled first, otherwise other elements will match that don't work, and - ;; those alists are traversed in *reverse* order: - ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-12/msg00674.html - (when (and (boundp 'compilation-error-regexp-alist) - (boundp 'compilation-error-regexp-alist-alist)) - (add-to-list 'compilation-error-regexp-alist 'go-test t) - (add-to-list 'compilation-error-regexp-alist-alist - '(go-test . ("^\t+\\([^()\t\n]+\\):\\([0-9]+\\):? .*$" 1 2)) t))) - -;;;###autoload -(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode)) - -(defun go--apply-rcs-patch (patch-buffer) - "Apply an RCS-formatted diff from PATCH-BUFFER to the current -buffer." - (let ((target-buffer (current-buffer)) - ;; Relative offset between buffer line numbers and line numbers - ;; in patch. - ;; - ;; Line numbers in the patch are based on the source file, so - ;; we have to keep an offset when making changes to the - ;; buffer. - ;; - ;; Appending lines decrements the offset (possibly making it - ;; negative), deleting lines increments it. This order - ;; simplifies the forward-line invocations. - (line-offset 0)) - (save-excursion - (with-current-buffer patch-buffer - (goto-char (point-min)) - (while (not (eobp)) - (unless (looking-at "^\\([ad]\\)\\([0-9]+\\) \\([0-9]+\\)") - (error "invalid rcs patch or internal error in go--apply-rcs-patch")) - (forward-line) - (let ((action (match-string 1)) - (from (string-to-number (match-string 2))) - (len (string-to-number (match-string 3)))) - (cond - ((equal action "a") - (let ((start (point))) - (forward-line len) - (let ((text (buffer-substring start (point)))) - (with-current-buffer target-buffer - (decf line-offset len) - (goto-char (point-min)) - (forward-line (- from len line-offset)) - (insert text))))) - ((equal action "d") - (with-current-buffer target-buffer - (go--goto-line (- from line-offset)) - (incf line-offset len) - (go--delete-whole-line len))) - (t - (error "invalid rcs patch or internal error in go--apply-rcs-patch"))))))))) - -(defun gofmt () - "Formats the current buffer according to the gofmt tool." - - (interactive) - (let ((tmpfile (make-temp-file "gofmt" nil ".go")) - (patchbuf (get-buffer-create "*Gofmt patch*")) - (errbuf (get-buffer-create "*Gofmt Errors*")) - (coding-system-for-read 'utf-8) - (coding-system-for-write 'utf-8)) - - (with-current-buffer errbuf - (setq buffer-read-only nil) - (erase-buffer)) - (with-current-buffer patchbuf - (erase-buffer)) - - (write-region nil nil tmpfile) - - ;; We're using errbuf for the mixed stdout and stderr output. This - ;; is not an issue because gofmt -w does not produce any stdout - ;; output in case of success. - (if (zerop (call-process "gofmt" nil errbuf nil "-w" tmpfile)) - (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile)) - (progn - (kill-buffer errbuf) - (message "Buffer is already gofmted")) - (go--apply-rcs-patch patchbuf) - (kill-buffer errbuf) - (message "Applied gofmt")) - (message "Could not apply gofmt. Check errors for details") - (gofmt--process-errors (buffer-file-name) tmpfile errbuf)) - - (kill-buffer patchbuf) - (delete-file tmpfile))) - - -(defun gofmt--process-errors (filename tmpfile errbuf) - ;; Convert the gofmt stderr to something understood by the compilation mode. - (with-current-buffer errbuf - (goto-char (point-min)) - (insert "gofmt errors:\n") - (while (search-forward-regexp (concat "^\\(" (regexp-quote tmpfile) "\\):") nil t) - (replace-match (file-name-nondirectory filename) t t nil 1)) - (compilation-mode) - (display-buffer errbuf))) - -;;;###autoload -(defun gofmt-before-save () - "Add this to .emacs to run gofmt on the current buffer when saving: - (add-hook 'before-save-hook 'gofmt-before-save). - -Note that this will cause go-mode to get loaded the first time -you save any file, kind of defeating the point of autoloading." - - (interactive) - (when (eq major-mode 'go-mode) (gofmt))) - -(defun godoc--read-query () - "Read a godoc query from the minibuffer." - ;; Compute the default query as the symbol under the cursor. - ;; TODO: This does the wrong thing for e.g. multipart.NewReader (it only grabs - ;; half) but I see no way to disambiguate that from e.g. foobar.SomeMethod. - (let* ((bounds (bounds-of-thing-at-point 'symbol)) - (symbol (if bounds - (buffer-substring-no-properties (car bounds) - (cdr bounds))))) - (completing-read (if symbol - (format "godoc (default %s): " symbol) - "godoc: ") - (go--old-completion-list-style (go-packages)) nil nil nil 'go-godoc-history symbol))) - -(defun godoc--get-buffer (query) - "Get an empty buffer for a godoc query." - (let* ((buffer-name (concat "*godoc " query "*")) - (buffer (get-buffer buffer-name))) - ;; Kill the existing buffer if it already exists. - (when buffer (kill-buffer buffer)) - (get-buffer-create buffer-name))) - -(defun godoc--buffer-sentinel (proc event) - "Sentinel function run when godoc command completes." - (with-current-buffer (process-buffer proc) - (cond ((string= event "finished\n") ;; Successful exit. - (goto-char (point-min)) - (view-mode 1) - (display-buffer (current-buffer) t)) - ((/= (process-exit-status proc) 0) ;; Error exit. - (let ((output (buffer-string))) - (kill-buffer (current-buffer)) - (message (concat "godoc: " output))))))) - -;;;###autoload -(defun godoc (query) - "Show go documentation for a query, much like M-x man." - (interactive (list (godoc--read-query))) - (unless (string= query "") - (set-process-sentinel - (start-process-shell-command "godoc" (godoc--get-buffer query) - (concat "godoc " query)) - 'godoc--buffer-sentinel) - nil)) - -(defun go-goto-imports () - "Move point to the block of imports. - -If using - - import ( - \"foo\" - \"bar\" - ) - -it will move point directly behind the last import. - -If using - - import \"foo\" - import \"bar\" - -it will move point to the next line after the last import. - -If no imports can be found, point will be moved after the package -declaration." - (interactive) - ;; FIXME if there's a block-commented import before the real - ;; imports, we'll jump to that one. - - ;; Generally, this function isn't very forgiving. it'll bark on - ;; extra whitespace. It works well for clean code. - (let ((old-point (point))) - (goto-char (point-min)) - (cond - ((re-search-forward "^import ([^)]+)" nil t) - (backward-char 2) - 'block) - ((re-search-forward "\\(^import \\([^\"]+ \\)?\"[^\"]+\"\n?\\)+" nil t) - 'single) - ((re-search-forward "^[[:space:]\n]*package .+?\n" nil t) - (message "No imports found, moving point after package declaration") - 'none) - (t - (goto-char old-point) - (message "No imports or package declaration found. Is this really a Go file?") - 'fail)))) - -(defun go-play-buffer () - "Like `go-play-region', but acts on the entire buffer." - (interactive) - (go-play-region (point-min) (point-max))) - -(defun go-play-region (start end) - "Send the region to the Playground and stores the resulting -link in the kill ring." - (interactive "r") - (let* ((url-request-method "POST") - (url-request-extra-headers - '(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (buffer-substring-no-properties start end)) - (content-buf (url-retrieve - "http://play.golang.org/share" - (lambda (arg) - (cond - ((equal :error (car arg)) - (signal 'go-play-error (cdr arg))) - (t - (re-search-forward "\n\n") - (kill-new (format "http://play.golang.org/p/%s" (buffer-substring (point) (point-max)))) - (message "http://play.golang.org/p/%s" (buffer-substring (point) (point-max))))))))))) - -;;;###autoload -(defun go-download-play (url) - "Downloads a paste from the playground and inserts it in a Go -buffer. Tries to look for a URL at point." - (interactive (list (read-from-minibuffer "Playground URL: " (ffap-url-p (ffap-string-at-point 'url))))) - (with-current-buffer - (let ((url-request-method "GET") url-request-data url-request-extra-headers) - (url-retrieve-synchronously (concat url ".go"))) - (let ((buffer (generate-new-buffer (concat (car (last (split-string url "/"))) ".go")))) - (goto-char (point-min)) - (re-search-forward "\n\n") - (copy-to-buffer buffer (point) (point-max)) - (kill-buffer) - (with-current-buffer buffer - (go-mode) - (switch-to-buffer buffer))))) - -(defun go-propertize-syntax (start end) - (save-excursion - (goto-char start) - (while (search-forward "\\" end t) - (put-text-property (1- (point)) (point) 'syntax-table (if (= (char-after) ?`) '(1) '(9)))))) - -(defun go-import-add (arg import) - "Add a new import to the list of imports. - -When called with a prefix argument asks for an alternative name -to import the package as. - -If no list exists yet, one will be created if possible. - -If an identical import has been commented, it will be -uncommented, otherwise a new import will be added." - - ;; - If there's a matching `// import "foo"`, uncomment it - ;; - If we're in an import() block and there's a matching `"foo"`, uncomment it - ;; - Otherwise add a new import, with the appropriate syntax - (interactive - (list - current-prefix-arg - (replace-regexp-in-string "^[\"']\\|[\"']$" "" (completing-read "Package: " (go--old-completion-list-style (go-packages)))))) - (save-excursion - (let (as line import-start) - (if arg - (setq as (read-from-minibuffer "Import as: "))) - (if as - (setq line (format "%s \"%s\"" as import)) - (setq line (format "\"%s\"" import))) - - (goto-char (point-min)) - (if (re-search-forward (concat "^[[:space:]]*//[[:space:]]*import " line "$") nil t) - (uncomment-region (line-beginning-position) (line-end-position)) - (case (go-goto-imports) - ('fail (message "Could not find a place to add import.")) - ('block - (save-excursion - (re-search-backward "^import (") - (setq import-start (point))) - (if (re-search-backward (concat "^[[:space:]]*//[[:space:]]*" line "$") import-start t) - (uncomment-region (line-beginning-position) (line-end-position)) - (insert "\n\t" line))) - ('single (insert "import " line "\n")) - ('none (insert "\nimport (\n\t" line "\n)\n"))))))) - -(defun go-root-and-paths () - (let* ((output (split-string (shell-command-to-string "go env GOROOT GOPATH") "\n")) - (root (car output)) - (paths (split-string (cadr output) ":"))) - (append (list root) paths))) - -(defun go--string-prefix-p (s1 s2 &optional ignore-case) - "Return non-nil if S1 is a prefix of S2. -If IGNORE-CASE is non-nil, the comparison is case-insensitive." - (eq t (compare-strings s1 nil nil - s2 0 (length s1) ignore-case))) - -(defun go--directory-dirs (dir) - "Recursively return all subdirectories in DIR." - (if (file-directory-p dir) - (let ((dir (directory-file-name dir)) - (dirs '()) - (files (directory-files dir nil nil t))) - (dolist (file files) - (unless (member file '("." "..")) - (let ((file (concat dir "/" file))) - (if (file-directory-p file) - (setq dirs (append (cons file - (go--directory-dirs file)) - dirs)))))) - dirs) - '())) - - -(defun go-packages () - (sort - (delete-dups - (mapcan - (lambda (topdir) - (let ((pkgdir (concat topdir "/pkg/"))) - (mapcan (lambda (dir) - (mapcar (lambda (file) - (let ((sub (substring file (length pkgdir) -2))) - (unless (or (go--string-prefix-p "obj/" sub) (go--string-prefix-p "tool/" sub)) - (mapconcat 'identity (cdr (split-string sub "/")) "/")))) - (if (file-directory-p dir) - (directory-files dir t "\\.a$")))) - (if (file-directory-p pkgdir) - (go--directory-dirs pkgdir))))) - (go-root-and-paths))) - 'string<)) - -(defun go-unused-imports-lines () - ;; FIXME Technically, -o /dev/null fails in quite some cases (on - ;; Windows, when compiling from within GOPATH). Practically, - ;; however, it has the same end result: There won't be a - ;; compiled binary/archive, and we'll get our import errors when - ;; there are any. - (reverse (remove nil - (mapcar - (lambda (line) - (if (string-match "^\\(.+\\):\\([[:digit:]]+\\): imported and not used: \".+\"$" line) - (if (string= (file-truename (match-string 1 line)) (file-truename buffer-file-name)) - (string-to-number (match-string 2 line))))) - (split-string (shell-command-to-string - (if (string-match "_test\.go$" buffer-file-truename) - "go test -c" - "go build -o /dev/null")) "\n"))))) - -(defun go-remove-unused-imports (arg) - "Removes all unused imports. If ARG is non-nil, unused imports -will be commented, otherwise they will be removed completely." - (interactive "P") - (save-excursion - (let ((cur-buffer (current-buffer)) flymake-state lines) - (when (boundp 'flymake-mode) - (setq flymake-state flymake-mode) - (flymake-mode-off)) - (save-some-buffers nil (lambda () (equal cur-buffer (current-buffer)))) - (if (buffer-modified-p) - (message "Cannot operate on unsaved buffer") - (setq lines (go-unused-imports-lines)) - (dolist (import lines) - (go--goto-line import) - (beginning-of-line) - (if arg - (comment-region (line-beginning-position) (line-end-position)) - (go--delete-whole-line))) - (message "Removed %d imports" (length lines))) - (if flymake-state (flymake-mode-on))))) - -(defun godef--find-file-line-column (specifier other-window) - "Given a file name in the format of `filename:line:column', -visit FILENAME and go to line LINE and column COLUMN." - (if (not (string-match "\\(.+\\):\\([0-9]+\\):\\([0-9]+\\)" specifier)) - (error "Unexpected godef output: %s" specifier) - (let ((filename (match-string 1 specifier)) - (line (string-to-number (match-string 2 specifier))) - (column (string-to-number (match-string 3 specifier)))) - (with-current-buffer (funcall (if other-window 'find-file-other-window 'find-file) filename) - (go--goto-line line) - (beginning-of-line) - (forward-char (1- column)) - (if (buffer-modified-p) - (message "Buffer is modified, file position might not have been correct")))))) - -(defun godef--call (point) - "Call godef, acquiring definition position and expression -description at POINT." - (if (go--xemacs-p) - (message "godef does not reliably work in XEmacs, expect bad results")) - (if (not buffer-file-name) - (message "Cannot use godef on a buffer without a file name") - (let ((outbuf (get-buffer-create "*godef*"))) - (with-current-buffer outbuf - (erase-buffer)) - (call-process-region (point-min) (point-max) "godef" nil outbuf nil "-i" "-t" "-f" (file-truename buffer-file-name) "-o" (number-to-string (go--position-bytes (point)))) - (with-current-buffer outbuf - (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n"))))) - -(defun godef-describe (point) - "Describe the expression at POINT." - (interactive "d") - (condition-case nil - (let ((description (nth 1 (godef--call point)))) - (if (string= "" description) - (message "No description found for expression at point") - (message "%s" description))) - (file-error (message "Could not run godef binary")))) - -(defun godef-jump (point &optional other-window) - "Jump to the definition of the expression at POINT." - (interactive "d") - (condition-case nil - (let ((file (car (godef--call point)))) - (cond - ((string= "-" file) - (message "godef: expression is not defined anywhere")) - ((string= "godef: no identifier found" file) - (message "%s" file)) - ((go--string-prefix-p "godef: no declaration found for " file) - (message "%s" file)) - (t - (push-mark) - (ring-insert find-tag-marker-ring (point-marker)) - (godef--find-file-line-column file other-window)))) - (file-error (message "Could not run godef binary")))) - -(defun godef-jump-other-window (point) - (interactive "d") - (godef-jump point t)) - -(defun go--goto-line (line) - (goto-char (point-min)) - (forward-line (1- line))) - -(defun go--line-column-to-point (line column) - (save-excursion - (go--goto-line line) - (forward-char (1- column)) - (point))) - -(defstruct go--covered - start-line start-column end-line end-column covered count) - -(defun go-coverage (input) - "Open a clone of the current buffer and overlay it with -coverage information gathered via go test -coverprofile=INPUT." - (interactive "fCoverage file: ") - (let ((ranges '()) - (file-name (file-name-nondirectory (buffer-file-name))) - (gocov-buffer-name (concat (buffer-name) "")) - (max-count 0) - divisor) - - (with-temp-buffer - (insert-file-contents input) - (go--goto-line 2) ;; Skip over mode - (while (not (eobp)) - (let* ((parts (split-string (buffer-substring (point-at-bol) (point-at-eol)) ":")) - (file (car parts)) - (rest (split-string (nth 1 parts) "[., ]"))) - - (destructuring-bind - (start-line start-column end-line end-column num count) - (mapcar 'string-to-number rest) - - (if (> count max-count) - (setq max-count count)) - - (if (and (string= (file-name-nondirectory file) file-name)) - (push - (make-go--covered - :start-line start-line - :start-column start-column - :end-line end-line - :end-column end-column - :covered (/= count 0) - :count count) - ranges))) - - (forward-line))) - - (if (> max-count 0) - (setq divisor (log max-count)))) - - (with-current-buffer (or - (get-buffer gocov-buffer-name) - (clone-indirect-buffer gocov-buffer-name nil)) - (save-excursion - (remove-overlays) - (overlay-put - (make-overlay - (point-min) - (point-max)) - 'face 'go-coverage-untracked) - - (dolist (range ranges) - (let* ((count (go--covered-count range)) - (norm (cond - ((= count 0) - -0.1) - ((= max-count 1) - 0.8) - (t - (/ (log count) divisor)))) - (n (1+ (floor (* norm 9)))) - (face (concat "go-coverage-" (number-to-string n))) - (ov (make-overlay - (go--line-column-to-point - (go--covered-start-line range) - (go--covered-start-column range)) - (go--line-column-to-point - (go--covered-end-line range) - (go--covered-end-column range))))) - - (overlay-put ov 'face face) - (overlay-put ov 'help-echo (format "Count: %d" count))))) - - (display-buffer (current-buffer) 'display-buffer-reuse-window)))) - -(provide 'go-mode) diff --git a/emacs.d/elpa/go-mode-20130809.1442/go-mode.elc b/emacs.d/elpa/go-mode-20130809.1442/go-mode.elc deleted file mode 100644 index 224b5fbde0f325d0c3c03c15d05c28eb17e8ed24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41582 zcmeI5>3bW;mF}54a}$bs%&`+kaW+j8v?Wqfljz36C9$$x3Xe^YiIOF)kwI31P)zwv}s!pB#RR8AIr#FALu&}W7o8SBzz7wEr^NAGAiJPQ82B>~*i*(9JOZtlqfM>phL{4SE}$UZdWLdfn*3NjJKFau_8^ zloWT1mEB?zrNyLVEglSd$I$_8Mw?#_TZ7?dzS+%<)^WWt+-PpLI{o_QVJ|-JHCwS> zE^ZfhHj;8V4W%2cjy2fsMz{1*^o-Wpbf1G3xa+2=R!~{R&66sIp_f(};pzk^2gmiN6JQBe!wv_ZP<=hh*P4T7nv3~3 zY^%L2a153CO@z1(&Y$GV4Wa#hbyFE|x8EDKg>$j?2-GobI{`BFjP>aE+TD>B%n#b` zwIq+D(hQ2T<`9kJK8UUkI_=>o9*$nZ5@<StEB2b%0uIWMIom3{8u3FPqLq+Waz)~O%wH|x=w5lEiKqvL)Ic65^;ep*nepzSw{<=;ku)=j>Q`Cwlo)|~J zZWwfGS4~#`S*z)=ji~`2##C!86lf25-o`$Mi6+I!@Ac#@ZJ8hQr*t;#<}yr7kKZ`=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mtq5x3^h5nVl7FwSq=Rdf1o>NuRbXhW^lEw<> z^$R3?n%&X#sz_&kCxRK(A+-rJ9Sdy9FB$M+iz(~mandmS?A(Hln|!=n1)hi`Ns0iH4+s|A z1e<%Gvw!5>w~RDCF7HCT%D_;rI2xwUxmC~OZe;{_9Q@_V50>xPn9hAH@IGGtFZ0)O zw5%n#(P5c6uFz^l$5s*0OTAL!8gV01OK<#u3Kq%!>mLvVQz_XZ{7j{+EUBbim8#3P zSBQ8kSI&Pzd1YCDtAAX1c>Yr^=%rd*{&eNuc@FU{vr5%OU5!DyK@(*UPnDI-!BYY5 ziMqeb*QKpo-4xh~9++;ulYfIb%e_&pOtsE{iuvjQm9M^~4hrW#1Kf03f6L47dM4ru zbe^vc_}xmuiGn?fm+v_BNb6$VFI=WVsm~uW0y3GT*(NrYxP;^S3pS`TcChVzfU?Vr z$=vtRK&PV;wJi0{PM7o1dZMOTtqCW82w%>gh60QFFZ@>LW{DqtGv2;ds{k5*ieojLFYuf^^TY6EOb(?AYSu7% zrA*W59p=Ix9VI8QiS!$>Ccg|mirA$qsCu}yGy53JfzjMuoAQ^G3c`lXUWi^d^G^Lg4gnxKr=E^WWfB(sg>mi#1{Kt_(?am0r`p5>(7o$`*3m^iqp)ffL2m^%H5xD`0I OzK3GgVr4a~Fa1BYM(>pX diff --git a/emacs.d/elpa/nose-0.1.1/nose-autoloads.el b/emacs.d/elpa/nose-0.1.1/nose-autoloads.el deleted file mode 100644 index 4429541..0000000 --- a/emacs.d/elpa/nose-0.1.1/nose-autoloads.el +++ /dev/null @@ -1,17 +0,0 @@ -;;; nose-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads nil nil ("nose-pkg.el" "nose.el") (20848 3769 807343)) - -;;;*** - -(provide 'nose-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; nose-autoloads.el ends here diff --git a/emacs.d/elpa/nose-0.1.1/nose-pkg.el b/emacs.d/elpa/nose-0.1.1/nose-pkg.el deleted file mode 100644 index 7678683..0000000 --- a/emacs.d/elpa/nose-0.1.1/nose-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "nose" "0.1.1" "Easy Python test running in Emacs" (quote nil)) diff --git a/emacs.d/elpa/nose-0.1.1/nose-pkg.elc b/emacs.d/elpa/nose-0.1.1/nose-pkg.elc deleted file mode 100644 index 7798f8a9a0257ecd584553d1991d8932e6705856..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmbtR%WlFj5agU6=yjD-D-j2WN(FK$APz{agjD(gi|r&9jvd*i75(~dLWNrO$X@)| z(ai2lxp`UNjYgxSEK69sw$nyQIGo|&Rg4C0EuDQ{^^cIfqF6b1%y!-};{+OT7WT~v zmYoMa1I`zGw%|`tO!#zQth{TXB2LKPgYqH&O`9{-q6kdp%5<1p7gRQ3obk)GJJw8@ zfks={^icR94o#xPBP$pmdY?KrfQDx2qHgsUMgjzu49$I`!$toTQ~-Il*lGdNi4eWE zbr@6EhX^Po?S0kZb5_j%aY#oT)0?wSu&dDTQp;V$GC;iD_KeYFH#0J!3LD$M*>Y`n`_d@yyxlq?nLM zp~tL9rpa4TfFSSen!{fvNp5A&bD2|ok%?&%QLLi8&`CDV_i?K8fC z#UobWk*R_rl@$WS^J3&4V<&ST|NQj%bBZQHi>QE-`$oLTV#*aoBBPZaDkdQG11lH7_@F;l;6wj*cXwM_{y9&yq`fF@@3vw&Iu{xyBTh4|UdpI&;Zyi! zujR-{9SoD~ppbdtwEu%zD^<7*2lGiTi}|cGyKu&og76`QTe)vPcsFb#dY{D{7v#?lIg{2K*a3 zisf)Vrjg*>X_FHM-9!2k_anL$W})8=uGhlA>tf}9!YdD#e~k~mo)1m2!^{l>kI8v7tPa_G!h`FbJ|_o`te^f)gKHUStVS?sa{T=*sfgjc%@ zbZ~6Qaot%wM0oL^|GBR9ltWT$rD>$}RDetjl`c*U7nARinx}ELS0GD~N`gwJ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YyWo}$=kAWh41RTw9#=B&2trUvJS0- zdW|3cHBP$TPUH5qGC6sshOs77{RhjJ3T%0<90@d5#ui?c?fu}D*-4ofQsgH`?z z64y4O@+Xk_QNw_JS25a7@a>FVv-s*6TM^HGD)qG$YYi7=4_Z!5%Wh*dw?D_O)>2rE naX(PEgGv~n^cl7>R~qB4b^UV`<3X9AF!MZ#@ne#`*WUdXP6--L diff --git a/emacs.d/elpa/virtualenv-1.2/virtualenv-autoloads.el b/emacs.d/elpa/virtualenv-1.2/virtualenv-autoloads.el deleted file mode 100644 index 0d85e1e..0000000 --- a/emacs.d/elpa/virtualenv-1.2/virtualenv-autoloads.el +++ /dev/null @@ -1,44 +0,0 @@ -;;; virtualenv-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (virtualenv-minor-mode virtualenv-deactivate virtualenv-workon) -;;;;;; "virtualenv" "virtualenv.el" (20848 3772)) -;;; Generated autoloads from virtualenv.el - -(autoload 'virtualenv-workon "virtualenv" "\ -Activate a virtual environment for python. -Optional argument ENV if non-nil, either use the string given as -the virtual environment or if not a string then query the user. - -\(fn &optional ENV)" t nil) - -(autoload 'virtualenv-deactivate "virtualenv" "\ - - -\(fn)" t nil) - -(autoload 'virtualenv-minor-mode "virtualenv" "\ -Toggle Virtualenv minor mode on or off. -With a prefix argument ARG, enable Virtualenv minor mode if ARG is -positive, and disable it otherwise. If called from Lisp, enable -the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. -\\{virtualenv-minor-mode-map} - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("virtualenv-pkg.el") (20848 3772 415174)) - -;;;*** - -(provide 'virtualenv-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; virtualenv-autoloads.el ends here diff --git a/emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.el b/emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.el deleted file mode 100644 index e27b96d..0000000 --- a/emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "virtualenv" "1.2" "Virtualenv for Python -*- coding: utf-8 -*-" (quote nil)) diff --git a/emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.elc b/emacs.d/elpa/virtualenv-1.2/virtualenv-pkg.elc deleted file mode 100644 index 9806f2e621f60adae06f5387fa6f36d6cde596ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 642 zcmbtRJ#WG=6lBgH==zkYt%yU?4nURyVnAvoq|)vW+es`OJF*=r`s@1$h*EXLgQfT3 zyYpSKd|liP27{<53Ru{tRay$z9$@Qa2pUZ#ta+Iq3!l6ppIf_2*3L3*Icl&5HgyNH z) -;; Maintainer: Aaron Culich -;; Version: 1.2 -;; Created: September 2010 -;; Updated: September 2012 -;; Keywords: python virtualenv -;; Vcs-git: git://github.com/aculich/virtualenv.git -;; Vcs-Browser: http://github.com/aculich/virtualenv - -;; virtualenv.el 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. -;; -;; virtualenv.el 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 virtualenv.el. If not, see . - -;;; Commentary: - -;; This is a minor mode for setting the virtual environment for the -;; Python shell using virtualenv and supports both python-mode.el and -;; python.el. This minor mode was inspired by an earlier -;; implementation by Jesse Legg and Jeremiah Dodds, however this code -;; is a complete re-write with a GPLv3 license consistent with -;; GNU Emacs and python-mode.el. - -;; There are two ways to use virtualenv. - -;; 1) The quickest way to get started is to simply type: -;; M-x virtualenv-workon -;; Which will prompt you to enter the name of a directory in -;; ~/.virtualenvs that contains your chosen environment. You can -;; hit tab to show the available completions. - -;; You'll know that you're in virtualenv mode now when you see the -;; name of the virtualenv you selected in brackets. So if I were to -;; select my turbogears environment that I call tg2.1 then I would -;; see [tg2.1] appear in the mode line. To make sure you're new -;; python shell is set up correctly you can try running this little -;; snippet of python code: - -;; import os, sys -;; print os.environ -;; print sys.path - -;; 2) The recommended way to use virtualenv minor mode is to use a -;; .dir-locals.el file in the root of your project directory, however that -;; requires Emacs 23.1 or higher. There are two buffer-local variables that you -;; can set for virtualenv as shown in this example: - -;; in file /path/to/project/.dir-locals.el: -;; ((nil . ((virtualenv-workon . "tg2.1") -;; (virtualenv-default-directory . "/path/to/project/subdir")))) - -;; The .dir-locals.el is new in Emacs23 and is useful for other -;; things, too. You should read the dir-locals docs to understand the -;; format. The variable virtualenv-workon should just be a string the -;; same as you'd give to the interactive function. The variable -;; virtualenv-default-directory is useful when you want to have your -;; python process rooted in a particular directory when it starts, so -;; that no matter where you are in your project's hierarchy, if you -;; launch a python shell. This method is recommended because it is -;; more flexible and will allow multiple virtualenvs running at once -;; in future versions. - -;;; Bugs: - -;; All bug reports can be filed by opening a new issue on github at: -;; http://github.com/aculich/virtualenv/issues - -;;; TODO: - -;; * support for multiple python processes in different virtualenvs - -;; * add "paster shell" features - -;; * add support for shell-command - -;;; Code: - -(defgroup virtualenv nil - "Emacs support for python virtualenv." - :group 'python) - -(defcustom virtualenv-root - (or (getenv "WORKON_HOME") "~/.virtualenvs") - "Default location for user's virtual environments" - :group 'virtualenv - :type 'directory) - -(defcustom virtualenv-mode-string-format " [%s]" - "Format for the mode string. It should start with a space." - :group 'virtualenv - :type 'string) - -(defcustom virtualenv-workon-starts-python t - "If non-nil the `virtualenv-workon' will also start python." - :group 'virtualenv - :type 'boolean) - -(defvar virtualenv-mode-name-default " Virtualenv" - "The default name in the mode line in case `virtualenv-workon' is not set. -In practice you should never see this in the mode line, but it is -better to use this than for it to appear blank.") - -(defvar virtualenv-mode-name virtualenv-mode-name-default) - -(defvar virtualenv-executables-dir - (if (eq system-type 'windows-nt) "/Scripts" "/bin") - "The name of the directory containing executables. It is system -dependent.") - -(defvar virtualenv-default-directory nil - "Buffer-local variable that should be set in your project's -top-level .dir-locals.el file as the place you want to start the python shell. -When using paster set this to where your .ini files live, e.g.: \ -((nil . ((virtualenv-default-directory . \"/projects/foo\"))))") -(put 'virtualenv-default-directory 'safe-local-variable 'stringp) - -(defvar virtualenv-workon nil - "Buffer-local variable that should be set in your project's -top-level .dir-locals.el file, e.g.: \ -((nil . ((virtualenv-workon . \"tg2.1\"))))") -(put 'virtualenv-workon 'safe-local-variable 'stringp) - -(defvar virtualenv-workon-session nil - "The virtualenv that this emacs session will workon.") -(put 'virtualenv-default-directory 'risky-local-variable 'stringp) - -(defvar virtualenv-workon-history nil - "History list of virtual environments used.") - -(defvar virtualenv-saved-path nil - "Saves `exec-path' and the `PATH' environment variable when - invoking `virtualenv-workon'.") - -(defun virtualenv-formatted-mode-string (&optional name) - "Format the `virtualenv-mode-name' string. -Optional argument NAME is a string that will appear as [NAME] in -the mode line, however if NAME begins with a space the string -will be used verbatim. If NAME is nil and `virtualenv-workon' is -not set, then use `virtualenv-mode-name-default'." - (let* ((name (or name - virtualenv-workon-session - virtualenv-workon - virtualenv-mode-name-default))) - (if (string= " " (substring name 0 1)) - name - (format virtualenv-mode-string-format name)))) - -(defun virtualenv-update-mode-name (&optional name) - "Update the mode line with a string formatted for virtualenv. -Optional argument NAME is a string that will appear as [NAME] in -the mode line, however if NAME begins with a space the string -will be used verbatim. If NAME is nil and `virtualenv-workon' is -not set, then use `virtualenv-mode-name-default'." - (let ((string (virtualenv-formatted-mode-string name))) - (make-local-variable 'virtualenv-mode-name) - (setq virtualenv-mode-name string))) - -(defalias 'virtualenv-old-hack-dir-local-variables (symbol-function 'hack-dir-local-variables)) - -;;;###autoload -(defun virtualenv-workon (&optional env) - "Activate a virtual environment for python. -Optional argument ENV if non-nil, either use the string given as -the virtual environment or if not a string then query the user." - (interactive "P") - - ;; reset virtualenv-workon-session if env is non-nil and also not a - ;; string (e.g. invoked interactively with C-u prefix arg) - (when (and env (not (stringp env))) - (setq virtualenv-workon-session nil)) - - (defalias 'hack-dir-local-variables 'virtualenv-hack-dir-local-variables) - - ;; if env is a string, then just use it, otherwise check to see if - ;; we have already queried the user the session, at last querying - ;; the user if all else fails. - (let ((env - (cond - ((stringp env) env) - ((stringp virtualenv-workon-session) - virtualenv-workon-session) - (t - (let* ((default (car virtualenv-workon-history)) - (root (or (unless (file-directory-p virtualenv-root) - (let ((dir (read-directory-name - "Virtualenv Directory: " - (expand-file-name "~")))) - (funcall - (if (y-or-n-p - (format - "Save %s as virtualenv-root for future sessions?" - dir)) - 'customize-save-variable - 'customize-set-variable) - 'virtualenv-root - dir))) - virtualenv-root)) - (prompt (concat - "Virtualenv to activate" - (when default - (format " (default %s)" default)) - ": ")) - ;; look for directories in virtualenv-root that - ;; contain a bin directory for tab-completion - (dirs (remove - nil - (mapcar - (lambda (d) - (when (file-exists-p - (expand-file-name - (concat d virtualenv-executables-dir) - root)) - d)) - (directory-files root nil "^[^.]")))) - (result (completing-read prompt dirs nil t nil - 'virtualenv-workon-history - default))) - - ;; if the user entered nothing, then return the default - ;; if there is one - (if (not (string= result "")) - result - default)))))) - - (let* ((buffer (get-buffer "*Python*")) - (kill (or (when buffer - (yes-or-no-p - "Python process already running. Kill? "))))) - - (if (or (not buffer) kill) - (progn - (when buffer - (kill-buffer buffer)) - (setq virtualenv-workon-session env) - (let* ((bin (expand-file-name - (concat env virtualenv-executables-dir) - virtualenv-root)) - (oldpath (or (car virtualenv-saved-path) - (getenv "PATH"))) - (oldexec (or (cdr virtualenv-saved-path) - exec-path))) - (setq virtualenv-saved-path (cons oldpath oldexec)) - (add-to-list 'exec-path bin) - (setenv "PATH" - (if (eq system-type 'windows-nt) - (concat bin path-separator - (replace-regexp-in-string - (regexp-quote "/") "\\" oldpath)) - (concat bin path-separator oldpath)))) - (when virtualenv-workon-starts-python - (cond ((fboundp 'python-shell-switch-to-shell) - (python-shell-switch-to-shell)) - ((fboundp 'py-shell) - (py-shell)) - ((fboundp 'python-shell) - (python-shell)) - ((fboundp 'run-python) - (run-python)) - (t (error "Could not start a python shell!")))) - (message (format "Now using virtualenv: %s" env))) - (message "Not changing virtualenv"))))) - -;;;###autoload -(defun virtualenv-deactivate () - (interactive) - - (defalias 'hack-dir-local-variables (symbol-function 'virtualenv-old-hack-dir-local-variables)) - - (when virtualenv-saved-path - (setenv "PATH" (car virtualenv-saved-path)) - (setq exec-path (cdr virtualenv-saved-path))) - - (setq virtualenv-workon-session nil - virtualenv-saved-path nil) - (virtualenv-minor-mode 0)) - -;;;###autoload -(define-minor-mode virtualenv-minor-mode - nil ; use default docstring - nil ; the initial value - virtualenv-mode-name ; mode line indicator - nil ; keymap - :group 'virtualenv) ; group - -(defun virtualenv-minor-mode-on () - (interactive) - (when (or virtualenv-workon-session - virtualenv-workon) - (virtualenv-minor-mode t))) - -(add-hook 'virtualenv-minor-mode-hook 'virtualenv-update-mode-name) -(add-hook 'find-file-hook 'virtualenv-minor-mode-on t) - -;; This provides support for both python-mode.el and python.el by -;; adding defadvice to py-shell and python-shell. -(dolist (list '((python-shell-switch-to-shell . "python") - (py-shell . "python-mode") - (python-shell . "python") - (run-python . "python"))) - (let* ((func (car list)) - (file (cdr list)) - (doc (format "Set the environment with virtualenv before running %s." func))) - - (eval-after-load file -`(progn - -(defadvice ,func (around virtualenv activate) - ,doc - (let ((workon (or virtualenv-workon-session - virtualenv-workon))) - (if workon - (progn - (when (stringp virtualenv-default-directory) - (cd virtualenv-default-directory)) - (let* ((activate (expand-file-name - "activate" - (expand-file-name - (concat workon virtualenv-executables-dir) - virtualenv-root))) - (process-environment - (when (file-exists-p activate) - (split-string - (shell-command-to-string - (if (eq system-type 'windows-nt) - (format "call %s & cd %s && set" - activate default-directory) - (format "source %s; (cd %s && env)" - activate default-directory))) - "\n"))) - (exec-path (split-string (getenv "PATH") path-separator))) - ad-do-it - (hack-local-variables) - (virtualenv-minor-mode-on) - )) - ad-do-it))) - - -)))) - - -;; This is a hack on top of a hack, but it's the way I think dir-local -;; variables should work. The original implementation only loads -;; dir-locals if the buffer has a filename associated with it, however -;; for a python comint buffer or for dired, a call to -;; (buffer-file-name) returns nil. In that case we should use the -;; value of default-directory to check for the presence of -;; .dir-locals.el. This should actually have no effect on any existing -;; code because this hack-local-variables is only added to the -;; find-file-hook, so we can selectively enable this for other buffers -;; that we create, like python shells or dired. - -(defcustom virtualenv-enable-local-variables :all - "Defaults to :all and allows `virtualenv-hack-dir-local-variables' -to override the value of `enable-local-variables' for convenience when -`virtualenv-workon' is enabled." - :risky t - :type '(choice (const :tag "Query Unsafe" t) - (const :tag "Safe Only" :safe) - (const :tag "Do all" :all) - (const :tag "Use value of `enable-local-variables'" nil) - (other :tag "Query" other)) - :group 'virtualenv) - -(defun virtualenv-hack-dir-local-variables () - "Read per-directory local variables for the current buffer. -Store the directory-local variables in `dir-local-variables-alist' -and `file-local-variables-alist', without applying them." - (let ((path (or (buffer-file-name) - default-directory))) - (when (and (or virtualenv-enable-local-variables - enable-local-variables) - path - (not (file-remote-p path))) - ;; Find the variables file. - (let ((variables-file (dir-locals-find-file path)) - (class nil) - (dir-name nil)) - (cond - ((stringp variables-file) - (setq dir-name (file-name-directory path)) - (setq class (dir-locals-read-from-file variables-file))) - ((consp variables-file) - (setq dir-name (nth 0 variables-file)) - (setq class (nth 1 variables-file)))) - (when class - (let ((variables - (dir-locals-collect-variables - (dir-locals-get-class-variables class) dir-name nil))) - (when variables - (dolist (elt variables) - (unless (memq (car elt) '(eval mode)) - (setq dir-local-variables-alist - (assq-delete-all (car elt) dir-local-variables-alist))) - (push elt dir-local-variables-alist)) - ;; override enable-local-variables with - ;; virtualenv-enable-local-variables if set - (let ((enable-local-variables - (or virtualenv-enable-local-variables - enable-local-variables))) - (hack-local-variables-filter variables dir-name))))))))) - -(defvar virtualenv-dir-local-not-supported - (cond ((featurep 'xemacs) - "XEmacs is not officially supported.") - ((not (and (>= emacs-major-version 23) - (>= emacs-minor-version 1))) - "Emacs 23.1 is required for .dir-locals.el support."))) - -(eval-after-load "dired" - '(progn - (unless virtualenv-dir-local-not-supported - (add-hook 'dired-mode-hook 'hack-local-variables)) - (add-hook 'dired-mode-hook 'virtualenv-minor-mode-on t))) - -(provide 'virtualenv) - -;;; virtualenv.el ends here diff --git a/emacs.d/elpa/virtualenv-1.2/virtualenv.elc b/emacs.d/elpa/virtualenv-1.2/virtualenv.elc deleted file mode 100644 index 4967ca4fcd9d1ab3080adaab08127ea7378b1136..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10735 zcmeHN`*YjYm1g&cU5TD>-Pq11ZKGa6Ym;;giU9bK;2Mv<3h zi6361573&VnQ%uV?0&J1b=V?Qe=m)}3;z?(593`0;M~R5%*#wd*I<^dPqDQN?X7ymuZHs4e z?9PG=?D1H3JR0Ik>X5h63<1^flPH|ZFiU^CM$@I6`0hDWtwffYL=aTH0ZJMdGQ$MI z_|vOzzI^raKfZYN)pMgMjGqo$1$8Oj)Efu?E?T13Ic_dUEqaKPY#w8ck)KE}i;_9h ze=L3nD3n zW!9>`2t`cR>3dSlqggJPP{Iz;Ltdq!h>W&_G z@5V8VS)9Xtz9)Wxawuo6#^m5wnzRvEl+t@cyj}P|Lue*h$5yj>?f7daCGPdR%sggV zG-jqPR5$lvaDhVpD7{%m_LH*0f(hw7&E&K?lCca&u({1!DGf9+vuK>pGiiFH|HjVH zXk><#`FQYUdj*6>D2^jBDIJ*{R@YzB~dAX*?=O_3td zs4(HC%&0hkfwGodxu6S@RhB@Sr!_jA$RKD{|1^<^11T{wcEL4LB@7@{!lOn9C| zwEWQLHBu4ym-2y-t&7%)Xf((YTey}CQL6@VRk<2;Fb?$|(!+5S8BP4#s9@`3X#uTP zeY;C)6+@-VzH)s`J$1)YF~?l+x2_yX%(m$q|DQ?WTHYx4LJY|+fC08MLU$~7Z(G*J z-Rq8jcgtOe4XTh6#0-UFSu>u2=u?I#>_FADn@vZxnR)*bjZU}!GbNPx>HGP0BI^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L6G8K6LRnIt|?DOblh*5Z8Roq}Ae6}>tad!a?BsQEGkFZuZ5U5R#O0d+b%$l>bG zJm25Eq^R@O^r89D(QzAx=6vLX)Khst1y`3V+`uC()bX0eEz{fZdPEK*iAIvFX1trt1<mz7b=Ifd;eV7`GnDC=U*#a zkEDvBLJE9`j{V(z0=~dEXh9%t6ZR#PYgxbflz#Vaa<#BSjrQ*TZCsq%&HXzVWIwIc zZc^pZp_{?&+Rf9!oe$J(HdP2M)I~AHr!_=sr+3<N4ExO?moi%&Yb4#)ou-HcZSACcWSq4cb?#Ko6*2WG_*4U9N?29%+ash zAZ*dc0w`ZLo1f+N|22=s-lgoJw^+`W*CcyJarlr4l^9h?C{@K+_EdMmM+`9)9h9b| z=%QhSiq=#^qIpVcTI$S|IZCm3=JGUNg!IcRDq<Z}{QHOrR*N&UzNGn9GYfDqqD_$ZxO=0ER|6 zvk;%mETv^z*+Dft#-RN5m_B7yFE)lnxX^2c6s}XVhYviFYyhti`n#mKR&?THr~d(5 CDXy{r diff --git a/gitconfig b/gitconfig index 83dcebd..76b8090 100644 --- a/gitconfig +++ b/gitconfig @@ -2,7 +2,7 @@ name = brettlangdon email = brett@blangdon.com [credential] - helper = osxkeychain + helper = store [core] excludesfile = /Users/brettlangdon/.gitignore_global editor = emacs diff --git a/postactivate b/postactivate deleted file mode 100755 index dfff46f..0000000 --- a/postactivate +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/zsh -# This hook is run after every virtualenv is activated. - -proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') -if [ -d ~/Magnetic/$proj_name ] -then - cd ~/Magnetic/$proj_name -elif [ -d ~/src/$proj_name ] -then - cd ~/src/$proj_name -fi diff --git a/setup.sh b/setup.sh index be68b57..aaa8a19 100755 --- a/setup.sh +++ b/setup.sh @@ -34,29 +34,5 @@ for file in $files; do fi done -echo "Installing Elpy" -sudo pip install elpy jedi - -echo "Installing Virtualenvwrapper" -sudo pip install virtualenvwrapper - -echo "Setting up $WORKON_HOME" -WORKON_HOME=~/environments -mkdir -p $WORKON_HOME -file="postactivate" -if [ -e $file ] -then - echo "Moving $WORKON_HOME/$file to $olddir/$file" - mv $WORKON_HOME/$file $olddir - echo "Creating symlink to $file in $WORKON_HOME directory." - ln -s $dir/$file $WORKON_HOME/$file -fi - -echo "Setting up GOPATH" -mkdir -p $GOPATH - -echo "Setting up CHEF_PATH" -mkdir -p $CHEF_PATH - echo "Source ~/.zshrc" . ~/.zshrc diff --git a/zshrc b/zshrc index f619b7b..15f9953 100644 --- a/zshrc +++ b/zshrc @@ -2,21 +2,11 @@ ZSH=$HOME/.oh-my-zsh ZSH_THEME="bira" DISABLE_AUTO_UPDATE="true" COMPLETION_WAITING_DOTS="true" -plugins=(git brew pip python node npm urltools golang knife) +plugins=(git pip python node npm) source $ZSH/oh-my-zsh.sh -export PATH=/usr/local/Cellar/ruby/1.9.3-p374/bin:/usr/local/bin:/usr/local/sbin:$PATH -export WORKON_HOME=~/environments -alias up="vagrant up && vagrant ssh" -source /usr/local/bin/virtualenvwrapper.sh +export PATH=/usr/local/bin:/usr/local/sbin:$PATH export NODE_PATH=/usr/local/lib/node_modules -export GOPATH=$HOME/go -export PATH=$PATH:$GOPATH/bin -export CHEF_PATH=~/Magnetic/chef-repo unsetopt inc_append_history unsetopt share_history # share command history data -alias cr="codereivew" -alias crr="codereview --reviewers" -alias cri="codereview --issue" -alias vagrant_restart="sudo /Library/StartupItems/VirtualBox/VirtualBox restart"