* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. [not found] ` <20181019175418.27D6920407@vcs0.savannah.gnu.org> @ 2018-10-19 17:58 ` Stefan Monnier 2018-10-19 18:49 ` Alan Mackenzie 0 siblings, 1 reply; 8+ messages in thread From: Stefan Monnier @ 2018-10-19 17:58 UTC (permalink / raw) To: Alan Mackenzie; +Cc: emacs-devel Hi Alan, > (edebug-pop-to-buffer edebug-buffer) > + (edebug-focus-frame (window-frame (selected-window))) [...] > - (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) > + (edebug-pop-to-buffer edebug-buffer (car edebug-window-data)) > + (edebug-focus-frame (window-frame (selected-window)))))) [...] > - (edebug-pop-to-buffer edebug-eval-buffer)) > + (edebug-pop-to-buffer edebug-eval-buffer) > + (edebug-focus-frame (window-frame (selected-window)))) Maybe edebug-pop-to-buffer should call edebug-focus-frame? Stefan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 17:58 ` [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame Stefan Monnier @ 2018-10-19 18:49 ` Alan Mackenzie 2018-10-19 19:07 ` Stefan Monnier 0 siblings, 1 reply; 8+ messages in thread From: Alan Mackenzie @ 2018-10-19 18:49 UTC (permalink / raw) To: Stefan Monnier; +Cc: emacs-devel Hello, Stefan. On Fri, Oct 19, 2018 at 13:58:44 -0400, Stefan Monnier wrote: > Hi Alan, > > (edebug-pop-to-buffer edebug-buffer) > > + (edebug-focus-frame (window-frame (selected-window))) > [...] > > - (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) > > + (edebug-pop-to-buffer edebug-buffer (car edebug-window-data)) > > + (edebug-focus-frame (window-frame (selected-window)))))) > [...] > > - (edebug-pop-to-buffer edebug-eval-buffer)) > > + (edebug-pop-to-buffer edebug-eval-buffer) > > + (edebug-focus-frame (window-frame (selected-window)))) > Maybe edebug-pop-to-buffer should call edebug-focus-frame? I thought about that, but in the end decided that could be a bit heavy for when information is only being displayed, i.e. in edebug-trace-display. Maybe putting the call in e-pop-to-buffer would indeed be better. But I think edebug-trace-display would have then to call edebug-focus-frame explicitly after re-selecting the original window. This bit of the code surely originates from the time before frames were implemented. > Stefan -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 18:49 ` Alan Mackenzie @ 2018-10-19 19:07 ` Stefan Monnier 2018-10-19 19:21 ` Alan Mackenzie 0 siblings, 1 reply; 8+ messages in thread From: Stefan Monnier @ 2018-10-19 19:07 UTC (permalink / raw) To: Alan Mackenzie; +Cc: emacs-devel > I thought about that, but in the end decided that could be a bit heavy > for when information is only being displayed, i.e. in > edebug-trace-display. If the intention is only to display the code shouldn't use pop-to-buffer but display-buffer. > This bit of the code surely originates from the time before frames were > implemented. [ Probably, but since most Emacs users don't actually make use of multiple frames, a lot of code written much more recently also suffers from the same kinds of "outdated" assumptions. ] Stefan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 19:07 ` Stefan Monnier @ 2018-10-19 19:21 ` Alan Mackenzie 2018-10-19 19:39 ` Davis Herring 2018-10-19 21:12 ` Stefan Monnier 0 siblings, 2 replies; 8+ messages in thread From: Alan Mackenzie @ 2018-10-19 19:21 UTC (permalink / raw) To: Stefan Monnier; +Cc: emacs-devel Hello, Stefan. On Fri, Oct 19, 2018 at 15:07:42 -0400, Stefan Monnier wrote: > > I thought about that, but in the end decided that could be a bit heavy > > for when information is only being displayed, i.e. in > > edebug-trace-display. > If the intention is only to display the code shouldn't use pop-to-buffer > but display-buffer. The doc string of display-buffer is a bit of a heavy read at this time of night. ;-) > > This bit of the code surely originates from the time before frames were > > implemented. > [ Probably, but since most Emacs users don't actually make use of multiple > frames, a lot of code written much more recently also suffers from the > same kinds of "outdated" assumptions. ] Most Emacs users restrict themselves to just one frame? Ouch! I couldn't work like that! > Stefan -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 19:21 ` Alan Mackenzie @ 2018-10-19 19:39 ` Davis Herring 2018-10-19 19:50 ` Alan Mackenzie 2018-10-19 21:12 ` Stefan Monnier 1 sibling, 1 reply; 8+ messages in thread From: Davis Herring @ 2018-10-19 19:39 UTC (permalink / raw) To: Alan Mackenzie, Stefan Monnier; +Cc: emacs-devel > Most Emacs users restrict themselves to just one frame? Ouch! I > couldn't work like that! I don't pretend to know the general statistics, but my Emacs sessions (not counting the occasional short-lived instance) typically have two or three frames, but no more. In a windowed Emacs, I find it counterproductive to have more than will (along with terminals and so forth) tile the screen, since they tend to fight over buffers and I have to go hunting. In a terminal, I'm instead limited by how many window configurations I can keep in my head (but it's about the same number). Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 19:39 ` Davis Herring @ 2018-10-19 19:50 ` Alan Mackenzie 0 siblings, 0 replies; 8+ messages in thread From: Alan Mackenzie @ 2018-10-19 19:50 UTC (permalink / raw) To: Davis Herring; +Cc: Stefan Monnier, emacs-devel Hello, Davis. On Fri, Oct 19, 2018 at 13:39:09 -0600, Davis Herring wrote: > > Most Emacs users restrict themselves to just one frame? Ouch! I > > couldn't work like that! > I don't pretend to know the general statistics, but my Emacs sessions > (not counting the occasional short-lived instance) typically have two > or three frames, but no more. In a windowed Emacs, I find it > counterproductive to have more than will (along with terminals and so > forth) tile the screen, since they tend to fight over buffers and I > have to go hunting. In a terminal, I'm instead limited by how many > window configurations I can keep in my head (but it's about the same > number). I tend frequently to go up to 8 or 9 frames on a tty, with one "big" file (such as cc-engine.el) in follow-mode per frame, or two or three "small" buffers (such as test files, *Help*, *Occur*) in other frames. I have no trouble maintaining a mental map of what's where, and I use the function keys F1 - F11 to switch instantly to any frame F1 - F11. When I need to work in a GUI, I tend to have fewer frames, each one occupying almost the entire screen area, and still switching between them with the function keys. > Davis > -- > This product is sold by volume, not by mass. If it appears too dense or > too sparse, it is because mass-energy conversion has occurred during > shipping. -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 19:21 ` Alan Mackenzie 2018-10-19 19:39 ` Davis Herring @ 2018-10-19 21:12 ` Stefan Monnier 2018-10-20 9:41 ` Alan Mackenzie 1 sibling, 1 reply; 8+ messages in thread From: Stefan Monnier @ 2018-10-19 21:12 UTC (permalink / raw) To: Alan Mackenzie; +Cc: emacs-devel >> If the intention is only to display the code shouldn't use pop-to-buffer >> but display-buffer. > The doc string of display-buffer is a bit of a heavy read at this time > of night. ;-) pop-to-buffer is no simpler: it's basically the same as (select-window (display-buffer BUF)). BTW, pop-to-buffer already calls `select-frame-set-input-focus`. And I see that edebug-pop-to-buffer doesn't call pop-to-buffer, and that it comes with: ;; FIXME: We should probably just be using `pop-to-buffer'. So maybe the better path is indeed to scratch edebug-pop-to-buffer and use pop-to-buffer instead (or more likely, to change edebug-pop-to-buffer so that it uses pop-to-buffer internally). > Most Emacs users restrict themselves to just one frame? Ouch! I > couldn't work like that! At least, that's the conclusion I draw from years of fighting code using save-window-excursion and such. Stefan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame. 2018-10-19 21:12 ` Stefan Monnier @ 2018-10-20 9:41 ` Alan Mackenzie 0 siblings, 0 replies; 8+ messages in thread From: Alan Mackenzie @ 2018-10-20 9:41 UTC (permalink / raw) To: Stefan Monnier; +Cc: emacs-devel Hello, Stefan. On Fri, Oct 19, 2018 at 17:12:38 -0400, Stefan Monnier wrote: > >> If the intention is only to display the code shouldn't use pop-to-buffer > >> but display-buffer. > > The doc string of display-buffer is a bit of a heavy read at this time > > of night. ;-) > pop-to-buffer is no simpler: it's basically the same as (select-window > (display-buffer BUF)). > BTW, pop-to-buffer already calls `select-frame-set-input-focus`. > And I see that edebug-pop-to-buffer doesn't call pop-to-buffer, and that > it comes with: > ;; FIXME: We should probably just be using `pop-to-buffer'. > So maybe the better path is indeed to scratch edebug-pop-to-buffer and > use pop-to-buffer instead (or more likely, to change > edebug-pop-to-buffer so that it uses pop-to-buffer internally). I've thought about this overnight. And I think the answer is no, it would not be better to use pop-to-buffer. At least, not if an ACTION argument needs to be constructed. The specification of the ACTION argument seems so arcane, so implicit, so difficult to use, that it will be simpler just to write a function such as edebug-pop-to-buffer. edebug-pop-to-buffer will also be much easier to understand and maintain than an equivalent using pop-to-buffer with an ACTION. In short, pop-to-buffer and display-buffer with ACTION seem to be "pyrrhic functions". At least, that's how I see it from reading the doc, not having yet tried to use them. Also, edebug-pop-to-buffer already exists and works. There are around 479 calls to these two functions in the Emacs source. A quick eyeballing of the grep results found just one single use of ACTION, in replace.el. I dare say there are more, but very few altogether. > Stefan -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-10-20 9:41 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20181019175416.10874.88992@vcs0.savannah.gnu.org> [not found] ` <20181019175418.27D6920407@vcs0.savannah.gnu.org> 2018-10-19 17:58 ` [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame Stefan Monnier 2018-10-19 18:49 ` Alan Mackenzie 2018-10-19 19:07 ` Stefan Monnier 2018-10-19 19:21 ` Alan Mackenzie 2018-10-19 19:39 ` Davis Herring 2018-10-19 19:50 ` Alan Mackenzie 2018-10-19 21:12 ` Stefan Monnier 2018-10-20 9:41 ` Alan Mackenzie
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.