Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bbatsov/prelude
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/bbatsov/prelude: (28 commits)
  Add tip on keyboard shortcut for ace-jump-mode
  Auto install cmake-mode
  Enable ERC spell mode only if prelude-flyspell
  Add tip on keyboard shortcut to open recent file
  Add Prelude tip on keyboard shortcut to join lines
  Added Gitter badge
  Update copyright years
  Kill some tabs
  [Fix bbatsov#813] Add missing smartrep require
  [Fix bbatsov#798] Prompt for confirmation in prelude-kill-other-buffers
  Use gfm-mode instead of plain markdown-mode
  Switch the bindings for zop-to-char and zop-up-to-char
  Add the zop-to-char package
  Minor README tweak - Gittip is now Gratipay
  Warn if the modules file is missing
  Require imenu for prelude-goto-symbol
  `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead.
  Use K&R as default style
  Revert "[Fix bbatsov#782] Added magit-filenotify"
  Remove fringe size customization
  ...
  • Loading branch information
Caleb Epstein committed Mar 25, 2015
2 parents 10098ab + 5d25782 commit 73992ed
Show file tree
Hide file tree
Showing 43 changed files with 113 additions and 109 deletions.
62 changes: 32 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt)
[![Gittip](http://img.shields.io/gittip/bbatsov.svg)](https://www.gittip.com/bbatsov/)
[![Gratipay](http://img.shields.io/gratipay/bbatsov.svg)](https://gratipay.com/bbatsov/)

Emacs Prelude
=============

[![Join the chat at https://gitter.im/bbatsov/prelude](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bbatsov/prelude?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Prelude is an Emacs distribution that aims to enhance the default
Emacs experience. Prelude alters a lot of the default settings,
bundles a plethora of additional packages and adds its own core
Expand All @@ -20,41 +22,41 @@ advised to always run Prelude with the latest Emacs - currently
- [Fast Forward](#fast-forward)
- [Installing Emacs 24](#installing-emacs-24)
- [Installation](#installation)
- [Automated](#automated)
- [Via Curl](#via-curl)
- [Via Wget](#via-wget)
- [Manual](#manual)
- [Automated](#automated)
- [Via Curl](#via-curl)
- [Via Wget](#via-wget)
- [Manual](#manual)
- [Updating Prelude](#updating-prelude)
- [Manual update](#manual-update)
- [Update all bundled packages](#update-all-bundled-packages)
- [Update Prelude's code](#update-preludes-code)
- [Restart Prelude](#restart-prelude)
- [Automatic update](#automatic-update)
- [Manual update](#manual-update)
- [Update all bundled packages](#update-all-bundled-packages)
- [Update Prelude's code](#update-preludes-code)
- [Restart Prelude](#restart-prelude)
- [Automatic update](#automatic-update)
- [Enabling additional modules](#enabling-additional-modules)
- [Running](#running)
- [Getting to know Prelude](#getting-to-know-prelude)
- [Keymap](#keymap)
- [Global](#global)
- [Prelude Mode](#prelude-mode)
- [OSX modifier keys](#osx-modifier-keys)
- [Projectile](#projectile)
- [Helm](#helm)
- [Key-chords](#key-chords)
- [Disabling key-chords](#disabling-key-chords)
- [Keymap](#keymap)
- [Global](#global)
- [Prelude Mode](#prelude-mode)
- [OSX modifier keys](#osx-modifier-keys)
- [Projectile](#projectile)
- [Helm](#helm)
- [Key-chords](#key-chords)
- [Disabling key-chords](#disabling-key-chords)
- [Automatic package installation](#automatic-package-installation)
- [Color Themes](#color-themes)
- [Personalizing](#personalizing)
- [Disabling whitespace-mode](#disabling-whitespace-mode)
- [Disable flyspell-mode](#disable-flyspell-mode)
- [Color Themes](#color-themes)
- [Personalizing](#personalizing)
- [Disabling whitespace-mode](#disabling-whitespace-mode)
- [Disable flyspell-mode](#disable-flyspell-mode)
- [Caveats & Pitfalls](#caveats--pitfalls)
- [Updating bundled packages](#updating-bundled-packages)
- [Problems with flyspell-mode](#problems-with-flyspell-mode)
- [Ugly colors in the terminal Emacs version](#ugly-colors-in-the-terminal-emacs-version)
- [MELPA error on initial startup](#melpa-error-on-initial-startup)
- [Warnings on arrow navigation in editor buffers](#warnings-on-navigation-in-editor-buffers)
- [Customized C-a behavior](#customized-c-a-behavior)
- [Poor ido matching performance on large datasets](#poor-ido-matching-performance-on-large-datasets)
- [Windows compatibility](#windows-compatibility)
- [Updating bundled packages](#updating-bundled-packages)
- [Problems with flyspell-mode](#problems-with-flyspell-mode)
- [Ugly colors in the terminal Emacs version](#ugly-colors-in-the-terminal-emacs-version)
- [MELPA error on initial startup](#melpa-error-on-initial-startup)
- [Warnings on arrow navigation in editor buffers](#warnings-on-navigation-in-editor-buffers)
- [Customized C-a behavior](#customized-c-a-behavior)
- [Poor ido matching performance on large datasets](#poor-ido-matching-performance-on-large-datasets)
- [Windows compatibility](#windows-compatibility)
- [Known issues](#known-issues)
- [Support](#support)
- [Contributors](#contributors)
Expand Down
29 changes: 13 additions & 16 deletions core/prelude-core.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-core.el --- Emacs Prelude: Core Prelude functions.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -181,16 +181,6 @@ point reaches the beginning or end of the buffer, stop there."
'display '(left-fringe right-triangle))
'modification-hooks '(prelude-todo-ov-evaporate)))

(defun prelude-copy-file-name-to-clipboard ()
"Copy the current buffer file name to the clipboard."
(interactive)
(let ((filename (if (equal major-mode 'dired-mode)
default-directory
(buffer-file-name))))
(when filename
(kill-new filename)
(message "Copied buffer file name '%s' to the clipboard." filename))))

(defun prelude-get-positions-of-line-or-region ()
"Return positions (beg . end) of the current line
or region."
Expand Down Expand Up @@ -367,11 +357,12 @@ Repeated invocations toggle between the two most recently open buffers."
"Kill all buffers but the current one.
Doesn't mess with special buffers."
(interactive)
(-each
(->> (buffer-list)
(-filter #'buffer-file-name)
(--remove (eql (current-buffer) it)))
#'kill-buffer))
(when (y-or-n-p "Are you sure you want to kill all buffers but the current one? ")
(-each
(->> (buffer-list)
(-filter #'buffer-file-name)
(--remove (eql (current-buffer) it)))
#'kill-buffer)))

(defun prelude-create-scratch-buffer ()
"Create a new scratch buffer."
Expand All @@ -383,6 +374,7 @@ Doesn't mess with special buffers."
(defvar prelude-tips
'("Press <C-c o> to open a file with external program."
"Press <C-c p f> to navigate a project's files with ido."
"Press <s-r> to open a recently visited file."
"Press <C-c p s g> to run grep on a project."
"Press <C-c p p> to switch between projects."
"Press <C-=> to expand the selected region."
Expand All @@ -401,6 +393,8 @@ Doesn't mess with special buffers."
"Press <C-c C-z> in a Elisp buffer to launch an interactive Elisp shell."
"Press <C-Backspace> to kill a line backwards."
"Press <C-S-Backspace> or <s-k> to kill the whole line."
"Press <s-j> or <C-^> to join lines."
"Press <s-.> or <C-c j> to jump to the start of a word in any visible window."
"Press <f11> to toggle fullscreen mode."
"Press <f12> to toggle the menu bar."
"Explore the Tools->Prelude menu to find out about some of Prelude extensions to Emacs."
Expand Down Expand Up @@ -487,6 +481,9 @@ With a prefix argument ARG, find the `user-init-file' instead."
(interactive "P")
(sp-wrap-with-pair ,s)))

;; needed for prelude-goto-symbol
(require 'imenu)

(defun prelude-goto-symbol (&optional symbol-list)
"Refresh imenu and jump to a place in the buffer using Ido."
(interactive)
Expand Down
2 changes: 1 addition & 1 deletion core/prelude-custom.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-custom.el --- Emacs Prelude: Prelude's customizable variables.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
4 changes: 3 additions & 1 deletion core/prelude-editor.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-editor.el --- Emacs Prelude: enhanced core editing experience.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -392,6 +392,8 @@ indent yanked text (with prefix arg don't indent)."

;; operate-on-number
(require 'operate-on-number)
(require 'smartrep)

(smartrep-define-key global-map "C-c ."
'(("+" . apply-operation-to-number-at-point)
("-" . apply-operation-to-number-at-point)
Expand Down
8 changes: 4 additions & 4 deletions core/prelude-global-keybindings.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-global-keybindings.el --- Emacs Prelude: some useful keybindings.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -76,9 +76,9 @@

(define-key 'help-command (kbd "C-i") 'info-display-manual)

;; a complement to the zap-to-char command, that doesn't eat up the target character
(autoload 'zap-up-to-char "misc" "Kill up to, but not including ARGth occurrence of CHAR.")
(global-set-key (kbd "M-Z") 'zap-up-to-char)
;; replace zap-to-char functionaity 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)

;; kill lines backward
(global-set-key (kbd "C-<backspace>") (lambda ()
Expand Down
5 changes: 2 additions & 3 deletions core/prelude-mode.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-mode.el --- Emacs Prelude: minor mode
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -87,8 +87,7 @@
("Files"
["Open with..." prelude-open-with]
["Delete file and buffer" prelude-delete-file-and-buffer]
["Rename buffer and file" prelude-rename-buffer-and-file]
["Copy file name to clipboard" prelude-copy-file-name-to-clipboard])
["Rename buffer and file" prelude-rename-buffer-and-file])

("Buffers"
["Clean up buffer or region" prelude-cleanup-buffer-or-region]
Expand Down
2 changes: 1 addition & 1 deletion core/prelude-osx.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-osx.el --- Emacs Prelude: OSX specific settings.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
16 changes: 10 additions & 6 deletions core/prelude-packages.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-packages.el --- Emacs Prelude: default package selection.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -52,7 +52,6 @@
diff-hl
diminish
easy-kill
elisp-slime-nav
epl
expand-region
flycheck
Expand All @@ -68,12 +67,12 @@
magit
move-text
operate-on-number
rainbow-mode
smartparens
smartrep
undo-tree
volatile-highlights
zenburn-theme)
zenburn-theme
zop-to-char)
"A list of packages to ensure are installed at launch.")

(defun prelude-packages-installed-p ()
Expand Down Expand Up @@ -128,6 +127,8 @@ PACKAGE is installed only if not already present. The file is opened in MODE."

(defvar prelude-auto-install-alist
'(("\\.clj\\'" clojure-mode clojure-mode)
("\\.cmake\\'" cmake-mode cmake-mode)
("CMakeLists\\.txt\\'" cmake-mode cmake-mode)
("\\.coffee\\'" coffee-mode coffee-mode)
("\\.css\\'" css-mode css-mode)
("\\.csv\\'" csv-mode csv-mode)
Expand All @@ -152,6 +153,9 @@ PACKAGE is installed only if not already present. The file is opened in MODE."
("\\.pp\\'" puppet-mode puppet-mode)
("\\.php\\'" php-mode php-mode)
("\\.proto\\'" protobuf-mode protobuf-mode)
("\\.pyd\\'" cython-mode cython-mode)
("\\.pyi\\'" cython-mode cython-mode)
("\\.pyx\\'" cython-mode cython-mode)
("PKGBUILD\\'" pkgbuild-mode pkgbuild-mode)
("\\.rs\\'" rust-mode rust-mode)
("\\.sass\\'" sass-mode sass-mode)
Expand All @@ -168,8 +172,8 @@ PACKAGE is installed only if not already present. The file is opened in MODE."
;; markdown-mode doesn't have autoloads for the auto-mode-alist
;; so we add them manually if it's already installed
(when (package-installed-p 'markdown-mode)
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . gfm-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . gfm-mode)))

(when (package-installed-p 'pkgbuild-mode)
(add-to-list 'auto-mode-alist '("PKGBUILD\\'" . pkgbuild-mode)))
Expand Down
7 changes: 1 addition & 6 deletions core/prelude-ui.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-ui.el --- Emacs Prelude: UI optimizations and tweaks.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -57,11 +57,6 @@
(column-number-mode t)
(size-indication-mode t)

;; make the fringe (gutter) smaller
;; the argument is a width in pixels (the default is 8)
(if (fboundp 'fringe-mode)
(fringe-mode 4))

;; enable y/n answers
(fset 'yes-or-no-p 'y-or-n-p)

Expand Down
6 changes: 4 additions & 2 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ by Prelude.")
(message "Loading Prelude's modules...")

;; the modules
(when (file-exists-p prelude-modules-file)
(load prelude-modules-file))
(if (file-exists-p prelude-modules-file)
(load prelude-modules-file)
(message "Missing modules file %s" prelude-modules-file)
(message "You can get started by copying the bundled example file"))

;; config changes made through the customize UI will be store here
(setq custom-file (expand-file-name "custom.el" prelude-personal-dir))
Expand Down
5 changes: 3 additions & 2 deletions modules/prelude-c.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-c.el --- Emacs Prelude: cc-mode configuration.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -35,7 +35,8 @@
(require 'prelude-programming)

(defun prelude-c-mode-common-defaults ()
(setq c-basic-offset 4)
(setq c-default-style "k&r"
c-basic-offset 4)
(c-set-offset 'substatement-open 0))

(setq prelude-c-mode-common-hook 'prelude-c-mode-common-defaults)
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-clojure.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-clojure.el --- Emacs Prelude: Clojure programming configuration.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: http://batsov.com/prelude
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-coffee.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-coffee.el --- Emacs Prelude: CoffeeScript programming support.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-common-lisp.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-common-lisp.el --- Emacs Prelude: lisp-mode and SLIME config.
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-company.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-company.el --- company-mode setup
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-css.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-css.el --- Emacs Prelude: css support
;;
;; Copyright © 2011-2014 Bozhidar Batsov
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: http://www.batsov.com/emacs-prelude
Expand Down
2 changes: 1 addition & 1 deletion modules/prelude-elixir.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-elixir.el --- Emacs Prelude: Elixir programming support.
;;
;; Copyright © 2014 Samuel Tonini
;; Copyright © 2014-2015 Samuel Tonini
;;
;; Author: Samuel Tonini <tonini.samuel@gmail.com>
;; Version: 1.0.0
Expand Down
Loading

0 comments on commit 73992ed

Please sign in to comment.