From fc0a81fd1fac2e8f5b00d667d5f240e8c7adcdab Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 12 Dec 2021 03:31:47 +0100 Subject: [PATCH] Fix minibuffer histoty completion for Emacs-27.2 --- README.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.org b/README.org index a89e2b9..3d9d3d2 100644 --- a/README.org +++ b/README.org @@ -538,6 +538,14 @@ previous input in the minibuffer. (add-hook 'minibuffer-setup-hook 'minibuffer-setup-history-completions) + ;; Stolen from Emacs-28.1 for Emacs-27.2: + (unless (fboundp 'minibuffer--completion-prompt-end) + (defun minibuffer--completion-prompt-end () + (let ((end (minibuffer-prompt-end))) + (if (< (point) end) + (user-error "Can't complete in prompt") + end)))) + ;; Adapted from ‘minibuffer-complete’: (defun my-minibuffer-complete-history () (interactive)