From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.devel Subject: Re: 26.1: calc-mode header line [PATCH] Date: Sun, 6 Sep 2020 14:45:30 -0400 Message-ID: <20200906184529.srcmx42ircaeueqv@E15-2016.optimum.net> References: <20200831184445.jy4yyfqf3gr5llmk@E15-2016.optimum.net> <83tuwcpv79.fsf@gnu.org> <20200906023516.qreesq6u3mjzwzna@E15-2016.optimum.net> <83sgbvng5l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="jnrgzwfd5ikzydmp" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 06 20:48:33 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEziJ-0001Qp-Oc for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Sep 2020 20:48:31 +0200 Original-Received: from localhost ([::1]:48186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEziI-0001GP-KR for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Sep 2020 14:48:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEzfV-0000dn-9c for emacs-devel@gnu.org; Sun, 06 Sep 2020 14:45:37 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:43611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEzfS-0005Wh-TX; Sun, 06 Sep 2020 14:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599417932; bh=dkuxjKZRRqCZIJcc7PCOeCuxwP2ufZOiGeGTeUL337M=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=IlGxU59jhgWXQEsydev7uBwrWR3oHTeQrqdED7Oa7cYAK9F2WBb8+dEpaUfgXOJJI sC19f7lgpIl+cr2QjcgcO6UQeoB76OG3hqpyy1ifDsxpPXriHkA3GluIxeuO17+0Mx aBxNSYGI8HPYvptC8Cc1SqNhw/wm7e0aHA907jnU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MnaoZ-1kviTx1tO1-00jXfe; Sun, 06 Sep 2020 20:45:32 +0200 Content-Disposition: inline In-Reply-To: <83sgbvng5l.fsf@gnu.org> X-Provags-ID: V03:K1:aWcU/E7tppXaUXwuRQpCyKe1AaXvuW1ZPxiqEWKY6v+tUm0Mgp3 y+z6WzWjRCBXeZdZKZUIHTaPw7YZAtxR9Q5poogx0Gtnkz0NCfdrCxziGHnZXrLY0ftZ/aX uK8p6JJd/YrK4xhdfPe1pMbik+lIQBnVOgecGG5QwM1C1ROExfclYJI7VoHH3MJcuXi2Gzf cb4znu0CkfkX7DIJIBYJw== X-UI-Out-Filterresults: notjunk:1;V03:K0:q/U0B5NPS5Y=:eeRquKZqEpRAFA5p7/EU9Y kO3sRhhh8ha8av/U0UabWpv4IEfxI0KC6Ggrkmc7OwHUH0zkasj+wZE8Cbchrlm8VFXxzKAjt ohs129TDIyzMJliSHVTtRMLV2QlE0F/1D8FErtOZc3V2nzNZ+FISmAFVbWsCcJkqu2FmcqAhv iw2QFDqukrBwTC2HgnLRVZiMn3MeGUr9/YZBTY7j5u8KzIFbysBB7G48lB0REITujLP7oMCC+ ca++n4FpZlX1QEGoYD2mljss4qzHFZA4bm/D3bjU20lMuZODucPS+j3VcJvkAx7cQBzuN6FWX 1aPRltbyt52Wfh62iXyVDXCb/9QKIlhrNm+2TKOEwZ1WVn0gTE/uBoZoj+MbZjKVOq1a4qQoJ cQWTCjZH6Nors6JoM/9x9Wu8raTvGzfxXguQHYWU38SX1Dw45hRPGq70DjpvsLv5TIFRy7AKC xqoEpFT24CDzDLm9uzoYix3O6cOeRYXYxwGLJBQn0Cgax2H0FqRXbMkHkoLturHrLrlcFgmJn REPgtchepSie/GCpaSQ336Br2lBOhoqWQxkAY2Wt8f0wqNi3HygHm38BBdCO5qmkKB/KZFW/a KGThR2DYubsXG0cEES5grmU9/KK+T8V4CK630xluDXlBF2ZW/qTo6HBHhLRGvDB6vDAi+KR0m NE3rgnprIDllsifWl0jVasx2P3+MMxGOtC1cYSDeCoBhz10ECSP+hn4JyMhvQ1kAkymOi79Em rwwsXFcenpQ7xXs6RDksdycOWbPH5ilAzJtU2d5h52GzJkXwa6qdWBm11ohaJ8KzJ3WtXcTX Received-SPF: pass client-ip=212.227.15.15; envelope-from=boruch_baum@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/06 14:45:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254581 Archived-At: --jnrgzwfd5ikzydmp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable New patches attached. On 2020-09-06 17:17, Eli Zaretskii wrote: > ... =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --jnrgzwfd5ikzydmp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="calc.patch" Content-Transfer-Encoding: quoted-printable =2D-- calc.el 2020-08-30 15:03:07.563840474 -0400 +++ calc-new.el 2020-09-06 14:42:10.768154045 -0400 @@ -1410,15 +1410,33 @@ (setq buffer-read-only t) (make-local-variable 'overlay-arrow-position) (make-local-variable 'overlay-arrow-string) - (when (=3D (buffer-size) 0) + (if (and (not calc-show-banner) + (=3D (buffer-size) 0)) (let ((buffer-read-only nil)) - (insert (propertize "Emacs Calculator Trail\n" 'face 'italic))))) + (insert (propertize "Emacs Calculator Trail\n" 'face 'italic))) + (setq header-line-format + (let* ((fract (/ (window-width) 3)) + (factor (if (> fract 19) 22 10)) + (size (/ (- fract factor) 2)) + (fill (make-string size ?-)) + (pre (replace-regexp-in-string ".$" " " fill)) + (post (replace-regexp-in-string "^." " " fill))) + (concat pre (if (=3D factor 22) "Emacs Calculator Trail" "Calc Tra= il") post))))) (defun calc-create-buffer () "Create and initialize a buffer for the Calculator." (set-buffer (get-buffer-create "*Calculator*")) (or (derived-mode-p 'calc-mode) (calc-mode)) + (when calc-show-banner + (setq header-line-format + (let* ((fract (/ (* (window-width) 2) 3)) + (factor (if (> fract 22) 21 10)) + (size (/ (- fract factor) 2)) + (fill (make-string size ?-)) + (pre (replace-regexp-in-string ".$" " " fill)) + (post (replace-regexp-in-string "^." " " fill))) + (concat pre (if (=3D factor 21) "Emacs Calculator Mode" "Emacs Ca= lc") post)))) (setq max-lisp-eval-depth (max max-lisp-eval-depth 1000)) (when calc-always-load-extensions (require 'calc-ext)) @@ -1465,7 +1483,6 @@ (pop-to-buffer (current-buffer))))))) (with-current-buffer (calc-trail-buffer) (and calc-display-trail - (=3D (window-width) (frame-width)) (calc-trail-display 1 t))) (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' fo= r help, `q' to quit") (run-hooks 'calc-start-hook) @@ -2000,13 +2017,8 @@ (calc-any-evaltos nil)) (setq calc-any-selections nil) (erase-buffer) - (when calc-show-banner - (insert (propertize "--- Emacs Calculator Mode ---\n" - 'face 'italic))) (while thing (goto-char (point-min)) - (when calc-show-banner - (forward-line 1)) (insert (math-format-stack-value (car thing)) "\n") (setq thing (cdr thing))) (calc-renumber-stack) @@ -2091,7 +2103,6 @@ (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (with-current-buffer calc-trail-buffer (goto-char (point-min)) - (forward-line 1) (setq calc-trail-pointer (point-marker)))) calc-trail-buffer) @@ -2159,10 +2170,8 @@ (if (derived-mode-p 'calc-trail-mode) (progn (beginning-of-line) - (if (bobp) - (forward-line 1) (if (eobp) - (forward-line -1))) + (forward-line -1)) (if (or (bobp) (eobp)) (setq overlay-arrow-position nil) ; trail is empty (set-marker calc-trail-pointer (point) (current-buffer)) @@ -2176,7 +2185,7 @@ (if win (save-excursion (forward-line (/ (window-height win) 2)) - (forward-line (- 1 (window-height win))) + (forward-line (- 2 (window-height win))) (set-window-start win (point)) (set-window-point win (+ calc-trail-pointer 4)) (set-buffer calc-main-buffer) --jnrgzwfd5ikzydmp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="NEWS.patch" Content-Transfer-Encoding: quoted-printable =2D-- NEWS 2020-09-05 22:28:48.607653342 -0400 +++ NEWS.new 2020-09-06 14:37:38.286349012 -0400 @@ -921,6 +921,14 @@ Likewise, point isn't moved to the end of the string before inserting digits. +--- +*** Buffer headings have been changed. +The *Calc* and *Calc Trail* buffers now use 'header-line-format' to +present a persistent buffer header line, and they are sized based upon +the window width upon launch. The header-line for the *Calc Trail* +buffer is no longer part of the buffer's text and no longer scrolls +off the visible display, unless on sets 'calc-show-banner' to NIL. + ** term-mode --- --jnrgzwfd5ikzydmp--