unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: 55260@debbugs.gnu.org
Subject: bug#55260: [PATCH] Avoid resizing mini buffer when displaying page numbers
Date: Wed, 04 May 2022 12:30:08 +0000	[thread overview]
Message-ID: <874k25tr8v.fsf@posteo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Avoid-resizing-mini-buffer-when-displaying-page-numb.patch --]
[-- Type: text/patch, Size: 1781 bytes --]

From e91f9a0767d0b9d749b91b86fa2d9000db8d211c Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
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


             reply	other threads:[~2022-05-04 12:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 12:30 Philip Kaludercic [this message]
2022-05-05 11:13 ` bug#55260: [PATCH] Avoid resizing mini buffer when displaying page numbers Lars Ingebrigtsen
2022-05-05 11:15   ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k25tr8v.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=55260@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).