Advertisement
Guest User

nonlocal-exit-demo.el

a guest
Feb 4th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.72 KB | None | 0 0
  1. ;; -- nonlocal-exit-demo.el
  2.  
  3. (defvar --nonlocal-exit-- t)
  4.  
  5. (princ "pre.exit\n")
  6.  
  7. (condition-case err
  8.     (when --nonlocal-exit--
  9.       (let ((--nonlocal-exit-- nil))
  10.         (load-file load-file-name)
  11.         (with-current-buffer " *load*" (goto-char (point-max)))))
  12.   (error (princ (format "%S\n" err))))
  13.  
  14. (princ "post.exit\n")
  15.  
  16.  
  17. ;; -- Shell session
  18. >>> emacs --batch --eval '(byte-compile-file "nonlocal-exit-demo.el")'
  19. >>> emacs --batch --load nonlocal-exit-demo.el
  20. pre.exit
  21. Loading /tmp/nonlocal-exit-demo.el (source)...
  22. pre.exit
  23. post.exit
  24.  
  25. >>> emacs --batch --load nonlocal-exit-demo.elc
  26. pre.exit
  27. Loading /tmp/nonlocal-exit-demo.elc...
  28. pre.exit
  29. post.exit
  30. (error "No buffer named  *load*")
  31. post.exit
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement