[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Toolbar problems with GDB mode.
From: |
Nick Roberts |
Subject: |
Re: Toolbar problems with GDB mode. |
Date: |
Tue, 7 Jan 2003 23:21:05 +0000 |
Kevin Rodgers writes:
> > Please don't simply kill the buffer. Always type gdb-quit before starting
> > a new session. I'm writing documentation to say things like that and I
> > will try to make it more robust with time.
> Could you install a local kill-buffer-hook to handle that for users like Jan?
Yes. I think this works best. I was trying to put it in gud-sentinel which is
called every time the process state changes. However, this is after the GUD
buffer is killed which makes it difficult to distinguish between gdb and gdba.
kill-buffer-hook won't work if the user types quit in the GUD buffer but this
probably doesn't matter as quit doesn't make much sense here and just leaves a
dead buffer lying around.
How about:
(defun gud-kill-buffer-hook ()
(if (eq (current-buffer) gud-comint-buffer)
(cond ((eq gud-minor-mode 'gdba)
(gdb-delete-frames '())
(dolist (buffer (buffer-list))
(if (not (eq buffer gud-comint-buffer))
(save-excursion
(set-buffer buffer)
(if (eq gud-minor-mode 'gdba)
(if (string-match "^\*.+*$" (buffer-name))
(kill-buffer nil)
(if (display-graphic-p)
(remove-images (point-min) (point-max))
(remove-strings (point-min) (point-max)))
(setq left-margin-width 0)
(setq gud-minor-mode nil)
(kill-local-variable 'tool-bar-map)
(setq gud-running nil)
(if (get-buffer-window (current-buffer))
(set-window-margins (get-buffer-window
(current-buffer))
left-margin-width
right-margin-width))))))))
(t (dolist (buffer (buffer-list))
(if (not (eq buffer gud-comint-buffer))
(save-excursion
(set-buffer buffer)
(when gud-minor-mode
(setq gud-minor-mode nil)
(kill-local-variable 'tool-bar-map)))))))))
(add-hook 'kill-buffer-hook 'gud-kill-buffer-hook)
- Toolbar problems with GDB mode., Jan D., 2003/01/03
- Toolbar problems with GDB mode., Nick Roberts, 2003/01/03
- Re: Toolbar problems with GDB mode., Jan D., 2003/01/03
- Re: Toolbar problems with GDB mode., Nick Roberts, 2003/01/03
- Re: Toolbar problems with GDB mode., Jan D., 2003/01/04
- Re: Toolbar problems with GDB mode., Nick Roberts, 2003/01/04
- Re: Toolbar problems with GDB mode., Jan D., 2003/01/04
- Re: Toolbar problems with GDB mode., Kevin Rodgers, 2003/01/07
- Re: Toolbar problems with GDB mode.,
Nick Roberts <=
- Re: Toolbar problems with GDB mode., Jan D., 2003/01/10
- Re: Toolbar problems with GDB mode., Nick Roberts, 2003/01/10
- Re: Toolbar problems with GDB mode., Richard Stallman, 2003/01/04
- Re: Toolbar problems with GDB mode., Nick Roberts, 2003/01/05
- Re: Toolbar problems with GDB mode., Stefan Monnier, 2003/01/11
- Re: Toolbar problems with GDB mode., Nick Roberts, 2003/01/11
- Re: Toolbar problems with GDB mode., Stefan Monnier, 2003/01/12
Re: Toolbar problems with GDB mode., Eli Zaretskii, 2003/01/04