FUEL: New fuel-switch-to-buffer command family.
parent
5c1d6b12c8
commit
e27daf5daf
|
@ -74,6 +74,9 @@ beast.
|
||||||
|
|
||||||
- C-cz : switch to listener
|
- C-cz : switch to listener
|
||||||
- C-co : cycle between code, tests and docs factor files
|
- C-co : cycle between code, tests and docs factor files
|
||||||
|
- C-cs : switch to other factor buffer (M-x fuel-switch-to-buffer)
|
||||||
|
- C-x4s : switch to other factor buffer in other window
|
||||||
|
- C-x5s : switch to other factor buffer in other frame
|
||||||
|
|
||||||
- M-. : edit word at point in Emacs (see fuel-edit-word-method custom var)
|
- M-. : edit word at point in Emacs (see fuel-edit-word-method custom var)
|
||||||
- M-, : go back to where M-. was last invoked
|
- M-, : go back to where M-. was last invoked
|
||||||
|
|
|
@ -132,6 +132,32 @@ was last invoked."
|
||||||
(pop-tag-mark)
|
(pop-tag-mark)
|
||||||
(error "No previous location for find word or vocab invokation")))
|
(error "No previous location for find word or vocab invokation")))
|
||||||
|
|
||||||
|
(defvar fuel-edit--buffer-history nil)
|
||||||
|
|
||||||
|
(defun fuel-switch-to-buffer (&optional method)
|
||||||
|
"Switch to any of the existing Factor buffers, with completion."
|
||||||
|
(interactive)
|
||||||
|
(let ((buffer (completing-read "Factor buffer: "
|
||||||
|
(remove (buffer-name)
|
||||||
|
(mapcar 'buffer-name (buffer-list)))
|
||||||
|
'(lambda (s) (string-match "\\.factor$" s))
|
||||||
|
t
|
||||||
|
nil
|
||||||
|
fuel-edit--buffer-history)))
|
||||||
|
(cond ((eq method 'window) (switch-to-buffer-other-window buffer))
|
||||||
|
((eq method 'frame) (switch-to-buffer-other-frame buffer))
|
||||||
|
(t (switch-to-buffer buffer)))))
|
||||||
|
|
||||||
|
(defun fuel-switch-to-buffer-other-window ()
|
||||||
|
"Switch to any of the existing Factor buffers, in other window."
|
||||||
|
(interactive)
|
||||||
|
(fuel-switch-to-buffer 'window))
|
||||||
|
|
||||||
|
(defun fuel-switch-to-buffer-other-frame ()
|
||||||
|
"Switch to any of the existing Factor buffers, in other frame."
|
||||||
|
(interactive)
|
||||||
|
(fuel-switch-to-buffer 'frame))
|
||||||
|
|
||||||
|
|
||||||
(provide 'fuel-edit)
|
(provide 'fuel-edit)
|
||||||
;;; fuel-edit.el ends here
|
;;; fuel-edit.el ends here
|
||||||
|
|
|
@ -177,6 +177,9 @@ interacting with a factor listener is at your disposal.
|
||||||
(fuel-mode--key-1 ?l 'fuel-run-file)
|
(fuel-mode--key-1 ?l 'fuel-run-file)
|
||||||
(fuel-mode--key-1 ?r 'fuel-eval-region)
|
(fuel-mode--key-1 ?r 'fuel-eval-region)
|
||||||
(fuel-mode--key-1 ?z 'run-factor)
|
(fuel-mode--key-1 ?z 'run-factor)
|
||||||
|
(fuel-mode--key-1 ?s 'fuel-switch-to-buffer)
|
||||||
|
(define-key fuel-mode-map "\C-x4s" 'fuel-switch-to-buffer-other-window)
|
||||||
|
(define-key fuel-mode-map "\C-x5s" 'fuel-switch-to-buffer-other-frame)
|
||||||
|
|
||||||
(define-key fuel-mode-map "\C-\M-x" 'fuel-eval-definition)
|
(define-key fuel-mode-map "\C-\M-x" 'fuel-eval-definition)
|
||||||
(define-key fuel-mode-map "\C-\M-r" 'fuel-eval-extended-region)
|
(define-key fuel-mode-map "\C-\M-r" 'fuel-eval-extended-region)
|
||||||
|
|
Loading…
Reference in New Issue