ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] Re: cyclebuffer integration (version 1)


From: Joe Corneli
Subject: [RP] Re: cyclebuffer integration (version 1)
Date: Fri Mar 5 22:20:00 2004

Hello - here are the functions I came up with for integrating
cyclebuffer and the ratpoison bar.  The only problem right now is
that switching directions (going forward or backward) causes a
somewhat disorienting change in the way the list is displayed.  If
the variable cyclebuffer-buffer-list is used where noted in the
code, then you get a static list that isn't good for much.  Except
if the current buffer could be backlit.... that would be the best:
but I don't know if it is possible to control backlighting from
outside ratpoison w/o a non-standard patch? It doesn't look that way
to me, but I could be wrong. Thoughts on this?

Joe

(defun ratpoison-cyclebuffer-forward ()
(interactive)
(setq this-command 'cyclebuffer-forward)
(cyclebuffer-forward)
(ratpoison-echo-buffer-list))

(defun ratpoison-cyclebuffer-backward ()
(interactive)
(setq this-command 'cyclebuffer-backward)
(cyclebuffer-backward)
(ratpoison-echo-buffer-list))

(defun ratpoison-echo-buffer-list ()
(ratpoison-echo
 (let* ((str (replace-regexp-in-string "^[( ]\\|)$" ""
             (replace-regexp-in-string "\\(#<buffer \\)\\(.*?\\)\\(>\\)" "\\2\n 
"
             (replace-regexp-in-string " #<buffer  .*?>" "" (format "%S" 
                                                                    ;; use
                                                                    ;; 
`cyclebuffer-buffer-list'
                                                                    ;; to get a
                                                                    ;; static
                                                                    ;; list (not
                                                                    ;; what you
                                                                    ;; would
                                                                    ;; 
necessarily
                                                                    ;; expect)
                                                                    
(buffer-list))))))
        (len (length str)))
 (substring str 0 (1- len)))))



reply via email to

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