Source of Nothingness - xyzzy lisp : global-mark を popup の続き

* xyzzy lisp : global-markpopup の続き


(in-package "editor")

(export '(popup-global-mark-list set-global-mark view-global-mark))

(defun view-global-mark ()
  (interactive)
  (with-output-to-temp-buffer ("*view gmark*")
    (mapc #'(lambda (x)
              (format t "<~A>:~D:~A~%" (buffer-name (second x)) (third x) (fourth x)))
          (global-mark-make-list))))

(defun popup-global-mark-list ()
  (interactive)
  (let* ((l (mapcar #'(lambda (x)
                        (list (car x) (format nil "<~A>:~D:~A" (buffer-name (second x)) (third x) (fourth x))))
                    (global-mark-make-list)))
         (sl (mapcar #'(lambda (x) (second x)) l)))
    (popup-list sl #'(lambda (x)
                       (setq *last-global-mark* (car (nth (position x sl :test #'string=) l)))
                       (global-mark-goto *last-global-mark*)
                       (refresh-screen))) ;
    t))

(defun set-global-mark ()
  (interactive)
  (global-mark-add)
  (message "Gmark set"))

(define-key ctl-x-map '(#\g #\j) 'popup-global-mark-list)
(define-key ctl-x-map '(#\g #\SPC) 'set-global-mark)

update : 2006-03-24 (Fri) 13:00:54