GNU bug report logs -
#25482
26.0.50; Allow setting `query-replace-from-to-separator` to nil
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
> [You've replied only to me.]
Yes sorry, I am so used to github that I sometimes forget to reply to
all.
> So you are saying that even setting the string to " -> " gets " → "
> into the history?
No even if you set the string to " -> " the string is not a plain string
but "\0" with 'display property " -> ".
> If so, that's the bug that we should solve, I think.
The patch is fixing this.
> Is it a problem to have the ASCII " -> " in the history?
It is not ASCII but ^@.
> Assuming we solve this part of the problem, would you still need to
> disable adding the string to the history?
No that would be ok as long as we use a plain string for " -> ".
But note that the fix I provided make the defcustom simpler and easier
to maintain both from user and developer side, thus it allow to use both
custom and setq which is not the case with actual code.
So to resume,
With actual code:
1) Using (setq query-replace-from-to-separator " -> ")
is not working.
2) Using (customize-set-variable query-replace-from-to-separator " -> ")
is working but " -> " will not be a plain ascii string and will be added
to history.
3) Setting query-replace-from-to-separator to nil is not possible, apart perhaps
using a sexp that evaluate to nil, which is not obvious and in which
case do not add a prompt with a default value like in 24.5 (regression).
With the patch:
1) and 2) are working and preserve the actual behavior, which is adding
"from<separator>to" to history.
3) Is working and provide the exact behavior as 24.5, that is use a
plain ascii string " -> " as separator and do not add
"from<separator>to" to history.
The default setting is the same as the actual code, no change.
Unrelated,
I also fixed this block of code:
(if regexp-flag
(read-regexp prompt nil 'minibuffer-history)
(read-from-minibuffer
prompt nil nil nil nil
(car (if regexp-flag regexp-search-ring search-ring)) t))
--
Thierry
This bug report was last modified 8 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.