help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: ESS completion buffer


From: David Hansen
Subject: Re: ESS completion buffer
Date: Mon, 19 Mar 2007 18:00:42 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

On 19 Mar 2007 01:35:35 -0700 cmr Pent wrote:

> On 19 мар, 11:07, David Hansen <address@hidden> wrote:
>> If you are interested i can send my
>> configuration.
>
> Yes, it would be nice if you sent your .emacs to cmr.Pent(a)gmail.com.
> I'll try special buffers when I get to my home computer.

Note that this is nothing more than some "dirty" configuration.
Comments, improvements welcome.  On a MAC or DOS box you may want to
change the `window-system' test (it's there b/c I run emacs from time
to time in non graphical mode where this makes no sense).

You'll have to tell your window manager to place/size the window
named "*special*" somewhere you like it (can maybe be done from
emacs as well).

David

(eval-when-compile (require 'cl))

(defun dh-get-special-window ()
  (let ((frame (or (loop for frame in (frame-list)
                      when (and (frame-live-p frame)
                                (frame-parameter frame 'dh-special))
                      do (return frame))
                   (make-frame '((name . "*special*")
                                 (dh-special . t)
                                 (unsplittable . t)
                                 (minibuffer . nil))))))
    (let ((window (frame-first-window frame)))
      (with-selected-window window
        (delete-other-windows))
      window)))

(defun dh-special-display (buffer &optional data)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (switch-to-buffer buffer)
      window)))

(defun dh-scroll-up-special-window ()
  (interactive)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (scroll-up))))

(defun dh-scroll-down-special-window ()
  (interactive)
  (let ((window (dh-get-special-window)))
    (with-selected-window window
      (scroll-down))))

(defun dh-switch-to-special-buffer ()
  (interactive)
  (let ((buffer (with-selected-window (dh-get-special-window)
                  (current-buffer))))
    (switch-to-buffer buffer)))

(when (eq window-system 'x)
  (setq display-buffer-reuse-frames t)

  (setq special-display-regexps
        '("^\\*Completions\\*$"
          "^\\*Help\\*$"
          "^\\*grep\\*$"
          "^\\*Apropos\\*$"
          "^\\*elisp macroexpansion\\*$"
          "^\\*local variables\\*$"
          "^\\*Compile-Log\\*$"
          "^\\*Quail Completions\\*$"
          "^\\*Occur\\*$"
          "^\\*frequencies\\*$"
          "^\\*compilation\\*$"
          "^\\*Locate\\*$"
          "^\\*Colors\\*$"
          "^\\*tumme-display-image\\*$"
          "^\\*SLIME Description\\*$"
          "^\\*.* output\\*$"           ; tex compilation buffer
          "^\\*TeX Help\\*$"))

  (global-set-key (kbd "C-c SPC") #'dh-scroll-up-special-window)
  (global-set-key (kbd "C-c DEL") #'dh-scroll-down-special-window)
  (global-set-key (kbd "C-c s SPC") #'dh-scroll-up-special-window)
  (global-set-key (kbd "C-c s DEL") #'dh-scroll-down-special-window)
  (global-set-key (kbd "C-c s b") #'dh-switch-to-special-buffer)

  (setq special-display-function #'dh-special-display))





reply via email to

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