diff options
| author | Nick Roberts | 2005-10-10 12:26:05 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-10-10 12:26:05 +0000 |
| commit | 974be7ce983b4f14f24bbcf4bb0a55b0e2e85e54 (patch) | |
| tree | bf1d73f75d82aec3796ab150ecb6cfb7ca726aaa | |
| parent | c35d8f463cf82e22b1ef82e79555e4f00e4d028b (diff) | |
| download | emacs-974be7ce983b4f14f24bbcf4bb0a55b0e2e85e54.tar.gz emacs-974be7ce983b4f14f24bbcf4bb0a55b0e2e85e54.zip | |
(gdba): Improve diagram.
(def-gdb-auto-update-handler, gdb-info-locals-handler)
(gdb-put-breakpoint-icon, gdb-remove-breakpoint-icons): Call
get-buffer-window once.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index fe05119d2cd..852cd8deb88 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -173,28 +173,28 @@ See Info node `(emacs)GDB Graphical Interface' for a more | |||
| 173 | detailed description of this mode. | 173 | detailed description of this mode. |
| 174 | 174 | ||
| 175 | 175 | ||
| 176 | --------------------------------------------------------------------- | 176 | +--------------------------------------------------------------+ |
| 177 | GDB Toolbar | 177 | | GDB Toolbar | |
| 178 | --------------------------------------------------------------------- | 178 | +-------------------------------+------------------------------+ |
| 179 | GUD buffer (I/O of GDB) | Locals buffer | 179 | | GUD buffer (I/O of GDB) | Locals buffer | |
| 180 | | | 180 | | | | |
| 181 | | | 181 | | | | |
| 182 | | | 182 | | | | |
| 183 | --------------------------------------------------------------------- | 183 | +-------------------------------+------------------------------+ |
| 184 | Source buffer | Input/Output (of inferior) buffer | 184 | | Source buffer | I/O buffer (of inferior) | |
| 185 | | (comint-mode) | 185 | | | (comint-mode) | |
| 186 | | | 186 | | | | |
| 187 | | | 187 | | | | |
| 188 | | | 188 | | | | |
| 189 | | | 189 | | | | |
| 190 | | | 190 | | | | |
| 191 | | | 191 | | | | |
| 192 | --------------------------------------------------------------------- | 192 | +-------------------------------+------------------------------+ |
| 193 | Stack buffer | Breakpoints buffer | 193 | | Stack buffer | Breakpoints buffer | |
| 194 | RET gdb-frames-select | SPC gdb-toggle-breakpoint | 194 | | RET gdb-frames-select | SPC gdb-toggle-breakpoint | |
| 195 | | RET gdb-goto-breakpoint | 195 | | | RET gdb-goto-breakpoint | |
| 196 | | d gdb-delete-breakpoint | 196 | | | d gdb-delete-breakpoint | |
| 197 | ---------------------------------------------------------------------" | 197 | +-------------------------------+------------------------------+" |
| 198 | ;; | 198 | ;; |
| 199 | (interactive (list (gud-query-cmdline 'gdba))) | 199 | (interactive (list (gud-query-cmdline 'gdba))) |
| 200 | ;; | 200 | ;; |
| @@ -1192,12 +1192,13 @@ happens to be appropriate." | |||
| 1192 | (let ((buf (gdb-get-buffer ',buf-key))) | 1192 | (let ((buf (gdb-get-buffer ',buf-key))) |
| 1193 | (and buf | 1193 | (and buf |
| 1194 | (with-current-buffer buf | 1194 | (with-current-buffer buf |
| 1195 | (let ((p (window-point (get-buffer-window buf 0))) | 1195 | (let* ((window (get-buffer-window buf 0)) |
| 1196 | (p (window-point window)) | ||
| 1196 | (buffer-read-only nil)) | 1197 | (buffer-read-only nil)) |
| 1197 | (erase-buffer) | 1198 | (erase-buffer) |
| 1198 | (insert-buffer-substring (gdb-get-create-buffer | 1199 | (insert-buffer-substring (gdb-get-create-buffer |
| 1199 | 'gdb-partial-output-buffer)) | 1200 | 'gdb-partial-output-buffer)) |
| 1200 | (set-window-point (get-buffer-window buf 0) p))))) | 1201 | (set-window-point window p))))) |
| 1201 | ;; put customisation here | 1202 | ;; put customisation here |
| 1202 | (,custom-defun))) | 1203 | (,custom-defun))) |
| 1203 | 1204 | ||
| @@ -2125,13 +2126,15 @@ corresponding to the mode line clicked." | |||
| 2125 | (while (re-search-forward "\\s-*{.*\n" nil t) | 2126 | (while (re-search-forward "\\s-*{.*\n" nil t) |
| 2126 | (replace-match " (array);\n" nil nil)))) | 2127 | (replace-match " (array);\n" nil nil)))) |
| 2127 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) | 2128 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) |
| 2128 | (and buf (with-current-buffer buf | 2129 | (and buf |
| 2129 | (let ((p (window-point (get-buffer-window buf 0))) | 2130 | (with-current-buffer buf |
| 2131 | (let* ((window (get-buffer-window buf 0)) | ||
| 2132 | (p (window-point window)) | ||
| 2130 | (buffer-read-only nil)) | 2133 | (buffer-read-only nil)) |
| 2131 | (erase-buffer) | 2134 | (erase-buffer) |
| 2132 | (insert-buffer-substring (gdb-get-create-buffer | 2135 | (insert-buffer-substring (gdb-get-create-buffer |
| 2133 | 'gdb-partial-output-buffer)) | 2136 | 'gdb-partial-output-buffer)) |
| 2134 | (set-window-point (get-buffer-window buf 0) p))))) | 2137 | (set-window-point window p))))) |
| 2135 | (run-hooks 'gdb-info-locals-hook)) | 2138 | (run-hooks 'gdb-info-locals-hook)) |
| 2136 | 2139 | ||
| 2137 | (defun gdb-info-locals-custom () | 2140 | (defun gdb-info-locals-custom () |
| @@ -2528,10 +2531,10 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2528 | (when (< left-margin-width 2) | 2531 | (when (< left-margin-width 2) |
| 2529 | (save-current-buffer | 2532 | (save-current-buffer |
| 2530 | (setq left-margin-width 2) | 2533 | (setq left-margin-width 2) |
| 2531 | (if (get-buffer-window (current-buffer) 0) | 2534 | (let ((window (get-buffer-window (current-buffer) 0))) |
| 2535 | (if window | ||
| 2532 | (set-window-margins | 2536 | (set-window-margins |
| 2533 | (get-buffer-window (current-buffer) 0) | 2537 | window left-margin-width right-margin-width))))) |
| 2534 | left-margin-width right-margin-width)))) | ||
| 2535 | (gdb-put-string | 2538 | (gdb-put-string |
| 2536 | (propertize putstring | 2539 | (propertize putstring |
| 2537 | 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled)) | 2540 | 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled)) |
| @@ -2543,10 +2546,10 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2543 | (remove-images start end)) | 2546 | (remove-images start end)) |
| 2544 | (when remove-margin | 2547 | (when remove-margin |
| 2545 | (setq left-margin-width 0) | 2548 | (setq left-margin-width 0) |
| 2546 | (if (get-buffer-window (current-buffer) 0) | 2549 | (let ((window (get-buffer-window (current-buffer) 0))) |
| 2547 | (set-window-margins | 2550 | (if window |
| 2548 | (get-buffer-window (current-buffer) 0) | 2551 | (set-window-margins |
| 2549 | left-margin-width right-margin-width)))) | 2552 | window left-margin-width right-margin-width))))) |
| 2550 | 2553 | ||
| 2551 | 2554 | ||
| 2552 | ;; | 2555 | ;; |