;;; GNU Emacs code converted from Mocklisp (require 'mlsupport) ;Indent region fcn at last. (ml-defun (indent-region p d indent-delta cur-indent (ml-if prefix-argument-provided (setq indent-delta ml-prefix-arg) (setq indent-delta (ml-arg 1 "Amount of indent: ")) ) (setq d (point-marker)) ;Standard my-save-window-excursion (beginning-of-window) ; stuff. Someday a fcn. (setq p (point-marker)) (goto-char d) ;Make sure to restore entering region. (narrow-region) ;Focus in on region and (beginning-of-buffer) ; have at it. (while (not (zerop (ml-not (eobp)))) ;For each line: (beginning-of-line) ;Nasty if at end of loop. (move-over-white-space) ;Move over current indent (setq cur-indent (ml-current-column)) ; and mark col. (delete-horizontal-space) ;Delete all current indent. (to-col (+ cur-indent indent-delta)) ;Add in new + old. ;This strategy maintains max number of tabs for white space. (ml-next-line) ) (widen) (goto-char p) (line-to-top-of-window) (goto-char d) ) )