Skip to content

Commit

Permalink
Merge remote-tracking branch 'bbatsov/master'
Browse files Browse the repository at this point in the history
* bbatsov/master:
  [Fix bbatsov#1170] Remove the vkill package
  Remove the mediawiki module
  Clarify some wording
  Replace dash with the built-in cl-lib
  Replace some custom TODO & friends highlighting with the hl-todo package
  [Fix bbatsov#1151] Bind counsel-ag to "C-c a"
  Tweak some OS references
  Simplify the Projectile README section
  Add a helpful comment
  Improve the code style
  Rename prelude-osx.el to prelude-macos.el
  [Fix bbatsov#1147] Add an extra keybinding for ace-window that's Windows friendly
  Update the copyright years
  Add graphql-mode auto installation
  • Loading branch information
Caleb Epstein committed May 24, 2018
2 parents a8979bb + 493836e commit 26ca4cb
Show file tree
Hide file tree
Showing 47 changed files with 90 additions and 181 deletions.
44 changes: 13 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ By default most of the modules that ship with Prelude are not loaded. For more i
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-mediawiki)
(require 'prelude-org)
(require 'prelude-perl)
;; (require 'prelude-python)
Expand Down Expand Up @@ -376,38 +375,21 @@ instead. That's an epic productivity boost and it's not as crazy as it sounds!

#### Projectile

Here's a list of functionality provided by [Projectile](https://github.com/bbatsov/projectile):
[Projectile](https://github.com/bbatsov/projectile) is one of the essential packages bundled with Prelude.
It provides an easy way to navigate and switch projects. Take a look at its extensive documentation
to get a feel for everything you can do with Projectile.

Keybinding | Description
-------------------|------------------------------------------------------------
<kbd>C-c p f</kbd> | Display a list of all files in the project. With a prefix argument it will clear the cache first.
<kbd>C-c p d</kbd> | Display a list of all directories in the project. With a prefix argument it will clear the cache first.
<kbd>C-c p T</kbd> | Display a list of all test files(specs, features, etc) in the project.
<kbd>C-c p s g</kbd> | Run grep on the files in the project.
<kbd>C-c p s s</kbd> | Runs `ag` on the project. Requires the presence of `ag.el`.
<kbd>M-- C-c p s g</kbd> | Run grep on `projectile-grep-default-files` in the project.
<kbd>C-c p b</kbd> | Display a list of all project buffers currently open.
<kbd>C-c p o</kbd> | Runs `multi-occur` on all project buffers currently open.
<kbd>C-c p r</kbd> | Runs interactive query-replace on all files in the projects.
<kbd>C-c p i</kbd> | Invalidates the project cache (if existing).
<kbd>C-c p R</kbd> | Regenerates the projects `TAGS` file.
<kbd>C-c p k</kbd> | Kills all project buffers.
<kbd>C-c p D</kbd> | Opens the root of the project in `dired`.
<kbd>C-c p e</kbd> | Shows a list of recently visited project files.
<kbd>C-c p a</kbd> | Switch between files with the same name but different extensions.
<kbd>C-c p c</kbd> | Runs a standard compilation command for your type of project.
<kbd>C-c p P</kbd> | Runs a standard test command for your type of project.
<kbd>C-c p z</kbd> | Adds the currently visited to the cache.
<kbd>C-c p p</kbd> | Display a list of known projects you can switch to.

Prelude adds an extra keymap prefix `S-p` (`S` stands for
`Super`), so you can use `S-p` instead of `C-c p`. By default on Windows keyboard
Prelude adds an extra keymap prefix `s-p` (`s` stands for
`Super`) in addition to the standard one `C-c p`. By default on Windows keyboard
`Super` is mapped to the `Windows` key and on macOS keyboards `Super` is mapped
to the `Command` key.

If you ever forget any of Projectile's keybindings just do a:

<kbd>C-c p C-h</kbd>
<kbd>C-c p C-h</kbd> or <kbd>s-p C-h</kbd>

Alternatively you can just press <kbd>s-p</kbd> and wait for a moment
for `which-key` to kick in and show you the available keybindings.

#### Helm

Expand Down Expand Up @@ -638,7 +620,7 @@ will automatically update the installed packages.
Prelude makes heavy use of the flyspell-mode package for spell
checking of various things. The proper operation of flyspell depends
on the presence of the `aspell` program and an `en` dictionary on your
system. You can install `aspell` and the dictionary on OS X with
system. You can install `aspell` and the dictionary on macOS with
`homebrew` like this:

```bash
Expand Down Expand Up @@ -697,8 +679,8 @@ you don't like that simply add this to your personal config:

### Poor ido matching performance on large datasets

Prelude swaps the default `ido` flex matching with the more powerful
[ido-flx](https://github.com/lewang/flx).
Prelude's `ido` module swaps the default `ido` flex matching with the
more powerful [ido-flx](https://github.com/lewang/flx).

The sorting algorithm `flx` uses is more complex, but yields better results.

Expand All @@ -718,7 +700,7 @@ You can always disable the improved sorting algorithm all together like this:
### Windows compatibility

While everything in Prelude should work fine in Windows, I test it only
with Linux & OS X, so there are Windows related problems from time to
with GNU/Linux & macOS, so there might be Windows-specific problems from time to
time. This situation will probably improve over time.

## Known issues
Expand Down
27 changes: 6 additions & 21 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -33,8 +33,7 @@
;;; Code:

(require 'thingatpt)
(require 'dash)
(require 'ov)
(require 'cl-lib)

(defun prelude-buffer-mode (buffer-or-name)
"Retrieve the `major-mode' of BUFFER-OR-NAME."
Expand Down Expand Up @@ -63,19 +62,6 @@ PROMPT sets the `read-string prompt."
(prelude-install-search-engine "github" "https://github.com/search?q=" "Search GitHub: ")
(prelude-install-search-engine "duckduckgo" "https://duckduckgo.com/?t=lm&q=" "Search DuckDuckGo: ")

(defun prelude-todo-ov-evaporate (_ov _after _beg _end &optional _length)
(let ((inhibit-modification-hooks t))
(if _after (ov-reset _ov))))

(defun prelude-annotate-todo ()
"Put fringe marker on TODO: lines in the current buffer."
(interactive)
(ov-set (format "[[:space:]]*%s+[[:space:]]*TODO:" comment-start)
'before-string
(propertize (format "A")
'display '(left-fringe right-triangle))
'modification-hooks '(prelude-todo-ov-evaporate)))

(defun prelude-recompile-init ()
"Byte-compile all your dotfiles again."
(interactive)
Expand Down Expand Up @@ -108,8 +94,7 @@ PROMPT sets the `read-string prompt."
"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."
"Access the official Emacs manual by pressing <C-h r>."
"Visit the EmacsWiki at http://emacswiki.org to find out even more about Emacs."))
"Access the official Emacs manual by pressing <C-h r>."))

(defun prelude-tip-of-the-day ()
"Display a random entry from `prelude-tips'."
Expand Down Expand Up @@ -152,11 +137,11 @@ With a prefix ARG updates all installed packages."
(when (y-or-n-p "Do you want to update Prelude's packages? ")
(if arg
(epl-upgrade)
(epl-upgrade (-filter (lambda (p) (memq (epl-package-name p) prelude-packages))
(epl-installed-packages))))
(epl-upgrade (cl-remove-if-not (lambda (p) (memq (epl-package-name p) prelude-packages))
(epl-installed-packages))))
(message "Update finished. Restart Emacs to complete the process.")))

;;; Emacs in OSX already has fullscreen support
;;; Emacs in macOS already has fullscreen support
;;; Emacs has a similar built-in command in 24.4
(defun prelude-fullscreen ()
"Make Emacs window fullscreen.
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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
8 changes: 4 additions & 4 deletions 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -138,9 +138,9 @@
(defun prelude-recentf-exclude-p (file)
"A predicate to decide whether to exclude FILE from recentf."
(let ((file-dir (file-truename (file-name-directory file))))
(-any-p (lambda (dir)
(string-prefix-p dir file-dir))
(mapcar 'file-truename (list prelude-savefile-dir package-user-dir)))))
(cl-some (lambda (dir)
(string-prefix-p dir file-dir))
(mapcar 'file-truename (list prelude-savefile-dir package-user-dir)))))

(add-to-list 'recentf-exclude 'prelude-recentf-exclude-p)

Expand Down
5 changes: 4 additions & 1 deletion 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -109,7 +109,10 @@

(global-set-key (kbd "C-c j") 'avy-goto-word-or-subword-1)
(global-set-key (kbd "s-.") 'avy-goto-word-or-subword-1)

;; improved window navigation with ace-window
(global-set-key (kbd "s-w") 'ace-window)
(global-set-key [remap other-window] 'ace-window)

(provide 'prelude-global-keybindings)

Expand Down
30 changes: 13 additions & 17 deletions core/prelude-osx.el → core/prelude-macos.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; prelude-osx.el --- Emacs Prelude: OSX specific settings.
;;; prelude-macos.el --- Emacs Prelude: macOS specific settings.
;;
;; Copyright © 2011-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand All @@ -11,7 +11,7 @@

;;; Commentary:

;; Some OSX specific stuff.
;; Some macOS specific stuff.

;;; License:

Expand All @@ -32,20 +32,16 @@

;;; Code:

;; On OS X Emacs doesn't use the shell PATH if it's not started from
;; On macOS Emacs doesn't use the shell PATH if it's not started from
;; the shell. Let's fix that:
(prelude-require-packages '(exec-path-from-shell vkill))
(prelude-require-packages '(exec-path-from-shell))

(require 'exec-path-from-shell)
(exec-path-from-shell-initialize)

;; It's all in the Meta
(setq ns-function-modifier 'hyper)

;; proced-mode doesn't work on OS X so we use vkill instead
(autoload 'vkill "vkill" nil t)
(global-set-key (kbd "C-x p") 'vkill)

(defun prelude-swap-meta-and-super ()
"Swap the mapping of Meta and Super.
Very useful for people using their Mac with a
Expand All @@ -56,20 +52,20 @@ Windows external keyboard from time to time."
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
(message "Command is now bound to META and Option is bound to SUPER."))
(progn
(setq mac-command-modifier 'super)
(setq mac-option-modifier 'meta)
(message "Command is now bound to SUPER and Option is bound to META."))))
(setq mac-command-modifier 'super)
(setq mac-option-modifier 'meta)
(message "Command is now bound to SUPER and Option is bound to META.")))

(define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super)
(define-key prelude-mode-map (kbd "s-/") 'hippie-expand)

;; There's no point in hiding the menu bar on macOS, so let's not do it
(menu-bar-mode +1)

;; Enable emoji, and stop the UI from freezing when trying to display them.
(if (fboundp 'set-fontset-font)
(set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend))
(when (fboundp 'set-fontset-font)
(set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend))


(provide 'prelude-osx)
;;; prelude-osx.el ends here
(provide 'prelude-macos)
;;; prelude-macos.el ends here
2 changes: 1 addition & 1 deletion 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
6 changes: 3 additions & 3 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -59,7 +59,6 @@
beacon
browse-kill-ring
crux
dash
discover-my-major
diff-hl
diminish
Expand All @@ -75,8 +74,8 @@
god-mode
grizzl
guru-mode
hl-todo
imenu-anywhere
ov
projectile
magit
move-text
Expand Down Expand Up @@ -158,6 +157,7 @@ PACKAGE is installed only if not already present. The file is opened in MODE."
("\\.erl\\'" erlang erlang-mode)
("\\.feature\\'" feature-mode feature-mode)
("\\.go\\'" go-mode go-mode)
("\\.graphql\\'" graphql-mode graphql-mode)
("\\.groovy\\'" groovy-mode groovy-mode)
("\\.haml\\'" haml-mode haml-mode)
("\\.hs\\'" haskell-mode haskell-mode)
Expand Down
2 changes: 1 addition & 1 deletion 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
6 changes: 3 additions & 3 deletions init.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; init.el --- Prelude's configuration entry point.
;;
;; Copyright (c) 2011-2017 Bozhidar Batsov
;; Copyright (c) 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: http://batsov.com/prelude
Expand Down Expand Up @@ -113,9 +113,9 @@ by Prelude.")
(require 'prelude-editor)
(require 'prelude-global-keybindings)

;; OSX specific settings
;; macOS specific settings
(when (eq system-type 'darwin)
(require 'prelude-osx))
(require 'prelude-macos))

(message "Loading Prelude's modules...")

Expand Down
1 change: 0 additions & 1 deletion modules/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ following links.
- Latex
- Lisp
- Markdown
- MediaWiki
- Org
- Perl
- [Python](prelude-python.md)
Expand Down
2 changes: 1 addition & 1 deletion 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
4 changes: 2 additions & 2 deletions 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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down Expand Up @@ -56,7 +56,7 @@
;; select the default value from slime-lisp-implementations
(if (and (eq system-type 'darwin)
(executable-find "ccl"))
;; default to Clozure CL on OS X
;; default to Clozure CL on macOS
(setq slime-default-lisp 'ccl)
;; default to SBCL on Linux and Windows
(setq slime-default-lisp 'sbcl))
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-2017 Bozhidar Batsov
;; Copyright © 2011-2018 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
Expand Down
Loading

0 comments on commit 26ca4cb

Please sign in to comment.