Subject: bug#55260: closed (Re: bug#55260: [PATCH] Avoid resizing mini buffer when displaying page numbers)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 05 May 2022 11:16:02 +0000

Your bug report

#55260: [PATCH] Avoid resizing mini buffer when displaying page numbers

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55260: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55260
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55260: [PATCH] Avoid resizing mini buffer when displaying page numbers
From: Philip Kaludercic <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked]
Date: Thu, 05 May 2022 11:15:46 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Lars Ingebrigtsen <[email-masked]> writes:

> Philip Kaludercic <[email-masked]> writes:
>
>> This patch avoids adding a newline if not necessary, circumventing the
>> issue when possible.
>
> Makes sense to me; go ahead and push.

Done!

Subject: [PATCH] Avoid resizing mini buffer when displaying page numbers
From: Philip Kaludercic <[email-masked]>
To: [email-masked]
Date: Wed, 04 May 2022 12:30:08 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

When viewing a document using doc-view, an idle timer indicates the
current page number after a short while.  Since this message ends with a
newline, the minibuffer is senselessly resized, producing unecessary
visual noise.

This patch avoids adding a newline if not necessary, circumventing the
issue when possible.

In GNU Emacs 29.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2022-04-25 built on viero
Repository revision: 91175a1fae92d521377bde8687d96b17556d1458
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Guix System

Configured using:
 'configure
 PKG_CONFIG_PATH=/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig'

>From e91f9a0767d0b9d749b91b86fa2d9000db8d211c Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
Date: Wed, 4 May 2022 14:24:31 +0200
Subject: [PATCH] Avoid resizing mini buffer when displaying page numbers

* doc-view.el (doc-view-goto-page): Do not insert a newline at the end
of the "current info" if not necessary.
---
 lisp/doc-view.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index e8698fad7e..22570dd510 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -632,17 +632,16 @@ doc-view-goto-page
 	   (propertize
 	    (format "Page %d of %d." page len) 'face 'bold)
 	   ;; Tell user if converting isn't finished yet
-	   (if doc-view--current-converter-processes
-	       " (still converting...)\n"
-	     "\n")
-	   ;; Display context infos if this page matches the last search
-	   (when (and doc-view--current-search-matches
-		      (assq page doc-view--current-search-matches))
-	     (concat (propertize "Search matches:\n" 'face 'bold)
+           (and doc-view--current-converter-processes
+                " (still converting...)")
+           ;; Display context infos if this page matches the last search
+           (when (and doc-view--current-search-matches
+                      (assq page doc-view--current-search-matches))
+             (concat "\n" (propertize "Search matches:" 'face 'bold)
 		     (let ((contexts ""))
 		       (dolist (m (cdr (assq page
 					     doc-view--current-search-matches)))
-			 (setq contexts (concat contexts "  - \"" m "\"\n")))
+			 (setq contexts (concat contexts "\n  - \"" m "\"")))
 		       contexts)))))
     ;; Update the buffer
     ;; We used to find the file name from doc-view--current-files but
-- 
2.35.1