Mercurial > emacs
comparison lisp/emacs-lisp/ewoc.el @ 76805:baac37af5483
(ewoc--insert-new-node): Take additional arg DLL.
Use it, passed in explicitly, instead of from the dynamic binding.
(ewoc-create, ewoc-enter-before): Update to use new call sequence.
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Fri, 30 Mar 2007 16:11:04 +0000 |
parents | 7a3f13e2dd57 |
children | 935157c0b596 4ef881a120fe |
comparison
equal
deleted
inserted
replaced
76804:2e059045b3c3 | 76805:baac37af5483 |
---|---|
189 (progn | 189 (progn |
190 (set-marker m end) | 190 (set-marker m end) |
191 (not (eq dll node)))) | 191 (not (eq dll node)))) |
192 (setq node (ewoc--node-right node)))))) | 192 (setq node (ewoc--node-right node)))))) |
193 | 193 |
194 (defun ewoc--insert-new-node (node data pretty-printer) | 194 (defun ewoc--insert-new-node (node data pretty-printer dll) |
195 "Insert before NODE a new node for DATA, displayed by PRETTY-PRINTER. | 195 "Insert before NODE a new node for DATA, displayed by PRETTY-PRINTER. |
196 Fourth arg DLL -- from `(ewoc--dll EWOC)' -- is for internal purposes. | |
196 Call PRETTY-PRINTER with point at NODE's start, thus pushing back | 197 Call PRETTY-PRINTER with point at NODE's start, thus pushing back |
197 NODE and leaving the new node's start there. Return the new node." | 198 NODE and leaving the new node's start there. Return the new node." |
198 (save-excursion | 199 (save-excursion |
199 (let ((elemnode (ewoc--node-create | 200 (let ((elemnode (ewoc--node-create |
200 (copy-marker (ewoc--node-start-marker node)) data))) | 201 (copy-marker (ewoc--node-start-marker node)) data))) |
260 (ewoc--set-buffer-bind-dll new-ewoc | 261 (ewoc--set-buffer-bind-dll new-ewoc |
261 ;; Set default values | 262 ;; Set default values |
262 (unless header (setq header "")) | 263 (unless header (setq header "")) |
263 (unless footer (setq footer "")) | 264 (unless footer (setq footer "")) |
264 (setf (ewoc--node-start-marker dll) (copy-marker pos) | 265 (setf (ewoc--node-start-marker dll) (copy-marker pos) |
265 foot (ewoc--insert-new-node dll footer hf-pp) | 266 foot (ewoc--insert-new-node dll footer hf-pp dll) |
266 head (ewoc--insert-new-node foot header hf-pp) | 267 head (ewoc--insert-new-node foot header hf-pp dll) |
267 (ewoc--hf-pp new-ewoc) hf-pp | 268 (ewoc--hf-pp new-ewoc) hf-pp |
268 (ewoc--footer new-ewoc) foot | 269 (ewoc--footer new-ewoc) foot |
269 (ewoc--header new-ewoc) head)) | 270 (ewoc--header new-ewoc) head)) |
270 ;; Return the ewoc | 271 ;; Return the ewoc |
271 new-ewoc)) | 272 new-ewoc)) |
299 | 300 |
300 (defun ewoc-enter-before (ewoc node data) | 301 (defun ewoc-enter-before (ewoc node data) |
301 "Enter a new element DATA before NODE in EWOC. | 302 "Enter a new element DATA before NODE in EWOC. |
302 Return the new node." | 303 Return the new node." |
303 (ewoc--set-buffer-bind-dll ewoc | 304 (ewoc--set-buffer-bind-dll ewoc |
304 (ewoc--insert-new-node node data (ewoc--pretty-printer ewoc)))) | 305 (ewoc--insert-new-node node data (ewoc--pretty-printer ewoc) dll))) |
305 | 306 |
306 (defun ewoc-next (ewoc node) | 307 (defun ewoc-next (ewoc node) |
307 "Return the node in EWOC that follows NODE. | 308 "Return the node in EWOC that follows NODE. |
308 Return nil if NODE is nil or the last element." | 309 Return nil if NODE is nil or the last element." |
309 (when node | 310 (when node |