diff --git a/Cask b/Cask index a3bdf7bb4..8aa518dcc 100644 --- a/Cask +++ b/Cask @@ -3,151 +3,53 @@ (source marmalade) (source gnu) -;; Essentials -(depends-on "cask") +;; Core (depends-on "dash") (depends-on "s") (depends-on "f") -(depends-on "deferred") -(depends-on "fuzzy") (depends-on "use-package") -(depends-on "smex") -(depends-on "pos-tip") -(depends-on "nlinum") -(depends-on "vim-empty-lines-mode") -(depends-on "hlinum" :git "https://github.com/tom-tan/hlinum-mode") +(depends-on "popwin") +(depends-on "help-fns+") -;; Themes -(depends-on "solarized-theme") - -;; OSX +;; OSX --- core-osx.el (depends-on "exec-path-from-shell") (depends-on "dash-at-point") -;; Core -(depends-on "shut-up") -(depends-on "popwin") -(depends-on "saveplace") - -;; Editing +;; UI --- core-ui.el +(depends-on "nlinum") (depends-on "smart-mode-line") -(depends-on "dired+") -(depends-on "expand-region") -(depends-on "flycheck") -(depends-on "flyspell") -(depends-on "rainbow-delimiters") -(depends-on "smartparens") -(depends-on "yasnippet") -(depends-on "diff-hl") -(depends-on "ace-jump-mode") -(depends-on "ace-window") -(depends-on "ace-link") -(depends-on "pcre2el") -(depends-on "emr") -(depends-on "smart-forward") -(depends-on "anzu") -(depends-on "iedit") -(depends-on "quickrun") -(depends-on "goto-last-change") -;; Auto-completion -(depends-on "company") -(depends-on "company-c-headers") -(depends-on "company-cmake") -(depends-on "company-tern") -(depends-on "company-anaconda") -(depends-on "company-inf-ruby") -(depends-on "company-statistics") - -;; Eeeevil +;; Evil --- core-editor.el (depends-on "evil") -(depends-on "evil-search-highlight-persist") +(depends-on "evil-anzu") (depends-on "evil-commentary") -(depends-on "evil-matchit") -(depends-on "evil-numbers") (depends-on "evil-exchange") -(depends-on "evil-visualstar") +(depends-on "evil-iedit-state") (depends-on "evil-indent-textobject") (depends-on "evil-jumper") -(depends-on "evil-iedit-state") -(depends-on "evil-anzu") +(depends-on "evil-matchit") +(depends-on "evil-numbers") +(depends-on "evil-search-highlight-persist") (depends-on "evil-snipe") -(depends-on "evil-surround") (depends-on "evil-space") +(depends-on "evil-surround" :git "https://github.com/hlissner/evil-surround") +(depends-on "evil-visualstar") +(depends-on "evil-plugins" :git "https://github.com/tarao/evil-plugins") -;; Project management -(depends-on "projectile") -(depends-on "helm") -(depends-on "helm-ag") -(depends-on "helm-css-scss") -(depends-on "helm-projectile") -(depends-on "helm-swoop") -(depends-on "helm-company") -(depends-on "helm-c-yasnippet") -(depends-on "neotree" :git "https://github.com/jeffplang/emacs-neotree") -(depends-on "ido-ubiquitous") -(depends-on "ido-vertical-mode") -(depends-on "flx-ido") -(depends-on "workgroups2") -(depends-on "xcscope") +;; Editor --- core-editor.el +(depends-on "ace-jump-mode") +(depends-on "ace-link") +(depends-on "ace-window") +(depends-on "emr") +(depends-on "expand-region") +(depends-on "goto-last-change") +(depends-on "hl-todo" :git "https://github.com/tarsius/hl-todo") +(depends-on "rainbow-delimiters") +(depends-on "rotate-text" :git "https://github.com/debug-ito/rotate-text.el") +(depends-on "smart-forward") +(depends-on "smartparens") +(depends-on "smex") -;; Modes/mode-specific -(depends-on "org-plus-contrib") -(depends-on "org-opml" :git "https://github.com/edavis/org-opml") -;(depends-on "org-present") - -(depends-on "rainbow-mode") -(depends-on "lua-mode") -(depends-on "haml-mode") -(depends-on "scss-mode") -(depends-on "sass-mode") -(depends-on "sws-mode") -(depends-on "json-mode") -(depends-on "yaml-mode") -(depends-on "markdown-mode") -(depends-on "glsl-mode") -(depends-on "groovy-mode") -(depends-on "swift-mode") -;; (depends-on "haxe-mode") -(depends-on "go-mode") - -(depends-on "php-mode") -(depends-on "php-refactor-mode") -(depends-on "php-extras" :git "https://github.com/arnested/php-extras") - -(depends-on "web-mode") -(depends-on "emmet-mode") -(depends-on "web-beautify") - -(depends-on "tern") -(depends-on "js2-mode") -(depends-on "js2-refactor") - -(depends-on "enh-ruby-mode") -(depends-on "ruby-refactor") -(depends-on "rspec-mode") -(depends-on "inf-ruby") -(depends-on "robe") - -(depends-on "anaconda-mode") - -(depends-on "omnisharp") -(depends-on "csharp-mode") -(depends-on "emacs-eclim") - -(depends-on "git-commit-mode") -(depends-on "git-rebase-mode") -(depends-on "gitconfig-mode") -(depends-on "gitignore-mode") - -(depends-on "applescript-mode") -(depends-on "cmake-mode") - -(depends-on "rust-mode") -(depends-on "d-mode") -(depends-on "android-mode") - -(depends-on "vimrc-mode") - -;(depends-on "osh") -;(depends-on "sonic-pi" :git "https://github.com/repl-electric/sonic-pi.el") +;; OTHER +;;(depends-on "shaderlab-mode" :git "https://bitbucket.org/bbbscarter/emacs-shaderlab-mode") +;;(depends-on "unityjs-mode" :git "https://github.com/naruse/EmacsUnityScript") diff --git a/Makefile b/Makefile index 6affd5c71..715754275 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,11 @@ -EMACS=emacs -all: update - -update: install autoloads - cask update +all: install update install: - cask install + @cask install -compile: clean - @cask exec ${EMACS} -f narf::byte-compile +update: + @cask update -clean: clean-extras - @rm -rf init.elc init/*.elc contrib/*.elc core/*.elc - -clean-extras: - @rm -rf auto-save-list recentf places ido.last async-bytecomp.log elpa projectile-bookmarks.eld projectile.cache company-statistics-cache.el tramp smex-items semanticdb - -autoloads: - @rm -rf core/autoloads.el - @cask exec ${EMACS} -Q --batch --eval $$'(progn (setq generated-autoload-file "~/.emacs.d/core/autoloads.el") (update-directory-autoloads "~/.emacs.d/init" "~/.emacs.d/core" "~/.emacs.d/contrib"))' +clean: + @rm -f init.elc {core,modules,private,contrib}/*.elc diff --git a/README.md b/README.md index 2f20d2dbf..e69de29bb 100644 --- a/README.md +++ b/README.md @@ -1,55 +0,0 @@ -# NARF Emacs - -![Screenshot](screenshots/01.png) - -> What we do every night, Pinky... - -This is emacs for the stubborn vimmer, megalomaniac mouse and masochists alike. -It has been configured first: to emulate vim as best it can, and second: to -surpass it in any way possible; all this is built on top of -[Evil-mode](https://gitorious.org/evil/pages/Home), a vim emulator for emacs. - -This has only been tested on Emacs 24.5 on OSX, YMMV. - -Any contributions or suggestions are welcome. The world won't take over itself. - -## Installation - -`brew install cask` - -Narf only requires [Cask](https://github.com/cask/cask) for managing its plugins -outside of emacs. - -Also, though not strictly a requirement, I recommend the railwaycat/emacsmacport -build of emacs for OSX users, which you can get via homebrew: - -```sh -brew tap railwaycat/emacsmacport -brew install emacs-mac -``` - -Lastly, a recursive clone will get everything you need: - -``` -git clone --recursive https://github.com/hlissner/emacs.d ~/.emacs.d -cd ~/.emacs.d -make # installs plugins via cask and generates autoloads -make compile # optional -``` - -## Features - -A summary of what to expect can be found in these three files: - -``` -./Cask # what packages are included -./init/narf-commands.el # what custom ex commands are defined -./init/narf-bindings.el # the keybindings -``` - -## Disclaimer - -I am not an elisp guru. You have been warned. - -## What about Windo- -![Windows, you say...](http://i3.kym-cdn.com/photos/images/newsfeed/000/549/293/504.gif) diff --git a/contrib/company-dict/README.md b/contrib/company-dict/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/contrib/company-dict/company-dict.el b/contrib/company-dict/company-dict.el new file mode 100644 index 000000000..e69de29bb diff --git a/contrib/evil-ex-registers.el b/contrib/evil-ex-registers.el deleted file mode 100644 index c0ef37dcf..000000000 --- a/contrib/evil-ex-registers.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; evil-ex-registers.el --- Command to paste from register in ex mode - -;; Author: INA Lintaro -;; URL: http://github.com/tarao/evil-plugins -;; Version: 0.1 -;; Keywords: evil, plugin - -;; This file is NOT part of GNU Emacs. - -;;; License: -;; -;; 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 . - -;;; Code: - -(require 'evil) -(eval-when-compile (require 'cl)) - -(defalias 'evil-orig-get-register (symbol-function 'evil-get-register)) - -(defun evil-get-spec-register (register &optional noerror) - "Return contents of REGISTER. -Signal an error if empty, unless NOERROR is non-nil. - -Support some registers listed below in addition to -`evil-get-register'. -  the file name under the cursor -  the expanded file name under the cursor -  the word under the cursor -  the WORD under the cursor" - (cond - ((or (= register ?\C-f) ; ^F the filename under the cursor - (= register ?\C-p)) ; ^P the expanded filename under the cursor - (let ((file (thing-at-point 'filename))) - (or (and file (= register ?\C-p) (expand-file-name file)) file))) - ((or (= register ?\C-w) ; ^W the word under the cursor - (= register ?\C-a)) ; ^A the WORD under the cursor - (let* ((word (if (= register ?\C-a) #'evil-move-WORD #'evil-move-word)) - (range (evil-inner-object-range nil nil nil nil word))) - (filter-buffer-substring (nth 0 range) (nth 1 range)))) - (t (evil-orig-get-register register noerror)))) - -(defun evil-ex-paste-from-register (&optional register) - "Paste from REGISTER in command line." - (interactive) - (cl-flet ((evil-get-register (register &optional noerror) - (with-current-buffer evil-ex-current-buffer - (evil-get-spec-register register noerror)))) - (if (called-interactively-p 'any) - (call-interactively #'evil-paste-from-register) - (evil-paste-from-register register)))) - -(provide 'evil-ex-registers) -;;; evil-ex-registers.el ends here diff --git a/contrib/flycheck-objc.el b/contrib/flycheck-objc.el deleted file mode 100644 index 11b7799fc..000000000 --- a/contrib/flycheck-objc.el +++ /dev/null @@ -1,168 +0,0 @@ -;;; flycheck-objc.el --- Flycheck for objc-mode. -*- lexical-binding: t; -*- - -;; Copyright (C) 2014 Rafal Kowalski - -;; Author: Rafal Kowalski -;; Keywords: c, tools - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Flycheck settings for objc-mode. - -;;; Code: - -(require 'flycheck) - -(flycheck-def-option-var flycheck-objc-clang-definitions nil objc-clang - "Additional preprocessor definitions for Clang. - -The value of this variable is a list of strings, where each -string is an additional definition to pass to Clang, via the `-D' -option." - :type '(repeat (string :tag "Definition")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-include-path nil objc-clang - "A list of include directories for Clang. - -Thae value of this variable is a list of strings, where each -string is a directory to add to the include path of Clang. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(flycheck-def-option-var flycheck-objc-clang-framework-path nil objc-clang - "A list of frameworks for Clang. - -Thae value of this variable is a list of strings, where each -string is a path to a frameworks directory to add to the frameworks -path of Clang. Relative paths are relative to the file being -checked." - :type '(repeat (directory :tag "Framework directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(flycheck-def-option-var flycheck-objc-clang-includes nil objc-clang - "A list of additional include files for Clang. - -The value of this variable is a list of strings, where each -string is a file to include before syntax checking. Relative -paths are relative to the file being checked." - :type '(repeat (file :tag "Include file")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-language-standard nil objc-clang - "The language standard to use in Clang. - -The value of this variable is either a string denoting a language -standard, or nil, to use the default standard. When non-nil, -pass the language standard via the `-std' option." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Language standard")) - :safe #'stringp - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-standard-library nil objc-clang - "The standard library to use for Clang. - -The value of this variable is the name of a standard library as -string, or nil to use the default standard library. - -Refer to the Clang manual at URL -`http://clang.llvm.org/docs/UsersManual.html' for more -information about the standard library." - :type '(choice (const "libc++") - (const :tag "GNU libstdc++" "libstdc++") - (string :tag "Library name")) - :safe #'stringp - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-archs nil objc-clang - "What architectures to use for clang. - -When non-nil, set the architectures, via `-arch'." - :type '(repeat (file :tag "Architecture")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-sysroot nil objc-clang - "The system root to use in clang. - -When non-nil,pass the language standard via the `-isysroot' option." - :type '(choice (const :tag "Default sysroot" nil) - (string :tag "Sysroot")) - :safe #'stringp - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-objc-clang-warnings '("all" "extra") objc-clang - "A list of additional warnings to enable in Clang. - -The value of this variable is a list of strings, where each string -is the name of a warning category to enable. By default, all -recommended warnings and some extra warnings are enabled (as by -`-Wall' and `-Wextra' respectively). - -Refer to the Clang manual at URL -`http://clang.llvm.org/docs/UsersManual.html' for more -information about warnings." - :type '(choice (const :tag "No additional warnings" nil) - (repeat :tag "Additional warnings" - (string :tag "Warning name"))) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(flycheck-define-checker objc-clang - "A objc syntax checker using Clang. - -See URL `http://clang.llvm.org/'." - :command ("clang" - "-fsyntax-only" - "-fno-color-diagnostics" ; Do not include color codes in output - "-fno-caret-diagnostics" ; Do not visually indicate the source - ; location - "-fno-diagnostics-show-option" ; Do not show the corresponding - ; warning group - (option "-isysroot" flycheck-objc-clang-sysroot) - (option-list "-arch" flycheck-objc-clang-archs) - (option "-std=" flycheck-objc-clang-language-standard) - (option "-stdlib=" flycheck-objc-clang-standard-library) - (option-list "-include" flycheck-objc-clang-includes) - (option-list "-W" flycheck-objc-clang-warnings s-prepend) - (option-list "-D" flycheck-objc-clang-definitions s-prepend) - (option-list "-I" flycheck-objc-clang-include-path) - (option-list "-F" flycheck-objc-clang-framework-path) - "-x" (eval - (cl-case major-mode - (objc-mode "objective-c") - (c-mode "c"))) - ;; We must stay in the same directory, to properly resolve #include - ;; with quotes - source-inplace) - :error-patterns - ((info line-start (file-name) ":" line ":" column - ": note: " (message) line-end) - (warning line-start (file-name) ":" line ":" column - ": warning: " (message) line-end) - (error line-start (file-name) ":" line ":" column - ": " (or "fatal error" "error") ": " (message) line-end)) - :modes (c-mode objc-mode) - :next-checkers ((warnings-only . objc-cppcheck))) - -(provide 'flycheck-objc) -;;; objc-flycheck.el ends here diff --git a/contrib/help-fns+.el b/contrib/help-fns+.el deleted file mode 100644 index ce392936b..000000000 --- a/contrib/help-fns+.el +++ /dev/null @@ -1,2820 +0,0 @@ -;;; help-fns+.el --- Extensions to `help-fns.el'. -;; -;; Filename: help-fns+.el -;; Description: Extensions to `help-fns.el'. -;; Author: Drew Adams -;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com") -;; Copyright (C) 2007-2014, Drew Adams, all rights reserved. -;; Created: Sat Sep 01 11:01:42 2007 -;; Version: 0 -;; Package-Requires: () -;; Last-Updated: Sat Nov 29 10:23:35 2014 (-0800) -;; By: dradams -;; Update #: 1972 -;; URL: http://www.emacswiki.org/help-fns+.el -;; Doc URL: http://emacswiki.org/HelpPlus -;; Keywords: help, faces, characters, packages, description -;; Compatibility: GNU Emacs: 22.x, 23.x, 24.x, 25.x -;; -;; Features that might be required by this library: -;; -;; `backquote', `button', `bytecomp', `cconv', `cl', `cl-lib', -;; `gv', `help-fns', `help-mode', `info', `macroexp', `naked', -;; `wid-edit', `wid-edit+'. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Extensions to `help-fns.el'. Also includes a redefinition of -;; `describe-face', which is from `faces.el'. -;; -;; Note: As of Emacs 24.4, byte-compiling this file in one Emacs -;; version and using the compiled file in another Emacs version -;; does not work. -;; -;; -;; Keys bound here: -;; -;; `C-h B' `describe-buffer' -;; `C-h c' `describe-command' (replaces `describe-key-briefly') -;; `C-h o' `describe-option' -;; `C-h C-c' `describe-key-briefly' (replaces `C-h c') -;; `C-h C-o' `describe-option-of-type' -;; `C-h M-c' `describe-copying' (replaces `C-h C-c') -;; `C-h M-f' `describe-file' -;; `C-h M-k' `describe-keymap' -;; `C-h M-l' `find-function-on-key' -;; -;; Commands defined here: -;; -;; `describe-buffer', `describe-command', `describe-file', -;; `describe-keymap', `describe-option', `describe-option-of-type'. -;; -;; User options defined here: -;; -;; `help-cross-reference-manuals' (Emacs 23.2+). -;; -;; Faces defined here: -;; -;; `describe-variable-value' (Emacs 24+). -;; -;; Non-interactive functions defined here: -;; -;; `describe-mode-1', `help-all-exif-data', -;; `help-commands-to-key-buttons', `help-custom-type', -;; `help-documentation', `help-documentation-property', -;; `help-key-button-string', `help-remove-duplicates', -;; `help-substitute-command-keys', `help-value-satisfies-type-p', -;; `help-var-inherits-type-p', `help-var-is-of-type-p', -;; `help-var-matches-type-p', `help-var-val-satisfies-type-p', -;; `Info-first-index-occurrence' (Emacs 23.2+), -;; `Info-indexed-find-file' (Emacs 23.2+), `Info-indexed-find-node' -;; (Emacs 23.2+), `Info-index-entries-across-manuals' (Emacs -;; 23.2+), `Info-index-occurrences' (Emacs 23.2+), -;; `Info-make-manuals-xref' (Emacs 23.2+). -;; -;; Internal variables defined here: -;; -;; `Info-indexed-file' (Emacs 23.2+), `Info-indexed-nodes' (Emacs -;; 23.2+), `variable-name-history'. -;; -;; -;; ***** NOTE: The following command defined in `faces.el' -;; has been REDEFINED HERE: -;; -;; `describe-face'. -;; -;; -;; ***** NOTE: The following command defined in `help.el' -;; has been REDEFINED HERE: -;; -;; `describe-mode'. -;; -;; -;; ***** NOTE: The following functions defined in `help-fns.el' -;; have been REDEFINED HERE: -;; -;; `describe-function', `describe-function-1', `describe-variable', -;; `help-fns--key-bindings', `help-fns--signature', -;; -;; -;; ***** NOTE: The following command defined in `package.el' -;; has been REDEFINED HERE: -;; -;; `describe-package'. -;; -;; -;; Put this in your initialization file (`~/.emacs'): -;; -;; (require 'help-fns+) -;; -;; Acknowledgement: Passing text properties on doc strings to the -;; *Help* buffer is an idea from Johan bockgard. He sent it on -;; 2007-01-24 to emacs-devel@gnu.org, Subject -;; "display-completion-list should not strip text properties". -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Change Log: -;; -;; 2014/11/29 dadams -;; Info-make-manuals-xref: Control number of newlines before. -;; describe-function-1: Use same def for Emacs 25. -;; describe-variable-value: Changed the default colors. -;; describe-variable: Use face describe-variable-value always. Fill region for value always. -;; Control number of newlines before and after Value:, and after manuals xref. -;; -;; 2014/11/12 dadams -;; describe-package: -;; Added version for Emacs 24.4+ - Use package-alist, package--builtins, or package-archive-contents. -;; 2014/11/08 dadams -;; describe-mode-1: Show major-mode and mode-function also, on a separate line (Emacs bug #18992), filling. -;; 2014/08/10 dadams -;; describe-command: Bind completion-annotate-function for use with Icicles. -;; 2014/05/11 dadams -;; help-substitute-command-keys: Bug: \= was not being removed - C-h f replace-regexp showed \=\N, not \N. -;; Small loop for \=: changed \\\\=$ to \\\\=. -;; Main loop, when escaped (\=) and odd: Skip the \=: concat before \= with after \=. -;; 2014/05/04 dadams -;; Use called-interactively only for Emacs 23.2+, since we pass it an arg. -;; 2014/05/02 dadams -;; describe-package: Updated for Emacs 24.4 - defstruct package-desc. -;; 2014/04/21 dadams -;; with-selected-frame: Updated for Emacs 24.4. -;; describe-face: Updated for Emacs 24.4: Try face-at-point for read-face-name default. -;; describe-file, describe-keymap, describe-function: -;; Updated for Emacs 24.4: Use with-help-window, not with-output-to-temp-buffer. See bug #17109. -;; describe-function-1: Created version for Emacs 24.4+ -;; help-key-button-string: Do not quote :type. -;; describe-buffer, describe-mode-1, describe-function: Use called-interactively, if available. -;; Removed autoload cookie for describe-function, describe-keymap (but why?). -;; 2014/03/06 dadams -;; describe-variable: Fixed typo in regexp: [n] -> [\n]. -;; 2014/01/04 dadams -;; Added: describe-variable-value. -;; describe-variable (Emacs 24+): Highlight the value with face describe-variable-value. -;; 2013/08/06 dadams -;; describe-function: Ensure arg is a defined function before calling describe-function-1 (for Emacs 24+). -;; 2013/07/01 dadams -;; Revert the filling part of yesterday's update. -;; 2013/06/30 dadams -;; describe-variable for Emacs 24+: -;; Update for vanilla Emacs 24.4. Update for Emacs bug #14754: fill printed value so no long lines. -;; 2013/06/16 dadams -;; describe-(variable|option(-of-type)): Fixed for dumb variable-at-point, which returns 0 for no var. -;; 2013/04/29 dadams -;; describe-(function|command|variable|option|option-of-type): -;; Provide default only if symbol is of the right type. Put default in prompt. -;; 2013/02/08 dadams -;; describe-variable: Updated wrt Emacs 24 build of 2013-01-30. -;; 2012/11/18 dadams -;; describe-(variable|function): Add completion-candidate annotation: (option|comand). -;; 2012/10/28 dadams -;; help-fns--key-bindings: Fixed: forgot to mapconcat over keys. -;; 2012/10/26 dadams -;; Added: help-fns--key-bindings, help-fns--signature, -;; Added Emacs 24.3+ version of describe-function-1. Updated version for 23.2-24.2. -;; help-substitute-command-keys: Fix for \= when no match for \[, \<, \{ past it. -;; 2012/09/24 dadams -;; describe-file: Added optional arg NO-ERROR-P. -;; 2012/09/22 dadams -;; Info-index-occurrences, Info-first-index-occurrence: -;; Replace Info-directory call by short version. Better Searching msg. -;; 2012/09/21 dadams -;; Renamed Info-any-index-occurrences-p to Info-first-index-occurrence. -;; Info-any-index-occurrences-p: Return the first successful lookup, not t. -;; Info-index-entries-across-manuals, Info-index-occurrences, Info-any-index-occurrences-p: -;; Added optional arg INDEX-NODES. -;; Adjust calls to those fns accordingly, e.g., in define-button-type for help-info-manual-lookup -;; and help-insert-xref-button in Info-make-manuals-xref. -;; 2012/07/20 dadams -;; Added: describe-buffer, describe-mode-1. Bound describe-buffer to C-h B. -;; describe-mode: Redefined to use describe-mode-1. -;; 2012/07/03 dadams -;; Info-make-manuals-xref, Info-index-entries-across-manuals, Info-index-occurrences, -;; Info-any-index-occurrences-p: -;; Added optional arg NOMSG. -;; describe-(function|variable|file|package): No message if not interactive-p. -;; describe-function-1: pass MSGP to Info-make-manuals-xref (i.e. msg always). -;; describe-(mode|variable|face|keymap|package): Pass proper NOMSG arg to Info-make-manuals-xref. -;; 2012/01/11 dadams -;; describe-variable: Remove * from beginning of doc string. -;; 2011/11/25 dadams -;; Reverted yesterday's change and added IMPORTANT note to Commentary. -;; 2011/11/24 dadams -;; Added Emacs 24 version of with-help-window. They changed the signature of help-window-setup. -;; 2011/10/14 dadams -;; describe-mode: Call help-documentation while in mode's buffer, in case no \\<...>. -;; 2011/10/08 dadams -;; Info-make-manuals-xref: Do nothing if OBJECT is not a string or a symbol (e.g. is a keymap). -;; 2011/10/07 dadams -;; Added soft require of naked.el. -;; help-substitute-command-keys, describe-function-1: Use naked-key-description if available. -;; 2011/08/22 dadams -;; describe-variable (Emacs 23+): Added terpri after Value: (for multiline value). -;; 2011/07/25 dadams -;; describe-mode: -;; Put call to help-documentation inside let for maj: else major-mode gets changed to help-mode. -;; 2011/06/26 dadams -;; Added: help-commands-to-key-buttons, help-documentation(-property), -;; help-key-button-string, help-substitute-command-keys (Emacs 23+). -;; describe-(mode|variable|function-1|keymap) for Emacs 23+: -;; Use help-documentation (with insert and button arg), instead of documentation (with princ). -;; 2011/06/22 dadams -;; Info-make-manuals-xref: Added optional arg MANUALS. -;; 2011/06/20 dadams -;; Info(-any)-index-occurrences(-p): Fix pattern: remove arbitrary prefix [^\n]*. -;; Added, for Emacs 24+: describe-package. -;; 2011/06/14 dadams -;; Added, for Emacs 23.2+: describe-mode. -;; Info-make-manuals-xref: Added optional arg NO-NEWLINES-AFTER-P. -;; 2011/06/13 dadams -;; Added: Info-any-index-occurrences-p. -;; Info-make-manuals-xref: Use Info-any-index-occurrences-p, not Info-index-occurrences. -;; 2011/06/11 dadams -;; Added, for Emacs 23.2+: -;; describe-face, describe-function-1, help-cross-reference-manuals, Info-indexed-find-file, -;; Info-indexed-find-node, Info-index-entries-across-manuals, Info-index-occurrences, -;; Info-make-manuals-xref, Info-indexed-file, Info-indexed-nodes. -;; describe-keymap: Emacs 23.2+: Added link to manuals. -;; describe-variable: Updated Emacs 23 version, per vanilla. -;; Emacs 23.2+: Added link to manuals. -;; Require info.el for Emacs 23.2+. -;; 2011/04/25 dadams -;; describe-file: Incorporate autofile bookmark description. Added optional arg. -;; 2011/03/31 dadams -;; help-var-(matches|inherits)-type-p: Wrap string-match with save-match-data. -;; 2011/03/17 dadams -;; describe-file: Added clickable thumbnail image to the help for an image file. -;; 2011/03/02 dadams -;; Added: help-all-exif-data -;; describe-file: Show all EXIF data, using help-all-exif-data. -;; 2011/02/22 dadams -;; describe-file: Show also EXIF data for an image file. -;; 2011/01/04 dadams -;; Removed autoload cookies from non def* sexps and define-key. -;; 2010/02/12 dadams -;; Added variable-name-history. -;; 2009/08/30 dadams -;; describe-keymap: Don't print nil if the map has no doc. -;; 2009/05/26 dadams -;; describe-variable: Updated wrt latest Emacs 23: -;; Added file-name-non-directory; removed substitute-command-keys. -;; 2008/09/13 dadams -;; Updated for latest Emacs 23 CVS. -;; describe-variable: Create separate version for Emacs 23. -;; describe-function-1: No longer needed for Emacs 23, since my patch added. -;; Added: with-selected-frame, with-help-window, at least temporarily. -;; Require wid-edit.el. -;; 2008/09/02 dadams -;; describe-function-1, describe-variable: -;; Emacs 23 uses find-lisp-object-file-name. Thx to Per Nordlow. -;; 2008/08/19 dadams -;; describe-keymap: Use insert instead of princ for map part. Thx to Chong Yidong. -;; 2008/05/20 dadams -;; describe-function: Different prompt if prefix arg. -;; 2008/03/02 dadams -;; Moved describe-file here from misc-cmds.el. Bound to C-h M-f. -;; Require cl.el at compile time. -;; 2008/02/01 dadams -;; Bound M-l to find-function-on-key. -;; 2008/01/03 dadams -;; Added: describe-function-1. The redefinition fills overlong lines. -;; 2007/12/25 dadams -;; help-var-inherits-type-p: -;; Recheck var-type match after set var-type to its car. -;; Handle string (regexp) TYPES elements. -;; help-value-satisfies-type-p: Skip type check for string type (regexp). -;; help-var-is-of-type-p: Doc string. Use help-var-matches-type-p. -;; Added: help-var-matches-type-p. -;; 2007/12/24 dadams -;; help-var-inherits-type-p: Recheck type match after set var-type to its car. -;; Added: help-custom-type. -;; 2007/12/23 dadams -;; help-var-is-of-type-p: -;; Added MODE arg. Use help-var-inherits-type-p, help-var-val-satisfies-type-p. -;; Redefined as MODE choice, not just a simple or. Treat more cases. -;; Added: help-var-inherits-type-p, help-var-val-satisfies-type-p, -;; help-value-satisfies-type-p. -;; describe-option-of-type: Prefix arg means use mode inherit-or-value. -;; 2007/12/22 dadams -;; help-var-is-of-type-p: -;; Check supertypes also. Use both :validate and :match. -;; Wrap type check in condition-case. Use widget-put instead of plist-put. -;; Added soft require of wid-edit+.el. -;; 2007/12/21 dadams -;; help-var-is-of-type-p: Use :validate, not :match, for the test. -;; 2007/12/20 dadams -;; Moved describe-option-of-type to C-h C-o. -;; 2007/12/15 dadams -;; Bound C-h c to describe-command and C-h C-c to describe-key-briefly. -;; 2007/12/07 dadams -;; describe-option-of-type: -;; Call describe-variable with nil buffer. Use "nil" as default value. -;; 2007/12/06 dadams -;; describe-option-of-type: -;; If nil type, all defcustom vars are candidates. Use custom-variable-p. -;; Specific error if no such custom type. -;; 2007/12/04 dadams -;; Added: describe-option-of-type, help-remove-duplicates, help-var-is-of-type-p. -;; Bound o to describe-option, M-o to describe-option-of-type, -;; C-c to describe-command, M-c to describe-copying. -;; 2007/11/28 dadams -;; Renamed describe-bindings-in-map to describe-keymap. Added keymap's doc string. -;; 2007/11/22 dadams -;; Added: describe-bindings-in-map. Bound to C-h M-k. -;; 2007/11/01 dadams -;; Corrected require typo: help-mode -> help-fns. -;; 2007/10/18 dadams -;; Created. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - - -(require 'help-fns) - -(require 'wid-edit+ nil t) ;; (no error if not found): - ;; redefined color widget (for help-var-is-of-type-p) -(require 'wid-edit) ;; widget-convert - -(require 'naked nil t) ;; (no error if not found): naked-key-description - -(when (or (> emacs-major-version 23) (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (require 'info)) ;; Info-virtual-files - -(eval-when-compile (require 'cl)) ;; case - - -;; Quiet the byte-compiler. -(defvar advertised-signature-table) -(defvar dir-local-variables-alist) -(defvar dir-locals-file) -(defvar file-local-variables-alist) -(defvar icicle-mode) ; In `icicles-mode.el' -(defvar icicle-pre-minibuffer-buffer) ; In `icicles-var.el' -(defvar Info-indexed-nodes) ; In `info.el' -(defvar help-cross-reference-manuals) ; For Emacs < 23.2 -(defvar help-enable-auto-load) ; For Emacs < 24.3 -(defvar package-alist) -(defvar package-archive-contents) -(defvar package--builtins) -(defvar package--initialized) - -;;;;;;;;;;;;;;;;;;;;;;;; - -(defvar variable-name-history () "Minibuffer history for variable names.") - -(define-key help-map "B" 'describe-buffer) -(define-key help-map "c" 'describe-command) -(define-key help-map "o" 'describe-option) -(define-key help-map "\C-c" 'describe-key-briefly) -(define-key help-map "\C-o" 'describe-option-of-type) -(define-key help-map "\M-c" 'describe-copying) -(define-key help-map "\M-f" 'describe-file) -(define-key help-map "\M-k" 'describe-keymap) -(define-key help-map "\M-l" 'find-function-on-key) - - -;; Need Emacs 23 for version of `make-text-button' that accepts a string. -(when (> emacs-major-version 22) - (defun help-documentation (function &optional raw add-help-buttons) - "Same as `documentation', but optionally adds buttons for help. -Non-nil optional arg ADD-HELP-BUTTONS does that, adding buttons to key -descriptions, which link to the key's command help." - (let ((raw-doc (documentation function 'RAW))) - (if raw raw-doc (help-substitute-command-keys raw-doc add-help-buttons)))) - - (defun help-documentation-property (symbol prop &optional raw add-help-buttons) - "Same as `documentation-property', but optionally adds buttons for help. -Non-nil optional arg ADD-HELP-BUTTONS does that, adding buttons to key -descriptions, which link to the key's command help." - (let ((raw-doc (documentation-property symbol prop 'RAW))) - (if raw raw-doc (help-substitute-command-keys raw-doc add-help-buttons)))) - - (defun help-commands-to-key-buttons (string) - "Like `substitute-command-keys', but adds buttons for help on keys. - Key descriptions become links to help about their commands." - (help-substitute-command-keys string 'ADD-HELP-BUTTONS)) - - (defun help-substitute-command-keys (string &optional add-help-buttons) - "Same as `substitute-command-keys', but optionally adds buttons for help. -Non-nil optional arg ADD-HELP-BUTTONS does that, adding buttons to key -descriptions, which link to the key's command help." - - ;; REPEAT: - ;; Search for first occurrence of any of the patterns: \[...], \{...}, or \<...>. - ;; Handle escaping via \=, if present before the pattern or if there is no pattern match. - ;; If pattern is a keymap (\<...>): use it from then on. - ;; If pattern is a command (\[...]): (a) substitute its key description, (b) put a button on it. - ;; If pattern is a bindings spec (\{...}): just substitute the usual text. - (with-syntax-table emacs-lisp-mode-syntax-table - (let* ((strg (copy-sequence string)) - (len-strg (length strg)) - (ii 0) - (jj 0) - (newstrg "") - (re-command "\\\\\\[\\(\\(\\sw\\|\\s_\\)+\\)\\]") - (re-keymap "\\\\<\\(\\(\\sw\\|\\s_\\)+\\)>") - (re-bindings "\\\\{\\(\\(\\sw\\|\\s_\\)+\\)}") - (re-any (concat "\\(" re-command "\\|" re-keymap "\\|" re-bindings "\\)")) - (keymap (or overriding-terminal-local-map overriding-local-map)) - (msg nil) - key bindings ma mc mk mb) - (while (< ii len-strg) - (setq key nil - bindings () - strg (substring strg ii)) - - (save-match-data ; ANY - (setq ma (string-match re-any strg)) - (cond ((not ma) ; No \[...], \{...}, or \<...>, but we need to handle \= - (setq jj 0 - newstrg (concat newstrg (replace-regexp-in-string - "\\\\=\\(.\\)" "\\1" strg nil nil nil jj))) - (when (match-beginning 1) (setq jj (match-beginning 1))) - (setq ii len-strg)) - (t - (let ((escaped nil) - (odd nil)) - (save-match-data - (let ((ma/= ma)) - (setq ii ma) - (while (string-match "\\\\=" (substring strg 0 ma/=)) - (setq odd (not odd) - ma/= (match-beginning 0)) - (when odd (setq ii (- ii 2) - escaped ma/=))))) - (if (not escaped) - (setq ii ma - jj (match-end 0) - ma (match-string-no-properties 0 strg) - newstrg (concat newstrg (substring strg 0 ii))) - (setq jj (match-end 0) ; End of \[...], \{...}, or \<...> - ma (and (not odd) (match-string-no-properties 0 strg)) - newstrg (if odd - (concat newstrg - (substring strg 0 escaped) ; Before \='s - (substring strg (+ 2 escaped) ii)) ; After \='s - (concat newstrg (substring strg 0 ii))))))))) - - (when ma - - (save-match-data ; KEYMAP - (setq ma (copy-sequence ma)) - (setq mk (string-match re-keymap ma)) - (setq mk (and mk (match-string-no-properties 0 ma))) - (when mk - (setq keymap (intern (match-string-no-properties 1 ma))) - (if (boundp keymap) - (setq keymap (symbol-value keymap)) - (setq msg (format "\nUses keymap \"%s\", which is not currently defined.\n" keymap)) - (setq keymap (or overriding-terminal-local-map overriding-local-map))))) - - (unless mk ; COMMAND - (save-match-data - (setq ma (copy-sequence ma)) - (setq mc (string-match re-command ma)) - (setq mc (and mc (match-string-no-properties 0 ma))) - (setq mc (and mc (intern (substring mc 2 -1)))) ; Remove \[...] envelope - (when mc - (let ((follow-remap t)) - (while (and (setq key (where-is-internal mc keymap 'FIRSTONLY)) - (vectorp key) (> (length key) 1) (eq 'remap (aref key 0)) - (symbolp (aref key 1)) follow-remap) - (setq mc (aref key 1) - follow-remap nil))) - (setq key (if key - (if (fboundp 'naked-key-description) - (naked-key-description key) - (key-description key)) - (concat "M-x " (symbol-name mc)))) - (when add-help-buttons (setq key (help-key-button-string key mc)))))) - - (unless (or mk mc) ; BINDINGS - (save-match-data - (setq ma (copy-sequence ma)) - (setq mb (string-match re-bindings ma)) - (setq mb (and mb (match-string-no-properties 0 ma))) - (when mb - (setq bindings (intern (match-string-no-properties 1 ma))) - (cond ((boundp bindings) - (setq bindings (substitute-command-keys mb))) ; Use original - no buttons. - (t - (setq msg (format "\nUses keymap \"%s\", which is not currently defined.\n" - bindings)) - (setq bindings nil)))))) - - (unless mk (setq newstrg (concat newstrg (or key bindings (substring strg ii jj))))) - (setq ii (or jj len-strg)))) - - (if (string= string newstrg) - string ; Return original string, not a copy, if no changes. - newstrg)))) - - (defun help-key-button-string (key-description command) - "Return a button for KEY-DESCRIPTION that links to the COMMAND description. -KEY-DESCRIPTION is a key-description string. -COMMAND is the command (a symbol) associated with the key described. -Return a copy of string KEY-DESCRIPTION with button properties added. -Clicking the button shows the help for COMMAND." - (let ((new-key (copy-sequence key-description))) - (make-text-button new-key nil 'button (list t) :type 'help-function 'help-args (list command)) - new-key))) - - -(when (boundp 'Info-virtual-files) ; Emacs 23.2+ - (defcustom help-cross-reference-manuals '(("emacs" "elisp")) - "*Manuals to search, for a `*Help*' buffer link to the manuals. -A cons. - - The car is a list of manuals to search, or the symbol `all', to - search all. If nil, then do not create a cross-reference link. - - The cdr is a boolean: - - Non-`nil' means search the manuals, then create a cross-ref link: - create it only if some search hits are found. - - `nil' means create a cross-ref link without searching manuals - first (but only if there are some manuals to search)." - :set #'(lambda (sym defs) (custom-set-default sym defs) (setq Info-indexed-nodes ())) - :type '(cons - (choice :tag "Which Manuals" - (repeat :tag "Specific Manuals (files)" string) - (const :tag "All Manuals" all)) - (boolean :tag "Search Before Creating Button?")) - :group 'help) - - (defvar Info-indexed-file "*Indexed*" - "Info file for virtual manual from `Info-index-entries-across-manuals'.") - - (defvar Info-indexed-nodes () - "Alist of cached nodes with matching index entries. -Each element is (NODENAME STRING MATCHES), where: - NODENAME is the name of the node that is indexed, - STRING is the search string passed to `Info-index-occurrences', - MATCHES is a list of index matches found by `Info-index-occurrences'. - -This has the same structure as `Info-apropos-nodes', but the search -was made by `Info-index-occurrences', not by `Info-apropos-matches', -so that matches are exact (ignoring case).") - - (defun Info-indexed-find-file (filename &optional _noerror) - "Index-search implementation of `Info-find-file'." - filename) - - (defun Info-indexed-find-node (_filename nodename &optional _no-going-back) - "Index-search implementation of `Info-find-node-2'." - (let* ((nodeinfo (assoc nodename Info-indexed-nodes)) - (matches (nth 2 nodeinfo))) - (when matches - (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" Info-indexed-file nodename)) - (insert "Index Matches\n") - (insert "*************\n\n") - (insert "Index entries that match `" (nth 1 nodeinfo) "':\n\n") - (insert "\0\b[index\0\b]\n") - (if (eq matches t) - (insert "No matches found.\n") - (insert "* Menu:\n\n") - (dolist (entry matches) - (insert (format "* %-38s (%s)%s.%s\n" (format "%s [%s]:" (nth 1 entry) (nth 0 entry)) - (nth 0 entry) (nth 2 entry) - (if (nth 3 entry) (format " (line %s)" (nth 3 entry)) "")))))))) - (add-to-list 'Info-virtual-files '("\\`\\*Indexed\\*\\'" - (find-file . Info-indexed-find-file) - (find-node . Info-indexed-find-node) - ;; (slow . t) ; $$$$$$ Useless here? - )) - - (defun Info-make-manuals-xref (object &optional no-newlines-after-p manuals-spec nomsg) - "Create a cross-ref link for index entries for OBJECT in manuals. -Non-`nil' optional arg NO-NEWLINES-AFTER-P means do not add two -newlines after the cross reference. - -Optional arg MANUALS-SPEC controls which manuals to search. It has -the same form as option `help-cross-reference-manuals', and it -defaults to the value of that option. - -Do nothing if the car of MANUALS-SPEC is nil (no manuals to search). -If its cdr is `nil' then create the link without first searching any -manuals. Otherwise, create the link only if there are search hits in -the manuals." - (when (or (stringp object) (symbolp object)) ; Exclude, e.g., a keymap as OBJECT. - (unless manuals-spec (setq manuals-spec help-cross-reference-manuals)) - (when (car manuals-spec) ; Create no link if no manuals to search. - (let ((books (car manuals-spec)) - (search-now-p (cdr manuals-spec)) - (symb-name (if (stringp object) object (symbol-name object)))) - (when (or (not search-now-p) - (save-current-buffer (Info-first-index-occurrence symb-name () books nomsg))) - (let ((buffer-read-only nil) - (nl-before (cond ((looking-back "[\n][\n]") "") - ((looking-back "[\n]") "\n") - (t "\n\n")))) - (insert (format "%sFor more information %s the " nl-before (if (cdr manuals-spec) "see" "check"))) - (help-insert-xref-button "manuals" 'help-info-manual-lookup symb-name () books) - (insert ".") - (unless no-newlines-after-p (insert "\n\n")))))))) - - (when (and (> emacs-major-version 21) - (condition-case nil (require 'help-mode nil t) (error nil)) - (get 'help-xref 'button-category-symbol)) ; In `button.el' - (define-button-type 'help-info-manual-lookup - :supertype 'help-xref - 'help-function #'(lambda (string &optional index-nodes books nomsg) - (Info-index-entries-across-manuals string () books nomsg)) - 'help-echo "mouse-2, RET: Look it up in the manuals")) - - (defun Info-index-entries-across-manuals (string &optional index-nodes manuals nomsg) - "Look up STRING in Info MANUALS on your system. -Looks for exact matches (ignoring case): STRING is expected to be an -index entry. Build an Info menu of the possible matches. - -Optional arg INDEX-NODES are the index nodes in MANUALS to search. - By default (nil value), all indexes are searched. -Optional arg MANUALS is the list of manuals to search, or the symbol - `all', to search all. -Optional arg NOMSG non-nil means do not display a progress message." - (let ((nodes Info-indexed-nodes) - nodename) - (while (and nodes (not (equal string (nth 1 (car nodes))))) (setq nodes (cdr nodes))) - (if nodes - (Info-find-node Info-indexed-file (car (car nodes))) - (setq nodename (format "Index for `%s'" string)) - (push (list nodename string (Info-index-occurrences string index-nodes manuals nomsg)) - Info-indexed-nodes) - (Info-find-node Info-indexed-file nodename)))) - - ;; Similar to `Info-apropos-matches', but using exact matches (ignoring case). - (defun Info-index-occurrences (index-entry &optional index-nodes manuals nomsg) - "Collect occurrences of INDEX-ENTRY in INDEX-NODES of MANUALS. -Return a list of the form ((FILE INDEX-ENTRY NODE LINE) ...), where: - FILE is the name of an Info file, - NODE is an Info node name, - LINE is the line number of the INDEX-ENTRY occurrence in that node. - -Optional arg INDEX-NODES are the index nodes in MANUALS to search. - By default (nil value), search all indexes of each manual. -Optional arg MANUALS is the list of manuals to search, or the symbol - `all', to search all. -Optional arg NOMSG non-nil means do not display a progress message." - (unless (string= index-entry "") - ;; Unlike `Info-apropos-matches', we match only the exact string as an index entry. - (let ((pattern (format "\n\\* +\\(%s\\):[ \t]+\\([^\n]+\\)\ -\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" - (regexp-quote index-entry))) - matches node) - (unless nomsg - (message "Searching indexes of %s..." - (cond ((eq manuals 'all) "all manuals") - ((null (cadr manuals)) (concat (car manuals) " manual")) - (t (concat "manuals " (mapconcat #'identity manuals ", ")))))) - (condition-case nil - (with-temp-buffer - (when (eq manuals 'all) (setq manuals ())) - (Info-mode) - ;; Next two lines are essentially `(Info-directory)'. - (info-initialize) - (Info-find-node-2 "dir" "top" 'NO-GOING-BACK) - (unless manuals - (goto-char (point-min)) - (re-search-forward "\\* Menu: *\n" nil t) - (let (manual) - (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t) - ;; `add-to-list' ensures no dups in `manuals', so the `dolist' runs faster. - (setq manual (match-string 1)) - (set-text-properties 0 (length manual) nil manual) - (add-to-list 'manuals manual)))) - (dolist (manual manuals) - (unless nomsg (message "Searching indexes of manual `%s'..." manual)) - (when (or index-nodes - (setq index-nodes (Info-index-nodes (Info-find-file manual)))) - (Info-find-node manual (car index-nodes)) - (while (progn (goto-char (point-min)) - (while (re-search-forward pattern nil t) - (setq matches (cons (list manual - (match-string-no-properties 1) - (match-string-no-properties 2) - (match-string-no-properties 3)) - matches))) - (setq index-nodes (cdr index-nodes) - node (car index-nodes))) - (Info-goto-node node))))) - (error nil)) - matches))) - - ;; Like `Info-index-occurrences', but return only the first occurrence found. - (defun Info-first-index-occurrence (index-entry &optional index-nodes manuals nomsg) - "Return nil or an occurrence of INDEX-ENTRY in INDEX-NODES of MANUALS. -Search INDEX-NODES and MANUALS in order. -A non-nil return value is the first first successful index lookup, in -the form (FILE INDEX-ENTRY NODE LINE) - see `Info-index-occurrences'. - -Optional arg INDEX-NODES are the index nodes of MANUALS to search. - By default (nil value), search all indexes of each manual. -Optional arg MANUALS is the list of manuals to search, or the symbol - `all', to search all. -Optional arg NOMSG non-nil means do not display a progress message." - (and (not (string= index-entry "")) - ;; Unlike `Info-apropos-matches', we match only the exact string as an index entry. - (let ((pattern (format "\n\\* +\\(%s\\):[ \t]+\\([^\n]+\\)\ -\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" - (regexp-quote index-entry))) - (found nil) - node) - (unless nomsg - (message "Searching indexes of %s..." - (cond ((eq manuals 'all) "all manuals") - ((null (cadr manuals)) (concat (car manuals) " manual")) - (t (concat "manuals " (mapconcat #'identity manuals ", ")))))) - (condition-case nil - (with-temp-buffer - (when (eq manuals 'all) (setq manuals ())) - (Info-mode) - ;; Next two lines are essentially `(Info-directory)'. - (info-initialize) - (Info-find-node-2 "dir" "top" 'NO-GOING-BACK) - (unless manuals - (goto-char (point-min)) - (re-search-forward "\\* Menu: *\n" nil t) - (let (manual) - (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t) - ;; `add-to-list' ensures no dups in `manuals', so the `dolist' runs faster. - (setq manual (match-string 1)) - (set-text-properties 0 (length manual) nil manual) - (add-to-list 'manuals manual)))) - (setq found (catch 'Info-first-index-occurrence - (dolist (manual manuals) - (unless nomsg - (message "Searching indexes of manual `%s'..." manual)) - (when (or index-nodes - (setq index-nodes (Info-index-nodes - (Info-find-file manual)))) - (Info-find-node manual (car index-nodes)) - (while (progn (goto-char (point-min)) - (when (re-search-forward pattern nil t) - (throw 'Info-first-index-occurrence - (list manual - (match-string-no-properties 1) - (match-string-no-properties 2) - (match-string-no-properties 3)))) - (setq index-nodes (cdr index-nodes) - node (car index-nodes))) - (Info-goto-node node)))) - nil))) - (error nil)) - found))) - - (defun describe-buffer (&optional buffer-name) ; Bound to `C-h B' - "Describe the existing buffer named BUFFER-NAME. -The description includes the information provided by `describe-mode'. -By default, describe the current buffer." - ;; (interactive "bDescribe buffer: ") - (interactive "@") - (unless buffer-name (setq buffer-name (buffer-name))) - (help-setup-xref `(describe-buffer ,buffer-name) (called-interactively-p 'interactive)) - (let ((buf (get-buffer buffer-name))) - (unless (and buf (buffer-live-p buf)) (error(format "No such live buffer `%s'" buffer-name))) - (let* ((file (or (buffer-file-name buf) - (with-current-buffer buf - (and (eq major-mode 'dired-mode) default-directory)))) - (help-text (concat - (format "Buffer `%s'\n%s\n\n" buffer-name (make-string - (+ 9 (length buffer-name)) ?-)) - (and file (format "File/directory:\t%s\n" file)) - (format "Mode:\t\t%s\n" - (with-current-buffer buf (format-mode-line mode-name))) - (format "Size in chars:\t%g\n" (buffer-size buf)) - (with-current-buffer buf - (if (not buffer-display-time) - "Never displayed\n" - (format "Last displayed:\t%s\n" - (format-time-string - ;; Could use this, for short format: "%02H:%02M:%02S" - ;; Or this, for a bit longer: "%_3a %_2l:%02M:%02S %_2p" - "%a %b %e %T %Y (%z)" - buffer-display-time)))) - (format "Modified:\t%s\n" (if (buffer-modified-p buf) "yes" "no")) - (with-current-buffer buf - (format "Read-only:\t%s\n\n\n" (if buffer-read-only "yes" "no")))))) - (with-help-window (help-buffer) - (describe-mode-1 buf)) - (with-current-buffer (help-buffer) - (let ((inhibit-read-only t)) - (goto-char (point-min)) - (insert help-text)))))) - - - ;; REPLACE ORIGINAL - ;; - ;; Use `describe-mode-1', which is different from the original `describe-mode' in these ways: - ;; - ;; 1. Call `Info-make-manuals-xref' to create a cross-ref link to manuals. - ;; 2. Add key-description buttons to command help. Use `insert', not `princ'. - ;; - (defun describe-mode (&optional buffer) - "Display documentation of current major mode and minor modes. -A brief summary of the minor modes comes first, followed by the -major mode description. This is followed by detailed -descriptions of the minor modes, each on a separate page. - -For this to work correctly for a minor mode, the mode's indicator -variable \(listed in `minor-mode-alist') must also be a function -whose documentation describes the minor mode." - (interactive "@") - (unless buffer (setq buffer (current-buffer))) - (help-setup-xref (list #'describe-mode buffer) (called-interactively-p 'interactive)) - (with-help-window (help-buffer) (describe-mode-1 buffer)) - nil) ; For the sake of IELM and maybe others - - (defun describe-mode-1 (buffer) - "Helper for `describe-mode'. -Does everything except create the help window and set up the -back/forward buttons, so you can use this in other help commands that -have their own back/forward buttons." - ;; For the sake of `help-do-xref' and `help-xref-go-back', do not switch buffers before calling `help-buffer'. - (with-current-buffer buffer - (let (minor-modes) - ;; Older packages do not register in minor-mode-list but only in `minor-mode-alist'. - (dolist (x minor-mode-alist) - (setq x (car x)) - (unless (memq x minor-mode-list) (push x minor-mode-list))) - (dolist (mode minor-mode-list) ; Find enabled minor mode we will want to mention. - ;; Document minor mode if listed in `minor-mode-alist', non-nil, and has a function def. - (let ((fmode (or (get mode :minor-mode-function) mode))) - (and (boundp mode) (symbol-value mode) (fboundp fmode) - (let ((pretty-minor-mode (if (string-match "\\(\\(-minor\\)?-mode\\)?\\'" - (symbol-name fmode)) - (capitalize (substring (symbol-name fmode) - 0 (match-beginning 0))) - fmode))) - (push (list fmode pretty-minor-mode - (format-mode-line (assq mode minor-mode-alist))) - minor-modes))))) - (setq minor-modes (sort minor-modes (lambda (a b) (string-lessp (cadr a) (cadr b))))) - (when minor-modes - (princ "Enabled minor modes:\n") - (make-local-variable 'help-button-cache) - (with-current-buffer standard-output - (dolist (mode minor-modes) - (let ((mode-function (nth 0 mode)) - (pretty-minor-mode (nth 1 mode)) - (indicator (nth 2 mode))) - (add-text-properties 0 (length pretty-minor-mode) '(face bold) pretty-minor-mode) - (save-excursion - (goto-char (point-max)) - (princ "\n\f\n") - (push (point-marker) help-button-cache) - ;; Document the minor modes fully. - (insert pretty-minor-mode) - (princ (format " minor mode:\n(`%s'; %s)\n" mode-function (if (zerop (length indicator)) - "no indicator" - (format "indicator%s" indicator)))) - (save-excursion - (fill-region-as-paragraph (line-beginning-position 0) (line-end-position 0) nil t t)) - (with-current-buffer standard-output - (insert (help-documentation mode-function nil 'ADD-HELP-BUTTONS))) - (Info-make-manuals-xref mode-function - t nil (not (called-interactively-p 'interactive)))) ; Link manuals. - (insert-button pretty-minor-mode 'action (car help-button-cache) - 'follow-link t 'help-echo "mouse-2, RET: show full information") - (newline))) - (forward-line -1) - (fill-paragraph nil) - (forward-line 1)) - (princ "\n(Information about these minor modes follows the major mode info.)\n\n")) - (let ((mode mode-name)) ; Document the major mode. - (with-current-buffer standard-output - (let ((start (point))) - (insert (format-mode-line mode nil nil buffer)) - (add-text-properties start (point) '(face bold))))) - (princ " mode") - (let* ((mode major-mode) - (file-name (find-lisp-object-file-name mode nil))) - (when file-name - (princ (concat " defined in `" (file-name-nondirectory file-name) "'")) - (with-current-buffer standard-output ; Make a hyperlink to the library. - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-def mode file-name)))) - (with-current-buffer standard-output - (insert (format " (`%s'):\n" mode)) - (save-excursion - (fill-region-as-paragraph (line-beginning-position 0) (line-end-position 0) nil t t)))) - (let* ((maj major-mode) - (maj-doc (help-documentation maj nil 'ADD-HELP-BUTTONS))) - (with-current-buffer standard-output - (insert maj-doc) - (Info-make-manuals-xref - maj t nil (not (called-interactively-p 'interactive)))))))) ; Link to manuals. - ) - - - -;; REPLACE ORIGINAL in `help-fns.el': -;; -;; 1. Preferred candidate is `symbol-nearest-point'. -;; 2. With a prefix argument, candidates are commands only. -;; 3. No no-function message if not called interactively. -;; -(defun describe-function (function &optional commandp) - "Display the full documentation of FUNCTION (a symbol). -FUNCTION names an Emacs Lisp function, possibly a user command. -With a prefix argument, candidates are commands (interactive) only. -Default candidate is: preferably the `symbol-nearest-point', or else -the innermost function call surrounding point -\(`function-called-at-point'). -Return the description that was displayed, as a string." - (interactive - (let* ((fn (or (and (fboundp 'symbol-nearest-point) - (symbol-nearest-point)) - (function-called-at-point))) - (enable-recursive-minibuffers t) - (completion-annotate-function (lambda (fn) (and (commandp (intern-soft fn)) " (command)"))) - (type (if current-prefix-arg 'command 'function)) - (prompt (format "Describe %s%s: " type - (if (if current-prefix-arg (commandp fn) (fboundp fn)) - (format " (default %s)" fn) - ""))) - val) - (setq val (completing-read prompt obarray (if current-prefix-arg 'commandp 'fboundp) t nil nil - (and (if current-prefix-arg (commandp fn) (fboundp fn)) (symbol-name fn)))) - (list (if (equal val "") fn (intern val)) current-prefix-arg))) - (if (or (not function) (not (fboundp (intern-soft function)))) - (when (if (or (> emacs-major-version 23) ; Emacs 23.1 `called-interactively' accepts no arg. - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p)) - (if (not function) - (message "You did not specify a defined function") - (message "`%s' is not a defined function" function))) - (unless (or (not commandp) (commandp function)) - (error "Not a defined Emacs command (interactive function): `%s'" function)) - ;;$$$ (unless (fboundp function) (error "Not a defined Emacs function: `%s'" function)) - (help-setup-xref (list #'describe-function function) - (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p))) - (save-excursion - (if (fboundp 'with-help-window) - (with-help-window (help-buffer) ; Emacs 24.4 needs this - see Emacs bug #17109. - (prin1 function) - ;; Use " is " instead of ": " so it is easier to get the function name using `forward-sexp'. - (princ " is ") - (describe-function-1 function) - (with-current-buffer standard-output (buffer-string))) ; Return help text. - (with-output-to-temp-buffer (help-buffer) - (prin1 function) - ;; Use " is " instead of ": " so it is easier to get the function name using `forward-sexp'. - (princ " is ") - (describe-function-1 function) - (print-help-return-message) - (with-current-buffer standard-output (buffer-string))))))) ; Return help text. - - - -;; REPLACE ORIGINAL in `help-fns.el' (`help.el', for Emacs < 22): -;; -;; Fill long lines. Add `,' before "which". -;; -(when (< emacs-major-version 23) - (defun describe-function-1 (function) - (let* ((def (if (symbolp function) (symbol-function function) function)) - (beg (if (commandp def) "an interactive " "a ")) - (pt1 (with-current-buffer (help-buffer) (point))) - file-name string) - (setq string (cond ((or (stringp def) (vectorp def)) "a keyboard macro") - ((subrp def) (if (eq 'unevalled (cdr (subr-arity def))) - (concat beg "special form") - (concat beg "built-in function"))) - ((byte-code-function-p def) (concat beg "compiled Lisp function")) - ((symbolp def) - (while (symbolp (symbol-function def)) - (setq def (symbol-function def))) - (format "an alias for `%s'" def)) - ((eq (car-safe def) 'lambda) (concat beg "Lisp function")) - ((eq (car-safe def) 'macro) "a Lisp macro") - ((eq (car-safe def) 'autoload) - (setq file-name (nth 1 def)) - (format "%s autoloaded %s" (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) - "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) - ((keymapp def) - (let ((is-full nil) - (elts (cdr-safe def))) - (while elts - (when (char-table-p (car-safe elts)) - (setq is-full t - elts ())) - (setq elts (cdr-safe elts))) - (if is-full "a full keymap" "a sparse keymap"))) - (t ""))) - (princ string) - (with-current-buffer standard-output - (save-excursion (save-match-data (when (re-search-backward "alias for `\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function def))))) - (unless file-name (setq file-name (symbol-file function 'defun))) - (setq file-name (describe-simplify-lib-file-name file-name)) - (when (equal file-name "loaddefs.el") - ;; Find the real def site of the preloaded function. This is necessary only for defaliases. - (let ((location (condition-case nil - (find-function-search-for-symbol function nil "loaddefs.el") - (error nil)))) - (when location - (with-current-buffer (car location) - (goto-char (cdr location)) - (when (re-search-backward "^;;; Generated autoloads from \\(.*\\)" nil t) - (setq file-name (match-string 1))))))) - (when (and (null file-name) (subrp def)) ; Find the C source file name. - (setq file-name (if (get-buffer " *DOC*") (help-C-file-name def 'subr) 'C-source))) - (when file-name - (princ " in `") - ;; We used to add `.el' to file name, but that's wrong when the user used `load-file'. - (princ (if (eq file-name 'C-source) "C source code" file-name)) - (princ "'") - (with-current-buffer standard-output ; Make a hyperlink to the library. - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-def function file-name)))) - (princ ".") - (with-current-buffer (help-buffer) - (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) (point))) - (terpri)(terpri) - (when (commandp function) - (let ((pt2 (with-current-buffer (help-buffer) (point)))) - (if (and (eq function 'self-insert-command) - (eq (key-binding "a") 'self-insert-command) - (eq (key-binding "b") 'self-insert-command) - (eq (key-binding "c") 'self-insert-command)) - (princ "It is bound to many ordinary text characters.\n") - (let* ((remapped (command-remapping function)) - (keys (where-is-internal - (or remapped function) overriding-local-map nil nil)) - non-modified-keys) - (dolist (key keys) ; Which non-control non-meta keys run this command? - (when (member (event-modifiers (aref key 0)) '(nil (shift))) - (push key non-modified-keys))) - (when remapped - (princ "It is remapped to `") (princ (symbol-name remapped)) (princ "'")) - (when keys - (princ (if remapped ", which is bound to " "It is bound to ")) - ;; If lots of ordinary text characters run this command, don't mention them one by one. - (if (< (length non-modified-keys) 10) - (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (dolist (key non-modified-keys) (setq keys (delq key keys))) - (if keys - (progn (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (princ ", and many ordinary text characters")) - (princ "many ordinary text characters")))) - (when (or remapped keys non-modified-keys) (princ ".") (terpri)))) - (with-current-buffer (help-buffer) (fill-region-as-paragraph pt2 (point))) - (terpri))) - (let* ((arglist (help-function-arglist def)) - (doc (documentation function)) - (usage (help-split-fundoc doc function))) - (with-current-buffer standard-output - ;; If definition is a keymap, skip arglist note. - (unless (keymapp def) - (let* ((use (cond (usage (setq doc (cdr usage)) (car usage)) - ((listp arglist) (format "%S" (help-make-usage function arglist))) - ((stringp arglist) arglist) - ;; Maybe the arglist is in the docstring of the alias. - ((let ((fun function)) - (while (and (symbolp fun) - (setq fun (symbol-function fun)) - (not (setq usage (help-split-fundoc (documentation fun) - function))))) - usage) - (car usage)) - ((or (stringp def) (vectorp def)) - (format "\nMacro: %s" (format-kbd-macro def))) - (t "[Missing arglist. Please make a bug report.]"))) - (high (help-highlight-arguments use doc))) - (let ((fill-begin (point))) - (insert (car high) "\n") - (fill-region fill-begin (point))) - (setq doc (cdr high)))) - (let ((obsolete (and (symbolp function) ; function might be a lambda construct. - (get function 'byte-obsolete-info)))) - (when obsolete - (princ "\nThis function is obsolete") - (when (nth 2 obsolete) (insert (format " since %s" (nth 2 obsolete)))) - (insert ";\n" (if (stringp (car obsolete)) - (car obsolete) - (format "use `%s' instead." (car obsolete))) - "\n")) - (insert "\n" (or doc "Not documented.")))))))) - - -;; REPLACE ORIGINAL in `help-fns.el': -;; -;; 1. Call `Info-make-manuals-xref' to create a cross-ref link to manuals. -;; 2. Add key-description buttons to command help. -;; -(when (and (boundp 'Info-virtual-files) ; Emacs 23.2 through 24.2 - (not (fboundp 'help-fns--autoloaded-p))) - (defun describe-function-1 (function) - (let* ((advised (and (symbolp function) (featurep 'advice) (ad-get-advice-info function))) - ;; If the function is advised, use the symbol that has the real def, if already set up. - (real-function (or (and advised (let ((origname (cdr (assq 'origname advised)))) - (and (fboundp origname) origname))) - function)) - ;; Get the real definition. - (def (if (symbolp real-function) (symbol-function real-function) function)) - (aliased (symbolp def)) - (real-def (if aliased - (let ((fn def)) - (while (and (fboundp fn) (symbolp (symbol-function fn))) - (setq fn (symbol-function fn))) - fn) - def)) - (file-name (find-lisp-object-file-name function def)) - (beg (if (commandp def) "an interactive " "a ")) - (pt1 (with-current-buffer (help-buffer) (point))) - string errtype) - (setq string (cond ((or (stringp def) (vectorp def)) "a keyboard macro") - ((subrp def) (if (eq 'unevalled (cdr (subr-arity def))) - (concat beg "special form") - (concat beg "built-in function"))) - ((byte-code-function-p def) (concat beg "compiled Lisp function")) - ((symbolp def) - (while (and (fboundp def) (symbolp (symbol-function def))) - (setq def (symbol-function def))) - ;; Handle (defalias 'foo 'bar), where bar is undefined. - (unless (fboundp def) (setq errtype 'alias)) - (format "an alias for `%s'" def)) - ((eq (car-safe def) 'lambda) (concat beg "Lisp function")) - ((eq (car-safe def) 'macro) "a Lisp macro") - ((eq (car-safe def) 'closure) (concat beg "Lisp closure")) - ((eq (car-safe def) 'autoload) - (format "%s autoloaded %s" (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) - "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) - ((keymapp def) (let ((is-full nil) - (elts (cdr-safe def))) - (while elts - (when (char-table-p (car-safe elts)) - (setq is-full t - elts ())) - (setq elts (cdr-safe elts))) - (if is-full "a full keymap" "a sparse keymap"))) - (t ""))) - (princ string) - (if (eq errtype 'alias) - (princ ",\nwhich is not defined. Please make a bug report.") - (with-current-buffer standard-output - (save-excursion (save-match-data (when (re-search-backward "alias for `\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function def))))) - (when file-name - (princ " in `") - ;; We used to add `.el' to the file name, but that's wrong when the user used `load-file'. - (princ (if (eq file-name 'C-source) "C source code" (file-name-nondirectory file-name))) - (princ "'") - ;; Make a hyperlink to the library. - (with-current-buffer standard-output - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-def function file-name)))) - (princ ".") - (with-current-buffer (help-buffer) - (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) (point))) - (terpri) (terpri) - (when (commandp function) - (let ((pt2 (with-current-buffer (help-buffer) (point))) - (remapped (command-remapping function))) - (unless (memq remapped '(ignore undefined)) - (let ((keys (where-is-internal (or remapped function) overriding-local-map nil nil)) - non-modified-keys) - (if (and (eq function 'self-insert-command) - (vectorp (car-safe keys)) - (consp (aref (car keys) 0))) - (princ "It is bound to many ordinary text characters.\n") - (dolist (key keys) ; Which non-control non-meta keys run this command? - (when (member (event-modifiers (aref key 0)) '(nil (shift))) - (push key non-modified-keys))) - (when remapped - (princ "It is remapped to `") (princ (symbol-name remapped)) (princ "'")) - (when keys - (princ (if remapped ", which is bound to " "It is bound to ")) - ;; If lots of ordinary text chars run this command, don't mention them one by one. - (if (< (length non-modified-keys) 10) - (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (dolist (key non-modified-keys) (setq keys (delq key keys))) - (if keys - (progn (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (princ ", and many ordinary text characters")) - (princ "many ordinary text characters")))) - (when (or remapped keys non-modified-keys) (princ ".") (terpri))))) - (with-current-buffer (help-buffer) - (fill-region-as-paragraph pt2 (point)) - (unless (looking-back "\n\n") (terpri))))) - ;; `list*' etc. do not get this property until `cl-hack-byte-compiler' runs, - ;; which is after bytecomp is loaded. - (when (and (symbolp function) (eq (get function 'byte-compile) 'cl-byte-compile-compiler-macro)) - (princ "This function has a compiler macro") - (let ((lib (get function 'compiler-macro-file))) - (when (stringp lib) - (princ (format " in `%s'" lib)) - (with-current-buffer standard-output - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-cmacro function lib))))) - (princ ".\n\n")) - (let* ((advertised (gethash def advertised-signature-table t)) - (arglist (if (listp advertised) advertised (help-function-arglist def))) - (doc (condition-case err - (help-documentation function nil 'ADD-HELP-BUTTONS) - (error (format "No Doc! %S" err)))) - (usage (help-split-fundoc doc function))) - (with-current-buffer standard-output - (unless (keymapp function) ; If definition is a keymap, skip arglist note. - (when usage (setq doc (cdr usage))) - (let* ((use (cond ((and usage (not (listp advertised))) (car usage)) - ((listp arglist) (format "%S" (help-make-usage function arglist))) - ((stringp arglist) arglist) - ;; Maybe arglist is in doc string of a symbol this one is aliased to. - ((let ((fun real-function)) - (while (and (symbolp fun) - (setq fun (symbol-function fun)) - (not (setq usage (help-split-fundoc - (help-documentation - fun nil 'ADD-HELP-BUTTONS) - function))))) - usage) - (car usage)) - ((or (stringp def) (vectorp def)) - (format "\nMacro: %s" (format-kbd-macro def))) - (t "[Missing arglist. Please submit a bug report.]"))) - (high (help-highlight-arguments use doc))) - (let ((fill-begin (point))) - (insert (car high) "\n") - (fill-region fill-begin (point))) - (setq doc (cdr high)))) - ;; If this is a derived mode, link to the parent. - (let ((parent-mode (and (symbolp real-function) (get real-function 'derived-mode-parent)))) - (when parent-mode - (with-current-buffer standard-output - (insert "\nParent mode: `") - (let ((beg (point))) - (insert (format "%s" parent-mode)) - (make-text-button beg (point) 'type 'help-function 'help-args (list parent-mode)))) - (princ "'.\n"))) - (let* ((obsolete (and (symbolp function) ; Function might be a lambda construct. - (get function 'byte-obsolete-info))) - (use (car obsolete))) - (when obsolete - (princ "\nThis function is obsolete") - (when (nth 2 obsolete) (insert (format " since %s" (nth 2 obsolete)))) - (insert (cond ((stringp use) (concat ";\n" use)) - (use (format ";\nuse `%s' instead." use)) - (t ".")) - "\n")) - (insert "\n") - (when (and doc (boundp 'Info-virtual-files)) ; Emacs 23.2+ - (Info-make-manuals-xref function)) ; Link to manuals. (With progress message.) - (insert (or doc "Not documented."))))))))) - -(when (fboundp 'help-fns--autoloaded-p) ; Emacs 24.3+ - - - ;; REPLACE ORIGINAL in `help-fns.el': - ;; - ;; Use `naked-key-description' if available, instead of `key-description'. - ;; - (defun help-fns--key-bindings (function) - (when (commandp function) - (let ((pt2 (with-current-buffer standard-output (point))) - (remapped (command-remapping function))) - (unless (memq remapped '(ignore undefined)) - (let ((keys (where-is-internal (or remapped function) overriding-local-map nil nil)) - non-modified-keys) - (if (and (eq function 'self-insert-command) - (vectorp (car-safe keys)) - (consp (aref (car keys) 0))) - (princ "It is bound to many ordinary text characters.\n") - (dolist (key keys) ; Which non-control non-meta keys run this command? - (when (member (event-modifiers (aref key 0)) '(nil (shift))) (push key non-modified-keys))) - (when remapped - (princ "Its keys are remapped to ") - (princ (if (symbolp remapped) (concat "`" (symbol-name remapped) "'") "an anonymous command")) - (princ ".\n")) - (when keys - (princ (if remapped "Without this remapping, it would be bound to " "It is bound to ")) - ;; If lots of ordinary text characters run this command, don't mention them one by one. - (if (< (length non-modified-keys) 10) - (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (dolist (key non-modified-keys) (setq keys (delq key keys))) - (if keys - (progn (princ (mapconcat (if (fboundp 'naked-key-description) - #'naked-key-description - #'key-description) - keys ", ")) - (princ ", and many ordinary text characters")) - (princ "many ordinary text characters")))) - (when (or remapped keys non-modified-keys) (princ ".") (terpri))))) - (with-current-buffer standard-output - (fill-region-as-paragraph pt2 (point)) - (unless (looking-back "\n\n") (terpri)))))) - - - ;; REPLACE ORIGINAL in `help-fns.el' - ;; - ;; Add key-description buttons to command help: Use `help-documentation', not `documentation'. - ;; - (defun help-fns--signature (function doc real-def real-function) - (unless (keymapp function) ; If definition is a keymap, skip arglist note. - (let* ((advertised (gethash real-def advertised-signature-table t)) - (arglist (if (listp advertised) advertised (help-function-arglist real-def))) - (usage (help-split-fundoc doc function))) - (when usage (setq doc (cdr usage))) - (let* ((use (cond ((and usage (not (listp advertised))) (car usage)) - ((listp arglist) (format "%S" (help-make-usage function arglist))) - ((stringp arglist) arglist) - ;; Maybe the arglist is in the docstring of a symbol this one is aliased to. - ((let ((fun real-function)) - (while (and (symbolp fun) - (setq fun (symbol-function fun)) - (not (setq usage (help-split-fundoc - (help-documentation fun nil 'ADD-HELP-BUTTONS) - function))))) - usage) - (car usage)) - ((or (stringp real-def) (vectorp real-def)) - (format "\nMacro: %s" (format-kbd-macro real-def))) - (t "[Missing arglist. Please submit a bug report.]"))) - (high (help-highlight-arguments use doc))) - (let ((fill-begin (point))) - (insert (car high) "\n") - (fill-region fill-begin (point))) - (cdr high)))))) - -(when (and (= emacs-major-version 24) (= emacs-minor-version 3)) - (defun describe-function-1 (function) - (let* ((advised (and (symbolp function) (featurep 'advice) (ad-get-advice-info function))) - ;; If the function is advised, use the symbol that has the real def, if already set up. - (real-function (or (and advised (let ((origname (cdr (assq 'origname advised)))) - (and (fboundp origname) origname))) - function)) - ;; Get the real definition. - (def (if (symbolp real-function) (symbol-function real-function) function)) - (aliased (symbolp def)) - (real-def (if aliased - (let ((fn def)) - (while (and (fboundp fn) (symbolp (symbol-function fn))) - (setq fn (symbol-function fn))) - fn) - def)) - (file-name (find-lisp-object-file-name function def)) - (pt1 (with-current-buffer (help-buffer) (point))) - (beg (if (and (or (byte-code-function-p def) (keymapp def) - (memq (car-safe def) '(macro lambda closure))) - file-name - (help-fns--autoloaded-p function file-name)) - (if (commandp def) "an interactive autoloaded " "an autoloaded ") - (if (commandp def) "an interactive " "a ")))) - ;; Print what kind of function-like object FUNCTION is. - (princ (cond ((or (stringp def) (vectorp def)) "a keyboard macro") - ((subrp def) (if (eq 'unevalled (cdr (subr-arity def))) - (concat beg "special form") - (concat beg "built-in function"))) - ((byte-code-function-p def) (concat beg "compiled Lisp function")) - (aliased (format "an alias for `%s'" real-def)) - ((eq (car-safe def) 'lambda) (concat beg "Lisp function")) - ((eq (car-safe def) 'macro) (concat beg "Lisp macro")) - ((eq (car-safe def) 'closure) (concat beg "Lisp closure")) - ((autoloadp def) - (format "%s autoloaded %s" (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) - "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) - ((keymapp def) (let ((is-full nil) - (elts (cdr-safe def))) - (while elts - (when (char-table-p (car-safe elts)) - (setq is-full t - elts ())) - (setq elts (cdr-safe elts))) - (concat beg (if is-full "keymap" "sparse keymap")))) - (t ""))) - (if (and aliased (not (fboundp real-def))) - (princ ",\nwhich is not defined. Please submit a bug report.") - (with-current-buffer standard-output - (save-excursion (save-match-data (when (re-search-backward "alias for `\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function real-def))))) - (when file-name - (princ " in `") - ;; We used to add `.el' to the file name, but that's wrong when the user used `load-file'. - (princ (if (eq file-name 'C-source) "C source code" (file-name-nondirectory file-name))) - (princ "'") - ;; Make a hyperlink to the library. - (with-current-buffer standard-output - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-def function file-name)))) - (princ ".") - (with-current-buffer (help-buffer) - (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) (point))) - (terpri) (terpri) - (let* ((doc-raw (documentation function 'RAW)) - ;; If the function is autoloaded, and its docstring has key substitution constructs, - ;; load the library. In any case, add help buttons. - (doc (if (and (autoloadp real-def) - doc-raw - help-enable-auto-load - (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) - (load (cadr real-def) t)) - (help-substitute-command-keys doc-raw 'ADD-HELP-BUTTONS) - (condition-case err - (help-documentation function nil 'ADD-HELP-BUTTONS) - (error (format "No Doc! %S" err)))))) - (help-fns--key-bindings function) - (with-current-buffer standard-output - (setq doc (help-fns--signature function doc real-def real-function)) - (help-fns--compiler-macro function) - (help-fns--parent-mode function) - (help-fns--obsolete function) - (insert "\n") - (when (and doc (boundp 'Info-virtual-files)) ; Emacs 23.2+ - (Info-make-manuals-xref function)) ; Link to manuals. (With progress message.) - (insert (or doc "Not documented.")))))))) - -(when (or (> emacs-major-version 24) (and (= emacs-major-version 24) (> emacs-minor-version 3))) - (defun describe-function-1 (function) - (let* ((advised (and (symbolp function) - (featurep 'nadvice) - (advice--p (advice--symbol-function function)))) - ;; If the function is advised, use the symbol that has the real definition, if already set up. - (real-function (or (and advised (advice--cd*r (advice--symbol-function function))) - function)) - ;; Get the real definition. - (def (if (symbolp real-function) (symbol-function real-function) real-function)) - (aliased (or (symbolp def) - (and advised (symbolp real-function)))) ; Advised & aliased function. - (real-def (cond (aliased (let ((f real-function)) - (while (and (fboundp f) (symbolp (symbol-function f))) - (setq f (symbol-function f))) - f)) - ((subrp def) (intern (subr-name def))) - (t def))) - (file-name (find-lisp-object-file-name function def)) - (pt1 (with-current-buffer (help-buffer) (point))) - (beg (if (and (or (byte-code-function-p def) (keymapp def) - (memq (car-safe def) '(macro lambda closure))) - file-name - (help-fns--autoloaded-p function file-name)) - (if (commandp def) "an interactive autoloaded " "an autoloaded ") - (if (commandp def) "an interactive " "a ")))) - ;; Print what kind of function-like object FUNCTION is. - (princ (cond ((or (stringp def) (vectorp def)) "a keyboard macro") - ((subrp def) (if (eq 'unevalled (cdr (subr-arity def))) - (concat beg "special form") - (concat beg "built-in function"))) - ;; Aliases are Lisp functions, check aliases before functions. - (aliased (format "an alias for `%s'" real-def)) - ((or (eq (car-safe def) 'macro) - ;; For advised macros, DEF is a lambda expression or is `byte-code-function-p', - ;; so check macros before functions. - (macrop function)) - (concat beg "Lisp macro")) - ((byte-code-function-p def) (concat beg "compiled Lisp function")) - ((eq (car-safe def) 'lambda) (concat beg "Lisp function")) - ((eq (car-safe def) 'closure) (concat beg "Lisp closure")) - ((autoloadp def) - (format "%s autoloaded %s" (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) - "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) - ((keymapp def) (let ((is-full nil) - (elts (cdr-safe def))) - (while elts - (when (char-table-p (car-safe elts)) - (setq is-full t - elts ())) - (setq elts (cdr-safe elts))) - (concat beg (if is-full "keymap" "sparse keymap")))) - (t ""))) - (if (and aliased (not (fboundp real-def))) - (princ ",\nwhich is not defined. Please submit a bug report.") - (with-current-buffer standard-output - (save-excursion (save-match-data (when (re-search-backward "alias for `\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function real-def))))) - (when file-name - (princ " in `") - ;; We used to add `.el' to the file name, but that's wrong when the user used `load-file'. - (princ (if (eq file-name 'C-source) "C source code" (file-name-nondirectory file-name))) - (princ "'") - ;; Make a hyperlink to the library. - (with-current-buffer standard-output - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-def function file-name)))) - (princ ".") - (with-current-buffer (help-buffer) - (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) (point))) - (terpri) (terpri) - (let* ((doc-raw (documentation function 'RAW)) - ;; If the function is autoloaded and its docstring has key substitution constructs, then - ;; load the library. In any case, add help buttons. - (doc (if (and (autoloadp real-def) - doc-raw - help-enable-auto-load - (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) - (load (cadr real-def) t)) - (help-substitute-command-keys doc-raw 'ADD-HELP-BUTTONS) - (condition-case err - (help-documentation function nil 'ADD-HELP-BUTTONS) - (error (format "No Doc! %S" err)))))) - (help-fns--key-bindings function) - (with-current-buffer standard-output - (setq doc (help-fns--signature function doc real-def real-function)) - (run-hook-with-args 'help-fns-describe-function-functions function) - (insert "\n") - (when (and doc (boundp 'Info-virtual-files)) ; Emacs 23.2+ - (Info-make-manuals-xref function)) ; Link to manuals. (With progress message.) - (insert (or doc "Not documented.")))))))) - -;;;###autoload -(defun describe-command (function) ; Bound to `C-h c' - "Describe an Emacs command (interactive function). -Equivalent to using a prefix arg with `describe-function'. - -If you use Icicles then in Icicle mode keys bound to the commands are -shown next to them in `*Completions*. You can toggle this keys -display on/off using `C-x C-a'." - (interactive - (let ((fn (or (and (fboundp 'symbol-nearest-point) (symbol-nearest-point)) - (function-called-at-point))) - (enable-recursive-minibuffers t) - (completion-annotate-function (and (boundp 'icicle-mode) icicle-mode - (lambda (cand) - (with-current-buffer icicle-pre-minibuffer-buffer - (and (setq cand (intern-soft cand)) (symbolp cand) - (let ((key (where-is-internal cand nil t))) - (and key - (format " %s" (icicle-key-description key))))))))) - val) - (setq val (completing-read - (format "Describe command%s: " (if (commandp fn) (format " (default %s)" fn) "")) - obarray 'commandp t nil nil (and fn (commandp fn) (symbol-name fn)))) - (list (if (equal val "") fn (intern val))))) - (describe-function function t)) - - -;; REPLACE ORIGINAL in `help.el': -;; -;; 1. With a prefix argument, candidates are user variables (options) only. -;; 2. Preferred default candidate is `symbol-nearest-point'. -;; 3. Remove initial `*' from doc string (indicates it is a user variable). -;; 4. Use `substitute-command-keys' on doc string. -;; 5. Preserve text properties. -;; 6. No message if not called interactively. -;; -(when (< emacs-major-version 23) - (defun describe-variable (variable &optional buffer optionp) - "Display the full documentation of VARIABLE (a symbol). -VARIABLE names an Emacs Lisp variable, possibly a user option. -With a prefix argument, candidates are user variables (options) only. -Default candidate is the `symbol-nearest-point'. -Return the documentation, as a string. -If VARIABLE has a buffer-local value in BUFFER (default to the current buffer), -it is displayed along with the global value." - (interactive - (let ((symb (or (and (fboundp 'symbol-nearest-point) (symbol-nearest-point)) - (variable-at-point))) - (enable-recursive-minibuffers t) - (completion-annotate-function (lambda (var) (and (custom-variable-p (intern-soft var)) " (option)"))) - val) - (when (numberp symb) (setq symb nil)) ; `variable-at-point' returns 0 when there is no var. - (setq val (completing-read - (format "Describe variable%s: " - (if (and symb (boundp symb)) (format " (default %s)" symb) "")) - obarray (if current-prefix-arg - (lambda (vv) (user-variable-p vv)) - (lambda (vv) (or (boundp vv) (get vv 'variable-documentation)))) - t nil nil (and (symbolp symb) (boundp symb) (symbol-name symb)))) - (list (if (equal val "") symb (intern val)) - nil - current-prefix-arg))) - (unless (buffer-live-p buffer) (setq buffer (current-buffer))) - (if (not (symbolp variable)) - (when (interactive-p) (message "You did not specify a variable")) - (unless (or (not optionp) (user-variable-p variable)) - (error "Not a defined Emacs user option: `%s'" variable)) - ;;$$ (unless (boundp variable) (error "Not a defined Emacs variable: `%s'" variable)) - (save-excursion - (let* ((valvoid (not (with-current-buffer buffer (boundp variable)))) - ;; Extract the value before setting up the output buffer, - ;; in case `buffer' *is* the output buffer. - (val (and (not valvoid) (buffer-local-value variable buffer))) - val-start-pos) - (help-setup-xref (list #'describe-variable variable buffer) (interactive-p)) - (with-output-to-temp-buffer (help-buffer) - (with-current-buffer buffer - (prin1 variable) - ;; Make a hyperlink to the library if appropriate. (Don't change the format of the - ;; buffer's initial line in case anything expects the current format.) - (let ((file-name (symbol-file variable 'defvar))) - (setq file-name (describe-simplify-lib-file-name file-name)) - (when (equal file-name "loaddefs.el") - ;; Find the real def site of the preloaded variable. - (let ((location (condition-case nil - (find-variable-noselect variable file-name) - (error nil)))) - (when location - (with-current-buffer (car location) - (when (cdr location) (goto-char (cdr location))) - (when (re-search-backward "^;;; Generated autoloads from \\(.*\\)" nil t) - (setq file-name (match-string 1))))))) - (when (and (null file-name) (integerp (get variable 'variable-documentation))) - ;; It's a var not defined in Elisp but in C. - (setq file-name (if (get-buffer " *DOC*") - (help-C-file-name variable 'var) - 'C-source))) - (if file-name - (progn (princ " is a variable defined in `") - (princ (if (eq file-name 'C-source) "C source code" file-name)) - (princ "'.\n") - (with-current-buffer standard-output - (save-excursion - (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-variable-def variable file-name))) - (if valvoid (princ "It is void as a variable.") (princ "Its "))) - (if valvoid (princ " is void as a variable.") (princ "'s ")))) - (unless valvoid - (with-current-buffer standard-output - (setq val-start-pos (point)) - (princ "value is ") (terpri) - (let ((from (point))) - (pp val) - ;; Hyperlinks in variable's value are quite frequently inappropriate - ;; e.g `C-h v features ' - ;; (help-xref-on-pp from (point)) - (when (< (point) (+ from 20)) (delete-region (1- from) from))))) - (terpri) - (when (local-variable-p variable) - (princ (format "%socal in buffer %s; " - (if (get variable 'permanent-local) "Permanently l" "L") - (buffer-name))) - (if (not (default-boundp variable)) - (princ "globally void") - (let ((val (default-value variable))) - (with-current-buffer standard-output - (princ "global value is ") (terpri) - ;; Fixme: `pp' can take an age if you happen to ask for a very large expression. - ;; We should probably print it raw once and check it's a sensible size before - ;; prettyprinting. -- fx - (let ((from (point))) - (pp val) - ;; See previous comment for this function. - ;; (help-xref-on-pp from (point)) - (when (< (point) (+ from 20)) (delete-region (1- from) from))))))) - ;; Add a note for variables that have been `make-var-buffer-local'. - (when (and (local-variable-if-set-p variable) - (or (not (local-variable-p variable)) - (with-temp-buffer (local-variable-if-set-p variable)))) - (princ "\nAutomatically becomes buffer-local when set in any fashion.\n")) - (terpri) - (with-current-buffer standard-output ; If the value is large, move it to the end. - (when (> (count-lines (point-min) (point-max)) 10) - ;; Note that setting the syntax table like below makes `forward-sexp' move over a - ;; `'s' at the end of a symbol. - (set-syntax-table emacs-lisp-mode-syntax-table) - (goto-char val-start-pos) - ;; The line below previously read as - ;; (delete-region (point) (progn (end-of-line) (point))) - ;; which suppressed display of the buffer local value for large values. - (when (looking-at "value is") (replace-match "")) - (save-excursion (insert "\n\nValue:") - (set (make-local-variable 'help-button-cache) (point-marker))) - (insert "value is shown ") - (insert-button "below" 'action help-button-cache 'follow-link t - 'help-echo "mouse-2, RET: show value") - (insert ".\n"))) - ;; Mention if it's an alias - (let* ((alias (condition-case nil (indirect-variable variable) (error variable))) - (obsolete (get variable 'byte-obsolete-variable)) - (safe-var (get variable 'safe-local-variable)) - (doc (or (documentation-property variable 'variable-documentation) - (documentation-property alias 'variable-documentation)))) - (when (and (> (length doc) 1) (eq ?* (elt doc 0))) - (setq doc (substring doc 1))) ; Remove any user-variable prefix `*'. - (unless (eq alias variable) - (princ (format "\nThis variable is an alias for `%s'.\n" alias))) - (when (or obsolete safe-var) (terpri)) - (when obsolete - (princ "This variable is obsolete") - (when (cdr obsolete) (princ (format " since %s" (cdr obsolete)))) - (princ ";") (terpri) - (princ (if (stringp (car obsolete)) - (car obsolete) - (format "use `%s' instead." (car obsolete)))) - (terpri)) - (when safe-var - (princ "This variable is safe as a file local variable ") - (princ "if its value\nsatisfies the predicate ") - (princ (if (byte-code-function-p safe-var) - "which is byte-compiled expression.\n" - (format "`%s'.\n" safe-var)))) - (princ "\nDocumentation:\n") - ;; Use `insert', not `princ', to keep text properties. - ;; Was: (princ (or doc "Not documented as a variable."))) - (with-current-buffer standard-output - (insert (or (substitute-command-keys doc) "Not documented as a variable.")))) - ;; Make a link to customize if this variable can be customized. - (when (custom-variable-p variable) - (let ((customize-label "customize")) - (terpri) (terpri) (princ (concat "You can " customize-label " this variable.")) - (with-current-buffer standard-output - (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) - (help-xref-button 1 'help-customize-variable variable))))) - (print-help-return-message) - (with-current-buffer standard-output (buffer-string))))))))) ; Return the text displayed. - -;;; This macro is no different from what is in vanilla Emacs 23+. -;;; Add it here so this file can be byte-compiled with Emacs 22 and used with Emacs 23+. -(defmacro with-selected-frame (frame &rest body) - "Execute the forms in BODY with FRAME as the selected frame. -Save the selected frame, select FRAME, execute BODY, then restore the -originally selected frame. Return the value of the last form in BODY. - -This macro changes the order of neither the recently selected windows -nor the buffers in the buffer list. See also `with-temp-buffer'." - (declare (indent 1) (debug t)) - (let ((old-frame (make-symbol "old-frame")) - (old-buffer (make-symbol "old-buffer"))) - `(let ((,old-frame (selected-frame)) - (,old-buffer (current-buffer))) - (unwind-protect - (progn (if (> emacs-major-version 22) (select-frame ,frame 'NORECORD) (select-frame ,frame)) - ,@body) - (when (frame-live-p ,old-frame) - (if (> emacs-major-version 22) (select-frame ,old-frame 'NORECORD) (select-frame ,old-frame))) - (when (buffer-live-p ,old-buffer) (set-buffer ,old-buffer)))))) - - -;; REPLACE ORIGINAL in `help.el': -;; -;; 1. With a prefix argument, candidates are user variables (options) only. -;; 2. Preferred default candidate is `symbol-nearest-point'. -;; 3. Preserve text properties. -;; 4. Remove initial `*' from doc string (indicates it is a user variable). -;; 5. Call `Info-make-manuals-xref' to create a cross-ref link to manuals (Emacs 23.3). -;; 6. Add key-description buttons to command help. Use `insert', not `princ'. -;; 7. No no-function message if not called interactively. -;; -(when (= emacs-major-version 23) - (defun describe-variable (variable &optional buffer frame optionp) - "Display the full documentation of VARIABLE (a symbol). -VARIABLE names an Emacs Lisp variable, possibly a user option. -With a prefix argument, candidates are user variables (options) only. -Default candidate is the `symbol-nearest-point'. -Return the documentation, as a string. -If VARIABLE has a buffer-local value in BUFFER or FRAME -\(default to the current buffer and current frame), -it is displayed along with the global value." - (interactive - (let ((symb (or (and (fboundp 'symbol-nearest-point) (symbol-nearest-point)) - (variable-at-point))) - (enable-recursive-minibuffers t) - (completion-annotate-function (lambda (var) (and (custom-variable-p (intern-soft var)) " (option)"))) - val) - (when (numberp symb) (setq symb nil)) ; `variable-at-point' returns 0 when there is no var. - (setq val (completing-read - (format "Describe variable%s: " - (if (and symb (boundp symb)) (format " (default %s)" symb) "")) - obarray - (if current-prefix-arg - (lambda (vv) (user-variable-p vv)) - (lambda (vv) - (or (get vv 'variable-documentation) (and (boundp vv) (not (keywordp vv)))))) - t nil nil (and (symbolp symb) (boundp symb) (symbol-name symb)))) - (list (if (equal val "") symb (intern val)) - nil - nil - current-prefix-arg))) - (let (file-name) - (unless (buffer-live-p buffer) (setq buffer (current-buffer))) - (unless (frame-live-p frame) (setq frame (selected-frame))) - (if (not (symbolp variable)) - (when (if (or (> emacs-major-version 23) ; Emacs 23.1 `called-interactively' accepts no arg. - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p)) - (message "You did not specify a variable")) - (unless (or (not optionp) (user-variable-p variable)) - (error "Not a defined Emacs user option: `%s'" variable)) - ;;$$ (unless (boundp variable) (error "Not a defined Emacs variable: `%s'" variable)) - (save-excursion - (let ((valvoid (not (with-current-buffer buffer (boundp variable)))) - val val-start-pos locus) - ;; Extract the value before setting up the output buffer, in case BUFFER *is* the - ;; output buffer. - (unless valvoid - (with-selected-frame frame - (with-current-buffer buffer - (setq val (symbol-value variable) - locus (variable-binding-locus variable))))) - (help-setup-xref (list #'describe-variable variable buffer) - (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p))) - (with-help-window (help-buffer) - (with-current-buffer buffer - (prin1 variable) - (setq file-name (find-lisp-object-file-name variable 'defvar)) - (if file-name - (progn (princ " is a variable defined in `") - (princ (if (eq file-name 'C-source) - "C source code" - (file-name-nondirectory file-name))) - (princ "'.\n") - (with-current-buffer standard-output - (save-excursion - (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-variable-def variable file-name))) - (if valvoid (princ "It is void as a variable.") (princ "Its "))) - (if valvoid (princ " is void as a variable.") (princ "'s ")))) - (unless valvoid - (with-current-buffer standard-output - (setq val-start-pos (point)) - (princ "value is ") - (let ((from (point))) - (terpri) - (pp val) - (if (< (point) (+ 68 (line-beginning-position 0))) - (delete-region from (1+ from)) - (delete-region (1- from) from))))) - (terpri) - (when locus - (if (bufferp locus) - (princ (format "%socal in buffer %s; " - (if (get variable 'permanent-local) "Permanently l" "L") - (buffer-name))) - (princ (format "It is a frame-local variable; "))) - (if (not (default-boundp variable)) - (princ "globally void") - (let ((val (default-value variable))) - (with-current-buffer standard-output - (princ "global value is ") (terpri) - ;; Fixme: `pp' can take an age if you happen to ask for a very large expression. - ;; We should probably print it raw once and check it's a sensible size before - ;; prettyprinting. -- fx - (let ((from (point))) - (pp val) - ;; See previous comment for this function. - ;; (help-xref-on-pp from (point)) - (when (< (point) (+ from 20)) (delete-region (1- from) from)))))) - (terpri)) - (with-current-buffer standard-output ; If the value is large, move it to the end. - (when (> (count-lines (point-min) (point-max)) 10) - ;; Note that setting the syntax table like below makes `forward-sexp' move over a - ;; `'s' at the end of a symbol. - (set-syntax-table emacs-lisp-mode-syntax-table) - (goto-char val-start-pos) - ;; The line below previously read as - ;; (delete-region (point) (progn (end-of-line) (point))) - ;; which suppressed display of the buffer local value for large values. - (when (looking-at "value is") (replace-match "")) - (save-excursion (insert "\n\nValue:") (terpri) - (set (make-local-variable 'help-button-cache) (point-marker))) - (insert "value is shown ") - (insert-button "below" 'action help-button-cache 'follow-link t - 'help-echo "mouse-2, RET: show value") - (insert ".\n"))) - (terpri) - (let* ((alias (condition-case nil (indirect-variable variable) (error variable))) - (obsolete (get variable 'byte-obsolete-variable)) - (use (car obsolete)) - (safe-var (get variable 'safe-local-variable)) - (doc (or (help-documentation-property variable 'variable-documentation - nil 'ADD-HELP-BUTTONS) - (help-documentation-property alias 'variable-documentation - nil 'ADD-HELP-BUTTONS))) - (extra-line nil)) - (when (and (> (length doc) 1) (eq ?* (elt doc 0))) - (setq doc (substring doc 1))) ; Remove any user-variable prefix `*'. - ;; Add a note for variables that have been `make-var-buffer-local'. - (when (and (local-variable-if-set-p variable) - (or (not (local-variable-p variable)) - (with-temp-buffer (local-variable-if-set-p variable)))) - (setq extra-line t) - (princ " Automatically becomes buffer-local when set in any fashion.\n")) - ;; Mention if it's an alias - (unless (eq alias variable) - (setq extra-line t) - (princ (format " This variable is an alias for `%s'.\n" alias))) - (when obsolete - (setq extra-line t) - (princ " This variable is obsolete") - (when (cdr obsolete) (princ (format " since %s" (cdr obsolete)))) - (princ (cond ((stringp use) (concat ";\n " use)) - (use (format ";\n use `%s' instead." (car obsolete))) - (t "."))) - (terpri)) - (when (member (cons variable val) file-local-variables-alist) - (setq extra-line t) - (if (member (cons variable val) dir-local-variables-alist) - (let ((file (and (buffer-file-name) - (not (file-remote-p (buffer-file-name))) - (dir-locals-find-file (buffer-file-name))))) - (princ " This variable is a directory local variable") - (when file - (princ (concat "\n from the file \"" (if (consp file) (car file) file) - "\""))) - (princ ".\n")) - (princ " This variable is a file local variable.\n"))) - (when (memq variable ignored-local-variables) - (setq extra-line t) - (princ " This variable is ignored when used as a file local \ -variable.\n")) - ;; Can be both risky and safe, eg `auto-fill-function'. - (when (risky-local-variable-p variable) - (setq extra-line t) - (princ " This variable is potentially risky when used as a \ -file local variable.\n") - (when (assq variable safe-local-variable-values) - (princ " However, you have added it to \ -`safe-local-variable-values'.\n"))) - (when safe-var - (setq extra-line t) - (princ " This variable is safe as a file local variable ") - (princ "if its value\n satisfies the predicate ") - (princ (if (byte-code-function-p safe-var) - "which is byte-compiled expression.\n" - (format "`%s'.\n" safe-var)))) - (when extra-line (terpri)) - (princ "Documentation:\n") - (with-current-buffer standard-output - (insert (or doc "Not documented as a variable.")))) - ;; Make a link to customize if this variable can be customized. - (when (custom-variable-p variable) - (let ((customize-label "customize")) - (terpri) (terpri) - (princ (concat "You can " customize-label " this variable.")) - (with-current-buffer standard-output - (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) - (help-xref-button 1 'help-customize-variable variable)))) - ;; Note variable's version or package version - (let ((output (describe-variable-custom-version-info variable))) - (when output (terpri) (terpri) (princ output)))) - (when (boundp 'Info-virtual-files) ; Emacs 23.2+ - (unless valvoid - (with-current-buffer standard-output ; Link to manuals. - (Info-make-manuals-xref variable nil nil - (not (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) - (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p))))))) - (with-current-buffer standard-output (buffer-string))))))))) ; Return the text displayed. - - -;; REPLACE ORIGINAL in `help-fns.el': -;; -;; 1. With a prefix argument, candidates are user variables (options) only. -;; 2. Preferred default candidate is `symbol-nearest-point'. -;; 3. Preserve text properties. -;; 4. Remove initial `*' from doc string (indicates it is a user variable). -;; 5. Call `Info-make-manuals-xref' to create a cross-ref link to manuals (Emacs 23.3). -;; 6. Add key-description buttons to command help. Use `insert', not `princ'. -;; 7. No no-function message if not called interactively. -;; -(when (> emacs-major-version 23) - - (defface describe-variable-value '((((background dark)) (:foreground "#58DFFA4FFFFF")) ; a dark cyan - (t (:foreground "Firebrick"))) - "*Face used to highlight the variable value, for `describe-variable'." - :group 'help :group 'faces) - - (defun describe-variable (variable &optional buffer frame optionp) - "Display the full documentation of VARIABLE (a symbol). -VARIABLE names an Emacs Lisp variable, possibly a user option. -With a prefix argument, candidates are user variables (options) only. -Default candidate is the `symbol-nearest-point'. -Return the documentation, as a string. -If VARIABLE has a buffer-local value in BUFFER or FRAME -\(default to the current buffer and current frame), -it is displayed along with the global value." - (interactive - (let ((symb (or (and (fboundp 'symbol-nearest-point) (symbol-nearest-point)) - (variable-at-point))) - (enable-recursive-minibuffers t) - (completion-annotate-function (lambda (vv) (and (custom-variable-p (intern-soft vv)) " (option)"))) - val) - (when (numberp symb) (setq symb nil)) ; `variable-at-point' returns 0 when there is no var. - (setq val (completing-read - (format "Describe variable%s: " - (if (and symb (boundp symb)) (format " (default %s)" symb) "")) - obarray (if current-prefix-arg - (lambda (vv) (user-variable-p vv)) - (lambda (vv) (or (get vv 'variable-documentation) - (and (boundp vv) (not (keywordp vv)))))) - t nil nil (and (symbolp symb) (boundp symb) (symbol-name symb)))) - (list (if (equal val "") symb (intern val)) - nil - nil - current-prefix-arg))) - (let (file-name) - (unless (buffer-live-p buffer) (setq buffer (current-buffer))) - (unless (frame-live-p frame) (setq frame (selected-frame))) - (if (not (symbolp variable)) - (when (called-interactively-p 'interactive) (message "You did not specify a variable")) - (unless (or (not optionp) (user-variable-p variable)) - (error "Not a defined Emacs user option: `%s'" variable)) - ;;$$ (unless (boundp variable) (error "Not a defined Emacs variable: `%s'" variable)) - (save-excursion - (let ((valvoid (not (with-current-buffer buffer (boundp variable)))) - (permanent-local (get variable 'permanent-local)) - val val-start-pos locus) - ;; Extract the value before setting up the output buffer, in case BUFFER *is* the output buffer. - (unless valvoid - (with-selected-frame frame - (with-current-buffer buffer - (setq val (symbol-value variable) - locus (variable-binding-locus variable))))) - (help-setup-xref (list #'describe-variable variable buffer) - (called-interactively-p 'interactive)) - (with-help-window (help-buffer) - (with-current-buffer buffer - (prin1 variable) - (setq file-name (find-lisp-object-file-name variable 'defvar)) - (if file-name - (progn (princ " is a variable defined in `") - (princ (if (eq file-name 'C-source) - "C source code" - (file-name-nondirectory file-name))) - (princ "'.\n") - (with-current-buffer standard-output - (save-excursion (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-variable-def variable file-name))) - (if valvoid (princ "It is void as a variable.") (princ "Its "))) - (if valvoid (princ " is void as a variable.") (princ "'s ")))) - (unless valvoid - (with-current-buffer standard-output - (setq val-start-pos (point)) - (princ "value is ") - (let ((from (point)) - (line-beg (line-beginning-position)) - (print-rep (let ((print-quoted t)) - (prin1-to-string val)))) - (if (< (+ (length print-rep) (point) (- line-beg)) 68) - (progn (insert print-rep) - (put-text-property from (point) 'face 'describe-variable-value)) - (terpri) - (unless (or (numberp val) (symbolp val) (characterp val) - (and (stringp val) (string-match-p "[\n]" val))) - (terpri)) - (let ((opoint (point))) - (pp val) - (save-excursion (fill-region-as-paragraph opoint (point) nil t t))) - (put-text-property from (point) 'face 'describe-variable-value) - (if (< (point) (+ 68 (line-beginning-position 0))) - (delete-region from (1+ from)) - (delete-region (1- from) from))) - (let* ((sv (get variable 'standard-value)) - (origval (and (consp sv) - (condition-case nil (eval (car sv)) (error :help-eval-error))))) - (when (and (consp sv) - (not (equal origval val)) - (not (equal origval :help-eval-error))) - (princ "\nOriginal value was \n") - (setq from (point)) - (unless (or (numberp origval) (symbolp origval) (characterp origval) - (and (stringp origval) (string-match-p "[\n]" origval))) - (terpri)) - (let ((opoint (point))) - (pp origval) - (save-excursion (fill-region-as-paragraph opoint (point) nil t t))) - (put-text-property from (point) 'face 'describe-variable-value) - (when (< (point) (+ from 20)) (delete-region (1- from) from))))))) - (terpri) - (when locus - (cond ((bufferp locus) - (princ (format "%socal in buffer `%s'; " - (if (get variable 'permanent-local) "Permanently l" "L") - (buffer-name buffer)))) - ((framep locus) - (princ (format "It is a frame-local variable; "))) - ((terminal-live-p locus) - (princ (format "It is a terminal-local variable; "))) - (t (princ (format "It is local to %S" locus)))) - (if (not (default-boundp variable)) - (princ "globally void") - (let ((global-val (default-value variable))) - (with-current-buffer standard-output - (princ "global value is ") - (if (eq val global-val) - (princ "the same.") - (terpri) - ;; Fixme: `pp' can take an age if you happen to ask for a very large expression. - ;; We should probably print it raw once and check whether it is a sensible size, - ;; before prettyprinting. -- fx - (let ((from (point))) - (pp global-val) - ;; See previous comment for this function. (help-xref-on-pp from (point)) - (when (< (point) (+ from 20)) (delete-region (1- from) from))))))) - (terpri)) - (with-current-buffer standard-output ; If the value is large, move it to the end. - (when (> (count-lines (point-min) (point-max)) 10) - ;; Note that setting the syntax table like below makes `forward-sexp' move over a - ;; `'s' at the end of a symbol. - (set-syntax-table emacs-lisp-mode-syntax-table) - (goto-char val-start-pos) - ;; The line below previously read as (delete-region (point) (progn (end-of-line) (point))), - ;; which suppressed display of the buffer local value for large values. - (when (looking-at "value is") (replace-match "")) - (save-excursion (let ((nl-before (cond ((looking-back "[\n][\n]") "") - ((looking-back "[\n]") "\n") - (t "\n\n"))) - (nl-after (cond ((looking-at "[\n]") "") - (t "\n")))) - (insert (format "%sValue:%s" nl-before nl-after))) - (set (make-local-variable 'help-button-cache) (point-marker))) - (insert "value is shown ") - (insert-button "below" 'action help-button-cache 'follow-link t - 'help-echo "mouse-2, RET: show value") - (insert ".\n"))) - (terpri) - (let* ((alias (condition-case nil (indirect-variable variable) (error variable))) - (obsolete (get variable 'byte-obsolete-variable)) - (use (car obsolete)) - (safe-var (get variable 'safe-local-variable)) - (doc (or (help-documentation-property variable 'variable-documentation - nil 'ADD-HELP-BUTTONS) - (help-documentation-property alias 'variable-documentation - nil 'ADD-HELP-BUTTONS))) - (extra-line nil)) - (when (and (> (length doc) 1) (eq ?* (elt doc 0))) - (setq doc (substring doc 1))) ; Remove any user-variable prefix `*'. - (cond ((and (local-variable-if-set-p variable) ; Mention if it's a local variable. - (or (not (local-variable-p variable)) - (with-temp-buffer (local-variable-if-set-p variable)))) - (setq extra-line t) - (princ " Automatically becomes ") - (when permanent-local (princ "permanently ")) - (princ "buffer-local when set.\n")) - ((not permanent-local)) - ((bufferp locus) (princ " This variable's buffer-local value is permanent.\n")) - (t (princ " This variable's value is permanent when it is given a local binding.\n"))) - (unless (eq alias variable) ; Mention if it's an alias. - (setq extra-line t) - (princ (format " This variable is an alias for `%s'.\n" alias))) - (when obsolete - (setq extra-line t) - (princ " This variable is obsolete") - (when (nth 2 obsolete) (princ (format " since %s" (nth 2 obsolete)))) - (princ (cond ((stringp use) (concat ";\n " use)) - (use (format ";\n use `%s' instead." (car obsolete))) - (t "."))) - (terpri)) - (when (member (cons variable val) file-local-variables-alist) - (setq extra-line t) - (if (member (cons variable val) dir-local-variables-alist) - (let ((file (and (buffer-file-name) - (not (file-remote-p (buffer-file-name))) - (dir-locals-find-file (buffer-file-name)))) - (dir-file t)) - (princ " This variable's value is directory-local") - (if (null file) - (princ ".\n") - (princ ", set ") - (when (consp file) ; When result is from cache... - (if (nth 2 file) ; If cache element has an mtime, assume it came from a file. - (setq file (expand-file-name dir-locals-file (car file))) - (setq dir-file nil))) ; Otherwise, assume it was set directly. - (princ (if dir-file "by the file\n `" "for the directory\n `")) - (with-current-buffer standard-output - (insert-text-button file 'type 'help-dir-local-var-def - 'help-args (list variable file))) - (princ "'.\n"))) - (princ " This variable's value is file-local.\n"))) - (when (memq variable ignored-local-variables) - (setq extra-line t) - (princ " This variable is ignored when used as a file-local variable.\n")) - (when (risky-local-variable-p variable) ; Can be both risky & safe, eg `auto-fill-function'. - (setq extra-line t) - (princ " This variable can be risky when used as a file-local variable.\n") - (when (assq variable safe-local-variable-values) - (princ " However, it has been added to `safe-local-variable-values'.\n"))) - (when safe-var - (setq extra-line t) - (princ " This variable is safe as a file local variable ") - (princ "if its value\n satisfies the predicate ") - (princ (if (byte-code-function-p safe-var) - "which is a byte-compiled expression.\n" - (format "`%s'.\n" safe-var)))) - (when extra-line (terpri)) - (princ "Documentation:\n") - (with-current-buffer standard-output (insert (or doc "Not documented as a variable.")))) - ;; Make a link to customize if this variable can be customized. - (when (custom-variable-p variable) - (let ((customize-label "customize")) - (terpri) (terpri) - (princ (concat "You can " customize-label " this variable.")) - (with-current-buffer standard-output - (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) - (help-xref-button 1 'help-customize-variable variable)))) - ;; Note variable's version or package version - (let ((output (describe-variable-custom-version-info variable))) - (when output (terpri) (terpri) (princ output)))) - (unless valvoid - (with-current-buffer standard-output ; Link to manuals. - (Info-make-manuals-xref variable nil nil (not (called-interactively-p 'interactive))) - (let ((nb-nls (cond ((looking-at "[\n][\n][\n]") 3) - ((looking-at "[\n][\n]") 2) - ((looking-at "[\n]") 1) - (t 0)))) - (delete-region (- (line-beginning-position) nb-nls) (line-beginning-position))))) - (with-current-buffer standard-output (buffer-string))))))))) ; Return the text displayed. - -;;;###autoload -(defun describe-option (variable &optional buffer) ; Bound to `C-h o' - "Describe an Emacs user variable (option). -Same as using a prefix arg with `describe-variable'." - (interactive (let ((symb (or (and (fboundp 'symbol-nearest-point) - (symbol-nearest-point)) - (variable-at-point))) - (enable-recursive-minibuffers t)) - (when (numberp symb) (setq symb nil)) ; `variable-at-point' returns 0 when there is no var. - (list (intern (completing-read - (format "Describe user option%s: " - (if (and symb (user-variable-p symb)) - (format " (default %s)" symb) - "")) - obarray 'user-variable-p - t nil nil (and symb (user-variable-p symb) (symbol-name symb)) t))))) - (describe-variable variable buffer t)) - -;;;###autoload -(defun describe-option-of-type (type option) ; Bound to `C-h C-o' - "Describe an Emacs user OPTION (variable) of a given `defcustom' TYPE. -A prefix argument determines the type-checking behavior: - - None: OPTION is defined with TYPE or a subtype of TYPE. - - Plain `C-u': OPTION is defined with TYPE or a subtype of TYPE, - or its current value is compatible with TYPE. - - Negative: OPTION is defined with TYPE (exact match). - - Non-negative: OPTION is defined with TYPE (exact match), - or its current value is compatible with TYPE. - -If TYPE is nil (default value) then *all* `defcustom' variables are -potential candidates. That is different from using `describe-option', -because `describe-option' includes user-variable candidates not -defined with `defcustom' (with `*'-prefixed doc strings)." - (interactive - (let* ((symb (or (and (fboundp 'symbol-nearest-point) (symbol-nearest-point)) (variable-at-point))) - (typ (car (condition-case err - (read-from-string (let ((types ())) - (mapatoms - (lambda (cand) - (when (custom-variable-p cand) - (push (list - (format - "%s" - (format "%S" (get cand 'custom-type)))) - types)))) - (completing-read "Describe option of type: " - (help-remove-duplicates types) - nil nil nil nil "nil"))) - (end-of-file (error "No such custom type"))))) - (pref-arg current-prefix-arg)) - (when (numberp symb) (setq symb nil)) ; `variable-at-point' returns 0 when there is no var. - (list typ - (intern - (completing-read - (format "Option%s: " (if (and symb (user-variable-p symb)) (format " (default %s)" symb) "")) - obarray - (lambda (v) - (and (custom-variable-p v) - (or (not typ) ; Allow all vars if requested type = nil. - (help-var-is-of-type-p v (list typ) (cond ((not pref-arg) 'inherit) - ((consp pref-arg) 'inherit-or-value) - ((wholenump - (prefix-numeric-value pref-arg)) - 'direct-or-value) - (t 'direct)))))) - t nil nil (and symb (user-variable-p symb) (symbol-name symb)) t))))) - (describe-variable option nil t)) - -(defun help-var-is-of-type-p (variable types &optional mode) - "Return non-nil if VARIABLE satisfies one of the custom types in TYPES. -TYPES is a list of `defcustom' type sexps or a list of regexp strings. -TYPES are matched, in order, against VARIABLE's type definition or -VARIABLE's current value, until one is satisfied or all are tried. - -If TYPES is a list of regexps, then each is regexp-matched against -VARIABLE's custom type. - -Otherwise, TYPES is a list of type sexps, each of which is a -definition acceptable for `defcustom' :type or the first symbol of -such a definition (e.g. `choice'). In this case, two kinds of type -comparison are possible: - -1. VARIABLE's custom type, or its first symbol, is matched using - `equal' against each type in TYPES. - -2. VARIABLE's current value is checked against each type in TYPES to - see if it satisfies one of them. In this case, VARIABLE's own type - is not used; VARIABLE might not even be typed - it could be a - variable not defined using `defcustom'. - -For any of the comparisons against VARIABLE's type, either that type -can be checked directly or its supertypes (inherited types) can also -be checked. - -These different type-checking possibilities depend on the value of -argument MODE, as follows, and they determine the meaning of the -returned value: - -`direct': VARIABLE's type matches a member of list TYPES -`inherit': VARIABLE's type matches or is a subtype of a TYPES member -`value': VARIABLE is bound, and its value satisfies a type in TYPES -`inherit-or-value': `inherit' or `value', tested in that order -`direct-or-value': `direct' or `value', tested in that order -anything else (default): `inherit' - -VARIABLE's current value cannot satisfy a regexp type: it is -impossible to know which concrete types a value must match." - (case mode - ((nil inherit) (help-var-inherits-type-p variable types)) - (inherit-or-value (or (help-var-inherits-type-p variable types) - (help-var-val-satisfies-type-p variable types))) - (value (help-var-val-satisfies-type-p variable types)) - (direct (help-var-matches-type-p variable types)) - (direct-or-value (or (member (get variable 'custom-type) types) - (help-var-val-satisfies-type-p variable types))) - (otherwise (help-var-inherits-type-p variable types)))) - -(defun help-var-matches-type-p (variable types) - "VARIABLE's type matches a member of TYPES." - (catch 'help-type-matches - (let ((var-type (get variable 'custom-type))) - (dolist (type types) - (when (if (stringp type) - (save-match-data (string-match type (format "%s" (format "%S" var-type)))) - (equal var-type type)) - (throw 'help-type-matches t)))) - nil)) - -(defun help-var-inherits-type-p (variable types) - "VARIABLE's type matches or is a subtype of a member of list TYPES." - (catch 'help-type-inherits - (let ((var-type (get variable 'custom-type))) - (dolist (type types) - (while var-type - (when (or (and (stringp type) - (save-match-data (string-match type (format "%s" (format "%S" var-type))))) - (equal type var-type)) - (throw 'help-type-inherits t)) - (when (consp var-type) (setq var-type (car var-type))) - (when (or (and (stringp type) - (save-match-data (string-match type (format "%s" (format "%S" var-type))))) - (equal type var-type)) - (throw 'help-type-inherits t)) - (setq var-type (car (get var-type 'widget-type)))) - (setq var-type (get variable 'custom-type)))) - nil)) - -(defun help-var-val-satisfies-type-p (variable types) - "VARIABLE is bound, and its value satisfies a type in the list TYPES." - (and (boundp variable) - (let ((val (symbol-value variable))) - (and (widget-convert (get variable 'custom-type)) (help-value-satisfies-type-p val types))))) - -(defun help-value-satisfies-type-p (value types) - "Return non-nil if VALUE satisfies a type in the list TYPES." - (catch 'help-type-value-satisfies - (dolist (type types) - (unless (stringp type) ; Skip, for regexp type. - (setq type (widget-convert type)) - (when (condition-case nil ; Satisfies if either :match or :validate. - (progn (when (and (widget-get type :match) (widget-apply type :match value)) - (throw 'help-type-value-satisfies t)) - (when (and (widget-get type :validate) - (progn (widget-put type :value value) - (not (widget-apply type :validate)))) - (throw 'help-type-value-satisfies t))) - (error nil)) - (throw 'help-type-value-satisfies t)))) - nil)) - -(defun help-custom-type (variable) - "Returns the `defcustom' type of VARIABLE. -Returns nil if VARIABLE is not a user option. - -Note: If the library that defines VARIABLE has not yet been loaded, -then `help-custom-type' loads it. Be sure you want to do that -before you call this function." - (and (custom-variable-p variable) - (or (get variable 'custom-type) (progn (custom-load-symbol variable) - (get variable 'custom-type))))) - -;; Borrowed from `ps-print.el' -(defun help-remove-duplicates (list) - "Copy of LIST with duplicate elements removed. Tested with `equal'." - (let ((tail list) - new) - (while tail - (unless (member (car tail) new) (push (car tail) new)) - (pop tail)) - (nreverse new))) - - -;; REPLACE ORIGINAL in `faces.el': -;; -;; Call `Info-make-manuals-xref' to create a cross-ref link to manuals. -;; -(when (or (> emacs-major-version 23) (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (defun describe-face (face &optional frame) - "Display the properties of face FACE on FRAME. -Interactively, FACE defaults to the faces of the character after point -and FRAME defaults to the selected frame. - -If the optional argument FRAME is given, report on face FACE in that frame. -If FRAME is t, report on the defaults for face FACE (for new frames). -If FRAME is omitted or nil, use the selected frame." - (interactive - (list (read-face-name "Describe face" (if (> emacs-major-version 23) - (or (face-at-point t) 'default) - "= `default' face") - t))) - (let* ((attrs '((:family . "Family") - (:foundry . "Foundry") - (:width . "Width") - (:height . "Height") - (:weight . "Weight") - (:slant . "Slant") - (:foreground . "Foreground") - (:background . "Background") - (:underline . "Underline") - (:overline . "Overline") - (:strike-through . "Strike-through") - (:box . "Box") - (:inverse-video . "Inverse") - (:stipple . "Stipple") - (:font . "Font") - (:fontset . "Fontset") - (:inherit . "Inherit"))) - (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x))) attrs)))) - (help-setup-xref (list #'describe-face face) (called-interactively-p 'interactive)) - (unless face (setq face 'default)) - (unless (listp face) (setq face (list face))) - (with-help-window (help-buffer) - (with-current-buffer standard-output - (dolist (f face) - (when (stringp f) (setq f (intern f))) - ;; We may get called for anonymous faces (i.e., faces expressed using prop-value plists). - ;; Those can't be usefully customized, so ignore them. - (when (symbolp f) - (insert "Face: " (symbol-name f)) - (if (not (facep f)) - (insert " undefined face.\n") - (let ((customize-label "customize this face") - file-name) - (insert (concat " (" (propertize "sample" 'font-lock-face f) ")")) - (princ (concat " (" customize-label ")\n")) - ;; FIXME not sure how much of this belongs here, how much in `face-documentation'. - ;; The latter is not used much, but needs to return nil for undocumented faces. - (let ((alias (get f 'face-alias)) - (face f) - obsolete) - (when alias - (setq face alias) - (insert (format "\n %s is an alias for the face `%s'.\n%s" f alias - (if (setq obsolete (get f 'obsolete-face)) - (format " This face is obsolete%s; use `%s' instead.\n" - (if (stringp obsolete) (format " since %s" obsolete) "") - alias) - "")))) - (insert "\nDocumentation:\n" (or (face-documentation face) - "Not documented as a face.") - "\n\n")) - (with-current-buffer standard-output - (save-excursion (re-search-backward (concat "\\(" customize-label "\\)") nil t) - (help-xref-button 1 'help-customize-face f))) - (setq file-name (find-lisp-object-file-name f 'defface)) - (when file-name - (princ "Defined in `") (princ (file-name-nondirectory file-name)) (princ "'") - (save-excursion ; Make a hyperlink to the library. - (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-face-def f file-name)) - (princ ".") (terpri) (terpri)) - (dolist (a attrs) - (let ((attr (face-attribute f (car a) frame))) - (insert (make-string (- max-width (length (cdr a))) ?\s) - (cdr a) ": " (format "%s" attr)) - (when (and (eq (car a) :inherit) (not (eq attr 'unspecified))) - (save-excursion ; Make a hyperlink to the parent face. - (re-search-backward ": \\([^:]+\\)" nil t) - (help-xref-button 1 'help-face attr))) - (insert "\n"))) - (when (boundp 'Info-virtual-files) ; Emacs 23.2+ - (with-current-buffer standard-output ; Link to manuals. - (Info-make-manuals-xref f nil nil (not (called-interactively-p 'interactive))))))) - (terpri)))))))) - -;;;###autoload -(defun describe-file (filename &optional internal-form-p no-error-p) ; Bound to `C-h M-f' - "Describe the file named FILENAME. -If FILENAME is nil, describe current directory (`default-directory'). - -Starting with Emacs 22, if the file is an image file then: - * Show a thumbnail of the image as well. - * If you have command-line tool `exiftool' installed and in your - `$PATH' or `exec-path', then show EXIF data (metadata) about the - image. See standard Emacs library `image-dired.el' for more - information about `exiftool'. - -If FILENAME is the name of an autofile bookmark and you use library -`Bookmark+', then show also the bookmark information (tags etc.). In -this case, a prefix arg shows the internal form of the bookmark. - -In Lisp code: - -Non-nil optional arg INTERNAL-FORM-P shows the internal form. -Non-nil optional arg NO-ERROR-P prints an error message but does not - raise an error." - (interactive "FDescribe file: \nP") - (unless filename (setq filename default-directory)) - (help-setup-xref `(describe-file ,filename ,internal-form-p ,no-error-p) - (if (or (> emacs-major-version 23) ; Emacs 23.1 `called-interactively' accepts no arg. - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p))) - (let ((attrs (file-attributes filename)) - ;; Functions `bmkp-*' are defined in `bookmark+.el'. - (bmk (and (fboundp 'bmkp-get-autofile-bookmark) (bmkp-get-autofile-bookmark filename)))) - (if (not attrs) - (if no-error-p (message "Cannot open file `%s'" filename) (error "Cannot open file `%s'" filename)) - (let* ((type (nth 0 attrs)) - (numlinks (nth 1 attrs)) - (uid (nth 2 attrs)) - (gid (nth 3 attrs)) - (last-access (nth 4 attrs)) - (last-mod (nth 5 attrs)) - (last-status-chg (nth 6 attrs)) - (size (nth 7 attrs)) - (permissions (nth 8 attrs)) - ;; Skip 9: t iff file's gid would change if file were deleted and recreated. - (inode (nth 10 attrs)) - (device (nth 11 attrs)) - (thumb-string (and (fboundp 'image-file-name-regexp) ; In `image-file.el' (Emacs 22+). - (if (fboundp 'string-match-p) - (string-match-p (image-file-name-regexp) filename) - (save-match-data - (string-match (image-file-name-regexp) filename))) - (if (fboundp 'display-graphic-p) (display-graphic-p) window-system) - (require 'image-dired nil t) - (image-dired-get-thumbnail-image filename) - (apply #'propertize "XXXX" - `(display ,(append (image-dired-get-thumbnail-image filename) - '(:margin 10)) - rear-nonsticky (display) - mouse-face highlight - follow-link t - help-echo "`mouse-2' or `RET': Show full image" - keymap (keymap - (mouse-2 . (lambda (e) (interactive "e") - (find-file ,filename))) - (13 . (lambda () (interactive) - (find-file ,filename)))))))) - (image-info (and (require 'image-dired nil t) - (fboundp 'image-file-name-regexp) - (if (fboundp 'string-match-p) - (string-match-p (image-file-name-regexp) filename) - (save-match-data - (string-match (image-file-name-regexp) filename))) - (progn (when (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) - (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p)) - (message "Gathering image data...")) t) - (condition-case nil - (let ((all (help-all-exif-data (expand-file-name filename)))) - (concat - (and all - (not (zerop (length all))) - (format "\nImage Data (EXIF)\n-----------------\n%s" all)))) - (error nil)))) - (help-text (concat - (format "`%s'\n%s\n\n" filename (make-string (+ 2 (length filename)) ?-)) - (format "File Type: %s\n" - (cond ((eq t type) "Directory") - ((stringp type) (format "Symbolic link to `%s'" type)) - (t "Normal file"))) - (format "Permissions: %s\n" permissions) - (and (not (eq t type)) (format "Size in bytes: %g\n" size)) - (format-time-string - "Time of last access: %a %b %e %T %Y (%Z)\n" last-access) - (format-time-string - "Time of last modification: %a %b %e %T %Y (%Z)\n" last-mod) - (format-time-string - "Time of last status change: %a %b %e %T %Y (%Z)\n" last-status-chg) - (format "Number of links: %d\n" numlinks) - (format "User ID (UID): %s\n" uid) - (format "Group ID (GID): %s\n" gid) - (format "Inode: %S\n" inode) - (format "Device number: %s\n" device) - image-info))) - (if (fboundp 'with-help-window) - (with-help-window (help-buffer) - (when bmk - (if internal-form-p - (let* ((bname (bookmark-name-from-full-record bmk)) - (bmk-defn (format "Bookmark `%s'\n%s\n\n%s" bname - (make-string (+ 11 (length bname)) ?-) - (pp-to-string bmk)))) - (princ bmk-defn) (terpri) (terpri)) - (princ (bmkp-bookmark-description bmk 'NO-IMAGE)) (terpri) (terpri))) - (princ help-text)) - (with-output-to-temp-buffer "*Help*" - (when bmk - (if internal-form-p - (let* ((bname (bookmark-name-from-full-record bmk)) - (bmk-defn (format "Bookmark `%s'\n%s\n\n%s" bname - (make-string (+ 11 (length bname)) ?-) - (pp-to-string bmk)))) - (princ bmk-defn) (terpri) (terpri)) - (princ (bmkp-bookmark-description bmk 'NO-IMAGE)) (terpri) (terpri))) - (princ help-text))) - (when thumb-string - (with-current-buffer "*Help*" - (save-excursion - (goto-char (point-min)) - (let ((buffer-read-only nil)) - (when (re-search-forward "Device number:.+\n" nil t) (insert thumb-string)))))) - help-text)))) ; Return displayed text. - -(defun help-all-exif-data (file) - "Return all EXIF data from FILE, using command-line tool `exiftool'." - (with-temp-buffer - (delete-region (point-min) (point-max)) - (unless (eq 0 (call-process shell-file-name nil t nil shell-command-switch - (format "exiftool -All \"%s\"" file))) - (error "Could not get EXIF data")) - (buffer-substring (point-min) (point-max)))) - -(defun describe-keymap (keymap) ; Bound to `C-h M-k' - "Describe bindings in KEYMAP, a variable whose value is a keymap. -Completion is available for the keymap name." - (interactive - (list (intern (completing-read "Keymap: " obarray - (lambda (m) (and (boundp m) (keymapp (symbol-value m)))) - t nil 'variable-name-history)))) - (unless (and (symbolp keymap) (boundp keymap) (keymapp (symbol-value keymap))) - (error "`%S' is not a keymapp" keymap)) - (let ((name (symbol-name keymap)) - (doc (if (fboundp 'help-documentation-property) ; Emacs 23+ - (help-documentation-property keymap 'variable-documentation - nil 'ADD-HELP-BUTTONS) - (documentation-property keymap 'variable-documentation)))) - (help-setup-xref (list #'describe-keymap keymap) - (if (or (> emacs-major-version 23) ; Emacs 23.1 `called-interactively' accepts no arg. - (and (= emacs-major-version 23) (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p))) - (if (fboundp 'with-help-window) - (with-help-window (help-buffer) - (princ name) (terpri) (princ (make-string (length name) ?-)) (terpri) (terpri) - (when doc - (when (boundp 'Info-virtual-files) ; Emacs 23.2+ - (with-current-buffer "*Help*" ; Link to manuals. - (Info-make-manuals-xref name nil nil (not (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) - (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p)))))) - (princ doc) (terpri) (terpri)) - ;; Use `insert' instead of `princ', so control chars (e.g. \377) insert correctly. - (with-current-buffer "*Help*" (insert (substitute-command-keys (concat "\\{" name "}"))))) - (with-output-to-temp-buffer "*Help*" - (princ name) (terpri) (princ (make-string (length name) ?-)) (terpri) (terpri) - (when doc - (when (boundp 'Info-virtual-files) ; Emacs 23.2+ - (with-current-buffer "*Help*" ; Link to manuals. - (Info-make-manuals-xref name nil nil (not (if (or (> emacs-major-version 23) - (and (= emacs-major-version 23) - (> emacs-minor-version 1))) - (called-interactively-p 'interactive) - (interactive-p)))))) - (princ doc) (terpri) (terpri)) - ;; Use `insert' instead of `princ', so control chars (e.g. \377) insert correctly. - (with-current-buffer "*Help*" (insert (substitute-command-keys (concat "\\{" name "}")))))))) - - -;; REPLACE ORIGINAL in `package.el': -;; -;; Call `Info-make-manuals-xref' to create a cross-ref link to manuals. -;; -(when (fboundp 'describe-package) ; Emacs 24+ - - (when (or (> emacs-major-version 24) (and (= emacs-major-version 24) (> emacs-minor-version 24))) - (defun describe-package (package) - "Display the full documentation of PACKAGE (a symbol)." - (interactive - (let* ((guess (function-called-at-point))) - (require 'finder-inf nil t) - ;; Load the package list if necessary (but don't activate them). - (unless package--initialized - (package-initialize t)) - (let ((packages (append (mapcar 'car package-alist) - (mapcar 'car package-archive-contents) - (mapcar 'car package--builtins)))) - (unless (memq guess packages) - (setq guess nil)) - (setq packages (mapcar 'symbol-name packages)) - (let ((val - (completing-read (if guess - (format "Describe package (default %s): " - guess) - "Describe package: ") - packages nil t nil nil guess))) - (list (intern val)))))) - (if (not (or (package-desc-p package) (and package (symbolp package)))) - (message "No package specified") - (help-setup-xref (list #'describe-package package) - (called-interactively-p 'interactive)) - (with-help-window (help-buffer) - (with-current-buffer standard-output - (describe-package-1 package) - (let* ((desc (or (and (package-desc-p package) package) - (cadr (assq package package-alist)) - (let ((built-in (assq package package--builtins))) - (if built-in - (package--from-builtin built-in) - (cadr (assq package package-archive-contents)))))) - (name (if desc (package-desc-name desc) package))) - (setq package name) - (Info-make-manuals-xref (concat (symbol-name package) " package") - nil nil (not (called-interactively-p 'interactive))))))))) ; Link to manuals - - (unless (or (> emacs-major-version 24) (and (= emacs-major-version 24) (> emacs-minor-version 24))) - (defun describe-package (package) - "Display the full documentation of PACKAGE (a symbol)." - (interactive - (let* ((guess (function-called-at-point))) - (require 'finder-inf nil t) - ;; Load the package list if necessary (but don't activate them). - (unless package--initialized (package-initialize t)) - (let ((packages (append (mapcar 'car package-alist) (mapcar 'car package-archive-contents) - (mapcar 'car package--builtins)))) - (unless (memq guess packages) (setq guess nil)) - (setq packages (mapcar 'symbol-name packages)) - (let ((val (completing-read (if guess - (format "Describe package (default %s): " guess) - "Describe package: ") - packages nil t nil nil guess))) - (list (if (equal val "") guess (intern val))))))) - (if (not (or (and (fboundp 'package-desc-p) (package-desc-p package)) - (and package (symbolp package)))) - (when (called-interactively-p 'interactive) (message "No package specified")) - (help-setup-xref (list #'describe-package package) (called-interactively-p 'interactive)) - (with-help-window (help-buffer) - (with-current-buffer standard-output - (describe-package-1 package) - (when (fboundp 'package-desc-name) (setq package (package-desc-name package))) ; Emacs 24.4 - (Info-make-manuals-xref (concat (symbol-name package) " package") - nil nil (not (called-interactively-p 'interactive)))))))) ; Link to manuals - - ) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(provide 'help-fns+) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; help-fns+.el ends here diff --git a/contrib/hide-mode-line.el b/contrib/hide-mode-line.el deleted file mode 100644 index 86b739501..000000000 --- a/contrib/hide-mode-line.el +++ /dev/null @@ -1,252 +0,0 @@ -;;; hide-mode-line.el --- Hides the mode line when there is only one frame and -;;; one buffer. -;; -;; Filename: hide-mode-line.el -;; Description: Hides the mode line when there is only one frame and one -;; buffer. -;; Author: Darren Embry -;; Copyright (c) 2008, 2011 Darren Embry -;; URL: http://webonastick.com/emacs-lisp/hide-mode-line.el -;; Keywords: mode line, writeroom -;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x -;; -;; Features that might be required by this library: -;; -;; None -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; This program is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by the Free -;; Software Foundation; either version 2, or (at your option) any later -;; version. -;; -;; This program is distributed in the hope that it will be useful, but WITHOUT -;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -;; more details. -;; -;; You should have received a copy of the GNU General Public License along -;; with this program; see the file COPYING. If not, write to the Free -;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. -;; -;; GPL 2 is available here: -;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Basically, automatically hides the mode-line if all of the following -;; are true: -;; - there is only one frame. -;; - there is only one window displayed in that frame. -;; - there is no minibuffer. -;; - the hide-mode-line variable is set. -;; and automatically shows the mode-line when any of the above isn't true. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; HOW TO USE -;; -;; Just put this file in your Emacs library directory and add this line to -;; your ~/.emacs: -;; -;; (autoload 'hide-mode-line "hide-mode-line" nil t) -;; -;; and use M-x hide-mode-line to toggle. Setting the hide-mode-line variable -;; won't automatically update the buffers' mode-line visibilities. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; MYSTERY BUG: every once in a while a few lines of text will be hidden -;; for some reason until you do a redraw-display. See if you can -;; reproduce this in a reliable fashion! -;; -;; MYSTERY BUG: not specific to this module, but... load linum, run M-x -;; linum-mode, then (setq mode-line-format nil) this triggers display -;; problems more reproducibly: sometimes the last line in the buffer -;; doesn't have the line number show up; and sometimes the cursor line -;; or the one after it doesn't have the line number show up. May be -;; related to above bug. -;; -;; CAVEAT: this code does not instruct your window system to make the -;; window full-screen. -;; -;; TODO: briefly show modeline for (example) 2 seconds when the following -;; happens: -;; - hide-mode-line is about to be activated -;; - you switch to another buffer -;; -;; TODO: Emacs 21 does not implement window-tree. -;; -;; BUG: if the hide-mode-line-window-configuration-change-hook function -;; displays a (message "moo") before it does its work, the screen is blanked -;; when you resize the window until you hit C-l. -;; -;; BUG: if a frame is closed and there is only one frame remaining, and -;; there is only one buffer in that window, mode lines are not hidden. -;; -;; SEE ALSO: -;; http://www.emacswiki.org/cgi-bin/wiki/LineNumbers -;; http://www.emacswiki.org/cgi-bin/wiki/WriteRoom -;; -;;============================================================================= - -;;; History: -;; -;; 2008-01-31 r3090 initial version -;; 2008-02-01 r3097 explicitly defint default for -;; hide-mode-line-saved-mode-line-format -;; 2008-02-01 r3100 implement hide-mode-line-unaffected-by-minibuffer -;; 2008-02-01 r3101 more robust handling of case where mode-line-format is -;; nil before this code runs -;; 2008-02-01 r3106 disable in emacs21: window-tree function not available -;; 2011-03-08 r5835 fix emacsw32 bug - -;;; Code: - -(defvar hide-mode-line-saved-mode-line-format nil) -(make-variable-buffer-local 'hide-mode-line-saved-mode-line-format) -; TODO: add a hook of some kind when setting mode-line-format. - -(defvar hide-mode-line nil) -; TODO: add a hook to run hide-mode-line-update when setting hide-mode-line. -; [or just use M-x hide-mode-line for now] - -(defcustom hide-mode-line-unaffected-by-minibuffer nil - "If non-nil, a minibuffer by itself does not un-hide the modeline." - :group 'hide-mode-line - :type 'boolean) - -(defun there-is-only-one-frame () - "Return non-nil if there is only one frame, nil otherwise." - (let ((frames (frames-on-display-list))) - (if (= (length frames) 1) - (car frames) - nil))) -(defun there-is-only-one-window-in (frame) - "Return non-nil if there is only one window in the specified FRAME." - (let ((root (car (window-tree frame)))) ;FIXME: does not work with emacs21 - (not (listp root)))) -(defun there-is-only-one-frame-and-one-window () - "Return non-nil if there is only one frame and one window." - (let ((the-only-frame (there-is-only-one-frame))) - (and the-only-frame - (or hide-mode-line-unaffected-by-minibuffer - (= (minibuffer-depth) 0)) - (there-is-only-one-window-in the-only-frame)))) - -(defun hide-mode-line-in (buffer) - "Hide the specified BUFFER's mode line. - -Saves the buffer's previous `mode-line-format' value if it's not -already hidden." - (with-current-buffer buffer - (if (and (not hide-mode-line-saved-mode-line-format) - ;; minibuffers don't have modelines :p - (not (minibufferp buffer))) - (progn (setq hide-mode-line-saved-mode-line-format - (list mode-line-format)) - (setq mode-line-format nil) - ;; bug workaround - (redraw-modeline))))) -(defun show-mode-line-in (buffer) - "If the specified BUFFER's mode line is hidden, un-hides it. - -Restores the buffer's `mode-line-format' from what was saved when -hide-mode-line-in was called." - (with-current-buffer buffer - (if (and hide-mode-line-saved-mode-line-format - ;; minibuffers don't have modelines :p - (not (minibufferp buffer))) - (progn (setq mode-line-format - (car hide-mode-line-saved-mode-line-format)) - (setq hide-mode-line-saved-mode-line-format nil))))) - -(defun hide-mode-lines () - "Hide all buffers' mode lines using hide-mode-line-in." - (mapcar 'hide-mode-line-in (buffer-list))) -(defun show-mode-lines () - "Show all buffers' mode lines using show-mode-line-in." - (mapcar 'show-mode-line-in (buffer-list)) - (if (equal window-system 'w32) - ;; bug workaround - (redraw-display))) - -(defun hide-mode-line-update () - "Update the state of all buffers' mode lines. - -This uses hide-mode-lines or show-mode-lines." - (if hide-mode-line - (if (there-is-only-one-frame-and-one-window) - (hide-mode-lines) - (show-mode-lines)) - (show-mode-lines))) - -(defun hide-mode-line-minibuffer-setup-hook () - "Internal function." - (hide-mode-line-update)) -(defun hide-mode-line-minibuffer-exit-hook () - "Internal function." - (hide-mode-line-update)) -(defun hide-mode-line-make-frame-function (new-frame) - "Internal function." - (hide-mode-line-update)) -(defun hide-mode-line-delete-frame-function (dead-frame-walking) - "Internal function." - (hide-mode-line-update)) -(defun hide-mode-line-window-configuration-change-hook () - "Internal function." - (hide-mode-line-update)) - -(defun hide-mode-line-add-hooks () - "Internal function." - (interactive) - (add-hook 'minibuffer-setup-hook - 'hide-mode-line-minibuffer-setup-hook) - (add-hook 'minibuffer-exit-hook - 'hide-mode-line-minibuffer-exit-hook) - (add-hook 'after-make-frame-functions - 'hide-mode-line-make-frame-function) - (add-hook 'delete-frame-functions - 'hide-mode-line-delete-frame-function) - (add-hook 'window-configuration-change-hook - 'hide-mode-line-window-configuration-change-hook)) - -(defun hide-mode-line-remove-hooks () - "Internal function." - (interactive) - (remove-hook 'minibuffer-setup-hook - 'hide-mode-line-minibuffer-setup-hook) - (remove-hook 'minibuffer-exit-hook - 'hide-mode-line-minibuffer-exit-hook) - (remove-hook 'after-make-frame-functions - 'hide-mode-line-make-frame-function) - (remove-hook 'delete-frame-functions - 'hide-mode-line-delete-frame-function) - (remove-hook 'window-configuration-change-hook - 'hide-mode-line-window-configuration-change-hook)) - -;;;###autoload -(defun hide-mode-line () - "Toggle the hide-mode-line functionality." - (interactive) - (if (functionp 'window-tree) - (progn - (if hide-mode-line - (hide-mode-line-remove-hooks) - (hide-mode-line-add-hooks)) - (setq hide-mode-line (not hide-mode-line)) - (hide-mode-line-update)) - (error (concat "Your Emacs does not provide the window-tree function. " - "Please upgrade to GNU Emacs 22 " - "or to some other version of Emacs that provides it.")))) - -(provide 'hide-mode-line) - -;;; hide-mode-line.el ends here - diff --git a/contrib/hl-todo.el b/contrib/hl-todo.el deleted file mode 100644 index 02e8167c1..000000000 --- a/contrib/hl-todo.el +++ /dev/null @@ -1,107 +0,0 @@ -;;; hl-todo.el --- highlight TODO keywords - -;; Copyright (C) 2013-2014 Jonas Bernoulli - -;; Author: Jonas Bernoulli -;; Created: 20130310 -;; Homepage: http://github.com/tarsius/hl-todo -;; Keywords: convenience - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; For a full copy of the GNU General Public License -;; see . - -;;; Commentary: - -;; Hightlight TODO keywords. There are many minor modes like it -;; but this one is mine. It also happens to be simpler than the -;; alternatives. - -;; For now at least -- I might extend it. Or I might abandon it -;; in favor of one of the following -- so you might be better of -;; going straight for one of these: - -;; - [[http://emacswiki.org/fic-ext-mode.el][fic-ext-mode]] -;; - [[https://github.com/lewang/fic-mode][fic-mode]] -;; - [[http://emacswiki.org/FixmeMode][fixme-mode]] -;; - [[https://github.com/rolandwalker/fixmee][fixmee]] -;; - see http://emacswiki.org/FixmeMode for more alternatives - -;; If you like this you might also like [[https://github.com/tarsius/orglink][orglink]]. - -;;; Code: - -(defgroup hl-todo nil - "Highlight TODO keywords in comments." - :group 'font-lock-extra-types) - -(defface hl-todo - '((t (:bold t :foreground "#cc9393"))) - "Face used to highlight TODO keywords." - :group 'hl-todo) - -(defcustom hl-todo-activate-in-modes '(emacs-lisp-mode) - "Major modes in which `hl-todo-mode' should be activated. -This is used by `global-hl-todo-mode'." - :group 'hl-todo - :type '(repeat function)) - -(defvar hl-todo-keywords nil) - -(defcustom hl-todo-keyword-faces - '(("\\(\\bTODO\\((.*)\\)?:?\\)" . "#cc9393") - ("\\(\\bNOTE\\((.*)\\)?:?\\)" . "#d0bf8f") - ("\\(\\bFIXME\\((.*)\\)?:?\\)" . "#cc9393")) - "Faces used to highlight specific TODO keywords." - :group 'hl-todo - :type '(repeat (cons (string :tag "Keyword") - (choice :tag "Face " - (string :tag "Color") - (sexp :tag "Face")))) - :set (lambda (symbol value) - (set-default symbol value) - (setq hl-todo-keywords - `((,(concat "\\_<\\(" - (mapconcat 'car value "\\|") - "\\)\\_>") - (1 (hl-todo-get-face) t)))))) - -(defun hl-todo-get-face () - (let ((f (cdr (assoc (match-string 1) hl-todo-keyword-faces)))) - (if (stringp f) (list :inherit 'hl-todo :foreground f) f))) - -;;;###autoload -(define-minor-mode hl-todo-mode - "Highlight TODO tags in comments." - :lighter "" - :group 'hl-todo - (if hl-todo-mode - (font-lock-add-keywords nil hl-todo-keywords 'append) - (font-lock-remove-keywords nil hl-todo-keywords)) - (when (called-interactively-p 'any) - (font-lock-fontify-buffer))) - -;;;###autoload -(define-globalized-minor-mode global-hl-todo-mode - hl-todo-mode turn-on-hl-todo-mode-if-desired) - -(defun turn-on-hl-todo-mode-if-desired () - (when (apply 'derived-mode-p hl-todo-activate-in-modes) - (hl-todo-mode 1))) - -(provide 'hl-todo) -;; Local Variables: -;; indent-tabs-mode: nil -;; End: -;;; hl-todo.el ends here diff --git a/contrib/ruby-mode-indent-fix.el b/contrib/ruby-mode-indent-fix.el deleted file mode 100644 index 6e40b42a3..000000000 --- a/contrib/ruby-mode-indent-fix.el +++ /dev/null @@ -1,195 +0,0 @@ -;;; ruby-mode-indent-fix.el --- - -;; this file is not part of Emacs - -;; Copyright (C) 2012 Le Wang -;; Author: Le Wang -;; Maintainer: Le Wang -;; Description: -;; Author: Le Wang -;; Maintainer: Le Wang - -;; Created: Sun Feb 26 23:27:17 2012 (+0800) -;; Version: 0.1 -;; Last-Updated: Mon Mar 26 11:23:48 2012 (+0800) -;; By: Le Wang -;; Update #: 29 -;; URL: -;; Keywords: -;; Compatibility: - -;;; Installation: - -;; (eval-after-load "ruby-mod" '(require 'ruby-mode-indent-fix)) -;; -;; - -;;; Commentary: - -;; Fix some indentation issues with ruby-mode with advices. -;; -;; Based on work by Dmitry Gutov(dgutov) -;; - http://stackoverflow.com/a/7622971/903943 and -;; - https://gist.github.com/1274520 - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; 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, 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; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; Code: - -(eval-when-compile (require 'cl)) - -(defvar ruby--paren-closings-regex - "[])}\"']" - "regex matching closing paren or string delimiter.") - -;; We make this advice around to avoid unnecessary buffer modifications. - -(defadvice ruby-indent-line (around fix-closing-paren activate) - "indent closing paren to line up properly. - -i.e. - - foo_function( {:a => 'foo', - :b => 'bar' - } - ) - -Note that the closing paren is vertically aligned with the opening paren. - -note: `ruby-deep-indent-paren' has to be enabled for this to work." - (let ((column (current-column)) - indent) - (when ruby-deep-indent-paren - (save-excursion - (back-to-indentation) - (let ((state (syntax-ppss))) - (when (and (or (memq (sp-get-pair (char-after)) ruby-deep-indent-paren) - (and (eq (char-after) ?\}) - (eq 'brace (ruby--point-in-braced-proc)))) - (not (zerop (car state)))) - (goto-char (cadr state)) - (setq indent (current-column)))))) - (if indent - (indent-line-to indent) - ad-do-it))) - -(defun ruby--indent-before-all-sexps () - " -1. search backwards for a closing delimiter ON THIS LINE, then - find the matching opening - -2. if found, recurse, else the point is at a place we don't need - to worry about sexps. -" - (if (re-search-backward ruby--paren-closings-regex (point-at-bol) t) - (let ((ppss (syntax-ppss)) - beg) - (goto-char (match-beginning 0)) - (cond ((setq beg (nth 1 ppss)) ; brace - (goto-char beg)) - ((nth 3 ppss) ; string - (goto-char (nth 8 ppss)))) - (ruby--indent-before-all-sexps)))) - -(defun ruby--point-in-braced-proc () - "returns 'proc if point is in braces where starting bracs is EOL or followed by arg-list - -i.e. - - arr.each { |foo| - // do stuff - } - -or - - 1.times { - // do stuff - } -returns 'brace if point in brace - -return nil otherwise -" - (save-excursion - (let ((ppss (syntax-ppss)) - beg) - (cond ((nth 3 ppss) ; string - nil) - ((setq beg (nth 1 ppss)) ; brace - (goto-char beg) - (if (looking-at-p "{[\t ]*\\(?:$\\||\\)") - 'proc - (when (looking-at-p "{") - 'brace))))))) - -(defadvice ruby-indent-line (around line-up-args activate) - "indent new line after comma at EOL properly: - -i.e. - - foo_function a_param, - b_param, - c_param - -Note that all params line up after the function. -" - (let (indent ppss) - (save-excursion - (back-to-indentation) - (skip-chars-backward " \t\n") - (setq ppss (syntax-ppss)) - ;; check for inside comment, string, or inside braces - (when (and (eq ?, (char-before)) - (not (memq (syntax-ppss-context ppss) '(comment string))) - (zerop (car ppss))) - (ruby--indent-before-all-sexps) - (back-to-indentation) - (if (save-excursion - (skip-chars-backward " \t\n") - (eq (char-before) ?,)) - (setq indent (current-column)) - (skip-syntax-forward "w_.") - (skip-chars-forward " ") - ;; if the first symbol on the line is followed, by a comma, then this - ;; line must be a continuation - (setq indent (current-column))))) - (if indent - (indent-line-to indent) - ad-do-it))) - -;; (defadvice ruby-indent-line (around indent-no-brace-args activate) -;; "indent new line after comma at EOL properly: - -;; i.e. - -;; foo_function a_param, -;; b_param, -;; c_param - -;; Note that all params line up after the function." -;; (let ((res (ruby--point-in-braced-proc))) -;; (cond ((eq 'brace res) -;; (let ((ruby-deep-indent-paren '(?\[ ?\( ?\{ t))) -;; ad-do-it)) -;; (t -;; ad-do-it)))) - -(provide 'ruby-mode-indent-fix) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; ruby-mode-indent-fix.el ends here diff --git a/contrib/shaderlab-mode.el b/contrib/shaderlab-mode.el deleted file mode 100644 index a83706ab8..000000000 --- a/contrib/shaderlab-mode.el +++ /dev/null @@ -1,425 +0,0 @@ -;;; shaderlab-mode-el -- Major mode for editing Shaderlab files - -;; Author: Simon Carter -;; Created: 1 August 2011 -;; Keywords: Shaderlab languages - -;; Copyright (C) 2011 Simon Carter - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 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, write to the Free -;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, -;; MA 02111-1307 USA - -;;; Commentary: -;; Borrows heavily from cg-mode.el for syntax highlighting. -;; In addition, provides custom indentation, and works with other -;; shaderlab structures, such as material blocks, subshaders, etc. - -;;; Code: - -(defconst shaderlab-font-lock-keywords-1 nil - "Subdued level highlighting for shaderlab mode.") - -(defconst shaderlab-font-lock-keywords-2 nil - "Medium level highlighting for Shaderlab mode. -See also `shaderlab-font-lock-extra-types'.") - -(defconst shaderlab-font-lock-keywords-3 nil - "Gaudy level highlighting for Shaderlab mode. -See also `shaderlab-font-lock-extra-types'.") - -;; taken largely from the c mode from font-lock.el -(let* ((shaderlab-keywords - (eval-when-compile - (regexp-opt '("break" "continue" "do" "else" "for" "if" "return" - "while" - "asm" "asm_fragment" - "technique" "pass" "compile" - "in" "out" "inout" - "typedef" "static" "const" "uniform" "packed" - "Shader" "Properties" "SubShader" "Pass" - "Material" - "Tags" "LOD" "Cull" - "CGPROGRAM" "ENDCG" - "Fallback")))) - (shaderlab-type-specs - (eval-when-compile - (regexp-opt '("struct" "interface")))) - (shaderlab-type-specs-depth - (regexp-opt-depth shaderlab-type-specs)) - (shaderlab-type-names - `(mapconcat 'identity - (cons - ,(eval-when-compile - (regexp-opt - '("void" "string" - "fragout" "fragout_float" - "sampler" "sampler1D" "sampler2D" "sampler3D" - "samplerCube" "samplerRECT" - "SurfaceOutput"))) - '("\\(bool\\|double\\|c?float\\|fixed\\|half\\|c?int\\)\\([1234]\\(x[1234]\\)?\\)?")) - "\\|")) - (shaderlab-type-names-depth - `(regexp-opt-depth ,shaderlab-type-names)) - (shaderlab-reserved-names - (eval-when-compile - (regexp-opt - ;; reserved but not supported (Cg is UGLY!) - '("short" "dword" "long" "signed" - "auto" "catch" "char" "class" "column major" - "const_cast" "decl" "default" "delete" - "discard" "dynamic_cast" "emit" "enum" "explicit" - "extern" "friend" "get" "goto" "inline" - "long" "mutable" "namespace" "new" "operator" - "pixelfragment" "pixelshader" "private" - "protected" "public" "register" "reinterpret_cast" - "row_major" "sampler_state" "shared" "sizeof" - "static_cast" "template" "this" "throw" - "try" "typeid" "typename" "union" "using" - "virtual" "volatile" "__identifier" - "switch" "case" "default")))) - (shaderlab-reserved-names-depth - `(regexp-opt-depth ,shaderlab-reserved-names)) - (shaderlab-bindings - (eval-when-compile - (regexp-opt - '("COLOR" "COLOR0" "COLOR1" "COLOR2" "COLOR3" - "POSITION" "BLENDWEIGHT" "NORMAL" "DIFFUSE" - "SPECULAR" "FOGCOORD" "PSIZE" "ATTR6" "TANGENT" - "TEXCOORD0" "TEXCOORD1" "TEXCOORD2" "TEXCOORD3" - "TEXCOORD4" "TEXCOORD5" "TEXCOORD6" "TEXCOORD7" - "HPOS" "PSIZ" "FOG" "FOGC" "COL0" "COL1" "BCOL0")))) - (shaderlab-bindings-depth - (regexp-opt-depth shaderlab-bindings)) - (shaderlab-math-calls - (eval-when-compile - (regexp-opt - '(;; Mathmatical Functions - "abs" "acos" "all" "any" "asin" "atan" "atan2" "ceil" "clamp" - "cos" "cosh" "cross" "degrees" "determinant" "dot" "exp" "exp2" - "floor" "fmod" "frac" "frexp" "isfinite" "isinf" "isnan" "ldexp" - "lerp" "lit" "log" "log2" "log10" "max" "min" "modf" "mul" "noise" - "pow" "radians" "round" "rsqrt" "saturate" "sign" "sin" "sincos" - "sinh" "smoothstep" "step" "sqrt" "tan" "tanh" "transpose" - ;; Geometric Functions - "distance" "faceforward" "length" "normalize" "reflect" "refract" - ;; Texture Map Functions - "tex1D" "tex1Dproj" "tex2D" "tex2Dproj" "texRECT" "texRECTproj" - "tex3D" "tex3Dproj" "texCUBE texCUBEproj" - ;; Derivitive Functions - "ddx" "ddy" - ;; Debugging Function - "debug" - )))) - (shaderlab-math-calls-depth - (regexp-opt-depth shaderlab-math-calls)) - (shaderlab-preprocessor-directives - (eval-when-compile - (regexp-opt - '("define" "else" "endif" "if" "ifdef" "elif" - "ifndef" "include" "line" "pragma" "undef")))) - (shaderlab-preprocessor-directives-depth - (regexp-opt-depth shaderlab-preprocessor-directives))) - - - (setq shaderlab-font-lock-keywords-1 - (list - ;; - ;; These are all anchored at the beginning of line for speed. - ;; - ;; Fontify function name definitions (GNU style; without type on line). - '("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face) - ;; - ;'("\".*\"" . font-lock-string-face) - ;; Fontify error directives. - '("^#[ \t]*error[ \t]+\\(.+\\)" 1 font-lock-warning-face prepend) - ;; - ;; Fontify filenames in #include <...> preprocessor directives as strings. - '("^#[ \t]*\\(import\\|include\\)[ \t]*\\(<[^>\"\n]*>?\\)" - 2 font-lock-string-face) - ;; - ;; Fontify function macro names. - '("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face) - ;; - ;; Fontify symbol names in #if ... defined preprocessor directives. - '("^#[ \t]*\\(elif\\|if\\)\\>" - ("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil - (1 font-lock-builtin-face) (2 font-lock-variable-name-face nil t))) - ;; - ;; Fontify otherwise as symbol names, and the preprocessor directive names. - (list - (concat "^#[ \t]*\\(" shaderlab-preprocessor-directives - "\\)\\>[ \t!]*\\(\\sw+\\)?") - '(1 font-lock-builtin-face) - (list (+ 2 shaderlab-preprocessor-directives-depth) - 'font-lock-variable-name-face nil t)))) - - (setq shaderlab-font-lock-keywords-2 - (append shaderlab-font-lock-keywords-1 - (list - ;; - ;; Simple regexps for speed. - ;; - ;; Fontify all type names. - `(eval . - (cons (concat "\\<\\(" ,shaderlab-type-names "\\)\\>") 'font-lock-type-face)) - ;; - ;; Fontify all bindings. - `(eval . - (cons (concat "\\<\\(" ,shaderlab-bindings "\\)\\>") 'font-lock-constant-face)) - ;; - ;; Fontify all math calls. - `(eval . - (cons (concat "\\<\\(" ,shaderlab-math-calls "\\)\\>") 'font-lock-builtin-face)) - ;; - ;; Fontify reserved but unimplemented keywords - `(eval . - (cons (concat "\\<\\(" ,shaderlab-reserved-names "\\)\\>") 'font-lock-warning-face)) - ;; - ;; Fontify all builtin keywords (except case, default and goto; see below). - (concat "\\<\\(" shaderlab-keywords "\\|" shaderlab-type-specs "\\)\\>") - ;; - ;; Fontify case/goto keywords and targets, and case default/goto tags. - '("\\<\\(case\\|goto\\)\\>" - (1 font-lock-keyword-face) - ("\\(-[0-9]+\\|\\sw+\\)" - ;; Return limit of search. - (save-excursion (skip-chars-forward "^:\n") (point)) - nil - (1 font-lock-constant-face nil t))) - ;; Anders Lindgren points out that it is quicker to - ;; use MATCH-ANCHORED to effectively anchor the regexp on the left. - ;; This must come after the one for keywords and targets. - '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$" - (beginning-of-line) (end-of-line) - (1 font-lock-constant-face))) - ))) - - (setq shaderlab-font-lock-keywords-3 - (append shaderlab-font-lock-keywords-2 - ;; - ;; More complicated regexps for more complete highlighting for types. - ;; We still have to fontify type specifiers individually, as C is so hairy. - (list - ;; - ;; Fontify builtin true and false constants - '("\\(true\\|false\\)" 1 font-lock-constant-face) - ;; - ;; Fontify all storage types, plus their items. - `(eval . - (list (concat "\\<\\(" ,shaderlab-type-names "\\)\\>" - "\\([ \t*&]+\\sw+\\>\\)*") - ;; Fontify each declaration item. - (list 'font-lock-match-c-style-declaration-item-and-skip-to-next - ;; Start with point after all type specifiers. - (list 'goto-char (list 'or - (list 'match-beginning - (+ ,shaderlab-type-names-depth 2)) - '(match-end 1))) - ;; Finish with point after first type specifier. - '(goto-char (match-end 1)) - ;; Fontify as a variable or function name. - '(1 (if (match-beginning 2) - font-lock-function-name-face - font-lock-variable-name-face))))) - ;; - ;; Fontify all storage specs and types, plus their items. - `(eval . - (list (concat "\\<\\(" ,shaderlab-type-specs "\\)\\>" - "[ \t]*\\(\\sw+\\)?") - (list 1 'font-lock-keyword-face) - (list ,(+ shaderlab-type-specs-depth 2) 'font-lock-type-face nil t) - (list 'font-lock-match-c-style-declaration-item-and-skip-to-next - nil - ;; Finish with point after the variable name if - ;; there is one. - `(if (match-end 2) - (goto-char (match-end 2))) - ;; Fontify as a variable or function name. - '(1 (if (match-beginning 2) - font-lock-function-name-face - font-lock-variable-name-face) nil t)))) - ;; - ;; Fontify structures, or typedef names, plus their items. - '("\\(}\\)[ \t*]*\\sw" - (font-lock-match-c-style-declaration-item-and-skip-to-next - (goto-char (match-end 1)) nil - (1 font-lock-type-face))) - ;; - ;; Fontify anything at beginning of line as a declaration or definition. - '("^\\(\\sw+\\)\\>\\([ \t*]+\\sw+\\>\\)*" - (1 font-lock-type-face) - (font-lock-match-c-style-declaration-item-and-skip-to-next - (goto-char (or (match-beginning 2) (match-end 1))) nil - (1 (if (match-beginning 2) - font-lock-function-name-face - font-lock-variable-name-face)))) - ))) - ) - -(defvar shaderlab-font-lock-keywords shaderlab-font-lock-keywords-3 - "Default expressions to highlight in C mode. -See also `shaderlab-font-lock-extra-types'.") - -(defvar shaderlab-mode-hook nil) -(defvar shaderlab-mode-map - (let ((shaderlab-mode-map (make-keymap))) - (define-key shaderlab-mode-map "\C-j" 'newline-and-indent) - shaderlab-mode-map) - "Keymap for SHADERLAB major mode") - -(define-derived-mode shaderlab-mode text-mode "Shaderlab" - "Major mode for editing shaderlab shaders. -\\{shaderlab-mode-map}" - (set-syntax-table shaderlab-mode-syntax-table2) - (set (make-local-variable 'font-lock-defaults) '(shaderlab-font-lock-keywords)) - ;; Register our indentation function - (set (make-local-variable 'indent-line-function) 'shaderlab-indent-line) - ) -(add-to-list 'auto-mode-alist '("\\.shader" . shaderlab-mode)) - -(defun shaderlab-indent-line () - "Indent current line as SHADERLAB code." - (interactive) - (beginning-of-line) - (let ((regexp-closing-brace "^[^ \\W\n]*};?\\w*") - (regexp-opening-brace "^.*{\\w*$") - (regexp-empty-line "^[\t ]*\n")) - - (let ((not-indented t) cur-indent) - (cond ((bobp) - ;(message "bobp") - (setq cur-indent 0)) - ((looking-at regexp-closing-brace) ; If the line we are looking at is the end of a block, then decrease the indentation - ;(message "Closing brace") - (save-excursion - ;Look backwards for a non-whitespace block or an opening brace - (let ((looking-for-line t)) - (while looking-for-line - (forward-line -1) - (cond ((looking-at regexp-opening-brace) - (setq cur-indent (current-indentation)) - (setq looking-for-line nil)) - ((not (looking-at regexp-empty-line)) - (setq cur-indent (- (current-indentation) tab-width)) - (setq looking-for-line nil)))))) - - (when (< cur-indent 0) ; We can't indent past the left margin - (setq cur-indent 0))) - ((looking-at "^\\W*#") - (message "preprocessor") - (setq cur-indent 0)) - (t (save-excursion - (while not-indented ; Iterate backwards until we find an indentation hint - (forward-line -1) - (cond ((looking-at regexp-closing-brace) ; This hint indicates that we need to indent at the level of the END_ token - ;(message "Found closing brace at %s" (what-line)) - (setq cur-indent (current-indentation)) - (setq not-indented nil)) - ((looking-at regexp-opening-brace) ; This hint indicates that we need to indent an extra level - ;(message "Found opening brace at %s" (what-line)) - (setq cur-indent (+ (current-indentation) tab-width)) ; Do the actual indenting - (setq not-indented nil)) - ((bobp) - (setq not-indented nil))))))) - (if cur-indent - (progn - ;(message "Indenting to %d" cur-indent) - (indent-line-to cur-indent)) - ;(message "not indenting!") - (indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation - - -(defvar shaderlab-mode-syntax-table - (let ((table (make-syntax-table))) - - ;; Populate the syntax TABLE - (modify-syntax-entry ?_ "_" table) - ;(modify-syntax-entry ?_ "w" 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) - ;; Set up block and line oriented comments. The new C standard - ;; mandates both comment styles even in C, so since all languages - ;; now require dual comments, we make this the default. - ;;(cond - ;; Emacs 22 and higher do nothing - ;; ((>= emacs-major-version 22)) - ;; XEmacs 19 & 20 - ;; ((memq '8-bit c-emacs-features) - ;; (modify-syntax-entry ?/ ". 1456" table) - ;; (modify-syntax-entry ?* ". 23" table)) - ;; Emacs 19 & 20 - ;; ((memq '1-bit c-emacs-features) - ;; (modify-syntax-entry ?/ ". 124b" table) - ;; (modify-syntax-entry ?* ". 23" table)) - ;; incompatible - ;; (t (error "Shaderlab Mode is incompatible with this version of Emacs")) - ;; ) - (modify-syntax-entry ?\n "> b" table) - ;; Give CR the same syntax as newline, for selective-display - (modify-syntax-entry ?\^m "> b" table) - table) - "Syntax table for shaderlab-mode") - -(provide 'shaderlab-mode) - -(defun shaderlab-populate-syntax-table (table) - "Populate the given syntax table as necessary for a C-like language. -This includes setting ' and \" as string delimiters, and setting up -the comment syntax to handle both line style \"//\" and block style -\"/*\" \"*/\" comments." - - (modify-syntax-entry ?_ "w" 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 ?\240 "." table) - - ;; Set up block and line oriented comments. The new C - ;; standard mandates both comment styles even in C, so since - ;; all languages now require dual comments, we make this the - ;; default. - (modify-syntax-entry ?/ ". 124b" table) - (modify-syntax-entry ?* ". 23" table) - - (modify-syntax-entry ?\n "> b" table) - ;; Give CR the same syntax as newline, for selective-display - (modify-syntax-entry ?\^m "> b" table) - table) - - -(defvar shaderlab-mode-syntax-table2 - (let ((shaderlab-mode-syntax-table2 (shaderlab-populate-syntax-table (make-syntax-table)))) - shaderlab-mode-syntax-table2) - "Syntax table for shaderlab-mode") - - - -;;; shaderlab-mode.el ends here diff --git a/core/autoloads.el b/core/autoloads.el deleted file mode 100644 index 682b77a2b..000000000 --- a/core/autoloads.el +++ /dev/null @@ -1,532 +0,0 @@ -;;; autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads nil "../contrib/goto-last-change" "../contrib/goto-last-change.el" -;;;;;; (21865 37510 0 0)) -;;; Generated autoloads from ../contrib/goto-last-change.el - -(autoload 'goto-last-change "../contrib/goto-last-change" "\ -Go to the point where the last edit was made in the current buffer. -Repeat the command to go to the second last edit, etc. - -To go back to more recent edit, the reverse of this command, use \\[goto-last-change-reverse] -or precede this command with \\[universal-argument] - (minus). - -It does not go to the same point twice even if there has been many edits -there. I call the minimal distance between distinguishable edits \"span\". -Set variable `glc-default-span' to control how close is \"the same point\". -Default span is 8. -The span can be changed temporarily with \\[universal-argument] right before \\[goto-last-change]: -\\[universal-argument] set current span to that number, -\\[universal-argument] (no number) multiplies span by 4, starting with default. -The so set span remains until it is changed again with \\[universal-argument], or the consecutive -repetition of this command is ended by any other command. - -When span is zero (i.e. \\[universal-argument] 0) subsequent \\[goto-last-change] visits each and -every point of edit and a message shows what change was made there. -In this case it may go to the same point twice. - -This command uses undo information. If undo is disabled, so is this command. -At times, when undo information becomes too large, the oldest information is -discarded. See variable `undo-limit'. - -\(fn ARG)" t nil) - -(autoload 'goto-last-change-reverse "../contrib/goto-last-change" "\ -Go back to more recent changes after \\[goto-last-change] have been used. -See `goto-last-change' for use of prefix argument. - -\(fn ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "../contrib/help-fns+" "../contrib/help-fns+.el" -;;;;;; (21631 21029 0 0)) -;;; Generated autoloads from ../contrib/help-fns+.el - -(autoload 'describe-command "../contrib/help-fns+" "\ -Describe an Emacs command (interactive function). -Equivalent to using a prefix arg with `describe-function'. - -If you use Icicles then in Icicle mode keys bound to the commands are -shown next to them in `*Completions*. You can toggle this keys -display on/off using `C-x C-a'. - -\(fn FUNCTION)" t nil) - -(autoload 'describe-option "../contrib/help-fns+" "\ -Describe an Emacs user variable (option). -Same as using a prefix arg with `describe-variable'. - -\(fn VARIABLE &optional BUFFER)" t nil) - -(autoload 'describe-option-of-type "../contrib/help-fns+" "\ -Describe an Emacs user OPTION (variable) of a given `defcustom' TYPE. -A prefix argument determines the type-checking behavior: - - None: OPTION is defined with TYPE or a subtype of TYPE. - - Plain `C-u': OPTION is defined with TYPE or a subtype of TYPE, - or its current value is compatible with TYPE. - - Negative: OPTION is defined with TYPE (exact match). - - Non-negative: OPTION is defined with TYPE (exact match), - or its current value is compatible with TYPE. - -If TYPE is nil (default value) then *all* `defcustom' variables are -potential candidates. That is different from using `describe-option', -because `describe-option' includes user-variable candidates not -defined with `defcustom' (with `*'-prefixed doc strings). - -\(fn TYPE OPTION)" t nil) - -(autoload 'describe-file "../contrib/help-fns+" "\ -Describe the file named FILENAME. -If FILENAME is nil, describe current directory (`default-directory'). - -Starting with Emacs 22, if the file is an image file then: - * Show a thumbnail of the image as well. - * If you have command-line tool `exiftool' installed and in your - `$PATH' or `exec-path', then show EXIF data (metadata) about the - image. See standard Emacs library `image-dired.el' for more - information about `exiftool'. - -If FILENAME is the name of an autofile bookmark and you use library -`Bookmark+', then show also the bookmark information (tags etc.). In -this case, a prefix arg shows the internal form of the bookmark. - -In Lisp code: - -Non-nil optional arg INTERNAL-FORM-P shows the internal form. -Non-nil optional arg NO-ERROR-P prints an error message but does not - raise an error. - -\(fn FILENAME &optional INTERNAL-FORM-P NO-ERROR-P)" t nil) - -;;;*** - -;;;### (autoloads nil "../contrib/hide-mode-line" "../contrib/hide-mode-line.el" -;;;;;; (21641 7940 0 0)) -;;; Generated autoloads from ../contrib/hide-mode-line.el - -(autoload 'hide-mode-line "../contrib/hide-mode-line" "\ -Toggle the hide-mode-line functionality. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "../contrib/hl-todo" "../contrib/hl-todo.el" -;;;;;; (21835 1957 0 0)) -;;; Generated autoloads from ../contrib/hl-todo.el - -(autoload 'hl-todo-mode "../contrib/hl-todo" "\ -Highlight TODO tags in comments. - -\(fn &optional ARG)" t nil) - -(defvar global-hl-todo-mode nil "\ -Non-nil if Global-Hl-Todo mode is enabled. -See the command `global-hl-todo-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-hl-todo-mode'.") - -(custom-autoload 'global-hl-todo-mode "../contrib/hl-todo" nil) - -(autoload 'global-hl-todo-mode "../contrib/hl-todo" "\ -Toggle Hl-Todo mode in all buffers. -With prefix ARG, enable Global-Hl-Todo mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. - -Hl-Todo mode is enabled in all buffers where -`turn-on-hl-todo-mode-if-desired' would do it. -See `hl-todo-mode' for more information on Hl-Todo mode. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "../contrib/rotate-text" "../contrib/rotate-text.el" -;;;;;; (21631 59390 0 0)) -;;; Generated autoloads from ../contrib/rotate-text.el - -(autoload 'rotate-region "../contrib/rotate-text" "\ -Rotate all matches in `rotate-text-rotations' between point and mark. - -\(fn BEG END)" t nil) - -(autoload 'rotate-word-at-point "../contrib/rotate-text" "\ -Rotate word at point based on sets in `rotate-text-rotations'. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "defuns-buffers" "defuns-buffers.el" (21869 -;;;;;; 43589 0 0)) -;;; Generated autoloads from defuns-buffers.el - -(autoload 'narf:narrow-to-region-indirect "defuns-buffers" "\ -Restrict editing in this buffer to the current region, indirectly. - -\(fn START END)" t nil) - -(autoload 'narf:widen "defuns-buffers" "\ - - -\(fn)" t nil) - -(autoload 'narf:set-region-read-only "defuns-buffers" "\ -See http://stackoverflow.com/questions/7410125 - -\(fn BEGIN END)" nil nil) - -(autoload 'narf:set-region-writeable "defuns-buffers" "\ -See http://stackoverflow.com/questions/7410125 - -\(fn BEGIN END)" nil nil) - -(autoload 'narf/living-buffer-list "defuns-buffers" "\ - - -\(fn &optional BUFFER-LIST)" nil nil) - -(autoload 'narf/add-throwaway-buffer "defuns-buffers" "\ - - -\(fn REGEXP)" nil nil) - -(autoload 'narf:cleanup-buffers "defuns-buffers" "\ -Kill left-over temporary, dired or buried special buffers - -\(fn)" t nil) - -(autoload 'narf:cleanup-processes "defuns-buffers" "\ - - -\(fn)" t nil) - -(autoload 'narf:kill-matching-buffers "defuns-buffers" "\ - - -\(fn REGEXP &optional BUFFER-LIST)" t nil) - -(autoload 'narf:next-real-buffer "defuns-buffers" "\ -Switch to the next buffer and avoid special buffers. - -\(fn)" t nil) - -(autoload 'narf:previous-real-buffer "defuns-buffers" "\ -Switch to the previous buffer and avoid special buffers. - -\(fn)" t nil) - -(autoload 'narf:kill-real-buffer "defuns-buffers" "\ -Kill buffer (but only bury scratch buffer) - -\(fn)" t nil) - (autoload 'narf::save-session "defuns-buffers") - (autoload 'narf::load-session "defuns-buffers") - (autoload 'narf::new-workgroup "defuns-buffers") - (autoload 'narf::rename-workgroup "defuns-buffers") - (autoload 'narf::rename-this-file "defuns-buffers") - (autoload 'narf::delete-this-file "defuns-buffers") - (autoload 'narf::create-file "defuns-buffers") - (autoload 'narf::scratch-buffer "defuns-buffers") - (autoload 'narf::kill-buried-buffers "defuns-buffers") - (autoload 'narf::kill-buffers "defuns-buffers") - (autoload 'narf::cd "defuns-buffers") - -;;;*** - -;;;### (autoloads nil "defuns-code" "defuns-code.el" (21871 23781 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-code.el - -(autoload 'narf/set-build-command "defuns-code" "\ - - -\(fn COMMAND &optional FILE)" nil nil) - (autoload 'narf::build "defuns-code") - (autoload 'narf::eval "defuns-code") - (autoload 'narf::eval-region "defuns-code") - (autoload 'narf::eval-buffer "defuns-code") - (autoload 'narf::eval-region-and-replace "defuns-code") - -(autoload 'narf/get-interpreter "defuns-code" "\ - - -\(fn)" nil nil) - -;;;*** - -;;;### (autoloads nil "defuns-debug" "defuns-debug.el" (21867 64619 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-debug.el - -(autoload 'what-face "defuns-debug" "\ -Tells you the name of the face (point) is on. - -\(fn POS)" t nil) - -(autoload 'what-col "defuns-debug" "\ - - -\(fn)" t nil) - -(autoload 'what-bindings "defuns-debug" "\ - - -\(fn KEY)" nil nil) - (autoload 'narf::echo "defuns-debug") - -;;;*** - -;;;### (autoloads nil "defuns-edit" "defuns-edit.el" (21869 43444 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-edit.el - -(autoload 'narf:replace-ms-word-chars "defuns-edit" "\ -Replace smart quotes and other MS Word verbiage into plain text - -\(fn BEG END)" t nil) - -(autoload 'narf:replace-email2mailto "defuns-edit" "\ -Email address with mailto link - -\(fn BEG END)" t nil) - -(autoload 'narf:replace-url2anchor "defuns-edit" "\ -Link with anchor - -\(fn BEG END)" t nil) - -(autoload 'narf:goto-line "defuns-edit" "\ - - -\(fn)" t nil) - (autoload 'narf::align "defuns-edit") - (autoload 'narf::retab "defuns-edit") - (autoload 'narf::narrow-indirect-or-widen "defuns-edit") - -(autoload 'narf:toggle-delete-trailing-whitespace "defuns-edit" "\ - - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "defuns-extern" "defuns-extern.el" (21869 43359 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-extern.el - -(autoload 'narf/tmux-send "defuns-extern" "\ - - -\(fn COMMAND)" nil nil) - (autoload 'narf::tmux-run "defuns-extern") - (autoload 'narf::tmux-chdir "defuns-extern") - -;;;*** - -;;;### (autoloads nil "defuns-mouse" "defuns-mouse.el" (21865 57645 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-mouse.el - -(autoload 'narf/mouse-line-at-click "defuns-mouse" "\ -Determine the line number at click - -\(fn)" nil nil) - -(autoload 'narf/mouse-select-line "defuns-mouse" "\ -Set point as *linum-mdown-line* - -\(fn EVENT)" t nil) - -(autoload 'narf/mouse-select-block "defuns-mouse" "\ -Select the current block of text between blank lines. - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "defuns-org" "defuns-org.el" (21869 43512 0 -;;;;;; 0)) -;;; Generated autoloads from defuns-org.el - -(autoload 'narf/project-org-filename "defuns-org" "\ - - -\(fn CAT)" t nil) - -(autoload 'narf--org-in-list-p "defuns-org" "\ - - -\(fn)" nil nil) - -(autoload 'narf/org-insert-item-after "defuns-org" "\ -Inserts a new heading or item, depending on the context. - -\(fn)" t nil) - -(autoload 'narf/org-insert-item-before "defuns-org" "\ -Inserts a new heading or item, depending on the context. - -\(fn)" t nil) - -(autoload 'narf/org-toggle-checkbox "defuns-org" "\ - - -\(fn)" t nil) - -(autoload 'narf/org-surround "defuns-org" "\ - - -\(fn DELIM)" nil nil) - (autoload 'narf::org-insert-image-url "defuns-org") - (autoload 'narf::org-insert-image "defuns-org") - -;;;*** - -;;;### (autoloads nil "defuns-search" "defuns-search.el" (21869 45131 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-search.el - -(autoload 'narf:ido-find-file "defuns-search" "\ - - -\(fn &optional DIR)" t nil) - -(autoload 'narf:ido-find-file-other-window "defuns-search" "\ - - -\(fn &optional DIR)" t nil) - -(autoload 'narf:ido-find-project-file "defuns-search" "\ - - -\(fn)" t nil) - (autoload 'narf::initfiles "defuns-search") - (autoload 'narf::notes "defuns-search") - (autoload 'narf::recentf "defuns-search") - (autoload 'narf::ag-search "defuns-search") - (autoload 'narf::ag-regex-search "defuns-search") - (autoload 'narf::ag-regex-cwd "defuns-search") - (autoload 'narf::ag-regex-search-cwd "defuns-search") - (autoload 'narf::swoop "defuns-search") - (autoload 'narf::snippets "defuns-search") - -;;;*** - -;;;### (autoloads nil "defuns-text" "defuns-text.el" (21869 14495 -;;;;;; 0 0)) -;;; Generated autoloads from defuns-text.el - -(autoload 'narf--point-at-bol-non-blank "defuns-text" "\ - - -\(fn)" nil nil) - -(autoload 'narf/surrounded-p "defuns-text" "\ - - -\(fn)" nil nil) - -(autoload 'narf:backward-kill-to-bol-and-indent "defuns-text" "\ -Kill line to the first non-blank character. If invoked again -afterwards, kill line to column 1. - -\(fn)" t nil) - -(autoload 'narf:move-to-bol "defuns-text" "\ -Moves cursor to the first non-blank character on the line. If -already there, move it to the true bol. - -\(fn)" t nil) - -(autoload 'narf:move-to-eol "defuns-text" "\ - - -\(fn)" t nil) - -(autoload 'narf:backward-delete-whitespace-to-column "defuns-text" "\ -Delete back to the previous column of whitespace, or as much -whitespace as possible, or just one char if that's not possible. - -\(fn)" t nil) - -(autoload 'narf:dumb-indent "defuns-text" "\ -Inserts a tab character (or spaces x tab-width). Checks if the -auto-complete window is open. - -\(fn)" t nil) - -(autoload 'narf:inflate-space-maybe "defuns-text" "\ -Checks if point is surrounded by {} [] () delimiters and adds a -space on either side of the point if so. - -\(fn)" t nil) - -(autoload 'narf:deflate-space-maybe "defuns-text" "\ -Checks if point is surrounded by {} [] () delimiters, and deletes -spaces on either side of the point if so. Resorts to -`narf:backward-delete-whitespace-to-column' otherwise. - -\(fn)" t nil) - -(autoload 'narf:newline-and-indent "defuns-text" "\ - - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil "defuns-ui" "defuns-ui.el" (21865 64034 0 0)) -;;; Generated autoloads from defuns-ui.el - -(autoload 'narf:toggle-transparency "defuns-ui" "\ - - -\(fn)" t nil) - -(autoload 'narf:toggle-fullscreen "defuns-ui" "\ - - -\(fn)" t nil) - -(autoload 'narf:toggle-big-mode "defuns-ui" "\ - - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("../contrib/evil-ex-registers.el" "../contrib/flycheck-objc.el" -;;;;;; "../contrib/ruby-mode-indent-fix.el" "../contrib/shaderlab-mode.el" -;;;;;; "../contrib/unityjs-mode.el" "../init/autoloads.el" "../init/init-auto-insert.el" -;;;;;; "../init/init-cc.el" "../init/init-cscope.el" "../init/init-csharp.el" -;;;;;; "../init/init-data.el" "../init/init-eshell.el" "../init/init-fly.el" -;;;;;; "../init/init-go.el" "../init/init-helm.el" "../init/init-ido.el" -;;;;;; "../init/init-java.el" "../init/init-js.el" "../init/init-lisp.el" -;;;;;; "../init/init-lua.el" "../init/init-org.el" "../init/init-php.el" -;;;;;; "../init/init-project.el" "../init/init-python.el" "../init/init-r.el" -;;;;;; "../init/init-regex.el" "../init/init-ruby.el" "../init/init-rust.el" -;;;;;; "../init/init-scss.el" "../init/init-sh.el" "../init/init-swift.el" -;;;;;; "../init/init-text.el" "../init/init-vc.el" "../init/init-vim.el" -;;;;;; "../init/init-web.el" "../init/init-workgroups.el" "../init/init-yasnippet.el" -;;;;;; "../init/narf-bindings.el" "../init/narf-commands.el" "../init/narf-settings.el" -;;;;;; "benchmark.el" "core-company.el" "core-editor.el" "core-evil.el" -;;;;;; "core-linux.el" "core-osx.el" "core-splash.el" "core-ui.el" -;;;;;; "core.el" "defuns.el" "startup.el") (21873 3804 549513 0)) - -;;;*** - -(provide 'autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; autoloads.el ends here diff --git a/core/benchmark.el b/core/benchmark.el deleted file mode 100644 index fc68df1a1..000000000 --- a/core/benchmark.el +++ /dev/null @@ -1,44 +0,0 @@ -(defvar require-times nil - "A list of (FEATURE . LOAD-DURATION). -LOAD-DURATION is the time taken in milliseconds to load FEATURE.") - -(defadvice require - (around build-require-times (feature &optional filename noerror) activate) - "Note in `require-times' the time taken to require each feature." - (let* ((already-loaded (memq feature features)) - (require-start-time (and (not already-loaded) (current-time)))) - (prog1 - ad-do-it - (when (and (not already-loaded) (memq feature features)) - (add-to-list 'require-times - (cons feature - (float-time (time-subtract (current-time) require-start-time))) - t))))) - -(defun list-times () - (interactive) - (let ((temp-buffer (get-buffer-create "*benchmark*")) - (sum 0.0)) - (popwin:popup-buffer temp-buffer :stick t) - (erase-buffer) - (org-mode) - (dolist (feature require-times) - (if (eq feature 'null) - (progn - (insert "|----+----+----|\n") - (insert (format "| %6f | Subtotal |\n" sum)) - (insert "|----+----+----|\n")) - (let ((time (cdr feature))) - (insert (format "| %6f | %s | %s |\n" time (car feature) (cond ((>= time 0.4) "XXX") - ((>= time 0.1) "X") - ((>= time 0.05) ".") - (t " ")))) - (setq sum (+ sum time))))) - (save-excursion - (insert "|----+----+----|\n") - (insert (format "| %6f | Total |\n" sum)) - (insert (format "| %s | On Init |\n" (emacs-init-time)))) - (org-table-align))) - - -(provide 'benchmark) diff --git a/core/core-company.el b/core/core-company.el deleted file mode 100644 index aeaaa8a7e..000000000 --- a/core/core-company.el +++ /dev/null @@ -1,95 +0,0 @@ -(use-package company - :diminish (company-mode . "=") - :init - (progn - (defvar company-dictionary-alist '()) - (defvar company-dictionary-major-minor-modes '()) - (defvar company-dictionary-dir (concat BASE-DIR "dict/"))) - - (after "abbrev" (diminish 'abbrev-mode "A")) - :config - (progn - (global-company-mode +1) - (setq company-idle-delay nil - company-minimum-prefix-length 1 - company-show-numbers nil - company-tooltip-limit 20 - company-dabbrev-downcase nil - company-dabbrev-ignore-case nil - company-tooltip-align-annotations t - company-require-match 'never - company-global-modes - '(not eshell-mode comint-mode org-mode erc-mode message-mode help-mode)) - - ;; sort candidates by - (setq-default company-frontends - '(company-pseudo-tooltip-unless-just-one-frontend - company-echo-metadata-frontend - company-preview-if-just-one-frontend)) - - (progn ; Rewrite evil-complete to use company-dabbrev - (setq company-dabbrev-code-other-buffers t) - (setq company-dabbrev-code-buffers nil) - (setq evil-complete-next-func - (lambda(arg) - (call-interactively 'company-dabbrev) - (if (eq company-candidates-length 1) - (company-complete)))) - (setq evil-complete-previous-func - (lambda (arg) - (let ((company-selection-wrap-around t)) - (call-interactively 'company-dabbrev) - (if (eq company-candidates-length 1) - (company-complete) - (call-interactively 'company-select-previous)))))) - - (progn ; backends - (setq-default company-backends (append '(company-dictionary company-keywords) company-backends)) - (add-to-list 'company-transformers 'company-sort-by-occurrence) - (after "yasnippet" - (setq-default company-backends (append '(company-capf company-yasnippet) company-backends))) - - (defmacro narf/add-company-backend (hook backends) - "Register a company backend for a mode." - (let ((def-name (intern (format "narf--init-%s" hook)))) - `(progn - (defun ,def-name () - (set (make-local-variable 'company-backends) - (append '((,@backends company-semantic)) company-backends))) - (add-hook ',(intern (format "%s-hook" hook)) ',def-name)))) - (narf/add-company-backend nxml-mode (company-nxml company-yasnippet)) - (narf/add-company-backend emacs-lisp-mode (company-elisp company-yasnippet)) - - - ;; Simulates ac-source-dictionary (without global dictionary) - (defun company-dictionary (command &optional arg &rest ignored) - "`company-mode' back-end for user-provided dictionaries." - (interactive (list 'interactive)) - (unless company-dictionary-alist - ;; initialize dictionary - (dolist (file (f-files company-dictionary-dir)) - (add-to-list 'company-dictionary-alist `(,(intern (f-base file)) ,@(s-split "\n" (f-read file) t))))) - (let ((dict (let ((minor-modes (-filter (lambda (mode) (when (boundp mode) (symbol-value mode))) - company-dictionary-major-minor-modes)) - (dicts (cdr (assq major-mode company-dictionary-alist)))) - (dolist (mode minor-modes) - (setq dicts (append dicts (cdr (assq mode company-dictionary-alist))))) - dicts))) - (cl-case command - (interactive (company-begin-backend 'company-dictionary)) - (prefix (and dict (or (company-grab-symbol) 'stop))) - (candidates - (let ((completion-ignore-case nil) - (symbols dict)) - (all-completions arg symbols))) - (sorted t))))) - - (use-package company-statistics - :config - (shut-up - (setq company-statistics-file (expand-file-name "company-statistics-cache.el" TMP-DIR)) - (company-statistics-mode))))) - - -(provide 'core-company) -;;; core-company.el ends here diff --git a/core/core-completion.el b/core/core-completion.el new file mode 100644 index 000000000..e69de29bb diff --git a/core/core-defuns.el b/core/core-defuns.el new file mode 100644 index 000000000..1d089a2f6 --- /dev/null +++ b/core/core-defuns.el @@ -0,0 +1,371 @@ +(! (defalias '@--concat-forms 'use-package-concat) + (defalias '@--normalize-symbols 'use-package-normalize-symlist) + (defalias '@--normalize-paths 'use-package-normalize-paths) + + + ;; Backwards compatible `with-eval-after-load' + (unless (fboundp 'with-eval-after-load) + (defmacro with-eval-after-load (file &rest body) + `(eval-after-load ,file + `(funcall (function ,(lambda () ,@body)))))) + + (defmacro @after (feature &rest forms) + (declare (indent 1)) + `(,(if (or (not (boundp 'byte-compile-current-file)) + (not byte-compile-current-file) + (if (symbolp feature) + (require feature nil :no-error) + (load feature :no-message :no-error))) + 'progn + (message "after: cannot find %s" feature) + 'with-no-warnings) + (with-eval-after-load ',feature ,@forms))) + + (defmacro @shut-up (&rest body) + "Silence message output from code." + (declare (indent defun)) + `(let (message-log-max) ,@body (message ""))) + + (defmacro @ (args &rest body) + "A shortcut for: `(lambda ,args ,@body)" + `(lambda ,args ,@body)) + + (defmacro λ (&rest body) + "A shortcut for: `(lambda () (interactive) ,@body)" + `(lambda () (interactive) ,@body)) + + (defmacro @add-hook (hook &rest func-or-forms) + "A convenience macro for `add-hook'. + +HOOK can be one hook or a list of hooks. If the hook(s) are not quoted, -hook is +appended to them automatically. If they are quoted, they are used verbatim. + +FUNC-OR-FORMS can be one quoted symbol, a list of quoted symbols, or a series of +forms. Forms will be wrapped in one lambda. A list of symbols will expand into a +series of add-hook calls. + +Examples: + (@add-hook 'some-mode-hook 'enable-something) + => (add-hook 'some-mode-hook 'enable-something) + + (@add-hook some-mode '(enable-something and-another)) + => (add-hook 'some-mode-hook 'enable-something) + (add-hook 'some-mode-hook 'and-another) + + (@add-hook '(one-mode-hook second-mode-hook) 'enable-something) + => (add-hook 'one-mode-hook 'enable-something) + (add-hook 'second-mode-hook 'enable-something) + + (@add-hook (one-mode second-mode) 'enable-something) + => (add-hook 'one-mode-hook 'enable-something) + (add-hook 'second-mode-hook 'enable-something) + + (@add-hook (one-mode second-mode) (setq v 5) (setq a 2)) + => (add-hook 'one-mode-hook (lambda () (setq v 5) (setq a 2))) + (add-hook 'second-mode-hook (lambda () (setq v 5) (setq a 2)))" + (declare (indent 1)) + (unless func-or-forms + (error "@add-hook: FUNC-OR-FORMS is empty")) + (let* ((val (car func-or-forms)) + (quoted (eq (car-safe hook) 'quote)) + (hook (if quoted (cadr hook) hook)) + (funcs (if (eq (car-safe val) 'quote) + (if (cdr-safe (cadr val)) + (cadr val) + (list (cadr val))) + (list func-or-forms))) + (forms '())) + (mapc (@ (f) + (let ((func (cond ((symbolp f) `(quote ,f)) + (t `(lambda () ,@func-or-forms))))) + (mapc (@ (h) + (push `(add-hook ',(if quoted h (intern (format "%s-hook" h))) ,func) forms)) + (if (listp hook) hook (list hook))))) funcs) + `(progn ,@forms))) + + (cl-defmacro @associate (mode &key in + &key match + &key files + &allow-other-keys) + "Associate a major or minor mode to certain patterns and project files." + (let* ((minor-p (memq mode minor-mode-alist)) + (modes (@--normalize-symbols ":in" in))) + (@--concat-forms + (when match + `(add-to-list ,(if minor-p 'narf-auto-minor-mode-alist 'auto-mode-alist) + (cons ,match ,mode))) + (when files + `(defun ,(intern (format "narf|init-mode-%s" 'lb6-mode)) () + (when (and (assq major-mode '(,@(@--normalize-paths ":in" in))) + (narf-project-has-files ,@(@--normalize-paths ":files" files))) + (,mode 1))))))) + + (@after evil + ;; Placeholders to correct binding indentation. Don't use these. + (defmacro :leader (key &rest rest) (declare (indent 1))) + (defmacro :localleader (key &rest rest) (declare (indent 1))) + (defmacro :map (key &rest rest) (declare (indent 1))) + (defmacro :after (key &rest rest) (declare (indent 1))) + (defmacro :when (key &rest rest) (declare (indent 1))) + + (macroexpand `(@map (:map my-map "C-k" 'hello :n "C-p" 'goodbye))) + + (defmacro @map (&rest rest) + (declare (indent defun)) + (let ((i 0) + key def + first-set + prefix + (default-keymaps '(narf-mode-map)) + (keymaps (if (boundp 'keymaps) keymaps)) + (states (if (boundp 'states) states '())) + (forms (if (boundp 'forms) forms)) + (state-map '(("n" . normal) + ("v" . visual) + ("i" . insert) + ("e" . emacs) + ("o" . operator) + ("m" . motion) + ("r" . replace) + ("I" . iedit)))) + (unless keymaps + (setq keymaps default-keymaps)) + (while rest + (setq key (pop rest)) + (message ">>> KEY: %s" key) + (add-to-list + 'forms + (cond ((eq key '-)) ; skip this + + ((listp key) ; it's a sub exp + (macroexpand `(@map ,@key))) + + ((keywordp key) + (pcase key + ;; TODO: Data checks + (:leader (setq prefix (kbd (pop rest))) nil) + (:localleader (setq prefix (kbd (pop rest))) nil) + (:prefix (setq prefix (kbd (pop rest))) + (if (= i 0) (setq first-set `(:prefix . ,prefix))) + nil) + (:map (setq keymaps (-list (pop rest))) + (if (= i 0) (setq first-set `(:map . ,keymaps))) + nil) + (:unset (prog1 `(@map ,(kbd (pop rest)) nil))) + (:after (prog1 `(@after ,(pop rest) ,(macroexp-progn `(@map ,@rest))) (setq rest '()))) + (:when (prog1 `(when ,(pop rest) ,(macroexp-progn `(@map ,@rest))) (setq rest '()))) + (:unless (prog1 `(unless ,(pop rest) ,(macroexp-progn `(@map ,@rest))) (setq rest '()))) + (otherwise ; might be a state prefix + (mapc (lambda (letter) + (when (assoc letter state-map) + (add-to-list 'states (cdr (assoc letter state-map))))) + (s-split "" (substring (symbol-name key) 1) t)) nil))) + + ;; It's a key-def pair + ((or (stringp key) + (characterp key) + (vectorp key)) + + (when (stringp key) + (setq key (kbd key))) + (when prefix + (cond ((vectorp key) + (setq key (vconcat prefix key))) + (t + (setq key (concat prefix key))))) + + (unless (car rest) + (user-error "Map has no definition for %s" key)) + + (setq def (pop rest)) + (let ((first-key (car first-set)) + (first-value (cdr first-set)) + out-forms) + (dolist (keymap keymaps) + (if (not states) + (add-to-list 'out-forms `(define-key ,keymap ,key ,def) t) + (dolist (state states) + (add-to-list 'out-forms `(define-key (evil-get-auxiliary-keymap ,keymap ,state t) ,key ,def) t)))) + + (setq prefix (if (eq first-key :prefix) first-value)) + (setq keymaps (if (eq first-key :map) first-value default-keymaps)) + (setq states '()) + out-forms)) + + (t (user-error "" key))) + t) + (cl-incf i)) + `(progn ,@(apply #'nconc (delete nil (delete (list nil) forms)))))) + + ;; (defmacro @map (&rest keys) + ;; "A minimalistic and evil-centric way of binding keys. KEYS is + ;;made up of either: + ;; + ;;1. Any of the following keywords: + ;; + ;;:when CONDITION + ;;:unless CONDITION + ;;:prefix PREFIX Key(s) to prefix keymappings with + ;;:map KEYMAP Keymaps to bind keys to. Can be a list. + ;;:global Tags these keymaps for the global keymap + ;;:local Ditto, but for local keymap + ;; + ;; + ;;2. A key (as a vector e.g. [escape], a string \"\", or + ;;character ?\^?). + ;; + ;;3. A key definition: a symbol or a lambda function. " + ;; (declare (indent defun)) + ;; (let* ((keymaps (-list map)) + ;; (states (-list in)) + ;; (forms '()) + ;; item def) + ;; (while keys + ;; (setq item (pop keys)) + ;; (cond ((keywordp item) + ;; (let ((val (pop keys))) + ;; (pcase item + ;; (:after) + ;; (:when) + ;; (:unless) + ;; (:keymap) + ;; (:in) + ;; (otherwise) + ;; ) + ;; )) + ;; + ;; ((or (and (symbolp item) + ;; (evil-state-p item)) + ;; (and (listp item) + ;; (--all? (evil-state-p it) item))) + ;; (setq states (-list item))) + ;; + ;; ;; item-definition pairs + ;; ((consp item) + ;; (let ((def (cdr item)) + ;; (item (car item))) + ;; (message "k %s : d %s" item def) + ;; + ;; ;;(or (stringp item) + ;; ;; (vectorp item) + ;; ;; (characterp item)) + ;; ;;(unless items (signal 'bind-no-definition item)) + ;; ;;(setq def (pop items)) + ;; (when condition + ;; ;; Process the item + ;; (cond ((stringp item) (setq item (kbd item))) + ;; ((characterp item) (setq item (string item)))) + ;; (when prefix + ;; (setq item (if (vectorp item) + ;; (vconcat prefix item) + ;; (concat (kbd prefix) item)))) + ;; ;; Do the binding + ;; `(,@(if (null states) + ;; (push (mapcar + ;; (lambda (keymap) `(define-key ,keymap ,item ,def)) keymaps) + ;; forms) + ;; (push (mapcar (lambda (state) + ;; (mapcar (lambda (keymap) + ;; `(define-key (evil-get-auxiliary-keymap ,keymap ',state t) ,item ,def)) + ;; keymaps)) + ;; states) forms)))))) + ;; + ;; ;; fallback + ;; (t (signal 'bind-invalid-key key))) + ;; `(progn ,@forms)))) + + (defmacro @exmap (command func) + (evil-ex-define-cmd + ,command + ,(cond ((autoloadp (symbol-function `,func)) + `(lambda () (interactive) (call-interactively ,func))) + ((symbolp `,func) func) + (t (user-error "Command for %s is invalid" command))))))) + + +;; Hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun narf|enable-comment-hard-wrap () + (set (make-local-variable 'comment-auto-fill-only-comments) t) + (turn-on-auto-fill)) + +(defun narf|enable-hard-wrap () + (turn-on-auto-fill)) + +(defun narf|enable-tab-width-2 () + (setq tab-width 2 evil-shift-width 2)) + +(defun narf|enable-tab-width-4 () + (setq tab-width 4 evil-shift-width 4)) + +(defun narf|disable-final-newline () + (set (make-local-variable 'require-final-newline) nil)) + +(defun narf|enable-tabs () + (setq indent-tabs-mode t)) + +(defun narf|disable-tabs () + (setq indent-tabs-mode nil)) + +(defun narf|disable-delete-trailing-whitespace () + (remove-hook 'before-save-hook 'delete-trailing-whitespace)) + +(defun narf|update-scratch-buffer-cwd () ; see core-editor.el + "Make sure scratch buffer is always 'in a project.'" + (let ((dir (narf-project-root))) + (with-current-buffer (get-buffer-create "*scratch*") + (cd dir)))) + + +;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;; +(defun narf-minibuffer-quit () + "Abort recursive edit. In Delete Selection mode, if the mark is +active, just deactivate it; then it takes a second \\[keyboard-quit] +to abort the minibuffer." + (interactive) + (let (message-log-max) + (if (and delete-selection-mode transient-mark-mode mark-active) + (setq deactivate-mark t) + (when (get-buffer "*Completions*") + (delete-windows-on "*Completions*")) + (abort-recursive-edit)))) + + +;;;; Project defuns ;;;;;;;;;;;;;;;;;;;; +(defun narf-project-root (&optional strict-p) + "Get the path to the root of your project. Uses `narf-project-root-files' to +determine if a directory is a project." + (let ((home (file-truename "~"))) + (catch 'found + (f-traverse-upwards + (lambda (path) + (let ((path (file-truename path))) + (if (file-equal-p home path) + (throw 'found (if strict-p nil default-directory)) + (dolist (file narf-project-root-files) + (when (file-exists-p (expand-file-name file path)) + (throw 'found path)))))) default-directory) + default-directory))) + +(defun narf-project-has-files (files &optional root) + "Return non-nil if `file' exists in the project root." + (let ((root (or root (narf-project-root))) + (files (if (listp files) files (list files))) + found-p file) + (while (and files (not found-p)) + (setq file (pop files)) + (setq found-p (file-exists-p (narf-project-path-to file root)))) + found-p)) + +(defun narf-project-path-to (file &optional root) + (let ((root (or root (narf-project-root)))) + (expand-file-name file root))) + +(defun narf-project-name (&optional root) + (file-name-nondirectory (directory-file-name (or root (narf-project-root))))) + +(defun narf-project-p () + (not (null (narf-project-root t)))) + + +(provide 'core-defuns) +;;; core-defuns.el ends here diff --git a/core/core-editor.el b/core/core-editor.el index fe3a84823..06775777c 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -1,62 +1,193 @@ -;;; Global editor behavior -(electric-indent-mode -1) -(setq electric-indent-chars '(? ?: ?{)) -(add-hook 'python-mode-hook 'electric-indent-local-mode) -(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) -(add-hook! 'eldoc-mode-hook (diminish 'eldoc-mode " ?")) +;;;; Editor behavior ;;;;;;;;;;;;;;;; +(setq-default + ;; spaces instead of tabs + indent-tabs-mode nil + tab-always-indent t + tab-width 4 -(setq-default fill-column 80) -(diminish 'auto-fill-function) -;; Sane scroll settings -(setq scroll-margin 5 - scroll-conservatively 9999 - scroll-preserve-screen-position t) -;; I'll use visual mode, kthxbai -(setq shift-select-mode nil) + require-final-newline t + delete-trailing-lines nil -;;;; Modes 'n hooks ;;;;;;;;;;;;;;;;; -(associate-mode "/LICENSE[^/]*$" 'text-mode) -(associate-mode "zsh\\(env\\|rc\\)?$" 'sh-mode) -(associate-mode "z\\(profile\\|login\\|logout\\)?$" 'sh-mode) -(associate-mode "zsh/" 'sh-mode) -(associate-mode "\\.applescript$" 'applescript-mode) -(associate-mode "Cask$" 'emacs-lisp-mode) -(associate-mode "\\.el\\.gz$" 'emacs-lisp-mode) -(associate-mode "/Makefile$" 'makefile-gmake-mode) -(associate-mode "\\.plist$" 'nxml-mode) + fill-column 80 -(add-hook 'help-mode-hook 'visual-line-mode) -(add-hook 'before-save-hook 'delete-trailing-whitespace) -(add-hook 'makefile-mode-hook 'narf|enable-tabs) ; Use normal tabs in makefiles + ;; Sane scroll settings + scroll-margin 5 + scroll-conservatively 9999 + scroll-preserve-screen-position t -(after "isearch" (diminish 'isearch-mode)) + shift-select-mode nil + + whitespace-style '(trailing face tabs tab-mark) + whitespace-display-mappings + '((tab-mark ?\t [?| ?\t] [?\\ ?\t]) + (newline-mark 10 [36 10])) + + truncate-lines t ; do not soft-wrap lines + truncate-partial-width-windows nil) + + +;; Modes 'n hooks ;;;;;;;;;;;;;;;;;;; + +(@associate text-mode :match "/LICENSE[^/]*$") +(@associate sh-mode :match "zsh\\(env\\|rc\\)?$") +(@associate sh-mode :match "z\\(profile\\|login\\|logout\\)?$") +(@associate sh-mode :match "zsh/") +(@associate applescript-mode :match "\\.applescript$") +(@associate emacs-lisp-mode :match "Cask$") +(@associate emacs-lisp-mode :match "\\.el\\.gz$") +(@associate makefile-gmake-mode :match "/Makefile$") +(@associate nxml-mode :match "\\.plist$") + +(@add-hook help-mode 'visual-line-mode) +(@add-hook python-mode 'electric-indent-local-mode) +(@add-hook emacs-lisp-mode 'turn-on-eldoc-mode) +(@add-hook eldoc-mode (diminish 'eldoc-mode " ?")) +(@add-hook makefile-mode 'narf|enable-tabs) ; Use normal tabs in makefiles ;; Fix code folding -;; (defun narf|init-hs-minor-mode-maybe () -;; (unless (bound-and-true-p hs-minor-mode) -;; (hs-minor-mode 1) -;; (diminish 'hs-minor-mode))) -;; (add-hook 'prog-mode-hook 'narf|init-hs-minor-mode-maybe) +;; (@add-hook prog-mode (unless (bound-and-true-p hs-minor-mode) +;; (hs-minor-mode 1) +;; (diminish 'hs-minor-mode))) +(@add-hook find-file 'narf|update-scratch-buffer-cwd) +;; (add-hook 'before-save-hook 'delete-trailing-whitespace) + +;; If file is oversized... +(@add-hook find-file (when (> (buffer-size) (* 1024 1024)) + (setq buffer-read-only t) + (buffer-disable-undo) + (fundamental-mode) + (visual-line-mode))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; (global-whitespace-mode 1) ; Show whitespace +(global-font-lock-mode t) ; Enable syntax highlighting for older emacs +(global-auto-revert-mode 1) ; revert buffers for changed files +(electric-indent-mode -1) +(winner-mode 1) ; window config undo/redo + + +;; Automatic minor modes ;;;;;;;;;;; + +(defvar narf/auto-minor-mode-alist () + "Alist of filename patterns vs correpsonding minor mode functions, +see `auto-mode-alist' All elements of this alist are checked, meaning +you can enable multiple minor modes for the same regexp.") + +(defun narf|enable-minor-mode-maybe () + "Check file name against `narf/auto-minor-mode-alist'." + (when buffer-file-name + (let ((name buffer-file-name) + (remote-id (file-remote-p buffer-file-name)) + (alist narf/auto-minor-mode-alist)) + ;; Remove backup-suffixes from file name. + (setq name (file-name-sans-versions name)) + ;; Remove remote file name identification. + (when (and (stringp remote-id) + (string-match-p (regexp-quote remote-id) name)) + (setq name (substring name (match-end 0)))) + (while (and alist (caar alist) (cdar alist)) + (if (string-match (caar alist) name) + (funcall (cdar alist) 1)) + (setq alist (cdr alist)))))) + +(@add-hook find-file 'narf|enable-minor-mode-maybe) + + +;; Plugins ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(use-package ace-jump-mode + :functions (ace-jump-char-category ace-jump-do) + :commands (ace-jump-line-mode ace-jump-char-mode + ace-jump-word-mode ace-jump-two-chars-mode) + :init (setq ace-jump-mode-scope 'window + ace-jump-mode-gray-background t) + :config + (defun ace-jump-two-chars-mode (&optional query-char query-char-2) + "AceJump two chars mode" + (interactive) + + (evil-half-cursor) + (setq query-char (or query-char (read-char ">"))) + (setq query-char-2 (or query-char-2 (read-char (concat ">" (string query-char))))) + (if (eq (ace-jump-char-category query-char) 'other) + (error "[AceJump] Non-printable character")) + + ;; others : digit , alpha, punc + (setq ace-jump-query-char query-char) + (setq ace-jump-current-mode 'ace-jump-char-mode) + (ace-jump-do (regexp-quote (concat (char-to-string query-char) + (char-to-string query-char-2)))))) + +(use-package ace-link + :commands + (ace-link-info ace-link-help ace-link-compilation ace-link-custom ace-link-org) + :init + (after "help-mode" + (bind motion :map help-mode-map "go" 'ace-link-help)) + (after "compile" + (bind motion :map compilation-mode-map "go" 'ace-link-compilation)) + (after "info" + (bind motion :map Info-mode-map "go" 'ace-link-info)) + (after "org" + (bind motion :map org-mode-map "go" 'ace-link-org))) + +(use-package ace-window + :commands ace-window + :config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) + aw-scope 'frame + aw-background nil)) + +;; (use-package emr +;; :commands (emr-initialize emr-show-refactor-menu emr-declare-command) +;; :bind (:map popup-menu-keymap [escape] 'keyboard-quit)) + +(use-package expand-region + :commands (er/expand-region er/contract-region er/mark-symbol er/mark-word)) + +(use-package goto-last-change :defer 3) + +(use-package hl-todo + :commands hl-todo-mode + :init + (@add-hook prog-mode 'hl-todo-mode) + (defvar hl-todo-keyword-faces) + '(("\\(\\bTODO\\((.*)\\)?:?\\)" . "#cc9393") + ("\\(\\bNOTE\\((.*)\\)?:?\\)" . "#d0bf8f") + ("\\(\\bFIXME\\((.*)\\)?:?\\)" . "#cc9393"))) + +(use-package hideshow + :diminish hs-minor-mode + :init (@add-hook (prog-mode org-mode) 'hs-minor-mode)) + +(use-package rainbow-delimiters + :commands rainbow-delimiters-mode + :init (@add-hook (emacs-lisp-mode js2-mode scss-mode) 'rainbow-delimiters-mode) + :config (setq rainbow-delimiters-outermost-only-face-count 1)) + +(use-package rotate-text :commands (rotate-word-at-point rotate-region)) + +(use-package smart-forward + :commands (smart-up smart-down smart-left smart-right)) + (use-package smartparens :diminish smartparens-mode + :commands smartparens-global-mode + :init (@add-init-hook evil-insert-state-entry 'smartparens-global-mode) :config (progn - (use-package smartparens-config) - (smartparens-global-mode 1) - (setq blink-matching-paren t - sp-autowrap-region nil ; let evil-surround handle this + sp-autowrap-region nil ; let evil-surround handle this sp-highlight-pair-overlay nil sp-show-pair-delay 0) + (use-package smartparens-config) + ;; Handle newlines + spaces (sp-pair "{" "}" :post-handlers '(("||\n[i]" "RET") ("| " " ")) :unless '(sp-point-before-word-p sp-point-before-same-p)) (sp-pair "(" ")" :post-handlers '(("||\n[i]" "RET") ("| " " ")) :unless '(sp-point-before-word-p sp-point-before-same-p)) - ;; Auto-close more conservatively (sp-pair "[" nil :unless '(sp-point-before-word-p sp-point-before-same-p)) (sp-pair "'" nil :unless '(sp-point-after-word-p sp-point-before-word-p sp-point-before-same-p)) @@ -73,89 +204,19 @@ (sp-with-modes '(c-mode c++-mode php-mode java-mode) (sp-local-pair "/*" "" :post-handlers '((" ||\n[i]*/" "RET")))) - (after "yasnippet" (advice-add 'yas-expand :before 'sp-remove-active-pair-overlay)))) + (after "yasnippet" + (advice-add 'yas-expand :before 'sp-remove-active-pair-overlay)))) -(use-package rotate-text - :commands (rotate-word-at-point rotate-region)) - -(use-package smart-forward - :commands (smart-up smart-down smart-left smart-right)) - -(use-package expand-region - :commands (er/expand-region er/contract-region er/mark-symbol er/mark-word)) - -(use-package hl-todo - :commands hl-todo-mode - :init (add-hook 'prog-mode-hook 'hl-todo-mode)) - -(use-package emr - :commands (emr-initialize emr-show-refactor-menu emr-declare-command) - :config (bind :map popup-menu-keymap [escape] 'keyboard-quit)) - -(use-package rainbow-delimiters - :commands rainbow-delimiters-mode - :init (add-to-hooks 'rainbow-delimiters-mode '(emacs-lisp-mode js2-mode scss-mode)) - :config (setq rainbow-delimiters-outermost-only-face-count 1)) - -(use-package ace-window - :commands ace-window +(use-package smex + :commands (smex smex-major-mode-commands smex-initialize smex-update) + :init (setq smex-save-file (! (expand-file-name "smex-items" TMP-DIR))) :config - (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) - aw-scope 'frame - aw-background nil)) + (smex-initialize) -(use-package ace-jump-mode - :functions (ace-jump-char-category ace-jump-do) - :commands (ace-jump-line-mode - ace-jump-char-mode - ace-jump-word-mode - ace-jump-two-chars-mode) - :config - (progn - (defun ace-jump-two-chars-mode (&optional query-char query-char-2) - "AceJump two chars mode" - (interactive) - - (evil-half-cursor) - (setq query-char (or query-char (read-char ">"))) - (setq query-char-2 (or query-char-2 (read-char (concat ">" (string query-char))))) - - (if (eq (ace-jump-char-category query-char) 'other) - (error "[AceJump] Non-printable character")) - - ;; others : digit , alpha, punc - (setq ace-jump-query-char query-char) - (setq ace-jump-current-mode 'ace-jump-char-mode) - (ace-jump-do (regexp-quote (concat (char-to-string query-char) - (char-to-string query-char-2))))) - (setq ace-jump-mode-scope 'window - ace-jump-mode-gray-background t))) - -(use-package ace-link - :commands (ace-link-info - ace-link-help - ace-link-compilation - ace-link-custom - ace-link-org) - :init - (progn - (after "help-mode" - (bind motion :map help-mode-map "go" 'ace-link-help)) - (after "compile" - (bind motion :map compilation-mode-map "go" 'ace-link-compilation)) - (after "info" - (bind motion :map Info-mode-map "go" 'ace-link-info)) - (after "org" - (bind motion :map org-mode-map "go" 'ace-link-org)))) - -(use-package quickrun - :commands (quickrun - quickrun-region - quickrun-with-arg - quickrun-shell - quickrun-compile-only - quickrun-replace-region - helm-quickrun)) + ;; Hook up smex to auto-update, rather than update on every run + (defun smex-update-after-load (unused) + (when (boundp 'smex-cache) (smex-update))) + (add-hook 'after-load-functions 'smex-update-after-load)) (provide 'core-editor) diff --git a/core/core-evil.el b/core/core-evil.el index 4730fd3d5..cd4470541 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -1,303 +1,261 @@ -;;;; Eeeeeeevil ;;;;;;;;;;;;;;;;;;;;;;;; +;;; core-evil.el --- the root of all evil + (use-package evil :init - (progn - (use-package goto-last-change) + ;; highlight matching delimiters where it's important + (defun show-paren-mode-off () (show-paren-mode -1)) + (@add-hook evil-insert-state-entry 'show-paren-mode) + (@add-hook evil-insert-state-exit 'show-paren-mode-off) + (@add-hook evil-visual-state-entry 'show-paren-mode) + (@add-hook evil-visual-state-exit 'show-paren-mode-off) + (@add-hook evil-motion-state-entry 'show-paren-mode) + (@add-hook evil-motion-state-exit 'show-paren-mode-off) + (@add-hook evil-operator-state-entry 'show-paren-mode) + (@add-hook evil-operator-state-exit 'show-paren-mode-off) - ;; highlight matching delimiters where it's important - (defun show-paren-mode-off () (show-paren-mode -1)) - (add-hook 'evil-insert-state-entry-hook 'show-paren-mode) - (add-hook 'evil-insert-state-exit-hook 'show-paren-mode-off) - (add-hook 'evil-visual-state-entry-hook 'show-paren-mode) - (add-hook 'evil-visual-state-exit-hook 'show-paren-mode-off) - (add-hook 'evil-motion-state-entry-hook 'show-paren-mode) - (add-hook 'evil-motion-state-exit-hook 'show-paren-mode-off) - (add-hook 'evil-operator-state-entry-hook 'show-paren-mode) - (add-hook 'evil-operator-state-exit-hook 'show-paren-mode-off) + ;; Disable highlights on insert-mode + (@add-hook evil-insert-state-entry 'evil-ex-nohighlight) - ;; Disable highlights on insert-mode - (add-hook 'evil-insert-state-entry-hook 'evil-ex-nohighlight) - - (add-hook! 'undo-tree-mode-hook (diminish 'undo-tree-mode)) - ;; Always ensure evil-shift-width is consistent with tab-width - (add-hook! 'evil-local-mode-hook (setq evil-shift-width tab-width))) + (@add-hook undo-tree-mode (diminish 'undo-tree-mode)) + ;; Always ensure evil-shift-width is consistent with tab-width + (@add-hook evil-local-mode (setq evil-shift-width tab-width)) :config - (progn - (progn ; open/close fold mods - ;; Instead of `evil-open-folds'. Accepts COUNT for dictating fold level. - (evil-define-command narf:open-folds (count) - (interactive "P") - (if count (hs-hide-level count) (evil-open-folds))) + (setq evil-magic t + evil-want-C-u-scroll t ; enable C-u for scrolling + evil-ex-visual-char-range t ; column range for ex commands + evil-want-fine-undo nil + evil-want-visual-char-semi-exclusive nil + evil-ex-search-vim-style-regexp t + evil-ex-interactive-search-highlight 'selected-window - ;; Instead of `evil-close-folds'. Accepts COUNT for dictating fold level. - (evil-define-command narf:close-folds (count) - (interactive "P") - (if count (hs-hide-level count) (evil-close-folds)))) + ;; Color-coded state cursors + evil-normal-state-cursor '("white" box) + evil-emacs-state-cursor '("cyan" bar) + evil-insert-state-cursor '("white" bar) + evil-visual-state-cursor '("white" hollow) + evil-iedit-state-cursor '("orange" box)) - (setq evil-magic t - evil-want-C-u-scroll t ; enable C-u for scrolling - evil-ex-visual-char-range t ; column range for ex commands - evil-want-fine-undo nil - evil-want-visual-char-semi-exclusive nil - evil-ex-search-vim-style-regexp t - evil-ex-interactive-search-highlight 'selected-window + (evil-mode 1) + (evil-select-search-module 'evil-search-module 'evil-search) + (add-to-list 'evil-overriding-maps 'narf-mode-map) - ;; Color-coded state cursors - evil-normal-state-cursor '("white" box) - evil-emacs-state-cursor '("cyan" bar) - evil-insert-state-cursor '("white" bar) - evil-visual-state-cursor '("white" hollow) - evil-iedit-state-cursor '("orange" box)) + (defadvice evil-ex-hl-do-update-highlight (around evil-ex-hl-shut-up activate) + "Silence 'Error running timer `evil-ex-hl-do-update-highlight': (error +\"Invalid use of `\\' in replacement text\") errors. - (add-to-list 'evil-overriding-maps '(narf-mode-map)) - (evil-mode 1) - (evil-select-search-module 'evil-search-module 'evil-search) +See `https://bitbucket.org/lyro/evil/issue/527'" + (ignore-errors ad-do-it)) - (defadvice evil-ex-hl-do-update-highlight (around evil-ex-hl-shut-up activate) - (ignore-errors ad-do-it)) + ;; modes to map to different default states + (dolist (mode-map '((cider-repl-mode . emacs) + (comint-mode . emacs) + (term-mode . emacs) + (fundamental-mode . normal) + (help-mode . normal) + (message-mode . normal) + (compilation-mode . normal))) + (evil-set-initial-state `,(car mode-map) `,(cdr mode-map))) - ;; modes to map to different default states - (dolist (mode-map '((cider-repl-mode . emacs) - (comint-mode . emacs) - (fundamental-mode . normal) - (help-mode . normal) - (term-mode . emacs) - (message-mode . normal) - (compilation-mode . normal))) - (evil-set-initial-state `,(car mode-map) `,(cdr mode-map))) + (progn ; evil plugins + (use-package evil-anzu) - ;; Ace Jump - ;; https://github.com/winterTTr/ace-jump-mode/issues/23 - (evil-define-motion evil-ace-jump-two-chars-mode (count) - :type exclusive - :repeat abort - (evil-without-repeat - (evil-enclose-ace-jump-for-motion - (call-interactively 'ace-jump-two-chars-mode)))) + (use-package evil-commentary + :diminish evil-commentary-mode + :commands (evil-commentary + evil-commentary-mode + evil-commentary-yank + evil-commentary-line) + :config (evil-commentary-mode 1)) - (progn ; evil helpers - (defun evil-visual-line-state-p () - "Returns non-nil if in visual-line mode, nil otherwise." - (and (evil-visual-state-p) - (eq (evil-visual-type) 'line)))) + (use-package evil-ex-registers + :commands (evil-get-spec-register + evil-ex-paste-from-register)) - (progn ; evil plugins - (use-package evil-anzu) + (use-package evil-exchange + :commands evil-exchange + :config + (defadvice evil-force-normal-state (before evil-esc-quit-exchange activate) + "Remove `evil-exchange' overlays on ESC" + (when evil-exchange--overlays (evil-exchange-cancel)))) +(lambda () + (interactive) + (if (iedit-current-occurrence-string) + (progn + (save-excursion (iedit-restrict-region (region-beginning) (region-end))) + (evil-previous-line) + (evil-iedit-state/iedit-mode)) + (call-interactively 'evil-ret))) + (use-package evil-iedit-state + :functions (iedit-current-occurrence-string iedit-restrict-region) + :commands (evil-iedit-state evil-iedit-state/iedit-mode) + :config + (@map ; Don't interfere with evil-snipe + :I :unset "s" + :I :unset "S" - (use-package evil-iedit-state - :functions (iedit-current-occurrence-string iedit-restrict-region) - :commands (evil-iedit-state evil-iedit-state/iedit-mode) - :config - (progn - (bind :map evil-iedit-state-map ; Don't interfere with evil-snipe - "s" nil - "S" nil) - (bind iedit - "V" 'evil-visual-line - "C" 'evil-iedit-state/substitute ; instead of s/S - "za" 'iedit-toggle-unmatched-lines-visible + :I "V" 'evil-visual-line + :I "C" 'evil-iedit-state/substitute ; instead of s/S + :I "za" 'iedit-toggle-unmatched-lines-visible - visual "SPC" (λ (if (iedit-current-occurrence-string) - (let ((current-prefix-arg '(4))) - (iedit-done) - (call-interactively 'iedit-mode) - (save-excursion (iedit-restrict-region (region-beginning) (region-end))) - (evil-previous-line)) - (call-interactively 'evil-ret)))))) + :v "SPC" (λ (if (iedit-current-occurrence-string) + (progn + (save-excursion (iedit-restrict-region (region-beginning) (region-end))) + (evil-previous-line) + (evil-iedit-state/iedit-mode)) + (call-interactively 'evil-ret))))) + (use-package evil-indent-textobject + :commands (evil-indent-i-indent + evil-indent-a-indent + evil-indent-a-indent-lines) + :init + (@map :map evil-inner-text-objects-map + "i" 'evil-indent-i-indent + "i" 'evil-indent-a-indent + "I" 'evil-indent-a-indent-lines)) - (use-package evil-search-highlight-persist - :config (global-evil-search-highlight-persist t)) + (use-package evil-jumper + :init + (setq evil-jumper-file (! (expand-file-name "jumplist" narf-temp-dir)) + evil-jumper-auto-center t + evil-jumper-auto-save-interval 3600)) - (use-package evil-indent-textobject ; vii/vai/vaI - :commands (evil-indent-i-indent - evil-indent-a-indent - evil-indent-a-indent-lines) - :init - (bind :map evil-inner-text-objects-map - "i" 'evil-indent-i-indent - "i" 'evil-indent-a-indent - "I" 'evil-indent-a-indent-lines)) + (use-package evil-matchit + :commands (evilmi-jump-items global-evil-matchit-mode) + :config (global-evil-matchit-mode 1)) - (use-package evil-ex-registers - :commands (evil-get-spec-register - evil-ex-paste-from-register)) + (use-package evil-numbers + :commands (evil-numbers/inc-at-pt + evil-numbers/dec-at-pt)) - (use-package evil-surround - :commands (global-evil-surround-mode - evil-surround-edit - evil-Surround-edit - evil-surround-region) - :config - (progn - (evil-define-motion evil-surround-line (count) - "Move COUNT - 1 lines down but return exclusive character motion." - :type exclusive - (let ((beg (line-beginning-position))) - (evil-line count) - (end-of-line) - (let ((range (evil-range beg (point) 'exclusive))) - (evil-expand-range range) - range))) + (use-package evil-search-highlight-persist + :config (global-evil-search-highlight-persist t)) - ;; Escaped surround characters - (defun evil-surround-escaped () - (let* ((char (string (read-char "\\"))) - (pair (cond ((string-match "[]})[{(]" char) - (let ((-pair (cdr (assoc (string-to-char char) evil-surround-pairs-alist)))) - `(,(car -pair) . ,(cdr -pair)))) - (t - `(,char . ,char)))) - (format (if (sp-point-in-string) "\\\\%s" "\\%s"))) - (cons (format format (car pair)) - (format format (cdr pair))))) + (use-package evil-snipe + :diminish evil-snipe-mode + :commands (evil-snipe-s evil-snipe-S + evil-snipe-x evil-snipe-X + evil-snipe-f evil-snipe-F + evil-snipe-t evil-snipe-T) + :init + (setq-default + evil-snipe-smart-case t + evil-snipe-scope 'line + evil-snipe-repeat-scope 'buffer + evil-snipe-override-evil-repeat-keys nil + evil-snipe-symbol-groups '((?\[ "[[{(]") + (?\] "[]})]"))) + :config + (evil-snipe-mode 1) + (evil-snipe-override-mode 1)) - (global-evil-surround-mode 1) + (use-package evil-space + :diminish (evil-space-mode . "_") + :config + (progn + (add-to-list 'evil-overriding-maps 'evil-space-mode-map) - (push '(?\C-\[ . ("" . "")) evil-surround-pairs-alist))) + (evil-space-setup "/" "n" "N") + (evil-space-setup "?" "N" "n") - (use-package evil-numbers - :commands (evil-numbers/inc-at-pt - evil-numbers/dec-at-pt)) + (@after evil-numbers + (let ((map (evil-get-auxiliary-keymap narf-mode-map 'normal))) + (evil-space-setup "g=" "g=" "g-" map) + (evil-space-setup "g-" "g-" "g=" map))) - (use-package evil-matchit - :commands (evilmi-jump-items global-evil-matchit-mode) - :config (global-evil-matchit-mode 1)) + (@after evil-snipe + (let ((map (evil-get-auxiliary-keymap evil-snipe-override-mode-map 'motion))) + (evil-space-setup "t" "C-;" "C-," map) + (evil-space-setup "f" "C-;" "C-," map) + (evil-space-setup "T" "C-," "C-;" map) + (evil-space-setup "F" "C-," "C-;" map)) + (let ((map (evil-get-auxiliary-keymap evil-snipe-mode-map 'motion))) + (evil-space-setup "s" "C-;" "C-," map) + (evil-space-setup "S" "C-," "C-;" map))) - (use-package evil-commentary - :diminish evil-commentary-mode - :commands (evil-commentary - evil-commentary-mode - evil-commentary-yank - evil-commentary-line) - :config (evil-commentary-mode 1)) + (@after evil-visualstar + (let ((map (evil-get-auxiliary-keymap evil-visualstar-mode-map 'visual))) + (evil-space-setup "*" "n" "N" map) + (evil-space-setup "#" "n" "N" map))) - (use-package evil-jumper - :init (setq evil-jumper-file (expand-file-name "jumplist" TMP-DIR)) - :config - (setq evil-jumper-auto-center t - evil-jumper-auto-save-interval 3600)) + (evil-space-mode))) - (use-package evil-exchange - :commands evil-exchange - :config - (defadvice evil-force-normal-state (before evil-esc-quit-exchange activate) - (when evil-exchange--overlays (evil-exchange-cancel)))) + (use-package evil-surround + :commands (global-evil-surround-mode + evil-surround-edit + evil-Surround-edit + evil-surround-region) + :config + (global-evil-surround-mode 1) - (use-package evil-visualstar - :commands (global-evil-visualstar-mode - evil-visualstar/begin-search-forward - evil-visualstar/begin-search-backward) - :config - (global-evil-visualstar-mode 1)) + ;; Escaped surround characters + (defun evil-surround-escaped () + (let* ((char (string (read-char "\\"))) + (pair (cond ((string-match "[]})[{(]" char) + (let ((-pair (cdr (assoc (string-to-char char) evil-surround-pairs-alist)))) + `(,(car -pair) . ,(cdr -pair)))) + (t + `(,char . ,char)))) + (format (if (sp-point-in-string) "\\\\%s" "\\%s"))) + (cons (format format (car pair)) + (format format (cdr pair))))) - (use-package evil-snipe - :diminish evil-snipe-mode - :init - (setq evil-snipe-smart-case t - evil-snipe-scope 'line - evil-snipe-repeat-scope 'buffer - evil-snipe-symbol-groups '((?\[ "[[{(]") - (?\] "[]})]"))) - :config - (progn - (evil-snipe-mode 1) - (evil-snipe-override-mode 1) + (push '(?\\ . evil-surround-escaped) evil-surround-pairs-alist)) - (bind motion :map evil-snipe-mode-map - "C-;" 'evil-snipe-repeat - "C-," 'evil-snipe-repeat-reverse))) + (use-package evil-visualstar + :commands (global-evil-visualstar-mode + evil-visualstar/begin-search + evil-visualstar/begin-search-forward + evil-visualstar/begin-search-backward) + :config + ;; I cut this down because the original visualstar wouldn't remember + ;; the last search if evil-search-module was 'evil-search. + (defun narf/evil-visualstar/begin-search (beg end direction) + (when (evil-visual-state-p) + (evil-exit-visual-state) + (let ((selection (regexp-quote (buffer-substring-no-properties beg end)))) + (setq isearch-forward direction) + (evil-search selection direction t)))) + (advice-add 'evil-visualstar/begin-search :override 'narf/evil-visualstar/begin-search) - (use-package evil-space - :diminish (evil-space-mode . "_") - :config - (progn - (evil-space-mode 1) + (global-evil-visualstar-mode 1))) - (evil-space-setup "/" "n" "N") - (evil-space-setup "?" "n" "N") + (progn ; evil hacks + (defadvice evil-force-normal-state (before evil-esc-quit activate) + (ignore-errors + (popwin:close-popup-window) ; close popups, if any + (evil-search-highlight-persist-remove-all) ; turn off highlights + (evil-ex-nohighlight) + ;; Exit minibuffer if alive + (if (minibuffer-window-active-p (minibuffer-window)) + (narf/minibuffer-quit)))) - (after "evil-snipe" - (evil-space-setup evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse) - (evil-space-setup evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse) - (evil-space-setup evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse) - (evil-space-setup evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse) - (evil-space-setup evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse) - (evil-space-setup evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)) + ;; Jump to new splits + (defadvice evil-window-split (after evil-window-split-jump activate) + (evil-window-down 1)) + (defadvice evil-window-vsplit (after evil-window-vsplit-jump activate) + (evil-window-right 1)) - (after "evil-numbers" - (let ((map (evil-get-auxiliary-keymap narf-mode-map 'normal))) - (evil-space-setup "g=" "g=" "g-" map) - (evil-space-setup "g-" "g-" "g=" map))) + (@after isearch ; Restore vimmish ex-mode keymaps to isearch + ;; Hide keystroke display while isearch is active + (@add-hook isearch-mode (setq echo-keystrokes 0)) + (@add-hook isearch-mode-end (setq echo-keystrokes 0.02)) + (@map :map isearch-mode-map + :unset "C-r" - (after "evil-visualstar" - (let ((map (evil-get-auxiliary-keymap evil-visualstar-mode-map 'visual))) - (evil-space-setup "*" "*" "#" map) - (evil-space-setup "#" "#" "*" map)))))) + "C-r %" (λ (narf:isearch-paste-from-register ?%)) + "C-r #" (λ (narf:isearch-paste-from-register ?#)) + "C-r /" (λ (narf:isearch-paste-from-register ?/)) + "C-r :" (λ (narf:isearch-paste-from-register ?:)) + "C-r ." (λ (narf:isearch-paste-from-register ?.)) + "C-r -" (λ (narf:isearch-paste-from-register ?-)) + "C-r _" (λ (narf:isearch-paste-from-register ?_)) + "C-r =" (λ (narf:isearch-paste-from-register ?=)) + "C-r +" 'narf:isearch-paste-from-clipboard - (progn ; evil hacks - (defadvice evil-force-normal-state (before evil-esc-quit activate) - (ignore-errors - (popwin:close-popup-window) ; close popups, if any - (evil-search-highlight-persist-remove-all) ; turn off highlights - (evil-ex-nohighlight) - ;; Exit minibuffer if alive - (if (minibuffer-window-active-p (minibuffer-window)) - (narf/minibuffer-quit)))) - - ;; Jump to new splits - (defadvice evil-window-split (after evil-window-split-jump activate) - (evil-window-down 1)) - (defadvice evil-window-vsplit (after evil-window-vsplit-jump activate) - (evil-window-right 1)) - - (progn ; Restore vimmish ex-mode keymaps to isearch - (defun narf:isearch-delete-word () - (interactive) - (let ((num (length isearch-string)) - (string (s-reverse isearch-string))) - (when (string-match "[^a-zA-Z0-9]" string 1) - (setq num (match-beginning 0))) - (dotimes (i num) - (isearch-pop-state)) - (isearch-update))) - - (defun narf:isearch-delete-line () - (interactive) - (let ((num (length isearch-string))) - (dotimes (i num) (isearch-pop-state)) - (isearch-update))) - - (defun narf:isearch-paste-from-register (reg) - (interactive) - (let ((str (evil-get-register reg t))) - (when (> (length str) 0) - (isearch-yank-string str)))) - - (defun narf:isearch-paste-from-clipboard () - (interactive) - (narf:isearch-paste-from-register ?+)) - - ;; Hide keystroke display while isearch is active - (add-hook! 'isearch-mode-hook (setq echo-keystrokes 0)) - (add-hook! 'isearch-mode-end-hook (setq echo-keystrokes 0.02)) - - (bind :map isearch-mode-map - "C-r" nil - - "C-r %" (λ (narf:isearch-paste-from-register ?%)) - "C-r #" (λ (narf:isearch-paste-from-register ?#)) - "C-r /" (λ (narf:isearch-paste-from-register ?/)) - "C-r :" (λ (narf:isearch-paste-from-register ?:)) - "C-r ." (λ (narf:isearch-paste-from-register ?.)) - "C-r -" (λ (narf:isearch-paste-from-register ?-)) - "C-r _" (λ (narf:isearch-paste-from-register ?_)) - "C-r =" (λ (narf:isearch-paste-from-register ?=)) - "C-r +" 'narf:isearch-paste-from-clipboard - - "C-w" 'narf:isearch-delete-word - "C-u" 'narf:isearch-delete-line - "M-v" 'narf:isearch-paste-from-clipboard))))) + "C-w" 'narf:isearch-delete-word + "C-u" 'narf:isearch-delete-line + "M-v" 'narf:isearch-paste-from-clipboard)))) (provide 'core-evil) diff --git a/core/core-linux.el b/core/core-linux.el deleted file mode 100644 index 6f8ca10e6..000000000 --- a/core/core-linux.el +++ /dev/null @@ -1,4 +0,0 @@ - -(provide 'core-linux) - -;; Nothing here yet diff --git a/core/core-os-linux.el b/core/core-os-linux.el new file mode 100644 index 000000000..146fa01b0 --- /dev/null +++ b/core/core-os-linux.el @@ -0,0 +1,9 @@ +;;; core-os-linux.el --- Debian-specific settings + +(defun narf-open-with (&optional app-name path) + (interactive) + (error "Not yet implemented")) + + +(provide 'core-os-linux) +;;; core-os-linux.el ends here diff --git a/core/core-osx.el b/core/core-os-osx.el similarity index 75% rename from core/core-osx.el rename to core/core-os-osx.el index d6b7d29ed..7451ca745 100644 --- a/core/core-osx.el +++ b/core/core-os-osx.el @@ -1,4 +1,4 @@ -;; Mac-specific settings +;;; core-os-osx.el --- Mac-specific settings ;; Use a shared clipboard (setq x-select-enable-clipboard t @@ -13,18 +13,15 @@ ;; fix emacs PATH on OSX (GUI only) (when window-system (setenv "SHELL" "/usr/local/bin/zsh") - (setenv "EMACS" "1") + (setenv "EMACS" "1") ; make sure the world knows - (defmacro narf/init-exec-path () - "Initialize shell path via `exec-path-from-shell'." - (require 'exec-path-from-shell) - (exec-path-from-shell-initialize) - `(setq exec-path ',exec-path)) + (setq exec-path (! (require 'exec-path-from-shell) + (exec-path-from-shell-initialize) + exec-path))) - (narf/init-exec-path)) +;; OSX Related Plugins ;;;;;;;;;;;;;;;;; -(use-package applescript-mode - :mode "\\.applescript$") +(use-package applescript-mode :mode "\\.applescript$") (use-package dash-at-point :commands (dash-at-point dash-at-point-with-docset) @@ -32,7 +29,9 @@ (add-to-list 'dash-at-point-mode-alist '(java-mode . "java,droid,javafx,grails,groovy,playjava,spring,cvj,processing,javadoc"))) -(after "evil" +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(@after evil (when (featurep 'ns) ;; On OSX, stop copying each visual state move to the clipboard: ;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on @@ -42,7 +41,7 @@ (unless (featurep 'ns) ad-do-it)))) ;; Send current file to OSX apps -(defun narf:osx-open-with (&optional app-name path) +(defun narf-open-with (&optional app-name path) (interactive) (let* ((path (f-full (s-replace "'" "\\'" (or path (if (eq major-mode 'dired-mode) (dired-get-file-for-visit) (buffer-file-name)))))) (command (concat "open " (when app-name (concat "-a " (shell-quote-argument app-name))) " '" path "'"))) @@ -50,5 +49,5 @@ (shell-command command))) -(provide 'core-osx) -;;; core-osx.el ends here +(provide 'core-os-osx) +;;; core-os-osx.el ends here diff --git a/core/core-os-win32.el b/core/core-os-win32.el new file mode 100644 index 000000000..6a61159a0 --- /dev/null +++ b/core/core-os-win32.el @@ -0,0 +1,9 @@ +;;; core-os-win32.el --- Windows-specific settings + +(defun narf-open-with (&optional app-name path) + (interactive) + (error "Not yet implemented")) + + +(provide 'core-os-win32) +;;; core-os-win32.el ends here diff --git a/core/core-splash.el b/core/core-splash.el deleted file mode 100644 index cf534026b..000000000 --- a/core/core-splash.el +++ /dev/null @@ -1,145 +0,0 @@ - -(define-derived-mode narf-splash-mode special-mode "NARF" - "Splash screen for Narf emacs.") - -(defun narf/splash-init () - ) - -(defun narf/random-comeback () - (let ((replies '("I think so, Brain, but where are we going to find a duck and a hose at this hour?" - "I think so, but where will we find an open tattoo parlor at this time of night?" - "Wuh, I think so, Brain, but if we didn't have ears, we'd look like weasels." - "Uh... yeah, Brain, but where are we going to find rubber pants our size?" - "Uh, I think so, Brain, but balancing a family and a career ... ooh, it's all too much for me." - "Wuh, I think so, Brain, but isn't Regis Philbin already married?" - "Wuh, I think so, Brain, but burlap chafes me so." - "Sure, Brain, but how are we going to find chaps our size?" - "Uh, I think so, Brain, but we'll never get a monkey to use dental floss." - "Are you pondering cheesesticks?" - "Uh, I think so Brain, but this time, you wear the tutu." - "I think so, Brain, but culottes have a tendency to ride up so." - "I think so, Brain, but if we covered the world in salad dressing wouldn't the aspargus feel left out?" - "I think so, Brain, but if they called them 'Sad Meals', kids wouldn't buy them!" - "I think so, Brain, but me and Pippi Longstocking -- I mean, what would the children look like?" - "I think so, Brain, but what would Pippi Longstocking look like with her hair straight?" - "I think so, Brain, but this time you put the trousers on the chimp." - "Well, I think so, Brain, but I can't memorize a whole opera in Yiddish." - "I think so, Brain, but there's still a bug stuck in here from last time." - "Uh, I think so, Brain, but I get all clammy inside the tent." - "I think so, Brain, but I don't think Kaye Ballard's in the union." - "I think so, Brain, but, the Rockettes? I mean, it's mostly girls, isn't it?" - "I think so, Brain, but pants with horizontal stripes make me look chubby." - "Well, I think so -POIT- but where do you stick the feather and call it macaroni?" - "Well, I think so, Brain, but pantyhose are so uncomfortable in the summertime." - "Well, I think so, Brain, but it's a miracle that this one grew back." - "Well, I think so, Brain, but first you'd have to take that whole bridge apart, wouldn't you?" - "Well, I think so, Brain, but 'apply North Pole' to what?" - "I think so, Brain, but 'Snowball for Windows'?" - "Well, I think so, Brain, but snort no, no, it's too stupid!" - "Umm, I think so, Don Cerebro, but, umm, why would Sophia Loren do a musical?" - "Umm, I think so, Brain, but what if the chicken won't wear the nylons?" - "I think so, Brain, but isn't that why they invented tube socks?" - "Well, I think so Brain, but what if we stick to the seat covers?" - "I think so Brain, but if you replace the 'P' with an 'O', my name would be Oinky, wouldn't it?" - "Oooh, I think so Brain, but I think I'd rather eat the Macarena." - "Well, I think so hiccup, but Kevin Costner with an English accent?" - "I think so, Brain, but don't you need a swimming pool to play Marco Polo?" - "Well, I think so, Brain, but do I really need two tongues?" - "I think so, Brain, but we're already naked." - "Well, I think so, Brain, but if Jimmy cracks corn, and no one cares, why does he keep doing it?" - "I think so, Brain NARF, but don't camels spit a lot?" - "I think so, Brain, but how will we get a pair of Abe Vigoda's pants?" - "I think so, Brain, but Pete Rose? I mean, can we trust him?" - "I think so, Brain, but why would Peter Bogdanovich?" - "I think so, Brain, but isn't a cucumber that small called a gherkin?" - "I think so, Brain, but if we get Sam Spade, we'll never have any puppies." - "I think so, Larry, and um, Brain, but how can we get seven dwarves to shave their legs?" - "I think so, Brain, but calling it pu-pu platter? Huh, what were they thinking?" - "I think so, Brain, but how will we get the Spice Girls into the paella?" - "I think so, Brain, but if we give peas a chance, won't the lima beans feel left out?" - "I think so, Brain, but I am running for mayor of Donkeytown and Tuesdays are booked." - "I think so, Brain, but if we had a snowmobile, wouldn't it melt before summer?" - "I think so, Brain, but what kind of rides do they have in Fabioland?" - "I think so, Brain, but can the Gummi Worms really live in peace with the Marshmallow Chicks?" - "Wuh, I think so, Brain, but wouldn't anything lose its flavor on the bedpost overnight?" - "I think so, Brain, but three round meals a day wouldn't be as hard to swallow." - "I think so, Brain, but if the plural of mouse is mice, wouldn't the plural of spouse be spice?" - "Umm, I think so, Brain, but three men in a tub? Ooh, that's unsanitary!" - "Yes, but why does the chicken cross the road, huh, if not for love? I do not know." - "Wuh, I think so, Brain, but I prefer Space Jelly." - "Yes Brain, but if our knees bent the other way, how would we ride a bicycle?" - "Wuh, I think so, Brain, but how will we get three pink flamingos into one pair of Capri pants?" - "I think so, Brain, but Tuesday Weld isn't a complete sentence." - "I think so, Brain, but why would anyone want to see Snow White and the Seven Samurai?" - "I think so, Brain, but wouldn't mustard make it sting?" - "I think so, Brain, but can you use the word 'asphalt' in polite society?" - "I think so, Mr. Brain, but if the sun'll come out tomorrow, what's it doing right now?" - "I think so, Brain, but aren't we out of shaving cream?" - "Oh yes, Brain! Remind me to tape all our phone calls!" - "Um, I think so, Brain, but I hear Hillary is the jealous type." - "I think so, Brain, but Madonna's stock is sinking." - "I think so, Brain. But does 'Chunk o' Cheesy's' deliver packing material?" - "I think so, Brainwulf, but if we're Danish, where's the cream cheese? Narf!" - "I think so, Bwain, but I don't think newspaper will fit in my underoos." - "Uh, I think so, Brain--but after eating newspaper all day, do I really need the extra fiber?" - "I think so, Brain! But isn't a dreadlock hair extension awfully expensive?" - "I think so, Brain. But will anyone other than Eskimos buy blubber-flavored chewing gum?" - "I think so, Brain, but the ointment expired weeks ago!" - "Uh, I think so Brain, but how are we gonna teach a goat to dance with flippers on?" - "Wuhh... I think so, Brain! But let's use safflower oil this time! It's ever so much healthier!" - "Wuh... I think so, Brain. But Cream of Gorilla Soup—well, we'd have to sell it in awfully big cans, wouldn't we?" - "I think so, Brain. But if he left chocolate bullets instead of silver, they'd get all runny and gooey!" - "Yes, Brain, I think so, but do nuts go with pudding?" - "I think so, Brain, but a codpiece made from a real fish would get smelly after a while, wouldn’t it?" - "I think... so, Brain... *gag* ...but I didn't know Annette used peanut butter in that way." - "I think so, Brain, but do those roost in this neighborhood?" - "I think so, Brain, but is the world ready for angora bellbottoms? I mean I can see wearing them inside out, but that would--" - "I think so, Commander Brain from Outer Space! But do we have time to grease the rockets?" - "I think so, Doctor. But are these really the legs of a show girl?" - "Whuh... I think so, Brain. But this time I get to play the dishwasher repairman!" - "I think so, Brainius. But what if a sudden wind were to blow up my toga?" - "I think so, Brain. But Trojans won’t arrive on the scene for another 300 years." - "I think so, Brain... but where would a yak put PVC tubing?" - "Whuh... I think so, Brain, but... but if Charlton Heston doesn't eat Soylent Green, what will he eat?" - "I think so, Brain, but would Danish flies work just as well?" - "We think so, Brain! But dressing like twins is so tacky." - "I think so, Brain, but practicing docking procedures with a goat at zero G's—it's never been done!" - "I think so, Brain! But shouldn't we let the silk worms finish the boxer shorts before we put them on?" - "I think so, Brain! You draw the bath and I'll fetch the alka-seltzers and candles!" - "I think so, Brain. But the real trick will be getting Demi Moore out of the creamed corn!" - "Wuhhh... I think so, Brain, but if a ham can operate a radio, why can't a pig set a VCR?" - "I think so, Brain, you'd think [Lyndon Johnson would] have left room for baby-kissing, wouldn't you?" - "I think so, Brain! But won't Mr. Hoover notice a missing evening gown?" - "I think so, Brain! But what's the use of having a heart-shaped tattoo if it's going to be covered by hair?" - "I think so, Brain, but couldn't the constant use of a henna rinse lead to premature baldness?" - "I think so, Brain. Just make sure we don't swallow each other's bubbles!" - "I think so, Brain! But ruby-studded stockings would be mighty uncomfortable wouldn't they?" - "I think so, Brain, but if I have my portrait drawn, will we have time to make it to the lifeboats?" - "I think so, Brain! But is Chippendale's ready for 'The Full Pinky?'" - "I think so, Brain! But do I have what it take to be the 'Lord of the Dance'?" - "I think so, Brain! How much deeper would the ocean be if there weren't sponges down there?" - "Oh, I think so, Brain! But doing a clog dance in actual clogs will give me awful blisters." - "I think so, Brain, but nose rings are kinda passé by now." - "I think so, Brain, but where are we going to get a trained octopus at this time of night?" - "I think so, Brain! But no more eels in jelly for me, thanks—I like my gelatin after lunch." - "I think so, Brain, but I didn’t know 90210 was a real zip code! Will Tori be there?" - "I think so, Brain. But if Pinocchio were carved out of bacon it wouldn't be the same story, would it?" - "Um, I think so, Brain, but wasn't Dicky Ducky released on his own recognaissance?" - "I think so, Brain, but Pepper Ann makes me sneeze." - "I think so, Brain. But suppose we do the hokey pokey and turn ourselves around, is that what it's really all about?" - "I think so, Brain, but just how will we get the weasel to hold still?" - "I think so, Brain, but how are we going to get the bacon flavoring into the pencils?" - "I think so, Brain, but instant karma's always so lumpy." - ))) - (nth (random (length replies)) replies))) - -;; TODO: Move this to external file -(add-hook 'after-init-hook - (lambda () (setq initial-scratch-message - (format "\n\n\n\n NARF!\n Emacs: %s\n\n >> Loaded in %s\n >>> %s" - emacs-version - (emacs-init-time) - (narf/random-comeback))))) - -(provide 'core-splash) -;;; core-splash.el ends here diff --git a/core/core-ui.el b/core/core-ui.el index a03b0d5da..cf59388cf 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -1,6 +1,9 @@ -;;; core-ui.el -- User interface layout & behavior +;;; core-ui.el --- interface settings (when (fboundp 'fringe-mode) (fringe-mode '(2 . 8))) +(when window-system ; more informative window title + (setq frame-title-format '(buffer-file-name "%f" ("%b")))) + ;; theme and GUI elements are loaded in init.el early (setq show-paren-delay 0) @@ -18,199 +21,180 @@ (setq-default cursor-in-non-selected-windows nil visible-bell nil ; silence of the bells - use-dialog-box nil ; avoid GUI + use-dialog-box nil ; avoid GUI redisplay-dont-pause t - ;; do not soft-wrap lines - truncate-lines t - truncate-partial-width-windows nil indicate-buffer-boundaries nil indicate-empty-lines nil - fringes-outside-margins t) + fringes-outside-margins t) ; fringes on the other side of line numbers -(use-package nlinum - :commands nlinum-mode - :init - (progn - (defface linum '((t (:inherit default))) - "Face for line numbers" - :group 'nlinum-mode) - (defface linum-highlight-face '((t (:inherit linum))) - "Face for line highlights" - :group 'nlinum-mode) - - ;; Preset width nlinum - (add-hook! 'nlinum-mode-hook - (setq nlinum--width (length (number-to-string (count-lines (point-min) - (point-max)))))) - - ;; Highlight line number - (defvar narf--hl-nlinum-overlay nil) - (defvar narf--hl-nlinum-line nil) - (defun narf/nlinum-unhl-line () - (when narf--hl-nlinum-overlay - (let* ((ov narf--hl-nlinum-overlay) - (disp (get-text-property 0 'display (overlay-get ov 'before-string))) - (str (nth 1 disp))) - (put-text-property 0 (length str) 'face 'linum str) - (setq narf--hl-nlinum-overlay nil - narf--hl-nlinum-line nil)))) - - (defun narf/nlinum-hl-line (&optional line) - (let ((line-no (or line (line-number-at-pos (point))))) - (when (and nlinum-mode (not (eq line-no narf--hl-nlinum-line))) - (let* ((pbol (if line (save-excursion (goto-char (point-min)) - (forward-line line-no) - (point-at-bol)) - (point-at-bol))) - (peol (1+ pbol))) - ;; Handle EOF case - (when (>= peol (point-max)) - (setq peol (point-max))) - (jit-lock-fontify-now pbol peol) - (let* ((overlays (overlays-in pbol peol)) - (ov (-first (lambda (item) (overlay-get item 'nlinum)) overlays))) - (when ov - (narf/nlinum-unhl-line) - (let* ((disp (get-text-property 0 'display (overlay-get ov 'before-string))) - (str (nth 1 disp))) - (put-text-property 0 (length str) 'face 'linum-highlight-face str) - (put-text-property 0 (length str) 'face 'linum-highlight-face str) - (setq narf--hl-nlinum-overlay ov - narf--hl-nlinum-line line-no)))))))) - - (defun narf:nlinum-toggle () - (interactive) - (if nlinum-mode - (narf/nlinum-disable) - (narf/nlinum-enable))) - (defun narf/nlinum-enable () - (nlinum-mode +1) - (add-hook 'post-command-hook 'narf/nlinum-hl-line)) - (defun narf/nlinum-disable () - (nlinum-mode -1) - (remove-hook 'post-command-hook 'narf/nlinum-hl-line) - (narf/nlinum-unhl-line)) - - (add-hook 'prog-mode-hook 'narf/nlinum-enable) - (add-hook 'org-mode-hook 'narf/nlinum-disable)) - :config - (setq-default nlinum-format " %4d ")) - -(when window-system - (setq frame-title-format '(buffer-file-name "%f" ("%b"))) - (if (string-equal (system-name) "io") - (set-frame-size (selected-frame) 326 119))) - -(add-hook! 'after-init-hook +(@add-hook after-init (defadvice save-buffers-kill-emacs (around no-query-kill-emacs activate) "Prevent annoying \"Active processes exist\" query when you quit Emacs." (flet ((process-list ())) ad-do-it))) +;;;; Line numbers ;;;;;;;;;;;;;;;;;;;;;; + +(use-package nlinum + :defines nlinum--width + :commands nlinum-mode + :preface + (defface linum '((t (:inherit default))) + "Face for line numbers" :group 'nlinum-mode) + (defface linum-highlight-face '((t (:inherit linum))) + "Face for line highlights" :group 'nlinum-mode) + (defvar narf--hl-nlinum-overlay nil) + (defvar narf--hl-nlinum-line nil) + (defvar nlinum-format " %4d ") + :init + ;; Highlight line number + (defun narf|nlinum-unhl-line () + (when narf--hl-nlinum-overlay + (let* ((ov narf--hl-nlinum-overlay) + (disp (get-text-property 0 'display (overlay-get ov 'before-string))) + (str (nth 1 disp))) + (put-text-property 0 (length str) 'face 'linum str) + (setq narf--hl-nlinum-overlay nil + narf--hl-nlinum-line nil)))) + + (defun narf|nlinum-hl-line (&optional line) + (let ((line-no (or line (line-number-at-pos (point))))) + (when (and nlinum-mode (not (eq line-no narf--hl-nlinum-line))) + (let* ((pbol (if line (save-excursion (goto-char (point-min)) + (forward-line line-no) + (point-at-bol)) + (point-at-bol))) + (peol (1+ pbol))) + ;; Handle EOF case + (when (>= peol (point-max)) + (setq peol (point-max))) + (jit-lock-fontify-now pbol peol) + (let* ((overlays (overlays-in pbol peol)) + (ov (-first (lambda (item) (overlay-get item 'nlinum)) overlays))) + (when ov + (narf|nlinum-unhl-line) + (let* ((disp (get-text-property 0 'display (overlay-get ov 'before-string))) + (str (nth 1 disp))) + (put-text-property 0 (length str) 'face 'linum-highlight-face str) + (put-text-property 0 (length str) 'face 'linum-highlight-face str) + (setq narf--hl-nlinum-overlay ov + narf--hl-nlinum-line line-no)))))))) + + (defun narf|nlinum-enable () + (nlinum-mode +1) + (add-hook 'post-command-hook 'narf|nlinum-hl-line)) + + (defun narf|nlinum-disable () + (nlinum-mode -1) + (remove-hook 'post-command-hook 'narf|nlinum-hl-line) + (narf|nlinum-unhl-line)) + + (@add-hook text-mode 'narf|nlinum-enable) + (@add-hook prog-mode 'narf|nlinum-enable) + (@add-hook org-mode 'narf|nlinum-disable) + ;; Preset width nlinum + (@add-hook nlinum-mode + (setq nlinum--width (length (number-to-string (count-lines (point-min) (point-max))))))) + + ;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;; + (use-package smart-mode-line + :init (setq-default + sml/no-confirm-load-theme t + sml/mode-width 'full + sml/extra-filler -7 + sml/show-remote nil + sml/encoding-format nil + sml/modified-char "*" + sml/numbers-separator "/" + sml/line-number-format "%3l" + sml/col-number-format "%2c" + sml/pre-modes-separator " : " + sml/pre-minor-modes-separator " " + sml/pos-minor-modes-separator ": " + sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:") + ("^~/.emacs.d/" "EMACS.D:") + ("^~/Dropbox/notes/" "NOTES:") + ("^/usr/local/Cellar/" "HOMEBREW:")) + mode-line-misc-info + '((which-func-mode ("" which-func-format "")) + (global-mode-string ("" global-mode-string "")))) :config - (progn - (setq sml/no-confirm-load-theme t - sml/mode-width 'full - sml/extra-filler -7 - sml/show-remote nil - sml/modified-char "*" - sml/encoding-format nil - sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:") - ("^~/.emacs.d/" "EMACS.D:") - ("^~/Dropbox/notes/" "NOTES:") - ("^/usr/local/Cellar/" "HOMEBREW:")) - sml/pre-modes-separator " : " - sml/pre-minor-modes-separator " " - sml/pos-minor-modes-separator ": " - sml/numbers-separator "/" - sml/line-number-format "%3l" - sml/col-number-format "%2c") + ;; Hide evil state indicator + (@after evil (setq evil-mode-line-format nil)) - ;; Hide evil state indicator - (after "evil" (setq evil-mode-line-format nil)) + (sml/setup) + (sml/apply-theme 'respectful) - (setq-default mode-line-misc-info - '((which-func-mode ("" which-func-format "")) - (global-mode-string ("" global-mode-string "")))) + ;; Hack modeline to be more vim-like, and right-aligned + (defun sml/generate-minor-modes () + (if sml/simplified + "" + (let* ((nameList (rm--mode-list-as-string-list)) + (last nil) + (concatList (mapconcat (lambda (mode) + (setq mode (s-trim mode)) + (if (> (length mode) 1) + (prog1 (concat (if last " ") mode " ") + (setq last nil)) + (prog1 mode + (setq last t)))) + nameList "")) + (size (sml/fill-width-available)) + (finalNameList concatList) + needs-removing filling) + (when (and sml/shorten-modes (> (length finalNameList) size)) + (setq needs-removing + (1+ (sml/count-occurrences-starting-at + " " finalNameList + (- size (string-width sml/full-mode-string)))))) + (when needs-removing + (setcdr (last nameList (1+ needs-removing)) + (list t sml/propertized-full-mode-string))) + (unless sml/shorten-modes + (add-to-list 'nameList sml/propertized-shorten-mode-string t)) + (setq filling (- size (+ (length (format-mode-line concatList)) (length mode-name) (length vc-mode)))) + (setq filling (make-string (max 0 filling) sml/fill-char)) + (list (propertize filling 'face 'sml/modes) + (propertize (or vc-mode "") 'face 'sml/vc) + (propertize sml/pre-modes-separator 'face 'font-lock-comment-delimiter-face) + (propertize mode-name) + 'sml/pre-minor-modes-separator + concatList + (propertize sml/pos-minor-modes-separator 'face + 'font-lock-comment-delimiter-face))))) - (sml/setup) - (sml/apply-theme 'respectful) + ;; Remove extra spaces in format lists + (pop mode-line-modes) + (nbutlast mode-line-modes) - ;; Hack modeline to be more vim-like, and right-aligned - (defun sml/generate-minor-modes () - (if sml/simplified - "" - (let* ((nameList (rm--mode-list-as-string-list)) - (last nil) - (concatList (mapconcat (lambda (mode) - (setq mode (s-trim mode)) - (if (> (length mode) 1) - (prog1 (concat (if last " ") mode " ") - (setq last nil)) - (prog1 mode - (setq last t)))) - nameList "")) - (size (sml/fill-width-available)) - (finalNameList concatList) - needs-removing filling) - (when (and sml/shorten-modes (> (length finalNameList) size)) - (setq needs-removing - (1+ (sml/count-occurrences-starting-at - " " finalNameList - (- size (string-width sml/full-mode-string)))))) - (when needs-removing - (setcdr (last nameList (1+ needs-removing)) - (list t sml/propertized-full-mode-string))) - (unless sml/shorten-modes - (add-to-list 'nameList sml/propertized-shorten-mode-string t)) + ;; Remove spacing in mode-line position so we can put it elsewhere + (setq mode-line-position + '((sml/position-percentage-format + (-3 (:propertize (:eval sml/position-percentage-format) + face sml/position-percentage help-echo "Buffer Relative Position\nmouse-1: Display Line and Column Mode Menu"))))) - ;; Padding - (setq filling (- size (+ (length (format-mode-line concatList)) (length mode-name) (length vc-mode)))) - (setq filling (make-string (max 0 filling) sml/fill-char)) + (@after anzu ; Add small gap for anzu + (defun narf--anzu-update-mode-line (here total) + (concat (anzu--update-mode-line-default here total) " ")) + (setq anzu-mode-line-update-function 'narf--anzu-update-mode-line)) - (list (propertize filling 'face 'sml/modes) - (propertize (or vc-mode "") 'face 'sml/vc) - (propertize sml/pre-modes-separator 'face 'font-lock-comment-delimiter-face) - (propertize mode-name) - 'sml/pre-minor-modes-separator - concatList - (propertize sml/pos-minor-modes-separator 'face - 'font-lock-comment-delimiter-face))))) - - ;; Remove extra spaces in format lists - (pop mode-line-modes) - (nbutlast mode-line-modes) - - ;; Remove spacing in mode-line position so we can put it elsewhere - (setq mode-line-position - '((sml/position-percentage-format - (-3 (:propertize (:eval sml/position-percentage-format) - face sml/position-percentage help-echo "Buffer Relative Position\nmouse-1: Display Line and Column Mode Menu"))))) - - (after "anzu" - ;; Add small gap for anzu - (defun narf/anzu-update-mode-line (here total) - (concat (anzu--update-mode-line-default here total) " ")) - (setq anzu-mode-line-update-function 'narf/anzu-update-mode-line)) - - ;; Rearrange and cleanup - (setq-default mode-line-format - '("%e " - mode-line-mule-info - mode-line-client - mode-line-remote - mode-line-frame-identification - mode-line-buffer-identification - mode-line-modified - mode-line-misc-info - mode-line-modes - mode-line-front-space - mode-line-end-spaces - " " - ":" mode-line-position - )))) + ;; Rearrange and cleanup + (setq-default mode-line-format + '("%e " + mode-line-mule-info + mode-line-client + ;; mode-line-remote + mode-line-frame-identification + mode-line-buffer-identification + mode-line-modified + mode-line-misc-info + mode-line-modes + mode-line-front-space + mode-line-end-spaces + " " + ":" mode-line-position))) (provide 'core-ui) diff --git a/core/core-vars.el b/core/core-vars.el new file mode 100644 index 000000000..fb6ce0071 --- /dev/null +++ b/core/core-vars.el @@ -0,0 +1,44 @@ +;;; core-vars.el --- narf emacs configuration + +(defgroup narf nil + "Narf variables." + :group 'convenience + :prefix 'narf-) + +(defcustom narf-leader-key "," "The prefix for leader keybindings." + :group 'narf :type 'string) + +(defcustom narf-localleader-key "\\" "The prefix for localleader keybindings." + :group 'narf) + + +;; Buffers/Files ;;;;;;;;;;;;;;;;;;;;;;; + +(defconst narf--splash-buffer-name "*narf*") + +(defvar narf-ignore-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*" + "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*" + "*Buffer List*" "*Ibuffer*" "*esh command on file*") + "List of buffer names to ignore when using `switch-to-next-buffer', + `switch-to-previous-buffer', `winner-undo', `winner-redo', or + `narf:cleanup-buffers'") + +(defvar narf-ignore-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*" + "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*" + "*Buffer List*" "*Ibuffer*" "*esh command on file*") + "List of buffer names to ignore when using `switch-to-next-buffer', + `switch-to-previous-buffer', `winner-undo', `winner-redo', or + `narf:cleanup-buffers'") + +(defvar narf-project-root-files + '(".git" ".hg" ".svn" ".project" "local.properties" "project.properties" + "rebar.config" "project.clj" "SConstruct" "pom.xml" "build.sbt" + "build.gradle" "Gemfile" "requirements.txt" "tox.ini" "package.json" + "gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml" + "mix.exs") + "A list of files that count as 'project files', which determine whether a + folder is the root of a project or not.") + + +(provide 'core-vars) +;;; core-vars.el ends here diff --git a/core/core.el b/core/core.el index e8361ca88..fd56892fa 100644 --- a/core/core.el +++ b/core/core.el @@ -1,319 +1,234 @@ -;;; The core of Narfy Emacs +;;; core.el --- The heart of the beast ;; -;;; Naming Conventions +;;; Naming conventions: ;; -;; narf/* public defun/variable -;; narf--* private defun/variable -;; narf|* hook defuns -;; narf:* interactive/keybind defuns -;; :* ex commands +;; narf-* A public variable/constant or function +;; narf--* A private variable or function (non-interactive) +;; narf/* An autoloaded interactive function +;; narf:* An ex command +;; narf|* A hook +;; @* Macro call ;; +;;; Bootstrap: -(setq package-enable-at-startup nil - debug-on-quit DEBUG-MODE) -(cd "~") ; instead of / -(require 'core-splash) +(fset '! 'eval-when-compile) -;; This is kept separate so it can jumpstart emacs; this prevents the unstyled -;; flash of emacs pre-makeover. -(load-theme (if window-system DEFAULT-THEME TERM-THEME) t) -(when window-system - (set-frame-font DEFAULT-FONT) - (scroll-bar-mode -1) ; no scrollbar - (tool-bar-mode -1) ; no toolbar - (menu-bar-mode -1)) ; no menubar +(defconst narf-emacs-dir user-emacs-directory) +(defconst narf-core-dir (! (concat narf-emacs-dir "core/"))) +(defconst narf-modules-dir (! (concat narf-emacs-dir "modules/"))) +(defconst narf-contrib-dir (! (concat narf-emacs-dir "contrib/"))) +(defconst narf-private-dir (! (concat narf-emacs-dir "private/"))) +(defconst narf-elpa-dir (! (concat narf-emacs-dir ".cask/" emacs-version "/elpa/"))) +(defconst narf-temp-dir (concat narf-private-dir "cache/" (system-name) "/")) +(defconst narf-snippet-dirs (! (list (concat narf-private-dir "snippets/") + (concat narf-private-dir "templates/")))) + +(! (defun --subdirs (path) + (let ((result '()) + (paths (ignore-errors (directory-files path t "^[^.]" t)))) + (dolist (file paths) + (when (file-directory-p file) + (add-to-list 'result file))) + result))) + +;; Scan various folders to populate the load-dirs +(setq custom-theme-load-path + (! (append (--subdirs (concat narf-private-dir "themes/")) + custom-theme-load-path))) +(setq load-path + (! (setq load-path (append (list narf-core-dir narf-contrib-dir narf-modules-dir narf-private-dir) + (list (concat narf-core-dir "defuns")) + load-path + (--subdirs narf-contrib-dir) + (--subdirs narf-contrib-dir))) + (require 'cask) + (cask-initialize) + load-path)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(message ">> %s" "Are you pondering what I'm pondering, Pinky?") -(message "-----------------------------------------------------------------------------------") -(defun display-startup-echo-area-message () - (message "-----------------------------------------------------------------------------------") - (message ">> %s\n>> Loaded in %s" (narf/random-comeback) (emacs-init-time))) +;; (require 'benchmark) ; records load times in `require-times'; also see `list-times' +(require 'autoloads nil t) ; generate autoloads with `make autoloads` +(require 'core-vars) +(require 'core-defuns) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(! (require 's) + (require 'dash) + (require 'f) + + (add-to-list 'load-path (concat narf-core-dir "macros/")) + + (setq use-package-verbose narf-debug-mode) + ;; (setq use-package-expand-minimally (not narf-debug-mode)) + (require 'use-package) + + (defun use-package--add-keyword (keyword after) + (setq use-package-keywords + (-insert-at (-find-index (lambda (key) (eq key after)) use-package-keywords) + keyword use-package-keywords))) + + (progn ; add :after to use-package + (use-package--add-keyword :after :load-path) + (setq use-package-keywords + (-insert-at (--find-index (eq it :load-path) use-package-keywords) + :after use-package-keywords)) + + (defalias 'use-package-normalize/:after 'use-package-normalize-symlist) + + (defun use-package-handler/:after (name-symbol keyword arg rest state) + (let ((body (use-package-process-keywords name-symbol rest state))) + (if (null arg) + body + (use-package-concat + (use-package-process-keywords name-symbol + (use-package-sort-keywords (use-package-plist-maybe-put rest :defer t)) state) + (apply #'nconc + (mapcar (lambda (feature) + `(,(macroexpand `(@after ,feature (require ',name-symbol))))) + (delete-dups arg)))))))) + + (progn ; add :map for in-house key binding macro + (use-package--add-keyword :map :bind) + + (defalias 'use-package-normalize/:map 'use-package-normalize-forms) + + ;; TODO: Write :map + (defun use-package-handler/:map (name-symbol keyword arg rest state) + (use-package-process-keywords name-symbol rest state)) + ) + ) +(require 'diminish) + +;; Emacs configuration ;;;;;;;;;;;;;;;;; + (defconst IS-MAC (eq system-type 'darwin)) (defconst IS-LINUX (eq system-type 'gnu/linux)) (defconst IS-WINDOWS (eq system-type 'windows-nt)) -(require 'defuns) - -;; NARF! -(defvar narf-mode-map (make-sparse-keymap)) -(define-minor-mode narf-mode - "Narf, yoink, poit." - :global t :init-value t :lighter "NARF" :keymap narf-mode-map) - -(defvar narf/leader-key ",") -(defvar narf/localleader-key "\\") - -;; Make sure undo/backup folders exist -(defconst TMP-DIR-UNDO (expand-file-name "undo" TMP-DIR)) -(defconst TMP-DIR-BACKUP (expand-file-name "backup" TMP-DIR)) -(defconst TMP-DIR-AUTOSAVE (expand-file-name "autosave" TMP-DIR)) -(unless (file-directory-p TMP-DIR) - (make-directory TMP-DIR-UNDO t) - (make-directory TMP-DIR-BACKUP t) - (make-directory TMP-DIR-AUTOSAVE t)) - -(fset 'yes-or-no-p 'y-or-n-p) ; y/n instead of yes/no - -;;;; Sane defaults ;;;;;;;;;;;;;;;;;;;;;;; -(global-font-lock-mode t) ; Enable syntax highlighting for older emacs -(global-auto-revert-mode 1) ; revert buffers for changed files - - ;;; window layout undo/redo -(setq winner-boring-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*" - "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*" - "*Buffer List*" "*Ibuffer*" "*esh command on file*")) -(winner-mode 1) - ;;; UTF-8 please -(setq locale-coding-system 'utf-8) ; pretty -(set-terminal-coding-system 'utf-8) ; pretty -(set-keyboard-coding-system 'utf-8) ; pretty -(set-selection-coding-system 'utf-8) ; please -(prefer-coding-system 'utf-8) ; with sugar on top +(setq locale-coding-system 'utf-8) ; pretty +(set-terminal-coding-system 'utf-8) ; pretty +(set-keyboard-coding-system 'utf-8) ; pretty +(set-selection-coding-system 'utf-8) ; please +(prefer-coding-system 'utf-8) ; with sugar on top -;;; Show tab characters -;; (global-whitespace-mode 1) -(setq whitespace-style '(trailing face tabs tab-mark) ; needs to be re-set in every buffer - whitespace-display-mappings - '((tab-mark ?\t [?| ?\t] [?\\ ?\t]) - (newline-mark 10 [36 10]))) ; for whitespace-newline-mode +(fset 'yes-or-no-p 'y-or-n-p) ; y/n instead of yes/no -;; avoid garbage collection (default is 400k) (setq-default - gc-cons-threshold 20000000 - confirm-kill-emacs nil - ;; minibufferception? Yay! - enable-recursive-minibuffers t) + confirm-kill-emacs (lambda (prompt) (y-or-n-p ">> Gee, I dunno Brain... Are you sure?")) -;; Show me those keystrokes -(setq echo-keystrokes 0.02 + gc-cons-threshold 20000000 ; avoid garbage collection + enable-recursive-minibuffers t ; minibufferception + echo-keystrokes 0.02 ; show me those keystrokes + ring-bell-function 'ignore ; silence of the bells! - ring-bell-function 'ignore + inhibit-startup-screen t ; don't show emacs start screen + inhibit-startup-echo-area-message "hlissner" ; username shuts up emacs + initial-major-mode 'text-mode ; initial scratch buffer mode + initial-scratch-message nil - inhibit-startup-screen t ; don't show EMACs start screen - inhibit-splash-screen t - ;; inhibit-startup-message t - inhibit-startup-echo-area-message "hlissner" - ;; inhibit-startup-buffer-menu t + compilation-always-kill t + compilation-ask-about-save nil + compilation-scroll-output t - initial-major-mode 'text-mode ; initial scratch buffer mode - initial-scratch-message nil + sentence-end-double-space nil ; sentences end with periods. period. - compilation-always-kill t - compilation-ask-about-save nil - compilation-scroll-output t + ediff-diff-options "-w" + ediff-split-window-function 'split-window-horizontally ; side-by-side diffs + ediff-window-setup-function 'ediff-setup-windows-plain ; no extra frames - sentence-end-double-space nil ; sentences end with periods. Period. + ;; Don't save clipboard contents into kill-ring before replacing them + save-interprogram-paste-before-kill nil - ediff-diff-options "-w" - ediff-split-window-function 'split-window-horizontally ; side-by-side diffs - ediff-window-setup-function 'ediff-setup-windows-plain) ; no extra frames + ;; Don't let the cursor go into minibuffer prompt + ;; from Xah Lee: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html + minibuffer-prompt-properties + '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt) -;; Don't save clipboard contents into kill-ring before replacing them -(setq save-interprogram-paste-before-kill nil) + ;; remove annoying ellipsis when printing sexp in message buffer + eval-expression-print-length nil + eval-expression-print-level nil -;; don't let the cursor go into minibuffer prompt -;; Tip taken from Xah Lee: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html -(setq minibuffer-prompt-properties - '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt)) + history-length 1000 -;; remove annoying ellipsis when printing sexp in message buffer -(setq eval-expression-print-length nil - eval-expression-print-level nil) + ;; Backups ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Disable all backups (that's what git/dropbox are for) + bookmark-save-flag t + bookmark-default-file (! (concat narf-temp-dir "bookmarks")) + auto-save-default nil + auto-save-list-file-name (! (concat narf-temp-dir "autosave")) + ;; In case I want to reactivate backup files + make-backup-files nil + create-lockfiles nil + backup-directory-alist `((".*" . ,(! (concat narf-temp-dir "backup/")))) + + ;; Remember undo history + undo-tree-auto-save-history t + undo-tree-history-directory-alist `(("." . ,(! (concat narf-temp-dir "undo/"))))) + +;; Make any folders needed +(! (dolist (file '("" "undo" "backup")) + (let ((path (concat narf-temp-dir file))) + (unless (file-exists-p path) + (make-directory path t))))) ;; Save cursor location across sessions. Only save for files that exist. -(use-package saveplace - :init (defvar save-place-file (concat TMP-DIR "saveplace")) - :config (add-hook! 'find-file-hook (if (file-exists-p (buffer-file-name)) (setq save-place t)))) +(require 'saveplace) +(setq save-place-file (! (concat narf-temp-dir "saveplace"))) +(@add-hook find-file (if (file-exists-p (buffer-file-name)) (setq save-place t))) ;; Save history across sessions -(use-package savehist - :config - (progn - (setq savehist-file (concat TMP-DIR "savehist") ; keep the home clean - history-length 1000 - savehist-additional-variables '(kill-ring - global-mark-ring - search-ring - regexp-search-ring - extended-command-history)) - (savehist-mode 1))) +(require 'savehist) +(setq savehist-file (! (concat narf-temp-dir "savehist")) + savehist-additional-variables + '(kill-ring global-mark-ring search-ring regexp-search-ring extended-command-history)) +(savehist-mode 1) -(use-package recentf - :config - (progn - (setq recentf-save-file (concat TMP-DIR "recentf") - recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" - "/\\.cache/.+" "emacs\\.d/workgroups/.+$" ".emacs.workgroup" - "/company-statistics-cache.el$") - recentf-max-menu-items 0 - recentf-max-saved-items 250 - recentf-auto-cleanup 600) - (recentf-mode 1))) - - -;;;; Backup ;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Disable all backups (that's what git/dropbox are for) -(setq bookmark-save-flag t - bookmark-default-file (concat TMP-DIR "bookmarks") - auto-save-default nil - auto-save-list-file-name (concat TMP-DIR-AUTOSAVE "auto-save") - auto-save-file-name-transforms `((".*" ,TMP-DIR-AUTOSAVE t)) - ;; In case I want to reactivate backup files - make-backup-files nil - create-lockfiles nil - backup-directory-alist `((".*" . ,TMP-DIR-BACKUP))) - - -;;;; Undo Tree ;;;;;;;;;;;;;;;;;;;;;;;;; -(setq-default ; Remember undo history - undo-tree-auto-save-history t - undo-tree-history-directory-alist `(("." . ,TMP-DIR-UNDO))) - -;; Keep region when undoing in region -(defadvice undo-tree-undo (around keep-region activate) - (if (use-region-p) - (let ((m (set-marker (make-marker) (mark))) - (p (set-marker (make-marker) (point)))) - ad-do-it - (goto-char p) - (set-mark m) - (set-marker p nil) - (set-marker m nil)) - ad-do-it)) - -;; Shut up undo-tree's constant complaining: http://youtu.be/Z6woIRLnbmE -(defadvice undo-tree-load-history-hook (around undo-tree-load-history-shut-up activate) (shut-up ad-do-it)) -(defadvice undo-tree-save-history-hook (around undo-tree-save-history-shut-up activate) (shut-up ad-do-it)) -;; Silences an annoying error: undo-tree-mapc: Wrong type argument: listp, \.\.\. -(defadvice undo-tree-position (around undo-tree-position-silence-type-error activate) - (when (listp (ad-get-args 1)) ad-do-it)) - -;;;; Editor behavior ;;;;;;;;;;;;;;;; -(setq-default ; spaces instead of tabs - indent-tabs-mode nil - tab-always-indent t - tab-width 4) - -(setq require-final-newline t - delete-trailing-lines nil) - -;; Automatic minor modes ;;;;;;;;;;; -(defvar narf/auto-minor-mode-alist () - "Alist of filename patterns vs correpsonding minor mode functions, -see `auto-mode-alist' All elements of this alist are checked, meaning -you can enable multiple minor modes for the same regexp.") -(defun narf|enable-minor-mode-maybe () - "Check file name against `narf/auto-minor-mode-alist'." - (when buffer-file-name - (let ((name buffer-file-name) - (remote-id (file-remote-p buffer-file-name)) - (alist narf/auto-minor-mode-alist)) - ;; Remove backup-suffixes from file name. - (setq name (file-name-sans-versions name)) - ;; Remove remote file name identification. - (when (and (stringp remote-id) - (string-match-p (regexp-quote remote-id) name)) - (setq name (substring name (match-end 0)))) - (while (and alist (caar alist) (cdar alist)) - (if (string-match (caar alist) name) - (funcall (cdar alist) 1)) - (setq alist (cdr alist)))))) -(add-hook 'find-file-hook 'narf|enable-minor-mode-maybe) - - -;;;; Utility plugins ;;;;;;;;;;;;;;;;;; -(use-package smex - :functions (smex-initialize smex-update) - :commands (smex smex-major-mode-commands) - :config - (progn - (setq smex-save-file (expand-file-name "smex-items" TMP-DIR)) - (smex-initialize) - ;; Hook up smex to auto-update, rather than update on every run - (defun smex-update-after-load (unused) - (when (boundp 'smex-cache) (smex-update))) - (add-hook 'after-load-functions 'smex-update-after-load))) - -(use-package popwin - :config - (progn ; popwin config - (popwin-mode 1) - (setq popwin:popup-window-height 0.45 - popwin:special-display-config - (append '(("\\`\\*helm.*?\\*\\'" :regexp t :position bottom :height 15) - ("^\\*Flycheck.*\\*$" :regexp t :position bottom :height 0.25 :noselect t) - (inf-enh-ruby-mode :position bottom :stick t) - (snippet-mode :position bottom :stick t) - ("^\\*eclim.*\\*" :regexp t :position bottom :height 0.25) - ("*ansi-term*" :position bottom :height 0.45 :stick t) - ("*terminal*" :position bottom :height 0.45 :stick t) - ("*Async Shell Command*" :position bottom) - ("*Shell Command Output*" :position bottom :stick t :height 15) - ("* Regexp Explain *" :position top :height 0.35) - ("*anaconda-doc*" :position bottom :height 15 :noselect t) - ("*anaconda-nav*" :position bottom :height 15 :stick t) - ("^\\*Python.+\\*$" :regexp t :position bottom :height 20 :noselect t) - ("*Pp Eval Output*" :position bottom :height 10 :noselect t) - ("*eval*" :position bottom :noselect t) - (help-mode :height 25 :position bottom :stick t) - (compilation-mode :height 0.5 :position bottom :noselect t) - (diff-mode :position bottom :stick t) - ("*Backtrace*") - ("*Warnings*") - ("*Process List*") - ("*Compile-Log*" :height 0.3 :position bottom :noselect t) - (" *undo-tree*" :width 0.3 :position right) - ("^\\*scratch\\*.*" :regexp t :stick t) - (image-mode)) - popwin:special-display-config)) - - (defun popwin:toggle-popup-window () - (interactive) - (if (popwin:popup-window-live-p) - (popwin:close-popup-window) - (popwin:popup-last-buffer))))) - -(use-package semantic - :commands semantic-mode - :init - (progn - (add-hook 'c-mode-common-hook 'semantic-mode) - (defvar semanticdb-default-system-save-directory (concat TMP-DIR "semanticdb")) - (defvar semanticdb-default-save-directory (concat TMP-DIR "semanticdb"))) - :config - (semantic-mode 1)) - -;; Improved help commands -(use-package help-fns+ - :commands (describe-buffer - describe-command - describe-file - describe-keymap - describe-option - describe-option-of-type)) - -(use-package server - :config (unless (server-running-p) (server-start))) +(require 'recentf) +(setq recentf-save-file (! (concat narf-temp-dir "recentf")) + recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" + "/\\.cache/.+" "emacs\\.d/workgroups/.+$" ".emacs.workgroup" + "/company-statistics-cache.el$") + recentf-max-menu-items 0 + recentf-max-saved-items 250 + recentf-auto-cleanup 600) +(recentf-mode 1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(cond (IS-MAC (require 'core-osx)) - (IS-LINUX (require 'core-linux)) - (IS-WINDOWS (require 'core-windows))) -;; Performance checks -(add-hook! 'find-file-hook - ;; If file is oversized... - (when (> (buffer-size) (* 1024 1024)) - (setq buffer-read-only t) - (buffer-disable-undo) - (fundamental-mode) - (visual-line-mode))) +(use-package help-fns+ ; Improved help commands + :commands (describe-buffer describe-command describe-file + describe-keymap describe-option describe-option-of-type)) + +(use-package popwin :config (popwin-mode 1)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(cond (IS-MAC (require 'core-os-osx)) + (IS-LINUX (require 'core-os-linux)) + (IS-WINDOWS (require 'core-os-win32))) + +(require 'core-ui) +(require 'core-evil) +;; (require 'core-editor) +;; (require 'core-completion) +;; (require 'core-syntax-checker) +;; (require 'core-snippets) +;; (require 'core-templates) +;; (require 'core-project) +;; (require 'core-vcs) +;; (require 'core-sessions) +;; (require 'core-quickrun) + +;; (@add-hook after-init +;; (use-package my-bindings) +;; (use-package my-commands)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(use-package server :config (unless (server-running-p) (server-start))) (provide 'core) diff --git a/core/defuns-buffers.el b/core/defuns-buffers.el deleted file mode 100644 index 062c28098..000000000 --- a/core/defuns-buffers.el +++ /dev/null @@ -1,289 +0,0 @@ -;; Inspired by http://demonastery.org/2013/04/emacs-evil-narrow-region/ -;;;###autoload -(defun narf:narrow-to-region-indirect (start end) - "Restrict editing in this buffer to the current region, indirectly." - (interactive "r") - (deactivate-mark) - (let ((buf (clone-indirect-buffer nil nil))) - (with-current-buffer buf - (narrow-to-region start end)) - (switch-to-buffer buf))) - -;;;###autoload -(defun narf:widen () - (interactive) - (when (buffer-narrowed-p) - (widen))) - -;;;###autoload -(defun narf:set-region-read-only (begin end) - "See http://stackoverflow.com/questions/7410125" - (let ((modified (buffer-modified-p))) - (add-text-properties begin end '(read-only t)) - (set-buffer-modified-p modified))) - -;;;###autoload -(defun narf:set-region-writeable (begin end) - "See http://stackoverflow.com/questions/7410125" - (let ((modified (buffer-modified-p)) - (inhibit-read-only t)) - (remove-text-properties begin end '(read-only t)) - (set-buffer-modified-p modified))) - -;;;###autoload -(defun narf/living-buffer-list (&optional buffer-list) - (-remove 'get-buffer-window (or buffer-list (buffer-list)))) - - -;; Killing Buffers ;;;;;;;;;;;;;;;;;;;;; -;; Buffer defuns -(defvar narf/cleanup-buffers-list '("^ \\*" - "^\\*Backtrace\\*$" - "^\\*Warnings\\*$" - "^\\*Compile-Log\\*$" - "^\\*Ediff.*\\*$" - help-mode - image-mode - dired-mode - reb-mode) - "A list of buffer name regexps or major-mode symbols. If buried buffers - match/have that mode active, `narf:cleanup-buffers' will kill them.") - -(defvar narf/cleanup-processes-alist '(("pry" . ruby-mode) - ("irb" . ruby-mode) - ("ipython" . python-mode)) - "An alist of (process-name . major-mode), that `narf:cleanup-processes' checks -before killing processes. If there are no buffers with matching major-modes, it -gets killed.") - -;;;###autoload -(defun narf/add-throwaway-buffer (regexp) - (add-to-list 'narf/cleanup-buffers-list regexp)) - -;;;###autoload -(defun narf:cleanup-buffers () - "Kill left-over temporary, dired or buried special buffers" - (interactive) - (let* ((this-frame (selected-frame)) - (kill-list (buffer-list this-frame))) - (setq kill-list - (-filter (lambda (b) - (unless (get-buffer-window b) ; don't kill if visible - (-any? (lambda (pred) - (cond ((stringp pred) - (s-matches? pred (buffer-name b))) - ((symbolp pred) - (eq (buffer-local-value 'major-mode b) pred)))) - narf/cleanup-buffers-list))) - kill-list)) - (message "Cleaned up %s buffers" (length kill-list)) - (mapc 'kill-buffer kill-list) - (narf:cleanup-processes))) - -;;;###autoload -(defun narf:cleanup-processes () - (interactive) - (let ((buffer-list (buffer-list))) - (dolist (p (process-list)) - (let* ((process-name (process-name p)) - (assoc (assoc process-name narf/cleanup-processes-alist))) - (when (and assoc - (not (string= process-name "server")) - (process-live-p p) - (not (-any? (lambda (b) - (let ((mode (buffer-local-value 'major-mode b))) - (eq mode (cdr assoc)))) - buffer-list))) - (message "Cleanup: killing %s" process-name) - (delete-process p)))))) - -;;;###autoload -(defun narf:kill-matching-buffers (regexp &optional buffer-list) - (interactive) - (mapc (lambda (b) - (if (string-match-p regexp (buffer-name b)) - (kill-buffer b))) - (if buffer-list buffer-list (buffer-list)))) - -(defun narf--cycle-real-buffer (&optional n) - "Switch to the previous buffer and avoid special buffers." - (interactive) - (let ((start-buffer (current-buffer)) - (move-func (if (< n 0) 'switch-to-next-buffer 'switch-to-prev-buffer))) - (funcall move-func) - (let ((i 0)) - (while (let ((current-buffer (current-buffer))) - (and (not (eq current-buffer start-buffer)) - (not (eq current-buffer narf--project-scratch-buffer)) - (< i 15) - (string-equal "*" (substring (buffer-name) 0 1)))) - (cl-incf i) - (funcall move-func))))) - -;; From spacemacs -;;;###autoload -(defun narf:next-real-buffer () - "Switch to the next buffer and avoid special buffers." - (interactive) - (narf--cycle-real-buffer +1)) - -;;;###autoload -(defun narf:previous-real-buffer () - "Switch to the previous buffer and avoid special buffers." - (interactive) - (narf--cycle-real-buffer -1)) - -;;;###autoload -(defun narf:kill-real-buffer () - "Kill buffer (but only bury scratch buffer)" - (interactive) - (let ((bname (buffer-name))) - (cond ((string-match-p "^\\*scratch\\*" bname) - (erase-buffer) - (bury-buffer)) - ((string-equal "*" (substring bname 0 1)) - (previous-buffer)) - (t (kill-this-buffer))))) - -;;;###autoload (autoload 'narf::save-session "defuns-buffers") -(evil-define-command narf::save-session (&optional bang session-name) - (interactive "") - (if session-name - (wg-save-session-as (concat wg-workgroup-directory session-name) (not bang)) - (wg-save-session))) - -;;;###autoload (autoload 'narf::load-session "defuns-buffers") -(evil-define-command narf::load-session (&optional bang session-name) - (interactive "") - (wg-open-session (if session-name - (concat wg-workgroup-directory session-name) - wg-session-file))) - -;;;###autoload (autoload 'narf::new-workgroup "defuns-buffers") -(evil-define-command narf::new-workgroup (bang name) - (interactive "") - (unless name - (user-error "No name specified for new workgroup")) - (if bang - (wg-clone-workgroup (wg-current-workgroup) name) - (wg-create-workgroup name t))) - -;;;###autoload (autoload 'narf::rename-workgroup "defuns-buffers") -(evil-define-command narf::rename-workgroup (new-name) - (interactive "") - (wg-rename-workgroup new-name)) - -;;;###autoload (autoload 'narf::rename-this-file "defuns-buffers") -(evil-define-command narf::rename-this-file (new-name) - "Renames current buffer and file it is visiting. Replaces %, # and other - variables (see `evil-ex-replace-special-filenames')" - :repeat nil - (interactive "") - (let ((name (buffer-name)) - (filename (buffer-file-name))) - (if (not (and filename (file-exists-p filename))) - (error "Buffer '%s' is not visiting a file!" name) - (let ((new-name - (expand-file-name - (evil-ex-replace-special-filenames (if new-name - new-name - (read-file-name "New name: " filename))) - (f-dirname filename)))) - (if (get-buffer new-name) - (error "A buffer named '%s' already exists!" new-name) - (rename-file filename new-name 1) - (rename-buffer new-name) - (set-visited-file-name new-name) - (set-buffer-modified-p nil) - (save-place-forget-unreadable-files) - (message "File '%s' successfully renamed to '%s'" - name (file-name-nondirectory new-name))))))) - -;;;###autoload (autoload 'narf::delete-this-file "defuns-buffers") -(evil-define-command narf::delete-this-file (&optional bang) - "Delete current buffer's file. If bang, then kill the buffer afterwards as well." - :repeat nil - (interactive "") - (let ((filename (file-truename (buffer-file-name)))) - (if (not (file-exists-p filename)) - (error "File doesn't exist: %s" filename) - (delete-file filename) - (when bang (kill-this-buffer)) - (save-place-forget-unreadable-files) - (message "File successfully deleted: %s" filename)))) - -(defun narf--save-exit() (save-buffer) (kill-buffer) (remove-hook 'yas-after-exit-snippet-hook '--save-exit)) -;;;###autoload (autoload 'narf::create-file "defuns-buffers") -(evil-define-command narf::create-file (path &optional bang) - "Deploy files (and their associated templates) quickly. Will prompt -you to fill in each snippet field before buffer closes unless BANG is -provided." - :repeat nil - (interactive "") - (let ((dir (f-dirname path)) - (fullpath (f-full path)) - (is-auto t)) - (when (and bang (not (file-exists-p dir))) (f-mkdir dir)) - (if (file-exists-p dir) - (if (file-exists-p fullpath) - (error "File already exists: %s" path) - (find-file fullpath) - (add-hook 'yas-after-exit-snippet-hook 'narf--save-exit) - (if bang (--save-exit))) - (error "Directory doesn't exist: %s" dir)))) - -;;;###autoload (autoload 'narf::scratch-buffer "defuns-buffers") -(evil-define-operator narf::scratch-buffer (&optional beg end bang) - "Send a selection to the scratch buffer. If BANG, then send it to org-capture - instead." - :move-point nil - :type inclusive - (interactive "") - (let ((mode major-mode) - (text (when (and (evil-visual-state-p) beg end) - (buffer-substring beg end)))) - (if bang - ;; use org-capture with bang - (if text - (org-capture-string text) - (org-capture)) - ;; or scratch buffer by default - (let* ((project-dir (narf/project-root t)) - (buffer-name (if project-dir - (format "*scratch* (%s)" (narf/project-name)) - "*scratch*"))) - (popwin:popup-buffer (get-buffer-create buffer-name)) - (when (eq (get-buffer buffer-name) (current-buffer)) - (when project-dir - (cd project-dir)) - (if text (insert text)) - (funcall mode)))))) - -;;;###autoload (autoload 'narf::kill-buried-buffers "defuns-buffers") -(evil-define-command narf::kill-buried-buffers (&optional bang) - :repeat nil - (interactive "") - (mapc 'kill-buffer - (narf/living-buffer-list (if bang (projectile-project-buffers) (buffer-list))))) - -;;;###autoload (autoload 'narf::kill-buffers "defuns-buffers") -(evil-define-command narf::kill-buffers (&optional bang) - :repeat nil - (interactive "") - (if (and (not bang) (projectile-project-p)) - (projectile-kill-buffers) - (mapc 'kill-buffer (buffer-list))) - (delete-other-windows) - (switch-to-buffer (if (buffer-live-p narf--project-scratch-buffer) - narf--project-scratch-buffer - (get-buffer-create "*scratch*")))) - -;;;###autoload (autoload 'narf::cd "defuns-buffers") -(evil-define-command narf::cd (dir) - :repeat nil - (interactive "") - (cd (if (zerop (length dir)) "~" dir))) - - -(provide 'defuns-buffers) -;;; defuns-buffers.el ends here diff --git a/core/defuns-code.el b/core/defuns-code.el deleted file mode 100644 index aeee18891..000000000 --- a/core/defuns-code.el +++ /dev/null @@ -1,83 +0,0 @@ -;;;; Code building ;;;;;;;;;;;;;;;;;;;;;; -(defvar narf--build-command '("make %s" . "Makefile")) -(make-variable-buffer-local 'narf--build-command) - -;;;###autoload -(defun narf/set-build-command (command &optional file) - (when (or (null file) - (narf/project-has-files file)) - (setq narf--build-command `(,command . ,file)))) - -;;;###autoload (autoload 'narf::build "defuns-code") -(evil-define-command narf::build (arg) - "Call a build command in the current directory. -If ARG is nil this function calls `recompile', otherwise it calls -`compile' passing ARG as build command." - (interactive "") - (when (null narf--build-command) - (user-error "No build command was set")) - (let ((build-file (cdr narf--build-command)) - (build-cmd (car narf--build-command))) - (if (narf/project-has-files build-file) - (compile (format "cd '%s' && %s" build-file (format build-cmd (or arg "")))) - (error "Could not find Makefile")))) - - -;;;; Code running ;;;;;;;;;;;;;;;;;;;;;; -;;;###autoload (autoload 'narf::eval "defuns-code") -(evil-define-operator narf::eval () - :move-point nil - (interactive) - (cond ((region-active-p) - (narf::eval-region (region-beginning) (region-end))) - (t (narf::eval-buffer)))) - -;;;###autoload (autoload 'narf::eval-region "defuns-code") -(evil-define-operator narf::eval-region (beg end) - :move-point nil - (interactive "") - (cond ((eq major-mode 'emacs-lisp-mode) - (let* ((pp-escape-newlines nil) - (out (s-trim (pp-to-string (eval (read (buffer-substring-no-properties beg end)))))) - (lines (length (s-lines out)))) - (if (< lines 5) - (princ out t) - (let ((buf (get-buffer-create "*eval*"))) - (with-current-buffer buf - (read-only-mode -1) - (emacs-lisp-mode) - (setq-local scroll-margin 0) - (erase-buffer) - (insert out) - (beginning-of-buffer) - (read-only-mode 1) - (popwin:popup-buffer buf :height (if (> lines 25) 25 (1+ lines)))))))) - (t (quickrun-region beg end)))) - -;;;###autoload (autoload 'narf::eval-buffer "defuns-code") -(evil-define-command narf::eval-buffer () - :move-point nil - (interactive) - (cond ((eq major-mode 'emacs-lisp-mode) - (narf::eval-region (point-min) (point-max))) - (t (quickrun)))) - -;;;###autoload (autoload 'narf::eval-region-and-replace "defuns-code") -(evil-define-operator narf::eval-region-and-replace (beg end) - (interactive "") - (cond ((eq major-mode 'emacs-lisp-mode) - (kill-region beg end) - (condition-case nil - (prin1 (eval (read (current-kill 0))) - (current-buffer)) - (error (message "Invalid expression") - (insert (current-kill 0))))) - (t (quickrun-replace-region beg end)))) - -;;;###autoload -(defun narf/get-interpreter () - (car (--first (eq (cdr it) major-mode) interpreter-mode-alist))) - - -(provide 'defuns-code) -;;; defuns-code.el ends here diff --git a/core/defuns-debug.el b/core/defuns-debug.el deleted file mode 100644 index 00ce37777..000000000 --- a/core/defuns-debug.el +++ /dev/null @@ -1,30 +0,0 @@ -;; Misc Defuns ;;;;;;;;;;;;;;;;;;;;;;;;; -;;;###autoload -(defun what-face (pos) - "Tells you the name of the face (point) is on." - (interactive "d") - (let ((face (or (get-char-property (point) 'read-face-name) - (get-char-property (point) 'face)))) - (if face (message "Face: %s" face) (message "No face at %d" pos)))) - -;;;###autoload -(defun what-col () - (interactive) - (message "Column %d" (current-column))) - -;;;###autoload -(defun what-bindings (key) - (list - (minor-mode-key-binding key) - (local-key-binding key) - (global-key-binding key))) - -;;;###autoload (autoload 'narf::echo "defuns-debug") -(evil-define-command narf::echo (message) - "Display MSG in echo-area without logging it in *Messages* buffer." - (interactive "") - (let (message-log-max) - (message "%s" message))) - - -(provide 'defuns-debug) diff --git a/core/defuns-edit.el b/core/defuns-edit.el deleted file mode 100644 index 3b307d6be..000000000 --- a/core/defuns-edit.el +++ /dev/null @@ -1,126 +0,0 @@ -;;;; HTML ;;;; - -;;;###autoload -(defun narf:replace-ms-word-chars (beg end) - "Replace smart quotes and other MS Word verbiage into plain text" - (interactive "r") - (replace-regexp "…" "..." nil beg end) - (replace-regexp "[‘’]" "'" nil beg end) - (replace-regexp "[“”]" "\"" nil beg end)) - -;;;###autoload -(defun narf:replace-email2mailto (beg end) - "Email address with mailto link" - (interactive "r") - (replace-regexp "\\b\\([a-zA-Z0-9._+-%]+@[a-zA-Z0-9-.]+\\.[a-zA-Z]+\\)\\b" - "\\1" - nil beg end)) - -;;;###autoload -(defun narf:replace-url2anchor (beg end) - "Link with anchor" - (interactive "r") - (replace-regexp "\\bhttps?://.+?\\b" - "\\1" - nil beg end)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; A hacky attempt to replace ace-jump line mode that incrementally shows where -;; you will land as you type the line number. -(defun narf--goto-line (line) - (let ((lines (count-lines (point-min) (point-max)))) - (if (and (<= line (1+ lines)) - (> line 0)) - (narf/nlinum-hl-line line) - (narf/nlinum-hl-line)))) - -;;;###autoload -(defun narf:goto-line () - (interactive) - (let ((keys '()) - (orig-point (point)) - (echo-keystrokes 0)) - (evil-save-echo-area - (catch 'abort - (while t - (let* ((keystr (concat keys)) - (key (read-event (concat ":" keystr)))) - (cond ((eq key 'escape) - (message "%s" key) - (throw 'abort t)) - ((eq key 'return) - (when keys - (goto-line (string-to-number keystr))) - (throw 'abort t)) - ((eq key 'backspace) - (let ((key-len (length keys))) - (if (= key-len 0) - (throw 'abort t) - (if (> key-len 1) - (progn - (nbutlast keys) - (narf--goto-line (string-to-number (concat keys)))) - (setq keys '()) - (narf/nlinum-hl-line))))) - ((and (characterp key) - (s-numeric? (char-to-string key))) - (setq keys (append keys (list key))) - (narf--goto-line (string-to-number (concat keys)))) - (t - (if (or (char-equal key ?\C-n) - (char-equal key ?\C-j)) - (progn - (setq keys (number-to-string (1+ (string-to-number (concat keys))))) - (narf--goto-line (string-to-number (concat keys)))) - (when (or (char-equal key ?\C-p) - (char-equal key ?\C-k)) - (setq keys (number-to-string (1- (string-to-number (concat keys))))) - (narf--goto-line (string-to-number (concat keys))))))))))))) - -;;;###autoload (autoload 'narf::align "defuns-edit") -(evil-define-command narf::align (beg end &optional regexp bang) - :repeat nil - (interactive "") - (when regexp - (align-regexp beg end - (concat "\\(\\s-*\\)" (rxt-pcre-to-elisp regexp)) 1 1))) - -;;;###autoload (autoload 'narf::retab "defuns-edit") -(evil-define-operator narf::retab (beg end) - "Akin to vim's narf::retab, this changes all tabs-to-spaces or spaces-to-tabs, - depending on `indent-tab-mode'. Untested." - :motion nil - :move-point nil - :type line - (interactive "") - (unless (and beg end) - (setq beg (point-min)) - (setq end (point-max))) - (if indent-tabs-mode - (tabify beg end) - (untabify beg end))) - -;;;###autoload (autoload 'narf::narrow-indirect-or-widen "defuns-edit") -(evil-define-operator narf::narrow-indirect-or-widen (beg end) - "Indirectly narrow the region from BEG to END." - :move-point nil - :type exclusive - :repeat nil - (interactive "") - (evil-normal-state) - (if (buffer-narrowed-p) - (narf:widen) - (narf:narrow-to-region-indirect beg end))) - -;;;###autoload -(defun narf:toggle-delete-trailing-whitespace () - (interactive) - (if (-contains-p before-save-hook 'delete-trailing-whitespace) - (progn (narf|disable-delete-trailing-whitespace) - (message "delete-trailing-whitespaces OFF")) - (add-hook 'before-save-hook 'delete-trailing-whitespace) - (message "delete-trailing-whitespaces ON"))) - - -(provide 'defuns-edit) -;;; defuns-edit.el ends here diff --git a/core/defuns-extern.el b/core/defuns-extern.el deleted file mode 100644 index 04089d412..000000000 --- a/core/defuns-extern.el +++ /dev/null @@ -1,37 +0,0 @@ -;;; defuns-extern.el -- for external operations - -;;;###autoload -(defun narf/tmux-send (command) - (shell-command (format "tmux send-keys %s" command))) - -(evil-define-interactive-code "" - "Ex tmux argument (a mix between and )" - :ex-arg shell - (list (when (evil-ex-p) (evil-ex-file-arg)))) - -;;;###autoload (autoload 'narf::tmux-run "defuns-extern") -(evil-define-command narf::tmux-run (&optional command bang) - "Sends input to tmux. Use `bang' to append to tmux" - (interactive "") - (nerf/tmux-send (format (if bang "C-u %s Enter" "%s") - (shell-quote-argument command))) - (when (evil-ex-p) - (message "[Tmux] %s" command))) - -;;;###autoload (autoload 'narf::tmux-chdir "defuns-extern") -(evil-define-command narf::tmux-chdir (&optional path bang) - "CDs in tmux using `narf/project-root'" - (interactive "") - (let ((dir (shell-quote-argument - (if (and path (not (s-blank? path))) - (if (file-directory-p path) - (file-truename path) - (error "Directory doesn't exist %s" path)) - (if bang default-directory (narf/project-root)))))) - (nerf/tmux-send (format "C-u cd Space %s Enter" (shell-quote-argument dir))) - (when (evil-ex-p) - (message "[Tmux] cd %s" dir)))) - - -(provide 'defuns-extern) -;;; defuns-extern.el ends here diff --git a/core/defuns-mouse.el b/core/defuns-mouse.el deleted file mode 100644 index e622bea9f..000000000 --- a/core/defuns-mouse.el +++ /dev/null @@ -1,39 +0,0 @@ -;;;###autoload -(defun narf/mouse-line-at-click () - "Determine the line number at click" - (save-excursion - (let ((click-y (cddr (mouse-position))) - (debug-on-error t) - (line-move-visual t)) - (goto-char (window-start)) - (next-line (1- click-y)) - (1+ (line-number-at-pos))))) - -;;;###autoload -(defun narf/mouse-select-line (event) - "Set point as *linum-mdown-line*" - (interactive "e") - (mouse-select-window event) - (goto-line (narf/mouse-line-at-click)) - (evil-visual-line) - (setq *linum-mdown-line* (line-number-at-pos))) - -;;;###autoload -(defun narf/mouse-select-block () - "Select the current block of text between blank lines." - (interactive) - (let (p1 p2) - (progn - (if (re-search-backward "\n[ \t]*\n" nil "move") - (progn (re-search-forward "\n[ \t]*\n") - (setq p1 (point))) - (setq p1 (point))) - (if (re-search-forward "\n[ \t]*\n" nil "move") - (progn (re-search-backward "\n[ \t]*\n") - (setq p2 (point))) - (setq p2 (point)))) - (set-mark p1))) - - -(provide 'defuns-mouse) -;;; defuns-mouse.el ends here diff --git a/core/defuns-org.el b/core/defuns-org.el deleted file mode 100644 index f3f28ca1b..000000000 --- a/core/defuns-org.el +++ /dev/null @@ -1,92 +0,0 @@ -;;;###autoload -(defun narf/project-org-filename (cat) - (interactive (list (completing-read "Choose category:" - (mapcar 'f-filename (f-directories org-project-directory))))) - (expand-file-name (concat (file-name-nondirectory (directory-file-name (narf/project-root))) ".org") - (expand-file-name cat org-project-directory))) - -;;;###autoload -(defun narf--org-in-list-p () - (and (save-excursion (search-backward-regexp "^ *\\([0-9]+[\.)]\\|[-*+]\\) " - (line-beginning-position) t)) - (org-in-item-p))) - -;;;###autoload -(defun narf/org-insert-item-after () - "Inserts a new heading or item, depending on the context." - (interactive) - (org-end-of-line) - (cond ((org-at-item-checkbox-p) - (org-insert-heading) - (insert "[ ] ")) - ((narf--org-in-list-p) - (org-insert-heading)) - ((org-on-heading-p) - (org-insert-heading-after-current)) - (t - (org-insert-heading-after-current) - (delete-char 1))) - (evil-insert-state)) - -;; TODO Check if this and -forward can be combined -;;;###autoload -(defun narf/org-insert-item-before () - "Inserts a new heading or item, depending on the context." - (interactive) - (evil-first-non-blank) - (cond ((org-at-item-checkbox-p) - (org-insert-heading) - (insert "[ ] ")) - ((narf--org-in-list-p) - (org-insert-heading)) - (t (org-insert-heading))) - (evil-insert-state)) - -;;;###autoload -(defun narf/org-toggle-checkbox () - (interactive) - (save-excursion - (org-end-of-line) - (cond ((org-in-item-p) - (if (search-backward-regexp "\\[[ +-]\\]" (line-beginning-position) t) - (delete-char 4) - (org-beginning-of-line))) - (t (org-insert-heading))) - (insert "[ ] "))) - -;; Formatting shortcuts -;;;###autoload -(defun narf/org-surround (delim) - (insert delim) (save-excursion (insert delim))) - -;;;###autoload (autoload 'narf::org-insert-image-url "defuns-org") -(evil-define-command narf::org-insert-image-url (&optional image-url) - :repeat nil - (interactive "") - (unless image-url - (user-error "You must specify an image URL to insert")) - (let ((dest (f-join org-directory "images/" (concat (format-time-string "%Y%m%d-") (f-filename image-url))))) - (shell-command (format "wget '%s' -O '%s'" image-url dest)) - (insert (format "<%s>" (f-relative dest (f-dirname (buffer-file-name))))) - (indent-according-to-mode))) - -;;;###autoload (autoload 'narf::org-insert-image "defuns-org") -(evil-define-command narf::org-insert-image (&optional filename bang) - :repeat nil - (interactive "") - (if bang - (narf::org-insert-image-url filename) - (unless filename - (user-error "You must specify a file to attach")) - (unless (file-exists-p filename) - (user-error "File %s does not exist" filename)) - (let ((dest (f-join org-directory "images/" (concat (format-time-string "%Y%m%d-") (f-filename filename))))) - (when (file-exists-p dest) - (user-error "File %s already exists at destination!")) - (copy-file filename dest) - (insert (format "" (f-relative dest (f-dirname (buffer-file-name))))) - (indent-according-to-mode)))) - - -(provide 'defuns-org) -;;; defuns-org.el ends here diff --git a/core/defuns-search.el b/core/defuns-search.el deleted file mode 100644 index 4f13e6a7d..000000000 --- a/core/defuns-search.el +++ /dev/null @@ -1,106 +0,0 @@ -;;;###autoload -(defun narf:ido-find-file (&optional dir) - (interactive) - (let ((default-directory (or dir default-directory))) - (ido-find-file))) - -;;;###autoload -(defun narf:ido-find-file-other-window (&optional dir) - (interactive) - (let ((default-directory (or dir default-directory))) - (ido-find-file-other-window))) - -;;;###autoload -(defun narf:ido-find-project-file () - (interactive) - (let ((default-directory (narf/project-root))) - (ido-find-file))) - -;;;###autoload (autoload 'narf::initfiles "defuns-search") -(evil-define-command narf::initfiles (&optional bang) :repeat nil - (interactive "") - (if bang - (ido-find-file-in-dir MODULES-DIR) - (ido-find-file-in-dir BASE-DIR))) - -;;;###autoload (autoload 'narf::notes "defuns-search") -(evil-define-command narf::notes () :repeat nil - (interactive) - (require 'org) - (ido-find-file-in-dir org-directory)) - -;; Ex-mode interface for `helm-recentf' and `helm-projectile-recentf'. If -;; `bang', then `search' is interpreted as regexp -;;;###autoload (autoload 'narf::recentf "defuns-search") -(evil-define-command narf::recentf (&optional bang) - :repeat nil - (interactive "") - (if bang (helm-recentf) (helm-projectile-recentf))) - -;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as -;; regexp. -;;;###autoload (autoload 'narf::ag-search "defuns-search") -(evil-define-operator narf::ag-search (beg end &optional search hidden-files-p pwd-p regex-p) - :type inclusive - :repeat nil - (interactive "") - (helm-alive-p) - (let* ((helm-ag-default-directory (if pwd-p default-directory (narf/project-root))) - (helm-ag-command-option (concat (unless regex-p "-Q ") - (if hidden-files-p "--hidden "))) - (input "") - (header-name (format "Search in %s" helm-ag-default-directory))) - (if search - (progn - (helm-attrset 'search-this-file nil helm-ag-source) - (setq helm-ag--last-query search)) - (if (and beg end (/= beg (1- end))) - (setq input (buffer-substring-no-properties beg end)))) - (helm-attrset 'name header-name helm-ag-source) - (helm :sources (if search (helm-ag--select-source) '(helm-source-do-ag)) - :buffer "*helm-ag*" - :input input - :prompt helm-global-prompt))) - -;;;###autoload (autoload 'narf::ag-regex-search "defuns-search") -(evil-define-operator narf::ag-regex-search (beg end &optional search bang) - :type inclusive :repeat nil - (interactive "") - (narf::ag-search beg end search bang nil t)) - -;;;###autoload (autoload 'narf::ag-regex-cwd "defuns-search") -(evil-define-operator narf::ag-search-cwd (beg end &optional search bang) - ;; Ex-mode interface for `helm-do-ag'. If `bang', then `search' is interpreted - ;; as regexp - :type inclusive :repeat nil - (interactive "") - (narf::ag-search beg end search bang t nil)) - -;;;###autoload (autoload 'narf::ag-regex-search-cwd "defuns-search") -(evil-define-operator narf::ag-regex-search-cwd (beg end &optional search bang) - :type inclusive :repeat nil - (interactive "") - (narf::ag-search beg end search bang t t)) - -;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or -;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is -;; `scss-mode' -;;;###autoload (autoload 'narf::swoop "defuns-search") -(evil-define-command narf::swoop (&optional search bang) - :repeat nil - (interactive "") - (if (eq major-mode 'scss-mode) - (if bang (helm-css-scss-multi search) (helm-css-scss search)) - (if bang (helm-multi-swoop-all search) (helm-swoop :$query search)))) - -;; TODO: Implement helm-find-file -;;;###autoload (autoload 'narf::snippets "defuns-search") -(evil-define-command narf::snippets (&optional bang) - (interactive "") - (if bang - (narf:ido-find-file SNIPPETS-DIR) - (helm-yas-visit-snippet-file))) - - -(provide 'defuns-search) -;;; defuns-search.el ends here diff --git a/core/defuns-text.el b/core/defuns-text.el deleted file mode 100644 index a781ce4f8..000000000 --- a/core/defuns-text.el +++ /dev/null @@ -1,135 +0,0 @@ -;;;###autoload -(defun narf--point-at-bol-non-blank() - (save-excursion (evil-first-non-blank) (point))) - -;;;###autoload -(defun narf/surrounded-p () - (and (looking-back "[[{(]\\(\s+\\|\n\\)?\\(\s\\|\t\\)*") - (let* ((whitespace (match-string 1)) - (match-str (concat whitespace (match-string 2) "[])}]"))) - (looking-at-p match-str)))) - -;;;###autoload -(defun narf:backward-kill-to-bol-and-indent () - "Kill line to the first non-blank character. If invoked again -afterwards, kill line to column 1." - (interactive) - (let ((empty-line (sp-point-in-blank-line))) - (evil-delete (point-at-bol) (point)) - (if (not empty-line) - (indent-according-to-mode)))) - -;;;###autoload -(defun narf:move-to-bol () - "Moves cursor to the first non-blank character on the line. If -already there, move it to the true bol." - (interactive) - (evil-save-goal-column - (let ((point-at-bol (narf--point-at-bol-non-blank)) - (point (point))) - (if (= point-at-bol point) - (evil-move-beginning-of-line) - (unless (= (point-at-bol) point) - (evil-first-non-blank)))))) - -;;;###autoload -(defun narf:move-to-eol () - (interactive) - (evil-save-goal-column - (let ((old-point (point))) - (when (comment-search-forward (point-at-eol) t) - (goto-char (match-beginning 0)) - (skip-syntax-backward " ^<*" (narf--point-at-bol-non-blank)) - - (if (eq old-point (point)) ; - (evil-move-end-of-line)))))) - -;; Mimic expandtab in vim -;;;###autoload -(defun narf:backward-delete-whitespace-to-column () - "Delete back to the previous column of whitespace, or as much -whitespace as possible, or just one char if that's not possible." - (interactive) - (cond ;; If in a string - ((sp-point-in-string) - (call-interactively 'backward-delete-char-untabify)) - ;; If using tabs (or at bol), just delete normally - ((or indent-tabs-mode - (= (point-at-bol) (point))) - (call-interactively 'backward-delete-char)) - ;; Delete up to the nearest tab column IF only whitespace between point - ;; and bol. - ((looking-back "^[\\t ]*" (point-at-bol)) - (let ((movement (% (current-column) tab-width)) - (p (point))) - (when (= movement 0) - (setq movement tab-width)) - (save-match-data - (if (string-match "\\w*\\(\\s-+\\)$" - (buffer-substring-no-properties (- p movement) p)) - (sp-backward-delete-char (- (match-end 1) (match-beginning 1))) - (backward-delete-char-untabify 1))))) - ;; Otherwise do a regular delete - (t (backward-delete-char-untabify 1)))) - -;;;###autoload -(defun narf:dumb-indent () - "Inserts a tab character (or spaces x tab-width). Checks if the -auto-complete window is open." - (interactive) - (if indent-tabs-mode - (insert "\t") - (let* ((movement (% (current-column) tab-width)) - (spaces (if (zerop movement) tab-width (- tab-width movement)))) - (insert (s-repeat spaces " "))))) - -;;;###autoload -(defun narf:inflate-space-maybe () - "Checks if point is surrounded by {} [] () delimiters and adds a -space on either side of the point if so." - (interactive) - (if (narf/surrounded-p) - (progn (call-interactively 'self-insert-command) - (save-excursion (call-interactively 'self-insert-command))) - (call-interactively 'self-insert-command))) - -;;;###autoload -(defun narf:deflate-space-maybe () - "Checks if point is surrounded by {} [] () delimiters, and deletes -spaces on either side of the point if so. Resorts to -`narf:backward-delete-whitespace-to-column' otherwise." - (interactive) - (save-match-data - (if (narf/surrounded-p) - (let ((whitespace-match (match-string 1))) - (cond ((not whitespace-match) - (call-interactively 'sp-backward-delete-char)) - ((string-match "\n" whitespace-match) - (evil-delete (point-at-bol) (point)) - (delete-char -1) - (save-excursion (delete-char 1))) - (t - (just-one-space 0)))) - (narf:backward-delete-whitespace-to-column)))) - -;;;###autoload -(defun narf:newline-and-indent () - (interactive) - (cond - ((sp-point-in-string) - (newline)) - ((sp-point-in-comment) - (cond ((eq major-mode 'js2-mode) - (js2-line-break)) - ((-contains? '(java-mode php-mode) major-mode) - (c-indent-new-comment-line)) - ((-contains? '(c-mode c++-mode objc-mode css-mode scss-mode) major-mode) - (newline-and-indent) - (insert "* ") - (indent-according-to-mode)) - (t (indent-new-comment-line)))) - (t (newline-and-indent)))) - - -(provide 'defuns-text) -;;; defuns-text.el ends here diff --git a/core/defuns-ui.el b/core/defuns-ui.el deleted file mode 100644 index cdd43943b..000000000 --- a/core/defuns-ui.el +++ /dev/null @@ -1,27 +0,0 @@ -(eval-when-compile (require 'cl)) - -;;;###autoload -(defun narf:toggle-transparency () - (interactive) - (let* ((alpha (frame-parameter nil 'alpha)) - (alpha-val (if (listp alpha) (car alpha) alpha))) - (if (/= alpha-val 97) - (set-frame-parameter nil 'alpha 100) - (set-frame-parameter nil 'alpha 0)))) - -;;;###autoload -(defun narf:toggle-fullscreen () - (interactive) - (set-frame-parameter nil 'fullscreen - (when (not (frame-parameter nil 'fullscreen)) 'fullboth))) - -(defconst BIG-FONT (font-spec :family "Inconsolata" :size 18 :antialias t)) -(defvar narf--big-mode nil) - -;;;###autoload -(defun narf:toggle-big-mode () - (interactive) - (if narf--big-mode - (set-frame-font DEFAULT-FONT) - (set-frame-font BIG-FONT)) - (setq narf--big-mode (not narf--big-mode))) diff --git a/core/defuns.el b/core/defuns.el deleted file mode 100644 index c4cfa8b28..000000000 --- a/core/defuns.el +++ /dev/null @@ -1,299 +0,0 @@ -(require 's) -(require 'dash) -(require 'f) - -;; Compatibility ;;;;;;;;;;;;;;;;;;; -;; Backwards compatible `with-eval-after-load' -(unless (fboundp 'with-eval-after-load) - (defmacro with-eval-after-load (file &rest body) - `(eval-after-load ,file - `(funcall (function ,(lambda () ,@body)))))) - -(defmacro after (feature &rest forms) - (declare (indent defun)) - `(,(if (or (not (boundp 'byte-compile-current-file)) - (not byte-compile-current-file) - (if (symbolp feature) - (require feature nil :no-error) - (load feature :no-message :no-error))) - 'progn - (message "after: cannot find %s" feature) - 'with-no-warnings) - (with-eval-after-load ',feature ,@forms))) - -(defmacro shut-up (&rest body) - "Silence message output from code." - (declare (indent defun)) - `(let (message-log-max) - ,@body - (message ""))) - -(eval-when-compile - ;; Convenience ;;;;;;;;;;;;;;;;;;;;; - (defmacro λ (&rest body) - "A shortcut for: `(lambda () (interactive) ,@body)" - `(lambda () (interactive) ,@body)) - - (defmacro associate-mode (match mode) - "Associate a major mode with a filepath through `auto-mode-alist'" - `(add-to-list 'auto-mode-alist (cons ,match ,mode))) - - (defmacro associate-minor-mode (match mode) - "Associate a minor mode with a filepath through `auto-minor-mode-alist'" - `(add-to-list 'narf/auto-minor-mode-alist (cons ,match ,mode))) - - ;; (defmacro add-to-mode (mode funcs)) - ;; (defmacro add-to-modes (func modes) - ;; (add-to-hooks)) - - (defmacro add-to-hook (hook funcs) - "Add a series of FUNCS to a hook. FUNCS can be a list." - (declare (indent 1)) - `(progn ,@(mapcar (lambda (func) `(add-hook ',(eval hook) ',func)) (eval funcs)))) - - (defmacro add-to-hooks (func hooks) - "Add one FUNC to a series of hooks. HOOKS can be a list." - (declare (indent 1)) - `(progn ,@(mapcar (lambda (hook) `(add-hook ',hook ',(eval func))) (eval hooks)))) - - (defmacro add-hook! (hook &rest body) - "A shortcut macro for `add-hook' that auto-wraps `body' in a lambda" - (declare (indent 1)) - `(add-hook ,hook (lambda() ,@body))) - - ;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;; - (after "evil" - (defmacro excmd (command func) - "An alternative to `evil-ex-define-cmd' that won't choke on autoload -functions being registered as ex commands." - `(evil-ex-define-cmd ,command ,func)) - - (defmacro excmd! (command func) - `(evil-ex-define-cmd ,command (lambda () (interactive) (call-interactively ,func)))) - - (defmacro bind (&rest keys) - "A minimalistic and evil-centric way of binding keys. KEYS is -made up of either: - -1. Any of the following keywords: - -:if CONDITION Determines where these keymaps should be set. -:prefix PREFIX Key(s) to prefix keymappings with -:map KEYMAP Keymaps to bind keys to. Can be a list. -:global Tags these keymaps for the global keymap -:local Ditto, but for local keymap -:leader Like :prefix ?, -:localleader Like :prefix ?\\ -: e.g. :normal ;visual and so on. Anything that - `evil-state-p' recognizes You can stack to - make a key present in more than one state. - -2. A key (as a vector e.g. [escape], a string \"\", or -character ?\^?). - -3. A key definition: a symbol or a lambda function. " - (declare (indent 9999)) - (let* ((condition t) - (default-keymaps '(narf-mode-map)) - (keymaps default-keymaps) - (forms '()) - (consecutive t) - (states '()) - prefix local-p - key def) - (while keys - (setq key (pop keys)) - (cond ((or (evil-state-p key) - (and (listp key) - (--all? (evil-state-p it) key))) - (setq states (-list key))) - - ((keywordp key) - (cl-case key - (:prefix - (let ((val (pop keys))) - (cond ((or (stringp val) - (characterp val) - (vectorp val)) - (setq prefix val)) - ((eq val 'leader) - (setq prefix narf/leader-key)) - ((eq val 'localleader) - (setq prefix narf/localleader-key)) - (t (signal 'bind-invalid-prefix prefix))))) - (:map - (let ((val (pop keys))) - (cond ((or (symbolp val) (listp val)) - (setq keymaps (-list val))) - ((null val) - (setq keymaps default-keymaps)) - (t (signal 'bind-invalid-keymaps '(key val)))))) - (:if (setq condition (pop keys))) - (:local (setq local-p (pop keys))) - ;; TODO: Deprecated - (otherwise - (let ((keyword (intern-soft (substring (symbol-name key) 1))) - (next-key (cadr keys))) - (when (evil-state-p keyword) - (setq local-p nil) - (if consecutive - (cl-pushnew keyword states) - (setq states (list keyword)))) - (setq consecutive t))))) - - ;; key-definition pairs - ((or (stringp key) - (vectorp key) - (characterp key)) - (unless keys (signal 'bind-no-definition key)) - (setq def (pop keys)) - (when condition - ;; Process the key - (cond ((stringp key) (setq key (kbd key))) - ((characterp key) (setq key (string key)))) - (when prefix - (setq key (if (vectorp key) - (vconcat prefix key) - (concat (kbd prefix) key)))) - ;; Do the binding - (if (null states) - (dolist (keymap keymaps) - (add-to-list 'forms `(define-key ,keymap ,key ,def) t)) - (dolist (state (-list states)) - (when local-p - (setq keymaps (list (make-symbol (format "evil-%s-state-local-mode-map" state))))) - (dolist (keymap keymaps) - (add-to-list 'forms `(define-key ,(if local-p keymap `(evil-get-auxiliary-keymap ,keymap ',state t)) ,key ,def) t))))) - (setq consecutive nil)) - - ;; fallback - (t (signal 'bind-invalid-key key)))) - (when DEBUG-MODE (message "%s" forms)) - `(progn ,@forms))))) - -(after "evil" - (evil-define-command narf:exit-mode-maybe () - "Exits insert mode using jk without the momentary pause caused by -key-chord-define." - :repeat change - (interactive) - (let ((modified (buffer-modified-p))) - (call-interactively 'self-insert-command) - (let ((evt (read-event nil nil 0.4))) - (cond - ((null evt) (message "")) - ((and (integerp evt) (char-equal evt ?k)) - - (if (evil-replace-state-p) - (evil-replace-backspace) - (delete-char -1)) - (set-buffer-modified-p modified) - (push 'escape unread-command-events)) - (t - (setq unread-command-events (append unread-command-events (list evt))))))))) - -;; Hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun narf|enable-comment-hard-wrap () - (set (make-local-variable 'comment-auto-fill-only-comments) t) - (turn-on-auto-fill)) - -(defun narf|enable-hard-wrap () - (turn-on-auto-fill)) - -(defun narf|enable-tab-width-2 () - (setq tab-width 2 evil-shift-width 2)) - -(defun narf|enable-tab-width-4 () - (setq tab-width 4 evil-shift-width 4)) - -(defun narf|disable-final-newline () - (set (make-local-variable 'require-final-newline) nil)) - -(defun narf|enable-tabs () - (setq indent-tabs-mode t)) - -(defun narf|disable-tabs () - (setq indent-tabs-mode nil)) - -(defun narf|disable-delete-trailing-whitespace () - (remove-hook 'before-save-hook 'delete-trailing-whitespace)) - - -;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;; -(defun narf/minibuffer-quit () - "Abort recursive edit. In Delete Selection mode, if the mark is -active, just deactivate it; then it takes a second \\[keyboard-quit] -to abort the minibuffer." - (interactive) - (let (message-log-max) - (if (and delete-selection-mode transient-mark-mode mark-active) - (setq deactivate-mark t) - (when (get-buffer "*Completions*") - (delete-windows-on "*Completions*")) - (abort-recursive-edit)))) - - -;;;; Project defuns ;;;;;;;;;;;;;;;;;;;; -(defvar narf/project-root-files '(".git" ".hg" ".svn" ".project" "local.properties" "project.properties" "rebar.config" "project.clj" "SConstruct" "pom.xml" "build.sbt" "build.gradle" "Gemfile" "requirements.txt" "tox.ini" "package.json" "gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml" "mix.exs") - "A list of files that count as 'project files', which determine whether a - folder is the root of a project or not.") -(defun narf/project-root (&optional strict-p) - "Get the path to the root of your project. Uses `narf/project-root-files' to -determine if a directory is a project." - (let ((home (file-truename "~"))) - (catch 'found - (f-traverse-upwards - (lambda (path) - (let ((path (file-truename path))) - (if (file-equal-p home path) - (throw 'found (if strict-p nil default-directory)) - (dolist (file narf/project-root-files) - (when (file-exists-p (expand-file-name file path)) - (throw 'found path)))))) default-directory) - default-directory))) - -(defun narf/project-has-files (files &optional root) - "Return non-nil if `file' exists in the project root." - (let ((root (or root (narf/project-root))) - (files (if (listp files) files (list files))) - found-p file) - (while (and files (not found-p)) - (setq file (pop files)) - (setq found-p (file-exists-p (narf/project-path-to file root)))) - found-p)) - -(defun narf/project-path-to (file &optional root) - (let ((root (or root (narf/project-root)))) - (expand-file-name file root))) - -(defun narf/project-name (&optional root) - (file-name-nondirectory (directory-file-name (or root (narf/project-root))))) - -(defun narf/project-p () - (not (null (narf/project-root t)))) - -;; Make sure scratch buffer is always "in a project" -(defvar narf--project-scratch-buffer nil) -(defun narf/project-create-scratch-buffer () - (let* ((scratch-buffer (get-buffer-create "*scratch*")) - (root (narf/project-root t)) - (project-name (narf/project-name root)) - (current-buffer (current-buffer))) - (when root - (mapc (lambda (b) - (when (and (string-match-p "\\*scratch\\* (.+)" (buffer-name b)) - (not (eq current-buffer b)) - (= (buffer-size b) 0)) - (kill-buffer b))) - (buffer-list)) - (save-window-excursion - (switch-to-buffer scratch-buffer) - (setq narf--project-scratch-buffer scratch-buffer) - (erase-buffer) - (cd root) - (rename-buffer (format "*scratch* (%s)" project-name)))))) -(add-hook 'find-file-hook 'narf/project-create-scratch-buffer) - - -(provide 'defuns) -;; defuns.el ends here diff --git a/core/defuns/defuns-compile.el b/core/defuns/defuns-compile.el new file mode 100644 index 000000000..ef98bcff8 --- /dev/null +++ b/core/defuns/defuns-compile.el @@ -0,0 +1,32 @@ +;;; defuns-compile.el + +(! (require 'f) + (setq narf-important-dirs (append (list narf-core-dir narf-modules-dir narf-contrib-dir narf-private-dir) + (f-directories narf-core-dir nil t) + (f-directories narf-modules-dir nil t) + (f-directories narf-contrib-dir nil t)))) + +;;;###autoload (autoload 'narf:byte-compile "defuns-compile") +(evil-define-command narf:byte-compile (&optional bang) + :repeat nil + (interactive "") + (when emacs-lisp-mode + (if (not bang) + (progn + (byte-recompile-file (! (f-expand "core-defuns.el" narf-core-dir)) t 0) + (byte-recompile-file (buffer-file-name) t 0)) + (byte-recompile-file (! (f-expand "init.el" narf-emacs-dir)) nil 0) + (byte-recompile-file (! (f-expand "startup.el" narf-emacs-dir)) nil 0) + (dolist (dir (! narf-impotant-dirs)) + (byte-recompile-directory dir 0 nil))))) + +;;;###autoload (autoload 'narf:autoload-compile "defuns-compile") +(evil-define-command narf:autoload-compile (&optional bang) + :repeat nil + (interactive "") + (defvar generated-autoload-file (! (f-expand "autoloads.el" narf-core-dir))) + (apply #'update-directory-autoloads (! narf-impotant-dirs))) + + +(provide 'defuns-compile) +;;; defuns-compile.el ends here diff --git a/core/defuns/defuns-evil.el b/core/defuns/defuns-evil.el new file mode 100644 index 000000000..fc7de2fdc --- /dev/null +++ b/core/defuns/defuns-evil.el @@ -0,0 +1,33 @@ +;;; defuns-evil.el + +;;;###autoload (autoload 'narf:evil-open-folds "defuns-evil") +(evil-define-command narf/evil-open-folds (count) + "Instead of `evil-open-folds'. Accepts COUNT for dictating fold level." + (interactive "P") + (if count (hs-hide-level count) (evil-open-folds))) + +;;;###autoload (autoload 'narf:evil-open-folds "defuns-evil") +(evil-define-command narf/evil-close-folds (count) + "Instead of `evil-close-folds'. Accepts COUNT for dictating fold level." + (interactive "P") + (if count (hs-hide-level count) (evil-close-folds))) + +;;;; Ace Jump ;;;;;;;;;;;;;;;;;;;;;;;;;; +;; https://github.com/winterTTr/ace-jump-mode/issues/23 +;;;###autoload (autoload 'narf:evil-ace-jump-two-chars "defuns-evil") +(evil-define-motion narf/evil-ace-jump-two-chars (count) + :type exclusive + :repeat abort + (evil-without-repeat + (evil-enclose-ace-jump-for-motion + (call-interactively 'ace-jump-two-chars-mode)))) + +;;;###autoload +(defun narf/evil-visual-line-state-p () + "Returns non-nil if in visual-line mode, nil otherwise." + (and (evil-visual-state-p) + (eq (evil-visual-type) 'line))) + + +(provide 'defuns-evil) +;;; defuns-evil.el ends here diff --git a/core/defuns/defuns-isearch.el b/core/defuns/defuns-isearch.el new file mode 100644 index 000000000..bbd235526 --- /dev/null +++ b/core/defuns/defuns-isearch.el @@ -0,0 +1,34 @@ + +;;;###autoload +(defun narf/isearch-delete-word () + (interactive) + (let ((num (length isearch-string)) + (string (s-reverse isearch-string))) + (when (string-match "[^a-zA-Z0-9]" string 1) + (setq num (match-beginning 0))) + (dotimes (i num) + (isearch-pop-state)) + (isearch-update))) + +;;;###autoload +(defun narf/isearch-delete-line () + (interactive) + (let ((num (length isearch-string))) + (dotimes (i num) (isearch-pop-state)) + (isearch-update))) + +;;;###autoload +(defun narf/isearch-paste-from-register (reg) + (interactive) + (let ((str (evil-get-register reg t))) + (when (> (length str) 0) + (isearch-yank-string str)))) + +;;;###autoload +(defun narf/isearch-paste-from-clipboard () + (interactive) + (narf:isearch-paste-from-register ?+)) + + +(provide 'defuns-isearch) +;;; defuns-isearch.el ends here diff --git a/core/defuns/defuns-nlinum.el b/core/defuns/defuns-nlinum.el new file mode 100644 index 000000000..516bbb690 --- /dev/null +++ b/core/defuns/defuns-nlinum.el @@ -0,0 +1,12 @@ +;;; defuns-nlinum.el + +;;;###autoload +(defun narf/nlinum-toggle () + (interactive) + (if nlinum-mode + (narf|nlinum-disable) + (narf|nlinum-enable))) + + +(provide 'defuns-nlinum) +;;; defuns-nlinum.el ends here diff --git a/core/defuns/defuns-popwin.el b/core/defuns/defuns-popwin.el new file mode 100644 index 000000000..fc7d35bbd --- /dev/null +++ b/core/defuns/defuns-popwin.el @@ -0,0 +1,10 @@ +;;;###autoload +(defun narf/popwin-toggle () + (interactive) + (if (popwin:popup-window-live-p) + (popwin:close-popup-window) + (popwin:popup-last-buffer))) + + +(provide 'defuns-popwin) +;;; defuns-popwin.el ends here diff --git a/core/macros/macros-company.el b/core/macros/macros-company.el new file mode 100644 index 000000000..172d8cb32 --- /dev/null +++ b/core/macros/macros-company.el @@ -0,0 +1,4 @@ + + +(provide 'macros-company) +;;; macros-company.el ends here diff --git a/core/macros/macros-popwin.el b/core/macros/macros-popwin.el new file mode 100644 index 000000000..d3594e303 --- /dev/null +++ b/core/macros/macros-popwin.el @@ -0,0 +1,14 @@ +;;; macros-popwin.el + +;;;###autoload +(defmacro @popwin-register (&rest forms) + "Register a rule for popwin. See `popwin:special-display-config'. + + Example: + (@popwin-register (\"^\\*Flycheck.*\\*$\" :regexp t :position bottom :height 0.25 :noselect t))" + (declare (indent defun)) + `(push (,@forms) form)) + + +(provide 'macros-popwin) +;;; macros-popwin.el ends here diff --git a/core/startup.el b/core/startup.el deleted file mode 100644 index f9285ad8a..000000000 --- a/core/startup.el +++ /dev/null @@ -1,39 +0,0 @@ -(defconst BASE-DIR user-emacs-directory) - -(defconst CORE-DIR (eval-when-compile (concat BASE-DIR "core/"))) -(defconst MODULES-DIR (eval-when-compile (concat BASE-DIR "init/"))) -(defconst CONTRIB-DIR (eval-when-compile (concat BASE-DIR "contrib/"))) -(defconst THEMES-DIR (eval-when-compile (concat BASE-DIR "themes/"))) -(defconst SNIPPETS-DIR (eval-when-compile (concat BASE-DIR "snippets/"))) -(defconst ELPA-DIR (eval-when-compile (concat BASE-DIR ".cask/" emacs-version "/elpa/"))) -(defconst TMP-DIR (eval-when-compile (concat BASE-DIR ".cache-" (system-name) "/"))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(eval-when-compile - (defmacro narf/init-load-path () - "Collect and verify `load-path'. Compile me!" - (let (paths '()) - (dolist (dir (append (directory-files ELPA-DIR t "^[^.]" t) - (directory-files CONTRIB-DIR t "^[^.]" t))) - (when (file-directory-p dir) - (push dir paths))) - `(setq load-path ',(append (list CORE-DIR CONTRIB-DIR MODULES-DIR) - (if (listp load-path) load-path (list load-path)) - paths)))) - - ;; Are you pondering what I'm pondering? - (defmacro narf/init (packages) - `(progn ,@(mapcar (lambda (pkg) `(require ',pkg)) (eval packages))))) - -(narf/init-load-path) -;; (require 'benchmark) -(require 'autoloads nil t) ; use `make autoloads` to generate autoloads file - -(setq custom-theme-directory THEMES-DIR) -(setq use-package-verbose DEBUG-MODE) -;;(setq use-package-expand-minimally (not DEBUG-MODE)) -(eval-when-compile (require 'use-package)) -(require 'diminish) - -;;; startup.el ends here diff --git a/dict/android-mode b/dict/android-mode deleted file mode 100755 index eb52d4f68..000000000 --- a/dict/android-mode +++ /dev/null @@ -1,4 +0,0 @@ -RelativeLayout -LinearLayout -ImageView -TextView diff --git a/dict/c++-mode b/dict/c++-mode deleted file mode 100755 index bd5649d2b..000000000 --- a/dict/c++-mode +++ /dev/null @@ -1,75 +0,0 @@ -and -and_eq -asm -auto -bitand -bitor -bool -break -case -catch -char -class -compl -const -const_cast -continue -default -delete -do -double -dynamic_cast -else -enum -explicit -export -extern -false -float -for -friend -goto -if -inline -int -internal -long -mutable -namespace -new -not -not_eq -operator -or -or_eq -private -protected -public -register -reinterpret_cast -return -short -signed -sizeof -static -static_cast -struct -switch -template -this -throw -true -try -typedef -typeid -typename -union -unsigned -using -virtual -void -volatile -wchar_t -while -xor -xor_eq diff --git a/dict/c-mode b/dict/c-mode deleted file mode 100755 index 4a06da438..000000000 --- a/dict/c-mode +++ /dev/null @@ -1,37 +0,0 @@ -auto -_Bool -break -case -char -_Complex -const -continue -default -do -double -else -enum -extern -float -for -goto -if -_Imaginary -inline -int -long -register -restrict -return -short -signed -sizeof -static -struct -switch -typedef -union -unsigned -void -volatile -while \ No newline at end of file diff --git a/dict/css-mode b/dict/css-mode deleted file mode 100755 index 05686131c..000000000 --- a/dict/css-mode +++ /dev/null @@ -1,677 +0,0 @@ -!important -_azimuth -_background -_background-position-x -_background-position-y -_border -_bottom -_caption -_clear -_clip -_color -_content -_counter -_cue -_cursor -_direction -_display -_elevation -_empty -_filter -_filter:progid:DXImageTransform.Microsoft -_float -_font -_height -_ime -_ime-mode -_layout -_layout-flow -_layout-grid -_layout-grid-char -_layout-grid-line -_layout-grid-mode -_layout-grid-type -_left -_letter -_line -_line-break -_list -_margin -_orphans -_outline -_overflow -_overflow-x -_overflow-y -_padding -_page -_pause -_pitch -_play -_position -_quotes -_richness -_right -_ruby -_ruby-align -_ruby-overhang -_ruby-position -_scrollbar -_scrollbar-3dlight-color -_scrollbar-arrow-color -_scrollbar-base-color -_scrollbar-darkshadow-color -_scrollbar-face-color -_scrollbar-highlight-color -_scrollbar-track-color -_speak -_speech -_stress -_table -_text -_text-align-last -_text-autospace -_text-justify -_text-kashida-space -_text-overflow -_text-underline-position -_top -_unicode -_vertical -_visibility -_voice -_volume -_white -_widows -_width -_word -_word-break -_word-wrap -_writing -_writing-mode -_z -_zoom -above -active -adjust -after -aliceblue -align -always -antiquewhite -aqua -aquamarine -armenian -arrow -attachment -auto -autospace -avoid -azimuth -azure -background -background-attachment -background-color -background-image -background-position -background-repeat -bar -base -baseline -before -behind -beige -below -bidi -bidi-override -bisque -black -blanchedalmond -blink -block -blue -blueviolet -bold -bolder -border -border-bottom -border-bottom-color -border-bottom-style -border-bottom-width -border-collapse -border-color -border-left -border-left-color -border-left-style -border-left-width -border-right -border-right-color -border-right-style -border-right-width -border-spacing -border-style -border-top -border-top-color -border-top-style -border-top-width -border-width -both -bottom -box -break -brown -burlwood -cadetblue -capitalize -caps -caption -caption-side -cell -cells -center -center-left -center-right -char -chartreuse -chocolate -circle -cjk -cjk-ideographic -clear -clip -close -close-quote -cm -code -collapse -color -column -compact -condensed -content -continuous -coral -cornflowerblue -cornsilk -counter -counter-increment -counter-reset -crimson -crop -cross -crosshair -cue -cue-after -cue-before -cursive -cursor -cyan -darkblue -darkcyan -darkgoldenrod -darkgray -darkgreen -darkkhaki -darkmagenta -darkolivegreen -darkorange -darkorchid -darkred -darksalmon -darkseagreen -darkshadow -darkslateblue -darkslategray -darkturquoise -darkviolet -dashed -decimal -decimal-leading-zero -decoration -deeppink -deepskyblue -default -deg -digits -dimgray -direction -disc -display -dodgerblue -dotted -double -during -e -e-resize -elevation -em -embed -empty -empty-cells -ex -expanded -extra -extra-condensed -extra-expanded -face -family -fantasy -far -far-left -far-right -fast -faster -firebrick -first -first-child -first-letter -first-line -fixed -float -floralwhite -flow -focus -font -font-family -font-size -font-size-adjust -font-stretch -font-style -font-variant -font-weight -footer -forestgreen -fuchsia -gainsboro -georgian -ghostwhite -gold -goldenrod -gray -greek -green -greenyellow -grid -groove -group -header -hebrew -height -help -hidden -hide -high -higher -hiragana -hiragana-iroha -honeydew -hotpink -hover -icon -ideographic -image -in -increment -indent -index -indianred -indigo -inherit -inline -inline-block -inline-table -inset -inside -iroha -italic -item -ivory -justify -kHz -kashida -katakana -katakana-iroha -khaki -landscape -lang() -large -larger -last -latin -lavender -lavenderblush -lawngreen -layout -leading -left -left-side -leftwards -lenonchiffon -letter -letter-spacing -level -lightblue -lightcoral -lightcyan -lighter -lightgoldenrodyellow -lightgray -lightgreen -lightgrey -lightpink -lightsalmon -lightseagreen -lightskyblue -lightslategray -lightsteelblue -lightyellow -lime -limegreen -line -line-height -line-through -linen -link -list -list-item -list-style -list-style-image -list-style-position -list-style-type -loud -low -lower -lower-alpha -lower-greek -lower-latin -lower-roman -lowercase -ltr -magenta -margin -margin-bottom -margin-left -margin-right -margin-top -marker -marker-offset -marks -maroon -max -max-height -max-width -medium -mediumaquamarine -mediumblue -mediumorchid -mediumpurple -mediumseagreen -mediumslateblue -mediumspringgreen -mediumturquoise -mediumvioletred -menu -message -message-box -middle -midnightblue -min -min-height -min-width -mintcream -mistyrose -mix -mm -moccasin -mode -monospace -move -ms -n -n-resize -naby -narrower -navajowhite -ne -ne-resize -no -no-close-quote -no-open-quote -no-repeat -none -normal -nowrap -number -numeral -nw -nw-resize -oblique -offset -oldlace -olive -olivedrab -once -open -open-quote -orange -orangered -orchid -orphans -out -outline -outline-color -outline-style -outline-width -outset -outside -overflow -overhang -overline -override -padding -padding-bottom -padding-left -padding-right -padding-top -page -page-break-after -page-break-before -page-break-inside -palegoldenrod -palegreen -paleturquoise -palevioletred -papayawhip -pause -pause-after -pause-before -pc -peachpuff -peru -pink -pitch -pitch-range -play -play-during -plum -pointer -portarait -position -powderblue -pre -pre-line -pre-wrap -progid -progress -pt -punctuation -purple -px -quote -quotes -rad -range -rate -red -relative -repeat -repeat-x -repeat-y -reset -resize -richness -ridge -right -right-side -rightwards -roman -rosybrown -row -royalblue -rtl -run -run-in -s -s-resize -saddlebrown -salmon -sandybrown -sans-serif -scroll -se -se-resize -seagreen -seashell -semi -semi-condensed -semi-expanded -separate -serif -shadow -show -side -sienna -silent -silever -silver -size -skyblue -slateblue -slategray -slow -slower -small -small-caps -small-caption -smaller -snow -soft -solid -space -spacing -speak -speak-header -speak-numeral -speak-punctuation -specific -specific-voice -speech -speech-rate -spell -spell-out -springgreen -square -static -status -status-bar -steelblue -stress -stretch -style -sub -super -sw -sw-resize -table -table-caption -table-cell -table-column -table-column-group -table-footer-group -table-header-group -table-layout -table-row -table-row-group -tan -teal -text -text-align -text-bottom -text-decoration -text-indent -text-shadow -text-top -text-transform -thick -thin -thistle -through -tomato -top -track -transform -transparent -turquoise -type -ultra -ultra-condensed -ultra-expanded -underline -unicode -unicode-bidi -upper -upper-alpha -upper-latin -upper-roman -uppercase -variant -vertical -vertical-align -violet -visibility -visible -visited -voice -voice-family -volume -w -w-resize -wait -weight -wheat -white -white-space -whitesmoke -wider -widows -width -word -word-spacing -wrap -x -x-fast -x-high -x-large -x-loud -x-low -x-slow -x-small -x-soft -xx -xx-large -xx-small -y -yellow -yellowgreen -z -z-index -zero \ No newline at end of file diff --git a/dict/java-mode b/dict/java-mode deleted file mode 100755 index 10583df3e..000000000 --- a/dict/java-mode +++ /dev/null @@ -1,4226 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.annotation -java.lang.instrument -java.lang.invoke -java.lang.management -java.lang.ref -java.lang.reflect -java.math -java.net -java.nio -java.nio.channels -java.nio.channels.spi -java.nio.charset -java.nio.charset.spi -java.nio.file -java.nio.file.attribute -java.nio.file.spi -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.text.spi -java.util -java.util -java.util.concurrent -java.util.concurrent.atomic -java.util.concurrent.locks -java.util.jar -java.util.logging -java.util.prefs -java.util.regex -java.util.spi -java.util.zip -javax.accessibility -javax.activity -javax.annotation.processing -javax.crypto -javax.crypto.interfaces -javax.crypto.spec -javax.imageio -javax.imageio.event -javax.imageio.metadata -javax.imageio.plugins.bmp -javax.imageio.plugins.jpeg -javax.imageio.spi -javax.imageio.stream -javax.lang.model -javax.lang.model.element -javax.lang.model.type -javax.lang.model.util -javax.management -javax.management.loading -javax.management.modelmbean -javax.management.monitor -javax.management.openmbean -javax.management.relation -javax.management.remote -javax.management.remote.rmi -javax.management.timer -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.net -javax.net.ssl -javax.print -javax.print.attribute -javax.print.attribute.standard -javax.print.event -javax.rmi -javax.rmi.CORBA -javax.rmi.ssl -javax.script -javax.security.auth -javax.security.auth.callback -javax.security.auth.kerberos -javax.security.auth.login -javax.security.auth.spi -javax.security.auth.x500 -javax.security.cert -javax.security.sasl -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.sql -javax.sql.rowset -javax.sql.rowset.serial -javax.sql.rowset.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.plaf.nimbus -javax.swing.plaf.synth -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.tools -javax.transaction -javax.transaction.xa -javax.xml.bind -javax.xml.bind.annotation -javax.xml.bind.annotation.adapters -javax.xml.bind.attachment -javax.xml.bind.helpers -javax.xml.bind.util -javax.xml.crypto -javax.xml.crypto.dom -javax.xml.crypto.dsig -javax.xml.crypto.dsig.dom -javax.xml.crypto.dsig.keyinfo -javax.xml.crypto.dsig.spec -javax.xml.datatype -javax.xml.namespace -javax.xml.parsers -javax.xml.soap -javax.xml.transform -javax.xml.transform.dom -javax.xml.transform.sax -javax.xml.transform.stax -javax.xml.transform.stream -javax.xml.validation -javax.xml.ws -javax.xml.ws.handler -javax.xml.ws.handler.soap -javax.xml.ws.http -javax.xml.ws.soap -javax.xml.ws.spi -javax.xml.ws.spi.http -javax.xml.ws.wsaddressing -javax.xml.xpath -org.ietf.jgss -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextExtPackage -org.omg.CosNaming.NamingContextPackage -org.omg.Dynamic -org.omg.DynamicAny -org.omg.DynamicAny.DynAnyFactoryPackage -org.omg.DynamicAny.DynAnyPackage -org.omg.IOP -org.omg.IOP.CodecFactoryPackage -org.omg.IOP.CodecPackage -org.omg.Messaging -org.omg.PortableInterceptor -org.omg.PortableInterceptor.ORBInitInfoPackage -org.omg.PortableServer -org.omg.PortableServer.CurrentPackage -org.omg.PortableServer.POAManagerPackage -org.omg.PortableServer.POAPackage -org.omg.PortableServer.portable -org.omg.PortableServer.ServantLocatorPackage -org.omg.SendingContext -org.omg.stub.java.rmi -org.w3c.dom -org.xml.sax -org.xml.sax.ext -org.xml.sax.helpers -AbstractAction -AbstractAnnotationValueVisitor6 -AbstractAnnotationValueVisitor7 -AbstractBorder -AbstractButton -AbstractCellEditor -AbstractCollection -AbstractColorChooserPanel -AbstractDocument -AbstractDocument.AttributeContext -AbstractDocument.Content -AbstractDocument.ElementEdit -AbstractElementVisitor6 -AbstractElementVisitor7 -AbstractExecutorService -AbstractInterruptibleChannel -AbstractLayoutCache -AbstractLayoutCache.NodeDimensions -AbstractList -AbstractListModel -AbstractMap -AbstractMap.SimpleEntry -AbstractMap.SimpleImmutableEntry -AbstractMarshallerImpl -AbstractMethodError -AbstractOwnableSynchronizer -AbstractPreferences -AbstractProcessor -AbstractQueue -AbstractQueuedLongSynchronizer -AbstractQueuedSynchronizer -AbstractRegionPainter -AbstractRegionPainter.PaintContext -AbstractRegionPainter.PaintContext.CacheMode -AbstractScriptEngine -AbstractSelectableChannel -AbstractSelectionKey -AbstractSelector -AbstractSequentialList -AbstractSet -AbstractSpinnerModel -AbstractTableModel -AbstractTypeVisitor6 -AbstractTypeVisitor7 -AbstractUndoableEdit -AbstractUnmarshallerImpl -AbstractWriter -AcceptPendingException -AccessControlContext -AccessControlException -AccessController -AccessDeniedException -AccessException -Accessible -AccessibleAction -AccessibleAttributeSequence -AccessibleBundle -AccessibleComponent -AccessibleContext -AccessibleEditableText -AccessibleExtendedComponent -AccessibleExtendedTable -AccessibleExtendedText -AccessibleHyperlink -AccessibleHypertext -AccessibleIcon -AccessibleKeyBinding -AccessibleObject -AccessibleRelation -AccessibleRelationSet -AccessibleResourceBundle -AccessibleRole -AccessibleSelection -AccessibleState -AccessibleStateSet -AccessibleStreamable -AccessibleTable -AccessibleTableModelChange -AccessibleText -AccessibleTextSequence -AccessibleValue -AccessMode -AccountException -AccountExpiredException -AccountLockedException -AccountNotFoundException -Acl -AclEntry -AclEntry -AclEntry.Builder -AclEntryFlag -AclEntryPermission -AclEntryType -AclFileAttributeView -AclNotFoundException -Action -Action -ActionEvent -ActionListener -ActionMap -ActionMapUIResource -Activatable -ActivateFailedException -ActivationDataFlavor -ActivationDesc -ActivationException -ActivationGroup -ActivationGroup_Stub -ActivationGroupDesc -ActivationGroupDesc.CommandEnvironment -ActivationGroupID -ActivationID -ActivationInstantiator -ActivationMonitor -ActivationSystem -Activator -ACTIVE -ActiveEvent -ACTIVITY_COMPLETED -ACTIVITY_REQUIRED -ActivityCompletedException -ActivityRequiredException -AdapterActivator -AdapterActivatorOperations -AdapterAlreadyExists -AdapterAlreadyExistsHelper -AdapterInactive -AdapterInactiveHelper -AdapterManagerIdHelper -AdapterNameHelper -AdapterNonExistent -AdapterNonExistentHelper -AdapterStateHelper -AddressHelper -Addressing -AddressingFeature -AddressingFeature.Responses -Adjustable -AdjustmentEvent -AdjustmentListener -Adler32 -AEADBadTagException -AffineTransform -AffineTransformOp -AlgorithmConstraints -AlgorithmMethod -AlgorithmParameterGenerator -AlgorithmParameterGeneratorSpi -AlgorithmParameters -AlgorithmParameterSpec -AlgorithmParametersSpi -AllPermission -AlphaComposite -AlreadyBound -AlreadyBoundException -AlreadyBoundException -AlreadyBoundHelper -AlreadyBoundHolder -AlreadyConnectedException -AncestorEvent -AncestorListener -AnnotatedElement -Annotation -Annotation -AnnotationFormatError -AnnotationMirror -AnnotationTypeMismatchException -AnnotationValue -AnnotationValueVisitor -Any -AnyHolder -AnySeqHelper -AnySeqHelper -AnySeqHolder -AppConfigurationEntry -AppConfigurationEntry.LoginModuleControlFlag -Appendable -Applet -AppletContext -AppletInitializer -AppletStub -ApplicationException -Arc2D -Arc2D.Double -Arc2D.Float -Area -AreaAveragingScaleFilter -ARG_IN -ARG_INOUT -ARG_OUT -ArithmeticException -Array -Array -ArrayBlockingQueue -ArrayDeque -ArrayIndexOutOfBoundsException -ArrayList -Arrays -ArrayStoreException -ArrayType -ArrayType -AssertionError -AsyncBoxView -AsyncHandler -AsynchronousByteChannel -AsynchronousChannel -AsynchronousChannelGroup -AsynchronousChannelProvider -AsynchronousCloseException -AsynchronousFileChannel -AsynchronousServerSocketChannel -AsynchronousSocketChannel -AtomicBoolean -AtomicInteger -AtomicIntegerArray -AtomicIntegerFieldUpdater -AtomicLong -AtomicLongArray -AtomicLongFieldUpdater -AtomicMarkableReference -AtomicMoveNotSupportedException -AtomicReference -AtomicReferenceArray -AtomicReferenceFieldUpdater -AtomicStampedReference -AttachmentMarshaller -AttachmentPart -AttachmentUnmarshaller -Attr -Attribute -Attribute -Attribute -Attribute -AttributeChangeNotification -AttributeChangeNotificationFilter -AttributedCharacterIterator -AttributedCharacterIterator.Attribute -AttributedString -AttributeException -AttributeInUseException -AttributeList -AttributeList -AttributeList -AttributeListImpl -AttributeModificationException -AttributeNotFoundException -Attributes -Attributes -Attributes -Attributes.Name -Attributes2 -Attributes2Impl -AttributeSet -AttributeSet -AttributeSet.CharacterAttribute -AttributeSet.ColorAttribute -AttributeSet.FontAttribute -AttributeSet.ParagraphAttribute -AttributeSetUtilities -AttributesImpl -AttributeValueExp -AttributeView -AudioClip -AudioFileFormat -AudioFileFormat.Type -AudioFileReader -AudioFileWriter -AudioFormat -AudioFormat.Encoding -AudioInputStream -AudioPermission -AudioSystem -AuthenticationException -AuthenticationException -AuthenticationNotSupportedException -Authenticator -Authenticator.RequestorType -AuthorizeCallback -AuthPermission -AuthProvider -AutoCloseable -Autoscroll -AWTError -AWTEvent -AWTEventListener -AWTEventListenerProxy -AWTEventMulticaster -AWTException -AWTKeyStroke -AWTPermission -BackingStoreException -BAD_CONTEXT -BAD_INV_ORDER -BAD_OPERATION -BAD_PARAM -BAD_POLICY -BAD_POLICY_TYPE -BAD_POLICY_VALUE -BAD_QOS -BAD_TYPECODE -BadAttributeValueExpException -BadBinaryOpValueExpException -BadKind -BadLocationException -BadPaddingException -BadStringOperationException -BandCombineOp -BandedSampleModel -BaseRowSet -BasicArrowButton -BasicAttribute -BasicAttributes -BasicBorders -BasicBorders.ButtonBorder -BasicBorders.FieldBorder -BasicBorders.MarginBorder -BasicBorders.MenuBarBorder -BasicBorders.RadioButtonBorder -BasicBorders.RolloverButtonBorder -BasicBorders.SplitPaneBorder -BasicBorders.ToggleButtonBorder -BasicButtonListener -BasicButtonUI -BasicCheckBoxMenuItemUI -BasicCheckBoxUI -BasicColorChooserUI -BasicComboBoxEditor -BasicComboBoxEditor.UIResource -BasicComboBoxRenderer -BasicComboBoxRenderer.UIResource -BasicComboBoxUI -BasicComboPopup -BasicControl -BasicDesktopIconUI -BasicDesktopPaneUI -BasicDirectoryModel -BasicEditorPaneUI -BasicFileAttributes -BasicFileAttributeView -BasicFileChooserUI -BasicFormattedTextFieldUI -BasicGraphicsUtils -BasicHTML -BasicIconFactory -BasicInternalFrameTitlePane -BasicInternalFrameUI -BasicLabelUI -BasicListUI -BasicLookAndFeel -BasicMenuBarUI -BasicMenuItemUI -BasicMenuUI -BasicOptionPaneUI -BasicOptionPaneUI.ButtonAreaLayout -BasicPanelUI -BasicPasswordFieldUI -BasicPermission -BasicPopupMenuSeparatorUI -BasicPopupMenuUI -BasicProgressBarUI -BasicRadioButtonMenuItemUI -BasicRadioButtonUI -BasicRootPaneUI -BasicScrollBarUI -BasicScrollPaneUI -BasicSeparatorUI -BasicSliderUI -BasicSpinnerUI -BasicSplitPaneDivider -BasicSplitPaneUI -BasicStroke -BasicTabbedPaneUI -BasicTableHeaderUI -BasicTableUI -BasicTextAreaUI -BasicTextFieldUI -BasicTextPaneUI -BasicTextUI -BasicTextUI.BasicCaret -BasicTextUI.BasicHighlighter -BasicToggleButtonUI -BasicToolBarSeparatorUI -BasicToolBarUI -BasicToolTipUI -BasicTreeUI -BasicViewportUI -BatchUpdateException -BeanContext -BeanContextChild -BeanContextChildComponentProxy -BeanContextChildSupport -BeanContextContainerProxy -BeanContextEvent -BeanContextMembershipEvent -BeanContextMembershipListener -BeanContextProxy -BeanContextServiceAvailableEvent -BeanContextServiceProvider -BeanContextServiceProviderBeanInfo -BeanContextServiceRevokedEvent -BeanContextServiceRevokedListener -BeanContextServices -BeanContextServicesListener -BeanContextServicesSupport -BeanContextServicesSupport.BCSSServiceProvider -BeanContextSupport -BeanContextSupport.BCSIterator -BeanDescriptor -BeanInfo -Beans -BevelBorder -Bidi -BigDecimal -BigInteger -BinaryRefAddr -Binder -BindException -Binding -Binding -Binding -BindingHelper -BindingHolder -BindingIterator -BindingIteratorHelper -BindingIteratorHolder -BindingIteratorOperations -BindingIteratorPOA -BindingListHelper -BindingListHolder -BindingProvider -Bindings -BindingType -BindingType -BindingTypeHelper -BindingTypeHolder -BitSet -Blob -BlockingDeque -BlockingQueue -BlockView -BMPImageWriteParam -Book -Boolean -BooleanControl -BooleanControl.Type -BooleanHolder -BooleanSeqHelper -BooleanSeqHolder -BootstrapMethodError -Border -BorderFactory -BorderLayout -BorderUIResource -BorderUIResource.BevelBorderUIResource -BorderUIResource.CompoundBorderUIResource -BorderUIResource.EmptyBorderUIResource -BorderUIResource.EtchedBorderUIResource -BorderUIResource.LineBorderUIResource -BorderUIResource.MatteBorderUIResource -BorderUIResource.TitledBorderUIResource -BoundedRangeModel -Bounds -Bounds -Box -Box.Filler -BoxedValueHelper -BoxLayout -BoxView -BreakIterator -BreakIteratorProvider -BrokenBarrierException -Buffer -BufferCapabilities -BufferCapabilities.FlipContents -BufferedImage -BufferedImageFilter -BufferedImageOp -BufferedInputStream -BufferedOutputStream -BufferedReader -BufferedWriter -BufferOverflowException -BufferPoolMXBean -BufferStrategy -BufferUnderflowException -Button -ButtonGroup -ButtonModel -ButtonUI -Byte -ByteArrayInputStream -ByteArrayOutputStream -ByteBuffer -ByteChannel -ByteHolder -ByteLookupTable -ByteOrder -C14NMethodParameterSpec -CachedRowSet -CacheRequest -CacheResponse -Calendar -Callable -CallableStatement -Callback -CallbackHandler -CallSite -CancelablePrintJob -CancellationException -CancelledKeyException -CannotProceed -CannotProceedException -CannotProceedHelper -CannotProceedHolder -CannotRedoException -CannotUndoException -CanonicalizationMethod -Canvas -CardLayout -Caret -CaretEvent -CaretListener -CDATASection -CellEditor -CellEditorListener -CellRendererPane -Certificate -Certificate -Certificate -Certificate.CertificateRep -CertificateEncodingException -CertificateEncodingException -CertificateException -CertificateException -CertificateExpiredException -CertificateExpiredException -CertificateFactory -CertificateFactorySpi -CertificateNotYetValidException -CertificateNotYetValidException -CertificateParsingException -CertificateParsingException -CertificateRevokedException -CertPath -CertPath.CertPathRep -CertPathBuilder -CertPathBuilderException -CertPathBuilderResult -CertPathBuilderSpi -CertPathParameters -CertPathTrustManagerParameters -CertPathValidator -CertPathValidatorException -CertPathValidatorException.BasicReason -CertPathValidatorException.Reason -CertPathValidatorResult -CertPathValidatorSpi -CertSelector -CertStore -CertStoreException -CertStoreParameters -CertStoreSpi -ChangedCharSetException -ChangeEvent -ChangeListener -Channel -ChannelBinding -Channels -Character -Character.Subset -Character.UnicodeBlock -Character.UnicodeScript -CharacterCodingException -CharacterData -CharacterIterator -Characters -CharArrayReader -CharArrayWriter -CharBuffer -CharConversionException -CharHolder -CharSeqHelper -CharSeqHolder -CharSequence -Charset -CharsetDecoder -CharsetEncoder -CharsetProvider -Checkbox -CheckboxGroup -CheckboxMenuItem -CheckedInputStream -CheckedOutputStream -Checksum -Choice -ChoiceCallback -ChoiceFormat -Chromaticity -Cipher -CipherInputStream -CipherOutputStream -CipherSpi -Class -ClassCastException -ClassCircularityError -ClassDefinition -ClassDesc -ClassFileTransformer -ClassFormatError -ClassLoader -ClassLoaderRepository -ClassLoadingMXBean -ClassNotFoundException -ClassValue -ClientInfoStatus -ClientRequestInfo -ClientRequestInfoOperations -ClientRequestInterceptor -ClientRequestInterceptorOperations -Clip -Clipboard -ClipboardOwner -Clob -Cloneable -CloneNotSupportedException -Closeable -ClosedByInterruptException -ClosedChannelException -ClosedDirectoryStreamException -ClosedFileSystemException -ClosedSelectorException -ClosedWatchServiceException -CMMException -Codec -CodecFactory -CodecFactoryHelper -CodecFactoryOperations -CodecOperations -CoderMalfunctionError -CoderResult -CODESET_INCOMPATIBLE -CodeSets -CodeSigner -CodeSource -CodingErrorAction -CollapsedStringAdapter -CollationElementIterator -CollationKey -Collator -CollatorProvider -Collection -CollectionCertStoreParameters -Collections -Color -ColorChooserComponentFactory -ColorChooserUI -ColorConvertOp -ColorModel -ColorSelectionModel -ColorSpace -ColorSupported -ColorType -ColorUIResource -ComboBoxEditor -ComboBoxModel -ComboBoxUI -ComboPopup -COMM_FAILURE -CommandInfo -CommandMap -CommandObject -Comment -Comment -CommonDataSource -CommunicationException -Comparable -Comparator -Compilable -CompilationMXBean -CompiledScript -Compiler -Completion -CompletionHandler -Completions -CompletionService -CompletionStatus -CompletionStatusHelper -Component -Component.BaselineResizeBehavior -ComponentAdapter -ComponentColorModel -ComponentEvent -ComponentIdHelper -ComponentInputMap -ComponentInputMapUIResource -ComponentListener -ComponentOrientation -ComponentSampleModel -ComponentUI -ComponentView -Composite -CompositeContext -CompositeData -CompositeDataInvocationHandler -CompositeDataSupport -CompositeDataView -CompositeName -CompositeType -CompositeView -CompoundBorder -CompoundControl -CompoundControl.Type -CompoundEdit -CompoundName -Compression -ConcurrentHashMap -ConcurrentLinkedDeque -ConcurrentLinkedQueue -ConcurrentMap -ConcurrentModificationException -ConcurrentNavigableMap -ConcurrentSkipListMap -ConcurrentSkipListSet -Condition -Configuration -Configuration.Parameters -ConfigurationException -ConfigurationSpi -ConfirmationCallback -ConnectException -ConnectException -ConnectIOException -Connection -ConnectionEvent -ConnectionEventListener -ConnectionPendingException -ConnectionPoolDataSource -Console -ConsoleHandler -ConstantCallSite -Constructor -ConstructorProperties -Container -ContainerAdapter -ContainerEvent -ContainerListener -ContainerOrderFocusTraversalPolicy -ContentHandler -ContentHandler -ContentHandlerFactory -ContentModel -Context -Context -ContextList -ContextNotEmptyException -ContextualRenderedImageFactory -Control -Control -Control.Type -ControlFactory -ControllerEventListener -ConvolveOp -CookieHandler -CookieHolder -CookieManager -CookiePolicy -CookieStore -Copies -CopiesSupported -CopyOnWriteArrayList -CopyOnWriteArraySet -CopyOption -CountDownLatch -CounterMonitor -CounterMonitorMBean -CRC32 -CredentialException -CredentialExpiredException -CredentialNotFoundException -CRL -CRLException -CRLReason -CRLSelector -CropImageFilter -CryptoPrimitive -CSS -CSS.Attribute -CTX_RESTRICT_SCOPE -CubicCurve2D -CubicCurve2D.Double -CubicCurve2D.Float -Currency -CurrencyNameProvider -Current -Current -Current -CurrentHelper -CurrentHelper -CurrentHelper -CurrentHolder -CurrentOperations -CurrentOperations -CurrentOperations -Cursor -Customizer -CustomMarshal -CustomValue -CyclicBarrier -Data -DATA_CONVERSION -DatabaseMetaData -DataBindingException -DataBuffer -DataBufferByte -DataBufferDouble -DataBufferFloat -DataBufferInt -DataBufferShort -DataBufferUShort -DataContentHandler -DataContentHandlerFactory -DataFlavor -DataFormatException -DatagramChannel -DatagramPacket -DatagramSocket -DatagramSocketImpl -DatagramSocketImplFactory -DataHandler -DataInput -DataInputStream -DataInputStream -DataLine -DataLine.Info -DataOutput -DataOutputStream -DataOutputStream -DataSource -DataSource -DataTruncation -DatatypeConfigurationException -DatatypeConstants -DatatypeConstants.Field -DatatypeConverter -DatatypeConverterInterface -DatatypeFactory -Date -Date -DateFormat -DateFormat.Field -DateFormatProvider -DateFormatSymbols -DateFormatSymbolsProvider -DateFormatter -DateTimeAtCompleted -DateTimeAtCreation -DateTimeAtProcessing -DateTimeSyntax -DebugGraphics -DecimalFormat -DecimalFormatSymbols -DecimalFormatSymbolsProvider -DeclaredType -DeclHandler -DefaultBoundedRangeModel -DefaultButtonModel -DefaultCaret -DefaultCellEditor -DefaultColorSelectionModel -DefaultComboBoxModel -DefaultDesktopManager -DefaultEditorKit -DefaultEditorKit.BeepAction -DefaultEditorKit.CopyAction -DefaultEditorKit.CutAction -DefaultEditorKit.DefaultKeyTypedAction -DefaultEditorKit.InsertBreakAction -DefaultEditorKit.InsertContentAction -DefaultEditorKit.InsertTabAction -DefaultEditorKit.PasteAction -DefaultFocusManager -DefaultFocusTraversalPolicy -DefaultFormatter -DefaultFormatterFactory -DefaultHandler -DefaultHandler2 -DefaultHighlighter -DefaultHighlighter.DefaultHighlightPainter -DefaultKeyboardFocusManager -DefaultListCellRenderer -DefaultListCellRenderer.UIResource -DefaultListModel -DefaultListSelectionModel -DefaultLoaderRepository -DefaultLoaderRepository -DefaultMenuLayout -DefaultMetalTheme -DefaultMutableTreeNode -DefaultPersistenceDelegate -DefaultRowSorter -DefaultRowSorter.ModelWrapper -DefaultSingleSelectionModel -DefaultStyledDocument -DefaultStyledDocument.AttributeUndoableEdit -DefaultStyledDocument.ElementSpec -DefaultTableCellRenderer -DefaultTableCellRenderer.UIResource -DefaultTableColumnModel -DefaultTableModel -DefaultTextUI -DefaultTreeCellEditor -DefaultTreeCellRenderer -DefaultTreeModel -DefaultTreeSelectionModel -DefaultValidationEventHandler -DefinitionKind -DefinitionKindHelper -Deflater -DeflaterInputStream -DeflaterOutputStream -Delayed -DelayQueue -Delegate -Delegate -Delegate -DelegationPermission -Deprecated -Deque -Descriptor -DescriptorAccess -DescriptorKey -DescriptorRead -DescriptorSupport -DESedeKeySpec -DesignMode -DESKeySpec -Desktop -Desktop.Action -DesktopIconUI -DesktopManager -DesktopPaneUI -Destination -Destroyable -DestroyFailedException -Detail -DetailEntry -DGC -DHGenParameterSpec -DHKey -DHParameterSpec -DHPrivateKey -DHPrivateKeySpec -DHPublicKey -DHPublicKeySpec -Diagnostic -Diagnostic.Kind -DiagnosticCollector -DiagnosticListener -Dialog -Dialog.ModalExclusionType -Dialog.ModalityType -DialogTypeSelection -Dictionary -DigestException -DigestInputStream -DigestMethod -DigestMethodParameterSpec -DigestOutputStream -Dimension -Dimension2D -DimensionUIResource -DirContext -DirectColorModel -DirectoryIteratorException -DirectoryManager -DirectoryNotEmptyException -DirectoryStream -DirectoryStream.Filter -DirObjectFactory -DirStateFactory -DirStateFactory.Result -DISCARDING -Dispatch -DisplayMode -DnDConstants -Doc -DocAttribute -DocAttributeSet -DocFlavor -DocFlavor.BYTE_ARRAY -DocFlavor.CHAR_ARRAY -DocFlavor.INPUT_STREAM -DocFlavor.READER -DocFlavor.SERVICE_FORMATTED -DocFlavor.STRING -DocFlavor.URL -DocPrintJob -Document -Document -DocumentBuilder -DocumentBuilderFactory -Documented -DocumentEvent -DocumentEvent -DocumentEvent.ElementChange -DocumentEvent.EventType -DocumentFilter -DocumentFilter.FilterBypass -DocumentFragment -DocumentHandler -DocumentListener -DocumentName -DocumentParser -DocumentType -DomainCombiner -DomainManager -DomainManagerOperations -DOMConfiguration -DOMCryptoContext -DOMError -DOMErrorHandler -DOMException -DomHandler -DOMImplementation -DOMImplementationList -DOMImplementationLS -DOMImplementationRegistry -DOMImplementationSource -DOMLocator -DOMLocator -DOMResult -DOMSignContext -DOMSource -DOMStringList -DOMStructure -DOMURIReference -DOMValidateContext -DosFileAttributes -DosFileAttributeView -Double -DoubleBuffer -DoubleHolder -DoubleSeqHelper -DoubleSeqHolder -DragGestureEvent -DragGestureListener -DragGestureRecognizer -DragSource -DragSourceAdapter -DragSourceContext -DragSourceDragEvent -DragSourceDropEvent -DragSourceEvent -DragSourceListener -DragSourceMotionListener -Driver -DriverManager -DriverPropertyInfo -DropMode -DropTarget -DropTarget.DropTargetAutoScroller -DropTargetAdapter -DropTargetContext -DropTargetDragEvent -DropTargetDropEvent -DropTargetEvent -DropTargetListener -DSAKey -DSAKeyPairGenerator -DSAParameterSpec -DSAParams -DSAPrivateKey -DSAPrivateKeySpec -DSAPublicKey -DSAPublicKeySpec -DTD -DTD -DTDConstants -DTDHandler -DuplicateFormatFlagsException -DuplicateName -DuplicateNameHelper -Duration -DynamicImplementation -DynamicImplementation -DynamicMBean -DynAny -DynAny -DynAnyFactory -DynAnyFactoryHelper -DynAnyFactoryOperations -DynAnyHelper -DynAnyOperations -DynAnySeqHelper -DynArray -DynArray -DynArrayHelper -DynArrayOperations -DynEnum -DynEnum -DynEnumHelper -DynEnumOperations -DynFixed -DynFixed -DynFixedHelper -DynFixedOperations -DynSequence -DynSequence -DynSequenceHelper -DynSequenceOperations -DynStruct -DynStruct -DynStructHelper -DynStructOperations -DynUnion -DynUnion -DynUnionHelper -DynUnionOperations -DynValue -DynValue -DynValueBox -DynValueBoxOperations -DynValueCommon -DynValueCommonOperations -DynValueHelper -DynValueOperations -ECField -ECFieldF2m -ECFieldFp -ECGenParameterSpec -ECKey -ECParameterSpec -ECPoint -ECPrivateKey -ECPrivateKeySpec -ECPublicKey -ECPublicKeySpec -EditorKit -Element -Element -Element -Element -Element -ElementFilter -ElementIterator -ElementKind -ElementKindVisitor6 -ElementKindVisitor7 -Elements -ElementScanner6 -ElementScanner7 -ElementType -ElementVisitor -Ellipse2D -Ellipse2D.Double -Ellipse2D.Float -EllipticCurve -EmptyBorder -EmptyStackException -EncodedKeySpec -Encoder -Encoding -ENCODING_CDR_ENCAPS -EncryptedPrivateKeyInfo -EndDocument -EndElement -Endpoint -EndpointContext -EndpointReference -Entity -Entity -EntityDeclaration -EntityReference -EntityReference -EntityResolver -EntityResolver2 -Enum -EnumConstantNotPresentException -EnumControl -EnumControl.Type -Enumeration -EnumMap -EnumSet -EnumSyntax -Environment -EOFException -Error -ErrorHandler -ErrorListener -ErrorManager -ErrorType -EtchedBorder -Event -Event -EventContext -EventDirContext -EventException -EventFilter -EventHandler -EventListener -EventListener -EventListenerList -EventListenerProxy -EventObject -EventQueue -EventReaderDelegate -EventSetDescriptor -EventTarget -ExcC14NParameterSpec -Exception -ExceptionDetailMessage -ExceptionInInitializerError -ExceptionList -ExceptionListener -Exchanger -ExecutableElement -ExecutableType -ExecutionException -Executor -ExecutorCompletionService -Executors -ExecutorService -ExemptionMechanism -ExemptionMechanismException -ExemptionMechanismSpi -ExpandVetoException -ExportException -Expression -ExtendedRequest -ExtendedResponse -ExtendedSSLSession -Extension -Externalizable -FactoryConfigurationError -FactoryConfigurationError -FailedLoginException -FaultAction -FeatureDescriptor -Fidelity -Field -FieldNameHelper -FieldNameHelper -FieldPosition -FieldView -File -FileAlreadyExistsException -FileAttribute -FileAttributeView -FileCacheImageInputStream -FileCacheImageOutputStream -FileChannel -FileChannel.MapMode -FileChooserUI -FileDataSource -FileDescriptor -FileDialog -FileFilter -FileFilter -FileHandler -FileImageInputStream -FileImageOutputStream -FileInputStream -FileLock -FileLockInterruptionException -FileNameExtensionFilter -FilenameFilter -FileNameMap -FileNotFoundException -FileObject -FileOutputStream -FileOwnerAttributeView -FilePermission -Filer -FileReader -FilerException -Files -FileStore -FileStoreAttributeView -FileSystem -FileSystemAlreadyExistsException -FileSystemException -FileSystemLoopException -FileSystemNotFoundException -FileSystemProvider -FileSystems -FileSystemView -FileTime -FileTypeDetector -FileTypeMap -FileView -FileVisitOption -FileVisitor -FileVisitResult -FileWriter -Filter -FilteredImageSource -FilteredRowSet -FilterInputStream -FilterOutputStream -FilterReader -FilterWriter -Finishings -FixedHeightLayoutCache -FixedHolder -FlatteningPathIterator -FlavorEvent -FlavorException -FlavorListener -FlavorMap -FlavorTable -Float -FloatBuffer -FloatControl -FloatControl.Type -FloatHolder -FloatSeqHelper -FloatSeqHolder -FlowLayout -FlowView -FlowView.FlowStrategy -Flushable -FocusAdapter -FocusEvent -FocusListener -FocusManager -FocusTraversalPolicy -Font -FontFormatException -FontMetrics -FontRenderContext -FontUIResource -ForkJoinPool -ForkJoinPool.ForkJoinWorkerThreadFactory -ForkJoinPool.ManagedBlocker -ForkJoinTask -ForkJoinWorkerThread -Format -Format.Field -FormatConversionProvider -FormatFlagsConversionMismatchException -FormatMismatch -FormatMismatchHelper -Formattable -FormattableFlags -Formatter -Formatter -Formatter.BigDecimalLayoutForm -FormatterClosedException -FormSubmitEvent -FormSubmitEvent.MethodType -FormView -ForwardingFileObject -ForwardingJavaFileManager -ForwardingJavaFileObject -ForwardRequest -ForwardRequest -ForwardRequestHelper -ForwardRequestHelper -Frame -FREE_MEM -Future -FutureTask -GapContent -GarbageCollectorMXBean -GatheringByteChannel -GaugeMonitor -GaugeMonitorMBean -GCMParameterSpec -GeneralPath -GeneralSecurityException -Generated -GenericArrayType -GenericDeclaration -GenericSignatureFormatError -GlyphJustificationInfo -GlyphMetrics -GlyphVector -GlyphView -GlyphView.GlyphPainter -GradientPaint -GraphicAttribute -Graphics -Graphics2D -GraphicsConfigTemplate -GraphicsConfiguration -GraphicsDevice -GraphicsDevice.WindowTranslucency -GraphicsEnvironment -GrayFilter -GregorianCalendar -GridBagConstraints -GridBagLayout -GridBagLayoutInfo -GridLayout -Group -GroupLayout -GroupLayout.Alignment -GroupPrincipal -GSSContext -GSSCredential -GSSException -GSSManager -GSSName -Guard -GuardedObject -GZIPInputStream -GZIPOutputStream -Handler -Handler -HandlerBase -HandlerChain -HandlerResolver -HandshakeCompletedEvent -HandshakeCompletedListener -HasControls -HashAttributeSet -HashDocAttributeSet -HashMap -HashPrintJobAttributeSet -HashPrintRequestAttributeSet -HashPrintServiceAttributeSet -HashSet -Hashtable -HeadlessException -HexBinaryAdapter -HierarchyBoundsAdapter -HierarchyBoundsListener -HierarchyEvent -HierarchyListener -Highlighter -Highlighter.Highlight -Highlighter.HighlightPainter -HMACParameterSpec -Holder -HOLDING -HostnameVerifier -HTML -HTML.Attribute -HTML.Tag -HTML.UnknownTag -HTMLDocument -HTMLDocument.Iterator -HTMLEditorKit -HTMLEditorKit.HTMLFactory -HTMLEditorKit.HTMLTextAction -HTMLEditorKit.InsertHTMLTextAction -HTMLEditorKit.LinkController -HTMLEditorKit.Parser -HTMLEditorKit.ParserCallback -HTMLFrameHyperlinkEvent -HTMLWriter -HTTPBinding -HttpContext -HttpCookie -HTTPException -HttpExchange -HttpHandler -HttpRetryException -HttpsURLConnection -HttpURLConnection -HyperlinkEvent -HyperlinkEvent.EventType -HyperlinkListener -ICC_ColorSpace -ICC_Profile -ICC_ProfileGray -ICC_ProfileRGB -Icon -IconUIResource -IconView -ID_ASSIGNMENT_POLICY_ID -ID_UNIQUENESS_POLICY_ID -IdAssignmentPolicy -IdAssignmentPolicyOperations -IdAssignmentPolicyValue -IdentifierHelper -Identity -IdentityHashMap -IdentityScope -IDLEntity -IDLType -IDLTypeHelper -IDLTypeOperations -IDN -IdUniquenessPolicy -IdUniquenessPolicyOperations -IdUniquenessPolicyValue -IIOByteBuffer -IIOException -IIOImage -IIOInvalidTreeException -IIOMetadata -IIOMetadataController -IIOMetadataFormat -IIOMetadataFormatImpl -IIOMetadataNode -IIOParam -IIOParamController -IIOReadProgressListener -IIOReadUpdateListener -IIOReadWarningListener -IIORegistry -IIOServiceProvider -IIOWriteProgressListener -IIOWriteWarningListener -IllegalAccessError -IllegalAccessException -IllegalArgumentException -IllegalBlockingModeException -IllegalBlockSizeException -IllegalChannelGroupException -IllegalCharsetNameException -IllegalClassFormatException -IllegalComponentStateException -IllegalFormatCodePointException -IllegalFormatConversionException -IllegalFormatException -IllegalFormatFlagsException -IllegalFormatPrecisionException -IllegalFormatWidthException -IllegalMonitorStateException -IllegalPathStateException -IllegalSelectorException -IllegalStateException -IllegalThreadStateException -IllformedLocaleException -Image -ImageCapabilities -ImageConsumer -ImageFilter -ImageGraphicAttribute -ImageIcon -ImageInputStream -ImageInputStreamImpl -ImageInputStreamSpi -ImageIO -ImageObserver -ImageOutputStream -ImageOutputStreamImpl -ImageOutputStreamSpi -ImageProducer -ImageReader -ImageReaderSpi -ImageReaderWriterSpi -ImageReadParam -ImageTranscoder -ImageTranscoderSpi -ImageTypeSpecifier -ImageView -ImageWriteParam -ImageWriter -ImageWriterSpi -ImagingOpException -ImmutableDescriptor -IMP_LIMIT -IMPLICIT_ACTIVATION_POLICY_ID -ImplicitActivationPolicy -ImplicitActivationPolicyOperations -ImplicitActivationPolicyValue -INACTIVE -IncompatibleClassChangeError -IncompleteAnnotationException -InconsistentTypeCode -InconsistentTypeCode -InconsistentTypeCodeHelper -IndexColorModel -IndexedPropertyChangeEvent -IndexedPropertyDescriptor -IndexOutOfBoundsException -IndirectionException -Inet4Address -Inet6Address -InetAddress -InetSocketAddress -Inflater -InflaterInputStream -InflaterOutputStream -InheritableThreadLocal -Inherited -InitialContext -InitialContextFactory -InitialContextFactoryBuilder -InitialDirContext -INITIALIZE -InitialLdapContext -InitParam -InlineView -InputContext -InputEvent -InputMap -InputMapUIResource -InputMethod -InputMethodContext -InputMethodDescriptor -InputMethodEvent -InputMethodHighlight -InputMethodListener -InputMethodRequests -InputMismatchException -InputSource -InputStream -InputStream -InputStream -InputStreamReader -InputSubset -InputVerifier -Insets -InsetsUIResource -InstanceAlreadyExistsException -InstanceNotFoundException -InstantiationError -InstantiationException -Instrument -Instrumentation -InsufficientResourcesException -IntBuffer -Integer -IntegerSyntax -Interceptor -InterceptorOperations -InterfaceAddress -INTERNAL -InternalError -InternalFrameAdapter -InternalFrameEvent -InternalFrameFocusTraversalPolicy -InternalFrameListener -InternalFrameUI -InternationalFormatter -InterruptedByTimeoutException -InterruptedException -InterruptedIOException -InterruptedNamingException -InterruptibleChannel -INTF_REPOS -IntHolder -IntrospectionException -IntrospectionException -Introspector -INV_FLAG -INV_IDENT -INV_OBJREF -INV_POLICY -Invalid -INVALID_ACTIVITY -INVALID_TRANSACTION -InvalidActivityException -InvalidAddress -InvalidAddressHelper -InvalidAddressHolder -InvalidAlgorithmParameterException -InvalidApplicationException -InvalidAttributeIdentifierException -InvalidAttributesException -InvalidAttributeValueException -InvalidAttributeValueException -InvalidClassException -InvalidDnDOperationException -InvalidKeyException -InvalidKeyException -InvalidKeySpecException -InvalidMarkException -InvalidMidiDataException -InvalidName -InvalidName -InvalidName -InvalidNameException -InvalidNameHelper -InvalidNameHelper -InvalidNameHolder -InvalidObjectException -InvalidOpenTypeException -InvalidParameterException -InvalidParameterSpecException -InvalidPathException -InvalidPolicy -InvalidPolicyHelper -InvalidPreferencesFormatException -InvalidPropertiesFormatException -InvalidRelationIdException -InvalidRelationServiceException -InvalidRelationTypeException -InvalidRoleInfoException -InvalidRoleValueException -InvalidSearchControlsException -InvalidSearchFilterException -InvalidSeq -InvalidSlot -InvalidSlotHelper -InvalidTargetObjectTypeException -InvalidTransactionException -InvalidTypeForEncoding -InvalidTypeForEncodingHelper -InvalidValue -InvalidValue -InvalidValueHelper -Invocable -InvocationEvent -InvocationHandler -InvocationTargetException -InvokeHandler -Invoker -IOError -IOException -IOR -IORHelper -IORHolder -IORInfo -IORInfoOperations -IORInterceptor -IORInterceptor_3_0 -IORInterceptor_3_0Helper -IORInterceptor_3_0Holder -IORInterceptor_3_0Operations -IORInterceptorOperations -IRObject -IRObjectOperations -IstringHelper -ItemEvent -ItemListener -ItemSelectable -Iterable -Iterator -IvParameterSpec -JApplet -JarEntry -JarException -JarFile -JarInputStream -JarOutputStream -JarURLConnection -JavaCompiler -JavaCompiler.CompilationTask -JavaFileManager -JavaFileManager.Location -JavaFileObject -JavaFileObject.Kind -JAXB -JAXBContext -JAXBElement -JAXBElement.GlobalScope -JAXBException -JAXBIntrospector -JAXBPermission -JAXBResult -JAXBSource -JButton -JCheckBox -JCheckBoxMenuItem -JColorChooser -JComboBox -JComboBox.KeySelectionManager -JComponent -JdbcRowSet -JDesktopPane -JDialog -JEditorPane -JFileChooser -JFormattedTextField -JFormattedTextField.AbstractFormatter -JFormattedTextField.AbstractFormatterFactory -JFrame -JInternalFrame -JInternalFrame.JDesktopIcon -JLabel -JLayer -JLayeredPane -JList -JList.DropLocation -JMenu -JMenuBar -JMenuItem -JMException -JMRuntimeException -JMX -JMXAddressable -JMXAuthenticator -JMXConnectionNotification -JMXConnector -JMXConnectorFactory -JMXConnectorProvider -JMXConnectorServer -JMXConnectorServerFactory -JMXConnectorServerMBean -JMXConnectorServerProvider -JMXPrincipal -JMXProviderException -JMXServerErrorException -JMXServiceURL -JobAttributes -JobAttributes.DefaultSelectionType -JobAttributes.DestinationType -JobAttributes.DialogType -JobAttributes.MultipleDocumentHandlingType -JobAttributes.SidesType -JobHoldUntil -JobImpressions -JobImpressionsCompleted -JobImpressionsSupported -JobKOctets -JobKOctetsProcessed -JobKOctetsSupported -JobMediaSheets -JobMediaSheetsCompleted -JobMediaSheetsSupported -JobMessageFromOperator -JobName -JobOriginatingUserName -JobPriority -JobPrioritySupported -JobSheets -JobState -JobStateReason -JobStateReasons -Joinable -JoinRowSet -JOptionPane -JPanel -JPasswordField -JPEGHuffmanTable -JPEGImageReadParam -JPEGImageWriteParam -JPEGQTable -JPopupMenu -JPopupMenu.Separator -JProgressBar -JRadioButton -JRadioButtonMenuItem -JRootPane -JScrollBar -JScrollPane -JSeparator -JSlider -JSpinner -JSpinner.DateEditor -JSpinner.DefaultEditor -JSpinner.ListEditor -JSpinner.NumberEditor -JSplitPane -JTabbedPane -JTable -JTable.DropLocation -JTable.PrintMode -JTableHeader -JTextArea -JTextComponent -JTextComponent.DropLocation -JTextComponent.KeyBinding -JTextField -JTextPane -JToggleButton -JToggleButton.ToggleButtonModel -JToolBar -JToolBar.Separator -JToolTip -JTree -JTree.DropLocation -JTree.DynamicUtilTreeNode -JTree.EmptySelectionModel -JViewport -JWindow -KerberosKey -KerberosPrincipal -KerberosTicket -Kernel -Key -KeyAdapter -KeyAgreement -KeyAgreementSpi -KeyAlreadyExistsException -KeyboardFocusManager -KeyEvent -KeyEventDispatcher -KeyEventPostProcessor -KeyException -KeyFactory -KeyFactorySpi -KeyGenerator -KeyGeneratorSpi -KeyInfo -KeyInfoFactory -KeyListener -KeyManagementException -KeyManager -KeyManagerFactory -KeyManagerFactorySpi -Keymap -KeyName -KeyPair -KeyPairGenerator -KeyPairGeneratorSpi -KeyRep -KeyRep.Type -KeySelector -KeySelector.Purpose -KeySelectorException -KeySelectorResult -KeySpec -KeyStore -KeyStore.Builder -KeyStore.CallbackHandlerProtection -KeyStore.Entry -KeyStore.LoadStoreParameter -KeyStore.PasswordProtection -KeyStore.PrivateKeyEntry -KeyStore.ProtectionParameter -KeyStore.SecretKeyEntry -KeyStore.TrustedCertificateEntry -KeyStoreBuilderParameters -KeyStoreException -KeyStoreSpi -KeyStroke -KeyTab -KeyValue -Label -LabelUI -LabelView -LanguageCallback -LastOwnerException -LayeredHighlighter -LayeredHighlighter.LayerPainter -LayerUI -LayoutFocusTraversalPolicy -LayoutManager -LayoutManager2 -LayoutPath -LayoutQueue -LayoutStyle -LayoutStyle.ComponentPlacement -LDAPCertStoreParameters -LdapContext -LdapName -LdapReferralException -Lease -Level -LexicalHandler -LIFESPAN_POLICY_ID -LifespanPolicy -LifespanPolicyOperations -LifespanPolicyValue -LimitExceededException -Line -Line.Info -Line2D -Line2D.Double -Line2D.Float -LinearGradientPaint -LineBorder -LineBreakMeasurer -LineEvent -LineEvent.Type -LineListener -LineMetrics -LineNumberInputStream -LineNumberReader -LineUnavailableException -LinkageError -LinkedBlockingDeque -LinkedBlockingQueue -LinkedHashMap -LinkedHashSet -LinkedList -LinkedTransferQueue -LinkException -LinkLoopException -LinkOption -LinkPermission -LinkRef -List -List -ListCellRenderer -ListDataEvent -ListDataListener -ListenerNotFoundException -ListIterator -ListModel -ListResourceBundle -ListSelectionEvent -ListSelectionListener -ListSelectionModel -ListUI -ListView -LoaderHandler -Locale -Locale.Builder -Locale.Category -LocaleNameProvider -LocaleServiceProvider -LocalObject -LocateRegistry -Location -LOCATION_FORWARD -Locator -Locator2 -Locator2Impl -LocatorImpl -Lock -LockInfo -LockSupport -Logger -LoggingMXBean -LoggingPermission -LogicalHandler -LogicalMessage -LogicalMessageContext -LoginContext -LoginException -LoginModule -LogManager -LogRecord -LogStream -Long -LongBuffer -LongHolder -LongLongSeqHelper -LongLongSeqHolder -LongSeqHelper -LongSeqHolder -LookAndFeel -LookupOp -LookupTable -LSException -LSInput -LSLoadEvent -LSOutput -LSParser -LSParserFilter -LSProgressEvent -LSResourceResolver -LSSerializer -LSSerializerFilter -Mac -MacSpi -MailcapCommandMap -MalformedInputException -MalformedLinkException -MalformedObjectNameException -MalformedParameterizedTypeException -MalformedURLException -ManagementFactory -ManagementPermission -ManageReferralControl -ManagerFactoryParameters -Manifest -Manifest -Map -Map.Entry -MappedByteBuffer -MARSHAL -MarshalException -MarshalException -MarshalException -MarshalledObject -Marshaller -Marshaller.Listener -MaskFormatter -Matcher -MatchResult -Math -MathContext -MatteBorder -MBeanAttributeInfo -MBeanConstructorInfo -MBeanException -MBeanFeatureInfo -MBeanInfo -MBeanNotificationInfo -MBeanOperationInfo -MBeanParameterInfo -MBeanPermission -MBeanRegistration -MBeanRegistrationException -MBeanServer -MBeanServerBuilder -MBeanServerConnection -MBeanServerDelegate -MBeanServerDelegateMBean -MBeanServerFactory -MBeanServerForwarder -MBeanServerInvocationHandler -MBeanServerNotification -MBeanServerNotificationFilter -MBeanServerPermission -MBeanTrustPermission -Media -MediaName -MediaPrintableArea -MediaSize -MediaSize.Engineering -MediaSize.ISO -MediaSize.JIS -MediaSize.NA -MediaSize.Other -MediaSizeName -MediaTracker -MediaTray -Member -MembershipKey -MemoryCacheImageInputStream -MemoryCacheImageOutputStream -MemoryHandler -MemoryImageSource -MemoryManagerMXBean -MemoryMXBean -MemoryNotificationInfo -MemoryPoolMXBean -MemoryType -MemoryUsage -Menu -MenuBar -MenuBarUI -MenuComponent -MenuContainer -MenuDragMouseEvent -MenuDragMouseListener -MenuElement -MenuEvent -MenuItem -MenuItemUI -MenuKeyEvent -MenuKeyListener -MenuListener -MenuSelectionManager -MenuShortcut -MessageContext -MessageContext.Scope -MessageDigest -MessageDigestSpi -MessageFactory -MessageFormat -MessageFormat.Field -MessageProp -Messager -MetaEventListener -MetalBorders -MetalBorders.ButtonBorder -MetalBorders.Flush3DBorder -MetalBorders.InternalFrameBorder -MetalBorders.MenuBarBorder -MetalBorders.MenuItemBorder -MetalBorders.OptionDialogBorder -MetalBorders.PaletteBorder -MetalBorders.PopupMenuBorder -MetalBorders.RolloverButtonBorder -MetalBorders.ScrollPaneBorder -MetalBorders.TableHeaderBorder -MetalBorders.TextFieldBorder -MetalBorders.ToggleButtonBorder -MetalBorders.ToolBarBorder -MetalButtonUI -MetalCheckBoxIcon -MetalCheckBoxUI -MetalComboBoxButton -MetalComboBoxEditor -MetalComboBoxEditor.UIResource -MetalComboBoxIcon -MetalComboBoxUI -MetalDesktopIconUI -MetalFileChooserUI -MetalIconFactory -MetalIconFactory.FileIcon16 -MetalIconFactory.FolderIcon16 -MetalIconFactory.PaletteCloseIcon -MetalIconFactory.TreeControlIcon -MetalIconFactory.TreeFolderIcon -MetalIconFactory.TreeLeafIcon -MetalInternalFrameTitlePane -MetalInternalFrameUI -MetalLabelUI -MetalLookAndFeel -MetalMenuBarUI -MetalPopupMenuSeparatorUI -MetalProgressBarUI -MetalRadioButtonUI -MetalRootPaneUI -MetalScrollBarUI -MetalScrollButton -MetalScrollPaneUI -MetalSeparatorUI -MetalSliderUI -MetalSplitPaneUI -MetalTabbedPaneUI -MetalTextFieldUI -MetalTheme -MetalToggleButtonUI -MetalToolBarUI -MetalToolTipUI -MetalTreeUI -MetaMessage -Method -MethodDescriptor -MethodHandle -MethodHandleProxies -MethodHandles -MethodHandles.Lookup -MethodType -MGF1ParameterSpec -MidiChannel -MidiDevice -MidiDevice.Info -MidiDeviceProvider -MidiDeviceReceiver -MidiDeviceTransmitter -MidiEvent -MidiFileFormat -MidiFileReader -MidiFileWriter -MidiMessage -MidiSystem -MidiUnavailableException -MimeHeader -MimeHeaders -MimeType -MimeTypeParameterList -MimeTypeParseException -MimeTypeParseException -MimetypesFileTypeMap -MinimalHTMLWriter -MirroredTypeException -MirroredTypesException -MissingFormatArgumentException -MissingFormatWidthException -MissingResourceException -Mixer -Mixer.Info -MixerProvider -MLet -MLetContent -MLetMBean -ModelMBean -ModelMBeanAttributeInfo -ModelMBeanConstructorInfo -ModelMBeanInfo -ModelMBeanInfoSupport -ModelMBeanNotificationBroadcaster -ModelMBeanNotificationInfo -ModelMBeanOperationInfo -ModificationItem -Modifier -Modifier -Monitor -MonitorInfo -MonitorMBean -MonitorNotification -MonitorSettingException -MouseAdapter -MouseDragGestureRecognizer -MouseEvent -MouseEvent -MouseInfo -MouseInputAdapter -MouseInputListener -MouseListener -MouseMotionAdapter -MouseMotionListener -MouseWheelEvent -MouseWheelListener -MTOM -MTOMFeature -MultiButtonUI -MulticastChannel -MulticastSocket -MultiColorChooserUI -MultiComboBoxUI -MultiDesktopIconUI -MultiDesktopPaneUI -MultiDoc -MultiDocPrintJob -MultiDocPrintService -MultiFileChooserUI -MultiInternalFrameUI -MultiLabelUI -MultiListUI -MultiLookAndFeel -MultiMenuBarUI -MultiMenuItemUI -MultiOptionPaneUI -MultiPanelUI -MultiPixelPackedSampleModel -MultipleComponentProfileHelper -MultipleComponentProfileHolder -MultipleDocumentHandling -MultipleGradientPaint -MultipleGradientPaint.ColorSpaceType -MultipleGradientPaint.CycleMethod -MultipleMaster -MultiPopupMenuUI -MultiProgressBarUI -MultiRootPaneUI -MultiScrollBarUI -MultiScrollPaneUI -MultiSeparatorUI -MultiSliderUI -MultiSpinnerUI -MultiSplitPaneUI -MultiTabbedPaneUI -MultiTableHeaderUI -MultiTableUI -MultiTextUI -MultiToolBarUI -MultiToolTipUI -MultiTreeUI -MultiViewportUI -MutableAttributeSet -MutableCallSite -MutableComboBoxModel -MutableTreeNode -MutationEvent -MXBean -Name -Name -Name -NameAlreadyBoundException -NameCallback -NameClassPair -NameComponent -NameComponentHelper -NameComponentHolder -NamedNodeMap -NamedValue -NameDynAnyPair -NameDynAnyPairHelper -NameDynAnyPairSeqHelper -NameHelper -NameHolder -NameList -NameNotFoundException -NameParser -Namespace -NamespaceChangeListener -NamespaceContext -NamespaceSupport -NameValuePair -NameValuePair -NameValuePairHelper -NameValuePairHelper -NameValuePairSeqHelper -Naming -NamingContext -NamingContextExt -NamingContextExtHelper -NamingContextExtHolder -NamingContextExtOperations -NamingContextExtPOA -NamingContextHelper -NamingContextHolder -NamingContextOperations -NamingContextPOA -NamingEnumeration -NamingEvent -NamingException -NamingExceptionEvent -NamingListener -NamingManager -NamingSecurityException -NavigableMap -NavigableSet -NavigationFilter -NavigationFilter.FilterBypass -NClob -NegativeArraySizeException -NestingKind -NetPermission -NetworkChannel -NetworkInterface -NimbusLookAndFeel -NimbusStyle -NO_IMPLEMENT -NO_MEMORY -NO_PERMISSION -NO_RESOURCES -NO_RESPONSE -NoClassDefFoundError -NoConnectionPendingException -NoContext -NoContextHelper -Node -Node -NodeChangeEvent -NodeChangeListener -NodeList -NodeSetData -NoInitialContextException -NON_EXISTENT -NoninvertibleTransformException -NonReadableChannelException -NonWritableChannelException -NoPermissionException -NormalizedStringAdapter -Normalizer -Normalizer.Form -NoRouteToHostException -NoServant -NoServantHelper -NoSuchAlgorithmException -NoSuchAttributeException -NoSuchElementException -NoSuchFieldError -NoSuchFieldException -NoSuchFileException -NoSuchMechanismException -NoSuchMethodError -NoSuchMethodException -NoSuchObjectException -NoSuchPaddingException -NoSuchProviderException -NotActiveException -Notation -NotationDeclaration -NotBoundException -NotCompliantMBeanException -NotContextException -NotDirectoryException -NotEmpty -NotEmptyHelper -NotEmptyHolder -NotFound -NotFoundHelper -NotFoundHolder -NotFoundReason -NotFoundReasonHelper -NotFoundReasonHolder -NotIdentifiableEvent -NotIdentifiableEventImpl -Notification -NotificationBroadcaster -NotificationBroadcasterSupport -NotificationEmitter -NotificationFilter -NotificationFilterSupport -NotificationListener -NotificationResult -NotLinkException -NotOwnerException -NotSerializableException -NotYetBoundException -NotYetConnectedException -NoType -NullCipher -NullPointerException -NullType -Number -NumberFormat -NumberFormat.Field -NumberFormatException -NumberFormatProvider -NumberFormatter -NumberOfDocuments -NumberOfInterveningJobs -NumberUp -NumberUpSupported -NumericShaper -NumericShaper.Range -NVList -OAEPParameterSpec -OBJ_ADAPTER -Object -Object -OBJECT_NOT_EXIST -ObjectAlreadyActive -ObjectAlreadyActiveHelper -ObjectChangeListener -ObjectFactory -ObjectFactoryBuilder -ObjectHelper -ObjectHolder -ObjectIdHelper -ObjectIdHelper -ObjectImpl -ObjectImpl -ObjectInput -ObjectInputStream -ObjectInputStream.GetField -ObjectInputValidation -ObjectInstance -ObjectName -ObjectNotActive -ObjectNotActiveHelper -ObjectOutput -ObjectOutputStream -ObjectOutputStream.PutField -ObjectReferenceFactory -ObjectReferenceFactoryHelper -ObjectReferenceFactoryHolder -ObjectReferenceTemplate -ObjectReferenceTemplateHelper -ObjectReferenceTemplateHolder -ObjectReferenceTemplateSeqHelper -ObjectReferenceTemplateSeqHolder -Objects -ObjectStreamClass -ObjectStreamConstants -ObjectStreamException -ObjectStreamField -ObjectView -ObjID -Observable -Observer -OceanTheme -OctetSeqHelper -OctetSeqHolder -OctetStreamData -Oid -OMGVMCID -Oneway -OpenDataException -OpenMBeanAttributeInfo -OpenMBeanAttributeInfoSupport -OpenMBeanConstructorInfo -OpenMBeanConstructorInfoSupport -OpenMBeanInfo -OpenMBeanInfoSupport -OpenMBeanOperationInfo -OpenMBeanOperationInfoSupport -OpenMBeanParameterInfo -OpenMBeanParameterInfoSupport -OpenOption -OpenType -OpenType -OperatingSystemMXBean -Operation -OperationNotSupportedException -OperationsException -Option -OptionalDataException -OptionChecker -OptionPaneUI -ORB -ORB -ORBIdHelper -ORBInitializer -ORBInitializerOperations -ORBInitInfo -ORBInitInfoOperations -OrientationRequested -OutOfMemoryError -OutputDeviceAssigned -OutputKeys -OutputStream -OutputStream -OutputStream -OutputStreamWriter -OverlappingFileLockException -OverlayLayout -Override -Owner -Pack200 -Pack200.Packer -Pack200.Unpacker -Package -PackageElement -PackedColorModel -Pageable -PageAttributes -PageAttributes.ColorType -PageAttributes.MediaType -PageAttributes.OrientationRequestedType -PageAttributes.OriginType -PageAttributes.PrintQualityType -PagedResultsControl -PagedResultsResponseControl -PageFormat -PageRanges -PagesPerMinute -PagesPerMinuteColor -Paint -PaintContext -Painter -PaintEvent -Panel -PanelUI -Paper -ParagraphView -ParagraphView -Parameter -ParameterBlock -ParameterDescriptor -Parameterizable -ParameterizedType -ParameterMetaData -ParameterMode -ParameterModeHelper -ParameterModeHolder -ParseConversionEvent -ParseConversionEventImpl -ParseException -ParsePosition -Parser -Parser -ParserAdapter -ParserConfigurationException -ParserDelegator -ParserFactory -PartialResultException -PasswordAuthentication -PasswordCallback -PasswordView -Patch -Path -Path2D -Path2D.Double -Path2D.Float -PathIterator -PathMatcher -Paths -Pattern -PatternSyntaxException -PBEKey -PBEKeySpec -PBEParameterSpec -PDLOverrideSupported -Permission -Permission -PermissionCollection -Permissions -PERSIST_STORE -PersistenceDelegate -PersistentMBean -PGPData -PhantomReference -Phaser -Pipe -Pipe.SinkChannel -Pipe.SourceChannel -PipedInputStream -PipedOutputStream -PipedReader -PipedWriter -PixelGrabber -PixelInterleavedSampleModel -PKCS8EncodedKeySpec -PKIXBuilderParameters -PKIXCertPathBuilderResult -PKIXCertPathChecker -PKIXCertPathValidatorResult -PKIXParameters -PKIXReason -PlainDocument -PlainView -PlatformLoggingMXBean -PlatformManagedObject -POA -POAHelper -POAManager -POAManagerOperations -POAOperations -Point -Point2D -Point2D.Double -Point2D.Float -PointerInfo -Policy -Policy -Policy -Policy.Parameters -PolicyError -PolicyErrorCodeHelper -PolicyErrorHelper -PolicyErrorHolder -PolicyFactory -PolicyFactoryOperations -PolicyHelper -PolicyHolder -PolicyListHelper -PolicyListHolder -PolicyNode -PolicyOperations -PolicyQualifierInfo -PolicySpi -PolicyTypeHelper -Polygon -PooledConnection -Popup -PopupFactory -PopupMenu -PopupMenuEvent -PopupMenuListener -PopupMenuUI -Port -Port.Info -PortableRemoteObject -PortableRemoteObjectDelegate -PortInfo -PortUnreachableException -Position -Position.Bias -PosixFileAttributes -PosixFileAttributeView -PosixFilePermission -PosixFilePermissions -PostConstruct -PreDestroy -Predicate -PreferenceChangeEvent -PreferenceChangeListener -Preferences -PreferencesFactory -PreparedStatement -PresentationDirection -PrimitiveType -Principal -Principal -PrincipalHolder -Printable -PrintConversionEvent -PrintConversionEventImpl -PrinterAbortException -PrinterException -PrinterGraphics -PrinterInfo -PrinterIOException -PrinterIsAcceptingJobs -PrinterJob -PrinterLocation -PrinterMakeAndModel -PrinterMessageFromOperator -PrinterMoreInfo -PrinterMoreInfoManufacturer -PrinterName -PrinterResolution -PrinterState -PrinterStateReason -PrinterStateReasons -PrinterURI -PrintEvent -PrintException -PrintGraphics -PrintJob -PrintJobAdapter -PrintJobAttribute -PrintJobAttributeEvent -PrintJobAttributeListener -PrintJobAttributeSet -PrintJobEvent -PrintJobListener -PrintQuality -PrintRequestAttribute -PrintRequestAttributeSet -PrintService -PrintServiceAttribute -PrintServiceAttributeEvent -PrintServiceAttributeListener -PrintServiceAttributeSet -PrintServiceLookup -PrintStream -PrintWriter -PriorityBlockingQueue -PriorityQueue -PRIVATE_MEMBER -PrivateClassLoader -PrivateCredentialPermission -PrivateKey -PrivateMLet -PrivilegedAction -PrivilegedActionException -PrivilegedExceptionAction -Process -ProcessBuilder -ProcessBuilder.Redirect -ProcessBuilder.Redirect.Type -ProcessingEnvironment -ProcessingInstruction -ProcessingInstruction -Processor -ProfileDataException -ProfileIdHelper -ProgressBarUI -ProgressMonitor -ProgressMonitorInputStream -Properties -PropertyChangeEvent -PropertyChangeListener -PropertyChangeListenerProxy -PropertyChangeSupport -PropertyDescriptor -PropertyEditor -PropertyEditorManager -PropertyEditorSupport -PropertyException -PropertyPermission -PropertyResourceBundle -PropertyVetoException -ProtectionDomain -ProtocolException -ProtocolException -ProtocolFamily -Provider -Provider -Provider -Provider.Service -ProviderException -ProviderMismatchException -ProviderNotFoundException -Proxy -Proxy -Proxy.Type -ProxySelector -PseudoColumnUsage -PSource -PSource.PSpecified -PSSParameterSpec -PUBLIC_MEMBER -PublicKey -PushbackInputStream -PushbackReader -QName -QuadCurve2D -QuadCurve2D.Double -QuadCurve2D.Float -QualifiedNameable -Query -QueryEval -QueryExp -Queue -QueuedJobCount -RadialGradientPaint -Random -RandomAccess -RandomAccessFile -Raster -RasterFormatException -RasterOp -RC2ParameterSpec -RC5ParameterSpec -Rdn -Readable -ReadableByteChannel -Reader -ReadOnlyBufferException -ReadOnlyFileSystemException -ReadPendingException -ReadWriteLock -RealmCallback -RealmChoiceCallback -REBIND -Receiver -Rectangle -Rectangle2D -Rectangle2D.Double -Rectangle2D.Float -RectangularShape -RecursiveAction -RecursiveTask -ReentrantLock -ReentrantReadWriteLock -ReentrantReadWriteLock.ReadLock -ReentrantReadWriteLock.WriteLock -Ref -RefAddr -Reference -Reference -Reference -Referenceable -ReferenceQueue -ReferenceType -ReferenceUriSchemesSupported -ReferralException -ReflectionException -ReflectiveOperationException -ReflectPermission -Refreshable -RefreshFailedException -Region -RegisterableService -Registry -RegistryHandler -RejectedExecutionException -RejectedExecutionHandler -Relation -RelationException -RelationNotFoundException -RelationNotification -RelationService -RelationServiceMBean -RelationServiceNotRegisteredException -RelationSupport -RelationSupportMBean -RelationType -RelationTypeNotFoundException -RelationTypeSupport -RemarshalException -Remote -RemoteCall -RemoteException -RemoteObject -RemoteObjectInvocationHandler -RemoteRef -RemoteServer -RemoteStub -RenderableImage -RenderableImageOp -RenderableImageProducer -RenderContext -RenderedImage -RenderedImageFactory -Renderer -RenderingHints -RenderingHints.Key -RepaintManager -ReplicateScaleFilter -RepositoryIdHelper -Request -REQUEST_PROCESSING_POLICY_ID -RequestInfo -RequestInfoOperations -RequestingUserName -RequestProcessingPolicy -RequestProcessingPolicyOperations -RequestProcessingPolicyValue -RequestWrapper -RequiredModelMBean -RescaleOp -ResolutionSyntax -Resolver -ResolveResult -Resource -Resource.AuthenticationType -ResourceBundle -ResourceBundle.Control -Resources -RespectBinding -RespectBindingFeature -Response -ResponseCache -ResponseHandler -ResponseWrapper -Result -ResultSet -ResultSetMetaData -Retention -RetentionPolicy -RetrievalMethod -ReverbType -RGBImageFilter -RMIClassLoader -RMIClassLoaderSpi -RMIClientSocketFactory -RMIConnection -RMIConnectionImpl -RMIConnectionImpl_Stub -RMIConnector -RMIConnectorServer -RMICustomMaxStreamFormat -RMIFailureHandler -RMIIIOPServerImpl -RMIJRMPServerImpl -RMISecurityException -RMISecurityManager -RMIServer -RMIServerImpl -RMIServerImpl_Stub -RMIServerSocketFactory -RMISocketFactory -Robot -Role -RoleInfo -RoleInfoNotFoundException -RoleList -RoleNotFoundException -RoleResult -RoleStatus -RoleUnresolved -RoleUnresolvedList -RootPaneContainer -RootPaneUI -RoundEnvironment -RoundingMode -RoundRectangle2D -RoundRectangle2D.Double -RoundRectangle2D.Float -RowFilter -RowFilter.ComparisonType -RowFilter.Entry -RowId -RowIdLifetime -RowMapper -RowSet -RowSetEvent -RowSetFactory -RowSetInternal -RowSetListener -RowSetMetaData -RowSetMetaDataImpl -RowSetProvider -RowSetReader -RowSetWarning -RowSetWriter -RowSorter -RowSorter.SortKey -RowSorterEvent -RowSorterEvent.Type -RowSorterListener -RSAKey -RSAKeyGenParameterSpec -RSAMultiPrimePrivateCrtKey -RSAMultiPrimePrivateCrtKeySpec -RSAOtherPrimeInfo -RSAPrivateCrtKey -RSAPrivateCrtKeySpec -RSAPrivateKey -RSAPrivateKeySpec -RSAPublicKey -RSAPublicKeySpec -RTFEditorKit -RuleBasedCollator -Runnable -RunnableFuture -RunnableScheduledFuture -Runtime -RunTime -RuntimeErrorException -RuntimeException -RuntimeMBeanException -RuntimeMXBean -RunTimeOperations -RuntimeOperationsException -RuntimePermission -SAAJMetaFactory -SAAJResult -SafeVarargs -SampleModel -Sasl -SaslClient -SaslClientFactory -SaslException -SaslServer -SaslServerFactory -Savepoint -SAXException -SAXNotRecognizedException -SAXNotSupportedException -SAXParseException -SAXParser -SAXParserFactory -SAXResult -SAXSource -SAXTransformerFactory -Scanner -ScatteringByteChannel -ScheduledExecutorService -ScheduledFuture -ScheduledThreadPoolExecutor -Schema -SchemaFactory -SchemaFactoryLoader -SchemaOutputResolver -SchemaViolationException -ScriptContext -ScriptEngine -ScriptEngineFactory -ScriptEngineManager -ScriptException -Scrollable -Scrollbar -ScrollBarUI -ScrollPane -ScrollPaneAdjustable -ScrollPaneConstants -ScrollPaneLayout -ScrollPaneLayout.UIResource -ScrollPaneUI -SealedObject -SearchControls -SearchResult -SecondaryLoop -SecretKey -SecretKeyFactory -SecretKeyFactorySpi -SecretKeySpec -SecureCacheResponse -SecureClassLoader -SecureDirectoryStream -SecureRandom -SecureRandomSpi -Security -SecurityException -SecurityManager -SecurityPermission -SeekableByteChannel -Segment -SelectableChannel -SelectionKey -Selector -SelectorProvider -Semaphore -SeparatorUI -Sequence -SequenceInputStream -Sequencer -Sequencer.SyncMode -SerialArray -SerialBlob -SerialClob -SerialDatalink -SerialException -Serializable -SerializablePermission -SerialJavaObject -SerialRef -SerialStruct -Servant -SERVANT_RETENTION_POLICY_ID -ServantActivator -ServantActivatorHelper -ServantActivatorOperations -ServantActivatorPOA -ServantAlreadyActive -ServantAlreadyActiveHelper -ServantLocator -ServantLocatorHelper -ServantLocatorOperations -ServantLocatorPOA -ServantManager -ServantManagerOperations -ServantNotActive -ServantNotActiveHelper -ServantObject -ServantRetentionPolicy -ServantRetentionPolicyOperations -ServantRetentionPolicyValue -ServerCloneException -ServerError -ServerException -ServerIdHelper -ServerNotActiveException -ServerRef -ServerRequest -ServerRequestInfo -ServerRequestInfoOperations -ServerRequestInterceptor -ServerRequestInterceptorOperations -ServerRuntimeException -ServerSocket -ServerSocketChannel -ServerSocketFactory -Service -Service.Mode -ServiceConfigurationError -ServiceContext -ServiceContextHelper -ServiceContextHolder -ServiceContextListHelper -ServiceContextListHolder -ServiceDelegate -ServiceDetail -ServiceDetailHelper -ServiceIdHelper -ServiceInformation -ServiceInformationHelper -ServiceInformationHolder -ServiceLoader -ServiceMode -ServiceNotFoundException -ServicePermission -ServiceRegistry -ServiceRegistry.Filter -ServiceUI -ServiceUIFactory -ServiceUnavailableException -Set -SetOfIntegerSyntax -SetOverrideType -SetOverrideTypeHelper -Severity -Shape -ShapeGraphicAttribute -SheetCollate -Short -ShortBuffer -ShortBufferException -ShortHolder -ShortLookupTable -ShortMessage -ShortSeqHelper -ShortSeqHolder -ShutdownChannelGroupException -Sides -Signature -SignatureException -SignatureMethod -SignatureMethodParameterSpec -SignatureProperties -SignatureProperty -SignatureSpi -SignedInfo -SignedObject -Signer -SimpleAnnotationValueVisitor6 -SimpleAnnotationValueVisitor7 -SimpleAttributeSet -SimpleBeanInfo -SimpleBindings -SimpleDateFormat -SimpleDoc -SimpleElementVisitor6 -SimpleElementVisitor7 -SimpleFileVisitor -SimpleFormatter -SimpleJavaFileObject -SimpleScriptContext -SimpleTimeZone -SimpleType -SimpleTypeVisitor6 -SimpleTypeVisitor7 -SinglePixelPackedSampleModel -SingleSelectionModel -Size2DSyntax -SizeLimitExceededException -SizeRequirements -SizeSequence -Skeleton -SkeletonMismatchException -SkeletonNotFoundException -SliderUI -SOAPBinding -SOAPBinding -SOAPBinding.ParameterStyle -SOAPBinding.Style -SOAPBinding.Use -SOAPBody -SOAPBodyElement -SOAPConnection -SOAPConnectionFactory -SOAPConstants -SOAPElement -SOAPElementFactory -SOAPEnvelope -SOAPException -SOAPFactory -SOAPFault -SOAPFaultElement -SOAPFaultException -SOAPHandler -SOAPHeader -SOAPHeaderElement -SOAPMessage -SOAPMessageContext -SOAPMessageHandler -SOAPMessageHandlers -SOAPPart -Socket -SocketAddress -SocketChannel -SocketException -SocketFactory -SocketHandler -SocketImpl -SocketImplFactory -SocketOption -SocketOptions -SocketPermission -SocketSecurityException -SocketTimeoutException -SoftBevelBorder -SoftReference -SortControl -SortedMap -SortedSet -SortingFocusTraversalPolicy -SortKey -SortOrder -SortResponseControl -Soundbank -SoundbankReader -SoundbankResource -Source -SourceDataLine -SourceLocator -SourceVersion -SpinnerDateModel -SpinnerListModel -SpinnerModel -SpinnerNumberModel -SpinnerUI -SplashScreen -SplitPaneUI -Spring -SpringLayout -SpringLayout.Constraints -SQLClientInfoException -SQLData -SQLDataException -SQLException -SQLFeatureNotSupportedException -SQLInput -SQLInputImpl -SQLIntegrityConstraintViolationException -SQLInvalidAuthorizationSpecException -SQLNonTransientConnectionException -SQLNonTransientException -SQLOutput -SQLOutputImpl -SQLPermission -SQLRecoverableException -SQLSyntaxErrorException -SQLTimeoutException -SQLTransactionRollbackException -SQLTransientConnectionException -SQLTransientException -SQLWarning -SQLXML -SSLContext -SSLContextSpi -SSLEngine -SSLEngineResult -SSLEngineResult.HandshakeStatus -SSLEngineResult.Status -SSLException -SSLHandshakeException -SSLKeyException -SSLParameters -SSLPeerUnverifiedException -SSLPermission -SSLProtocolException -SslRMIClientSocketFactory -SslRMIServerSocketFactory -SSLServerSocket -SSLServerSocketFactory -SSLSession -SSLSessionBindingEvent -SSLSessionBindingListener -SSLSessionContext -SSLSocket -SSLSocketFactory -Stack -StackOverflowError -StackTraceElement -StandardCharsets -StandardCopyOption -StandardEmitterMBean -StandardJavaFileManager -StandardLocation -StandardMBean -StandardOpenOption -StandardProtocolFamily -StandardSocketOptions -StandardWatchEventKinds -StartDocument -StartElement -StartTlsRequest -StartTlsResponse -State -State -StateEdit -StateEditable -StateFactory -Statement -Statement -StatementEvent -StatementEventListener -StAXResult -StAXSource -Streamable -StreamableValue -StreamCorruptedException -StreamFilter -StreamHandler -StreamPrintService -StreamPrintServiceFactory -StreamReaderDelegate -StreamResult -StreamSource -StreamTokenizer -StrictMath -String -StringBuffer -StringBufferInputStream -StringBuilder -StringCharacterIterator -StringContent -StringHolder -StringIndexOutOfBoundsException -StringMonitor -StringMonitorMBean -StringNameHelper -StringReader -StringRefAddr -StringSelection -StringSeqHelper -StringSeqHolder -StringTokenizer -StringValueExp -StringValueHelper -StringWriter -Stroke -StrokeBorder -Struct -StructMember -StructMemberHelper -Stub -StubDelegate -StubNotFoundException -Style -StyleConstants -StyleConstants.CharacterConstants -StyleConstants.ColorConstants -StyleConstants.FontConstants -StyleConstants.ParagraphConstants -StyleContext -StyledDocument -StyledEditorKit -StyledEditorKit.AlignmentAction -StyledEditorKit.BoldAction -StyledEditorKit.FontFamilyAction -StyledEditorKit.FontSizeAction -StyledEditorKit.ForegroundAction -StyledEditorKit.ItalicAction -StyledEditorKit.StyledTextAction -StyledEditorKit.UnderlineAction -StyleSheet -StyleSheet.BoxPainter -StyleSheet.ListPainter -Subject -SubjectDelegationPermission -SubjectDomainCombiner -SUCCESSFUL -SupportedAnnotationTypes -SupportedOptions -SupportedSourceVersion -SupportedValuesAttribute -SuppressWarnings -SwingConstants -SwingPropertyChangeSupport -SwingUtilities -SwingWorker -SwingWorker.StateValue -SwitchPoint -SYNC_WITH_TRANSPORT -SyncFactory -SyncFactoryException -SyncFailedException -SynchronousQueue -SyncProvider -SyncProviderException -SyncResolver -SyncScopeHelper -SynthButtonUI -SynthCheckBoxMenuItemUI -SynthCheckBoxUI -SynthColorChooserUI -SynthComboBoxUI -SynthConstants -SynthContext -SynthDesktopIconUI -SynthDesktopPaneUI -SynthEditorPaneUI -Synthesizer -SynthFormattedTextFieldUI -SynthGraphicsUtils -SynthInternalFrameUI -SynthLabelUI -SynthListUI -SynthLookAndFeel -SynthMenuBarUI -SynthMenuItemUI -SynthMenuUI -SynthOptionPaneUI -SynthPainter -SynthPanelUI -SynthPasswordFieldUI -SynthPopupMenuUI -SynthProgressBarUI -SynthRadioButtonMenuItemUI -SynthRadioButtonUI -SynthRootPaneUI -SynthScrollBarUI -SynthScrollPaneUI -SynthSeparatorUI -SynthSliderUI -SynthSpinnerUI -SynthSplitPaneUI -SynthStyle -SynthStyleFactory -SynthTabbedPaneUI -SynthTableHeaderUI -SynthTableUI -SynthTextAreaUI -SynthTextFieldUI -SynthTextPaneUI -SynthToggleButtonUI -SynthToolBarUI -SynthToolTipUI -SynthTreeUI -SynthUI -SynthViewportUI -SysexMessage -System -SYSTEM_EXCEPTION -SystemColor -SystemException -SystemFlavorMap -SystemTray -TabableView -TabbedPaneUI -TabExpander -TableCellEditor -TableCellRenderer -TableColumn -TableColumnModel -TableColumnModelEvent -TableColumnModelListener -TableHeaderUI -TableModel -TableModelEvent -TableModelListener -TableRowSorter -TableStringConverter -TableUI -TableView -TabSet -TabStop -TabularData -TabularDataSupport -TabularType -TAG_ALTERNATE_IIOP_ADDRESS -TAG_CODE_SETS -TAG_INTERNET_IOP -TAG_JAVA_CODEBASE -TAG_MULTIPLE_COMPONENTS -TAG_ORB_TYPE -TAG_POLICIES -TAG_RMI_CUSTOM_MAX_STREAM_FORMAT -TagElement -TaggedComponent -TaggedComponentHelper -TaggedComponentHolder -TaggedProfile -TaggedProfileHelper -TaggedProfileHolder -Target -TargetDataLine -TargetedNotification -TCKind -Templates -TemplatesHandler -Text -Text -TextAction -TextArea -TextAttribute -TextComponent -TextEvent -TextField -TextHitInfo -TextInputCallback -TextLayout -TextLayout.CaretPolicy -TextListener -TextMeasurer -TextOutputCallback -TextSyntax -TextUI -TexturePaint -Thread -Thread.State -Thread.UncaughtExceptionHandler -THREAD_POLICY_ID -ThreadDeath -ThreadFactory -ThreadGroup -ThreadInfo -ThreadLocal -ThreadLocalRandom -ThreadMXBean -ThreadPolicy -ThreadPolicyOperations -ThreadPolicyValue -ThreadPoolExecutor -ThreadPoolExecutor.AbortPolicy -ThreadPoolExecutor.CallerRunsPolicy -ThreadPoolExecutor.DiscardOldestPolicy -ThreadPoolExecutor.DiscardPolicy -Throwable -Tie -TileObserver -Time -TimeLimitExceededException -TIMEOUT -TimeoutException -Timer -Timer -Timer -TimerMBean -TimerNotification -TimerTask -Timestamp -Timestamp -TimeUnit -TimeZone -TimeZoneNameProvider -TitledBorder -Tool -ToolBarUI -Toolkit -ToolProvider -ToolTipManager -ToolTipUI -TooManyListenersException -Track -TRANSACTION_MODE -TRANSACTION_REQUIRED -TRANSACTION_ROLLEDBACK -TRANSACTION_UNAVAILABLE -TransactionalWriter -TransactionRequiredException -TransactionRolledbackException -TransactionService -Transferable -TransferHandler -TransferHandler.DropLocation -TransferHandler.TransferSupport -TransferQueue -Transform -TransformAttribute -Transformer -TransformerConfigurationException -TransformerException -TransformerFactory -TransformerFactoryConfigurationError -TransformerHandler -TransformException -TransformParameterSpec -TransformService -Transient -TRANSIENT -Transmitter -Transparency -TRANSPORT_RETRY -TrayIcon -TrayIcon.MessageType -TreeCellEditor -TreeCellRenderer -TreeExpansionEvent -TreeExpansionListener -TreeMap -TreeModel -TreeModelEvent -TreeModelListener -TreeNode -TreePath -TreeSelectionEvent -TreeSelectionListener -TreeSelectionModel -TreeSet -TreeUI -TreeWillExpandListener -TrustAnchor -TrustManager -TrustManagerFactory -TrustManagerFactorySpi -Type -TypeCode -TypeCodeHolder -TypeConstraintException -TypeElement -TypeInfo -TypeInfoProvider -TypeKind -TypeKindVisitor6 -TypeKindVisitor7 -TypeMirror -TypeMismatch -TypeMismatch -TypeMismatch -TypeMismatchHelper -TypeMismatchHelper -TypeNotPresentException -TypeParameterElement -Types -Types -TypeVariable -TypeVariable -TypeVisitor -UID -UIDefaults -UIDefaults.ActiveValue -UIDefaults.LazyInputMap -UIDefaults.LazyValue -UIDefaults.ProxyLazyValue -UIEvent -UIManager -UIManager.LookAndFeelInfo -UIResource -ULongLongSeqHelper -ULongLongSeqHolder -ULongSeqHelper -ULongSeqHolder -UndeclaredThrowableException -UndoableEdit -UndoableEditEvent -UndoableEditListener -UndoableEditSupport -UndoManager -UnexpectedException -UnicastRemoteObject -UnionMember -UnionMemberHelper -UnionType -UNKNOWN -UNKNOWN -UnknownAnnotationValueException -UnknownElementException -UnknownEncoding -UnknownEncodingHelper -UnknownEntityException -UnknownError -UnknownException -UnknownFormatConversionException -UnknownFormatFlagsException -UnknownGroupException -UnknownHostException -UnknownHostException -UnknownObjectException -UnknownServiceException -UnknownTypeException -UnknownUserException -UnknownUserExceptionHelper -UnknownUserExceptionHolder -UnmappableCharacterException -UnmarshalException -UnmarshalException -Unmarshaller -Unmarshaller.Listener -UnmarshallerHandler -UnmodifiableClassException -UnmodifiableSetException -UnrecoverableEntryException -UnrecoverableKeyException -Unreferenced -UnresolvedAddressException -UnresolvedPermission -UnsatisfiedLinkError -UnsolicitedNotification -UnsolicitedNotificationEvent -UnsolicitedNotificationListener -UNSUPPORTED_POLICY -UNSUPPORTED_POLICY_VALUE -UnsupportedAddressTypeException -UnsupportedAudioFileException -UnsupportedCallbackException -UnsupportedCharsetException -UnsupportedClassVersionError -UnsupportedDataTypeException -UnsupportedEncodingException -UnsupportedFlavorException -UnsupportedLookAndFeelException -UnsupportedOperationException -URI -URIDereferencer -URIException -URIParameter -URIReference -URIReferenceException -URIResolver -URISyntax -URISyntaxException -URL -URLClassLoader -URLConnection -URLDataSource -URLDecoder -URLEncoder -URLStreamHandler -URLStreamHandlerFactory -URLStringHelper -USER_EXCEPTION -UserDataHandler -UserDefinedFileAttributeView -UserException -UserPrincipal -UserPrincipalLookupService -UserPrincipalNotFoundException -UShortSeqHelper -UShortSeqHolder -UTFDataFormatException -Util -UtilDelegate -Utilities -UUID -ValidationEvent -ValidationEventCollector -ValidationEventHandler -ValidationEventImpl -ValidationEventLocator -ValidationEventLocatorImpl -ValidationException -Validator -Validator -ValidatorHandler -ValueBase -ValueBaseHelper -ValueBaseHolder -ValueExp -ValueFactory -ValueHandler -ValueHandlerMultiFormat -ValueInputStream -ValueMember -ValueMemberHelper -ValueOutputStream -VariableElement -VariableHeightLayoutCache -Vector -VerifyError -VersionSpecHelper -VetoableChangeListener -VetoableChangeListenerProxy -VetoableChangeSupport -View -ViewFactory -ViewportLayout -ViewportUI -VirtualMachineError -Visibility -VisibilityHelper -VM_ABSTRACT -VM_CUSTOM -VM_NONE -VM_TRUNCATABLE -VMID -VoiceStatus -Void -VolatileCallSite -VolatileImage -W3CDomHandler -W3CEndpointReference -W3CEndpointReferenceBuilder -Watchable -WatchEvent -WatchEvent.Kind -WatchEvent.Modifier -WatchKey -WatchService -WCharSeqHelper -WCharSeqHolder -WeakHashMap -WeakReference -WebEndpoint -WebFault -WebMethod -WebParam -WebParam.Mode -WebResult -WebRowSet -WebService -WebServiceClient -WebServiceContext -WebServiceException -WebServiceFeature -WebServiceFeatureAnnotation -WebServicePermission -WebServiceProvider -WebServiceRef -WebServiceRefs -WildcardType -WildcardType -Window -Window.Type -WindowAdapter -WindowConstants -WindowEvent -WindowFocusListener -WindowListener -WindowStateListener -WrappedPlainView -Wrapper -WritableByteChannel -WritableRaster -WritableRenderedImage -WriteAbortedException -WritePendingException -Writer -WrongAdapter -WrongAdapterHelper -WrongMethodTypeException -WrongPolicy -WrongPolicyHelper -WrongTransaction -WrongTransactionHelper -WrongTransactionHolder -WStringSeqHelper -WStringSeqHolder -WStringValueHelper -X500Principal -X500PrivateCredential -X509Certificate -X509Certificate -X509CertSelector -X509CRL -X509CRLEntry -X509CRLSelector -X509Data -X509EncodedKeySpec -X509ExtendedKeyManager -X509ExtendedTrustManager -X509Extension -X509IssuerSerial -X509KeyManager -X509TrustManager -XAConnection -XADataSource -XAException -XAResource -Xid -XmlAccessOrder -XmlAccessorOrder -XmlAccessorType -XmlAccessType -XmlAdapter -XmlAnyAttribute -XmlAnyElement -XmlAttachmentRef -XmlAttribute -XMLConstants -XMLCryptoContext -XMLDecoder -XmlElement -XmlElement.DEFAULT -XmlElementDecl -XmlElementDecl.GLOBAL -XmlElementRef -XmlElementRef.DEFAULT -XmlElementRefs -XmlElements -XmlElementWrapper -XMLEncoder -XmlEnum -XmlEnumValue -XMLEvent -XMLEventAllocator -XMLEventConsumer -XMLEventFactory -XMLEventReader -XMLEventWriter -XMLFilter -XMLFilterImpl -XMLFormatter -XMLGregorianCalendar -XmlID -XmlIDREF -XmlInlineBinaryData -XMLInputFactory -XmlJavaTypeAdapter -XmlJavaTypeAdapter.DEFAULT -XmlJavaTypeAdapters -XmlList -XmlMimeType -XmlMixed -XmlNs -XmlNsForm -XMLObject -XMLOutputFactory -XMLParseException -XmlReader -XMLReader -XMLReaderAdapter -XMLReaderFactory -XmlRegistry -XMLReporter -XMLResolver -XmlRootElement -XmlSchema -XmlSchemaType -XmlSchemaType.DEFAULT -XmlSchemaTypes -XmlSeeAlso -XMLSignature -XMLSignature.SignatureValue -XMLSignatureException -XMLSignatureFactory -XMLSignContext -XMLStreamConstants -XMLStreamException -XMLStreamReader -XMLStreamWriter -XMLStructure -XmlTransient -XmlType -XmlType.DEFAULT -XMLValidateContext -XmlValue -XmlWriter -XPath -XPathConstants -XPathException -XPathExpression -XPathExpressionException -XPathFactory -XPathFactoryConfigurationException -XPathFilter2ParameterSpec -XPathFilterParameterSpec -XPathFunction -XPathFunctionException -XPathFunctionResolver -XPathType -XPathType.Filter -XPathVariableResolver -XSLTTransformParameterSpec -ZipEntry -ZipError -ZipException -ZipFile -ZipInputStream -ZipOutputStream -ZoneView -_BindingIteratorImplBase -_BindingIteratorStub -_DynAnyFactoryStub -_DynAnyStub -_DynArrayStub -_DynEnumStub -_DynFixedStub -_DynSequenceStub -_DynStructStub -_DynUnionStub -_DynValueStub -_IDLTypeStub -_NamingContextExtStub -_NamingContextImplBase -_NamingContextStub -_PolicyStub -_Remote_Stub -_ServantActivatorStub -_ServantLocatorStub -@Override -@NotNull -@FunctionalInterface -@Deprecated diff --git a/dict/js-mode b/dict/js-mode deleted file mode 100755 index e2c3a815e..000000000 --- a/dict/js-mode +++ /dev/null @@ -1,2 +0,0 @@ -JSON.stringify -JSON.parse diff --git a/dict/js2-mode b/dict/js2-mode deleted file mode 100755 index 0f91dcec7..000000000 --- a/dict/js2-mode +++ /dev/null @@ -1,7 +0,0 @@ -JSON -JSON.stringify -JSON.parse -LaunchBar -include -HTTP -File diff --git a/dict/love-mode b/dict/love-mode deleted file mode 100755 index f6f5e2d79..000000000 --- a/dict/love-mode +++ /dev/null @@ -1,30 +0,0 @@ -love.keyboard.isDown -love.draw -love.update -love.conf -love.load -draw -focus -joystickpressed -joystickreleased -keypressed -keyreleased -load -mousepressed -mousereleased -quit -run -update -audio -event -filesystem -font -graphics -image -joystick -keyboard -mouse -physics -sound -thread -timer diff --git a/dict/lua-mode b/dict/lua-mode deleted file mode 100755 index fcfb3ff67..000000000 --- a/dict/lua-mode +++ /dev/null @@ -1,21 +0,0 @@ -and -break -do -else -elseif -end -false -for -function -if -in -local -nil -not -or -repeat -return -then -true -until -while \ No newline at end of file diff --git a/dict/nxml-mode b/dict/nxml-mode deleted file mode 100755 index 5242b29c2..000000000 --- a/dict/nxml-mode +++ /dev/null @@ -1,34 +0,0 @@ -CFBundleName -CFBundleShortVersionString -CFBundleVersion -CFBundleIdentifier -CFBundleIconFile -LSMinimumSystemVersion -LBMinimumLaunchBarVersion -LBDebugLogEnabled -LBAbbreviation -LBRequiredApplication -LBAssociatedApplication -LBTextInputTitle -LBScripts -LBDefaultScript -LBScriptName -LBRunInBackground -LBLiveFeedbackEnabled -LBBackgroundKillEnabled -LBRequiresArgument -LBAcceptedArgumentTypes -LBReturnsResult -LBResultType -LBKeepWindowActive -LBSuggestionsScript -LBActionURLScript -LBDescription -LBAuthor -LBWebsite -LBEmail -LBTwitter -LBSummary -LBArgument -LBResult -LBRequirements \ No newline at end of file diff --git a/dict/php-mode b/dict/php-mode deleted file mode 100755 index 30f44afd6..000000000 --- a/dict/php-mode +++ /dev/null @@ -1,62 +0,0 @@ -and -array -as -break -case -catch -cfunction -class -clone -const -continue -declare -default -die -do -echo -else -elseif -empty -enddeclare -endfor -endforeach -endif -endswitch -endwhile -eval -exit -extends -final -for -foreach -function -global -goto -if -implements -include -include_once -instanceof -interface -isset -list -namespace -new -old_function -or -print -private -protected -public -require -require_once -return -static -switch -throw -try -unset -use -var -while -xor \ No newline at end of file diff --git a/dict/ruby-mode b/dict/ruby-mode deleted file mode 100755 index 90b4fc9d8..000000000 --- a/dict/ruby-mode +++ /dev/null @@ -1,181 +0,0 @@ -$! -$" -$$ -$& -$' -$* -$+ -$, -$-0 -$-F -$-I -$-K -$-a -$-d -$-i -$-l -$-p -$-v -$-w -$. -$/ -$0 -$1 -$10 -$11 -$2 -$3 -$4 -$5 -$6 -$7 -$8 -$9 -$: -$; -$< -$= -$> -$? -$@ -$DEBUG -$FILENAME -$KCODE -$LOADED_FEATURES -$LOAD_PATH -$PROGRAM_NAME -$SAFE -$VERBOSE -$\ -$_ -$` -$deferr -$defout -$stderr -$stdin -$stdout -$~ -ARGF -ARGV -Array -BEGIN -DATA -END -ENV -FALSE -Float -Integer -NIL -PLATFORM -RELEASE_DATE -RUBY_COPYRIGHT -RUBY_DESCRIPTION -RUBY_PATCHLEVEL -RUBY_PLATFORM -RUBY_RELEASE_DATE -RUBY_VERSION -SCRIPT_LINES__ -STDERR -STDIN -STDOUT -String -TOPLEVEL_BINDING -TRUE -VERSION -__method__ -` -abort -alias -and -at_exit -autoload -autoload? -begin -binding -block_given -break -callcc -caller -case -catch -chomp -chomp! -chop -chop -class -def -defined? -do -else -elsif -end -ensure -eval -exec -exit -exit! -fail -false -for -fork -format -getc -gets -global_variables -gsub -gsub! -if -in -iterator? -lambda -load -local_varaibles -loop -module -next -nil -not -open -or -p -printf -proc -putc -puts -raise -rand -readline -readlines -redo -require -require_relative -rescue -retry -return -scan -select -self -set_trace_func -sleep -split -sprintf -srand -sub -sub! -super -syscall -system -test -then -throw -trace_var -trap -true -undef -unless -until -untrace_var -warn -when -while -yield diff --git a/dict/scss-mode b/dict/scss-mode deleted file mode 100755 index 6b7837da1..000000000 --- a/dict/scss-mode +++ /dev/null @@ -1,680 +0,0 @@ -@import -@mixin -@extend -!important -_azimuth -_background -_background-position-x -_background-position-y -_border -_bottom -_caption -_clear -_clip -_color -_content -_counter -_cue -_cursor -_direction -_display -_elevation -_empty -_filter -_filter:progid:DXImageTransform.Microsoft -_float -_font -_height -_ime -_ime-mode -_layout -_layout-flow -_layout-grid -_layout-grid-char -_layout-grid-line -_layout-grid-mode -_layout-grid-type -_left -_letter -_line -_line-break -_list -_margin -_orphans -_outline -_overflow -_overflow-x -_overflow-y -_padding -_page -_pause -_pitch -_play -_position -_quotes -_richness -_right -_ruby -_ruby-align -_ruby-overhang -_ruby-position -_scrollbar -_scrollbar-3dlight-color -_scrollbar-arrow-color -_scrollbar-base-color -_scrollbar-darkshadow-color -_scrollbar-face-color -_scrollbar-highlight-color -_scrollbar-track-color -_speak -_speech -_stress -_table -_text -_text-align-last -_text-autospace -_text-justify -_text-kashida-space -_text-overflow -_text-underline-position -_top -_unicode -_vertical -_visibility -_voice -_volume -_white -_widows -_width -_word -_word-break -_word-wrap -_writing -_writing-mode -_z -_zoom -above -active -adjust -after -aliceblue -align -always -antiquewhite -aqua -aquamarine -armenian -arrow -attachment -auto -autospace -avoid -azimuth -azure -background -background-attachment -background-color -background-image -background-position -background-repeat -bar -base -baseline -before -behind -beige -below -bidi -bidi-override -bisque -black -blanchedalmond -blink -block -blue -blueviolet -bold -bolder -border -border-bottom -border-bottom-color -border-bottom-style -border-bottom-width -border-collapse -border-color -border-left -border-left-color -border-left-style -border-left-width -border-right -border-right-color -border-right-style -border-right-width -border-spacing -border-style -border-top -border-top-color -border-top-style -border-top-width -border-width -both -bottom -box -break -brown -burlwood -cadetblue -capitalize -caps -caption -caption-side -cell -cells -center -center-left -center-right -char -chartreuse -chocolate -circle -cjk -cjk-ideographic -clear -clip -close -close-quote -cm -code -collapse -color -column -compact -condensed -content -continuous -coral -cornflowerblue -cornsilk -counter -counter-increment -counter-reset -crimson -crop -cross -crosshair -cue -cue-after -cue-before -cursive -cursor -cyan -darkblue -darkcyan -darkgoldenrod -darkgray -darkgreen -darkkhaki -darkmagenta -darkolivegreen -darkorange -darkorchid -darkred -darksalmon -darkseagreen -darkshadow -darkslateblue -darkslategray -darkturquoise -darkviolet -dashed -decimal -decimal-leading-zero -decoration -deeppink -deepskyblue -default -deg -digits -dimgray -direction -disc -display -dodgerblue -dotted -double -during -e -e-resize -elevation -em -embed -empty -empty-cells -ex -expanded -extra -extra-condensed -extra-expanded -face -family -fantasy -far -far-left -far-right -fast -faster -firebrick -first -first-child -first-letter -first-line -fixed -float -floralwhite -flow -focus -font -font-family -font-size -font-size-adjust -font-stretch -font-style -font-variant -font-weight -footer -forestgreen -fuchsia -gainsboro -georgian -ghostwhite -gold -goldenrod -gray -greek -green -greenyellow -grid -groove -group -header -hebrew -height -help -hidden -hide -high -higher -hiragana -hiragana-iroha -honeydew -hotpink -hover -icon -ideographic -image -in -increment -indent -index -indianred -indigo -inherit -inline -inline-block -inline-table -inset -inside -iroha -italic -item -ivory -justify -kHz -kashida -katakana -katakana-iroha -khaki -landscape -lang() -large -larger -last -latin -lavender -lavenderblush -lawngreen -layout -leading -left -left-side -leftwards -lenonchiffon -letter -letter-spacing -level -lightblue -lightcoral -lightcyan -lighter -lightgoldenrodyellow -lightgray -lightgreen -lightgrey -lightpink -lightsalmon -lightseagreen -lightskyblue -lightslategray -lightsteelblue -lightyellow -lime -limegreen -line -line-height -line-through -linen -link -list -list-item -list-style -list-style-image -list-style-position -list-style-type -loud -low -lower -lower-alpha -lower-greek -lower-latin -lower-roman -lowercase -ltr -magenta -margin -margin-bottom -margin-left -margin-right -margin-top -marker -marker-offset -marks -maroon -max -max-height -max-width -medium -mediumaquamarine -mediumblue -mediumorchid -mediumpurple -mediumseagreen -mediumslateblue -mediumspringgreen -mediumturquoise -mediumvioletred -menu -message -message-box -middle -midnightblue -min -min-height -min-width -mintcream -mistyrose -mix -mm -moccasin -mode -monospace -move -ms -n -n-resize -naby -narrower -navajowhite -ne -ne-resize -no -no-close-quote -no-open-quote -no-repeat -none -normal -nowrap -number -numeral -nw -nw-resize -oblique -offset -oldlace -olive -olivedrab -once -open -open-quote -orange -orangered -orchid -orphans -out -outline -outline-color -outline-style -outline-width -outset -outside -overflow -overhang -overline -override -padding -padding-bottom -padding-left -padding-right -padding-top -page -page-break-after -page-break-before -page-break-inside -palegoldenrod -palegreen -paleturquoise -palevioletred -papayawhip -pause -pause-after -pause-before -pc -peachpuff -peru -pink -pitch -pitch-range -play -play-during -plum -pointer -portarait -position -powderblue -pre -pre-line -pre-wrap -progid -progress -pt -punctuation -purple -px -quote -quotes -rad -range -rate -red -relative -repeat -repeat-x -repeat-y -reset -resize -richness -ridge -right -right-side -rightwards -roman -rosybrown -row -royalblue -rtl -run -run-in -s -s-resize -saddlebrown -salmon -sandybrown -sans-serif -scroll -se -se-resize -seagreen -seashell -semi -semi-condensed -semi-expanded -separate -serif -shadow -show -side -sienna -silent -silever -silver -size -skyblue -slateblue -slategray -slow -slower -small -small-caps -small-caption -smaller -snow -soft -solid -space -spacing -speak -speak-header -speak-numeral -speak-punctuation -specific -specific-voice -speech -speech-rate -spell -spell-out -springgreen -square -static -status -status-bar -steelblue -stress -stretch -style -sub -super -sw -sw-resize -table -table-caption -table-cell -table-column -table-column-group -table-footer-group -table-header-group -table-layout -table-row -table-row-group -tan -teal -text -text-align -text-bottom -text-decoration -text-indent -text-shadow -text-top -text-transform -thick -thin -thistle -through -tomato -top -track -transform -transparent -turquoise -type -ultra -ultra-condensed -ultra-expanded -underline -unicode -unicode-bidi -upper -upper-alpha -upper-latin -upper-roman -uppercase -variant -vertical -vertical-align -violet -visibility -visible -visited -voice -voice-family -volume -w -w-resize -wait -weight -wheat -white -white-space -whitesmoke -wider -widows -width -word -word-spacing -wrap -x -x-fast -x-high -x-large -x-loud -x-low -x-slow -x-small -x-soft -xx -xx-large -xx-small -y -yellow -yellowgreen -z -z-index -zero \ No newline at end of file diff --git a/dict/sh-mode b/dict/sh-mode deleted file mode 100755 index 6052219a9..000000000 --- a/dict/sh-mode +++ /dev/null @@ -1,162 +0,0 @@ -alias -bg -bind -break -builtin -caller -cd -command -compgen -complete -compopt -continue -declare -dirs -disown -echo -enable -eval -exec -exit -export -fc -fg -getopts -hash -help -history -jobs -kill -let -local -logout -mapfile -popd -printf -pushd -pwd -read -readarray -readonly -return -set -shift -shopt -source -suspend -test -times -trap -type -typeset -ulimit -umask -unalias -unset -wait -case -do -done -elif -else -esac -fi -for -function -if -in -select -then -time -until -while -BASH -BASH_ALIASES -BASH_ARGC -BASH_ARGV -BASH_CMDS -BASH_COMMAND -BASH_ENV -BASH_EXECUTION_STRING -BASH_LINENO -BASH_REMATCH -BASH_SOURCE -BASH_SUBSHELL -BASH_VERSINFO -BASH_VERSION -BASH_XTRACEFD -BASHOPTS -BASHPID -CDPATH -COLUMNS -COMP_CWORD -COMP_KEY -COMP_LINE -COMP_POINT -COMP_TYPE -COMP_WORDBREAKS -COMP_WORDS -COMPREPLY -DIRSTACK -EMACS -EUID -FCEDIT -FIGNORE -FUNCNAME -GLOBIGNORE -GROUPS -HISTCMD -HISTCONTROL -HISTFILE -HISTFILESIZE -HISTIGNORE -HISTSIZE -HISTTIMEFORMAT -HOME -HOSTFILE -HOSTNAME -HOSTTYPE -IFS -IGNOREEOF -INPUTRC -LANG -LC_ALL -LC_COLLATE -LC_CTYPE -LC_MESSAGES -LC_MESSAGES -LC_NUMERIC -LINENO -LINES -MACHTYPE -MAIL -MAILCHECK -MAILPATH -OLDPWD -OPTARG -OPTERR -OPTIND -OSTYPE -PATH -PIPESTATUS -POSIXLY_CORRECT -PPID -PROMPT_COMMAND -PROMPT_DIRTRIM -PS1 -PS2 -PS3 -PS4 -PWD -RANDOM -REPLY -SECONDS -SHELL -SHELLOPTS -SHLVL -TEXTDOMAIN -TEXTDOMAINDIR -TIMEFORMAT -TMOUT -TMPDIR -UID \ No newline at end of file diff --git a/init.el b/init.el index bda1341a2..863902f76 100644 --- a/init.el +++ b/init.el @@ -1,18 +1,19 @@ -;;; NARF! Emacs for the jaded vimmer +;;; init.el --- NARF bootstrap ;; -;; Author: Henrik Lissner -;; URL: https://github.com/hlissner/emacs.d +;; Author: Henrik Lissner +;; URL: https://github.com/hlissner/emacs.d +;; Version: 0.0.0001 ;; -;;; Narf! +;;; Are you pondering what i'm pondering, Pinky? ;; ;; ,,, !/:. ;; /::\". !!::: ;; :::::\". ," \:,:: ;; ::::::\ ". ,","\::. -;; \:::::":\ "/""V' :' +;; \:::::":\ "/""v' :' ;; !::::\ ! \ \ __ ;; "::::\ \ ! \.&&&&, -;; ," __ ", CD,&&&&&&' +;; ," __ ", cd,&&&&&&' ;; \ ". "" / \&&&" _,--- ;; "",__\_ / _,:"::::: ;; _," ,"" ,-,__,/":,_ ,","::::::: @@ -22,73 +23,65 @@ ;; / ,"_!:::::::/, ," _,,--, /::::::/ ;; / "" _,"\:::::::' ! ," ){:::::/ ;; ! _," \ "", \,"""-,____,"__,,,"_," _/ -;; ""T" \\ \ "-,_(*)&&&&(*)," \ ." +;; ""t" \\ \ "-,_(*)&&&&(*)," \ ." ;; / \", ! , \ ! - ) ;; ! \ "" ! !==!"-,__,' ;; ! \ """_""""`, ", /"_ -;; \ , .L /" " ", \! ,_/ +;; \ , .l /" " ", \! ,_/ ;; ), \ / \ \/ ,, /! ! ;; ,::\ \," \ ! \/ ! ! ;; _,::::" ) )\ ," ___ \ -,_, ,"",! ! ;; __,,,::::"" ," ,":::,-:::--:" __\_!__/_""-,_! ;; ,,:::""""""" ,:_,""__...._"""::::"" /:::::" "":::::: -;; (:._ L::::::::::::\\/ "" "" +;; (:._ l::::::::::::\\/ "" "" ;; """"--,,,--- """" ;; -;;; Code: -(defconst DEBUG-MODE nil) +;; These mice are not part of GNU Emacs. +;; +;;; License: GPLv3 -(defconst DEFAULT-FONT (font-spec :family "Terminus (TTF)" :size 12 :antialias nil)) -(defconst DEFAULT-THEME 'narf-dark) ; for GUI client -(defconst TERM-THEME 'wombat) ; for <256 color terminals +(defconst narf-debug-mode nil) -(load (concat user-emacs-directory "core/startup.el")) -(narf/init - '(core ; yoink @ core.el - core-ui ; aesthetics - core-evil ; evil-mode and its plugins - core-editor ; completing the editor - core-company ; for the lazy typist +(defconst narf-default-font '(:family "terminus (ttf)" :size 12 :antialias nil)) +(defconst narf-default-theme (if window-system 'narf-dark 'wombat)) - init-auto-insert ; see above - init-fly ; fly(check|spell) - init-vc ; version control gutter + git modes - init-ido ; a search engine for your car keys - init-helm ; a search engine for your life - init-project ; dired, neotree +(setq user-emacs-directory "~/Dropbox/Projects/dev/narf-emacs/") +(load (concat user-emacs-directory "core/core.el")) +(mapc 'require + '()) + ;; (;; Settings for specific modes or tools + ;; init-cc ; c/c++/obj-c madness + ;; ;; init-cscope + ;; ;; init-csharp ; unity, mono and xamarin + ;; init-data ; dbs 'n data formats + ;; ;; init-eshell + ;; ;; init-go + ;; init-java ; the poster child for carpal tunnel syndome + ;; init-js ; alert("not java, javascript!") + ;; init-lisp ; elisp, clisp and clojure + ;; init-lua ; one-based indices? one-based indices. + ;; init-org ; for fearless [organized] leader + ;; init-php ; making php less painful to work with + ;; init-python ; beautiful is better than ugly + ;; init-regex ; /^[^\s](meaning)[^\n]*/ + ;; init-ruby ; <3 + ;; init-scss ; @include magic; + ;; init-sh ; #!/bin/bash_your_head_in + ;; ;; init-sonicpi ; the funk soul brotha + ;; ;; init-swift ; yay, emoji variabless! + ;; init-text ; i got nothing... + ;; ;; init-rust + ;; ;; init-r ; for science! + ;; init-vim ; the confessional + ;; init-web ; for the 2.0'er - init-cc ; C/C++/Obj-C madness - ;; init-cscope - ;; init-csharp ; unity, mono and xamarin - init-data ; DBs 'n data formats - ;; init-eshell - ;; init-go - init-java ; the poster child for carpal tunnel syndome - init-js ; alert("not java, javascript!") - init-lisp ; elisp, clisp and clojure - init-lua ; one-based indices? One-based indices. - init-org ; for fearless [organized] leader - init-php ; making php less painful to work with - init-python ; beautiful is better than ugly - init-regex ; /^[^\s](meaning)[^\n]*/ - init-ruby ; <3 - init-scss ; @include magic; - init-sh ; #!/bin/bash_your_head_in + ;; bindings + ;; commands + ;; ) +;; ) - ;; init-sonicpi ; - ;; init-swift ; yay, emoji variabless! - init-text ; I got nothing... - ;; init-rust - ;; init-r ; for science! - init-vim ; the confessional - init-web ; for the 2.0'er - init-workgroups ; session management I can understand - init-yasnippet ; type for me - - narf-bindings - narf-commands - narf-settings - )) +(require 'local nil t) +(message ">>> Loaded in %s" (emacs-init-time)) -;;; Are you pondering what I'm pondering Pinky? +;;; I think so Brain... diff --git a/init/init-auto-insert.el b/init/init-auto-insert.el deleted file mode 100644 index 61d6f2333..000000000 --- a/init/init-auto-insert.el +++ /dev/null @@ -1,91 +0,0 @@ -(use-package autoinsert - :config - (progn - ;; (setq auto-insert-directory "%/.emacs.d/templates/") - (setq auto-insert-query nil) ; Don't prompt before insertion - (setq auto-insert-alist '()) - - (auto-insert-mode 1))) - -(after "yasnippet" - (defun add-template (regexp-or-major-mode uuid yas-mode &optional project-only) - (define-auto-insert regexp-or-major-mode - `(lambda () (insert-template ,uuid ',yas-mode ,project-only)))) - - (defun insert-template (uuid mode &optional project-only) - "Expand snippet template in MODE by its UUID" - (unless (or (and project-only (not (narf/project-p))) - (not (or (eq major-mode mode) - (symbol-value mode)))) - (insert uuid) - (yas-expand-from-trigger-key) - (if (string-equal uuid (s-trim (buffer-string))) - (erase-buffer) - (evil-insert-state 1)))) - - (add-template "/\\.gitignore$" "%%" 'gitignore-mode) - - ;; C/C++ - (add-template "/Makefile$" "%%" 'makefile-gmake-mode) - (add-template "/main\\.\\(cc\\|cpp\\)$" "%main.cpp%" 'c++-mode) - (add-template "/win32_\\.\\(cc\\|cpp\\)$" "%winmain.cpp%" 'c++-mode) - (add-template "\\.\\([Hh]\\|hpp\\)$" "%.h%" 'c++-mode) - (add-template "\\.\\([Cc]\\|cc\\|cpp\\)$" "%.cpp%" 'c++-mode) - - ;; Shell scripts - (add-template "\\.z?sh$" "%%" 'sh-mode) - - ;; Ruby - (add-template "/spec_helper\\.rb$" "%helper%" 'rspec-mode t) - (add-template "_spec\\.rb$" "%%" 'rspec-mode t) - (add-template "/\\.rspec$" "%.rspec%" 'rspec-mode) - (add-template "/Rakefile$" "%Rakefile%" 'ruby-mode t) - (add-template "/Gemfile$" "%Gemfile%" 'ruby-mode t) - ;; (add-template "\\.gemspec$" "%.gemspec%" 'ruby-mode t) - (add-template "/lib/.+\\.rb$" "%module%" 'ruby-mode t) - (add-template "\\.rb$" "%%" 'ruby-mode) - - ;; ;; Python - ;; (add-template "tests?/test_.+\\.py$" "%%" 'nose-mode) - ;; (add-template "/setup\\.py$" "%setup%" 'python-mode) - (add-template "\\.py$" "%%" 'python-mode) - - ;; ;; PHP - ;; (add-template "\\.class\\.php$" "%class%" 'php-mode) - ;; (add-template "\\.php$" "%%" 'php-mode) - - ;; ;; Markdown - (add-template "\\.md$" "%%" 'markdown-mode) - ;; (add-template "/_posts/.+\\.md$" "%jekyll-post" 'markdown-mode) - ;; (add-template "/_layouts/.+\\.html$" "%jekyll-layout%" 'web-mode) - - ;; ;; Javascript - (add-template "\\.lbaction/Contents/Info.plist$" "%Info.plst%" 'lb6-mode) - (add-template "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "%default.js%" 'lb6-mode) - ;; (add-template "/package\\.json$" "%package.json%" 'json-mode) - ;; (add-template "\\.\\(json\\|jshintrc\\)$" "%%" 'json-mode) - - ;; ;; SCSS - ;; (add-template "/master\\.scss$" "%master%" 'scss-mode) - ;; (add-template "/normalize\\.scss$" "%normalize%" 'scss-mode) - ;; (add-template "\\.scss$" "%%" 'scss-mode) - - ;; ;; HTML - ;; (add-template "\\.html$" "%%" 'web-mode) - - ;; Lua - ;; (add-template "\\.love/main\\.lua$" "%love.main%" 'lua-mode) - (add-template "/conf\\.lua$" "%love.conf%" 'love-mode) - ;; (add-template "\\.lua$" "%%" 'lua-mode) - - ;; ;; Java - (add-template "/src/.+/.+\\.java$" "%%" 'java-mode) - (add-template "/build\\.gradle$" "%gradle%" 'android-mode) - - ;; ;; Elisp - (add-template "\\.emacs\\.d/.+\\.el$" "%initfile%" 'emacs-lisp-mode) - (add-template "\\.emacs\\.d/snippets/.+$" "%%" 'snippet-mode)) - - -(provide 'init-auto-insert) -;;; init-auto-insert.el ends here diff --git a/init/init-cc.el b/init/init-cc.el deleted file mode 100644 index b0998df82..000000000 --- a/init/init-cc.el +++ /dev/null @@ -1,153 +0,0 @@ -(use-package cmake-mode - :mode "CMakeLists\\.txt$" - :config - (progn - (after "company" - (use-package company-cmake - :config - (narf/add-company-backend cmake-mode (company-cmake company-yasnippet)))))) - -(use-package glsl-mode - :mode (("\\.glsl\\'" . glsl-mode) - ("\\.vert\\'" . glsl-mode) - ("\\.frag\\'" . glsl-mode) - ("\\.geom\\'" . glsl-mode))) - -(use-package cc-mode - :defines (c-syntactic-context) - :functions (c-toggle-electric-state c-toggle-auto-newline - c-skip-comments-and-strings c-forward-sws c-end-of-macro - c-font-lock-invalid-string csharp-log c-font-lock-declarators - c-get-lang-constant c-forward-keyword-clause - c-fontify-recorded-types-and-refs c-forward-type imenu--split - c-backward-sws c-determine-limit c-beginning-of-decl-1) - :commands (c-mode c++-mode objc-mode java-mode) - :init - (progn - (associate-mode "\\.h$" 'c++-mode) - (associate-mode "\\.mm$" 'objc-mode)) - :config - (progn - ;; Settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;; - (setq c-basic-offset 4 - c-tab-always-indent nil - c-electric-flag nil) - - (progn ; C/C++ Settings - (after "flycheck" - (when IS-MAC - (setq flycheck-clang-language-standard "c++11" - flycheck-clang-standard-library "libc++" - flycheck-c/c++-clang-executable "clang++" - flycheck-clang-include-path '("/usr/local/include")))) - - (after "company" - ;; TODO Clang is *really* slow in larger projects, maybe replace it with irony-mode or ycmd? - (narf/add-company-backend c-mode (company-c-headers company-clang)) - (narf/add-company-backend c++-mode (company-c-headers company-clang)) - (narf/add-company-backend objc-mode (company-c-headers company-xcode))) - - (defun narf--c-lineup-inclass (langelem) - (let ((inclass (assoc 'inclass c-syntactic-context))) - (save-excursion - (goto-char (c-langelem-pos inclass)) - (if (or (looking-at "struct") - (looking-at "typedef struct")) - '+ - '++)))) - (defun narf|init-c/c++-settings () - (c-toggle-electric-state -1) - (c-toggle-auto-newline -1) - (c-set-offset 'substatement-open '0) ; brackets should be at same indentation level as the statements they open - (c-set-offset 'inline-open '+) - (c-set-offset 'block-open '+) - (c-set-offset 'brace-list-open '+) ; all "opens" should be indented by the c-indent-level - (c-set-offset 'case-label '+) ; indent case labels by c-indent-level, too - (c-set-offset 'access-label '-) - (c-set-offset 'inclass 'narf--c-lineup-inclass) - ;; DEL mapping interferes with smartparens and my custom DEL binding - (define-key c-mode-map (kbd "DEL") nil)) - (add-hook 'c-mode-hook 'narf|init-c/c++-settings) - (add-hook 'c++-mode-hook 'narf|init-c/c++-settings) - - ;; C++11 syntax support (until cc-mode is updated) - (require 'font-lock) - (defun --copy-face (new-face face) - "Define NEW-FACE from existing FACE." - (copy-face face new-face) - (eval `(defvar ,new-face nil)) - (set new-face new-face)) - - (--copy-face 'font-lock-label-face ; labels, case, public, private, proteced, namespace-tags - 'font-lock-keyword-face) - (--copy-face 'font-lock-doc-markup-face ; comment markups such as Javadoc-tags - 'font-lock-doc-face) - (--copy-face 'font-lock-doc-string-face ; comment markups - 'font-lock-comment-face) - (global-font-lock-mode t) - (setq font-lock-maximum-decoration t) - - (add-hook! 'c++-mode-hook - ;; We could place some regexes into `c-mode-common-hook', but - ;; note that their evaluation order matters. - (font-lock-add-keywords - nil '(;; complete some fundamental keywords - ("\\<\\(void\\|unsigned\\|signed\\|char\\|short\\|bool\\|int\\|long\\|float\\|double\\)\\>" . font-lock-keyword-face) - ;; namespace names and tags - these are rendered as constants by cc-mode - ("\\<\\(\\w+::\\)" . font-lock-function-name-face) - ;; new C++11 keywords - ("\\<\\(alignof\\|alignas\\|constexpr\\|decltype\\|noexcept\\|nullptr\\|static_assert\\|thread_local\\|override\\|final\\)\\>" . font-lock-keyword-face) - ("\\<\\(char16_t\\|char32_t\\)\\>" . font-lock-keyword-face) - ;; PREPROCESSOR_CONSTANT, PREPROCESSORCONSTANT - ("\\<[A-Z]*_[A-Z_]+\\>" . font-lock-constant-face) - ("\\<[A-Z]\\{3,\\}\\>" . font-lock-constant-face) - ;; hexadecimal numbers - ("\\<0[xX][0-9A-Fa-f]+\\>" . font-lock-constant-face) - ;; integer/float/scientific numbers - ("\\<[\\-+]*[0-9]*\\.?[0-9]+\\([ulUL]+\\|[eE][\\-+]?[0-9]+\\)?\\>" . font-lock-constant-face) - ;; c++11 string literals - ;; L"wide string" - ;; L"wide string with UNICODE codepoint: \u2018" - ;; u8"UTF-8 string", u"UTF-16 string", U"UTF-32 string" - ("\\<\\([LuU8]+\\)\".*?\"" 1 font-lock-keyword-face) - ;; R"(user-defined literal)" - ;; R"( a "quot'd" string )" - ;; R"delimiter(The String Data" )delimiter" - ;; R"delimiter((a-z))delimiter" is equivalent to "(a-z)" - ("\\(\\<[uU8]*R\"[^\\s-\\\\()]\\{0,16\\}(\\)" 1 font-lock-keyword-face t) ; start delimiter - ( "\\<[uU8]*R\"[^\\s-\\\\()]\\{0,16\\}(\\(.*?\\))[^\\s-\\\\()]\\{0,16\\}\"" 1 font-lock-string-face t) ; actual string - ( "\\<[uU8]*R\"[^\\s-\\\\()]\\{0,16\\}(.*?\\()[^\\s-\\\\()]\\{0,16\\}\"\\)" 1 font-lock-keyword-face t) ; end delimiter - - ;; user-defined types (rather project-specific) - ("\\<[A-Za-z_]+[A-Za-z_0-9]*_\\(type\\|ptr\\)\\>" . font-lock-type-face) - ("\\<\\(xstring\\|xchar\\)\\>" . font-lock-type-face) - )) t) - - ;; Fix enum and C++11 lambda indentation - (defadvice c-lineup-arglist (around c-lineup-arglist-indent-fix activate) - "Improve indentation of continued C++11 lambda function opened as argument." - (setq ad-return-value - (if (and (equal major-mode 'c++-mode) - (ignore-errors - (save-excursion - (goto-char (c-langelem-pos langelem)) - ;; Detect "[...](" or "[...]{". preceded by "," or "(", - ;; and with unclosed brace. - (looking-at ".*[(,][ \t]*\\[[^]]*\\][ \t]*[({][^}]*$")))) - 0 ; no additional indent - ad-do-it)))) - - (progn ; Obj-C - (add-to-list 'magic-mode-alist - `(,(lambda () - (and (string= (file-name-extension buffer-file-name) "h") - (re-search-forward "@\\" - magic-mode-regexp-match-limit t))) - . objc-mode)) - (after "flycheck" - (add-hook! 'objc-mode-hook (use-package flycheck-objc)))) - )) - - -(provide 'init-cc) -;;; init-cc.el ends here diff --git a/init/init-cscope.el b/init/init-cscope.el deleted file mode 100644 index 01fb8e7c0..000000000 --- a/init/init-cscope.el +++ /dev/null @@ -1,11 +0,0 @@ - -(use-package xcscope - :init (cscope-setup) - :config - ;; (push '("*cscope*" :position bottom) popwin:special-display-config) - ) - -(add-hook 'ruby-mode-hook (function cscope-minor-mode)) - - -(provide 'init-cscope) diff --git a/init/init-csharp.el b/init/init-csharp.el deleted file mode 100644 index 74ad7da78..000000000 --- a/init/init-csharp.el +++ /dev/null @@ -1,25 +0,0 @@ -(use-package csharp-mode :mode "\\.cs$" - :init - (add-hook 'csharp-mode-hook 'flycheck-mode) - :config - (progn - (use-package omnisharp - :defer t - :config - (progn - (setq omnisharp-server-executable-path - "~/Dropbox/projects/lib/Omnisharp/server/OmniSharp/bin/Debug/OmniSharp.exe") - - (bind :normal :map omnisharp-mode-map - "gd" 'omnisharp-go-to-definition) - - (after "company" - (narf/add-company-backend csharp-mode (company-omnisharp)) - (add-hook 'csharp-mode-hook 'turn-on-eldoc-mode)))))) - -;; unity shaders -(use-package shaderlab-mode :mode "\\.shader$") - - -(provide 'init-csharp) -;;; init-csharp.el ends here diff --git a/init/init-data.el b/init/init-data.el deleted file mode 100644 index 604a96adf..000000000 --- a/init/init-data.el +++ /dev/null @@ -1,11 +0,0 @@ -(use-package yaml-mode - :mode "\\.ya?ml$" - :init (add-hook 'yaml-mode-hook 'narf|enable-tab-width-2)) - -(use-package json-mode - :mode (("\\.json$" . json-mode) - ("\\.jshintrc$" . json-mode))) - - -(provide 'init-data) -;;; init-data.el ends here diff --git a/init/init-eshell.el b/init/init-eshell.el deleted file mode 100644 index c82db062b..000000000 --- a/init/init-eshell.el +++ /dev/null @@ -1,50 +0,0 @@ -;; (evil-set-initial-state 'eshell-mode 'emacs) - -;; (push '("*eshell*" :position left :width 80 :stick t) popwin:special-display-config) - -;; ;; eshell -;; (setq eshell-directory-name (concat TMP-DIR "eshell")) -;; (setq eshell-scroll-to-bottom-on-input 'all) -;; (setq eshell-buffer-shorthand t) - - -;; ;; em-alias -;; (setq eshell-aliases-file (concat TMP-DIR ".eshell-aliases")) - - -;; ;; em-glob -;; (setq eshell-glob-case-insensitive t) -;; (setq eshell-error-if-no-glob t) - - -;; ;; em-hist -;; (setq eshell-history-size 1024) - - -;; ;; plan 9 smart shell -;; ;; (after "esh-module" -;; ;; (add-to-list 'eshell-modules-list 'eshell-smart) -;; ;; (setq eshell-where-to-jump 'begin) -;; ;; (setq eshell-review-quick-commands nil) -;; ;; (setq eshell-smart-space-goes-to-end t)) - -;; (defun my-current-git-branch () -;; (let ((branch (car (loop for match in (split-string (shell-command-to-string "git branch") "\n") -;; when (string-match "^\*" match) -;; collect match)))) -;; (if (not (eq branch nil)) -;; (concat " [" (substring branch 2) "]") -;; ""))) - -;; (defun my-eshell-prompt () -;; (concat (propertize (abbreviate-file-name (eshell/pwd)) 'face 'eshell-prompt) -;; (propertize (my-current-git-branch) 'face 'font-lock-function-name-face) -;; (propertize " $ " 'face 'font-lock-constant-face))) - - -;; ;; em-prompt -;; (setq eshell-prompt-function 'my-eshell-prompt) - - -(provide 'init-eshell) -;;; init-eshell.el ends here diff --git a/init/init-fly.el b/init/init-fly.el deleted file mode 100644 index 9fff7c27f..000000000 --- a/init/init-fly.el +++ /dev/null @@ -1,45 +0,0 @@ -(use-package flycheck - :functions (flycheck-buffer) - :commands (flycheck-mode flycheck-list-errors) - :init - (add-to-hooks 'flycheck-mode '(ruby-mode-hook - python-mode-hook - php-mode-hook - lua-mode-hook - shell-mode-hook - scss-mode-hook - c++-mode-hook - c-mode-hook)) - :config - (progn ; flycheck settings - (defun my-shorter-fly-status (result) - (format "[%s]" (replace-regexp-in-string " FlyC:?" "" result))) - (advice-add 'flycheck-mode-line-status-text :filter-return 'my-shorter-fly-status) - - (setq-default flycheck-indication-mode 'right-fringe - ;; Removed checks on idle/change for snappiness - flycheck-check-syntax-automatically '(save mode-enabled idle-change) - flycheck-disabled-checkers '(emacs-lisp-checkdoc make)) - - (narf/add-throwaway-buffer "^\\*Flycheck.*\\*$") - - (bind :normal :map flycheck-error-list-mode-map - [escape] 'kill-this-buffer - "q" 'kill-this-buffer) - - (evil-initial-state 'flycheck-error-list-mode 'emacs) - - (defun narf/evil-flycheck-buffer () - (if (and (featurep 'flycheck) flycheck-mode) - (flycheck-buffer))) - - ;; Check buffer when normal mode is entered - (add-hook 'evil-normal-state-entry-hook 'narf/evil-flycheck-buffer) - ;; And on ESC in normal mode. - (advice-add 'evil-force-normal-state :after 'narf/evil-flycheck-buffer))) - -(use-package flyspell :commands flyspell-mode) - - -(provide 'init-fly) -;;; init-fly.el ends here diff --git a/init/init-go.el b/init/init-go.el deleted file mode 100644 index 63d858d7d..000000000 --- a/init/init-go.el +++ /dev/null @@ -1,14 +0,0 @@ -(use-package go-mode - :mode "\\.go$" - :interpreter "go" - :config - (progn - (bind normal :map go-mode-map "gd" 'godef-jump) - - (use-package company-go - :config - (narf/add-company-backend go-mode (company-go company-yasnippet))))) - - -(provide 'init-go) -;;; init-go.el ends here diff --git a/init/init-helm.el b/init/init-helm.el deleted file mode 100644 index a5445d1f3..000000000 --- a/init/init-helm.el +++ /dev/null @@ -1,176 +0,0 @@ -(use-package helm - :commands (helm - helm-etags-select - helm-show-kill-ring - helm-bookmarks - helm-wg - helm-ag - helm-alive-p - helm-attrset) - :init - (progn - (defvar helm-global-prompt ">>> ") - (evil-set-initial-state 'helm-mode 'emacs)) - :config - (progn - (use-package helm-grep) - (use-package helm-ag - :functions (helm-ag--select-source) - :defines (helm-ag-source helm-ag--last-query)) - - ;; No persistent header - (defun narf--helm-display-mode-line (source &optional force) - (setq mode-line-format nil) - (setq header-line-format nil)) - (advice-add 'helm-display-mode-line :override 'narf--helm-display-mode-line) - - ;; Minimalistic split-fn; leaves popwin to handle helm buffers - (defun narf--helm-split-window-fn (window) - (if (one-window-p t) - (let ((helm-full-frame t)) - (selected-window)) - (other-window-for-scrolling))) - - (setq helm-quick-update t - helm-idle-delay 0.05 - helm-input-idle-delay 0.05 - helm-reuse-last-window-split-state t - helm-buffers-fuzzy-matching t - helm-candidate-number-limit 40 - helm-bookmark-show-location t - helm-split-window-default-side 'other - helm-split-window-preferred-function 'narf--helm-split-window-fn) ; let popwin handle this - - (after "winner" - ;; Tell winner-mode to ignore helm buffers - (dolist (bufname '("*helm recentf*" - "*helm projectile*" - "*helm imenu*" - "*helm company*" - "*helm buffers*" - ;; "*helm tags*" - "*helm-ag*" - "*Helm Swoop*")) - (push bufname winner-boring-buffers))) - (narf/add-throwaway-buffer "^\\*[Hh]elm.*\\*$") - - (bind :map helm-map - "C-w" 'evil-delete-backward-word - "C-u" 'helm-delete-minibuffer-contents - "C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious! - [escape] 'helm-keyboard-quit))) - -(use-package projectile - :commands (projectile-ack - projectile-ag - projectile-compile-project - projectile-dired - projectile-grep - projectile-find-dir - projectile-find-file - projectile-find-tag - projectile-find-test-file - projectile-invalidate-cache - projectile-kill-buffers - projectile-multi-occur - projectile-project-root - projectile-recentf - projectile-regenerate-tags - projectile-replace - projectile-run-async-shell-command-in-root - projectile-run-shell-command-in-root - projectile-switch-project - projectile-switch-to-buffer - projectile-vc - projectile-project-p - projectile-global-mode - helm-projectile-switch-to-buffer - helm-projectile-find-file - helm-projectile-recentf - helm-projectile-find-other-file - helm-projectile-switch-project) - :diminish projectile-mode - :config - (progn - (defun narf/project-invalidate-cache-maybe () - (when (projectile-project-p) (projectile-invalidate-cache nil))) - (add-hook 'kill-emacs-hook 'narf/project-invalidate-cache-maybe) - (setq-default projectile-enable-caching t) - (setq projectile-sort-order 'recentf - projectile-cache-file (concat TMP-DIR "projectile.cache") - projectile-known-projects-file (concat TMP-DIR "projectile.projects") - projectile-indexing-method 'alien - projectile-project-root-files narf/project-root-files) - (add-to-list 'projectile-globally-ignored-files "ido.last") - (add-to-list 'projectile-globally-ignored-directories "assets") - (add-to-list 'projectile-other-file-alist '("scss" "css")) - (add-to-list 'projectile-other-file-alist '("css" "scss")) - - (use-package helm-projectile) - (projectile-global-mode +1) - - ;; Don't show the project name in the prompts; I already know. - (defun projectile-prepend-project-name (string) helm-global-prompt))) - -(use-package helm-org - :commands (helm-org-in-buffer-headings - helm-org-agenda-files-headings - helm-org-capture-templates) - :config - (defun helm-get-org-candidates-in-file (filename min-depth max-depth - &optional fontify nofname) - (with-current-buffer (pcase filename - ((pred bufferp) filename) - ((pred stringp) (find-file-noselect filename))) - (and fontify (jit-lock-fontify-now)) - (let ((match-fn (if fontify 'match-string 'match-string-no-properties))) - (save-excursion - (goto-char (point-min)) - (cl-loop with width = (window-width) - while (re-search-forward org-complex-heading-regexp nil t) - if (let ((num-stars (length (match-string-no-properties 1)))) - (and (>= num-stars min-depth) (<= num-stars max-depth))) - collect `(,(let ((heading (funcall match-fn 4)) - (file (unless nofname - (concat (f-no-ext (f-relative filename org-directory)) ":"))) - (level (length (match-string-no-properties 1)))) - (org-format-outline-path - (append (org-get-outline-path t level heading) - (list heading)) width file)) - . ,(point-marker)))))))) - -(use-package helm-files - :commands helm-recentf - :config - (progn - ;; Reconfigured `helm-recentf' to use `helm', instead of `helm-other-buffer' - (defun helm-recentf () - (interactive) - (let ((helm-ff-transformer-show-only-basename nil)) - (helm :sources '(helm-source-recentf) - :buffer "*helm recentf*" - :prompt helm-global-prompt))))) - -(use-package helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss - :commands (helm-css-scss - helm-css-scss-multi - helm-css-scss-insert-close-comment)) - -(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop - :defines (helm-swoop-last-prefix-number) - :commands (helm-swoop helm-multi-swoop helm-multi-swoop-all) - :config - (setq helm-swoop-use-line-number-face t - helm-swoop-split-with-multiple-windows t - helm-swoop-speed-or-color t)) - -(use-package helm-c-yasnippet :commands helm-yas-visit-snippet-file) -(use-package helm-buffers :commands helm-buffers-list) -(use-package helm-semantic :commands helm-semantic-or-imenu) -(use-package helm-elisp :commands helm-apropos) -(use-package helm-command :commands helm-M-x) -(use-package helm-company :defer t) - - -(provide 'init-helm) -;;; init-helm.el ends here diff --git a/init/init-ido.el b/init/init-ido.el deleted file mode 100644 index f06d74f67..000000000 --- a/init/init-ido.el +++ /dev/null @@ -1,62 +0,0 @@ -(use-package ido - :defines (flx-ido-mode ido-ubiquitous-debug-mode ido-context-switch-command ido-temp-list) - :functions (ido-to-end) - :commands (ido-mode - ido-everywhere - ido-vertical-mode - flx-ido-mode - ido-ubiquitous-mode - ido-find-file - ido-find-file-in-dir) - :config - (progn - (ido-mode 1) - (ido-everywhere 1) - - (use-package ido-vertical-mode :config (ido-vertical-mode 1)) - (use-package flx-ido :config (flx-ido-mode 1)) - (use-package ido-ubiquitous :config (ido-ubiquitous-mode 1)) - - (setq ido-use-faces nil - ido-confirm-unique-completion t - ido-case-fold t - ido-enable-tramp-completion nil - ido-enable-flex-matching t - ido-create-new-buffer 'always - ido-enable-tramp-completion t - ido-enable-last-directory-history t - ido-save-directory-list-file (concat TMP-DIR "ido.last")) - - (add-to-list 'ido-ignore-files "\\`.DS_Store$") - (add-to-list 'ido-ignore-files "Icon\\?$") - (setq ido-ignore-buffers - '("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer" - "^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-" - "_region_" " output\\*$" "^TAGS$" "^\*Ido")) - - ; sort ido filelist by mtime instead of alphabetically - (add-hook 'ido-make-file-list-hook 'ido-sort-mtime) - (add-hook 'ido-make-dir-list-hook 'ido-sort-mtime) - (defun ido-sort-mtime () - (setq ido-temp-list - (sort ido-temp-list - (lambda (a b) - (time-less-p - (sixth (file-attributes (concat ido-current-directory b))) - (sixth (file-attributes (concat ido-current-directory a))))))) - (ido-to-end ;; move . files to end (again) - (delq nil (mapcar - (lambda (x) (and (char-equal (string-to-char x) ?.) x)) - ido-temp-list)))) - - ;; Press ~ to go to $HOME in ido - (add-hook! 'ido-setup-hook - ;; Go straight home - (define-key ido-file-completion-map (kbd "~") - (λ (if (looking-back "/") - (insert "~/") - (call-interactively 'self-insert-command))))))) - - -(provide 'init-ido) -;;; init-ido.el ends here diff --git a/init/init-java.el b/init/init-java.el deleted file mode 100644 index cbd3edf06..000000000 --- a/init/init-java.el +++ /dev/null @@ -1,84 +0,0 @@ -(defun narf/java-project-package () - (if (eq major-mode 'java-mode) - (s-chop-suffix "." (s-replace "/" "." (f-dirname (f-relative (buffer-file-name) - (concat (narf/project-root) "/src/"))))) - "")) - -(defun narf/java-class-name () - (if (eq major-mode 'java-mode) - (f-no-ext (f-base (buffer-file-name))) - "")) - -(use-package eclim - :functions (eclim--project-dir eclim--project-name) - :commands (eclim-mode global-eclim-mode) - :init - (progn - (setq eclim-eclipse-dirs '("/Applications/eclipse") - eclim-executable "/Applications/eclipse/eclim") - (when (file-exists-p eclim-executable) - (add-hook 'java-mode-hook 'eclim-mode))) - :config - (progn - ;; (use-package eclim-ant) - ;; (use-package eclim-maven) - (use-package eclim-problems) - (use-package eclim-project) - (use-package eclimd) - - (setq help-at-pt-display-when-idle t) - (setq help-at-pt-timer-delay 0.1) - (help-at-pt-set-timer) - - (push "*eclim: problems*" winner-boring-buffers) - - (after "company" - (use-package company-emacs-eclim - :config (company-emacs-eclim-setup))) - - (bind :motion :map java-mode-map "gd" 'eclim-java-find-declaration))) - -(use-package android-mode - :commands android-mode - :init - (progn - ;; yasnippet defuns - (defun android-mode-is-layout-file () - (and android-mode - (eq major-mode 'nxml-mode) - (string-equal (file-name-base (directory-file-name default-directory)) "layout"))) - - (defun android-mode-in-tags (&rest tags) - (-contains? tags (android-mode-tag-name))) - - (defun android-mode-tag-name () - (save-excursion - (let (beg end) - (nxml-backward-up-element) - (evil-forward-word-begin) - (setq beg (point)) - (evil-forward-WORD-end) - (setq end (1+ (point))) - (buffer-substring-no-properties beg end)))) - - (defun narf|android-mode-enable-maybe () - (let ((root (narf/project-root))) - (when (or (narf/project-has-files "local.properties" root) - (narf/project-has-files "AndroidManifest.xml" root) - (narf/project-has-files "src/main/AndroidManifest.xml" root)) - (android-mode +1) - (narf/set-build-command "./gradlew %s" "build.gradle")))) - - (after "company" (add-to-list 'company-dictionary-major-minor-modes 'android-mode)) - (add-hook 'java-mode-hook 'narf|android-mode-enable-maybe) - (add-hook 'groovy-mode-hook 'narf|android-mode-enable-maybe) - (add-hook 'nxml-mode-hook 'narf|android-mode-enable-maybe) - (add-hook! 'android-mode-hook (narf/init-yas-mode 'android-mode)))) - -(use-package groovy-mode - :functions (is-groovy-mode) - :mode "\\.gradle$") - - -(provide 'init-java) -;;; init-java.el ends here diff --git a/init/init-js.el b/init/init-js.el deleted file mode 100644 index e6552386c..000000000 --- a/init/init-js.el +++ /dev/null @@ -1,57 +0,0 @@ -(use-package js2-mode - :mode "\\.js$" - :interpreter "node" - :config - (progn - (setq js2-skip-preprocessor-directives t) - (setq-default js2-show-parse-errors nil) - (setq-default js2-global-externs '("module" "require" "buster" "sinon" "assert" - "refute" "setTimeout" "clearTimeout" - "setInterval" "clearInterval" "location" - "__dirname" "console" "JSON" "jQuery" "$" - ;; Launchbar API - "LaunchBar" "File" "Action" "HTTP" "include")) - - (after "web-beautify" - (add-hook! 'js2-mode-hook (setenv "jsbeautify_indent_size" "4")) - (bind :motion :map js2-mode-map "gQ" 'web-beautify-js)) - - (after "emr" (use-package js2-refactor)) - - ;; [pedantry intensifies] - (defadvice js2-mode (after js2-mode-rename-modeline activate) - (setq mode-name "Javascript2")) - - (use-package tern - :diminish (tern-mode . "tern") - :commands tern-mode - :init - (add-hook 'js2-mode-hook 'tern-mode) - :config - (after "company" - (use-package company-tern - :config - (narf/add-company-backend js2-mode (company-tern))))))) - -;; For UnityScript -(use-package unityjs-mode - :mode "/Assets/*.js$" - :config - (progn - (add-hook 'unityjs-mode-hook 'flycheck-mode) - (add-hook! 'unityjs-mode-hook - (narf|enable-tab-width-2) - (setq js-indent-level 2)))) - -;; For launchbar script development -(define-minor-mode lb6-mode - "Launchbar development mode." - :init-value nil - :lighter "lb6" - :keymap (make-sparse-keymap) - (narf/init-yas-mode 'lb6-mode)) -(associate-minor-mode "\\.lb\\(action\\|ext\\)/.*$" 'lb6-mode) - - -(provide 'init-js) -;;; init-js.el ends here diff --git a/init/init-lisp.el b/init/init-lisp.el deleted file mode 100644 index 55aac4225..000000000 --- a/init/init-lisp.el +++ /dev/null @@ -1,19 +0,0 @@ - -;; TODO: Do this later - -(add-hook! 'hs-minor-mode-hook (when hs-minor-mode (hs-hide-level 3))) - -;; [pedantry intensifies] -(defadvice emacs-lisp-mode (after emacs-lisp-mode-rename-modeline activate) - (setq mode-name "Elisp")) - -;; Real go-to-definition for elisp -(bind :motion :map emacs-lisp-mode-map - "gd" (λ (let ((func (function-called-at-point))) - (if func (find-function func)))) - "gD" (λ (let ((func (function-called-at-point))) - (if func (find-function-other-window func))))) - - -(provide 'init-lisp) -;;; init-lisp.el ends here diff --git a/init/init-lua.el b/init/init-lua.el deleted file mode 100644 index 9f3fc9f7d..000000000 --- a/init/init-lua.el +++ /dev/null @@ -1,28 +0,0 @@ -(use-package lua-mode - :mode "\\.lua$" - :interpreter "lua" - :init - (progn - (setq lua-indent-level tab-width) - - (when (file-exists-p "/Applications/love.app") - (define-minor-mode love-mode - "Buffer local minor mode for Love2D" - :init-value nil - :lighter " <3" - :keymap (make-sparse-keymap) - (narf/init-yas-mode 'love-mode)) - (add-hook! 'lua-mode-hook - (narf/set-build-command "open -a love.app '%s'" "main.lua") - (when (narf/project-has-files "main.lua") - (love-mode +1)))) - - (after "company" (add-to-list 'company-dictionary-major-minor-modes 'love-mode)) - - (add-hook! 'lua-mode-hook - (narf|enable-tab-width-2) - (setq lua-indent-level 2)))) - - -(provide 'init-lua) -;;; init-lua.el ends here diff --git a/init/init-org.el b/init/init-org.el deleted file mode 100644 index 94fbb839a..000000000 --- a/init/init-org.el +++ /dev/null @@ -1,255 +0,0 @@ -(define-minor-mode evil-org-mode - "Evil-mode bindings for org-mode." - :init-value nil - :lighter "!" - :keymap (make-sparse-keymap) ; defines evil-org-mode-map - :group 'evil-org) - -(use-package org - :defines (org-directory) - :functions (org-bookmark-jump-unhide outline-next-heading org-end-of-subtree - outline-flag-region org-remove-inline-images org-display-inline-images - org-at-item-checkbox-p org-toggle-checkbox org-entry-is-todo-p org-todo - org-format-outline-path org-get-outline-path) - :commands (org-capture - org-capture-string) - :mode (("\\.org$" . org-mode) - ("\\.opml$" . org-mode)) - :init - (progn - (add-hook 'org-mode-hook 'narf|enable-tab-width-2) - (add-hook 'org-mode-hook 'narf|enable-hard-wrap) - (add-hook 'org-mode-hook 'iimage-mode) - (add-hook 'org-mode-hook 'org-indent-mode) - (add-hook 'org-mode-hook 'evil-org-mode) - (add-hook! 'org-mode-hook (hl-line-mode -1))) - :config - (progn - (after "org-indent" (diminish 'org-indent-mode)) - (after "iimage" (diminish 'iimage-mode)) - - (setq org-directory "~/Dropbox/notes") - (setq org-project-directory (expand-file-name "projects" org-directory) ; custom variable - org-default-notes-file (expand-file-name "notes.org" org-directory) - org-agenda-files (f-entries org-directory (lambda (path) (and (f-ext? path "org") - (not (f-same? path (f-expand "inbox.org" org-directory))))) t) - org-archive-location (concat org-directory "/archive/%s::") - org-confirm-babel-evaluate nil - org-src-tab-acts-natively t - org-image-actual-width 250 - org-startup-with-inline-images t - org-completion-use-ido t - org-hidden-keywords '(title) - org-special-ctrl-a/e t - org-hide-leading-stars t - org-hierarchical-todo-statistics t - org-checkbox-hierarchical-statistics t - org-tags-column -87 - org-log-done t - org-confirm-elisp-link-function nil - org-startup-folded 'content - org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") - (sequence "DOING(s)" "PENDING(p)") - (sequence "|" "CANCELLED(c)")) - org-mobile-directory "~/Dropbox/Apps/MobileOrg" - org-mobile-inbox-for-pull (expand-file-name "mobile.org" org-directory)) - - (setq org-src-fontify-natively t - org-blank-before-new-entry '((heading . auto) (plain-list-item . auto)) - org-export-backends '(ascii html latex md opml)) - - (add-to-list 'org-link-frame-setup '(file . find-file)) - - (setq org-tag-alist '(("@home" . ?h) - ("@daily" . ?d) - ("@invoices" . ?i) - ("@personal" . ?p) - ("@learning" . ?l) - ("@dev" . ?v) - ("@writing" . ?w) - ("@projects" . ?r))) - - (setq org-capture-templates - '(("t" "TODO" entry (file+headline "~/Dropbox/notes/todo.org" "Inbox") "* TODO %? %u\n%i") - ("T" "Project TODO" entry (file+headline (narf/project-org-filename) "Tasks") "** TODO %?\n%i" :prepend t) - ("N" "Project Note" entry (file+headline (narf/project-org-filename) "Notes") "** %u %?\n%i") - ("c" "Changelog" entry (file+datetree (narf/project-org-filename)) "** %<%H:%M>: %? :unsorted:\n%i" :prepend t) - ("n" "Note" entry (file+datetree org-default-notes-file) "** %<%H:%M>: %?\n%i" :prepend t) - ("j" "Journal" entry (file+datetree "~/Dropbox/notes/journal.org") "** %?%^g\nAdded: %U\n%i") - ("a" "Trivia" entry (file "~/Dropbox/notes/trivia.org") "* %u %?\n%i" :prepend t) - ("s" "Writing Scraps" entry (file "~/Dropbox/notes/writing.org") "* %u %?\n%i" :prepend t) - ("v" "Vocab" entry (file "~/Dropbox/notes/vocab.org") "* %?\n%i" :prepend t) - ("e" "Excerpt" entry (file "~/Dropbox/notes/excerpts.org") "* %u %?\n%i" :prepend t))) - - (setq iimage-mode-image-regex-alist - '(("\\(`?file://\\|\\[\\[\\|<\\|`\\)?\\([-+./_0-9a-zA-Z]+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)\\(\\]\\]\\|>\\|'\\)?" . 2) - ("<\\(http://.+\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\)>" . 1))) - - (org-babel-do-load-languages 'org-babel-load-languages - '((python . t) - (ruby . t) - (sh . t) - (emacs-lisp . t) - (matlab . t) - (latex . t))) - - ;; Remove occur highlights on ESC in normal mode - (advice-add 'evil-force-normal-state :before 'org-remove-occur-highlights) - - ;; (progn ; opml support - ;; (defun set-buffer-file-format-to-opml () - ;; (when (string-match "\.opml$" (buffer-file-name)) - ;; (setq buffer-file-format '(opml)))) - - ;; (defun my--opml-encode (begin end buffer) - ;; "Export Org mode buffer to OPML." - ;; (let ((org-export-show-temporary-export-buffer nil) - ;; (name "*OPML Export Buffer*")) - ;; (org-export-to-buffer 'opml name) - ;; (erase-buffer) - ;; (insert-buffer-substring (get-buffer name)) - ;; (point-max))) - - ;; (add-hook 'find-file-hooks 'set-buffer-file-format-to-opml) - ;; (add-to-list 'format-alist '(opml "Outline Processor Markup Language" - ;; "<[?]xml version=\"1.0\"[^>]*[?]>[\n]?.*[\n]?.*[\n]?" - ;; "~/.emacs.d/elisp/org-opml/opml2org.py" my--opml-encode t)) - ;; (shut-up (load-library "ox-opml"))) - - (progn ; key bindings - ;; Hide properties PERMANENTLY - (defun org-cycle-hide-drawers (state) - "Re-hide all drawers after a visibility state change." - (when (and (derived-mode-p 'org-mode) - (not (memq state '(overview folded contents)))) - (save-excursion - (let* ((globalp (memq state '(contents all))) - (beg (if globalp (point-min) (point))) - (end (if globalp (point-max) - (if (eq state 'children) - (save-excursion (outline-next-heading) (point)) - (org-end-of-subtree t))))) - (goto-char beg) - (while (re-search-forward org-drawer-regexp end t) - (save-excursion - (beginning-of-line 1) - (backward-char 1) - (let ((b (point))) - (if (re-search-forward - "^[ \t]*:END:" - (save-excursion (outline-next-heading) (point)) t) - (outline-flag-region b (point-at-eol) t) - (user-error ":END: line missing at position %s" b))))))))) - - (use-package org-agenda - :config - (setq org-agenda-restore-windows-after-quit t - org-agenda-custom-commands '(("x" agenda) - ("y" agenda*) - ("w" todo "WAITING") - ("W" todo-tree "WAITING") - ("to" todo) - ("tp" tags "+Projects") - ("tg" tags-todo "+gamedev") - ("tw" tags-tree "+webdev")))) - - (bind :map org-mode-map - "RET" nil - "C-j" nil - "C-k" nil - - insert [remap narf:inflate-space-maybe] 'self-insert-command - - normal insert - :map evil-org-mode-map - "A-l" 'org-metaright ; M-j - "A-h" 'org-metaleft ; M-h - "A-k" 'org-metaup ; M-k - "A-j" 'org-metadown ; M-j - "A-l" 'org-shiftmetaright ; M-L - "A-h" 'org-shiftmetaleft ; M-H - "A-k" 'org-shiftmetaup ; M-K - "A-j" 'org-shiftmetadown ; M-J - - "" 'org-beginning-of-line - "" 'org-end-of-line - "" 'org-up-element - "" 'org-down-element - - ",;" 'helm-org-in-buffer-headings - "M-a" 'mark-whole-buffer - ", l" 'org-insert-link - - insert - "C-e" 'org-end-of-line - "C-a" 'org-beginning-of-line - ;; Add new header line before this line - "" 'narf/org-insert-item-before - ;; Add new header line after this line - "" 'narf/org-insert-item-after - - "M-b" (λ (narf/org-surround "*")) ; bold - "M-u" (λ (narf/org-surround "_")) ; underline - "M-i" (λ (narf/org-surround "/")) ; italics - "M-`" (λ (narf/org-surround "+")) ; strikethrough - - visual - "M-b" "S*" - "M-u" "S_" - "M-i" "S/" - "M-`" "S+" - - normal - ",=" 'org-align-all-tags - ",/" 'org-sparse-tree - ",?" 'org-tags-view - ",a" 'org-attach - ",D" 'org-time-stamp-inactive - ",T" 'org-show-todo-tree - ",d" 'org-time-stamp - ",r" 'org-refile - ",s" 'org-schedule - ",t" 'org-todo - "gr" 'org-babel-execute-src-block-maybe - "gh" 'outline-up-heading - "gj" 'org-forward-heading-same-level - "gk" 'org-backward-heading-same-level - "gl" 'outline-next-visible-heading - "go" 'org-open-at-point - "gO" 'org-attach-open - "gC-o" 'org-attach-reveal - "gI" (λ (if (> (length org-inline-image-overlays) 0) - (org-remove-inline-images) - (org-display-inline-images nil t (line-beginning-position) (line-end-position)))) - "gQ" 'org-fill-paragraph - "ga" 'org-attach - "gA" 'org-agenda - "gt" 'org-show-todo-tree - "]l" 'org-next-link - "[l" 'org-previous-link - "$" 'org-end-of-line - "^" 'org-beginning-of-line - "<" 'org-metaleft - ">" 'org-metaright - "-" 'org-cycle-list-bullet - ",SPC" 'narf/org-toggle-checkbox - "," 'org-archive-subtree - "" 'narf/org-insert-item-before - "" 'narf/org-insert-item-after - "RET" (λ (cond ((org-at-item-checkbox-p) - (org-toggle-checkbox)) - ((org-entry-is-todo-p) - (org-todo 'done)))) - [tab] 'org-cycle) - - (after "org-agenda" - (bind emacs :map org-agenda-mode-map - "" 'org-agenda-Quit - "C-j" 'org-agenda-next-item - "C-k" 'org-agenda-previous-item - "C-n" 'org-agenda-next-item - "C-p" 'org-agenda-previous-item))))) - - -(provide 'init-org) -;;; init-org.el ends here diff --git a/init/init-php.el b/init/init-php.el deleted file mode 100644 index d7ea22bc1..000000000 --- a/init/init-php.el +++ /dev/null @@ -1,21 +0,0 @@ -(use-package php-mode - :mode "\\.\\(php\\|inc\\)$" - :config - (progn - (setq php-template-compatibility nil) - (add-hook 'php-mode-hook 'turn-on-eldoc-mode) - - (use-package php-extras - :config - (narf/add-company-backend php-mode (php-extras-company))) - - ;; TODO Tie into emr - (use-package php-refactor-mode - :config - (progn - (add-hook 'php-mode-hook 'emr-initialize) - (add-hook 'php-mode-hook 'php-refactor-mode))))) - - -(provide 'init-php) -;;; init-php.el ends here diff --git a/init/init-project.el b/init/init-project.el deleted file mode 100644 index aa6a44a53..000000000 --- a/init/init-project.el +++ /dev/null @@ -1,86 +0,0 @@ -;; Project nav+search tools (projectile, helm, ag) -(use-package neotree - :functions (neo-buffer--unlock-width neo-buffer--lock-width - projectile-current-project-dirs projectile-file-cached-p - projectile-purge-file-from-cache neo-buffer--insert-with-face - neo-global--get-buffer) - :commands (neotree-show - neotree-hide - neotree-toggle - neo-global--window-exists-p - neotree-dir - neotree-find) - :init - (progn - (defun narf:neotree-open (&optional dir) - (interactive) - (neotree-dir (or dir (narf/project-root)))) - - (defun narf:neotree-toggle () - (interactive) - (if (neo-global--window-exists-p) - (neotree-hide) - (narf:neotree-open))) - - (defun narf:neotree-find () - (interactive) - (save-excursion (narf:neotree-open)) - (neotree-find)) - - (add-hook 'neotree-mode-hook 'narf|init-neotree-keymap)) - :config - (progn - (setq neo-create-file-auto-open t - neo-mode-line-type 'none - neo-persist-show t - neo-window-width 22 - neo-show-updir-line nil - neo-auto-indent-point t - neo-banner-message nil - ;; requires fork of - ;; neotree (at least, until the PR is accepted). Causes neotree to - ;; open in a vertical split that consumes the entire height of the - ;; frame. - neo-modern-sidebar t) - - ;; Redefinition for custom ascii theme - (defun narf/neo-buffer-fold-symbol (name) - (let ((n-insert-symbol (lambda (n) - (neo-buffer--insert-with-face - n 'neo-expand-btn-face)))) - (or (and (equal name 'open) (funcall n-insert-symbol "- ")) - (and (equal name 'close) (funcall n-insert-symbol "> ")) - (and (equal name 'leaf) (funcall n-insert-symbol " "))))) - (advice-add 'neo-buffer--insert-fold-symbol :override 'narf/neo-buffer-fold-symbol) - - ;; Close neotree on window changes, to prevent ensuing mindbuggery - (add-hook! 'window-configuration-change-hook - (unless (and (neo-global--window-exists-p) - (eq (current-buffer) (neo-global--get-buffer))) - (neotree-hide))) - - (after "projectile" - (setq projectile-switch-project-action 'neotree-projectile-action)) - (add-to-list 'evil-motion-state-modes 'neotree-mode) - (defun narf|init-neotree-keymap () - (bind :map evil-motion-state-local-map - "ESC" 'neotree-hide - "\\\\" 'neotree-hide - "RET" 'neotree-enter - "J" 'neotree-select-next-sibling-node - "K" 'neotree-select-previous-sibling-node - "H" 'neotree-select-up-node - "L" 'neotree-select-down-node - "v" 'neotree-enter-vertical-split - "s" 'neotree-enter-horizontal-split - "c" 'neotree-create-node - "d" 'neotree-delete-node - "g" 'neotree-refresh - "q" 'neotree-hide - "r" 'neotree-rename-node - "R" 'neotree-change-root - "?" 'neotree-)))) - - -(provide 'init-project) -;;; init-project.el ends here diff --git a/init/init-python.el b/init/init-python.el deleted file mode 100644 index b2ccfbf55..000000000 --- a/init/init-python.el +++ /dev/null @@ -1,80 +0,0 @@ -(use-package python - :mode ("\\.py\\'" . python-mode) - :interpreter ("python" . python-mode) - :commands (python-mode) - :init - (add-to-hook 'python-mode-hook '(narf|enable-tab-width-4 emr-initialize)) - :config - (progn - (setq-default python-indent-offset 4) - (setq python-environment-directory TMP-DIR) - (setq python-shell-interpreter "ipython") - ;; interferes with smartparens - (define-key python-mode-map (kbd "DEL") nil) - - (use-package anaconda-mode - :defines (anaconda-mode-map anaconda-nav-mode-map) - :functions (anaconda-mode-running-p) - :init (add-to-hook 'python-mode-hook '(anaconda-mode eldoc-mode)) - :config - (progn - (bind :motion :map anaconda-mode-map "gd" 'anaconda-mode-goto-definitions) - (bind :normal :map anaconda-nav-mode-map [escape] 'anaconda-nav-quit) - - ;; Delete the window on escape or C-g - (defadvice anaconda-mode-doc-buffer (after anaconda-doc-buffer-escape-to-close activate) - (with-current-buffer (get-buffer "*anaconda-doc*") - (local-set-key [escape] 'anaconda-nav-quit) - (local-set-key [?\C-g] 'anaconda-nav-quit))) - - (after "emr" - (emr-declare-command 'anaconda-mode-view-doc - :title "view documentation" - :modes 'python-mode - :predicate (lambda () (and (anaconda-mode-running-p) - (not (use-region-p)) - (not (sp-point-in-string-or-comment))))) - (emr-declare-command 'anaconda-mode-goto-assignments - :title "go to assignments" - :modes 'python-mode - :predicate (lambda () (and (anaconda-mode-running-p) - (not (use-region-p)) - (not (sp-point-in-string-or-comment))))) - - (emr-declare-command 'anaconda-mode-goto-definitions - :title "go to definition" - :modes 'python-mode - :predicate (lambda () (and (anaconda-mode-running-p) - (not (use-region-p)) - (not (sp-point-in-string-or-comment))))) - - (emr-declare-command 'anaconda-mode-usages - :title "show usages" - :modes 'python-mode - :predicate (lambda () (and (anaconda-mode-running-p) - (not (use-region-p)) - (not (sp-point-in-string-or-comment)))))) - - (after "company" - (use-package company-anaconda - :config - (narf/add-company-backend python-mode (company-anaconda)))))) - - (use-package nose - :commands nose-mode - :preface (defvar nose-mode-map (make-sparse-keymap)) - :init (associate-minor-mode "/test_.+\\.py\\'" 'nose-mode) - :config - (bind normal :map nose-mode-map - :prefix leader - "tr" 'nosetests-again - "ta" 'nosetests-all - "ts" 'nosetests-one - "tv" 'nosetests-module - "tA" 'nosetests-pdb-all - "tO" 'nosetests-pdb-one - "tV" 'nosetests-pdb-module)))) - - -(provide 'init-python) -;;; init-python.el ends here diff --git a/init/init-r.el b/init/init-r.el deleted file mode 100644 index 67097aafe..000000000 --- a/init/init-r.el +++ /dev/null @@ -1,10 +0,0 @@ -(use-package ess-site - :config - (progn - (setq ess-indent-level 4) - (setq ess-arg-function-offset 4) - (setq ess-else-offset 4) - )) - -(provide 'init-r) -;;; init-r.el ends here diff --git a/init/init-regex.el b/init/init-regex.el deleted file mode 100644 index 4282a0a36..000000000 --- a/init/init-regex.el +++ /dev/null @@ -1,56 +0,0 @@ -(use-package re-builder - :commands (re-builder reb-mode-buffer-p) - :config - (progn - (bind :normal :map reb-mode-map - "C-g" 'reb-quit - [escape] 'reb-quit - [backtab] 'reb-change-syntax) - - (defun narf|reb-cleanup () - (replace-regexp "^[ \n]*" "" nil (point-min) (point-max)) - (text-scale-set 1.5) - (goto-char 2)) - (add-hook 'reb-mode-hook 'narf|reb-cleanup) - - (use-package pcre2el - :functions (rxt--re-builder-switch-pcre-mode) - :config - (progn - (bind :normal :map rxt-help-mode-map [escape] 'kill-buffer-and-window) - (setq reb-re-syntax 'pcre))) - - (after "evil" - (evil-set-initial-state 'reb-mode 'insert) - ;; Either a) converts selected (or entered-in) pcre regex into elisp - ;; regex, OR b) opens up re-builder. - (evil-define-operator narf::regex (beg end type &optional regexstr bang) - :move-point nil - :type inclusive - :repeat nil - (interactive "") - (if (reb-mode-buffer-p) - (if regexstr - (let ((regexstr (s-trim (buffer-string)))) - (if bang - (rxt-explain-pcre regexstr) - (rxt-pcre-to-elisp (s-trim (buffer-string))))) - (erase-buffer) - (insert (concat "/" regexstr "/"))) - (cond ((and beg end (/= beg (1- end))) ; Convert selection from pcre regex to elisp - (let ((regexstr (buffer-substring-no-properties beg end))) - (if bang - (rxt-explain-pcre (concat "/" regexstr "/")) - (delete-region beg end) - (insert (rxt-pcre-to-elisp regexstr))))) - (regexstr ; Convert input regex into elisp regex - (let ((newregex (rxt-pcre-to-elisp regexstr))) - (when bang - (setq newregex (s-replace "\\" "\\\\" newregex))) - (kill-new newregex) - (message "Copied regex to kill ring: %s" newregex))) - (t (re-builder)))))))) - - -(provide 'init-regex) -;;; init-regex.el ends here diff --git a/init/init-ruby.el b/init/init-ruby.el deleted file mode 100644 index 4281fc078..000000000 --- a/init/init-ruby.el +++ /dev/null @@ -1,134 +0,0 @@ -(use-package enh-ruby-mode - :mode (("\\.rb$" . enh-ruby-mode) - ("\\.ru$" . enh-ruby-mode) - ("\\.rake$" . enh-ruby-mode) - ("\\.gemspec$" . enh-ruby-mode) - ("\\.?pryrc$" . enh-ruby-mode) - ("/Gemfile$" . enh-ruby-mode) - ("/Capfile$" . enh-ruby-mode) - ("/Vagrantfile$" . enh-ruby-mode) - ("/Rakefile$" . enh-ruby-mode)) - :interpreter "ruby" - :init - (progn - (add-hook 'enh-ruby-mode-hook 'narf|enable-tab-width-2) - (add-hook! 'enh-ruby-mode-hook (set-build-command "rake %s" "Rakefile"))) - :config - (progn - ;;; Formatting - (setq ruby-indent-level 2 - ruby-deep-indent-paren t - enh-ruby-check-syntax nil) - - (associate-mode "/\\.rspec$" 'text-mode) - - ;; Don't interfere with my custom RET behavior - (define-key enh-ruby-mode-map [?\n] nil) - - (use-package ruby-refactor - :init - (add-hook 'enh-ruby-mode-hook 'emr-initialize) - :config - (after "emr" - (emr-declare-command 'ruby-refactor-extract-to-method - :title "extract method" - :modes 'enh-ruby-mode - :predicate (lambda () (use-region-p))) - (emr-declare-command 'ruby-refactor-extract-local-variable - :title "extract local variable" - :modes 'enh-ruby-mode - :predicate (lambda () (use-region-p))) - (emr-declare-command 'ruby-refactor-extract-constant - :title "extract constant" - :modes 'enh-ruby-mode - :predicate (lambda () (use-region-p))) - (emr-declare-command 'ruby-refactor-add-parameter - :title "add parameter" - :modes 'enh-ruby-mode) - (emr-declare-command 'ruby-refactor-extract-to-let - :title "extract to let" - :modes 'enh-ruby-mode - :predicate (lambda () (use-region-p))))) - - - ;; Rakefiles ;;;;;;;;;;;;;;;;;;;;;;;;;;; - (define-minor-mode rake-mode - "Buffer local minor mode for rake files" - :lighter " Rake" :keymap (make-sparse-keymap) - (narf/init-yas-mode 'rake-mode)) - (associate-minor-mode "/\\(Rakefile\\|\\.rake\\)$" 'rake-mode) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; Vagrantfiles ;;;;;;;;;;;;;;;;;;;;;;;; - (define-minor-mode vagrant-mode - "Buffer local minor mode for vagrant files" - :lighter " Va" :keymap (make-sparse-keymap) - (narf/yas-init-mode 'vagrant-mode)) - (associate-minor-mode "/Vagrantfile$" 'vagrant-mode) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; Rspec files ;;;;;;;;;;;;;;;;;;;;;;;;; - (use-package rspec-mode - :defer t - :init - (progn - (associate-minor-mode "\\(/spec_helper\\|_spec\\)\\.rb$" 'rspec-mode) - (associate-minor-mode "/\\.rspec$" 'rspec-mode) - - (defvar rspec-mode-verifiable-map (make-sparse-keymap)) - (defvar evilmi-ruby-match-tags - '((("unless" "if") ("elsif" "else") "end") - ("begin" ("rescue" "ensure") "end") - ("case" ("when" "else") "end") - (("class" "def" "while" "do" "module" "for" "until") () "end") - ;; Rake - (("task" "namespace") () "end")))) - :config - (bind :normal - ",tr" 'rspec-rerun - ",ta" 'rspec-verify-all - ",ts" 'rspec-verify-single - ",tv" 'rspec-verify)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - (use-package inf-ruby - :commands (inf-ruby inf-ruby-console-auto) - :config - (progn - (evil-set-initial-state 'inf-enh-ruby-mode 'insert) - (after "company" - (use-package company-inf-ruby - :config (narf/add-company-backend inf-enh-ruby-mode (company-inf-ruby)))))) - - (use-package robe - :functions (robe-mode robe-start ruby-load-file) - :config - (progn - (after "company" - (use-package company-robe - :config (narf/add-company-backend enh-ruby-mode (company-robe)))) - - (defun narf|enable-robe-maybe () - (let ((file (buffer-file-name))) - ;; Don't run in gemfiles, capfiles or vagrantfiles - (unless (or (string-equal (f-filename file) "Gemfile") - (string-equal (f-filename file) "Capfile") - (string-equal (f-filename file) "Vagrantfile") - (f-ext? file "org")) ;; or org-mode - (robe-mode 1) - (narf|ruby-load-file file)))) - (add-hook 'enh-ruby-mode-hook 'narf|enable-robe-maybe) - - (defun narf|ruby-load-file (&optional file) - (let ((file (or file buffer-file-name))) - (when (and (eq major-mode 'enh-ruby-mode) - (featurep 'robe) - (not (string= (f-base file) "Gemfile")) - (file-exists-p buffer-file-name)) - (unless robe-running (robe-start 1)) - (when robe-running (ruby-load-file file))))) - (add-hook 'after-save-hook 'narf|ruby-load-file))))) - - -(provide 'init-ruby) -;;; init-ruby.el ends here diff --git a/init/init-rust.el b/init/init-rust.el deleted file mode 100644 index 37f83933f..000000000 --- a/init/init-rust.el +++ /dev/null @@ -1,13 +0,0 @@ -(use-package rust-mode - :mode "\\.rs$" - :config - ;; (after "company" - ;; (let ((racer-dir (concat my-contrib-dir "racer/"))) - ;; (setq racer-rust-src-path (concat racer-dir "src")) - ;; (setq racer-cmd (concat racer-dir "bin/racer")) - ;; (add-to-list 'load-path (concat racer-dir "editors/")) - ;; (require 'racer))) - ) - -(provide 'init-rust) -;;; init-rust.el ends here diff --git a/init/init-scss.el b/init/init-scss.el deleted file mode 100644 index e32620edd..000000000 --- a/init/init-scss.el +++ /dev/null @@ -1,33 +0,0 @@ -(use-package sass-mode - :mode "\\.sass$" - :init - (add-hook 'sass-mode-hook 'narf|enable-tab-width-2) - :config - (progn - (after "company" (narf/add-company-backend sass-mode (company-css))))) - -(use-package scss-mode - :mode "\\.scss$" - :init - (add-hook 'scss-mode-hook 'narf|enable-tab-width-2) - :config - (progn - (setq-default css-indent-offset 2) - (setq scss-compile-at-save nil) - - ;; Syntax coloring breaks on consecutive loads for some reason. This fixes that: - (add-hook 'scss-mode-hook 'css-mode) - - (after "web-beautify" - (add-hook! 'scss-mode-hook (setenv "jsbeautify_indent_size" "2")) - (bind :motion :map scss-mode-map "gQ" 'web-beautify-css)) - - (after "company" (narf/add-company-backend scss-mode (company-css))))) - -(use-package rainbow-mode - :defer t - :init (add-hook 'scss-mode-hook 'rainbow-mode)) - - -(provide 'init-scss) -;;; init-scss.el ends here diff --git a/init/init-sh.el b/init/init-sh.el deleted file mode 100644 index 0e2745109..000000000 --- a/init/init-sh.el +++ /dev/null @@ -1,19 +0,0 @@ -(narf/add-throwaway-buffer "^\\*Shell Command Output\\*$") -(narf/add-throwaway-buffer "^\\*Async Shell Command\\*$") - -;; Make shell scrips executable on save? -;; (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) - -;; Color in *Shell Command Output* -(require 'ansi-color) -(defadvice display-message-or-buffer (before ansi-color activate) - "Process ANSI color codes in shell output." - (let ((buf (ad-get-arg 0))) - (and (bufferp buf) - (string= (buffer-name buf) "*Shell Command Output*") - (with-current-buffer buf - (ansi-color-apply-on-region (point-min) (point-max)))))) - - -(provide 'init-sh) -;;; init-sh.el ends here diff --git a/init/init-swift.el b/init/init-swift.el deleted file mode 100644 index e6eefa4db..000000000 --- a/init/init-swift.el +++ /dev/null @@ -1,11 +0,0 @@ -(use-package swift-mode - :mode "\\.swift$" - :config - (progn - (after "flycheck" (add-to-list 'flycheck-cehckers 'swift)) - (after "company" (narf/add-company-backend swift-mode (company-xcode))))) - -;; TODO Set up emacs task runners for fruitstrap - -(provide 'init-swift) -;;; init-swift.el ends here diff --git a/init/init-text.el b/init/init-text.el deleted file mode 100644 index 10e66320f..000000000 --- a/init/init-text.el +++ /dev/null @@ -1,56 +0,0 @@ -(add-hook 'text-mode-hook 'narf|enable-hard-wrap) -(add-hook 'prog-mode-hook 'narf|enable-comment-hard-wrap) - -(use-package markdown-mode - :mode (("\\.md$" . markdown-mode) - ("/README$" . markdown-mode)) - :functions (markdown-use-region-p markdown-unwrap-things-in-region - markdown-wrap-or-insert markdown-unwrap-thing-at-point) - :init - ;; Implement strike-through formatting - (defvar markdown-regex-del "\\(^\\|[^\\]\\)\\(\\(~\\{2\\}\\)\\([^ \n \\]\\|[^ \n ]\\(?:.\\|\n[^\n]\\)*?[^\\ ]\\)\\(\\3\\)\\)") - :config - (progn - (defun markdown-insert-del () - (interactive) - (let ((delim "~~")) - (if (markdown-use-region-p) - ;; Active region - (let ((bounds (markdown-unwrap-things-in-region - (region-beginning) (region-end) - markdown-regex-del 2 4))) - (markdown-wrap-or-insert delim delim nil (car bounds) (cdr bounds))) - ;; Bold markup removal, bold word at point, or empty markup insertion - (if (thing-at-point-looking-at markdown-regex-del) - (markdown-unwrap-thing-at-point nil 2 4) - (markdown-wrap-or-insert delim delim 'word nil nil))))) - - (sp-local-pair 'markdown-mode "*" "*" - :unless '(sp-point-after-bol-p sp-point-before-same-p sp-point-after-same-p)) - - (bind :map markdown-mode-map - "" nil - "" nil - "" nil - - "M-*" 'markdown-insert-list-item - "M-b" 'markdown-insert-bold - "M-i" 'markdown-insert-italic - "M-`" 'markdown-insert-del - - :normal :visual - ",i" 'markdown-insert-image - ",l" 'markdown-insert-link - ",L" 'markdown-insert-reference-link-dwim - ",b" 'markdown-preview - - :normal - "[p" 'markdown-promote - "]p" 'markdown-demote - - :insert - "M--" 'markdown-insert-hr))) - - -(provide 'init-text) -;;; init-text.el ends here diff --git a/init/init-vc.el b/init/init-vc.el deleted file mode 100644 index e98f0a126..000000000 --- a/init/init-vc.el +++ /dev/null @@ -1,33 +0,0 @@ -(use-package git-commit-mode ; - :mode (("/COMMIT_EDITMSG\\'" . git-commit-mode) - ("/NOTES_EDITMSG\\'" . git-commit-mode) - ("/MERGE_MSG\\'" . git-commit-mode) - ("/TAG_EDITMSG\\'" . git-commit-mode) - ("/PULLREQ_EDITMSG\\'" . git-commit-mode)) - :config - (evil-set-initial-state 'git-commit-mode 'insert)) - -(use-package git-rebase-mode - :mode ("/git-rebase-todo\\'" . git-rebase-mode) - :config - (evil-set-initial-state 'git-rebase-mode 'insert)) - -(use-package gitconfig-mode - :mode (("/\\.?git/?config\\'" . gitconfig-mode) - ("/\\.gitmodules\\'" . gitconfig-mode)) - :init (add-hook 'gitconfig-mode-hook 'flyspell-mode)) - -(use-package gitignore-mode - :mode (("/\\.gitignore\\'" . gitignore-mode) - ("/\\.git/info/exclude\\'" . gitignore-mode) - ("/git/ignore\\'" . gitignore-mode))) - -(use-package diff-hl - :config - (progn - (setq diff-hl-draw-borders nil) - (global-diff-hl-mode +1))) - - -(provide 'init-vc) -;;; init-vc.el ends here diff --git a/init/init-vim.el b/init/init-vim.el deleted file mode 100644 index 79d878889..000000000 --- a/init/init-vim.el +++ /dev/null @@ -1,7 +0,0 @@ -(use-package vimrc-mode - :mode (("/\\.?g?vimrc$" . vimrc-mode) - ("\\.vim$" . vimrc-mode))) - - -(provide 'init-vim) -;;; init-vim.el ends here diff --git a/init/init-web.el b/init/init-web.el deleted file mode 100644 index 84fa50fff..000000000 --- a/init/init-web.el +++ /dev/null @@ -1,89 +0,0 @@ -(use-package web-beautify - :commands (web-beautify-js web-beautify-css web-beautify-html) - :init - (after "css-mode" - (add-hook! 'css-mode-hook (setenv "jsbeautify_indent_size" "2")) - (bind :motion :map css-mode-map "gQ" 'web-beautify-css))) - -(use-package web-mode - :mode (("\\.\\(p\\)?htm\\(l\\)?$" . web-mode) - ("\\.tpl\\(\\.php\\)?$" . web-mode) - ("\\.erb$" . web-mode) - ("wp-content/themes/.+/.+\\.php$" . web-mode)) - :init - (add-hook 'web-mode-hook 'narf|enable-tab-width-2) - :config - (progn - (setq web-mode-markup-indent-offset 2 - web-mode-code-indent-offset 2 - web-mode-css-indent-offset 2 - web-mode-style-padding 2 - web-mode-script-padding 2 - web-mode-block-padding 2) - - (after "smartparens" - (add-hook! 'web-mode-hook (setq web-mode-enable-auto-pairing nil)) - - (defun sp-web-mode-is-code-context (id action context) - (when (and (eq action 'insert) - (not (or (get-text-property (point) 'part-side) - (get-text-property (point) 'block-side)))) - t)) - (sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context))) - - (after "web-beautify" - (add-hook! 'web-mode-hook (setenv "jsbeautify_indent_size" "4")) - (bind :motion :map web-mode-map "gQ" 'web-beautify-html)) - - (bind :map web-mode-map - "M-/" 'web-mode-comment-or-uncomment - - :normal - "zf" 'web-mode-fold-or-unfold - ",t" 'web-mode-element-rename - - :normal :visual - "]a" 'web-mode-attribute-next - "[a" 'web-mode-attribute-previous - "]t" 'web-mode-tag-next - "[t" 'web-mode-tag-previous - "]T" 'web-mode-element-child - "[T" 'web-mode-element-parent))) - -(use-package emmet-mode - :defer t - :init - (add-to-hooks 'emmet-mode '(scss-mode-hook web-mode-hook html-mode-hook haml-mode-hook nxml-mode-hook)) - :config - (progn - (setq emmet-move-cursor-between-quotes t) - (bind insert :map emmet-mode-keymap - "M-e" 'emmet-expand-yas - "M-E" 'emmet-expand-line))) - -(define-minor-mode jekyll-mode - "Jekyll development mode." - :init-value nil - :lighter " :{" - :keymap (make-sparse-keymap) - (narf/init-yas-mode 'jekyll-mode)) -(defun narf|jekyll-mode-enable-maybe () - (when (narf/project-has-files '("_config.yml" "_layouts")) - (jekyll-mode 1))) -(associate-minor-mode "/_\\(layouts\\|posts\\)/.+$" 'jekyll-mode) -(add-to-hooks 'narf|jekyll-mode-enable-maybe '(web-mode-hook scss-mode-hook html-mode-hook markdown-mode markdown-mode-hook)) -(after "company" (add-to-list 'company-dictionary-major-minor-modes 'jekyll-mode)) - -(define-minor-mode wordpress-mode - "Wordpress development mode." - :init-value nil - :lighter " wp" - :keymap (make-sparse-keymap) - (narf/init-yas-mode 'wordpress-mode)) -(associate-minor-mode "/wp-\\(content\\|admin\\|includes\\)/.+$" 'wordpress-mode) -(associate-minor-mode "/wp-.+\\.php$" 'wordpress-mode) -(after "company" (add-to-list 'company-dictionary-major-minor-modes 'wordpress-mode)) - - -(provide 'init-web) -;;; init-web.el ends here diff --git a/init/init-workgroups.el b/init/init-workgroups.el deleted file mode 100644 index f81c0058f..000000000 --- a/init/init-workgroups.el +++ /dev/null @@ -1,41 +0,0 @@ -(use-package workgroups2 - :init - (setq wg-session-file (expand-file-name "wg-default" TMP-DIR) - wg-workgroup-directory (expand-file-name "workgroups" TMP-DIR) - wg-first-wg-name "main" - wg-session-load-on-start t - wg-mode-line-display-on nil - ;; What to do on Emacs exit / workgroups-mode exit? - wg-emacs-exit-save-behavior 'save ; Options: 'save 'ask nil - wg-workgroups-mode-exit-save-behavior 'save) - :config - (progn - (after "helm" - (defun narf/helm-switch-to-workgroup (name) - (wg-switch-to-workgroup (wg-get-workgroup name))) - (defvar narf/helm-source-wg - '((name . "Workgroups") - (candidates . wg-workgroup-names) - (action . narf/helm-switch-to-workgroup))) - (defun narf:helm-wg () - (interactive) - (helm :sources '(helm-source-wg)))) - - ;; Turns projectile switch-project interface (or helm's interface to it) - ;; create a new workgroup for the new project. - (after "projectile" - (defun narf/wg-projectile-switch-project () - (let ((workgroup-name (file-name-nondirectory (directory-file-name (narf/project-root))))) - (wg-create-workgroup workgroup-name t) - (helm-projectile-find-file))) - (setq projectile-switch-project-action 'narf/wg-projectile-switch-project)) - - ;; Initialize! - (defun narf|init-workgroups () - (workgroups-mode +1) - (diminish 'workgroups-mode)) - (add-hook 'after-init-hook 'narf|init-workgroups))) - - -(provide 'init-workgroups) -;;; init-workgroups.el ends here diff --git a/init/init-yasnippet.el b/init/init-yasnippet.el deleted file mode 100644 index 0a40e0943..000000000 --- a/init/init-yasnippet.el +++ /dev/null @@ -1,158 +0,0 @@ -(use-package yasnippet - :diminish (yas-minor-mode . "Y") - :commands (yas-minor-mode yas-minor-mode-on narf/init-yas-mode) - :mode (("emacs\\.d/snippets/.+$" . snippet-mode)) - :init - (progn - (add-to-hooks 'yas-minor-mode-on '(prog-mode-hook - snippet-mode-hook - markdown-mode-hook - org-mode-hook)) - (add-hook 'snippet-mode-hook 'disable-final-newline) - - ;; Switch to insert mode when expanding a template via backtab, or go back - ;; to normal mode if there are no fields. - (defun narf/insert-yas-snippet () - (interactive) - (yas-insert-snippet) - (evil-insert-state +1)) - - (defvar yas-minor-mode-map - (let ((map (make-sparse-keymap))) - (bind insert :map map [(tab)] 'yas-expand) - (bind visual :map map "" 'narf/insert-yas-snippet) - map))) - :config - (progn - ;; Undo global maps - (bind insert [(tab)] nil) - (bind visual "" nil) - - (after "helm" (add-to-list 'yas-dont-activate 'helm-alive-p)) - - (setq yas-verbosity 0 - yas-indent-line 'auto - yas-also-auto-indent-first-line t - yas-wrap-around-region nil - ;; Only load personal snippets - yas-snippet-dirs `(,SNIPPETS-DIR) - yas-prompt-functions '(yas-ido-prompt yas-no-prompt)) - (yas-reload-all) - - ;; Exit snippets on ESC in normal mode - (advice-add 'evil-force-normal-state :before 'yas-exit-all-snippets) - ;; Once you're in normal mode, you're out - (add-hook 'evil-normal-state-entry-hook 'yas-abort-snippet) - - ;; Fixes: evil's visual-line mode gobbles up the newline on the right. - ;; This prevents that by essentially doing (1- (region-end)). - (defadvice yas-expand-snippet (around yas-expand-snippet-visual-line activate) - (when (evil-visual-line-state-p) - (ad-set-arg 2 (1- (ad-get-arg 2)))) ad-do-it) - - ;; Fixes: visual-line includes indentation before the selection. This - ;; strips it out. - (add-hook! 'yas-before-expand-snippet-hook - (when (evil-visual-line-state-p) - (setq-local yas-selected-text - (replace-regexp-in-string - "\\(^ *\\|\n? $\\)" "" - (buffer-substring-no-properties (region-beginning) - (1- (region-end))))))) - ;; Previous hook causes yas-selected-text to persist between expansions. - ;; This little hack gets around it. - (add-hook! 'yas-after-exit-snippet-hook (setq-local yas-selected-text nil)) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; Snippet helpers - (defvaralias '% 'yas-selected-text) - ;; Shorthand defun to surround text with newlines if more than one line. - (defun !%! () - (when % - (if (> (length (s-lines %)) 1) - (concat "\n" % "\n") - (s-trim %)))) - ;; Shorthand defun for snippets: prepends a newline to `yas-selected-text' - ;; IF it contains more than one line. - (defun !% () - (when % - (if (> (length (s-lines %)) 1) - (concat "\n" %) - (s-trim %)))) - ;; Trim selection; do no further processing - (defun %1 () (s-trim %)) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; Inter-field navigation - (defun narf/yas-goto-start-of-field () - (interactive) - (let* ((snippet (car (yas--snippets-at-point))) - (position (yas--field-start (yas--snippet-active-field snippet)))) - (if (= (point) position) - (move-beginning-of-line 1) - (goto-char position)))) - (defun narf/yas-goto-end-of-field () - (interactive) - (let* ((snippet (car (yas--snippets-at-point))) - (position (yas--field-end (yas--snippet-active-field snippet)))) - (if (= (point) position) - (move-end-of-line 1) - (goto-char position)))) - - ;; Prevents Yas from stepping on my toes when I use backspace - (defun narf/yas-backspace (&optional field) - (interactive) - (let ((field (or field (and yas--active-field-overlay - (overlay-buffer yas--active-field-overlay) - (overlay-get yas--active-field-overlay 'yas--field))))) - (cond ((eq (point) (marker-position (yas--field-start field))) nil) - (t (delete-char -1))))) - - (defun narf/yas-delete (&optional field) - (interactive) - (let ((field (or field (and yas--active-field-overlay - (overlay-buffer yas--active-field-overlay) - (overlay-get yas--active-field-overlay 'yas--field))))) - (cond ((and field - (not (yas--field-modified-p field)) - (eq (point) (marker-position (yas--field-start field)))) - (yas--skip-and-clear field) - (yas-next-field 1)) - ((eq (point) (marker-position (yas--field-end field))) nil) - (t (delete-char 1))))) - - (defun narf/yas-clear-to-sof (&optional field) - (interactive) - (let* ((field (or field (and yas--active-field-overlay - (overlay-buffer yas--active-field-overlay) - (overlay-get yas--active-field-overlay 'yas--field)))) - (sof (marker-position (yas--field-start field)))) - (when (and field (> (point) sof)) - (delete-region sof (point))))) - - (defun narf/init-yas-mode (&rest modes) - ;; Yasnippet 0.8.1+ - (after "yasnippet" - (when (boundp 'yas-extra-modes) - (dolist (mode modes) - (if (symbol-value mode) - (yas-activate-extra-mode mode) - (setq yas-extra-modes (delq mode yas-extra-modes))))))) - - ;; keybinds - (bind :map yas-keymap - "C-e" 'narf/yas-goto-end-of-field - "C-a" 'narf/yas-goto-start-of-field - "" 'narf/yas-goto-end-of-field - "" 'narf/yas-goto-start-of-field - "" 'yas-prev-field - "" 'narf/yas-clear-to-sof - - [backspace] 'narf/yas-backspace - "" 'narf/yas-delete))) - - -(provide 'init-yasnippet) -;;; init-yasnippet.el ends here diff --git a/init/narf-bindings.el b/init/narf-bindings.el deleted file mode 100644 index 8d89473ea..000000000 --- a/init/narf-bindings.el +++ /dev/null @@ -1,347 +0,0 @@ -(eval-when-compile (require 'defuns)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Global keymaps ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(bind "M-x" 'smex - "M-X" 'smex-major-mode-commands - "M-A-x" 'helm-M-x - "M-;" 'eval-expression - "C-`" 'popwin:toggle-popup-window - "M-=" 'text-scale-increase - "M--" 'text-scale-decrease - "M-w" 'evil-window-delete - "M-/" 'evil-commentary-line - "M-b" 'narf::build - "M-t" 'helm-projectile-find-file) - -(bind motion - ;; Faster scrolling - "M-j" "6j" - "M-k" "6k" - "M-r" 'narf::eval - - normal - "M-o" 'narf:ido-find-file - "M-O" 'narf:ido-find-project-file - "" 'dash-at-point - - "M-R" 'narf::eval-buffer) - -;; restore text nav keys -(bind :if IS-MAC - "" 'backward-word - "" 'forward-word - "" 'narf:backward-kill-to-bol-and-indent - "A-SPC" 'just-one-space - "M-a" 'mark-whole-buffer - "M-c" 'evil-yank - "M-s" 'save-buffer - "M-v" 'clipboard-yank - "M-q" 'evil-quit-all - "M-z" 'undo - "M-Z" 'redo - "C-M-f" 'narf:toggle-fullscreen) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Local keymaps ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(bind (normal motion visual) ";" 'evil-ex) - -(bind normal - :prefix leader - "," (λ (if (narf/project-p) (helm-projectile-switch-to-buffer) (helm-buffers-list))) - "<" 'helm-buffers-list - "." 'narf:ido-find-file - ">" 'narf:ido-find-file-other-window - "/" 'helm-projectile-find-file - ";" 'helm-semantic-or-imenu - - "]" 'helm-etags-select - "a" 'helm-projectile-find-other-file - "E" 'narf::initfiles - "h" 'helm-apropos - "n" 'narf::notes - "m" 'helm-recentf - "M" 'helm-projectile-recentf ; recent PROJECT files - "p" 'helm-projectile-switch-project - "r" 'emr-show-refactor-menu - - "qq" 'evil-save-and-quit - "QQ" (λ (let ((confirm-kill-emacs nil)) (narf::kill-buffers t) (evil-quit-all))) - - ;; insert lines in-place - "jj" (λ (save-excursion (evil-insert-newline-below))) - "kk" (λ (save-excursion (evil-insert-newline-above))) - - "oo" 'narf:osx-open-with - "ob" (λ (narf:osx-open-with "Google Chrome")) - "of" (λ (narf:osx-open-with "Finder.app" default-directory)) - "oF" (λ (narf:osx-open-with "Finder.app" (narf/project-root))) - "ou" (λ (narf:osx-open-with "Transmit")) - "oU" (λ (narf:osx-open-with "Transmit" default-directory)) - "ol" (λ (narf:osx-open-with "LaunchBar")) - "oL" (λ (narf:osx-open-with "LaunchBar" default-directory)) - "ot" (λ (narf::tmux-chdir nil t)) ; tmux: cd (default-directory) - "oT" 'narf::tmux-chdir ; tmux: cd [project root] - - :prefix localleader - "\\" 'narf:neotree-toggle - "." 'narf:neotree-find - ";" 'narf:nlinum-toggle - "=" 'toggle-transparency - "E" 'evil-emacs-state - - "]" 'next-buffer - "[" 'previous-buffer - - "s" (λ (narf::snippets t)) ; ido snippets dir - "g" 'diff-hl-diff-goto-hunk - "e" (λ (call-interactively 'flycheck-buffer) (flycheck-list-errors)) - "p" 'helm-show-kill-ring - "b" 'helm-bookmarks - "w" 'helm-wg) - -(bind normal - "Y" (λ (evil-yank (point) (point-at-eol))) ; yank to eol, like D and C - - "zr" 'narf:open-folds - "zm" 'narf:close-folds - - "zx" 'narf:kill-real-buffer - "zX" 'bury-buffer - - "]b" 'narf:next-real-buffer - "[b" 'narf:previous-real-buffer - "]w" 'wg-switch-to-workgroup-right - "[w" 'wg-switch-to-workgroup-left - - ;; Increment/decrement number under cursor - "g=" 'evil-numbers/inc-at-pt - "g-" 'evil-numbers/dec-at-pt - "gR" 'narf::eval-buffer - "gc" 'evil-commentary - "gy" 'evil-commentary-yank - - visual - "gR" 'narf::eval-region-and-replace - ",=" 'align-regexp - - ;; vnoremap < >gv - ">" (λ (evil-shift-right (region-beginning) (region-end)) - (evil-normal-state) - (evil-visual-restore)) - - ;; undo/redo for regions - ;; "u" 'undo-tree-undo - ;; "C-r" 'redo-tree-redo - - "*" 'evil-visualstar/begin-search-forward - "#" 'evil-visualstar/begin-search-backward - - ;; paste from recent yank register; which isn't overwritten by deletes or - ;; other operations. - "P" "\"0p" - - "S" 'evil-surround-region - "R" 'evil-iedit-state/iedit-mode ; edit all instances of marked region - "v" 'er/expand-region - "V" 'er/contract-region - - motion - ;; aliases for % - "%" 'evilmi-jump-items - [tab] (λ (if (ignore-errors (hs-already-hidden-p)) - (hs-toggle-hiding) - (call-interactively 'evilmi-jump-items))) - - "j" 'evil-next-line - "k" 'evil-previous-line - - "]g" 'diff-hl-next-hunk - "[g" 'diff-hl-previous-hunk - - "]e" (λ (call-interactively (if (bound-and-true-p flycheck-mode) 'flycheck-next-error 'next-error))) - "[e" (λ (call-interactively (if (bound-and-true-p flycheck-mode) 'flycheck-previous-error 'previous-error))) - - "gl" 'narf:goto-line - "gs" 'evil-ace-jump-two-chars-mode - "gx" 'evil-exchange - "gr" 'narf::eval-region - "g]" 'smart-down - "g[" 'smart-up - - insert - "" 'evil-delete-backward-word - "" (λ (evil-forward-word) (evil-delete-backward-word)) - - ;; Newline magic - "" 'backward-delete-char-untabify - "" 'narf:backward-kill-to-bol-and-indent - "" 'evil-ret-and-indent - - ;; Textmate-esque indent shift left/right - "M-[" (kbd "C-o m l C-o I DEL C-o ` l") - "M-]" (λ (evil-shift-right (point-at-bol) (point-at-eol))) - "" (kbd "M-[") - - ;; Company-mode - "C-SPC" 'company-complete-common - "C-x C-k" 'company-dictionary - "C-x C-f" 'company-files - "C-x C-]" 'company-tags - "C-x s" 'company-ispell - "C-x C-s" 'company-yasnippet - "C-x C-o" 'company-semantic - "C-x C-n" 'company-dabbrev-code - "C-x C-p" (λ (let ((company-selection-wrap-around t)) - (call-interactively 'company-dabbrev-code) - (company-select-previous-or-abort))) - - (insert replace) - ;; escape from insert mode (more responsive than using key-chord-define) - "j" 'narf:exit-mode-maybe - - (insert replace visual) - "C-g" 'evil-normal-state - - operator - "s" 'evil-surround-edit - "S" 'evil-Surround-edit - - ;; Rotate-text (see elisp/rotate-text.el) - normal "!" 'rotate-word-at-point - visual "!" 'rotate-region - emacs [escape] 'evil-normal-state) - -(bind :map evil-window-map - ;; winner-mode: window layout undo/redo (see core.el) - "u" 'winner-undo - "C-u" 'winner-undo - "C-r" 'winner-redo - - "C-w" 'ace-window - "C-S-w" (λ (ace-window 4)) ; swap windows - "C-C" (λ (ace-window 16))) ; delete windows - -(after "help-mode" - (bind normal :map help-mode-map - "" (λ (kill-buffer) - (if (eq popwin:popup-buffer (current-buffer)) - (popwin:close-popup-window) - (evil-window-delete))) - "]]" 'help-go-forward - "[[" 'help-go-back)) - -(bind :map evil-ex-completion-map - "C-r" 'evil-ex-paste-from-register ; registers in ex-mode - "C-a" 'move-beginning-of-line - "" 'move-beginning-of-line - "" 'move-beginning-of-line - "" 'evil-delete-whole-line) - -(bind :map company-active-map - "C-o" 'company-search-kill-others - "C-n" 'company-select-next-or-abort - "C-p" 'company-select-previous-or-abort - "C-h" 'company-show-doc-buffer - "C-S-h" 'company-show-location - "C-S-s" 'company-search-candidates - "C-s" 'company-filter-candidates - "C-SPC" 'company-complete-common - [tab] 'company-complete - "" 'company-select-previous - [escape] 'company-abort - "" 'helm-company - "C-w" nil - - :map company-search-map - "C-n" 'company-search-repeat-forward - "C-p" 'company-search-repeat-backward - [escape] 'company-abort - "C-w" nil) - -;; TODO: Swap helm's C-z and Tab - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Keymap fixes ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; This section is dedicated to keymaps that "fix" certain keys so -;; that they behave more like vim (or how I like it). - -;; Restores "dumb" indentation to the tab key. This rustles a lot of -;; peoples' jimmies, apparently, but it's how I like it. -(bind insert - "" 'narf:dumb-indent - "" 'indent-for-tab-command - - ;; No dumb-tab for lisp - :map lisp-mode-map [remap narf:dumb-indent] 'indent-for-tab-command - :map emacs-lisp-mode-map [remap narf:dumb-indent] 'indent-for-tab-command) - -;; Highjacks space/backspace to: -;; a) delete spaces on either side of the cursor, if present ( | ) -> (|) -;; b) allow backspace to delete space-indented blocks intelligently -;; c) and not do any of this magic when inside a string -(bind insert - "SPC" 'narf:inflate-space-maybe - [remap backward-delete-char-untabify] 'narf:deflate-space-maybe - [remap newline] 'narf:newline-and-indent - - ;; Smarter move-to-beginning-of-line - [remap move-beginning-of-line] 'narf:move-to-bol - - ;; Restore bash-esque keymaps in insert mode; C-w and C-a already exist - "C-e" 'narf:move-to-eol - "C-u" 'narf:backward-kill-to-bol-and-indent - - ;; Fixes delete - "" 'delete-char - - ;; Fix osx keymappings and then some - "" 'narf:move-to-bol - "" 'narf:move-to-eol - "" 'beginning-of-buffer - "" 'end-of-buffer - "" 'smart-up - "" 'smart-down - - ;; Fix emacs motion keys - "A-b" 'evil-backward-word-begin - "A-w" 'evil-forward-word-begin - "A-e" 'evil-forward-word-end - - (insert normal) - ;; Textmate-esque insert-line before/after - "" 'evil-open-below - "" 'evil-open-above) - -;; Make ESC quit all the things -(bind :map (minibuffer-local-map - minibuffer-local-ns-map - minibuffer-local-completion-map - minibuffer-local-must-match-map - minibuffer-local-isearch-map) - [escape] 'narf/minibuffer-quit) -(bind emacs [escape] 'narf/minibuffer-quit) - -(bind :map read-expression-map "C-w" 'evil-delete-backward-word) - -;; Line selection via linum -(bind " " 'narf/mouse-select-line - " " 'narf/mouse-select-line - " " 'narf/mouse-select-line - " " 'narf/mouse-select-block) - - -(provide 'narf-bindings) -;;; narf-bindings.el ends here diff --git a/init/narf-commands.el b/init/narf-commands.el deleted file mode 100644 index 2b21dc3fe..000000000 --- a/init/narf-commands.el +++ /dev/null @@ -1,88 +0,0 @@ -;; ex-commands -(evil-define-command narf::byte-compile (&optional bang) - :repeat nil - (interactive "") - (when emacs-lisp-mode - (if (not bang) - (progn ;; (byte-recompile-file (concat CORE-DIR "defuns.el") t 0) - (byte-recompile-file (buffer-file-name) t 0)) - (byte-recompile-file (expand-file-name "init.el" BASE-DIR) nil 0) - (byte-recompile-directory CORE-DIR 0 nil) - (byte-recompile-directory CONTRIB-DIR 0 nil) - (dolist (path (directory-files MODULES-DIR t "\\(core\\|defuns\\|narf\\).*\\.el$")) - (byte-recompile-file path nil 0))))) - -(evil-define-command narf::autoload-compile (&optional bang) - :repeat nil - (interactive "") - (defvar generated-autoload-file (expand-file-name "autoloads.el" MODULES-DIR)) - (update-directory-autoloads CORE-DIR MODULES-DIR CONTRIB-DIR)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(excmd! "settr[im]" 'narf:toggle-delete-trailing-whitespace) - -(excmd! "echo" 'narf::echo) -(excmd "l[ast]" 'popwin:popup-last-buffer) -(excmd "m[sg]" 'popwin:messages) -(excmd! "full[scr]" 'narf:toggle-fullscreen) -(excmd! "ini" 'narf::initfiles) -(excmd! "bcomp[ile]" 'narf::byte-compile) -(excmd! "acomp[ile]" 'narf::autoload-compile) -(excmd! "cd" 'narf::cd) -(excmd! "en[ew]" 'narf::create-file) -(excmd! "ren[ame]" 'narf::rename-this-file) ; rename [NEWNAME] # rename file -(excmd! "del[ete]" 'narf::delete-this-file) ; delete[!] -(excmd! "al[ign]" 'narf::align) -(excmd! "retab" 'narf::retab) -(excmd! "na[rrow]" 'narf::narrow-indirect-or-widen) ; Narrow buffer to selection -(excmd! "x" 'narf::scratch-buffer) -(excmd "k[ill]" 'kill-this-buffer) ; Kill current buffer -(excmd! "k[ill]o" 'narf:cleanup-buffers) ; Kill current project buffers -(excmd! "k[ill]all" 'narf::kill-buffers) ; Kill all buffers (bang = project buffers only) -(excmd! "k[ill]buried" 'narf::kill-buried-buffers) ; Kill all buffers (bang = project buffers only) -(excmd! "ma[ke]" 'narf::build) -(excmd! "t" 'narf::tmux-run) -(excmd! "tcd" 'narf::tmux-chdir) -(excmd! "a" 'helm-projectile-find-other-file) -(excmd! "proj[ect]" 'helm-projectile-switch-project) -(excmd! "ag" 'narf::ag-search) -(excmd! "agr" 'narf::ag-regex-search) -(excmd! "ag[cw]d" 'narf::ag-search-cwd) -(excmd! "agr[cw]d" 'narf::ag-regex-search-cwd) -(excmd! "sw[oop]" 'narf::swoop) -(excmd! "rec[ent]" 'narf::recentf) -(excmd! "ref[actor]" 'emr-show-refactor-menu) -(excmd! "snip[pets]" 'narf::snippets) ; snip[!] -(excmd! "cap[ture]" 'helm-org-capture-templates) -(excmd! "n[otes]" 'helm-org-agenda-files-headings) -(after "flycheck" - (excmd! "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))) -(after "re-builder" - (excmd "re[gex]" 'narf::regex)) -(after "org" - (excmd "o[rg]edit" 'org-edit-special) - (excmd "o[rg]refile" 'org-refile) - (excmd "o[rg]archive" 'org-archive-subtree) - (excmd "o[rg]agenda" 'org-agenda) - (excmd "o[rg]todo" 'org-show-todo-tree) - (excmd "o[rg]link" 'org-link) - (excmd "o[rg]align" 'org-align-all-tags)) -(after "workgroups2" - (excmd! "sl[oad]" 'narf::load-session) - (excmd! "ss[ave]" 'narf::save-session) - (excmd "wg" (λ (message (wg-workgroup-list-display)))) - (excmd! "wnew" 'narf::new-workgroup) - (excmd! "wre[name]" 'narf::rename-workgroup) - (excmd "wn[ext]" 'wg-switch-to-workgroup-right) - (excmd "wp[rev]" 'wg-switch-to-workgroup-left) - (excmd "wl[ast]" 'wg-switch-to-previous-workgroup) - (excmd "k[ill]w" 'wg-kill-workgroup) - (excmd "k[ill]ow" (λ (let (workgroup (wg-current-workgroup)) - (dolist (w (wg-workgroup-list)) - (unless (wg-current-workgroup-p w) - (wg-kill-workgroup w))))))) - - -(provide 'narf-commands) -;;; narf-commands.el ends here diff --git a/init/narf-settings.el b/init/narf-settings.el deleted file mode 100644 index 9a8ccd457..000000000 --- a/init/narf-settings.el +++ /dev/null @@ -1,26 +0,0 @@ -(set-register ?. "~/.dotfiles/") -(set-register ?d "~/Dropbox/Projects/") -(set-register ?@ "~/.emacs.d/init.el") - -;;;; Keymap Fixes ;;;;;;;;;;;;;;;;;;;;;; -;; Implements some helpful keymappings for emacs sub-modes -(add-hook! 'ido-setup-hook - (bind :map (ido-completion-map ido-file-completion-map) - ;; "" 'ido-delete-backward-updir - "C-w" 'ido-delete-backward-word-updir)) - -(bind :normal :map evil-command-window-mode-map [escape] 'kill-buffer-and-window) -(bind :map evil-ex-map [escape] 'narf/minibuffer-quit) - -(bind :map minibuffer-local-map "\C-u" 'evil-delete-whole-line) - -;; Disable the global drag-mouse map; clicking in new buffers often sends evil -;; into visual mode, which is UN...ACCEPTAABBLLLEEEE! -(global-unset-key (kbd "")) - -;; Don't allow quitting easily. -(setq confirm-kill-emacs (lambda (prompt) (y-or-n-p ">> Gee, I dunno Brain... Are you sure?"))) - - -(provide 'narf-settings) -;;; narf-settings.el ends here diff --git a/package.json b/package.json deleted file mode 100644 index f01165ecd..000000000 --- a/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "Emacs.d", - "preferGlobal": true, - "dependencies": { - "jshint": "*", - "jsonlint": "*", - "js-beautify": "*", - "jsctags": "git://github.com/ramitos/jsctags.git" - } -} diff --git a/private/README.md b/private/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/private/my-bindings.el b/private/my-bindings.el new file mode 100644 index 000000000..415391b64 --- /dev/null +++ b/private/my-bindings.el @@ -0,0 +1,336 @@ +;;; my-bindings.el + +;; Minimalistic key mapping! Why go so far for this? +;; ... +;; Uh. Good question. + +(@map + - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Global keymaps ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + "M-x" 'smex + "M-X" 'smex-major-mode-commands + "M-A-x" 'helm-M-x + "M-;" 'eval-expression + "C-`" 'popwin:toggle-popup-window + "M-=" 'text-scale-increase + "M--" 'text-scale-increase + "M-w" 'evil-window-delete + "M-/" 'evil-commentary-line + "M-b" 'narf:build + "M-t" 'helm-projectile-find-file + + :m "M-j" "6j" + :m "M-k" "6k" + :n "M-k" 'narf:eval-buffer + :n "M-d" 'dash-at-point + :n "M-o" 'narf:ido-find-file + :n "M-O" 'narf:ido-find-project-file + + (:when IS-MAC + "" 'backward-word + "" 'forward-word + "" 'narf:backward-kill-to-bol-and-indent + "A-SPC" 'just-one-space + "M-a" 'mark-whole-buffer + "M-c" 'evil-yank + "M-s" 'save-buffer + "M-v" 'clipboard-yank + "M-q" 'evil-quit-all + "M-z" 'undo + "M-Z" 'redo + "C-M-f" 'narf:toggle-fullscreen) + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Local keymaps ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + :nmv ";" evil-ex + + (:leader "m" + :n "," (λ (if (narf/project-p) (helm-projectile-switch-to-buffer) (helm-buffers-list))) + :n "<" 'helm-buffers-list + :n "." 'narf:ido-find-file + :n ">" 'narf:ido-find-file-other-window + :n "/" 'helm-projectile-find-file + :n ";" 'helm-semantic-or-imenu + + :n "]" 'helm-etags-select + :n "a" 'helm-projectile-find-other-file + :n "E" 'narf::initfiles + :n "h" 'helm-apropos + :n "n" 'narf::notes + :n "m" 'helm-recentf + :n "M" 'helm-projectile-recentf ; recent PROJECT files + :n "p" 'helm-projectile-switch-project + :n "r" 'emr-show-refactor-menu + + :n "qq" 'evil-save-and-quit + :n "QQ" (λ (let ((confirm-kill-emacs nil)) (narf::kill-buffers t) (evil-quit-all))) + + ;; insert lines in-place) + :n "jj" (λ (save-excursion (evil-insert-newline-below))) + :n "kk" (λ (save-excursion (evil-insert-newline-above))) + + :n "oo" 'narf:open-with + :n "ob" (λ (narf:open-with "Google Chrome")) + :n "of" (λ (narf:open-with "Finder.app" default-directory)) + :n "oF" (λ (narf:open-with "Finder.app" (narf/project-root))) + :n "ou" (λ (narf:open-with "Transmit")) + :n "oU" (λ (narf:open-with "Transmit" default-directory)) + :n "ol" (λ (narf:open-with "LaunchBar")) + :n "oL" (λ (narf:open-with "LaunchBar" default-directory)) + :n "ot" (λ (narf::tmux-chdir nil t)) + :n "oT" 'narf::tmux-chdir) + + (:localleader "\\" + :n "\\" 'narf:neotree-toggle + :n "." 'narf:neotree-find + :n ";" 'narf:nlinum-toggle + :n "=" 'toggle-transparency + :n "E" 'evil-emacs-state + + :n "]" 'next-buffer + :n "[" 'previous-buffer + + :n "s" (λ (narf::snippets t)) ; ido snippets dir + :n "g" 'diff-hl-diff-goto-hunk + :n "e" (λ (call-interactively 'flycheck-buffer) (flycheck-list-errors)) + :n "p" 'helm-show-kill-ring + :n "b" 'helm-bookmarks + :n "w" 'helm-wg) + + :m :remap "j" "gj" + :m :remap "k" "gk" + + :n "Y" "y$" + + :n "zr" 'narf:open-folds + :n "zm" 'narf:close-folds + + :n "zx" 'narf:kill-real-buffer + :n "zX" 'bury-buffer + + :n "]b" 'narf:next-real-buffer + :n "[b" 'narf:previous-real-buffer + :n "]w" 'wg-switch-to-workgroup-right + :n "[w" 'wg-switch-to-workgroup-left + + ;; don't move cursor on indent + :n "=" (λ (save-excursion (call-interactively 'evil-indent))) + + ;; Increment/decrement number under cursor + :n "g=" 'evil-numbers/inc-at-pt + :n "g-" 'evil-numbers/dec-at-pt + :n "gR" 'narf::eval-buffer + :n "gc" 'evil-commentary + :n "gy" 'evil-commentary-yank + + ;; VISUAL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + :v "." 'evil-repeat + :v "gR" 'narf::eval-region-and-replace + :v ",=" 'align-regexp + + ;; vnoremap < >gv + :v ">" (λ (evil-shift-right (region-beginning) (region-end)) + (evil-normal-state) + (evil-visual-restore)) + + ;; undo/redo for regions + ;; "u" 'undo-tree-undo + ;; "C-r" 'redo-tree-redo + + :v "*" 'evil-visualstar/begin-search-forward + :v "#" 'evil-visualstar/begin-search-backward + + ;; paste from recent yank register; which isn't overwritten by deletes or + ;; other operations. + :v "P" "\"0p" + + :v "S" 'evil-surround-region + :v "R" 'evil-iedit-state/iedit-mode ; edit all instances of marked region + :v "v" 'er/expand-region + :v "V" 'er/contract-region + + ;; aliases for % + :m "%" 'evilmi-jump-items + :m [tab] (λ (if (ignore-errors (hs-already-hidden-p)) + (hs-toggle-hiding) + (call-interactively 'evilmi-jump-items))) + + :m "]g" 'diff-hl-next-hunk + :m "[g" 'diff-hl-previous-hunk + + :m "]e" (λ (call-interactively (if (bound-and-true-p flycheck-mode) 'flycheck-next-error 'next-error))) + :m "[e" (λ (call-interactively (if (bound-and-true-p flycheck-mode) 'flycheck-previous-error 'previous-error))) + + :m "gl" 'narf:goto-line + :m "gs" 'evil-ace-jump-two-chars-mode + :m "gx" 'evil-exchange + :m "gr" 'narf::eval-region + :m "g]" 'smart-down + :m "g[" 'smart-up + + :i "" 'evil-delete-backward-word + :i "" (λ (evil-forward-word) (evil-delete-backward-word)) + + :i ;; Newline magic + :i "" 'backward-delete-char-untabify + :i "" 'narf:backward-kill-to-bol-and-indent + :i "" 'evil-ret-and-indent + + :i ;; Textmate-esque indent shift left/right + :i "M-[" "C-o m l C-o I DEL C-o ` l" + :i "M-]" (λ (evil-shift-right (point-at-bol) (point-at-eol))) + :i "" "M-[" + + ;; escape from insert mode (more responsive than using key-chord-define) + :ir "j" 'narf:exit-mode-maybe + :irv "C-g" 'evil-normal-state + + :o "s" 'evil-surround-edit + :o "S" 'evil-Surround-edit + + :n "!" 'rotate-word-at-point + :v "!" 'rotate-region + :e [escape] 'evil-normal-state + + :i "C-SPC" 'company-complete-common + :i "C-x C-k" 'company-dictionary + :i "C-x C-f" 'company-files + :i "C-x C-]" 'company-tags + :i "C-x s" 'company-ispell + :i "C-x C-s" 'company-yasnippet + :i "C-x C-o" 'company-semantic + :i "C-x C-n" 'company-dabbrev-code + :i "C-x C-p" (λ (let ((company-selection-wrap-around t)) + (call-interactively 'company-dabbrev-code) + (company-select-previous-or-abort))) + + (:map company-active-map + "C-o" 'company-search-kill-others + "C-n" 'company-select-next-or-abort + "C-p" 'company-select-previous-or-abort + "C-h" 'company-show-doc-buffer + "C-S-h" 'company-show-location + "C-S-s" 'company-search-candidates + "C-s" 'company-filter-candidates + "C-SPC" 'company-complete-common + [tab] 'company-complete + "" 'company-select-previous + [escape] 'company-abort + "" 'helm-company + :unset "C-w") + (:map company-search-map + "C-n" 'company-search-repeat-forward + "C-p" 'company-search-repeat-backward + [escape] 'company-abort + :unset "C-w") + + (keymap evil-window-map + "u" 'winner-undo + "C-u" 'winner-undo + "C-r" 'winner-redo + + "C-w" 'ace-window + "C-S-w" (λ (ace-window 4)) ; swap windows + "C-C" (λ (ace-window 16))) ; delete windows + + (:after help-mode + (:map help-mode-map + :n "]]" 'help-go-forward + :n "[[" 'help-go-back + :n "" (λ (kill-buffer) + (if (eq popwin:popup-buffer (current-buffer)) + (popwin:close-popup-window) + (evil-window-delete))))) + + (:map evil-ex-completion-map + "C-r" 'evil-ex-paste-from-register ; registers in ex-mode + "C-a" 'move-beginning-of-line + "" 'move-beginning-of-line + "" 'move-beginning-of-line + "" 'evil-delete-whole-line) + + (:map evil-snipe-override-mode-map + "C-;" 'evil-snipe-repeat + "C-," 'evil-snipe-repeat-reverse)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Keymap fixes ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; This section is dedicated to keymaps that "fix" certain keys so +;; that they behave more like vim (or how I like it). + +;; Restores "dumb" indentation to the tab key. This rustles a lot of +;; peoples' jimmies, apparently, but it's how I like it. +(@map :i "" 'narf:dumb-indent + :i "" 'indent-for-tab-command + + ;; No dumb-tab for lisp + :i :map lisp-mode-map [remap narf:dumb-indent] 'indent-for-tab-command + :i :map emacs-lisp-mode-map [remap narf:dumb-indent] 'indent-for-tab-command + +;; Highjacks space/backspace to: +;; a) delete spaces on either side of the cursor, if present ( | ) -> (|) +;; b) allow backspace to delete space-indented blocks intelligently +;; c) and not do any of this magic when inside a string + :i "SPC" 'narf:inflate-space-maybe + :i [remap backward-delete-char-untabify] 'narf:deflate-space-maybe + :i [remap newline] 'narf:newline-and-indent + + ;; Smarter move-to-beginning-of-line + :i [remap move-beginning-of-line] 'narf:move-to-bol + + ;; Restore bash-esque keymaps in insert mode; C-w and C-a already exist + :i "C-e" 'narf:move-to-eol + :i "C-u" 'narf:backward-kill-to-bol-and-indent + + ;; Fixes delete + :i "" 'delete-char + + ;; Fix osx keymappings and then some + :i "" 'narf:move-to-bol + :i "" 'narf:move-to-eol + :i "" 'beginning-of-buffer + :i "" 'end-of-buffer + :i "" 'smart-up + :i "" 'smart-down + + ;; Fix emacs motion keys + :i "A-b" 'evil-backward-word-begin + :i "A-w" 'evil-forward-word-begin + :i "A-e" 'evil-forward-word-end + + ;; Textmate-esque insert-line before/after + :ni "" 'evil-open-below + :ni "" 'evil-open-above + + ;; Make ESC quit all the things + :e [escape] narf/minibuffer-quit + (:map (minibuffer-local-map + minibuffer-local-ns-map + minibuffer-local-completion-map + minibuffer-local-must-match-map + minibuffer-local-isearch-map) + [escape] 'narf/minibuffer-quit) + + :map read-expression-map "C-w" 'evil-delete-backward-word + + ;; Line selection via linum + " " 'narf/mouse-select-line + " " 'narf/mouse-select-line + " " 'narf/mouse-select-line + " " 'narf/mouse-select-block) + +(provide 'my-bindings) +;;; my-bindings.el ends here diff --git a/private/my-commands.el b/private/my-commands.el new file mode 100644 index 000000000..69f954c18 --- /dev/null +++ b/private/my-commands.el @@ -0,0 +1,72 @@ +;;; my-commands.el + +(! (require 'core-defuns)) + +(@exmap "settr[im]" 'narf:toggle-delete-trailing-whitespace) + +(@exmap "l[ast]" 'popwin:popup-last-buffer) +(@exmap "m[sg]" 'popwin:messages) + +(@exmap "bcomp[ile]" 'narf:byte-compile) +(@exmap "acomp[ile]" 'narf:autoload-compile) + +(@exmap "echo" 'narf:echo) +(@exmap "full[scr]" 'narf/toggle-fullscreen) +(@exmap "ini" 'narf:initfiles) +(@exmap "cd" 'narf:cd) +(@exmap "en[ew]" 'narf:create-file) +(@exmap "ren[ame]" 'narf:rename-this-file) ; rename [NEWNAME] # rename file +(@exmap "del[ete]" 'narf:delete-this-file) ; delete[!] +(@exmap "al[ign]" 'narf:align) +(@exmap "retab" 'narf:retab) +(@exmap "na[rrow]" 'narf:narrow-indirect-or-widen) ; Narrow buffer to selection +(@exmap "x" 'narf:scratch-buffer) +(@exmap "k[ill]" 'kill-this-buffer) ; Kill current buffer +(@exmap "k[ill]o" 'narf:cleanup-buffers) ; Kill current project buffers +(@exmap "k[ill]all" 'narf:kill-buffers) ; Kill all buffers (bang = project buffers only) +(@exmap "k[ill]buried" 'narf:kill-buried-buffers) ; Kill all buffers (bang = project buffers only) +(@exmap "ma[ke]" 'narf:build) +(@exmap "t" 'narf:tmux-run) +(@exmap "tcd" 'narf:tmux-chdir) +(@exmap "a" 'helm-projectile-find-other-file) +(@exmap "proj[ect]" 'helm-projectile-switch-project) +(@exmap "ag" 'narf:ag-search) +(@exmap "agr" 'narf:ag-regex-search) +(@exmap "ag[cw]d" 'narf:ag-search-cwd) +(@exmap "agr[cw]d" 'narf:ag-regex-search-cwd) +(@exmap "sw[oop]" 'narf:swoop) +(@exmap "rec[ent]" 'narf:recentf) +(@exmap "ref[actor]" 'emr-show-refactor-menu) +(@exmap "snip[pets]" 'narf::snippets) ; snip[!] +(@exmap "cap[ture]" 'helm-org-capture-templates) +(@exmap "n[otes]" 'helm-org-agenda-files-headings) +(after "flycheck" + (@exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))) +(after "re-builder" + (@exmap "re[gex]" 'narf::regex)) +(after "org" + (@exmap "o[rg]edit" 'org-edit-special) + (@exmap "o[rg]refile" 'org-refile) + (@exmap "o[rg]archive" 'org-archive-subtree) + (@exmap "o[rg]agenda" 'org-agenda) + (@exmap "o[rg]todo" 'org-show-todo-tree) + (@exmap "o[rg]link" 'org-link) + (@exmap "o[rg]align" 'org-align-all-tags)) +(after "workgroups2" + (@exmap "sl[oad]" 'narf:load-session) + (@exmap "ss[ave]" 'narf:save-session) + (@exmap "wg" (λ (message (wg-workgroup-list-display)))) + (@exmap "wnew" 'narf:new-workgroup) + (@exmap "wre[name]" 'narf:rename-workgroup) + (@exmap "wn[ext]" 'wg-switch-to-workgroup-right) + (@exmap "wp[rev]" 'wg-switch-to-workgroup-left) + (@exmap "wl[ast]" 'wg-switch-to-previous-workgroup) + (@exmap "k[ill]w" 'wg-kill-workgroup) + (@exmap "k[ill]ow" (λ (let (workgroup (wg-current-workgroup)) + (dolist (w (wg-workgroup-list)) + (unless (wg-current-workgroup-p w) + (wg-kill-workgroup w))))))) + + +(provide 'my-commands) +;;; my-commands.el ends here diff --git a/private/themes/README.md b/private/themes/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/themes/narf-dark-theme.el b/private/themes/narf/narf-dark-theme.el similarity index 97% rename from themes/narf-dark-theme.el rename to private/themes/narf/narf-dark-theme.el index 3cc666408..6ac4d786b 100644 --- a/themes/narf-dark-theme.el +++ b/private/themes/narf/narf-dark-theme.el @@ -50,12 +50,12 @@ `(mode-line ((t (:foreground ,white :background ,gutter-light - ;;:box (:line-width 0 :color ,gutter-light) + :box (:line-width 3 :color ,gutter-light) )))) `(mode-line-inactive ((t (:foreground ,gutter-fg :background ,gutters-active - ;;:box (:line-width 0 :color ,gutters-active) + :box (:line-width 3 :color ,gutters-active) )))) `(mode-line-modified-face ((t (:foreground ,builtin)))) diff --git a/screenshots/01.png b/screenshots/01.png deleted file mode 100644 index 749124063..000000000 Binary files a/screenshots/01.png and /dev/null differ diff --git a/screenshots/02.png b/screenshots/02.png deleted file mode 100644 index cf5f7a0ca..000000000 Binary files a/screenshots/02.png and /dev/null differ diff --git a/snippets b/snippets deleted file mode 160000 index a7565d061..000000000 --- a/snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a7565d06156caff49adaae426a2be638090fd1e5 diff --git a/themes/narf-light-theme.el b/themes/narf-light-theme.el deleted file mode 100644 index 575a826ba..000000000 --- a/themes/narf-light-theme.el +++ /dev/null @@ -1,163 +0,0 @@ - ;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; ***************************************************************************************** -;; -;; v0 :- A dark Emacs theme inspired by Space Grey ST2 theme -;; -;; ***************************************************************************************** - -;; -;; By Henrik Lissner -;; - -(deftheme v0 "V-NOUGHT dark theme for Emacs 24+") - - (custom-theme-set-variables 'v0) - - (let (;; (background "#222222") - (background "#2b303b") - ;; (gutters "#262E34") - (gutters "#1f252a") - (gutter-fg "#55616A") - ;; (gutters-active "#2e363c") - (gutters-active "#1c1f26") - (linum "#1e262c") - ;; (gutter-light "#434f58") - (gutter-light "#232830") - (builtin "#d08770") - (foreground "#c0c5ce") - (invisibles "#65737e") - ;; (line-hl "#353539") - (line-hl "#343d46") - (selection "#4f5b66") - (text "#c0c5ce") - (comments "#65737e") - (punctuation "#8fa1b3") - (delimiters "#c0c5ce") - (operators "#c0c5ce") - (keywords "#b48ead") - (variables "#CBECFF") - (functions "#8fa1b3") - (methods "#8fa1b3") - (strings "#a3be8c") - (constants "#d08770") - (white "#ffffff") - (highlight "orange") - (dim-highlight "#556779") - - (git-modified "#55616A") - (git-added "#436b3b") - (git-deleted "#714243")) - - (custom-theme-set-faces - 'v0 - -;; Default colors -;; ***************************************************************************************** - - `(default ((t (:foreground ,text :background ,background) ))) - `(hl-line ((t (:background ,line-hl) ))) - `(region ((t (:background ,selection) ))) - `(cursor ((t (:background ,white) ))) - `(fringe ((t (:background ,background :foreground ,white) ))) - `(linum ((t (:background ,background :foreground ,gutter-fg :weight normal) ))) - - `(vertical-border ((t (:foreground "#000000") ))) - - `(mode-line ((t (:foreground ,white - :background ,gutter-light - :box (:line-width 3 :color ,gutter-light) - )))) - - `(mode-line-inactive ((t (:foreground ,gutter-fg - :background ,gutters-active - :box (:line-width 3 :color ,gutters-active) - )))) - - `(mode-line-modified-face ((t (:foreground ,builtin)))) - - `(sml/folder ((t nil))) - `(sml/modified ((t (:foreground ,highlight)))) - - `(flyspell-incorrect ((t (:underline "#ff5555" :inherit unspecified)))) - - `(helm-source-header ((t (:background ,gutters-active :foreground ,strings :weight bold :height 1.0)))) - `(helm-selection ((t (:background ,selection)))) - -;; Font lock faces -;; ***************************************************************************************** - - `(linum-highlight-face ((t (:foreground ,text :background ,line-hl :inherit linum)))) - - `(font-lock-keyword-face ((t (:foreground ,keywords)))) - `(font-lock-type-face ((t (:foreground ,punctuation)))) - `(font-lock-constant-face ((t (:foreground ,constants)))) - `(font-lock-variable-name-face ((t (:foreground ,variables)))) - `(font-lock-builtin-face ((t (:foreground ,builtin)))) - `(font-lock-string-face ((t (:foreground ,strings)))) - `(font-lock-comment-face ((t (:foreground ,comments)))) - `(font-lock-comment-delimiter-face ((t (:foreground ,comments)))) - `(font-lock-function-name-face ((t (:foreground ,functions)))) - `(font-lock-doc-string-face ((t (:foreground ,comments)))) - `(font-lock-doc-face ((t (:foreground ,comments)))) - - `(trailing-whitespace ((t (:background "#884444")))) - `(whitespace-tab ((t (:foreground "#444444")))) - `(whitespace-newline ((t (:foreground "#444444")))) - `(whitespace-trailing ((t (:background "#553333")))) - - `(git-gutter+-modified ((t (:foreground ,git-modified :background nil)))) - `(git-gutter+-added ((t (:foreground ,git-added :background nil)))) - `(git-gutter+-deleted ((t (:foreground ,git-deleted :background nil)))) - - `(diff-hl-change ((t (:background ,git-modified)))) - `(diff-hl-delete ((t (:background ,git-deleted)))) - `(diff-hl-insert ((t (:background ,git-added)))) - - `(rainbow-delimiters-unmatched-face ((t (:inherit 'error)))) - `(rainbow-delimiters-depth-1-face ((t (:foreground "#CCCCCC" :weight bold :bold t)))) - -;; js2-mode -;; ***************************************************************************************** - - `(js2-function-param ((t (:foreground ,variables)))) - `(js2-jsdoc-tag ((t (:foreground ,comments :weight bold :bold t)))) - - -;; ***************************************************************************************** - - `(persp-selected-face ((t (:foreground ,builtin)))) - - `(org-level-1 ((t (:inherit outline-1 :bold t :foreground ,constants)))) - `(org-level-2 ((t (:inherit outline-2 :bold t :foreground ,variables)))) - - `(show-paren-match ((t (:background nil :foreground ,highlight :weight ultra-bold)))) - - `(evil-snipe-first-match-face ((t (:background ,highlight :foreground "black")))) - `(evil-snipe-matches-face ((t (:foreground ,highlight :background ,dim-highlight)))) - `(isearch ((t (:foreground "black" :background ,highlight :inverse-video nil)))) - `(isearch-lazy-highlight-face ((t (:foreground ,text :background ,dim-highlight)))) - `(evil-search-highlight-persist-highlight-face - ((t (:background nil :foreground nil :inherit isearch-lazy-highlight-face)))) - - )) - - -;; ***************************************************************************************** - -(provide-theme 'v0) - -;; Local Variables: -;; no-byte-compile: t -;; End: