annotate lisp/energize/energize-windows.el @ 111:164ab62060bf

Added tag r20-1b7 for changeset fe104dbd9147
author cvs
date Mon, 13 Aug 2007 09:19:47 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; -*- Mode:Emacs-Lisp -*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright © 1992 by Lucid, Inc. All Rights Reserved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; Displaying buffers. Why is this so hard?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; This crud is damage control, because sometimes things get confused, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; the server asks us to display a buffer that has been killed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 (defun energize-request-kill-buffer-if-dead (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 (cond ((not (bufferp buffer)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ((null (buffer-name buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 (if (energize-buffer-p buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 (energize-request-kill-buffer buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (defun energize-prune-killed-buffers-from-list (buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 (let ((rest buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (buffer-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (deleted-count 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (while rest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (let* ((buffer (car rest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (extent (car (cdr rest))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (setq rest (cdr (cdr rest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (setq buffer-count (1+ buffer-count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (if (energize-request-kill-buffer-if-dead buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (setq deleted-count (1+ deleted-count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (setq buffer-extent-list (delq buffer buffer-extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (setq buffer-extent-list (delq extent buffer-extent-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (if (> deleted-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (format "Oops, confused about %s selected %s -- please try again."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (if (> deleted-count 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (format "%d of the" deleted-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (if (> buffer-count 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 "one of the"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "the"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (if (> buffer-count 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "buffers"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 "buffer")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (ding t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 buffer-extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defvar energize-auto-scroll-p t ;#### this should be nil, t is LOSING
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "*If t, energize will scroll your debugger and error log buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 to the bottom whenever output appears with reckless abandon. If nil,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 it will behave just like normal shell and gdb-mode buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (defvar energize-error-log-context-lines 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 "*Number of lines to skip above the current error in the Energize error log")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;; called by energize-show-all-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;;; If the extent is specified:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;;; - scrolls the window so that point is at at the beginning of the extent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;; - If the buffer is "Error Log", the extent is moved to top-of-window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;;; - if `only-one' and the buffer is a source buffer, then... what?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;; If the buffer is "*Debugger*" or "Error Log", point is moved to eof,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;; IF and ONLY if it was at EOF already.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (defun energize-scroll-window-at-extent (window extent only-one)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (let* ((buffer (window-buffer window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (type (energize-buffer-type buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (if (and extent (null (extent-start-position extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; it has been detached somehow.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (setq extent nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (let ((pos (extent-start-position extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (if (not (eq pos 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (set-window-point window pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (cond ((eq type 'energize-error-log-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; scroll the Error Log buffer so that the first error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;; is at the top of the window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (set-window-start window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (goto-char pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (forward-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 energize-error-log-context-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ((and only-one (eq type 'energize-source-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; if only one buffer is requested to be visible and it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; is a source buffer then scroll point close to the top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (set-window-start window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (goto-char pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (if (> (window-height window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 next-screen-context-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (vertical-motion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (- next-screen-context-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (vertical-motion -1 window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (point)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (cond ((and (memq type '(energize-error-log-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 energize-debugger-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ; don't move point if it's before the last line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (or energize-auto-scroll-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (>= (window-point window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (set-buffer (window-buffer window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;;(comint-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (energize-user-input-buffer-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ;; Debugger and Error Log buffers generally get scrolled to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;; the bottom when displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (set-window-point window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (save-excursion (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (+ 1 (buffer-size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;; Careful to deactivate the selection when automatically moving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; the user to the end of the buffer. This is suboptimal, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; otherwise we have bad interactions with the debugger-panel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; Print button. (Double-click on a value (point is now at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; end of that word); hit Print; point is now at point-max, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; the original word is still highlighted, which is incorrect -
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;; we're now in a state where the selection highlighting and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;; region between point and mark is out of sync. I'm not entirely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;; sure how to fix this short of using a point-motion hook of some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; kind, so we'll punt, and just deactivate the region instead.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (zmacs-deactivate-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;; called by energize-make-buffers-visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;;; For each of the contents of an plist of buffers and extents:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;;; - If the buffer is visible in a window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; - dedicate the window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;; - energize-scroll-window-at-extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;; If we dedicated any windows, select the last one dedicated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; For each of the buffers and extents:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;;; - pop-to-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;;; - remember the first window selected in this way
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;;; - dedicate the window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;;; - energize-scroll-window-at-extent; only-one arg is true if there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;;; is only one buffer/extent pair in the list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;;; - if energize-edit-buffer-externally-p make it read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;;; Un-dedicate the windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;;; Select the remembered window (the first one we popped-to-buffer on)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ;;; Maybe raise its frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (defun energize-show-all-buffers (buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (let ((pop-up-windows t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (dedicated-windows ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (buffer-extent-current)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (window-to-select ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (only-one (null (cdr (cdr buffer-extent-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (setq buffer-extent-current buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (while buffer-extent-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (let* ((buffer (car buffer-extent-current))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (extent (car (cdr buffer-extent-current)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (window (get-buffer-window buffer (selected-frame))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (if window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (set-window-buffer-dedicated window buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (setq dedicated-windows (cons window dedicated-windows))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (energize-scroll-window-at-extent window extent only-one)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (setq buffer-extent-current (cdr (cdr buffer-extent-current)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (if dedicated-windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (select-window (car dedicated-windows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (setq buffer-extent-current buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (while buffer-extent-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (let* ((buffer (car buffer-extent-current))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (extent (car (cdr buffer-extent-current))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ;; ## what was this intended to do? a frame is being passed as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;; ## argument which means "always select a different window even if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ;; ## it's visible in the selected window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;; (pop-to-buffer buffer nil (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (pop-to-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (if (energize-edit-buffer-externally-p buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (setq buffer-read-only t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (let ((window (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (if (null window-to-select)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq window-to-select window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (set-window-buffer-dedicated window buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (setq dedicated-windows (cons window dedicated-windows))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (energize-scroll-window-at-extent window extent only-one))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (setq buffer-extent-current (cdr (cdr buffer-extent-current)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (while dedicated-windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (set-window-buffer-dedicated (car dedicated-windows) ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (setq dedicated-windows (cdr dedicated-windows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (select-window window-to-select)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ;; now we may have to pop the frame up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (let ((frame (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (if (and energize-auto-raise-screen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (or (not (frame-visible-p frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (not (frame-totally-visible-p frame))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (sit-for 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (make-frame-visible frame))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ;;; called by energize-make-buffers-visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defun energize-main-buffer-of-list (list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;; Given an alternating list of buffers and extents, pick out the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;; "interesting" buffer. If one of the buffers is in debugger-mode,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ;; or in breakpoint-mode, then that's the interesting one; otherwise,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;; the last buffer in the list is the interesting one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (let (buffer mode result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (while list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (setq buffer (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (or (memq mode '(energize-debugger-mode energize-breakpoint-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (setq result buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 mode (save-excursion (set-buffer buffer) major-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (setq list (cdr (cdr list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;;; called by energize-make-many-buffers-visible-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ;;; If there is only one buffer/extent pair, and it's a source buffer, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ;;; edit it in vi if that's the kind of kinkiness we're into.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ;;; Get the "main" buffer, and select a frame for it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;;; Then call energize-show-all-buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (defun energize-make-buffers-visible (buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (let ((main-buffer (energize-main-buffer-of-list buffer-extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (if (and (null (cdr (cdr buffer-extent-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (energize-edit-buffer-externally-p main-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (energize-edit-buffer-externally-1 main-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (car (cdr buffer-extent-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ;; This may create and/or select a frame as a side-effect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ;; I'm not sure it's necessary to call this, as display-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ;; calls it too. But it can't hurt to select the appropriate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;; frame early...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (let ((hacked-frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (cond ((null energize-split-screens-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ((get-frame-name-for-buffer main-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (setq hacked-frame t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (if pre-display-buffer-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (funcall pre-display-buffer-function main-buffer nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ((setq window (get-buffer-window main-buffer t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (cond (window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (setq hacked-frame t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (select-frame (window-frame window))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (let ((pre-display-buffer-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (if hacked-frame nil pre-display-buffer-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (energize-show-all-buffers buffer-extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;; ;; kludge!! Select the debugger frame, not the sources frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;; (if (and (null energize-split-screens-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;; pre-display-buffer-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ;; (funcall pre-display-buffer-function main-buffer nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ;;; this is the guts of energize-make-many-buffers-visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ;;; `arg' is really two args: `buffer-extent-list' and `go-there'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ;;; go-there is specified by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;;; Given a list of buffer/extent pairs, make them all visible at once
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ;;; (presumably in the same frame?)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ;;; If `go-there'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;;; - call energize-make-buffers-visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;;; else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;;; - dedicate the selected window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;;; - call energize-make-buffers-visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;;; - re-select and undedicate the original selected window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (defun energize-make-many-buffers-visible-function (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (let ((buffer-extent-list (car arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (go-there (cdr arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ;; enqueue an history record if we're going to move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (if go-there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (energize-history-enqueue))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (setq buffer-extent-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (energize-prune-killed-buffers-from-list buffer-extent-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (if buffer-extent-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (if go-there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (energize-make-buffers-visible buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (let ((window (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (set-window-buffer-dedicated window (window-buffer window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (energize-make-buffers-visible buffer-extent-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (set-window-buffer-dedicated window ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (select-window window)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (defvar energize-make-many-buffers-visible-should-enqueue-event t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 "Special variable bound by energize-execute-command to allow the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 buffers to be selected while the command is executed")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ;;; called by by editorside.c:MakeBufferAndExtentVisible().
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;;; should-enqueue is bound by `energize-execute-command'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (defun energize-make-many-buffers-visible (buffer-extent-list go-there)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 "First arg is a list of buffers and extents. All those should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 made visible at the same time. If the second argument is T then point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 should be moved to the first character of the extent of the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 buffer, or to the buffer if no extent is specified for this buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 If second argument is NIL point should not change."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (if energize-make-many-buffers-visible-should-enqueue-event
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 ;; don't do it from process filters, but wait until we come back to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 ;; top-level. Using go-there should still be done sparingly, as we can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 ;; surprise the user and grab their keystrokes into another buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (enqueue-eval-event 'energize-make-many-buffers-visible-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (cons buffer-extent-list go-there))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ;; go-there is always true when called from energize-execute-command,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ;; I guess under the assumption that it's always ok to select a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ;; when we're doing something in direct response to a menu selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (energize-make-many-buffers-visible-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (cons buffer-extent-list t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 ;;; This deales with the energize history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (defvar energize-navigation-history '(nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 "List of places where Energize took you to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 It is a list of (file-name/buffer-name . position)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (defvar energize-history-maximum-length 20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 "Maximum number of locations kept in the energize history")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (defvar energize-navigation-current ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 "Current pointer into the energize-navigation-history")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (defvar energize-navigation-current-length 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (defun energize-history-enqueue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 "Memorize the current place in the history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 Trim the history if need be."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (let ((new-item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (cons (or buffer-file-truename (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (1+ (count-lines 1 (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (if (not (equal new-item (car energize-navigation-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (setq energize-navigation-history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (cons new-item energize-navigation-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (setq energize-navigation-current-length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (1+ energize-navigation-current-length))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (> energize-navigation-current-length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (* 2 energize-history-maximum-length))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (let ((tail (nthcdr energize-history-maximum-length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 energize-navigation-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (rplacd tail nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (setq energize-navigation-current-length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 energize-history-maximum-length)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (defun energize-history-dequeue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 "Forget the current place in the history"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (setq energize-navigation-history (cdr energize-navigation-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (defun energize-history-go-back (item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 "Go back to the place memorized by item"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (let ((buffer-or-file (car item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (position (cdr item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (buffer ()))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (cond ((bufferp buffer-or-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (setq buffer buffer-or-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 ((stringp buffer-or-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (setq buffer (or (get-file-buffer buffer-or-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (find-file-noselect buffer-or-file)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (if (null (buffer-name buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (pop-to-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (goto-line position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (defun energize-history-previous ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 "Go back in the history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 If the last command was the same go back more"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (if (not (eq last-command 'energize-history-previous))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (setq energize-navigation-current energize-navigation-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (energize-history-enqueue)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (while (and (car energize-navigation-current)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (energize-history-go-back (car energize-navigation-current))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (rplaca energize-navigation-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (car (cdr energize-navigation-current)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (rplacd energize-navigation-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (cdr (cdr energize-navigation-current))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (if (null (car energize-navigation-current))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (energize-history-dequeue)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (setq last-command 'beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (error "You reached the beginning of the Energize history"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (setq energize-navigation-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (cdr energize-navigation-current))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (define-key global-map '(shift f14) 'energize-history-previous)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (defun energize-history ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 "Show the energize history in the energize history buffer"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (pop-to-buffer "*Energize History*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (mapcar (function (lambda (item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (if item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (insert (format "%s" (car item)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (indent-to-column 32 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (insert (format "%s\n" (cdr item)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 energize-navigation-history)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (energize-history-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (defun energize-history-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 "Turn on energize history mode"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 )