From 925ed507b1cd5b2e354d3d2a887d8bcbc0946c31 Mon Sep 17 00:00:00 2001 From: Andrzej Pronobis Date: Thu, 12 Mar 2015 20:26:20 -0700 Subject: [PATCH 01/18] Fixed the problem with ido/untabify defadvice triggering got redefined error --- core/prelude-core.el | 1 + core/prelude-editor.el | 1 + 2 files changed, 2 insertions(+) diff --git a/core/prelude-core.el b/core/prelude-core.el index a9e1167c45..3bee675555 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -285,6 +285,7 @@ there's a region, all lines that region covers will be duplicated." (interactive) (byte-recompile-directory prelude-dir 0)) +(require 'ido) (defun prelude-sudo-edit (&optional arg) "Edit currently visited file as root. diff --git a/core/prelude-editor.el b/core/prelude-editor.el index b116335ae9..3afe162330 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -298,6 +298,7 @@ The body of the advice is in BODY." (interactive (list (not (region-active-p))))) +(require 'tabify) (defmacro with-region-or-buffer (func) "When called with no active region, call FUNC on current buffer." `(defadvice ,func (before with-region-or-buffer activate compile) From c572d7cb8f7eaf3cb3bc3f4103d7fc93091aa2be Mon Sep 17 00:00:00 2001 From: Swaroop C H Date: Sun, 15 Mar 2015 20:04:32 -0700 Subject: [PATCH 02/18] Enable ERC spell mode only if prelude-flyspell --- modules/prelude-erc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/prelude-erc.el b/modules/prelude-erc.el index 4a9c94bf0c..9f51938fb5 100644 --- a/modules/prelude-erc.el +++ b/modules/prelude-erc.el @@ -74,7 +74,8 @@ (erc-truncate-mode +1) ;; enable spell checking -(erc-spelling-mode 1) +(when prelude-flyspell + (erc-spelling-mode 1)) ;; set different dictionaries by different servers/channels ;;(setq erc-spelling-dictionaries '(("#emacs" "american"))) From 3e536efb2d92257ff57cca421e91be3a84e93266 Mon Sep 17 00:00:00 2001 From: Mark Sikora Date: Mon, 16 Mar 2015 17:27:36 -0400 Subject: [PATCH 03/18] Auto install cmake-mode --- core/prelude-packages.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/prelude-packages.el b/core/prelude-packages.el index ced3895ece..6643ae02d0 100644 --- a/core/prelude-packages.el +++ b/core/prelude-packages.el @@ -127,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) From bcde6a59bd08db67968e40aec2e870c9dd1e8d8e Mon Sep 17 00:00:00 2001 From: Swaroop Date: Mon, 9 Mar 2015 00:12:21 -0700 Subject: [PATCH 04/18] Add tip on keyboard shortcut for ace-jump-mode --- core/prelude-core.el | 1 + 1 file changed, 1 insertion(+) diff --git a/core/prelude-core.el b/core/prelude-core.el index a9e1167c45..b9447bf71a 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -394,6 +394,7 @@ Doesn't mess with special buffers." "Press to kill a line backwards." "Press or to kill the whole line." "Press or to join lines." + "Press or to jump to the start of a word in any visible window." "Press to toggle fullscreen mode." "Press to toggle the menu bar." "Explore the Tools->Prelude menu to find out about some of Prelude extensions to Emacs." From 4fe5752a8df853040ba8c4bc3509ec9f0e282f3a Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Sun, 22 Mar 2015 23:05:37 -0600 Subject: [PATCH 05/18] Improve slime repl This enables the slime-fancy contribs for slime, and no longer enables rainbow-delimiters for the slime repl. rainbow-delimiters doesn't seem to work with the slime-repl anyway, and messes up all of the other colors. --- modules/prelude-common-lisp.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/prelude-common-lisp.el b/modules/prelude-common-lisp.el index 718a9e5111..23efd03851 100644 --- a/modules/prelude-common-lisp.el +++ b/modules/prelude-common-lisp.el @@ -60,8 +60,15 @@ ;; default to SBCL on Linux and Windows (setq slime-default-lisp 'sbcl)) +;; Add fancy slime contribs +(setq slime-contribs '(slime-fancy)) + (add-hook 'lisp-mode-hook (lambda () (run-hooks 'prelude-lisp-coding-hook))) -(add-hook 'slime-repl-mode-hook (lambda () (run-hooks 'prelude-interactive-lisp-coding-hook))) +;; rainbow-delimeters messes up colors in slime-repl, and doesn't seem to work +;; anyway, so we won't use prelude-lisp-coding-defaults. +(add-hook 'slime-repl-mode-hook (lambda () + (smartparens-strict-mode +1) + (whitespace-mode -1))) (eval-after-load "slime" '(progn From dbfe0df1d094efb8596833d3420c83e381c7cbf7 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sun, 5 Apr 2015 21:06:47 +0300 Subject: [PATCH 06/18] Use sbcl in the absence of ccl on OS X --- modules/prelude-common-lisp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/prelude-common-lisp.el b/modules/prelude-common-lisp.el index 718a9e5111..9b982e6648 100644 --- a/modules/prelude-common-lisp.el +++ b/modules/prelude-common-lisp.el @@ -54,7 +54,8 @@ (sbcl ("sbcl" "--noinform") :coding-system utf-8-unix))) ;; select the default value from slime-lisp-implementations -(if (eq system-type 'darwin) +(if (and (eq system-type 'darwin) + (executable-find "ccl")) ;; default to Clozure CL on OS X (setq slime-default-lisp 'ccl) ;; default to SBCL on Linux and Windows From 01569fa13f925ae857000d762d559bf165a66df5 Mon Sep 17 00:00:00 2001 From: Wu Jiang Date: Thu, 16 Apr 2015 13:14:34 -0400 Subject: [PATCH 07/18] Enable the mode in a definite way `(anaconda-mode)` is to toggle the mode on/off. --- modules/prelude-python.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prelude-python.el b/modules/prelude-python.el index 8b717019e4..5c283744a2 100644 --- a/modules/prelude-python.el +++ b/modules/prelude-python.el @@ -87,8 +87,8 @@ (defun prelude-python-mode-defaults () "Defaults for Python programming." (subword-mode +1) - (anaconda-mode) - (eldoc-mode) + (anaconda-mode 1) + (eldoc-mode 1) (which-function-mode -1) (setq-local electric-layout-rules '((?: . (lambda () From c8b33df81101a321209a6037ebd6a0a0e502b0a4 Mon Sep 17 00:00:00 2001 From: "M. Tong" Date: Fri, 17 Apr 2015 17:08:21 +0800 Subject: [PATCH 08/18] Don't disabling which-function-mode in Python --- modules/prelude-python.el | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/prelude-python.el b/modules/prelude-python.el index 5c283744a2..7def5fd799 100644 --- a/modules/prelude-python.el +++ b/modules/prelude-python.el @@ -89,7 +89,6 @@ (subword-mode +1) (anaconda-mode 1) (eldoc-mode 1) - (which-function-mode -1) (setq-local electric-layout-rules '((?: . (lambda () (and (zerop (first (syntax-ppss))) From b2947f2164a0ce004e1e4746a829de5ea7408c8c Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 9 May 2015 13:02:43 +0300 Subject: [PATCH 09/18] Replace ace-jump-mode with avy --- README.md | 7 +++---- core/prelude-editor.el | 6 ++++++ core/prelude-global-keybindings.el | 6 ++---- core/prelude-packages.el | 4 +--- modules/prelude-evil.el | 4 ++-- modules/prelude-key-chord.el | 6 +++--- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ce1c144cd4..f7e5b762b7 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,6 @@ Keybinding | Description F12 | Toggle the Emacs menu bar. C-x g | Open Magit's status buffer. M-Z | Zap up to char. -C-c J or Super-> | Switch between buffers with [`ace-jump-buffer`](https://github.com/waymondo/ace-jump-buffer) C-= | Run `expand-region` (incremental text selection). C-a | Run `prelude-move-beginning-of-line`. Read [this](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/) for details. @@ -429,9 +428,9 @@ buffer. Passing prefix argument **BEFORE** =helm-M-x= **has no effect**. Keybinding | Description -------------------|---------------------------------------------- -jj | Jump to the beginning of a word(`ace-jump-word-mode`) -jk | Jump to a character(`ace-jump-char-mode`) -jl | Jump to the beginning of a line(`ace-jump-line-mode`) +jj | Jump to the beginning of a word(`avy-goto-word-1`) +jk | Jump to a character(`avy-goto-char`) +jl | Jump to the beginning of a line(`avy-goto-line`) JJ | Jump back to previous buffer(`prelude-switch-to-previous-buffer`) uu | View edits as a tree(`undo-tree-visualize`) xx | Executed extended command(`execute-extended-command`) diff --git a/core/prelude-editor.el b/core/prelude-editor.el index 3afe162330..138d51e9b0 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -259,6 +259,12 @@ The body of the advice is in BODY." (setq projectile-cache-file (expand-file-name "projectile.cache" prelude-savefile-dir)) (projectile-global-mode t) +;; avy allows us to effectively navigate to visible things +(require 'avy-jump) +(setq avy-background t) +(setq avy-goto-char-style 'at) +(setq avy-goto-word-style 'at) + ;; anzu-mode enhances isearch & query-replace by showing total matches and current match position (require 'anzu) (diminish 'anzu-mode) diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index 5bfa1c3323..cd71c797dd 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -112,10 +112,8 @@ (global-set-key (kbd "C-=") 'er/expand-region) -(global-set-key (kbd "C-c j") 'ace-jump-mode) -(global-set-key (kbd "s-.") 'ace-jump-mode) -(global-set-key (kbd "C-c J") 'ace-jump-buffer) -(global-set-key (kbd "s->") 'ace-jump-buffer) +(global-set-key (kbd "C-c j") 'avy-goto-word-1) +(global-set-key (kbd "s-.") 'avy-goto-word-1) (global-set-key (kbd "s-w") 'ace-window) (provide 'prelude-global-keybindings) diff --git a/core/prelude-packages.el b/core/prelude-packages.el index 6643ae02d0..b43b7b7099 100644 --- a/core/prelude-packages.el +++ b/core/prelude-packages.el @@ -42,9 +42,7 @@ (package-initialize) (defvar prelude-packages - '(ace-jump-mode - ace-jump-buffer - ace-window + '(avy anzu browse-kill-ring dash diff --git a/modules/prelude-evil.el b/modules/prelude-evil.el index e0d705bac6..1998fbce6b 100644 --- a/modules/prelude-evil.el +++ b/modules/prelude-evil.el @@ -122,8 +122,8 @@ (setq evil-shift-width 2) -;;; enable ace-jump mode with evil-mode -(define-key evil-normal-state-map (kbd "SPC") 'ace-jump-mode) +;;; enable avy with evil-mode +(define-key evil-normal-state-map (kbd "SPC") 'avy-goto-word-1) ;;; snagged from Eric S. Fraga ;;; http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00153.html diff --git a/modules/prelude-key-chord.el b/modules/prelude-key-chord.el index d329ee069f..fbaf5b7bf7 100644 --- a/modules/prelude-key-chord.el +++ b/modules/prelude-key-chord.el @@ -35,9 +35,9 @@ (require 'key-chord) -(key-chord-define-global "jj" 'ace-jump-word-mode) -(key-chord-define-global "jl" 'ace-jump-line-mode) -(key-chord-define-global "jk" 'ace-jump-char-mode) +(key-chord-define-global "jj" 'avy-goto-word-1) +(key-chord-define-global "jl" 'avy-goto-line) +(key-chord-define-global "jk" 'avy-goto-char) (key-chord-define-global "JJ" 'prelude-switch-to-previous-buffer) (key-chord-define-global "uu" 'undo-tree-visualize) (key-chord-define-global "xx" 'execute-extended-command) From 7a5e798d033baf331532a945e8db3d0f5db78368 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Mon, 11 May 2015 12:44:30 +0300 Subject: [PATCH 10/18] Track upstream changes in avy --- core/prelude-editor.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/prelude-editor.el b/core/prelude-editor.el index 138d51e9b0..65d84c7e0f 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -260,10 +260,10 @@ The body of the advice is in BODY." (projectile-global-mode t) ;; avy allows us to effectively navigate to visible things -(require 'avy-jump) +(require 'avy) (setq avy-background t) -(setq avy-goto-char-style 'at) -(setq avy-goto-word-style 'at) +(setq avy-style 'at-full) +(setq avy-style 'at-full) ;; anzu-mode enhances isearch & query-replace by showing total matches and current match position (require 'anzu) From 04a663fa45fe37f741bebb2bc9ed04b5c7e1a34b Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 12 May 2015 21:56:43 +0300 Subject: [PATCH 11/18] [Fix #847] Restore ace-window --- core/prelude-packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/prelude-packages.el b/core/prelude-packages.el index b43b7b7099..04eeca52a4 100644 --- a/core/prelude-packages.el +++ b/core/prelude-packages.el @@ -42,7 +42,8 @@ (package-initialize) (defvar prelude-packages - '(avy + '(ace-window + avy anzu browse-kill-ring dash From b4717ca5b30c80c40b0a17b356a5addb46b4d6d3 Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Fri, 15 May 2015 16:53:39 -0500 Subject: [PATCH 12/18] Make it possible to stop prelude loading any theme at all Fixes #844. --- README.md | 7 +++++++ core/prelude-ui.el | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7e5b762b7..99daeca164 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,13 @@ Or you can use another theme altogether by adding something in `personal/preload install it from MELPA first (`M-x package-install RET solarized-theme`). +Finally, if you don't want any theme at all, you can add this to your +`personal/preload`: + +```lisp +(setq prelude-theme nil) +``` + ### Personalizing Fork the official Prelude repo and add your own touch to it. You're advised to avoid changing stuff outside of the diff --git a/core/prelude-ui.el b/core/prelude-ui.el index 3544051a45..bf59f5772d 100644 --- a/core/prelude-ui.el +++ b/core/prelude-ui.el @@ -68,7 +68,8 @@ "%b")))) ;; use zenburn as the default theme -(load-theme prelude-theme t) +(when prelude-theme + (load-theme prelude-theme t)) (provide 'prelude-ui) ;;; prelude-ui.el ends here From 61d45f8e6e6fa63416db1cbf9a9f034d54a15d66 Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Sat, 16 May 2015 11:43:14 -0500 Subject: [PATCH 13/18] Extract a function for reopening a file as root --- core/prelude-core.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 353dbfa658..94e685ad3d 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -285,6 +285,10 @@ there's a region, all lines that region covers will be duplicated." (interactive) (byte-recompile-directory prelude-dir 0)) +(defun prelude-find-alternate-file-as-root (filename) + "Wraps `find-alternate-file' with opening a file as root." + (find-alternate-file (concat "/sudo:root@localhost:" filename))) + (require 'ido) (defun prelude-sudo-edit (&optional arg) "Edit currently visited file as root. @@ -296,7 +300,7 @@ buffer is not visiting a file." (if (or arg (not buffer-file-name)) (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "Find file(as root): "))) - (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) + (prelude-find-alternate-file-as-root buffer-file-name))) (defadvice ido-find-file (after find-file-sudo activate) "Find file as root if necessary." @@ -304,7 +308,7 @@ buffer is not visiting a file." (equal major-mode 'dired-mode) (not (file-exists-p (file-name-directory buffer-file-name))) (file-writable-p buffer-file-name)) - (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) + (prelude-find-alternate-file-as-root buffer-file-name))) (defun prelude-start-or-switch-to (function buffer-name) "Invoke FUNCTION if there is no buffer with BUFFER-NAME. From cd9ea1edee66de2e356b01dae659d26263eddccf Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Sat, 16 May 2015 11:43:47 -0500 Subject: [PATCH 14/18] Change how the "re-open file as root" functionality works Fixes #850 Use find-file-hook instead of advising ido-find-file. --- core/prelude-core.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 94e685ad3d..5243eb825c 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -302,13 +302,14 @@ buffer is not visiting a file." (ido-read-file-name "Find file(as root): "))) (prelude-find-alternate-file-as-root buffer-file-name))) -(defadvice ido-find-file (after find-file-sudo activate) +(defun prelude-reopen-as-root () "Find file as root if necessary." (unless (or (tramp-tramp-file-p buffer-file-name) (equal major-mode 'dired-mode) (not (file-exists-p (file-name-directory buffer-file-name))) (file-writable-p buffer-file-name)) (prelude-find-alternate-file-as-root buffer-file-name))) +(add-hook 'find-file-hook 'prelude-reopen-as-root) (defun prelude-start-or-switch-to (function buffer-name) "Invoke FUNCTION if there is no buffer with BUFFER-NAME. From 67cf26cbbd998ad9ebc85e7fe47c875f7d226f38 Mon Sep 17 00:00:00 2001 From: Geoff Shannon Date: Sat, 16 May 2015 12:39:31 -0500 Subject: [PATCH 15/18] Don't open a file as root if it is owned by the current user Fixes #839. The reasoning behind this is that if we own a file, we can change it's permissions with `chmod` so there's probably a good reason it's not writable. --- core/prelude-core.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 5243eb825c..30db174c23 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -285,6 +285,17 @@ there's a region, all lines that region covers will be duplicated." (interactive) (byte-recompile-directory prelude-dir 0)) +(defun prelude-file-owner-uid (filename) + "Return the UID of the FILENAME as an integer. + +See `file-attributes' for more info." + (nth 2 (file-attributes filename 'integer))) + +(defun prelude-file-owned-by-user-p (filename) + "Return t if file FILENAME is owned by the currently logged in user." + (equal (prelude-file-owner-uid filename) + (user-uid))) + (defun prelude-find-alternate-file-as-root (filename) "Wraps `find-alternate-file' with opening a file as root." (find-alternate-file (concat "/sudo:root@localhost:" filename))) @@ -307,7 +318,8 @@ buffer is not visiting a file." (unless (or (tramp-tramp-file-p buffer-file-name) (equal major-mode 'dired-mode) (not (file-exists-p (file-name-directory buffer-file-name))) - (file-writable-p buffer-file-name)) + (file-writable-p buffer-file-name) + (prelude-file-owned-by-user-p buffer-file-name)) (prelude-find-alternate-file-as-root buffer-file-name))) (add-hook 'find-file-hook 'prelude-reopen-as-root) From 25ad11c759cab3e173dd05ad041109d57e69a4ab Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 22 May 2015 08:51:32 +0300 Subject: [PATCH 16/18] Use jump to word or subword by default --- core/prelude-global-keybindings.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index cd71c797dd..683a0a2cdb 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -112,8 +112,8 @@ (global-set-key (kbd "C-=") 'er/expand-region) -(global-set-key (kbd "C-c j") 'avy-goto-word-1) -(global-set-key (kbd "s-.") 'avy-goto-word-1) +(global-set-key (kbd "C-c j") 'avy-goto-word-or-subword-1) +(global-set-key (kbd "s-.") 'avy-goto-word-or-subword-1) (global-set-key (kbd "s-w") 'ace-window) (provide 'prelude-global-keybindings) From 2b6615381deef8ab91a34d30b590bad474b46576 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 22 May 2015 08:51:47 +0300 Subject: [PATCH 17/18] [Fix #827] Make it possible to disable the tips --- core/prelude-core.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 353dbfa658..42e12e9ac5 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -405,7 +405,7 @@ Doesn't mess with special buffers." (defun prelude-tip-of-the-day () "Display a random entry from `prelude-tips'." (interactive) - (unless (window-minibuffer-p) + (when (and prelude-tips (not (window-minibuffer-p))) ;; pick a new random seed (random t) (message From c06c78f964e93fe665da0d827c63247ff1d950dc Mon Sep 17 00:00:00 2001 From: Douglas Calvert Date: Thu, 4 Jun 2015 12:42:29 -0400 Subject: [PATCH 18/18] use https when piping to sh for install --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99daeca164..7707c01ef4 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ can skip the whole manual and just type in your favorite shell the following command: ```bash -curl -L http://git.io/epre | sh +curl -L https://git.io/epre | sh ``` You can now power up your Emacs, sit back and enjoy Prelude,