Created
July 12, 2010 13:45
-
-
Save miyamuko/472474 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: lisp-interaction-mode: package: hoge -*- ってファイルの先頭に書いておくと | |
;; hoge パッケージ内で評価する | |
(defun eval-print-last-sexp/buffer-package () | |
(interactive "*") | |
(let* ((current-package | |
(or (save-excursion | |
(when (scan-buffer "^[ \t]*(in-package[ \t\n]+[:'\"]\\([^\")]+\\)" | |
:regexp t :reverse t) | |
(match-string 1))) | |
*buffer-package* | |
*package*)) | |
(*package* (lisp::coerce-to-package current-package))) | |
(minibuffer-message "eval in package: ~A" (package-name *package*)) | |
(message "eval in package: ~A" (package-name *package*)) | |
(eval-print-last-sexp))) | |
(define-key ed::*lisp-interaction-mode-map* #\LFD 'eval-print-last-sexp/buffer-package) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment