all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23418: 25.1.50; next-history-element no longer works in query-replace
@ 2016-05-02  2:01 Artur Malabarba
  2016-05-02 20:30 ` Juri Linkov
       [not found] ` <handler.23418.D23418.146239237724461.notifdone@debbugs.gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Artur Malabarba @ 2016-05-02  2:01 UTC (permalink / raw)
  To: 23418


1. emacs -q
2. Go to the scratch buffer and place point on a word.
3. M-x query-replace-regexp (or query-replace)
4. M-n
5. Emacs will say: “End of history; no default available”.

Until recently, this would try to “guess” what you want to replace by
inserting the word at point on the prompt. If you kept hitting M-n it
would try other guesses like inserting the word surrounded in symbol
delimiters.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23418: 25.1.50; next-history-element no longer works in query-replace
  2016-05-02  2:01 bug#23418: 25.1.50; next-history-element no longer works in query-replace Artur Malabarba
@ 2016-05-02 20:30 ` Juri Linkov
  2016-05-03 20:28   ` Juri Linkov
       [not found] ` <handler.23418.D23418.146239237724461.notifdone@debbugs.gnu.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2016-05-02 20:30 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: 23418

> 1. emacs -q
> 2. Go to the scratch buffer and place point on a word.
> 3. M-x query-replace-regexp (or query-replace)
> 4. M-n
> 5. Emacs will say: “End of history; no default available”.
>
> Until recently, this would try to “guess” what you want to replace by
> inserting the word at point on the prompt. If you kept hitting M-n it
> would try other guesses like inserting the word surrounded in symbol
> delimiters.

I see the same bug caused by
http://git.sv.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=f99b51295b86770e4b16d4717c0e73049191c4c5
that breaks syntax for bounds-of-thing-at-point.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23418: 25.1.50; next-history-element no longer works in query-replace
  2016-05-02 20:30 ` Juri Linkov
@ 2016-05-03 20:28   ` Juri Linkov
  2016-05-04 20:05     ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2016-05-03 20:28 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: 23418

>> 1. emacs -q
>> 2. Go to the scratch buffer and place point on a word.
>> 3. M-x query-replace-regexp (or query-replace)
>> 4. M-n
>> 5. Emacs will say: “End of history; no default available”.
>>
>> Until recently, this would try to “guess” what you want to replace by
>> inserting the word at point on the prompt. If you kept hitting M-n it
>> would try other guesses like inserting the word surrounded in symbol
>> delimiters.
>
> I see the same bug caused by
> http://git.sv.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=f99b51295b86770e4b16d4717c0e73049191c4c5
> that breaks syntax for bounds-of-thing-at-point.

As pointed out by Stefan in
http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01504.html
http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01538.html
a proper fix for bug#23127 is to use minibuffer-with-setup-hook:

diff --git a/lisp/replace.el b/lisp/replace.el
index 801c605..26e5875 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -191,18 +191,15 @@ query-replace-read-from
 	    ;; a region in order to specify the minibuffer input.
 	    ;; That should not clobber the region for the query-replace itself.
 	    (save-excursion
-              ;; The `with-current-buffer' ensures that the binding
-              ;; for `text-property-default-nonsticky' isn't a buffer
-              ;; local binding in the current buffer, which
-              ;; `read-from-minibuffer' wouldn't see.
-              (with-current-buffer (window-buffer (minibuffer-window))
-                (let ((text-property-default-nonsticky
-                       (cons '(separator . t) text-property-default-nonsticky)))
-                  (if regexp-flag
-                      (read-regexp prompt nil 'query-replace-from-to-history)
-                    (read-from-minibuffer
-                     prompt nil nil nil 'query-replace-from-to-history
-                     (car (if regexp-flag regexp-search-ring search-ring)) t))))))
+              (minibuffer-with-setup-hook
+                  (lambda ()
+                    (setq-local text-property-default-nonsticky
+                                (cons '(separator . t) text-property-default-nonsticky)))
+                (if regexp-flag
+                    (read-regexp prompt nil 'query-replace-from-to-history)
+                  (read-from-minibuffer
+                   prompt nil nil nil 'query-replace-from-to-history
+                   (car (if regexp-flag regexp-search-ring search-ring)) t)))))
            (to))
       (if (and (zerop (length from)) query-replace-defaults)
 	  (cons (caar query-replace-defaults)





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#23418: 25.1.50; next-history-element no longer works in query-replace
  2016-05-03 20:28   ` Juri Linkov
@ 2016-05-04 20:05     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2016-05-04 20:05 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: 23418-done

>>> 1. emacs -q
>>> 2. Go to the scratch buffer and place point on a word.
>>> 3. M-x query-replace-regexp (or query-replace)
>>> 4. M-n
>>> 5. Emacs will say: “End of history; no default available”.
>>>
>>> Until recently, this would try to “guess” what you want to replace by
>>> inserting the word at point on the prompt. If you kept hitting M-n it
>>> would try other guesses like inserting the word surrounded in symbol
>>> delimiters.
>>
>> I see the same bug caused by
>> http://git.sv.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=f99b51295b86770e4b16d4717c0e73049191c4c5
>> that breaks syntax for bounds-of-thing-at-point.
>
> As pointed out by Stefan in
> http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01504.html
> http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01538.html
> a proper fix for bug#23127 is to use minibuffer-with-setup-hook:

Fixed accordingly.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23418: closed (Re: bug#23418: 25.1.50; next-history-element no longer works in query-replace)
       [not found] ` <handler.23418.D23418.146239237724461.notifdone@debbugs.gnu.org>
@ 2016-05-04 20:24   ` Artur Malabarba
  0 siblings, 0 replies; 5+ messages in thread
From: Artur Malabarba @ 2016-05-04 20:24 UTC (permalink / raw)
  To: 23418; +Cc: Juri Linkov

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

Thanks, Juri!

On Wed, May 4, 2016 at 5:07 PM GNU bug Tracking System <help-debbugs@gnu.org>
wrote:

> Your bug report
>
> #23418: 25.1.50; next-history-element no longer works in query-replace
>
> which was filed against the emacs package, has been closed.
>
> The explanation is attached below, along with your original report.
> If you require more details, please reply to 23418@debbugs.gnu.org.
>
> --
> 23418: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23418
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
>
>
>
> ---------- Forwarded message ----------
> From: Juri Linkov <juri@linkov.net>
> To: Artur Malabarba <bruce.connor.am@gmail.com>
> Cc: 23418-done@debbugs.gnu.org
> Date: Wed, 04 May 2016 23:05:49 +0300
> Subject: Re: bug#23418: 25.1.50; next-history-element no longer works in
> query-replace
> >>> 1. emacs -q
> >>> 2. Go to the scratch buffer and place point on a word.
> >>> 3. M-x query-replace-regexp (or query-replace)
> >>> 4. M-n
> >>> 5. Emacs will say: “End of history; no default available”.
> >>>
> >>> Until recently, this would try to “guess” what you want to replace by
> >>> inserting the word at point on the prompt. If you kept hitting M-n it
> >>> would try other guesses like inserting the word surrounded in symbol
> >>> delimiters.
> >>
> >> I see the same bug caused by
> >>
> http://git.sv.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=f99b51295b86770e4b16d4717c0e73049191c4c5
> >> that breaks syntax for bounds-of-thing-at-point.
> >
> > As pointed out by Stefan in
> > http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01504.html
> > http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01538.html
> > a proper fix for bug#23127 is to use minibuffer-with-setup-hook:
>
> Fixed accordingly.
>
>
>
>
> ---------- Forwarded message ----------
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> To: bug-gnu-emacs@gnu.org
> Cc:
> Date: Sun, 01 May 2016 23:01:36 -0300
> Subject: 25.1.50; next-history-element no longer works in query-replace
>
> 1. emacs -q
> 2. Go to the scratch buffer and place point on a word.
> 3. M-x query-replace-regexp (or query-replace)
> 4. M-n
> 5. Emacs will say: “End of history; no default available”.
>
> Until recently, this would try to “guess” what you want to replace by
> inserting the word at point on the prompt. If you kept hitting M-n it
> would try other guesses like inserting the word surrounded in symbol
> delimiters.
>
>
>

[-- Attachment #2: Type: text/html, Size: 3944 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-04 20:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02  2:01 bug#23418: 25.1.50; next-history-element no longer works in query-replace Artur Malabarba
2016-05-02 20:30 ` Juri Linkov
2016-05-03 20:28   ` Juri Linkov
2016-05-04 20:05     ` Juri Linkov
     [not found] ` <handler.23418.D23418.146239237724461.notifdone@debbugs.gnu.org>
2016-05-04 20:24   ` bug#23418: closed (Re: bug#23418: 25.1.50; next-history-element no longer works in query-replace) Artur Malabarba

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.