Skip to content

Instantly share code, notes, and snippets.

@jorgenschaefer
Created February 16, 2014 10:55
Show Gist options
  • Save jorgenschaefer/9032466 to your computer and use it in GitHub Desktop.
Save jorgenschaefer/9032466 to your computer and use it in GitHub Desktop.
(defun foo ()
(interactive) ; To make it a command that can be bound to a key
(string-rectangle ; Call this function
(region-beginning) ; First arg: START
(region-end) ; Second arg: END
"ZZZ")) ; Third arg: STRING
;; More idiomatically:
(defun foo (beg end) ; Args will be passed by interactive below
(interactive "r") ; This is a command operating on the region
(string-rectangle ; Call this function
beg ; First arg: START
end ; Second arg: END
"ZZZ")) ; Third arg: STRING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment