[Openmcl-devel] accessing pathname of Lisp file containing code evaluated via Execute Selection
ron at flownet.com
Thu Mar 11 17:12:50 UTC 2010
On Mar 9, 2010, at 3:49 PM, Alexander Repenning wrote:
> Are there handy dandy Hemlock functions allowing me to detect that I am being evaluated in the context of a Hemlock Execute Selection?
No (at least AFAIK), but you can roll your own, something like:
(defvar *hemlock-execute-selection-p* nil)
(defun eval-region (region
(package (variable-value 'current-package :buffer (current-buffer)))
(path (buffer-pathname (current-buffer))))
(format nil "(let ((hemlock::*hemlock-execute-selection-p* t)) ~A)"
(mark-absolute-position (region-start region)))))
There are lots of variations on this theme depending on exactly what you mean by "in the context of a Hemlock Execute Selection".
> Also, I would need to access the pathname of the file containing me.
More information about the Openmcl-devel