From 29929e3386b1ae86a12b7d4284161923e7492dc9 Mon Sep 17 00:00:00 2001 From: Tobias Adam Date: Wed, 13 Aug 2014 16:38:21 +0200 Subject: [PATCH 01/10] Delete documentation for C-M-h keybinding It was removed in commit 3ac3415a2c5bdd7a4cba8bac914577bcde388627. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8388019..59a0a65 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,6 @@ extensions to keybindings. Keybinding | Description -------------------|------------------------------------------------------------ -C-M-h | Kill the previous word(`backward-kill-word`). (as in Bash/Zsh) C-x \\ | `align-regexp` C-+ | Increase font size(`text-scale-increase`). C-- | Decrease font size(`text-scale-decrease`). From 56e46a62a9177fd6897c1e5bdd584201a67a85ab Mon Sep 17 00:00:00 2001 From: Tobias Adam Date: Wed, 13 Aug 2014 16:57:39 +0200 Subject: [PATCH 02/10] Fix Markdown escaping of backslash character. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59a0a65..91f9d9f 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ Keybinding | Description C-c . - | Decrement integer at point. Default is -1. C-c . * | Multiply integer at point. Default is *2. C-c . / | Divide integer at point. Default is /2. -C-c . \ | Modulo integer at point. Default is modulo 2. +C-c . \\ | Modulo integer at point. Default is modulo 2. C-c . ^ | Power to the integer at point. Default is ^2. C-c . < | Left-shift integer at point. Default is 1 position to the left. C-c . > | Right-shift integer at point. Default is 1 position to the right. From 0a140202cb7998c5cfa534bda8a37b53df634f83 Mon Sep 17 00:00:00 2001 From: Tobias Adam Date: Thu, 14 Aug 2014 12:43:58 +0200 Subject: [PATCH 03/10] Remove the documentation for the keybinding It was removed in commit 0e1632868e0377caf50db5d7e2361b7477533a9b and it is now the standard kill-region command. --- README.md | 1 - core/prelude-core.el | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 91f9d9f..a0593f0 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,6 @@ Keybinding | Description C-c . % | Replace integer at point with another specified integer. C-c . ' | Perform arithmetic operations on integer at point. User specifies the operator. Super-r | Recent files -Super-x | Expand region Super-j | Join lines Super-k | Kill whole line Super-m m | Magit status diff --git a/core/prelude-core.el b/core/prelude-core.el index 265803f..c9705a2 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -382,7 +382,7 @@ Doesn't mess with special buffers." "Press or to navigate a project's files with ido." "Press or to run grep on a project." "Press or to switch between projects." - "Press or to expand the selected region." + "Press to expand the selected region." "Press to search in Google." "Press to search in GitHub." "Press to search in YouTube." From 6ab7ed461cb45dba2f0a6adf22d08591d002a410 Mon Sep 17 00:00:00 2001 From: Tobias Adam Date: Thu, 14 Aug 2014 12:47:15 +0200 Subject: [PATCH 04/10] Remove the documentation for the keybinding It was removed in commit d49a8e9a16e2b3dacd55b4de3e526405cec6e13d and it is now bound to the god-local-mode command. --- README.md | 1 + core/prelude-core.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0593f0..a5a1db2 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,7 @@ Keybinding | Description C-c . # | Convert integer at point to specified base. Default is 10. C-c . % | Replace integer at point with another specified integer. C-c . ' | Perform arithmetic operations on integer at point. User specifies the operator. +Super-g | Toggle between God mode and non-God mode Super-r | Recent files Super-j | Join lines Super-k | Kill whole line diff --git a/core/prelude-core.el b/core/prelude-core.el index c9705a2..910e61b 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -380,7 +380,7 @@ Doesn't mess with special buffers." (defvar prelude-tips '("Press to open a file with external program." "Press or to navigate a project's files with ido." - "Press or to run grep on a project." + "Press to run grep on a project." "Press or to switch between projects." "Press to expand the selected region." "Press to search in Google." From 7bcfcf6b21b7934e4542bb6032a9f803d0edde6f Mon Sep 17 00:00:00 2001 From: Tobias Adam Date: Thu, 14 Aug 2014 14:19:48 +0200 Subject: [PATCH 05/10] Remove two keybinding tips concerning Super - was removed in commit d49a8e9a16e2b3dacd55b4de3e526405cec6e13d. - was removed in commit 0e1632868e0377caf50db5d7e2361b7477533a9b. --- core/prelude-core.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 910e61b..dfb87ff 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -379,7 +379,7 @@ Doesn't mess with special buffers." (defvar prelude-tips '("Press to open a file with external program." - "Press or to navigate a project's files with ido." + "Press to navigate a project's files with ido." "Press to run grep on a project." "Press or to switch between projects." "Press to expand the selected region." @@ -390,7 +390,7 @@ Doesn't mess with special buffers." "Press to rename the current buffer and the file it's visiting if any." "Press to open a terminal in Emacs." "Press to kill all the buffers, but the active one." - "Press or to run magit-status." + "Press to run magit-status." "Press to delete the current file and buffer." "Press to swap two windows." "Press or to open a line beneath the current one." From 6283c1afd79011e5f601f1f754c3898ca8b0f888 Mon Sep 17 00:00:00 2001 From: toctan Date: Wed, 20 Aug 2014 16:07:55 +0800 Subject: [PATCH 06/10] Turn on electric indent mode with python mode --- modules/prelude-python.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/prelude-python.el b/modules/prelude-python.el index d3e727d..65eb463 100644 --- a/modules/prelude-python.el +++ b/modules/prelude-python.el @@ -37,8 +37,7 @@ (defun prelude-python-mode-defaults () "Defaults for Python programming." - (subword-mode +1) - (electric-indent-mode -1)) + (subword-mode +1)) (setq prelude-python-mode-hook 'prelude-python-mode-defaults) From 41e153058cc7aa106c71c3cb25ffdab8c0b03a41 Mon Sep 17 00:00:00 2001 From: toctan Date: Wed, 20 Aug 2014 16:12:29 +0800 Subject: [PATCH 07/10] Automatically newline with block start --- modules/prelude-python.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/prelude-python.el b/modules/prelude-python.el index 65eb463..604ef87 100644 --- a/modules/prelude-python.el +++ b/modules/prelude-python.el @@ -37,7 +37,12 @@ (defun prelude-python-mode-defaults () "Defaults for Python programming." - (subword-mode +1)) + (subword-mode +1) + (setq-local electric-layout-rules + '((?: . (lambda () + (if (python-info-statement-starts-block-p) + 'after))))) + (electric-layout-mode +1)) (setq prelude-python-mode-hook 'prelude-python-mode-defaults) From 17cf2c710aaa3dda657f01ce8e77e2043725372e Mon Sep 17 00:00:00 2001 From: toctan Date: Wed, 20 Aug 2014 16:14:05 +0800 Subject: [PATCH 08/10] Insert magic encoding comment upon save --- modules/prelude-python.el | 42 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/modules/prelude-python.el b/modules/prelude-python.el index 604ef87..1f7a44e 100644 --- a/modules/prelude-python.el +++ b/modules/prelude-python.el @@ -35,6 +35,45 @@ (require 'prelude-programming) +;; Copy pasted from ruby-mode.el +(defun prelude-python--encoding-comment-required-p () + (re-search-forward "[^\0-\177]" nil t)) + +(defun prelude-python--detect-encoding () + (let ((coding-system + (or save-buffer-coding-system + buffer-file-coding-system))) + (if coding-system + (symbol-name + (or (coding-system-get coding-system 'mime-charset) + (coding-system-change-eol-conversion coding-system nil))) + "ascii-8bit"))) + +(defun prelude-python--insert-coding-comment (encoding) + (let ((newlines (if (looking-at "^\\s *$") "\n" "\n\n"))) + (insert (format "# coding: %s" encoding) newlines))) + +(defun prelude-python-mode-set-encoding () + "Insert a magic comment header with the proper encoding if necessary." + (save-excursion + (widen) + (goto-char (point-min)) + (when (prelude-python--encoding-comment-required-p) + (goto-char (point-min)) + (let ((coding-system (prelude-python--detect-encoding))) + (when coding-system + (if (looking-at "^#!") (beginning-of-line 2)) + (cond ((looking-at "\\s *#\\s *.*\\(en\\)?coding\\s *:\\s *\\([-a-z0-9_]*\\)") + ;; update existing encoding comment if necessary + (unless (string= (match-string 2) coding-system) + (goto-char (match-beginning 2)) + (delete-region (point) (match-end 2)) + (insert coding-system))) + ((looking-at "\\s *#.*coding\\s *[:=]")) + (t (prelude-python--insert-coding-comment coding-system))) + (when (buffer-modified-p) + (basic-save-buffer-1))))))) + (defun prelude-python-mode-defaults () "Defaults for Python programming." (subword-mode +1) @@ -42,7 +81,8 @@ '((?: . (lambda () (if (python-info-statement-starts-block-p) 'after))))) - (electric-layout-mode +1)) + (electric-layout-mode +1) + (add-hook 'after-save-hook 'prelude-python-mode-set-encoding nil 'local)) (setq prelude-python-mode-hook 'prelude-python-mode-defaults) From 6f05616b6022e1029594b8bf107dd5bcbff93db7 Mon Sep 17 00:00:00 2001 From: Aleksei Gusev Date: Sat, 23 Aug 2014 18:59:50 +0300 Subject: [PATCH 09/10] Update documentation and tips for projectile keys --- README.md | 7 +++++-- core/prelude-core.el | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a5a1db2..39bb565 100644 --- a/README.md +++ b/README.md @@ -343,7 +343,8 @@ Keybinding | Description C-c p f | Display a list of all files in the project. With a prefix argument it will clear the cache first. C-c p d | Display a list of all directories in the project. With a prefix argument it will clear the cache first. C-c p T | Display a list of all test files(specs, features, etc) in the project. -C-c p g | Run grep on the files in the project. +C-c p s g | Run grep on the files in the project. +M-- C-c p s g | Run grep on `projectile-grep-default-files` in the project. C-c p b | Display a list of all project buffers currently open. C-c p o | Runs `multi-occur` on all project buffers currently open. C-c p r | Runs interactive query-replace on all files in the projects. @@ -352,11 +353,13 @@ Keybinding | Description C-c p k | Kills all project buffers. C-c p D | Opens the root of the project in `dired`. C-c p e | Shows a list of recently visited project files. +C-c p s a | Runs `ack` on the project. Requires the presence of `ack-and-a-half`. +C-c p s s | Runs `ag` on the project. Requires the presence of `ag.el`. C-c p a | Runs `ack` on the project. Requires the presence of `ack-and-a-half`. C-c p c | Runs a standard compilation command for your type of project. C-c p p | Runs a standard test command for your type of project. C-c p z | Adds the currently visited to the cache. -C-c p s | Display a list of known projects you can switch to. +C-c p p | 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`. diff --git a/core/prelude-core.el b/core/prelude-core.el index dfb87ff..5830d1d 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -380,8 +380,8 @@ Doesn't mess with special buffers." (defvar prelude-tips '("Press to open a file with external program." "Press to navigate a project's files with ido." - "Press to run grep on a project." - "Press or to switch between projects." + "Press to run grep on a project." + "Press to switch between projects." "Press to expand the selected region." "Press to search in Google." "Press to search in GitHub." From e0df69013f84bb42ba33647240e7ded69d97fee6 Mon Sep 17 00:00:00 2001 From: Keyvan Hedayati Date: Mon, 25 Aug 2014 14:57:20 +0430 Subject: [PATCH 10/10] Added M-X to README [Close #621] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 39bb565..ba875e2 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,7 @@ Keybinding | Description C-x m | Start `eshell`. C-x M-m | Start your default shell. C-x C-m | Alias for `M-x`. +M-X | Like `M-x` but limited to commands that are relevant to the active major mode. C-h A | Run `apropos` (search in all Emacs symbols). C-h C-m | Display key bindings of current major mode and descriptions of every binding. M-/ | Run `hippie-expand` (a replacement for the default `dabbrev-expand`).