Skip to content
Sergey Pashinin edited this page Oct 2, 2013 · 19 revisions

Useful functions

(wg-workgroup-list) - get a list of workgroups
(wg-current-workgroup) - current workgroup
(wg-workgroup-name (wg-current-workgroup)) - current WG name
(wg-workgroup-names) - a list of all WG names

Restoring a buffer

Functions to look into:

  • wg-restore-buffer, wg-restore-file-buffer in workgroups-wconfig-restore.el
  • Deserialize functions in workgroups-specialbufs.el

What happens when saving?

Functions stack:

  • wg-write-session-file
    • wg-perform-session-maintenance
      • wg-update-current-workgroup-working-wconfig
        • wg-frame-to-wconfig (serialization (a wg-wconfig) of Emacs frame)
      • wg-update-all-base-wconfigs
      • wg-gc-bufs (Remove bufs from wg-buf-list that are no longer needed)
      • wg-gc-buf-uids
      • wg-update-buf-list (Update all bufs in wg-buf-list corresponding to buffers in BUFFER-LIST)
    • wg-write-sexp-to-file
      • wg-pickel-all-session-parameters
        • wg-current-session

wg-switch-to-workgroup

  • wg-switch-to-workgroup
    • wg-read-workgroup-name
      • wg-completing-read
        • wg-workgroup-names
        • wg-read-buffer-mode (ido, iswitchb, fallback)

wg-update-current-workgroup-working-wconfig

  • wg-update-current-workgroup-working-wconfig
    • wg-current-workgroup
    • wg-current-wconfig
      • wg-frame-to-wconfig
    • wg-set-workgroup-working-wconfig

What hooks are used?

  • post-command-hook

Test workgroups

If you put an extension to ~/.emacs.d/elisp/extensions/workgroups2 try to run this command:

emacs -Q -L ~/.emacs.d/elisp/extensions/workgroups2/src -l cl.el -l workgroups2.el --eval '(workgroups-mode 1)'

with ido.el

emacs -Q -L ~/.emacs.d/elisp/extensions/workgroups2/src -l cl.el -l ido.el -l workgroups2.el --eval "(ido-mode t)" --eval "(workgroups-mode 1)"