Discussion:
gnus-eval-in-buffer-window fails
James Cloos
2015-03-03 18:51:51 UTC
Permalink
The function I use to re-classify main as spam looks like:

(defun jimc-gnus-report-spam (n)
"Submit spam, then mark it as expirable."
(interactive "p")
(gnus-eval-in-buffer-window gnus-original-article-buffer
(save-restriction
(widen)
(call-process-region (point-min) (point-max) "/usr/local/bin/re-classify" nil 0 nil "--user" "cloos" "--class=spam" "--source=error")))
(gnus-summary-mark-as-expirable 1))

But that no longer works since I switched to a larger monitor.

I use gnus with the typical *Summary* and *Article* buffers visible.
Now, gnus-eval-in-buffer-window splits the lower pane horizontally,
leavin *Summary*, *Article* and the original buffer visible but does
not operate on the (gnus-original-article-buffer) buffer. The call
to (call-process-region) never occurs.

I just tested in a narrow frame (by way of C-x 5 2); there it works.

Is this fixable in my code? Something other that (gnus-eval-in-buffer-window)?

Or is this a bug in emacs (master) itself?

-JimC
--
James Cloos <***@jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6
Katsumi Yamaoka
2015-03-04 04:56:57 UTC
Permalink
Post by James Cloos
(defun jimc-gnus-report-spam (n)
"Submit spam, then mark it as expirable."
(interactive "p")
(gnus-eval-in-buffer-window gnus-original-article-buffer
(save-restriction
(widen)
(call-process-region (point-min) (point-max) "/usr/local/bin/re-classify" nil 0 nil "--user" "cloos" "--class=spam" "--source=error")))
(gnus-summary-mark-as-expirable 1))
But that no longer works since I switched to a larger monitor.
I couldn't reproduce this in a 1920x1080 monitor. I ran:

form1:
(gnus-eval-in-buffer-window gnus-original-article-buffer (buffer-name))

It pops up the `gnus-original-article-buffer' and returns its name.
Since `gnus-original-article-buffer' is normally invisible,
`gnus-eval-in-buffer-window' should use `pop-to-buffer' to visit
the buffer. I doubt your version of `pop-to-buffer' does something
different; for a certain condition it displays the buffer but does
not visit the buffer, for example.

[...]
Post by James Cloos
Something other that (gnus-eval-in-buffer-window)?
Is displaying the original article buffer necessary? If no, how
about simply using `with-current-buffer' instead?
Post by James Cloos
Or is this a bug in emacs (master) itself?
If the form1 doesn't work with emacs -Q, it may be.
James Cloos
2015-03-04 19:22:44 UTC
Permalink
KY> I couldn't reproduce this in a 1920x1080 monitor. I ran:

With my font size (which fits 193 characters wide when the frame is
maximized), it was only when I upgraded from 1920x1080 to 2560x1440
that this started.

With an emacs frame 2560 pixels wide (including the wm overhead) the
*Article* window is no longer replaced.

KY> Is displaying the original article buffer necessary? If no, how
KY> about simply using `with-current-buffer' instead?

Yes, I need to:

(call-process-region (point-min) (point-max) ...)

KY> If the form1 doesn't work with emacs -Q, it may be.

I cannot test gnus with -Q, way too much depends on the init files.

With a 1080p monitor one'd need to use a tiny font. Unless the split
horizontally logic is pixel- rather than character-based?

-JimC
--
James Cloos <***@jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6
Loading...