+2013-08-09 Juanma Barranquero <lekktu@gmail.com>
+
+ * frameset.el (frameset-p): Add autoload cookie.
+ (frameset--jump-to-register): New function, based on code moved from
+ register.el.
+ (frameset-to-register): Move from register.el. Adapt to `registerv'.
+
+ * register.el (frameset-frame-id, frameset-frame-with-id, frameset-p)
+ (frameset-restore, frameset-save, frameset-session-filter-alist):
+ Remove declarations.
+ (register-alist): Doc fix.
+ (frameset-to-register): Move to frameset.el.
+ (jump-to-register, describe-register-1): Remove frameset-specific code.
+
2013-08-08 Juanma Barranquero <lekktu@gmail.com>
* allout-widgets.el (allout-widgets-pre-command-business)
IMPORTANT: Modifying this slot may cause frameset functions to fail,
unless the type constraints defined above are respected.\n\n(fn FRAMESET)")
+;;;###autoload (autoload 'frameset-p "frameset"
+;;;###autoload "Return non-nil if OBJECT is a frameset, nil otherwise." nil)
+
(defun frameset-copy (frameset)
"Return a deep copy of FRAMESET.
FRAMESET is copied with `copy-tree'."
(unless (or (daemonp) (visible-frame-list))
(make-frame-visible (car (frame-list))))))
+\f
+;; Register support
+
+(defun frameset--jump-to-register (data)
+ "Restore frameset from DATA stored in register.
+Called from `jump-to-register'. Internal use only."
+ (let* ((delete (and current-prefix-arg t))
+ (iconify-list (if delete nil (frame-list))))
+ (frameset-restore (aref data 0)
+ :filters frameset-session-filter-alist
+ :reuse-frames (if delete t :keep))
+ (mapc #'iconify-frame iconify-list)
+ (let ((frame (frameset-frame-with-id (aref data 1))))
+ (when frame
+ (select-frame-set-input-focus frame)
+ (goto-char (aref data 2))))))
+
+;;;###autoload
+(defun frameset-to-register (register &optional _arg)
+ "Store the current frameset in register REGISTER.
+Use \\[jump-to-register] to restore the frameset.
+Argument is a character, naming the register."
+ (interactive "cFrameset to register: \nP")
+ (set-register register
+ (registerv-make
+ (vector (frameset-save nil
+ :app 'register
+ :filters frameset-session-filter-alist)
+ ;; frameset-save does not include the value of point
+ ;; in the current buffer, so record that separately.
+ (frameset-frame-id nil)
+ (point-marker))
+ :print-func (lambda (_data) (princ "a frameset."))
+ :jump-func #'frameset--jump-to-register)))
+
(provide 'frameset)
;;; frameset.el ends here
(eval-when-compile (require 'cl-lib))
-(declare-function frameset-frame-id "frameset" (frame))
-(declare-function frameset-frame-with-id "frameset" (id &optional frame-list))
-(declare-function frameset-p "frameset" (frameset))
-(declare-function frameset-restore "frameset" (frameset &rest keys) t)
-(declare-function frameset-save "frameset" (frame-list &rest keys) t)
-
;;; Code:
(cl-defstruct
A list of the form (WINDOW-CONFIGURATION POSITION)
represents a saved window configuration plus a saved value of point.
A list of the form (FRAME-CONFIGURATION POSITION)
- represents a saved frame configuration plus a saved value of point.
-A list of the form (FRAMESET FRAME-ID POSITION)
- represents a saved frameset plus the value of point in frame FRAME-ID.")
+ represents a saved frame configuration plus a saved value of point.")
(defgroup register nil
"Register commands."
;; of point in the current buffer, so record that separately.
(set-register register (list (current-frame-configuration) (point-marker))))
-(defvar frameset-session-filter-alist)
-
-(defun frameset-to-register (register &optional _arg)
- "Store the current frameset in register REGISTER.
-Use \\[jump-to-register] to restore the frameset.
-Argument is a character, naming the register."
- (interactive "cFrameset to register: \nP")
- (set-register register
- (list (frameset-save nil
- :app 'register
- :filters frameset-session-filter-alist)
- ;; frameset-save does not include the value of point
- ;; in the current buffer, so record that separately.
- (frameset-frame-id nil)
- (point-marker))))
-
(defalias 'register-to-point 'jump-to-register)
(defun jump-to-register (register &optional delete)
"Move point to location stored in a register.
((and (consp val) (window-configuration-p (car val)))
(set-window-configuration (car val))
(goto-char (cadr val)))
- ((and (consp val) (frameset-p (car val)))
- (let ((iconify-list (if delete nil (frame-list)))
- frame)
- (frameset-restore (car val)
- :filters frameset-session-filter-alist
- :reuse-frames (if delete t :keep))
- (mapc #'iconify-frame iconify-list)
- (when (setq frame (frameset-frame-with-id (cadr val)))
- (select-frame-set-input-focus frame)
- (goto-char (nth 2 val)))))
((markerp val)
(or (marker-buffer val)
(error "That register's buffer no longer exists"))
((and (consp val) (frame-configuration-p (car val)))
(princ "a frame configuration."))
- ((and (consp val) (frameset-p (car val)))
- (princ "a frameset."))
-
((and (consp val) (eq (car val) 'file))
(princ "the file ")
(prin1 (cdr val))