Skip to content

Instantly share code, notes, and snippets.

@g000001 g000001/gist:75250
Created Mar 7, 2009

Embed
What would you like to do?
(progn
;; edit-definitionで(setf foo)を拾えるようにする
;; slime-read-function-name に変更しただけ
(defun slime-edit-definition (name &optional where)
"Lookup the definition of the name at point.
If there's no name at point, or a prefix argument is given, then the
function name is prompted."
(interactive (list (slime-read-function-name "Name: ")))
(or (run-hook-with-args-until-success 'slime-edit-definition-hooks
name where)
(slime-edit-definition-cont (slime-find-definitions name)
name where)))
;; setf関数名を取り出す
(defun setf-function-name (str)
(let ((expr (car (read-from-string str))))
(cond ((eq 'setf (car expr))
(format "%s" expr))
(t (and (eq 'function (car expr))
(and (eq 'setf (car (cadr expr)))
(format "%s" (cadr expr))))))))
(defun slime-function-name-at-point ()
(let ((name (thing-at-point 'list)))
(if (and name (setf-function-name name))
(setf-function-name name)
(slime-symbol-at-point))))
(defun slime-read-function-name (prompt &optional query)
(cond ((or current-prefix-arg query (not (slime-function-name-at-point)))
(slime-read-from-minibuffer prompt (slime-function-name-at-point)))
(t (slime-function-name-at-point)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.