[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] find-file-noselect-1
From: |
Nick Roberts |
Subject: |
Re: [PATCH] find-file-noselect-1 |
Date: |
Sat, 12 Feb 2005 23:30:36 +1300 |
> I suggest you change the progn to condition-case so as to catch any
> errors that happen in gdb-enqueue-input. And if it does ever catch an
> error, it could set gud-comint-buffer to nil so it won't do anything
> on future calls to find-file. That should make it safe.
(defun gdb-find-file-hook ()
(if (and (boundp 'gud-comint-buffer)
;; in case gud or gdb-ui is just loaded.
gud-comint-buffer
(buffer-name gud-comint-buffer)
(with-current-buffer gud-comint-buffer
(eq gud-minor-mode 'gdba)))
(condition-case nil
(gdb-enqueue-input
(list (concat "list " (file-name-nondirectory buffer-file-name)
":1\n")
`(lambda () (gdb-set-gud-minor-mode ,buffer-file-name)))))
(error nil)))
Is this what you mean? I don't think that gud-comint-buffer should be set to
nil because that would prevent the GDB session from recovering.
>
> + (defun gdb-set-gud-minor-mode (file)
> + "Set gud-minor-mode from find-file if appropriate."
> + (goto-char (point-min))
> + (unless (search-forward "No source file named " nil t)
> + (with-current-buffer
> + (find-file-noselect file)
>
> Why call find-file-noselect there? If this is meant to operate on the
> file that was just visited, it already has a buffer, and it is the
> current buffer when gdb-find-file-hook runs. Why not just use
> that buffer?
That might have been true but I'm now using this function to address Kim's
point about enabling gud-minor-mode for existing buffers.
> + (save-current-buffer
>
> What's the reason for that? The contents don't change buffers.
This was just a legacy from earlier code. I've removed it.
Since the changes are all in gdb-ui.el, I feel more comfortable installing
them. However, having asked for people's opinion, I'll wait for some approval
before doing this.
Nick
- [PATCH] find-file-noselect-1, Nick Roberts, 2005/02/10
- Re: [PATCH] find-file-noselect-1, Miles Bader, 2005/02/10
- Re: [PATCH] find-file-noselect-1, Nick Roberts, 2005/02/10
- Re: [PATCH] find-file-noselect-1, Nick Roberts, 2005/02/10
- Re: [PATCH] find-file-noselect-1, Richard Stallman, 2005/02/12
- Re: [PATCH] find-file-noselect-1,
Nick Roberts <=
- Re: [PATCH] find-file-noselect-1, Stefan Monnier, 2005/02/12
- Re: [PATCH] find-file-noselect-1, Nick Roberts, 2005/02/13
- Re: [PATCH] find-file-noselect-1, Stefan Monnier, 2005/02/13
- Re: [PATCH] find-file-noselect-1, Richard Stallman, 2005/02/13
- Re: [PATCH] find-file-noselect-1, Nick Roberts, 2005/02/13
- Re: [PATCH] find-file-noselect-1, Richard Stallman, 2005/02/15
- Re: [PATCH] find-file-noselect-1, Stefan Monnier, 2005/02/10
Re: [PATCH] find-file-noselect-1, Stefan Monnier, 2005/02/10