From unknown Fri Jun 20 18:25:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23127 <23127@debbugs.gnu.org> To: bug#23127 <23127@debbugs.gnu.org> Subject: Status: 25.0.92; Assertion failure when editing history in query-replace in cc-mode Reply-To: bug#23127 <23127@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:25:07 +0000 retitle 23127 25.0.92; Assertion failure when editing history in query-repl= ace in cc-mode reassign 23127 emacs submitter 23127 Richard Copley severity 23127 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 15:52:23 2016 Received: (at submit) by debbugs.gnu.org; 27 Mar 2016 19:52:23 +0000 Received: from localhost ([127.0.0.1]:40417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akGjX-0003aU-Fq for submit@debbugs.gnu.org; Sun, 27 Mar 2016 15:52:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akGjV-0003aD-Hu for submit@debbugs.gnu.org; Sun, 27 Mar 2016 15:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akGjP-0008D8-8D for submit@debbugs.gnu.org; Sun, 27 Mar 2016 15:52:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGjP-0008D4-4f for submit@debbugs.gnu.org; Sun, 27 Mar 2016 15:52:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGjO-0003Kt-1c for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akGjM-0008Cu-Ud for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:52:13 -0400 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:35417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGjM-0008Cq-Oz for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:52:12 -0400 Received: by mail-vk0-x235.google.com with SMTP id e6so136079970vkh.2 for ; Sun, 27 Mar 2016 12:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=wF6oLKzgpIOmdTs8aiT/Hbv9P/XYtSp2/k2INoacN3k=; b=fCRZOJN+NwBzy1uynhAyqqkmWJVvk+bS+38eGXfToVm14CoW7PIUKaXkZg+HjBNLHM cYRV8VFfDhHISOx9UTdO3bzIqcFte6L3sG0lGa+b/AlskbtbVu/wzpax20iRdHjazFJj k3KafYijoRScBICYlOLTwTJtuKTjhTj7Fo5/QDdqCFee+DqQOdHIiTt5U2JIbeGtfzd0 +3V1749CB+Nrt+gpZDPNAcbZvyE0nPdMekLxFRvinMkitw2X/gJgeAg/fFcE6PeWPxbh 5rfRDmTzQ4noAPNiV69I5bll53flvRliXb41yJ1srtvFPFwfXihWowmtuEywU1onv1/K 8a2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=wF6oLKzgpIOmdTs8aiT/Hbv9P/XYtSp2/k2INoacN3k=; b=OTeCAu1uqS7+3iIDkbS6JVPmSBEkzuqrdXc5wgmxTMm7/qLnq8xeNXlTpXXAuSMrAj bqKesBu88aZR4+jj2/ejwV14bTOWGB8S1AU+bTYrrd8VBMoFy4TpYjiqfo8sJMf0x2dR +fs4vh3NvyRjCjdS76CybGtr+hOnHLXzxsdSFDjXOsCe/qehtwN3aWnygp1On6VBDVCy go9266VtIE0Of7rLL00dR32tssL8worOhUm3XNZgyK9s86LA29CZE66jP+vDIrL9hhIi u6haFNWryJdL7w2q+zSIQx/vYU1Od4DP4ozT1f3DOwZkZYbKKhstaLDHtBnJn4UENfIt i7SA== X-Gm-Message-State: AD7BkJLjSaTNhKohWT7JHgyKTk22wcHaNwVBLw1yzq1bqVCa7XBivbl75DGLHnl/4UGVCvp6LdZrbFOwZudf1A== X-Received: by 10.31.13.140 with SMTP id 134mr12114926vkn.142.1459108331996; Sun, 27 Mar 2016 12:52:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.35.105 with HTTP; Sun, 27 Mar 2016 12:51:42 -0700 (PDT) From: Richard Copley Date: Sun, 27 Mar 2016 20:51:42 +0100 Message-ID: Subject: 25.0.92; Assertion failure when editing history in query-replace in cc-mode To: "bug-gnu-emacs@gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) In cc-mode, while doing query-replace, edit a previous replacement in the minibuffer, and insert characters after the " =E2=86=92 " separator. Th= e subsequent emacs-lisp chokes on the text properties of the resulting string, with an assertion failure. Recipe starting from 'emacs -Q': M-x c-mode RET M-< C-% a RET b RET ! M-< C-% M-p C-e c RET =3D=3D> error "cl--assertion-failed: Assertion failed: (not (text-property-any (1+ split-pos) length (quote separator) t string))" The callstack looks like this (except that here I've replaced a NUL with "^= @"): Debugger entered: ((cl-assertion-failed (not (text-property-any (1+ split-pos) length (quote separator) t string)) nil)) cl--assertion-failed((not (text-property-any (1+ split-pos) length (quote separator) t string))) query-replace--split-string(#("a^@c" 1 2 (display #(" =E2=86=92 " 0 3 (fa= ce minibuffer-prompt)) separator t) 2 3 (separator t))) query-replace-read-from("Query replace" nil) query-replace-read-args("Query replace" nil) (let ((common (query-replace-read-args (concat "Query replace" (if current-prefix-arg (if (eq current-prefix-arg ...) " backward" " word") "") (if (use-region-p) " in region" "")) nil))) (list (nth 0 common) (nth 1 common) (nth 2 common) (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) (nth 3 common) (if (use-region-p) (region-noncontiguous-p)))) call-interactively(query-replace nil nil) command-execute(query-replace) As you can see, the "c" inherited the separator property, and query-replace--split-string choked on that. It doesn't happen in all modes. It does happen in c-mode and c++-mode. In GNU Emacs 25.0.92.1 (x86_64-w64-mingw32) of 2016-03-21 built on MACHINE Repository revision: 76ef52267cf887e3e1aa6d25b3b16dd0601dd459 Windowing system distributor 'Microsoft Corp.', version 10.0.10586 Configured using: 'configure --prefix /c/emacs/emacs-20160321-102640 --without-imagemagick --disable-dependency-tracking --enable-locallisppath=3D%emacs_dir%/../site-lisp 'CFLAGS=3D-Og -g -ggdb'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: C++/l Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent messages: Mark set cl--assertion-failed: Assertion failed: (not (text-property-any (1+ split-pos) length (quote separator) t string)) Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils thingatpt cl-extra help-mode cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs pcase cl-lib kmacro time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote w32notify dbusbind w32 multi-tty make-network-process emacs) Memory information: ((conses 16 110212 13535) (symbols 56 21829 0) (miscs 48 49 129) (strings 32 21738 3341) (string-bytes 1 713085) (vectors 16 15026) (vector-slots 8 455559 3738) (floats 8 164 97) (intervals 56 275 18) (buffers 976 12)) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 18:02:14 2016 Received: (at 23127) by debbugs.gnu.org; 28 Mar 2016 22:02:14 +0000 Received: from localhost ([127.0.0.1]:42478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akfEj-0006HV-EG for submit@debbugs.gnu.org; Mon, 28 Mar 2016 18:02:13 -0400 Received: from mail.muc.de ([193.149.48.3]:31586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akfEh-0006FM-FQ for 23127@debbugs.gnu.org; Mon, 28 Mar 2016 18:02:12 -0400 Received: (qmail 57302 invoked by uid 3782); 28 Mar 2016 22:02:10 -0000 Date: 28 Mar 2016 22:02:10 -0000 Message-ID: <20160328220210.57301.qmail@mail.muc.de> From: Alan Mackenzie To: Richard Copley Subject: Re: bug#23127: 25.0.92; Assertion failure when editing history in query-replace in cc-mode Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.2-RELEASE-p14 (amd64)) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 23127 Cc: 23127@debbugs.gnu.org, acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Richard. In article you wrote: > In cc-mode, while doing query-replace, edit a previous replacement in > the minibuffer, and insert characters after the " =E2=86=92 " separator= . The > subsequent emacs-lisp chokes on the text properties of the resulting > string, with an assertion failure. > Recipe starting from 'emacs -Q': > M-x c-mode RET > M-< > C-% a RET b RET ! > M-< > C-% M-p C-e c RET > =3D=3D> error "cl--assertion-failed: Assertion failed: (not > (text-property-any (1+ split-pos) length (quote separator) t string))" > The callstack looks like this (except that here I've replaced a NUL wit= h "^@"): > Debugger entered: ((cl-assertion-failed (not (text-property-any (1+ > split-pos) length (quote separator) t string)) nil)) > cl--assertion-failed((not (text-property-any (1+ split-pos) length > (quote separator) t string))) > query-replace--split-string(#("a^@c" 1 2 (display #(" =E2=86=92 " 0 3= (face > minibuffer-prompt)) separator t) 2 3 (separator t))) > query-replace-read-from("Query replace" nil) > query-replace-read-args("Query replace" nil) > (let ((common (query-replace-read-args (concat "Query replace" (if > current-prefix-arg (if (eq current-prefix-arg ...) " backward" " > word") "") (if (use-region-p) " in region" "")) nil))) (list (nth 0 > common) (nth 1 common) (nth 2 common) (if (use-region-p) > (region-beginning)) (if (use-region-p) (region-end)) (nth 3 common) > (if (use-region-p) (region-noncontiguous-p)))) > call-interactively(query-replace nil nil) > command-execute(query-replace) > As you can see, the "c" inherited the separator property, and > query-replace--split-string choked on that. > It doesn't happen in all modes. It does happen in c-mode and c++-mode. Thanks for such a high quality bug report. The cause was a critical variable being buffer local in C Mode and C++ Mode. This buffer local binding was not available in `read-from-minibuffer', with the result that the `separator' text property got spread to the newly inserted 'c'. The following patch should fix the bug. Would you please try it out and confirm that the bug is indeed fixed, or report what's still wrong. Thanks! > In GNU Emacs 25.0.92.1 (x86_64-w64-mingw32) > of 2016-03-21 built on MACHINE > Repository revision: 76ef52267cf887e3e1aa6d25b3b16dd0601dd459 > Windowing system distributor 'Microsoft Corp.', version 10.0.10586 > Configured using: > 'configure --prefix /c/emacs/emacs-20160321-102640 > --without-imagemagick --disable-dependency-tracking > --enable-locallisppath=3D%emacs_dir%/../site-lisp 'CFLAGS=3D-Og -g -gg= db'' diff --git a/lisp/replace.el b/lisp/replace.el index 428be3c..412f827 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -167,8 +167,6 @@ query-replace-read-from ;; unavailable while preparing to dump. (custom-reevaluate-setting 'query-replace-from-to-separator) (let* ((history-add-new-input nil) - (text-property-default-nonsticky - (cons '(separator . t) text-property-default-nonsticky)) (separator (when query-replace-from-to-separator (propertize "\0" @@ -195,9 +193,16 @@ query-replace-read-from (save-excursion (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)))) + ;; 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-no= nsticky))) + (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) --=20 Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 19:24:59 2016 Received: (at 23127) by debbugs.gnu.org; 28 Mar 2016 23:24:59 +0000 Received: from localhost ([127.0.0.1]:42579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akgWp-0008I9-3x for submit@debbugs.gnu.org; Mon, 28 Mar 2016 19:24:59 -0400 Received: from mail-vk0-f43.google.com ([209.85.213.43]:33695) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akgWl-0008Hs-R6 for 23127@debbugs.gnu.org; Mon, 28 Mar 2016 19:24:57 -0400 Received: by mail-vk0-f43.google.com with SMTP id k1so175705206vkb.0 for <23127@debbugs.gnu.org>; Mon, 28 Mar 2016 16:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=oGjDrgBvnQxM/oqNLUmLZ1KhD4aMpr02QHM20soCymQ=; b=edSR9YUSBvgs6HrF2W7Or/jjrgP/dUNTqGjlrPKRLLJLERYnBhTnLZITE/a7q5k2+p XqbxCaSqD9BcDXFL+wiTp0pE5l6B6HvsuSHjG8ixM9TjosrMOR7jZ+cCcrn5XJv6ahFx wP2uNbAdPWI1i+8Olaprgp/K5xhfaE+Ykda6PtP/YDR70N6/kLkdj8ys/ObXw0yI0005 SWu1M712v0SDf06mGtkP15/Ph8SD8ew1LUecOALCfsuAcCVUqQysX/+/fELeNDcSM+Hr oie3lj+ACl+h26pRtC+Wjlqq6ZNWZdBBA2++PckdcNjEifF5ndtTl9CBLLylg3tuOFvg lsMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=oGjDrgBvnQxM/oqNLUmLZ1KhD4aMpr02QHM20soCymQ=; b=cvVCDMG4/S1TroQx1F00VteWDD9XbZBUIF7LcV4uXAsIPTpv+ERPyaEaUAyXmRTGqF 3c267rvYZPvUvhzWtSvFn/4WyTD6LEpq+9cBnS3hqK7jvdmS/nINNAT/UvzFDZnjz/Tq Nr+eroEN2ypxTASypXIsFSCye5dP2hTDS1ReHlLZrSUtaenSSMWU5BTwkD87TXPBzeGM rBmFhchC53Skd3TvhbeVxmYxkNU9vWTxSe+AvtaKn/QiqAy+jdRoReCpmj+IersCGQnm sY45eC8QbredqxXInY0DAxJKxDMTfTJ//4I6WVIbSNiGuZ1zmd2iSikiTdeypcecan2U VtCQ== X-Gm-Message-State: AD7BkJLDJA7an+XLu3h2xW7q66vQ5IiZp6+Y4UHZDHvhTJzidOY5PXed4v34h7eHnjCBEU64RidKuO0qcgVrXA== X-Received: by 10.31.49.137 with SMTP id x131mr16349973vkx.0.1459207490324; Mon, 28 Mar 2016 16:24:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.35.105 with HTTP; Mon, 28 Mar 2016 16:24:20 -0700 (PDT) In-Reply-To: <20160328220210.57301.qmail@mail.muc.de> References: <20160328220210.57301.qmail@mail.muc.de> From: Richard Copley Date: Tue, 29 Mar 2016 00:24:20 +0100 Message-ID: Subject: Re: bug#23127: 25.0.92; Assertion failure when editing history in query-replace in cc-mode To: Alan Mackenzie Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23127 Cc: 23127@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 28 March 2016 at 23:02, Alan Mackenzie wrote: > Hello, Richard. > > In article you wrote: >> In cc-mode, while doing query-replace, edit a previous replacement in >> the minibuffer, and insert characters after the " =E2=86=92 " separator.= The >> subsequent emacs-lisp chokes on the text properties of the resulting >> string, with an assertion failure. > >> Recipe starting from 'emacs -Q': > >> M-x c-mode RET >> M-< >> C-% a RET b RET ! >> M-< >> C-% M-p C-e c RET > >> =3D=3D> error "cl--assertion-failed: Assertion failed: (not >> (text-property-any (1+ split-pos) length (quote separator) t string))" > >> The callstack looks like this (except that here I've replaced a NUL with= "^@"): > >> Debugger entered: ((cl-assertion-failed (not (text-property-any (1+ >> split-pos) length (quote separator) t string)) nil)) >> cl--assertion-failed((not (text-property-any (1+ split-pos) length >> (quote separator) t string))) >> query-replace--split-string(#("a^@c" 1 2 (display #(" =E2=86=92 " 0 3 = (face >> minibuffer-prompt)) separator t) 2 3 (separator t))) >> query-replace-read-from("Query replace" nil) >> query-replace-read-args("Query replace" nil) >> (let ((common (query-replace-read-args (concat "Query replace" (if >> current-prefix-arg (if (eq current-prefix-arg ...) " backward" " >> word") "") (if (use-region-p) " in region" "")) nil))) (list (nth 0 >> common) (nth 1 common) (nth 2 common) (if (use-region-p) >> (region-beginning)) (if (use-region-p) (region-end)) (nth 3 common) >> (if (use-region-p) (region-noncontiguous-p)))) >> call-interactively(query-replace nil nil) >> command-execute(query-replace) > >> As you can see, the "c" inherited the separator property, and >> query-replace--split-string choked on that. >> It doesn't happen in all modes. It does happen in c-mode and c++-mode. > > Thanks for such a high quality bug report. The cause was a critical > variable being buffer local in C Mode and C++ Mode. This buffer local > binding was not available in `read-from-minibuffer', with the result that > the `separator' text property got spread to the newly inserted 'c'. > > The following patch should fix the bug. Would you please try it out and > confirm that the bug is indeed fixed, or report what's still wrong. > Thanks! > >> In GNU Emacs 25.0.92.1 (x86_64-w64-mingw32) >> of 2016-03-21 built on MACHINE >> Repository revision: 76ef52267cf887e3e1aa6d25b3b16dd0601dd459 >> Windowing system distributor 'Microsoft Corp.', version 10.0.10586 >> Configured using: >> 'configure --prefix /c/emacs/emacs-20160321-102640 >> --without-imagemagick --disable-dependency-tracking >> --enable-locallisppath=3D%emacs_dir%/../site-lisp 'CFLAGS=3D-Og -g -ggd= b'' > > > > diff --git a/lisp/replace.el b/lisp/replace.el > index 428be3c..412f827 100644 > --- a/lisp/replace.el > +++ b/lisp/replace.el > @@ -167,8 +167,6 @@ query-replace-read-from > ;; unavailable while preparing to dump. > (custom-reevaluate-setting 'query-replace-from-to-separator) > (let* ((history-add-new-input nil) > - (text-property-default-nonsticky > - (cons '(separator . t) text-property-default-nonsticky)) > (separator > (when query-replace-from-to-separator > (propertize "\0" > @@ -195,9 +193,16 @@ query-replace-read-from > (save-excursion > (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)= ))) > + ;; 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-no= nsticky))) > + (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) Thanks very much Alan. I tested your patch and noticed that it fixes query-replace but not query-replace-regexp. I won't submit a new patch because I don't have the paperwork (sorry), but I reckon you just need to move the "(with-current-buffer (...) (let (...) ...))" construct outside the "(if regexp-flag ...)". With that change it works fine for me. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 06:00:19 2016 Received: (at 23127) by debbugs.gnu.org; 29 Mar 2016 10:00:19 +0000 Received: from localhost ([127.0.0.1]:42844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akqRe-0006l5-Sx for submit@debbugs.gnu.org; Tue, 29 Mar 2016 06:00:19 -0400 Received: from mail.muc.de ([193.149.48.3]:14239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akqRd-0006kx-L1 for 23127@debbugs.gnu.org; Tue, 29 Mar 2016 06:00:18 -0400 Received: (qmail 60066 invoked by uid 3782); 29 Mar 2016 10:00:16 -0000 Received: from acm.muc.de (p548A5478.dip0.t-ipconnect.de [84.138.84.120]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 29 Mar 2016 12:00:15 +0200 Received: (qmail 3417 invoked by uid 1000); 29 Mar 2016 10:03:09 -0000 Date: Tue, 29 Mar 2016 10:03:09 +0000 To: Richard Copley Subject: Re: bug#23127: 25.0.92; Assertion failure when editing history in query-replace in cc-mode Message-ID: <20160329100309.GA3377@acm.fritz.box> References: <20160328220210.57301.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 23127 Cc: 23127@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Richard. On Tue, Mar 29, 2016 at 12:24:20AM +0100, Richard Copley wrote: > Thanks very much Alan. > I tested your patch and noticed that it fixes query-replace but not > query-replace-regexp. Whoops! > I won't submit a new patch because I don't have the paperwork (sorry), > but I reckon you just need to move the "(with-current-buffer (...) > (let (...) ...))" construct outside the "(if regexp-flag ...)". With > that change it works fine for me. And it works fine for me, too. Thanks for spotting that. I've committed the fix (to the emacs-25 branch in the savannah repository), and I'm closing the bug. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 06:01:36 2016 Received: (at 23127-done) by debbugs.gnu.org; 29 Mar 2016 10:01:36 +0000 Received: from localhost ([127.0.0.1]:42848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akqSu-0006n6-58 for submit@debbugs.gnu.org; Tue, 29 Mar 2016 06:01:36 -0400 Received: from mail.muc.de ([193.149.48.3]:14273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akqSs-0006mz-Se for 23127-done@debbugs.gnu.org; Tue, 29 Mar 2016 06:01:35 -0400 Received: (qmail 60567 invoked by uid 3782); 29 Mar 2016 10:01:34 -0000 Received: from acm.muc.de (p548A5478.dip0.t-ipconnect.de [84.138.84.120]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 29 Mar 2016 12:01:33 +0200 Received: (qmail 3424 invoked by uid 1000); 29 Mar 2016 10:04:27 -0000 Date: Tue, 29 Mar 2016 10:04:27 +0000 To: 23127-done@debbugs.gnu.org Subject: Re: bug#23127: 25.0.92; Assertion failure when editing history in query-replace in cc-mode Message-ID: <20160329100427.GB3377@acm.fritz.box> References: <20160328220210.57301.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 23127-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Bug fixed. -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 18:25:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 Apr 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator