Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun delete-empty-lines ()
- "Delete empty lines in bibliography."
- (interactive)
- ;; set point-min
- (setq m1 (make-marker))
- (goto-char (point-min))
- (search-forward "\begin{thebibliography}" nil nil)
- (beginning-of-line)
- (set-marker m1 (point))
- ;; set point-max
- (setq m2 (make-marker))
- (search-forward "\end{thebibliography}" nil nil)
- (end-of-line)
- (set-marker m2 (point))
- ;; set marker
- (push-mark m1 nil t)
- (push-mark m2 nil t)
- ;; color region
- (setq mark-active t)
- ;; clean empty lines
- (flush-lines "$^" m1 m2)
- ;; decolor region
- (setq mark-active nil))
Add Comment
Please, Sign In to add comment