emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: speedbar-frame-mode calls dframe-frame-mode too early


From: Drew Adams
Subject: RE: speedbar-frame-mode calls dframe-frame-mode too early
Date: Sat, 1 Apr 2006 10:27:59 -0800

        In speedbar-frame-mode, function `dframe-frame-mode' is called using
        an empty speedbar-buffer. I have code that fits frames to their
        current buffer upon switch-to-buffer (if one-window-p).  In
        this case, my code fits the frame to an empty buffer, because the
        buffer contents are filled after, not before, the frame is created
        with the buffer.

        Please create the frame (via `dframe-frame-mode') after, not before,
        the speedbar-buffer has already been filled.

    I should add that I tried using the available speedbar hooks to
    run my frame-fitting function, to no avail. I tried:

    . speedbar-mode-hook
    . speedbar-after-create-hook

    In both cases the hook is run too early: the buffer is still empty.

    If the suggestion I made above cannot be implemented for some
    reason, then please consider providing another hook that will
    be run after the buffer is filled - for example, a hook at the
    end of `speedbar-update-contents'. Actually, I need to fit the
    frame only once, after the initial speedbar display, but if
    there cannot be a hook at that place, then a hook each time the
    contents are updated would be OK. If another hook is added,
    probably the best place would be at the end of
    `speedbar-frame-mode' (that is, `speedbar').

To give you a better idea, this hack is what I need to do now, at the top
level of my startup library:

(require 'speedbar)
(speedbar-frame-mode 99)
(let ((win (get-buffer-window " SPEEDBAR" t)))
  (when win (save-window-excursion (select-window win) (fit-frame)))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]