Skip to content

How to restore a specific type of buffer

Sergey Pashinin edited this page Aug 27, 2013 · 2 revisions

The problem is following:

  • my-beautiful-buffer-mode hasn't been restored

You can help to solve it. What information is helpful:

  1. Extension name that you use (and others are likely using it) + major-mode variable
  2. Local buffer variables (that may help restoring it)
  3. Specific functions to run (to restore a buffer)

Important note

It's better to exclude any interaction with user on restoring (and do everything automatically)
So if you run a command that asks to enter something - it's likely saved as a local buffer variable that we can use to restore it automatically.

Well, actually when there is no support at all - even a command that requires user interaction can be used (but will annoy you each time buffers are restored)

So when you got all needed info - it's time to write some code...

Program code to write

You need to:

  • write 2 functions (serialize-deserialize) in workgroups-specialbufs.el (see this file for examples)

  • Add serialize function to a special variable wg-special-buffer-serdes-functions in workgroups-variables.el

      (defcustom wg-special-buffer-serdes-functions
      '(wg-serialize-Info-buffer
        wg-serialize-org-agenda-buffer
        wg-serialize-help-buffer
        wg-serialize-ielm-buffer
        wg-serialize-shell-buffer
        wg-serialize-eshell-buffer
        wg-serialize-term-buffer)