Skip to content
Newer
Older
100644 138 lines (104 sloc) 4.93 KB
d08eaa2 fixed line endings
creator authored
1 ;;; ecb-cycle.el --- cycle buffers through ecb windows.
2
f88254a - Removed Emacs 20.X support completely
berndl authored
3 ;; Copyright (C) 2000 - 2005 Jesper Nordenberg,
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
4 ;; Klaus Berndl,
5 ;; Kevin A. Burton,
6 ;; Free Software Foundation, Inc.
d08eaa2 fixed line endings
creator authored
7
aa7071f Updated Copyright
berndl authored
8 ;; Author: Klaus Berndl <klaus.berndl@sdm.de>
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
9 ;; Kevin A. Burton <burton@openprivacy.org>
10 ;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
11 ;; Keywords: browser, code, programming, tools
12 ;; Created: 2002
d08eaa2 fixed line endings
creator authored
13
14 ;; This program is free software; you can redistribute it and/or modify it under
15 ;; the terms of the GNU General Public License as published by the Free Software
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
16 ;; Foundation; either version 2, or (at your option) any later version.
17
d08eaa2 fixed line endings
creator authored
18 ;; This program is distributed in the hope that it will be useful, but WITHOUT
19 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 ;; details.
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
22
d08eaa2 fixed line endings
creator authored
23 ;; You should have received a copy of the GNU General Public License along with
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
24 ;; GNU Emacs; see the file COPYING. If not, write to the Free Software
25 ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;; $Id$
d08eaa2 fixed line endings
creator authored
28
29 ;;; Commentary:
30
31 ;; NOTE: If you enjoy this software, please consider a donation to the EFF
32 ;; (http://www.eff.org)
33
34 ;;; History:
35
7df4b6d Added the same Copyright-header to all sources (incl. copyright for FSF)
berndl authored
36 ;; For the ChangeLog of this file see the CVS-repository. For a complete
37 ;; history of the ECB-package see the file NEWS.
d08eaa2 fixed line endings
creator authored
38
39 ;;; TODO:
40 ;;
41 ;; - What is the pattern we should use for cycling through other windows?
42 ;;
43 ;; - ecb-cycle-through-X-buffers (select the next X buffer)
44 ;; - ecb-cycle-switch-to-X-buffer (set the X buffer using completion)
45 ;;
46 ;; - How do we setup the menubar?
47 ;;
48 ;; - ECB
49 ;; Cycle
50 ;; - Forward Compilation Buffer
51 ;; - Set Compilation Buffer
52 ;;
53 ;; - What do we use for key bindings?
54 ;;
55 ;; - We need an easier way to setup completion and a better way to get the
56 ;; index.
57 ;;
58 ;; - If possible, try to put fit the buffer so that the end of buffer is at the
59 ;; end of the window... if necessary.
60
61 ;;; Code:
62
d789f9c silencing the byte-compiler better
berndl authored
63 (eval-when-compile
d1db9e5 ecb-bytecomp.el was renamed to silentcomp.el - an ECB independent pac…
berndl authored
64 (require 'silentcomp))
d789f9c silencing the byte-compiler better
berndl authored
65
d08eaa2 fixed line endings
creator authored
66 (require 'ecb-compilation)
5a310e1 small changes and improving the online-help
berndl authored
67 (require 'ecb-layout)
d08eaa2 fixed line endings
creator authored
68
69 (defgroup ecb-cycle nil
70 "Setting for cycling through misc ECB buffers."
71 :group 'ecb
72 :prefix "ecb-cycle-")
73
74
5a310e1 small changes and improving the online-help
berndl authored
75 (defun ecb-cycle-through-compilation-buffers(&optional choose-buffer)
01acd14 Making the docstrings of the customizable options and the interactive…
berndl authored
76 "Cycle through all compilation buffers currently open.
77 The choosen compilation buffer is displayed within the compilation window
78 `ecb-compile-window' \(if this window doesn't exist then an error is
79 displayed). If the currently opened buffer within the compilation window is
80 not a compilation buffer, we jump to the first compilation buffer. If not we
81 try to loop through all compilation buffers. If we hit the end we go back to
82 the beginning.
5a310e1 small changes and improving the online-help
berndl authored
83
84 If CHOOSE-BUFFER is not nil then the user will be prompted for the
6e1abd0 Fixing a lot of misspellings in strings and comments and in the onlin…
berndl authored
85 compilation-buffer to switch to.
5a310e1 small changes and improving the online-help
berndl authored
86
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
87 Afterwards always the compile-window of ECB is selected."
9b51e85 Removed some unnecessary code
berndl authored
88
5a310e1 small changes and improving the online-help
berndl authored
89 (interactive "P")
28db338 some minor bug fixes for the next release
berndl authored
90 (if (not (numberp ecb-compile-window-height))
11e257a manual and doc additions and fixes
berndl authored
91 (ecb-error "This command needs a persistent compile window!")
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
92 (if choose-buffer
d0bb095 - Added new advice-backbone (all)
berndl authored
93 (switch-to-buffer (completing-read "ECB compilation buffer: "
94 (ecb-compilation-get-buffers)))
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
95
96 (let* ((compilation-buffers (ecb-compilation-get-buffers))
28db338 some minor bug fixes for the next release
berndl authored
97 ;; This works even if ecb-compile-window is nil or not alive
98 ;; (means temporally hidden) --> then current-buffer is the
99 ;; buffer of the currently selected window!
100 (current-buffer (or (and (ecb-compile-window-live-p)
101 (window-buffer ecb-compile-window))
102 (current-buffer)))
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
103 (current-buffer-name (buffer-name current-buffer))
104 (current nil)
105 (index nil))
106 (when (null compilation-buffers)
107 (ecb-error "No compilation buffers available."))
108
109 (if (not (ecb-compilation-buffer-p current-buffer))
110 ;;if the current buffer is not a compilation buffer, goto the first
111 ;;compilation buffer.
112
113 (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
114
115 ;;else... we need to determine what buffer to display.
116
117 (setq current (assoc current-buffer-name compilation-buffers))
118
119 (setq index (cdr current))
120
121 (if (= (1+ index) (length compilation-buffers))
122 ;;go back to the first buffer.
123 (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
124 (ecb-cycle-set-compilation-buffer (1+ index)
125 compilation-buffers)))))))
126
d08eaa2 fixed line endings
creator authored
127
128 (defun ecb-cycle-set-compilation-buffer(index compilation-buffers)
129 "Set the buffer in the compilation window."
130
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
131 (let ((buffer-name (car (nth index compilation-buffers))))
d0bb095 - Added new advice-backbone (all)
berndl authored
132 (switch-to-buffer buffer-name)))
9753042 Updated switch-to-buffer-* to the new display-buffer advice. Update a…
berndl authored
133
d08eaa2 fixed line endings
creator authored
134
d1db9e5 ecb-bytecomp.el was renamed to silentcomp.el - an ECB independent pac…
berndl authored
135 (silentcomp-provide 'ecb-cycle)
d08eaa2 fixed line endings
creator authored
136
137 ;;; ecb-cycle.el ends here
Something went wrong with that request. Please try again.