Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro for-each-line (varname &rest body)
- "For each line in current buffer from point to end of buffer, execute body.\nLine text passed as a string arg. and point is at beginning of line."
- `(while (not (eobp))
- (save-excursion
- (beginning-of-line)
- (let ((,varname (buffer-substring-no-properties (line-beginning-position) (line-end-position))))
- ,@body ))
- (forward-line 1)))
- ;; This was my very first elisp macro
Add Comment
Please, Sign In to add comment