[Openmcl-devel] indent3, and fonts

Ron Garret ron at flownet.com
Wed Apr 4 09:17:24 PDT 2012

Left out one detail:

> ; Fix the indent command to indent the current selection if there is one

(in-package :hemlock)

> (defcommand "Indent" (p)
>  "Invokes function held by the Hemlock variable \"Indent Function\",
>  moving point past region if called with argument."
>  (if (region-active-p)
>    (let ((region (current-region)))
>      (with-mark ((start (region-start region) :left-inserting)
>                  (end (region-end region) :left-inserting))
>        (indent-region-for-commands (region start end))))
>    (let ((point (current-point)))
>      (with-mark ((mark point :left-inserting))
>        (cond ((or (not p) (zerop p))
>               (funcall (value indent-function) mark)
>               (when (mark< point mark)
>                 (move-mark point mark)))
>              (t
>               (if (plusp p)
>                 (unless (line-offset point (1- p))
>                   (buffer-end point))
>                 (unless (line-offset mark (1+ p))
>                   (buffer-start mark)))
>               (indent-region-for-commands (region mark point))
>               (find-attribute (line-start point) :whitespace #'zerop)))))))

More information about the Openmcl-devel mailing list