diff --git a/.gitignore b/.gitignore index 8c58fc0..ee058f6 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ tramp /var/pcache .emacs.desktop .emacs.desktop.lock +network-security.data diff --git a/README.md b/README.md index 8eca638..2e5b42b 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,8 @@ wget --no-check-certificate https://github.com/bbatsov/prelude/raw/master/utils/ ### Manual +Make sure you do not have any `~/.emacs` file present. + ```bash git clone git://github.com/bbatsov/prelude.git path/to/local/repo ln -s path/to/local/repo ~/.emacs.d @@ -257,7 +259,7 @@ alias vi='emacsclient -t' The last two aliases are helpful if you're used to editing files from the command line using `vi(m)`. -Also you can open a file with cursor on choosen line: +You can also open a file with the cursor positioned directly on a specific line: ```bash emacsclient somefile:1234 @@ -695,10 +697,12 @@ and send me a pull request. :-) ## Support -Support is available via the Prelude Google Group . - -There's also a Freenode channel you can visit - `#prelude-emacs`. +Support is available via several channels: +* Prelude's Google Group +* Prelude's Freenode channel (`#prelude-emacs`) +* [Gitter](https://gitter.im/bbatsov/prelude) +. ## Contributors Here's a [list](https://github.com/bbatsov/prelude/contributors) of all the people who have contributed to the diff --git a/core/prelude-core.el b/core/prelude-core.el index 33584cb..216aa3e 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -68,7 +68,7 @@ PROMPT sets the `read-string prompt." (if _after (ov-reset _ov)))) (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) (ov-set (format "[[:space:]]*%s+[[:space:]]*TODO:" comment-start) 'before-string diff --git a/core/prelude-custom.el b/core/prelude-custom.el index be6f74c..34f0584 100644 --- a/core/prelude-custom.el +++ b/core/prelude-custom.el @@ -98,11 +98,6 @@ Only modes that don't derive from `prog-mode' should be listed here." :type 'symbol :group 'prelude) -(defcustom prelude-shell (getenv "SHELL") - "The default shell to run with `crux-visit-term-buffer'" - :type 'string - :group 'prelude) - (provide 'prelude-custom) ;;; prelude-custom.el ends here diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index 6eb6467..425a189 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -75,7 +75,7 @@ (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-to-char) diff --git a/init.el b/init.el index bee0f12..c77a359 100644 --- a/init.el +++ b/init.el @@ -125,7 +125,7 @@ by Prelude.") (message "Missing modules file %s" prelude-modules-file) (message "You can get started by copying the bundled example file from sample/prelude-modules.el")) -;; config changes made through the customize UI will be store here +;; config changes made through the customize UI will be stored here (setq custom-file (expand-file-name "custom.el" prelude-personal-dir)) ;; load the personal settings (this includes `custom-file') @@ -135,6 +135,12 @@ by Prelude.") (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 ;; greet the use with some useful tip (run-at-time 5 nil 'prelude-tip-of-the-day)) diff --git a/modules/doc/prelude-erc.md b/modules/doc/prelude-erc.md index 539c725..5f61069 100644 --- a/modules/doc/prelude-erc.md +++ b/modules/doc/prelude-erc.md @@ -2,30 +2,49 @@ ## 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 -(setq my-fav-irc '( "irc.freenode.net" - "irc.oftc.net" - "irc.mozilla.org" - "irc.gnome.org")) +``` emacs-lisp +(setq my-fav-irc '("irc.freenode.net" + "irc.oftc.net" + "irc.mozilla.org" + "irc.gnome.org")) ``` ## 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 -(setq bye-erc-message "adios") +``` emacs-lisp +(setq bye-erc-message "adios") ``` ## 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 -(setq erc-prompt-for-password nil) +``` emacs-lisp +(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) +``` diff --git a/modules/prelude-common-lisp.el b/modules/prelude-common-lisp.el index 0269013..4829f02 100644 --- a/modules/prelude-common-lisp.el +++ b/modules/prelude-common-lisp.el @@ -62,7 +62,7 @@ (setq slime-default-lisp 'sbcl)) ;; 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))) ;; 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-autodoc-use-multiline-p t 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))) (provide 'prelude-common-lisp) diff --git a/modules/prelude-erc.el b/modules/prelude-erc.el index fb5f2c9..701009c 100644 --- a/modules/prelude-erc.el +++ b/modules/prelude-erc.el @@ -114,10 +114,16 @@ that can occur between two notifications. The default is (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" - "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) "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?" (interactive) (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))) (defun filter-server-buffers () @@ -140,10 +148,14 @@ that can occur between two notifications. The default is (defun stop-irc () "Disconnects from all irc servers." (interactive) + (when prelude-new-irc-persp + (persp-switch "IRC")) (dolist (buffer (filter-server-buffers)) (message "Server buffer: %s" (buffer-name 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) diff --git a/modules/prelude-ido.el b/modules/prelude-ido.el index 649991a..768bf74 100644 --- a/modules/prelude-ido.el +++ b/modules/prelude-ido.el @@ -31,10 +31,10 @@ ;; Boston, MA 02110-1301, USA. ;;; Code: -(prelude-require-packages '(flx-ido ido-ubiquitous smex)) +(prelude-require-packages '(flx-ido ido-completing-read+ smex)) (require 'ido) -(require 'ido-ubiquitous) +(require 'ido-completing-read+) (require 'flx-ido) (setq ido-enable-prefix nil diff --git a/modules/prelude-rust.el b/modules/prelude-rust.el new file mode 100644 index 0000000..bb4c4a8 --- /dev/null +++ b/modules/prelude-rust.el @@ -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 diff --git a/sample/prelude-modules.el b/sample/prelude-modules.el index 496a499..c4a340b 100644 --- a/sample/prelude-modules.el +++ b/sample/prelude-modules.el @@ -29,6 +29,7 @@ (require 'prelude-perl) ;; (require 'prelude-python) ;; (require 'prelude-ruby) +;; (require 'prelude-rust) ;; (require 'prelude-scala) (require 'prelude-scheme) (require 'prelude-shell) diff --git a/sample/prelude-pinned-packages.el b/sample/prelude-pinned-packages.el index 719cf99..6d79431 100644 --- a/sample/prelude-pinned-packages.el +++ b/sample/prelude-pinned-packages.el @@ -73,8 +73,6 @@ (helm-core . "melpa-stable") (helm-descbinds . "melpa-stable") (helm-projectile . "melpa-stable") - (ido-completing-read+ . "melpa-stable") - (ido-ubiquitous . "melpa-stable") (imenu-anywhere . "melpa-stable") (inf-ruby . "melpa-stable") (js2-mode . "melpa-stable")