emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

frameset-to-register


From: Juanma Barranquero
Subject: frameset-to-register
Date: Wed, 12 Feb 2014 23:59:13 +0100

I'd like to commit this small patch, which basically makes the output
of list-registers/view-register a bit more informative for framesets.

It's not a bug fix, but OTOH, frameset-to-register is a new feature by
itself and this is just making the feature a bit better.

OK to install, or do I wait for the unfreezing?

   J



=== modified file 'lisp/frameset.el'
--- lisp/frameset.el 2014-02-11 20:48:23 +0000
+++ lisp/frameset.el 2014-02-12 22:42:11 +0000
@@ -1223,6 +1223,16 @@
     (set-frame-selected-window frame window)
     (with-current-buffer buffer (goto-char position))))))))

+(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.
@@ -1240,7 +1250,7 @@
  ;; 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]