summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-06-01 00:25:08 +0200
committerGravatar Tom Willemse2014-06-01 00:25:08 +0200
commit3225f300bff2e7f91db97ef4ed52247a6944104f (patch)
tree03cc09d54feb756130699037b3d17d47b9249b97
parent40692c57456cba773b0f8b4825f0f079f1388037 (diff)
downloademacs-3225f300bff2e7f91db97ef4ed52247a6944104f.tar.gz
emacs-3225f300bff2e7f91db97ef4ed52247a6944104f.zip
Move indent-shift code to separate package
-rw-r--r--.emacs.d/init.el47
1 files changed, 2 insertions, 45 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index f48f490..d246ced 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -256,47 +256,6 @@ MODE1 is enabled and vice-versa."
(mark-defun)
(indent-region (region-beginning) (region-end))))
-(defun oni:indent-shift-left (start end &optional count)
- "Rigidly indent region.
-Region is from START to END. Move
-COUNT number of spaces if it is non-nil otherwise use
-`tab-width'."
- (interactive
- (if mark-active
- (list (region-beginning) (region-end) current-prefix-arg)
- (list (line-beginning-position)
- (line-end-position)
- current-prefix-arg)))
- (if count
- (setq count (prefix-numeric-value count))
- (setq count tab-width))
- (when (> count 0)
- (let ((deactivate-mark nil))
- (save-excursion
- (goto-char start)
- (while (< (point) end)
- (if (and (< (current-indentation) count)
- (not (looking-at "[ \t]*$")))
- (error "Can't shift all lines enough"))
- (forward-line))
- (indent-rigidly start end (- count))))))
-
-(defun oni:indent-shift-right (start end &optional count)
- "Indent region between START and END rigidly to the right.
-If COUNT has been specified indent by that much, otherwise look at
-`tab-width'."
- (interactive
- (if mark-active
- (list (region-beginning) (region-end) current-prefix-arg)
- (list (line-beginning-position)
- (line-end-position)
- current-prefix-arg)))
- (let ((deactivate-mark nil))
- (if count
- (setq count (prefix-numeric-value count))
- (setq count tab-width))
- (indent-rigidly start end count)))
-
(defun oni:eshell-C-d ()
"Either call `delete-char' interactively or quit."
(interactive)
@@ -910,8 +869,6 @@ from myaethon2.core.decorators import (
;;;; Unconditional settings
-(add-to-list 'debug-ignored-errors "^Can't shift all lines enough")
-
(eval '(setq inhibit-startup-echo-area-message "slash"))
;;;; Module-specific settings
@@ -1336,8 +1293,8 @@ from myaethon2.core.decorators import (
(global-set-key (kbd "<next>") 'oni:scroll-up-or-next-page)
(global-set-key (kbd "<prior>") 'oni:scroll-down-or-prev-page)
(global-set-key (kbd "C-. C-.") #'oni:switch-to-other-buffer)
-(global-set-key (kbd "C-<") 'oni:indent-shift-left)
-(global-set-key (kbd "C->") 'oni:indent-shift-right)
+(global-set-key (kbd "C-<") 'indent-shift-left)
+(global-set-key (kbd "C->") 'indent-shift-right)
(global-set-key (kbd "C-M-4") 'split-window-vertically)
(global-set-key (kbd "C-M-SPC") 'er/expand-region)
(global-set-key (kbd "C-M-d") 'kill-word)