From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#23418: 25.1.50; next-history-element no longer works in query-replace Date: Tue, 03 May 2016 23:28:18 +0300 Organization: LINKOV.NET Message-ID: <87eg9iubrx.fsf@mail.linkov.net> References: <87inyxxlof.fsf@gmail.com> <8737q0p5i7.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1462307450 5810 80.91.229.3 (3 May 2016 20:30:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 May 2016 20:30:50 +0000 (UTC) Cc: 23418@debbugs.gnu.org To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 03 22:30:41 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1axgxs-0001Ic-Gq for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 May 2016 22:30:40 +0200 Original-Received: from localhost ([::1]:43250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axgxo-0000Mc-E6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 May 2016 16:30:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axgxV-0008Ja-Rq for bug-gnu-emacs@gnu.org; Tue, 03 May 2016 16:30:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axgxJ-00009p-VE for bug-gnu-emacs@gnu.org; Tue, 03 May 2016 16:30:12 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axgxJ-00006v-SQ for bug-gnu-emacs@gnu.org; Tue, 03 May 2016 16:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1axgxG-00017e-G6 for bug-gnu-emacs@gnu.org; Tue, 03 May 2016 16:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2016 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23418-submit@debbugs.gnu.org id=B23418.14623073574235 (code B ref 23418); Tue, 03 May 2016 20:30:02 +0000 Original-Received: (at 23418) by debbugs.gnu.org; 3 May 2016 20:29:17 +0000 Original-Received: from localhost ([127.0.0.1]:35817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axgwX-00016F-E3 for submit@debbugs.gnu.org; Tue, 03 May 2016 16:29:17 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:35116 helo=homiemail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axgwV-000164-Fz for 23418@debbugs.gnu.org; Tue, 03 May 2016 16:29:15 -0400 Original-Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id 86BFA300079; Tue, 3 May 2016 13:29:11 -0700 (PDT) Original-Received: from localhost.linkov.net (62.65.225.204.cable.starman.ee [62.65.225.204]) (Authenticated sender: jurta@jurta.org) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPA id A348C300061; Tue, 3 May 2016 13:29:10 -0700 (PDT) In-Reply-To: <8737q0p5i7.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 02 May 2016 23:30:24 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:117688 Archived-At: >> 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: =E2=80=9CEnd of history; no default available=E2=80= =9D. >> >> Until recently, this would try to =E2=80=9Cguess=E2=80=9D what you wan= t 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=3Demacs-25&id=3Df99b5129= 5b86770e4b16d4717c0e73049191c4c5 > 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-nons= ticky))) - (if regexp-flag - (read-regexp prompt nil 'query-replace-from-to-his= tory) - (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-def= ault-nonsticky))) + (if regexp-flag + (read-regexp prompt nil 'query-replace-from-to-histo= ry) + (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)