Advertisement
froleyks

temp.org

Apr 15th, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. **** special functions
  2. #+begin_src elisp
  3. (use-package! ox
  4. :defer t
  5. :commands
  6. graph
  7. :config
  8. (defun graph ()
  9. (save-excursion
  10. (search-backward "#+name: ")
  11. (evil-forward-WORD-begin)
  12. (setq drawGraphName (buffer-substring-no-properties (point) (point-at-eol)))
  13. (search-forward "#+begin_example")
  14. (evil-next-line-first-non-blank)
  15. (let ((begin (point)))
  16. (search-forward "#+end_example")
  17. (previous-line)
  18. (setq drawGraph (buffer-substring-no-properties begin (point-at-eol)))
  19. )
  20. (concat drawGraph (concat "\nname: " (replace-regexp-in-string " " "_" (replace-regexp-in-string " +" "_" drawGraphName))))
  21. ))
  22. )
  23. #+end_src
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement