unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: frameset-to-register
Date: Wed, 12 Feb 2014 23:59:13 +0100	[thread overview]
Message-ID: <CAAeL0SRLb_d1Ora3ro4iWnGeJT3bqWpT008jGgVM00FUwQn7CA@mail.gmail.com> (raw)

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	other threads:[~2014-02-12 22:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 22:59 Juanma Barranquero [this message]
2014-02-13  0:34 ` frameset-to-register Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2013-08-05  5:12 frameset-to-register Juanma Barranquero
2013-08-05 13:11 ` frameset-to-register Juanma Barranquero
2013-08-05 20:35 ` frameset-to-register Drew Adams
2013-08-05 20:49   ` frameset-to-register Juanma Barranquero
2013-08-06 21:11     ` frameset-to-register Stefan Monnier
2013-08-08  0:49       ` frameset-to-register Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0SRLb_d1Ora3ro4iWnGeJT3bqWpT008jGgVM00FUwQn7CA@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).