4

I'm in emacs 24.something on a Windows platform. I have an agenda generated by org that I would like to keep on continuous display. I use multiple frames, and multiple windows per frame, for my other work. What I would like is a single frame with a dedicated window displaying my agenda buffer that is NOT split

(set-window-dedicated (selected-window) t)

seems to help, but doesn't quite do the trick.

Any ideas?

1
  • The following link contains a detailed example of how to display a particular buffer in a particular frame, which includes making it the only window in the frame -- it also includes solutions for non-file-visiting buffers (like *Org Agenda*) and file-visiting buffers: stackoverflow.com/a/18371427/2112489 Unfortunately, it is a little complex and may take some time to digest and incorporate into your workflow. I'm sorry that I don't have a simple solution.
    – lawlist
    Feb 11, 2015 at 20:32

2 Answers 2

2

A similar question was asked here. Try this solution:

(with-current-buffer
  ;; initialize org-agenda here
  ;; this sexp MUST return a buffer,
  ;; to be used by with-current-buffer
  (blah blah initialize org-agenda blah blah)
  (make-frame '((unsplittable . t)))
  (set-window-dedicated-p
    (get-buffer-window (current-buffer) t) t))

Disclaimer: I, personally, don't use org-agenda, so I can't guarantee that this will work. It should if org-agenda behaves nicely.

2
  • You should warn the reader that the first argument of with-current-buffer has to be the agenda buffer.
    – Malabarba
    Feb 13, 2015 at 1:38
  • Indeed. Edited to reflect that.
    – PythonNut
    Feb 13, 2015 at 2:22
2

There was only one thing wrong with the code you tried, in terms of making the window dedicated:

(set-window-dedicated (selected-window) t)

The function is set-window-dedicated-p, not set-window-dedicated. Try again, without the typo:

 (set-window-dedicated-p (selected-window) t)

That will prevent both you and Emacs from using the window for another buffer. For example, C-x b will raise an error.

To prevent automatic splitting of the window, you can do this:

 (set-frame-parameter nil 'unsplittable t)

That will not prevent you from splitting the window, e.g. using C-x 2, but it will prevent Emacs from splitting it automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.