From 3225f300bff2e7f91db97ef4ed52247a6944104f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 1 Jun 2014 00:25:08 +0200 Subject: Move indent-shift code to separate package --- .emacs.d/init.el | 47 ++--------------------------------------------- 1 file 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 "") 'oni:scroll-up-or-next-page) (global-set-key (kbd "") '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) -- cgit v1.2.3-54-g00ecf