lisp/frameset.el: Make list-registers a bit more informative.
(frameset--print-register): New function. (frameset-to-register): Use it.
This commit is contained in:
parent
4539380159
commit
6ce1b56e2a
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-03-21 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* frameset.el (frameset--print-register): New function.
|
||||
(frameset-to-register): Use it.
|
||||
|
||||
2014-03-20 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* progmodes/hideif.el (hif-string-to-number): New function.
|
||||
|
|
|
@ -1271,6 +1271,17 @@ Called from `jump-to-register'. Internal use only."
|
|||
(set-frame-selected-window frame window)
|
||||
(with-current-buffer buffer (goto-char (aref data 2)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun frameset--print-register (data)
|
||||
"Print basic info about frameset stored in DATA.
|
||||
Called from `list-registers' and `view-register'. Internal use only."
|
||||
(let* ((fs (aref data 0))
|
||||
(ns (length (frameset-states fs))))
|
||||
(princ (format "a frameset (%d frame%s, saved on %s)."
|
||||
ns
|
||||
(if (= 1 ns) "" "s")
|
||||
(format-time-string "%c" (frameset-timestamp fs))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun frameset-to-register (register)
|
||||
"Store the current frameset in register REGISTER.
|
||||
|
@ -1288,7 +1299,7 @@ Interactively, reads the register using `register-read-with-preview'."
|
|||
;; in the current buffer, so record that separately.
|
||||
(frameset-frame-id nil)
|
||||
(point-marker))
|
||||
:print-func (lambda (_data) (princ "a frameset."))
|
||||
:print-func #'frameset--print-register
|
||||
:jump-func #'frameset--jump-to-register)))
|
||||
|
||||
(provide 'frameset)
|
||||
|
|
Loading…
Add table
Reference in a new issue