bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43295: 26.1: calc-mode header line [UPDATED PATCH]


From: Boruch Baum
Subject: bug#43295: 26.1: calc-mode header line [UPDATED PATCH]
Date: Thu, 10 Sep 2020 19:40:59 -0400
User-agent: NeoMutt/20180716

On 2020-09-10 23:45, Lars Ingebrigtsen wrote:
> Thanks; I applied it to Emacs 28, but it needed some changes because it
> didn't apply cleanly (and it didn't set the header in the main calc
> buffer?)  But it looks like it works now, at least, but you should
> perhaps take a look at the result and see whether it looks like you
> imagined...

I see a few things. Here are some comments, with reference to a new
patch, attached, which is a diff based upon the savannah-git (my
calc28.el).

1) I notice that I had forgotten to remove two lines of coding notes to
   myself @lines ~1395. They can be removed.

2) You removed two lines I had @lines ~1428, and copied a modified
   version of them to @lines ~2008. I think the absence of the two lines
   ~1428 may be cause the problem that you mentioned.

3) I see an additional problem with your modification to the patch that
   you'll notice upon starting calc with a very narrow window. Your line
   ~2009 reads

                        (* 2 (/ (window-width) 3)) -3))

   which is code for the trail buffer, but it should be for the main
   buffer, like in my line ~1429

+                       (/ (* (window-width) 2) 3) 1)

3) If you modify ~2009, then that snippet might be redundant together
   with my snippet ~1428, but it shouldn't do any harm (but remove the
   comment line 'Added by Lars?').

4) You also did something that I welcome, but that was done at Eli
   Zaretskii's insistence, so you may want to co-ordinate with him about
   it. My very original patch looked like your final result @line ~1419,
   but Eli on-list insisted that was wrong on the basis of 'breaking backward
   compatibility', because in the old behavior, the trail buffer always
   had a title line inside the buffer even when calc-show-banner was
   NIL. My position was that's a bug. That part should really read (modifed
   from my original):

  (if calc-show-banner
    (calc--header-line "Emacs Calculator Trail" "Calc Trail"
                       (/ (window-width) 3) -3)
   (when (zerop (buffer-size))
     (let ((buffer-read-only nil))
       (insert (propertize "Emacs Calculator Trail\n" 'face 'italic))))))


--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

Attachment: calc28.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]