Merge branch 'master' of github.com:bbatsov/prelude
This commit is contained in:
commit
e7876d5096
12 changed files with 128 additions and 25 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -23,3 +23,4 @@ tramp
|
||||||
/var/pcache
|
/var/pcache
|
||||||
.emacs.desktop
|
.emacs.desktop
|
||||||
.emacs.desktop.lock
|
.emacs.desktop.lock
|
||||||
|
network-security.data
|
||||||
|
|
|
@ -136,6 +136,8 @@ wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/
|
||||||
|
|
||||||
### Manual
|
### Manual
|
||||||
|
|
||||||
|
Make sure you do not have any `~/.emacs` file present.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git://github.com/bbatsov/prelude.git path/to/local/repo
|
git clone git://github.com/bbatsov/prelude.git path/to/local/repo
|
||||||
ln -s path/to/local/repo ~/.emacs.d
|
ln -s path/to/local/repo ~/.emacs.d
|
||||||
|
|
|
@ -68,7 +68,7 @@ PROMPT sets the `read-string prompt."
|
||||||
(if _after (ov-reset _ov))))
|
(if _after (ov-reset _ov))))
|
||||||
|
|
||||||
(defun prelude-annotate-todo ()
|
(defun prelude-annotate-todo ()
|
||||||
"Put fringe marker on TODO: lines in the curent buffer."
|
"Put fringe marker on TODO: lines in the current buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
(ov-set (format "[[:space:]]*%s+[[:space:]]*TODO:" comment-start)
|
(ov-set (format "[[:space:]]*%s+[[:space:]]*TODO:" comment-start)
|
||||||
'before-string
|
'before-string
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
(define-key 'help-command (kbd "C-i") 'info-display-manual)
|
(define-key 'help-command (kbd "C-i") 'info-display-manual)
|
||||||
|
|
||||||
;; replace zap-to-char functionaity with the more powerful zop-to-char
|
;; replace zap-to-char functionality with the more powerful zop-to-char
|
||||||
(global-set-key (kbd "M-z") 'zop-up-to-char)
|
(global-set-key (kbd "M-z") 'zop-up-to-char)
|
||||||
(global-set-key (kbd "M-Z") 'zop-to-char)
|
(global-set-key (kbd "M-Z") 'zop-to-char)
|
||||||
|
|
||||||
|
|
6
init.el
6
init.el
|
@ -135,6 +135,12 @@ by Prelude.")
|
||||||
|
|
||||||
(message "Prelude is ready to do thy bidding, Master %s!" current-user)
|
(message "Prelude is ready to do thy bidding, Master %s!" current-user)
|
||||||
|
|
||||||
|
;; Patch security vulnerability in Emacs versions older than 25.3
|
||||||
|
(when (version< emacs-version "25.3")
|
||||||
|
(eval-after-load "enriched"
|
||||||
|
'(defun enriched-decode-display-prop (start end &optional param)
|
||||||
|
(list start end))))
|
||||||
|
|
||||||
(prelude-eval-after-init
|
(prelude-eval-after-init
|
||||||
;; greet the use with some useful tip
|
;; greet the use with some useful tip
|
||||||
(run-at-time 5 nil 'prelude-tip-of-the-day))
|
(run-at-time 5 nil 'prelude-tip-of-the-day))
|
||||||
|
|
|
@ -2,30 +2,49 @@
|
||||||
|
|
||||||
## Customizing Server list
|
## Customizing Server list
|
||||||
|
|
||||||
If you want to join a list of servers on `M-x start-irc`, other than the default list, please redefine the variable `my-fav-irc` as follows in your personal config
|
If you want to join a list of servers on `M-x start-irc`, other than
|
||||||
|
the default list, please redefine the variable `my-fav-irc` as follows
|
||||||
|
in your personal config
|
||||||
|
|
||||||
``` emacs-lisp
|
``` emacs-lisp
|
||||||
(setq my-fav-irc '( "irc.freenode.net"
|
(setq my-fav-irc '("irc.freenode.net"
|
||||||
"irc.oftc.net"
|
"irc.oftc.net"
|
||||||
"irc.mozilla.org"
|
"irc.mozilla.org"
|
||||||
"irc.gnome.org"))
|
"irc.gnome.org"))
|
||||||
```
|
```
|
||||||
|
|
||||||
## Customizing Last Quit Message
|
## Customizing Last Quit Message
|
||||||
|
|
||||||
If you want to customize your IRC Last Quit Message from *Asta la vista* to something more funkier, please redefine `bye-irc-message` as follows
|
If you want to customize your IRC Last Quit Message from *Asta la
|
||||||
|
vista* to something more funkier, please redefine `bye-irc-message` as
|
||||||
|
follows
|
||||||
|
|
||||||
``` emacs-lisp
|
``` emacs-lisp
|
||||||
(setq bye-erc-message "adios")
|
(setq bye-erc-message "adios")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reading NickServ passwords from auth-source plugin
|
## Reading NickServ passwords from auth-source plugin
|
||||||
|
|
||||||
If you want to automatically authenticate while logging into IRC servers set the `erc-prompt-for-password` to nil as follows
|
If you want to automatically authenticate while logging into IRC
|
||||||
|
servers set the `erc-prompt-for-password` to nil as follows
|
||||||
|
|
||||||
``` emacs-lisp
|
``` emacs-lisp
|
||||||
(setq erc-prompt-for-password nil)
|
(setq erc-prompt-for-password nil)
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can set password in plaintext in .authinfo file in the netRC format or you it encrypted in .authinfo.gpg file after setting up gpg in emacs
|
Now you can set password in plaintext in .authinfo file in the netRC
|
||||||
|
format or you it encrypted in .authinfo.gpg file after setting up gpg
|
||||||
|
in emacs
|
||||||
|
|
||||||
|
## Opening all ERC buffers in a new perspective
|
||||||
|
Many a time when we start IRC with the `start-irc` command, all the
|
||||||
|
channels open in our existing workspace, which can be annoying to
|
||||||
|
some; especially to those who like to organize their buffers into
|
||||||
|
separate groups (perspectives). To avoid this scenario, it is better
|
||||||
|
to group all the ERC buffers into one perspective called `IRC` when
|
||||||
|
`start-irc` is called. To enable this set the `prelude-new-irc-persp`
|
||||||
|
variable to true as follows
|
||||||
|
|
||||||
|
``` emacs-lisp
|
||||||
|
(setq prelude-new-irc-persp t)
|
||||||
|
```
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
(setq slime-default-lisp 'sbcl))
|
(setq slime-default-lisp 'sbcl))
|
||||||
|
|
||||||
;; Add fancy slime contribs
|
;; Add fancy slime contribs
|
||||||
(setq slime-contribs '(slime-fancy))
|
(setq slime-contribs '(slime-fancy slime-cl-indent))
|
||||||
|
|
||||||
(add-hook 'lisp-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook)))
|
(add-hook 'lisp-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook)))
|
||||||
;; rainbow-delimeters messes up colors in slime-repl, and doesn't seem to work
|
;; rainbow-delimeters messes up colors in slime-repl, and doesn't seem to work
|
||||||
|
@ -78,8 +78,6 @@
|
||||||
slime-enable-evaluate-in-emacs t
|
slime-enable-evaluate-in-emacs t
|
||||||
slime-autodoc-use-multiline-p t
|
slime-autodoc-use-multiline-p t
|
||||||
slime-auto-start 'always)
|
slime-auto-start 'always)
|
||||||
|
|
||||||
(define-key slime-mode-map (kbd "TAB") 'slime-indent-and-complete-symbol)
|
|
||||||
(define-key slime-mode-map (kbd "C-c C-s") 'slime-selector)))
|
(define-key slime-mode-map (kbd "C-c C-s") 'slime-selector)))
|
||||||
|
|
||||||
(provide 'prelude-common-lisp)
|
(provide 'prelude-common-lisp)
|
||||||
|
|
|
@ -114,10 +114,16 @@ that can occur between two notifications. The default is
|
||||||
|
|
||||||
|
|
||||||
(defvar my-fav-irc '( "irc.freenode.net" )
|
(defvar my-fav-irc '( "irc.freenode.net" )
|
||||||
"Stores the list of IRC servers that you want to connect to with start-irc.")
|
"Stores the list of IRC servers that you want to connect to with start-irc.")
|
||||||
|
|
||||||
(defvar bye-irc-message "Asta la vista"
|
(defvar bye-irc-message "Asta la vista"
|
||||||
"Message string to be sent while quitting IRC.")
|
"Message string to be sent while quitting IRC.")
|
||||||
|
|
||||||
|
(defcustom prelude-new-irc-persp nil
|
||||||
|
"True (t) means start IRC in new perspective."
|
||||||
|
:type 'boolean
|
||||||
|
:require 'prelude-erc
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
(defun connect-to-erc (server)
|
(defun connect-to-erc (server)
|
||||||
"Connects securely to IRC SERVER over TLS at port 6697."
|
"Connects securely to IRC SERVER over TLS at port 6697."
|
||||||
|
@ -129,6 +135,8 @@ that can occur between two notifications. The default is
|
||||||
"Connect to IRC?"
|
"Connect to IRC?"
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (y-or-n-p "Do you want to start IRC? ")
|
(when (y-or-n-p "Do you want to start IRC? ")
|
||||||
|
(when prelude-new-irc-persp
|
||||||
|
(persp-switch "IRC"))
|
||||||
(mapcar 'connect-to-erc my-fav-irc)))
|
(mapcar 'connect-to-erc my-fav-irc)))
|
||||||
|
|
||||||
(defun filter-server-buffers ()
|
(defun filter-server-buffers ()
|
||||||
|
@ -140,10 +148,14 @@ that can occur between two notifications. The default is
|
||||||
(defun stop-irc ()
|
(defun stop-irc ()
|
||||||
"Disconnects from all irc servers."
|
"Disconnects from all irc servers."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(when prelude-new-irc-persp
|
||||||
|
(persp-switch "IRC"))
|
||||||
(dolist (buffer (filter-server-buffers))
|
(dolist (buffer (filter-server-buffers))
|
||||||
(message "Server buffer: %s" (buffer-name buffer))
|
(message "Server buffer: %s" (buffer-name buffer))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(erc-quit-server bye-irc-message))))
|
(erc-quit-server bye-irc-message)))
|
||||||
|
(when prelude-new-irc-persp
|
||||||
|
(persp-kill "IRC")))
|
||||||
|
|
||||||
(provide 'prelude-erc)
|
(provide 'prelude-erc)
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@
|
||||||
;; Boston, MA 02110-1301, USA.
|
;; Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(prelude-require-packages '(flx-ido ido-ubiquitous smex))
|
(prelude-require-packages '(flx-ido ido-completing-read+ smex))
|
||||||
|
|
||||||
(require 'ido)
|
(require 'ido)
|
||||||
(require 'ido-ubiquitous)
|
(require 'ido-completing-read+)
|
||||||
(require 'flx-ido)
|
(require 'flx-ido)
|
||||||
|
|
||||||
(setq ido-enable-prefix nil
|
(setq ido-enable-prefix nil
|
||||||
|
|
66
modules/prelude-rust.el
Normal file
66
modules/prelude-rust.el
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
;;; prelude-rust.el --- Emacs Prelude: Rust programming support.
|
||||||
|
;;
|
||||||
|
;; Authors: Doug MacEachern, Manoel Vilela
|
||||||
|
;; Version: 1.0.1
|
||||||
|
;; Keywords: convenience rust
|
||||||
|
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Prelude configuration for Rust
|
||||||
|
|
||||||
|
;;; 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 GNU Emacs; 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 'prelude-programming)
|
||||||
|
|
||||||
|
;; You may need installing the following packages on your system:
|
||||||
|
;; * rustc (Rust Compiler)
|
||||||
|
;; * cargo (Rust Package Manager)
|
||||||
|
;; * racer (Rust Completion Tool)
|
||||||
|
;; * rustfmt (Rust Tool for formatting code)
|
||||||
|
|
||||||
|
(prelude-require-packages '(rust-mode
|
||||||
|
racer
|
||||||
|
flycheck-rust
|
||||||
|
cargo))
|
||||||
|
|
||||||
|
(setq rust-format-on-save t)
|
||||||
|
|
||||||
|
(eval-after-load 'rust-mode
|
||||||
|
'(progn
|
||||||
|
(add-hook 'rust-mode-hook 'racer-mode)
|
||||||
|
(add-hook 'racer-mode-hook 'eldoc-mode)
|
||||||
|
(add-hook 'rust-mode-hook 'cargo-minor-mode)
|
||||||
|
(add-hook 'rust-mode-hook 'flycheck-rust-setup)
|
||||||
|
(add-hook 'flycheck-mode-hook 'flycheck-rust-setup)
|
||||||
|
|
||||||
|
(defun prelude-rust-mode-defaults ()
|
||||||
|
(local-set-key (kbd "C-c C-d") 'racer-describe)
|
||||||
|
;; CamelCase aware editing operations
|
||||||
|
(subword-mode +1))
|
||||||
|
|
||||||
|
(setq prelude-rust-mode-hook 'prelude-rust-mode-defaults)
|
||||||
|
|
||||||
|
(add-hook 'rust-mode-hook (lambda ()
|
||||||
|
(run-hooks 'prelude-rust-mode-hook)))))
|
||||||
|
|
||||||
|
(provide 'prelude-rust)
|
||||||
|
;;; prelude-rust.el ends here
|
|
@ -29,6 +29,7 @@
|
||||||
(require 'prelude-perl)
|
(require 'prelude-perl)
|
||||||
;; (require 'prelude-python)
|
;; (require 'prelude-python)
|
||||||
;; (require 'prelude-ruby)
|
;; (require 'prelude-ruby)
|
||||||
|
;; (require 'prelude-rust)
|
||||||
;; (require 'prelude-scala)
|
;; (require 'prelude-scala)
|
||||||
(require 'prelude-scheme)
|
(require 'prelude-scheme)
|
||||||
(require 'prelude-shell)
|
(require 'prelude-shell)
|
||||||
|
|
|
@ -73,8 +73,6 @@
|
||||||
(helm-core . "melpa-stable")
|
(helm-core . "melpa-stable")
|
||||||
(helm-descbinds . "melpa-stable")
|
(helm-descbinds . "melpa-stable")
|
||||||
(helm-projectile . "melpa-stable")
|
(helm-projectile . "melpa-stable")
|
||||||
(ido-completing-read+ . "melpa-stable")
|
|
||||||
(ido-ubiquitous . "melpa-stable")
|
|
||||||
(imenu-anywhere . "melpa-stable")
|
(imenu-anywhere . "melpa-stable")
|
||||||
(inf-ruby . "melpa-stable")
|
(inf-ruby . "melpa-stable")
|
||||||
(js2-mode . "melpa-stable")
|
(js2-mode . "melpa-stable")
|
||||||
|
|
Loading…
Reference in a new issue