Re: Increase text size of the minibuffer

Jean Louis <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <acZdx0J6grLGXyBF@false>
* Heime <[email protected]> [2026-03-24 05:17]:
> How can I increase the size of text in the minibuffer, because I am 
> finding it too small for me.

Me too, though I have made it this way:

(defcustom rcd-minibuffer-text-scale-adjust 1.5
  "The RCD Notes text scale adjustment for minibuffer."
  :group 'rcd
  :type 'number)

(defun rcd-minibuffer-text-scale-adjust ()
  "Adjust text scale."
  (text-scale-increase rcd-minibuffer-text-scale-adjust))

This Emacs Lisp code defines a custom variable and function to
permanently increase the text size by a factor of 1.5 when editing
within the minibuffer (pop-up input line).

Then I am using it this way:

(defun rcd-ask (&optional prompt initial-input default-value auto-initial-input)
  "Modified function `read-string'.

This is shorter, simpler function that generates the prompt
automatically, generates history variable automatically and
inherits the input method. The input will be returned trimmed."
  (let* ((prompt (or prompt "Input data: "))
	 (history (rcd-ask-history-variable prompt))
	 (initial-input (cond (auto-initial-input (car (symbol-value history)))
			(initial-input initial-input)))
	 (input (minibuffer-with-setup-hook 'rcd-minibuffer-text-scale-adjust (read-string prompt initial-input history default-value t)))
	 (input (string-trim input)))
    input))

Here is the simplest example of how to use `minibuffer-with-setup-hook` with `read-string`:

(defun example-with-scale-adjust ()
  "Example showing minibuffer text scale adjustment."
  (interactive)
  (let ((input (minibuffer-with-setup-hook 
                 'example-scale-adjust 
                 (read-string "Enter text: " "default" nil t))))
    input))

(defun example-scale-adjust ()
  "Adjust text scale in this minibuffer."
  (text-scale-increase 3))

Run this command to see:
(example-with-scale-adjust)

Key points:

- `minibuffer-with-setup-hook` takes two arguments:

  1. A function to call when the minibuffer is set up (your hook function)
  2. The actual call to `read-string` (wrapped in a function call)

- The hook function runs once when the minibuffer opens
- The hook runs before `read-string` is called, so it affects the initial display

Minimal version (just your use case):

(defun rcd-ask ()
  (let ((input (minibuffer-with-setup-hook 
                 'rcd-minibuffer-text-scale-adjust 
                 (read-string "Input data: " "default" nil t))))
    (string-trim input)))

This is all you need - the hook adjusts text scale every time you use
this function, and your `rcd-minibuffer-text-scale-adjust` function
runs in that hook context.

Or this way:

(defun rcd-ask ()
  "Ask with scaled minibuffer text."
  (let ((input (minibuffer-with-setup-hook 
                 (lambda () (text-scale-increase 5))
                 (read-string "Input data: " nil nil t))))
    (string-trim input)))

(rcd-ask) then shows large minibuffer text.

-- 
Jean Louis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.