help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use tab key to indent both region AND line?


From: mopi
Subject: Re: Use tab key to indent both region AND line?
Date: 20 Apr 2007 12:07:55 -0700
User-agent: G2/1.0

Wohoo!

I found this little thing in easymacs.el that does exactly what I
want.


(defun easymacs-rigidly-indent-line-or-region ()
  (interactive)
  (if mark-active
(increase-left-margin (region-beginning) (region-end) nil)
    (increase-left-margin (point-at-bol) (point-at-eol) nil))
  (setq deactivate-mark nil))

(defun easymacs-rigidly-unindent-line-or-region ()
  (interactive)
  (if mark-active
(decrease-left-margin (region-beginning) (region-end) nil)
    (decrease-left-margin (point-at-bol) (point-at-eol) nil))
  (setq deactivate-mark nil))

(global-set-key [tab]       'easymacs-rigidly-indent-line-or-region)
(global-set-key [S-tab]       'easymacs-rigidly-unindent-line-or-
region)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]