aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/minibuffer.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 5f594679ca3..c900b0d7ce6 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -488,8 +488,17 @@ for use at QPOS."
488 (qsuffix (cdr action)) 488 (qsuffix (cdr action))
489 (ufull (if (zerop (length qsuffix)) ustring 489 (ufull (if (zerop (length qsuffix)) ustring
490 (funcall unquote (concat string qsuffix)))) 490 (funcall unquote (concat string qsuffix))))
491 (_ (cl-assert (string-prefix-p ustring ufull))) 491 ;; If (not (string-prefix-p ustring ufull)) we have a problem:
492 (usuffix (substring ufull (length ustring))) 492 ;; the unquoting the qfull gives something "unrelated" to ustring.
493 ;; E.g. "~/" and "/" where "~//" gets unquoted to just "/" (see
494 ;; bug#47678).
495 ;; In that case we can't even tell if we're right before the
496 ;; "/" or right after it (aka if this "/" is from qstring or
497 ;; from qsuffix), which which usuffix to use is very unclear.
498 (usuffix (if (string-prefix-p ustring ufull)
499 (substring ufull (length ustring))
500 ;; FIXME: Maybe "" is preferable/safer?
501 qsuffix))
493 (boundaries (completion-boundaries ustring table pred usuffix)) 502 (boundaries (completion-boundaries ustring table pred usuffix))
494 (qlboundary (car (funcall requote (car boundaries) string))) 503 (qlboundary (car (funcall requote (car boundaries) string)))
495 (qrboundary (if (zerop (cdr boundaries)) 0 ;Common case. 504 (qrboundary (if (zerop (cdr boundaries)) 0 ;Common case.