tlh / workgroups.el

workgroups for windows -- sexy window management for emacs
242 stars 30 forks source link

buffers that aren't linked to a file #7

Closed vinhdizzo closed 13 years ago

vinhdizzo commented 13 years ago

Hi tlh,

I finally decided (actually, had time) to migrate to workgroups over escreen for testing purposes. I currently have the following in my (add-hook 'desktop-save-hook (lambda () (wg-update-all-workgroups) (wg-save "~/.emacs.d/workgroups-save") )) .emacs file. Since I use desktop mode to to have my opened files opened automatically, I just update my workgroups whenever desktop-mode saves, which includes when I close emacs. I guess in theory i wouldn't need desktop-mode anymore, since workgroups should open up those files that are apart of the workgroups. Well, I guess files that aren't visible in any workgroups wouldn't be re-opened...so I guess I'll still use desktop-mode.

Now, to my question. Suppose in a workgroup, one of the window is a buffer that is not linked to a file, e.g., the messages buffer. If I save the workgroup, and re-launch emacs at a later time, this window does not show the original buffer, which makes sense, because those buffers aren't linked to a file. Currently, what shows up in those window spaces are other files that are opened in emacs. Is it possible to always use the scratch buffer in those places? That way other files aren't mixed in with different workgroups/projects.

tlh commented 13 years ago

Hrm. scratch (wg-default-buffer) should already be switched-to in windows viewing buffers that can't be restored. Can you verify that it isn't restoring scratch, and post more details on how to reproduce the misbehavior?

vinhdizzo commented 13 years ago

Hmmm, I can't reproduce it anymore. Will re-post if it comes up again...it just might have been my mistake. Sorry for the false alarm.

vinhdizzo commented 13 years ago

Hi again,

So I found out how to reproduce the issue I was noticing. Try this.

You will notice that the buffer in the first workgroup will be that of scratch. Note that I use desktop-mode, so all the previous buffers will be open, such as "file1.txt". "file1.txt" will be the buffer that shows when emacs is restarted since it was the last shown buffer.

vinhdizzo commented 13 years ago

This "issue" I was referring to occurs when desktop-mode is used concurrently with workgroups. Disabling desktop-mode fixes it. Thanks.