Guest User

Untitled

a guest
May 24th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. (defmacro for-each-line (varname &rest body)
  2. "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."
  3. `(while (not (eobp))
  4. (save-excursion
  5. (beginning-of-line)
  6. (let ((,varname (buffer-substring-no-properties (line-beginning-position) (line-end-position))))
  7. ,@body ))
  8. (forward-line 1)))
  9.  
  10. ;; This was my very first elisp macro
Add Comment
Please, Sign In to add comment