From unknown Sat Sep 06 20:02:20 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#25482 <25482@debbugs.gnu.org> To: bug#25482 <25482@debbugs.gnu.org> Subject: Status: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Reply-To: bug#25482 <25482@debbugs.gnu.org> Date: Sun, 07 Sep 2025 03:02:20 +0000 retitle 25482 26.0.50; Allow setting `query-replace-from-to-separator` to n= il reassign 25482 emacs submitter 25482 Thierry Volpiatto severity 25482 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 03:40:54 2017 Received: (at submit) by debbugs.gnu.org; 19 Jan 2017 08:40:54 +0000 Received: from localhost ([127.0.0.1]:35176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU8H7-0000hy-Pd for submit@debbugs.gnu.org; Thu, 19 Jan 2017 03:40:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU8H5-0000hl-Be for submit@debbugs.gnu.org; Thu, 19 Jan 2017 03:40:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cU8Gw-0000Yv-W4 for submit@debbugs.gnu.org; Thu, 19 Jan 2017 03:40:46 -0500 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]:59497) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cU8Gw-0000Yk-Kb for submit@debbugs.gnu.org; Thu, 19 Jan 2017 03:40:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cU8Gt-00041n-6x for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 03:40:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cU8Gp-0000Wh-RT for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 03:40:39 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cU8Gp-0000VX-Ea for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 03:40:35 -0500 Received: by mail-wm0-x22e.google.com with SMTP id r126so279890245wmr.0 for ; Thu, 19 Jan 2017 00:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=u+iGxNJZ2XMaWid/6wzNvie6vq6Cgks9QLtn70oaaaA=; b=SHI9uGG6WzQLEgkWbwp2N29/17aYTohzrvo6Q4lcNXEupsVKF9GLcxwLBYngyj+0o/ CSSuWePhAD/D9YW/IlzuWB25mxToe495wp8bLlV/XY6iVAx2N9NkXvD6ORDuRUf+mlbo 8QmW/dCnDErTX5PyOqF6blfgT2ihKHzxDixyQbt3gNXbWTCt8w21+iWSZ0ZFd5nAEkgE seN0DgZr38zQHyLMFowIXH85BfiIi7ZUSfF7o2CH9Dtct0uv/s5ZfgxZKT7F7ejRm7gU +NyvIOV+rNPgIkui6iU9eBWBm3bFWAyHIYiShKm7V8GEANwxZ1Tjv56Otb5FiMHv32Gx GIMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=u+iGxNJZ2XMaWid/6wzNvie6vq6Cgks9QLtn70oaaaA=; b=FfQzAvPnwUltbJ1sZ7iYxhAsBj7D8czb7Ctd5NH+F41VDYdlGwXx22yxwHz75t2jj1 Hwn2GDjtaiTbqUBHHsVslN+08D05zUy3rzCO5h5d99MbIJWJbasq2UYkQz0jbMFws7CG y1DWzdonhOAd08rpiN5B1mPnMYaOoJLD0JJng7M52AiSaIDJzzesMX29h0+8L+8uufM8 aQ+HpANIWMpAUfRNn04SYRG/mHoILQor9YRtK71JAfISOqm1i72lo9ZD5yi7hl80vNTh ZoKLSgjmEsdgQYXmlOAD48LSGNmJ5eEa2lZ0pkB2xAl0+94ADM7AoDSLY9HesACM/BOf 2Ilg== X-Gm-Message-State: AIkVDXJ4k8Vwlf+AT/LW+bytN28UYrr3Ht/JNk+lJDsxC3qWjuMGHllsdW/kxFdbcPAOAQ== X-Received: by 10.223.173.181 with SMTP id w50mr6367931wrc.177.1484815232324; Thu, 19 Jan 2017 00:40:32 -0800 (PST) Received: from dell-14z ([37.168.4.45]) by smtp.gmail.com with ESMTPSA id f76sm11214922wmd.15.2017.01.19.00.40.30 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 19 Jan 2017 00:40:31 -0800 (PST) User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Date: Thu, 19 Jan 2017 09:18:07 +0100 Message-ID: <871svzzcn4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 (----) Actually it is not possible to customize easily `query-replace-from-to-separator` and it is impossible to set it to nil. If I use `setq`, `custom-reevaluate-setting` reevaluate the original sexp from `query-replace-from-to-separator` and if I use customize I can add a string or a sexp, nothing else. But the code in `query-replace-read-from` is checking if `query-replace-from-to-separator` is non-nil, which is impossible actually. Thus it adds difficulties to load such sexp when dumping emacs. I would expect setting `query-replace-from-to-separator` to nil to retrieve same behavior as emacs-24.5 and not have unicode strings in my minibuffer-history. This patch allow this, please review it. Thanks. diff --git a/lisp/replace.el b/lisp/replace.el index ff917344453..dfc991b1691 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -79,15 +79,15 @@ That becomes the \"string to replace\".") to the minibuffer that reads the string to replace, or invoke replacements from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") -(defcustom query-replace-from-to-separator - (propertize (if (char-displayable-p ?→) " → " " -> ") - 'face 'minibuffer-prompt) - "String that separates FROM and TO in the history of replacement pairs." - ;; Avoids error when attempt to autoload char-displayable-p fails - ;; while preparing to dump, also stops customize-rogue listing this. - :initialize 'custom-initialize-delay +(defcustom query-replace-from-to-separator " → " + "String that separates FROM and TO in the history of replacement pairs. +When nil the default separator \" -> \" will be used as a plain string +and the pair will not be added to `query-replace-history' +\(Same behavior as in emacs 24.5)." :group 'matching - :type '(choice string (sexp :tag "Display specification")) + :type '(choice + (const :tag "Disabled" nil) + string) :version "25.1") (defcustom query-replace-from-history-variable 'query-replace-history @@ -165,9 +165,13 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) - ;; Reevaluating will check char-displayable-p that is - ;; unavailable while preparing to dump. - (custom-reevaluate-setting 'query-replace-from-to-separator) + (when (stringp query-replace-from-to-separator) + (setq query-replace-from-to-separator + (propertize (if (char-displayable-p + (string-to-char query-replace-from-to-separator)) + query-replace-from-to-separator + " -> ") + 'face 'minibuffer-prompt))) (let* ((history-add-new-input nil) (separator (when query-replace-from-to-separator @@ -185,9 +189,13 @@ wants to replace FROM with TO." (symbol-value query-replace-from-history-variable))) (minibuffer-allow-text-properties t) ; separator uses text-properties (prompt - (if (and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history)) - (format "%s: " prompt))) + (cond ((and query-replace-defaults separator) + (format "%s (default %s): " prompt (car minibuffer-history))) + (query-replace-defaults + (format "%s (default %s -> %s): " prompt + (query-replace-descr (caar query-replace-defaults)) + (query-replace-descr (cdar query-replace-defaults)))) + (t (format "%s: " prompt)))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. In GNU Emacs 26.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2017-01-06 built on dell-14z Repository revision: 1d714e41ea73af89b56fb4bf19f8f0c3f443c268 Windowing system distributor 'The X.Org Foundation', version 11.0.11701000 System Description: Linux Mint 17.3 Rosa Recent messages: Mark set Auto-saving...done Auto-saving...done Mark set Sending... Entering debugger... Back to top level previous-line: Beginning of buffer Mark set Message modified; kill anyway? (y or n) y Configured using: 'configure CFLAGS=-O3' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: fr_FR.UTF-8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: global-disable-mouse-mode: t global-git-gutter-mode: t git-gutter-mode: t eldoc-in-minibuffer-mode: t global-undo-tree-mode: t undo-tree-mode: t diff-auto-refine-mode: t magit-auto-revert-mode: t auto-revert-mode: t global-git-commit-mode: t psession-mode: t dired-async-mode: t display-time-mode: t winner-mode: t auto-image-file-mode: t savehist-mode: t show-paren-mode: t helm-descbinds-mode: t helm-top-poll-mode: t helm-push-mark-mode: t helm-mode: t shell-dirtrack-mode: t helm-adaptive-mode: t helm-popup-tip-mode: t async-bytecomp-package-mode: t minibuffer-depth-indicate-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/thierry/.emacs.d/elpa/org-20161224/ob-keys hides /usr/local/share/emacs/26.0.50/lisp/org/ob-keys /home/thierry/.emacs.d/elpa/org-20161224/ob-ref hides /usr/local/share/emacs/26.0.50/lisp/org/ob-ref /home/thierry/.emacs.d/elpa/org-20161224/ox-org hides /usr/local/share/emacs/26.0.50/lisp/org/ox-org /home/thierry/.emacs.d/elpa/org-20161224/ob-sass hides /usr/local/share/emacs/26.0.50/lisp/org/ob-sass /home/thierry/.emacs.d/elpa/org-20161224/org-bbdb hides /usr/local/share/emacs/26.0.50/lisp/org/org-bbdb /home/thierry/.emacs.d/elpa/org-20161224/ox-latex hides /usr/local/share/emacs/26.0.50/lisp/org/ox-latex /home/thierry/.emacs.d/elpa/org-20161224/ox-beamer hides /usr/local/share/emacs/26.0.50/lisp/org/ox-beamer /home/thierry/.emacs.d/elpa/org-20161224/org-crypt hides /usr/local/share/emacs/26.0.50/lisp/org/org-crypt /home/thierry/.emacs.d/elpa/org-20161224/ob-maxima hides /usr/local/share/emacs/26.0.50/lisp/org/ob-maxima /home/thierry/.emacs.d/elpa/org-20161224/ob-R hides /usr/local/share/emacs/26.0.50/lisp/org/ob-R /home/thierry/.emacs.d/elpa/org-20161224/ob-eval hides /usr/local/share/emacs/26.0.50/lisp/org/ob-eval /home/thierry/.emacs.d/elpa/org-20161224/org-datetree hides /usr/local/share/emacs/26.0.50/lisp/org/org-datetree /home/thierry/.emacs.d/elpa/org-20161224/org-element hides /usr/local/share/emacs/26.0.50/lisp/org/org-element /home/thierry/.emacs.d/elpa/org-20161224/ob-core hides /usr/local/share/emacs/26.0.50/lisp/org/ob-core /home/thierry/.emacs.d/elpa/org-20161224/ox-md hides /usr/local/share/emacs/26.0.50/lisp/org/ox-md /home/thierry/.emacs.d/elpa/org-20161224/org-indent hides /usr/local/share/emacs/26.0.50/lisp/org/org-indent /home/thierry/.emacs.d/elpa/org-20161224/ox hides /usr/local/share/emacs/26.0.50/lisp/org/ox /home/thierry/.emacs.d/elpa/org-20161224/ob-fortran hides /usr/local/share/emacs/26.0.50/lisp/org/ob-fortran /home/thierry/.emacs.d/elpa/org-20161224/ob-matlab hides /usr/local/share/emacs/26.0.50/lisp/org/ob-matlab /home/thierry/.emacs.d/elpa/org-20161224/org-macro hides /usr/local/share/emacs/26.0.50/lisp/org/org-macro /home/thierry/.emacs.d/elpa/org-20161224/ox-texinfo hides /usr/local/share/emacs/26.0.50/lisp/org/ox-texinfo /home/thierry/.emacs.d/elpa/org-20161224/ob-sqlite hides /usr/local/share/emacs/26.0.50/lisp/org/ob-sqlite /home/thierry/.emacs.d/elpa/org-20161224/org-faces hides /usr/local/share/emacs/26.0.50/lisp/org/org-faces /home/thierry/.emacs.d/elpa/org-20161224/org-pcomplete hides /usr/local/share/emacs/26.0.50/lisp/org/org-pcomplete /home/thierry/.emacs.d/elpa/org-20161224/org-mouse hides /usr/local/share/emacs/26.0.50/lisp/org/org-mouse /home/thierry/.emacs.d/elpa/org-20161224/ob-emacs-lisp hides /usr/local/share/emacs/26.0.50/lisp/org/ob-emacs-lisp /home/thierry/.emacs.d/elpa/org-20161224/org-archive hides /usr/local/share/emacs/26.0.50/lisp/org/org-archive /home/thierry/.emacs.d/elpa/org-20161224/org-capture hides /usr/local/share/emacs/26.0.50/lisp/org/org-capture /home/thierry/.emacs.d/elpa/org-20161224/ob-awk hides /usr/local/share/emacs/26.0.50/lisp/org/ob-awk /home/thierry/.emacs.d/elpa/org-20161224/ob-octave hides /usr/local/share/emacs/26.0.50/lisp/org/ob-octave /home/thierry/.emacs.d/elpa/org-20161224/org-timer hides /usr/local/share/emacs/26.0.50/lisp/org/org-timer /home/thierry/.emacs.d/elpa/org-20161224/ob-sql hides /usr/local/share/emacs/26.0.50/lisp/org/ob-sql /home/thierry/.emacs.d/elpa/org-20161224/ob-latex hides /usr/local/share/emacs/26.0.50/lisp/org/ob-latex /home/thierry/.emacs.d/elpa/org-20161224/org-macs hides /usr/local/share/emacs/26.0.50/lisp/org/org-macs /home/thierry/.emacs.d/elpa/org-20161224/org-rmail hides /usr/local/share/emacs/26.0.50/lisp/org/org-rmail /home/thierry/.emacs.d/elpa/org-20161224/org-w3m hides /usr/local/share/emacs/26.0.50/lisp/org/org-w3m /home/thierry/.emacs.d/elpa/org-20161224/ob-io hides /usr/local/share/emacs/26.0.50/lisp/org/ob-io /home/thierry/.emacs.d/elpa/org-20161224/ob hides /usr/local/share/emacs/26.0.50/lisp/org/ob /home/thierry/.emacs.d/elpa/org-20161224/ob-perl hides /usr/local/share/emacs/26.0.50/lisp/org/ob-perl /home/thierry/.emacs.d/elpa/org-20161224/ob-mscgen hides /usr/local/share/emacs/26.0.50/lisp/org/ob-mscgen /home/thierry/.emacs.d/elpa/org-20161224/ob-lilypond hides /usr/local/share/emacs/26.0.50/lisp/org/ob-lilypond /home/thierry/.emacs.d/elpa/org-20161224/org-footnote hides /usr/local/share/emacs/26.0.50/lisp/org/org-footnote /home/thierry/.emacs.d/elpa/org-20161224/ob-java hides /usr/local/share/emacs/26.0.50/lisp/org/ob-java /home/thierry/.emacs.d/elpa/org-20161224/ox-html hides /usr/local/share/emacs/26.0.50/lisp/org/ox-html /home/thierry/.emacs.d/elpa/org-20161224/ob-haskell hides /usr/local/share/emacs/26.0.50/lisp/org/ob-haskell /home/thierry/.emacs.d/elpa/org-20161224/org-docview hides /usr/local/share/emacs/26.0.50/lisp/org/org-docview /home/thierry/.emacs.d/elpa/org-20161224/ob-comint hides /usr/local/share/emacs/26.0.50/lisp/org/ob-comint /home/thierry/.emacs.d/elpa/org-20161224/ob-css hides /usr/local/share/emacs/26.0.50/lisp/org/ob-css /home/thierry/.emacs.d/elpa/org-20161224/ob-ditaa hides /usr/local/share/emacs/26.0.50/lisp/org/ob-ditaa /home/thierry/.emacs.d/elpa/org-20161224/ob-scala hides /usr/local/share/emacs/26.0.50/lisp/org/ob-scala /home/thierry/.emacs.d/elpa/org-20161224/org hides /usr/local/share/emacs/26.0.50/lisp/org/org /home/thierry/.emacs.d/elpa/org-20161224/org-mobile hides /usr/local/share/emacs/26.0.50/lisp/org/org-mobile /home/thierry/.emacs.d/elpa/org-20161224/ob-lisp hides /usr/local/share/emacs/26.0.50/lisp/org/ob-lisp /home/thierry/.emacs.d/elpa/org-20161224/ob-gnuplot hides /usr/local/share/emacs/26.0.50/lisp/org/ob-gnuplot /home/thierry/.emacs.d/elpa/org-20161224/org-src hides /usr/local/share/emacs/26.0.50/lisp/org/org-src /home/thierry/.emacs.d/elpa/org-20161224/ox-ascii hides /usr/local/share/emacs/26.0.50/lisp/org/ox-ascii /home/thierry/.emacs.d/elpa/org-20161224/ob-calc hides /usr/local/share/emacs/26.0.50/lisp/org/ob-calc /home/thierry/.emacs.d/elpa/org-20161224/org-irc hides /usr/local/share/emacs/26.0.50/lisp/org/org-irc /home/thierry/.emacs.d/elpa/org-20161224/org-loaddefs hides /usr/local/share/emacs/26.0.50/lisp/org/org-loaddefs /home/thierry/.emacs.d/elpa/org-20161224/org-install hides /usr/local/share/emacs/26.0.50/lisp/org/org-install /home/thierry/.emacs.d/elpa/org-20161224/org-info hides /usr/local/share/emacs/26.0.50/lisp/org/org-info /home/thierry/.emacs.d/elpa/org-20161224/ob-plantuml hides /usr/local/share/emacs/26.0.50/lisp/org/ob-plantuml /home/thierry/.emacs.d/elpa/org-20161224/org-feed hides /usr/local/share/emacs/26.0.50/lisp/org/org-feed /home/thierry/.emacs.d/elpa/org-20161224/org-version hides /usr/local/share/emacs/26.0.50/lisp/org/org-version /home/thierry/.emacs.d/elpa/org-20161224/ob-makefile hides /usr/local/share/emacs/26.0.50/lisp/org/ob-makefile /home/thierry/.emacs.d/elpa/org-20161224/org-entities hides /usr/local/share/emacs/26.0.50/lisp/org/org-entities /home/thierry/.emacs.d/elpa/org-20161224/ob-python hides /usr/local/share/emacs/26.0.50/lisp/org/ob-python /home/thierry/.emacs.d/elpa/org-20161224/ob-ledger hides /usr/local/share/emacs/26.0.50/lisp/org/ob-ledger /home/thierry/.emacs.d/elpa/org-20161224/ox-man hides /usr/local/share/emacs/26.0.50/lisp/org/ox-man /home/thierry/.emacs.d/elpa/org-20161224/ob-shen hides /usr/local/share/emacs/26.0.50/lisp/org/ob-shen /home/thierry/.emacs.d/elpa/org-20161224/org-inlinetask hides /usr/local/share/emacs/26.0.50/lisp/org/org-inlinetask /home/thierry/.emacs.d/elpa/org-20161224/org-list hides /usr/local/share/emacs/26.0.50/lisp/org/org-list /home/thierry/.emacs.d/elpa/org-20161224/ox-publish hides /usr/local/share/emacs/26.0.50/lisp/org/ox-publish /home/thierry/.emacs.d/elpa/org-20161224/org-gnus hides /usr/local/share/emacs/26.0.50/lisp/org/org-gnus /home/thierry/.emacs.d/elpa/org-20161224/org-agenda hides /usr/local/share/emacs/26.0.50/lisp/org/org-agenda /home/thierry/.emacs.d/elpa/org-20161224/org-id hides /usr/local/share/emacs/26.0.50/lisp/org/org-id /home/thierry/.emacs.d/elpa/org-20161224/org-plot hides /usr/local/share/emacs/26.0.50/lisp/org/org-plot /home/thierry/.emacs.d/elpa/org-20161224/ob-C hides /usr/local/share/emacs/26.0.50/lisp/org/ob-C /home/thierry/.emacs.d/elpa/org-20161224/org-clock hides /usr/local/share/emacs/26.0.50/lisp/org/org-clock /home/thierry/.emacs.d/elpa/org-20161224/org-attach hides /usr/local/share/emacs/26.0.50/lisp/org/org-attach /home/thierry/.emacs.d/elpa/org-20161224/ob-ruby hides /usr/local/share/emacs/26.0.50/lisp/org/ob-ruby /home/thierry/.emacs.d/elpa/org-20161224/org-habit hides /usr/local/share/emacs/26.0.50/lisp/org/org-habit /home/thierry/.emacs.d/elpa/org-20161224/org-eshell hides /usr/local/share/emacs/26.0.50/lisp/org/org-eshell /home/thierry/.emacs.d/elpa/org-20161224/ob-ocaml hides /usr/local/share/emacs/26.0.50/lisp/org/ob-ocaml /home/thierry/.emacs.d/elpa/org-20161224/ox-odt hides /usr/local/share/emacs/26.0.50/lisp/org/ox-odt /home/thierry/.emacs.d/elpa/org-20161224/ob-exp hides /usr/local/share/emacs/26.0.50/lisp/org/ob-exp /home/thierry/.emacs.d/elpa/org-20161224/ob-dot hides /usr/local/share/emacs/26.0.50/lisp/org/ob-dot /home/thierry/.emacs.d/elpa/org-20161224/ob-scheme hides /usr/local/share/emacs/26.0.50/lisp/org/ob-scheme /home/thierry/.emacs.d/elpa/org-20161224/ob-org hides /usr/local/share/emacs/26.0.50/lisp/org/ob-org /home/thierry/.emacs.d/elpa/org-20161224/org-bibtex hides /usr/local/share/emacs/26.0.50/lisp/org/org-bibtex /home/thierry/.emacs.d/elpa/org-20161224/org-compat hides /usr/local/share/emacs/26.0.50/lisp/org/org-compat /home/thierry/.emacs.d/elpa/org-20161224/ox-icalendar hides /usr/local/share/emacs/26.0.50/lisp/org/ox-icalendar /home/thierry/.emacs.d/elpa/org-20161224/org-colview hides /usr/local/share/emacs/26.0.50/lisp/org/org-colview /home/thierry/.emacs.d/elpa/org-20161224/ob-picolisp hides /usr/local/share/emacs/26.0.50/lisp/org/ob-picolisp /home/thierry/.emacs.d/elpa/org-20161224/org-mhe hides /usr/local/share/emacs/26.0.50/lisp/org/org-mhe /home/thierry/.emacs.d/elpa/org-20161224/org-table hides /usr/local/share/emacs/26.0.50/lisp/org/org-table /home/thierry/.emacs.d/elpa/org-20161224/ob-clojure hides /usr/local/share/emacs/26.0.50/lisp/org/ob-clojure /home/thierry/.emacs.d/elpa/org-20161224/ob-tangle hides /usr/local/share/emacs/26.0.50/lisp/org/ob-tangle /home/thierry/.emacs.d/elpa/org-20161224/ob-table hides /usr/local/share/emacs/26.0.50/lisp/org/ob-table /home/thierry/.emacs.d/elpa/org-20161224/ob-asymptote hides /usr/local/share/emacs/26.0.50/lisp/org/ob-asymptote /home/thierry/.emacs.d/elpa/org-20161224/org-ctags hides /usr/local/share/emacs/26.0.50/lisp/org/org-ctags /home/thierry/.emacs.d/elpa/org-20161224/ob-screen hides /usr/local/share/emacs/26.0.50/lisp/org/ob-screen /home/thierry/.emacs.d/elpa/org-20161224/org-protocol hides /usr/local/share/emacs/26.0.50/lisp/org/org-protocol /home/thierry/.emacs.d/elpa/org-20161224/ob-js hides /usr/local/share/emacs/26.0.50/lisp/org/ob-js /home/thierry/.emacs.d/elpa/org-20161224/ob-lob hides /usr/local/share/emacs/26.0.50/lisp/org/ob-lob Features: (mail-extr sort shadow epa-mail face-remap emacsbug whitespace helm-ls-git vc vc-dispatcher helm-misc helm-dabbrev eieio-opt help-fns radix-tree tabify helm-command helm-imenu js sgml-mode dom imenu slime-xref-browser tree-widget slime-banner slime-tramp slime-asdf slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse slime etags xref project arc-mode archive-mode hyperspec make-mode cc-awk macrostep-c cmacexp macrostep cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs conf-mode vc-git naquadah-theme view solar cal-dst holidays hol-loaddefs em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias tv-utils gh gh-users gh-issues gh-pulls gh-repos gh-comments gh-gist gh-oauth gh-api logito gh-cache pcache eieio-base gh-auth gh-url url-http tls gnutls url-auth url-gw nsm disable-mouse powerline powerline-separators color powerline-themes windmove benchmark-init toc-org ert ewoc debug elp cl-indent esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util markdown-mode addressbook-bookmark mu4e-config org-mu4e helm-mu mu4e-contrib mu4e desktop frameset mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main mu4e-context mu4e-view mu4e-headers mu4e-compose mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils mu4e-lists mu4e-vars hl-line cl mu4e-meta config-w3m w3m-search w3m doc-view jka-compr timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util git-gutter cus-edit wid-edit appt diary-lib diary-loaddefs ange-ftp xdvi-search eldoc-eval undo-tree diff magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-branch magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode magit-git crm magit-section magit-popup git-commit magit-utils log-edit message subr-x puny rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor tramp-sh server pcomplete-extension pcmpl-unix pcmpl-gnu psession iterator iedit iedit-lib dired-extension org-config-thierry ob-sh org-crypt org-element avl-tree org-location-google-maps org-agenda google-maps google-maps-static google-maps-geocode google-maps-base org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs dired-async net-utils time winner w3m-wget wget wget-sysdep cmake-mode autotest-mode autoconf-mode sh-script smie executable ps-print ps-print-loaddefs ps-def lpr rst image-file savehist paren woman man ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff init-helm-thierry helm-descbinds helm-sys popup helm-ring helm-elisp helm-eval edebug helm-mode helm-files image-dired image-mode tramp tramp-compat tramp-loaddefs trampver shell pcomplete parse-time format-spec dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptive helm-info bookmark pp helm-locate helm-grep wgrep-helm wgrep grep helm-regexp helm-external helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap helm-utils compile comint ansi-color ring helm-help helm-types helm helm-source helm-multi-match helm-lib dired dired-loaddefs helm-extensions-autoloads helm-config helm-autoloads helm-easymenu async-bytecomp advice async mb-depth edmacro kmacro use-package diminish bind-key easy-mmode finder-inf tex-site gh-common gh-profile rx s ucs-normalize marshal eieio-compat ht json map dash slime-autoloads info package url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv time-date avoid cus-start cus-load cl-loaddefs pcase cl-lib mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors 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 composite charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray 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 dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 878437 367693) (symbols 48 66030 13) (miscs 40 9143 3337) (strings 32 204861 111153) (string-bytes 1 7231121) (vectors 16 104738) (vector-slots 8 1950618 149106) (floats 8 3475 3306) (intervals 56 12606 6385) (buffers 976 203) (heap 1024 108498 9771)) -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 11:01:39 2017 Received: (at 25482) by debbugs.gnu.org; 19 Jan 2017 16:01:39 +0000 Received: from localhost ([127.0.0.1]:35688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUF9e-0006PD-Ve for submit@debbugs.gnu.org; Thu, 19 Jan 2017 11:01:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUF9d-0006P0-Kp for 25482@debbugs.gnu.org; Thu, 19 Jan 2017 11:01:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUF9T-0005ST-I0 for 25482@debbugs.gnu.org; Thu, 19 Jan 2017 11:01:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUF9T-0005SP-F9; Thu, 19 Jan 2017 11:01:27 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3363 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cUF9R-0002Xx-Qf; Thu, 19 Jan 2017 11:01:27 -0500 Date: Thu, 19 Jan 2017 18:01:12 +0200 Message-Id: <83lgu76nuf.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <871svzzcn4.fsf@gmail.com> (message from Thierry Volpiatto on Thu, 19 Jan 2017 09:18:07 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Date: Thu, 19 Jan 2017 09:18:07 +0100 > > > Actually it is not possible to customize easily > `query-replace-from-to-separator` and it is impossible to set it to nil. > > If I use `setq`, `custom-reevaluate-setting` reevaluate the original > sexp from `query-replace-from-to-separator` and if I use customize I can > add a string or a sexp, nothing else. > But the code in `query-replace-read-from` is checking if > `query-replace-from-to-separator` is non-nil, which is impossible > actually. > Thus it adds difficulties to load such sexp when dumping emacs. > > I would expect setting `query-replace-from-to-separator` to nil to > retrieve same behavior as emacs-24.5 and not have unicode strings in my > minibuffer-history. Sorry, I don't think I follow: you should be able to set this variable to " -> ", a string, to get the old behavior and avoid non-ASCII strings in your minibuffer-history. So why did you need the value of nil? > + (when (stringp query-replace-from-to-separator) > + (setq query-replace-from-to-separator > + (propertize (if (char-displayable-p > + (string-to-char query-replace-from-to-separator)) This doesn't look right: string-to-char will return the blank character, which is the first character of " → ", and I don't think you meant that. In any case, this looks more complex than it has to be, because you for some reason want to have the nil value. Please elaborate on the need for that. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 00:42:20 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 05:42:20 +0000 Received: from localhost ([127.0.0.1]:35977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cURxs-0000ck-AE for submit@debbugs.gnu.org; Fri, 20 Jan 2017 00:42:20 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cURxr-0000cW-AL for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 00:42:19 -0500 Received: by mail-wm0-f46.google.com with SMTP id c85so23046283wmi.1 for <25482@debbugs.gnu.org>; Thu, 19 Jan 2017 21:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yqOY8CNPFfEkUoQcig2+vkGlnWOCGUpiAG2CUapLy9U=; b=kD5V/uOn44OKc3KlNALCkZTUAtTnfK1LjD3ViIImxfvfIX2am7sq20LODeqSjUUDUV QgVrQ1FrsC2pOGiCHMk49SBlVwCew0ub9AVCox8ldqqifn8rbGJhK0z0oaMD3/hwJSmJ AtlyluWFAWv9gv8wuYygwUnABGaup6fwrA+gRI8DV/gEoxUAEWMNVL5hekgjwRhDE2eb 8U+rWbpvxTITKFATcST2ENifx4P+NLp9MdoYrLbIxAS+16ywh/kpIgc64L1y1VmGmGpt ZRuDWYhRgHQZWXCX5EGA7aWIvwKfVcBCLS4oBLFxqCzby9lj2tcnWgZT0aZ8FBiwI3zO AJ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :message-id:mime-version:content-transfer-encoding; bh=yqOY8CNPFfEkUoQcig2+vkGlnWOCGUpiAG2CUapLy9U=; b=FL/AMwEAYxTQyiwLmD99dwr3VtJ7gAtDgrB8zLYdv+DA1Q/xjKe/2U0UFZISqsUF8s bqGwKucqnLQM0KvUzOlv3Wgda1hh5fEuupghkunNKBbgu7P83jpjnl3Z8GrLuifRhfP0 mz+zd6VeZKF2gawS0pDBrSsxIrXqSdzdS6mtDi2TFgFG/GoYNwTjNeIsd8+HiYYbKScI hZSPe0Xvtf1Ti4pWwLGlOaia6LFkheNJUhNwQwK9auhAeqqT8O342Mt9bk37aLoKJ9iw 4Lv5v6YTC5G5lcBGY4BNmj63KldS508KTk1TkmoyLgnLMgFSUFcpSanGj9d5fHTmUqn0 cVMw== X-Gm-Message-State: AIkVDXIO0cuFhaLW2IBF18U3vAe0K/mpcZukvdqkQ9RKphbKfJ78vQaTgKDzQXXRs7PiGg== X-Received: by 10.223.176.93 with SMTP id g29mr10066530wra.12.1484890933286; Thu, 19 Jan 2017 21:42:13 -0800 (PST) Received: from dell-14z ([37.160.42.143]) by smtp.gmail.com with ESMTPSA id e14sm3437676wmd.14.2017.01.19.21.42.11 for <25482@debbugs.gnu.org> (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 19 Jan 2017 21:42:12 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: 25482@debbugs.gnu.org Subject: Fwd: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Date: Fri, 20 Jan 2017 06:42:10 +0100 Message-ID: <87r33yb83x.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 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.5 (/) Thierry Volpiatto writes: > Eli Zaretskii writes: > >> Sorry, I don't think I follow: you should be able to set this variable >> to " -> ", a string, to get the old behavior and avoid non-ASCII >> strings in your minibuffer-history. > > No, you don't have the same behavior, you endup with a non ascii string > which goes to minibuffer-history, so the behavior is not as emacs-24.5 > if you set this variable to " -> ". > >> So why did you need the value of nil? > > Because when it is nil the string is not added to history, just like in > 24.5. > >>> + (when (stringp query-replace-from-to-separator) >>> + (setq query-replace-from-to-separator >>> + (propertize (if (char-displayable-p >>> + (string-to-char query-replace-from-to-separator)) >> >> This doesn't look right: string-to-char will return the blank >> character, which is the first character of " → ", and I don't think >> you meant that. > > Yes, you are right, thanks, however see how the actual code is wrong, > what if someone set the separator to another unicode string. > >> In any case, this looks more complex than it has to be, because you >> for some reason want to have the nil value. Please elaborate on the >> need for that. > > To retrieve the same behavior as in emacs-24.5, see above. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 00:54:12 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 05:54:12 +0000 Received: from localhost ([127.0.0.1]:35984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUS9M-0000tL-FZ for submit@debbugs.gnu.org; Fri, 20 Jan 2017 00:54:12 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUS9L-0000t6-Fi for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 00:54:11 -0500 Received: by mail-wm0-f52.google.com with SMTP id c85so23302386wmi.1 for <25482@debbugs.gnu.org>; Thu, 19 Jan 2017 21:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=rx7TGHmeUF0zRauYAnHvi5yKcIQY4lYEvk/QPARkhx0=; b=a2fX9DmKsZxPhEaOQ8T+LpDwtXz4o/XAkb50Cc8g+U6vJ4R80yqqfxm9OP9AndUCac 3ihOZEDlk83NSxzlhAjI5W82l7mOZ/w/6Ydp8kHBR6yePSwdzx8QOIONA6aG5TmA+hDk MzXe1+3VWoQXCLcY+JU4AyGaswi27oa4WAj8i4aHqBrQ2pL3+iUIW0L/6z9tjOAU3V+V GxnrkoYbJ5iGMxwzFwdJsxjSdqSf2ccSzO91r+ddw/5P0mYfq8mwBC2rw3tzxjVCNB92 7Xuo5MPf7ho9+8iGwI24SVccuBuiThRmP5FNz51xikx32o0y2s+0YWXGo5WN4bYi2eHw QXhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=rx7TGHmeUF0zRauYAnHvi5yKcIQY4lYEvk/QPARkhx0=; b=f31D8vGVi1OhhyeN2KwgtpZHDG/obfnfEcWZuG65Ffia/IL2RILUvlPUz+d/PnPDtq YLrAw7K98d2A9hlB++NGFMPyJpxcX8Xk3EQWOIwcbdJ6lJ8OEoAy7m8FF0B8rX0qCCa2 PKNhgf9aKGDiJNfjP1CThLD8TdOJSETxSAfbNKscaWksRRfJwoz+l3ArvbIvLP+O7Pty zjm2PFmeM+e6pHkkgdB+g2FU36ko6Sw65Sh9N31CYFDkIqP1neOuIUuIzMANW7CcFFzK W7lcpSe9V8q3XsfUu0xyGdmj89XgpMuoqMaIRRL1ifl8rPAOc9Yy/smuK6+NdLUrQkX/ aV6Q== X-Gm-Message-State: AIkVDXIT4H9nZEZWvTYwMwoeJlcpCrkKUnfD4mSX1qSEdHmYCW7GIYr6khSfl7n+Z4HDzw== X-Received: by 10.28.169.135 with SMTP id s129mr1779927wme.24.1484891645667; Thu, 19 Jan 2017 21:54:05 -0800 (PST) Received: from dell-14z ([37.160.42.143]) by smtp.gmail.com with ESMTPSA id y97sm3479819wmh.24.2017.01.19.21.54.04 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 19 Jan 2017 21:54:04 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83lgu76nuf.fsf@gnu.org> Date: Fri, 20 Jan 2017 06:54:02 +0100 Message-ID: <87pojib7k5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Here the patch updated: 1 file changed, 25 insertions(+), 16 deletions(-) lisp/replace.el | 41 +++++++++++++++++++++++++---------------- modified lisp/replace.el @@ -79,15 +79,15 @@ That becomes the \"string to replace\".") to the minibuffer that reads the string to replace, or invoke replacements from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") -(defcustom query-replace-from-to-separator - (propertize (if (char-displayable-p ?→) " → " " -> ") - 'face 'minibuffer-prompt) - "String that separates FROM and TO in the history of replacement pairs." - ;; Avoids error when attempt to autoload char-displayable-p fails - ;; while preparing to dump, also stops customize-rogue listing this. - :initialize 'custom-initialize-delay +(defcustom query-replace-from-to-separator " → " + "String that separates FROM and TO in the history of replacement pairs. +When nil the default separator \" -> \" will be used as a plain string +and the pair will not be added to `query-replace-history' +\(Same behavior as in emacs 24.5)." :group 'matching - :type '(choice string (sexp :tag "Display specification")) + :type '(choice + (const :tag "Disabled" nil) + string) :version "25.1") (defcustom query-replace-from-history-variable 'query-replace-history @@ -165,9 +165,15 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) - ;; Reevaluating will check char-displayable-p that is - ;; unavailable while preparing to dump. - (custom-reevaluate-setting 'query-replace-from-to-separator) + (when (stringp query-replace-from-to-separator) + (setq query-replace-from-to-separator + (propertize (if (char-displayable-p + (string-to-char + (replace-regexp-in-string + " " "" query-replace-from-to-separator))) + query-replace-from-to-separator + " -> ") + 'face 'minibuffer-prompt))) (let* ((history-add-new-input nil) (separator (when query-replace-from-to-separator @@ -185,9 +191,13 @@ wants to replace FROM with TO." (symbol-value query-replace-from-history-variable))) (minibuffer-allow-text-properties t) ; separator uses text-properties (prompt - (if (and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history)) - (format "%s: " prompt))) + (cond ((and query-replace-defaults separator) + (format "%s (default %s): " prompt (car minibuffer-history))) + (query-replace-defaults + (format "%s (default %s -> %s): " prompt + (query-replace-descr (caar query-replace-defaults)) + (query-replace-descr (cdar query-replace-defaults)))) + (t (format "%s: " prompt)))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. @@ -200,8 +210,7 @@ wants to replace FROM with TO." (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))))) + prompt nil nil nil nil (car search-ring) t))))) (to)) (if (and (zerop (length from)) query-replace-defaults) (cons (caar query-replace-defaults) -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 02:56:51 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 07:56:51 +0000 Received: from localhost ([127.0.0.1]:36007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUU43-0003qh-K7 for submit@debbugs.gnu.org; Fri, 20 Jan 2017 02:56:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUU41-0003qT-4D for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 02:56:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUU3q-000811-Tj for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 02:56:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUU3q-00080p-Q6; Fri, 20 Jan 2017 02:56:38 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4100 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cUU3p-00030w-Vv; Fri, 20 Jan 2017 02:56:38 -0500 Date: Fri, 20 Jan 2017 09:56:29 +0200 Message-Id: <83a8am6u6q.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87vatac0a2.fsf@gmail.com> (message from Thierry Volpiatto on Thu, 19 Jan 2017 20:33:41 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) [You've replied only to me.] > From: Thierry Volpiatto > Date: Thu, 19 Jan 2017 20:33:41 +0100 > > > Eli Zaretskii writes: > > > Sorry, I don't think I follow: you should be able to set this variable > > to " -> ", a string, to get the old behavior and avoid non-ASCII > > strings in your minibuffer-history. > > No, you don't have the same behavior, you endup with a non ascii string > which goes to minibuffer-history, so the behavior is not as emacs-24.5 > if you set this variable to " -> ". So you are saying that even setting the string to " -> " gets " → " into the history? If so, that's the bug that we should solve, I think. > > So why did you need the value of nil? > > Because when it is nil the string is not added to history, just like in > 24.5. Is it a problem to have the ASCII " -> " in the history? Assuming we solve this part of the problem, would you still need to disable adding the string to the history? From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 06:35:55 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 11:35:55 +0000 Received: from localhost ([127.0.0.1]:36064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUXU3-0000ZO-Ck for submit@debbugs.gnu.org; Fri, 20 Jan 2017 06:35:55 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUXU1-0000ZA-Rz for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 06:35:54 -0500 Received: by mail-wm0-f42.google.com with SMTP id c206so39176697wme.0 for <25482@debbugs.gnu.org>; Fri, 20 Jan 2017 03:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=Lp59q0RXELCRce+Piwcyjd14zFsl8Nuy2ZdRd1bjpkQ=; b=guhjhvoHVH+KPTBsVc8T4SIECXDdtjeuiM05koe6u8sOhkBX3wTG1N/hd7Kxq8J/eA vYBjcF8j3uieW/Yn99wlw5M8fsLzqA5Ye8SQViS51wz07yQdehary8DP0XKMitxKNrLB HKk6LtNqivgPjwN3TAxjzmNvBOrw4WLOvSNzwdBZeedpqtOZPaJKJwxLXespc27LutBk iT0D9lwnISZbEEPNs9itk0YmGAaELE9xdpEORg4nqwWm1/3XZgW4iq11zBHMSMW1h2BC 0Xnnx67dmNMJh0gzqodSwmsGVbk1ZbByYt/Sb/zhDXRUX/vZTfNKGN6wdcGN3GWEBrI5 S/jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=Lp59q0RXELCRce+Piwcyjd14zFsl8Nuy2ZdRd1bjpkQ=; b=cay7qPHZeDLLwbbODSOfsCMTh2oLrq7kJowVybgB+PXhPzWI6Aa+FgRb5kHJ+D/Pic 3PnLHbVXn9VEAmkGisKEnyAORsZ9kjD8KtmjFXq8hBTRgrMjlFxJl3YP6ltZwAVue0Ku 3huoY8sXzGmjZO9pAsysbZEg9DKfevP3/g56YFIaoQu+bovz9B6RClworvmTd64H7Zb0 9TFNLFWOsgExcf41UuDL5WwOtyxZNVaECSE8vsNIWHFPTh/zSLEMg5sGZa71eMXS+Lf4 eM2UsoOO074r5rhot1jCuQwhz96GmV8QAkgycZZ+NR+EkBqvw1E/v8Qd0OJj2CpIHfvl Kuyw== X-Gm-Message-State: AIkVDXKHgIjAqBpYYbe2jkvUfvSc17IDBV1iJ3sbXO9t0M9kau2LQcSPrNZwdoNU5mIfgQ== X-Received: by 10.223.173.183 with SMTP id w52mr13648743wrc.164.1484912147898; Fri, 20 Jan 2017 03:35:47 -0800 (PST) Received: from MM061 (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by smtp.gmail.com with ESMTPSA id a13sm5573277wma.0.2017.01.20.03.35.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2017 03:35:46 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83a8am6u6q.fsf@gnu.org> Date: Fri, 20 Jan 2017 12:35:29 +0100 Message-ID: <87y3y6ezge.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii 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 "fromto" 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 "fromto" 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 08:07:26 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 13:07:26 +0000 Received: from localhost ([127.0.0.1]:36110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUYuc-00068n-Ad for submit@debbugs.gnu.org; Fri, 20 Jan 2017 08:07:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUYua-00068c-W3 for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 08:07:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUYuP-00019M-Vr for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 08:07:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUYuP-00019G-SX; Fri, 20 Jan 2017 08:07:13 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3987 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cUYuO-0001FV-0J; Fri, 20 Jan 2017 08:07:13 -0500 Date: Fri, 20 Jan 2017 15:06:59 +0200 Message-Id: <8337gd7udo.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87y3y6ezge.fsf@gmail.com> (message from Thierry Volpiatto on Fri, 20 Jan 2017 12:35:29 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Fri, 20 Jan 2017 12:35:29 +0100 > > 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 > "fromto" 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 > "fromto" to history. > > The default setting is the same as the actual code, no change. Yes, I understand. I'm asking whether the (fixed) behavior, whereby using setq to change the value to " -> " would add the ASCII string " -> " to the minibuffer history, would be acceptable. If not, please tell why. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 10:16:55 2017 Received: (at 25482) by debbugs.gnu.org; 20 Jan 2017 15:16:55 +0000 Received: from localhost ([127.0.0.1]:36559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUavv-0000lT-37 for submit@debbugs.gnu.org; Fri, 20 Jan 2017 10:16:55 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUavt-0000lF-IR for 25482@debbugs.gnu.org; Fri, 20 Jan 2017 10:16:54 -0500 Received: by mail-wm0-f42.google.com with SMTP id c85so41317269wmi.1 for <25482@debbugs.gnu.org>; Fri, 20 Jan 2017 07:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:message-id:in-reply-to :date:mime-version; bh=Zjo7OhpfshZAPGlAgmmGzlT3UecMzT7O/J861yQNw8o=; b=ofC4aZyMPBmRGhm+JBE8cSJOJEF+K9+YBrw5cZsSBUopd+mT4RL71+G5FhrK0ickMQ 4O2qkOK3n8ki4Qv2VQFGR6UMCM2O5Dk+MG9glnOZcZomqUy3a1ot594KZORgnh+T9oW+ Oj62gCBb0rwcomh3WaTaGFyTzjjaC6b2fn3vB7Jmhf+g2EbGA/8ARsX0vIP7Lnx5m9XF bYEl3mZyOKm3L8Xcfa2qfpRlfrswCHb5hLbm4r4QfuaB2pxE18YNYrfXkTMNqmjQYetF kzIFUBnGY80wdYcIXzTaDQ3vQNd/ozGzqbm29X9qNPkilGV5T0t7exwFjx5pTX+5UHUw 7M9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :message-id:in-reply-to:date:mime-version; bh=Zjo7OhpfshZAPGlAgmmGzlT3UecMzT7O/J861yQNw8o=; b=SvC6nSdBmgiYjUuWIIi7Yxi3ncYfxGlR2vOb4eoCyIkVNFqV/LNdxmhnBCWQdz/lsU yk6lqNXzzCKfLaX0IdkyWy7Afu9/+CQCRN3Ji+xRUItwJwXO6qjxY320QScRD8FrRjWD 8qf7y3xIRn+F+VWeQuoGvF1ta9zm571vd3XmHHyMNcqK91iXNozqaV68NTsd0lg3mGC8 5MstFpCK7dW2otAQiQ8msbJK6+2Kz6y571EUW4JbmWp4J5HWfchZaOQy0lOqqbcQXjQU obc79P9TuWaLh5yaErK9HkQpmg2AXiv6xzbRQnnnpvC333M0SwZqaiut/y5smyrn4Bzs VG0Q== X-Gm-Message-State: AIkVDXKRnJGOWDNz5H5mjDE8jSQePQbd4/mwlyAoZ4NhFcmCTh+6IL8ESvLUfLLzKkH9mQ== X-Received: by 10.28.0.2 with SMTP id 2mr3968340wma.141.1484925407833; Fri, 20 Jan 2017 07:16:47 -0800 (PST) Received: from MM061 (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by smtp.gmail.com with ESMTPSA id t194sm14347277wmd.1.2017.01.20.07.16.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2017 07:16:46 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Message-ID: <87o9z1n4o3.fsf@gmail.com> In-reply-to: <8337gd7udo.fsf@gnu.org> Date: Fri, 20 Jan 2017 16:16:34 +0100 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: > I'm asking whether the (fixed) behavior, whereby using setq to change > the value to " -> " would add the ASCII string " -> " to the > minibuffer history, would be acceptable. If not, please tell why. Would be good, but we will have to modify also `query-replace--split-string` just for this purpose as it assume the separator is one char long and have a text property 'separator. I wanted to keep things as simple as possible in this patch. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 21 05:06:16 2017 Received: (at 25482) by debbugs.gnu.org; 21 Jan 2017 10:06:16 +0000 Received: from localhost ([127.0.0.1]:36877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUsYp-0001we-M7 for submit@debbugs.gnu.org; Sat, 21 Jan 2017 05:06:16 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUsYn-0001wR-Nb for 25482@debbugs.gnu.org; Sat, 21 Jan 2017 05:06:14 -0500 Received: by mail-wm0-f49.google.com with SMTP id r144so80526900wme.1 for <25482@debbugs.gnu.org>; Sat, 21 Jan 2017 02:06:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=YfzCpBqZOzgRPgTqfjYvxZ72fpdjBfRZUFMd5kmdWm0=; b=GZexevG4Kq0wioETdN8sjzFavlaEiH1J+irpCbX/XwKZKcBDsuOom4bC9CkeDJUBhq VL75BPgicOBM9iPsKMdovmOJWZA7AmCOM2h3ASD9SJVCYwRBOOvl09nQUFQULAUSw3N+ fFY+nBsV3F0WJOyLuxXzBGEKQ+Pt/ge0w/GvccJuuOvWAXdKc7mu1sP3mqniCjMZdObe mFrf1NTt2itcRWI3kMv0/Zecl+pCMc1wvDAf0+Sz4MhPBqz8a8zceUSFI0vMFezVBIzh agq3FqG3bSTIAecNbrUv8aryue2NeNa6gWp4KSXaYVQmUQ5Fl99WRnx5JdXIvIdEqfzM stMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=YfzCpBqZOzgRPgTqfjYvxZ72fpdjBfRZUFMd5kmdWm0=; b=TDkkoAP/fWgq42oA4MCC7SaSbV+WqUvJn1rNeYpa9jx2vcLnFzBjZasEj3ud7mLinI 6a4sGsHeRQAGhyCs++sHehXFF68hCrC83MDstMOfeHFIGmA9UUcHrgeqgqKgKBO0+eme fUbGuwW4DLwe5XLJ7z1cbI+CJNvRtv2IoZoQboebC4nLYtf1b7aTffYPRDxQFhAVlKSW vIOL0aAU8dSLRKwDkCPgpxAYjErAEMr+ttYryspYuxELV0kjuGMYBhi8UGZdvbFMgika uEUsZiH4BZjdE4E8n5WNy0cnYQ2rqPWmQ46g3IPhvTEK12RMtE8UZ5vZ2+3NJBfa2e3e FP3Q== X-Gm-Message-State: AIkVDXI/bS9ocFMK0k3fbdDJgHFUFJmR1i+pRup754sqyrimlLUPh/W1yKjhB1sCQENQsA== X-Received: by 10.28.188.213 with SMTP id m204mr6476673wmf.0.1484993167465; Sat, 21 Jan 2017 02:06:07 -0800 (PST) Received: from dell-14z ([37.168.21.33]) by smtp.gmail.com with ESMTPSA id g40sm3700190wrg.19.2017.01.21.02.06.02 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 21 Jan 2017 02:06:06 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <8337gd7udo.fsf@gnu.org> Date: Sat, 21 Jan 2017 11:05:59 +0100 Message-ID: <87a8akiv7c.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: > I'm asking whether the (fixed) behavior, whereby using setq to change > the value to " -> " would add the ASCII string " -> " to the > minibuffer history, would be acceptable. If not, please tell why. Here the patch updated adding the plain string to history when it is an ascii string. 1 file changed, 92 insertions(+), 74 deletions(-) lisp/replace.el | 166 +++++++++++++++++++++++++++++++------------------------- modified lisp/replace.el @@ -79,15 +79,17 @@ That becomes the \"string to replace\".") to the minibuffer that reads the string to replace, or invoke replacements from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") -(defcustom query-replace-from-to-separator - (propertize (if (char-displayable-p ?→) " → " " -> ") - 'face 'minibuffer-prompt) - "String that separates FROM and TO in the history of replacement pairs." - ;; Avoids error when attempt to autoload char-displayable-p fails - ;; while preparing to dump, also stops customize-rogue listing this. - :initialize 'custom-initialize-delay +(defcustom query-replace-from-to-separator " → " + "String that separates FROM and TO in the history of replacement pairs. +When non-nil, the pair (FROM TO) will be added to `query-replace-history' as +a string \"FROMTO\". +When nil the default separator \" -> \" will be used as a plain string +and the pair will not be added to `query-replace-history' +\(Same behavior as in emacs 24.5)." :group 'matching - :type '(choice string (sexp :tag "Display specification")) + :type '(choice + (const :tag "Disabled" nil) + string) :version "25.1") (defcustom query-replace-from-history-variable 'query-replace-history @@ -150,14 +152,20 @@ See `replace-regexp' and `query-replace-regexp-eval'.") (mapconcat 'isearch-text-char-description string "")) (defun query-replace--split-string (string) - "Split string STRING at a character with property `separator'" + "Split string STRING at `query-replace-from-to-separator'. +Split at a character with property `separator' or at place matching regexp +`query-replace-from-to-separator'." (let* ((length (length string)) (split-pos (text-property-any 0 length 'separator t string))) - (if (not split-pos) - (substring-no-properties string) - (cl-assert (not (text-property-any (1+ split-pos) length 'separator t string))) - (cons (substring-no-properties string 0 split-pos) - (substring-no-properties string (1+ split-pos) length))))) + (cond (split-pos + (cl-assert (not (text-property-any + (1+ split-pos) length 'separator t string))) + (cons (substring-no-properties string 0 split-pos) + (substring-no-properties string (1+ split-pos) length))) + ((string-match query-replace-from-to-separator string) + (cons (substring-no-properties string 0 (match-beginning 0)) + (substring-no-properties string (match-end 0) length))) + (t (substring-no-properties string))))) (defun query-replace-read-from (prompt regexp-flag) "Query and return the `from' argument of a query-replace operation. @@ -165,66 +173,76 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) - ;; Reevaluating will check char-displayable-p that is - ;; unavailable while preparing to dump. - (custom-reevaluate-setting 'query-replace-from-to-separator) - (let* ((history-add-new-input nil) - (separator - (when query-replace-from-to-separator - (propertize "\0" - 'display query-replace-from-to-separator - 'separator t))) - (minibuffer-history - (append - (when separator - (mapcar (lambda (from-to) - (concat (query-replace-descr (car from-to)) - separator - (query-replace-descr (cdr from-to)))) - query-replace-defaults)) - (symbol-value query-replace-from-history-variable))) - (minibuffer-allow-text-properties t) ; separator uses text-properties - (prompt - (if (and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history)) - (format "%s: " prompt))) - (from - ;; The save-excursion here is in case the user marks and copies - ;; a region in order to specify the minibuffer input. - ;; That should not clobber the region for the query-replace itself. - (save-excursion - (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 'minibuffer-history) - (read-from-minibuffer - prompt nil nil nil nil - (car (if regexp-flag regexp-search-ring search-ring)) t))))) - (to)) - (if (and (zerop (length from)) query-replace-defaults) - (cons (caar query-replace-defaults) - (query-replace-compile-replacement - (cdar query-replace-defaults) regexp-flag)) - (setq from (query-replace--split-string from)) - (when (consp from) (setq to (cdr from) from (car from))) - (add-to-history query-replace-from-history-variable from nil t) - ;; Warn if user types \n or \t, but don't reject the input. - (and regexp-flag - (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) - (let ((match (match-string 3 from))) - (cond - ((string= match "\\n") - (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) - ((string= match "\\t") - (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) - (sit-for 2))) - (if (not to) - from - (add-to-history query-replace-to-history-variable to nil t) - (add-to-history 'query-replace-defaults (cons from to) nil t) - (cons from (query-replace-compile-replacement to regexp-flag))))))) + (let ((sep-char (replace-regexp-in-string + " " "" query-replace-from-to-separator))) + (when (stringp query-replace-from-to-separator) + (setq query-replace-from-to-separator + (propertize (if (char-displayable-p (string-to-char sep-char)) + query-replace-from-to-separator + " -> ") + 'face 'minibuffer-prompt))) + (let* ((history-add-new-input nil) + (separator + (if (and query-replace-from-to-separator + (> (string-bytes sep-char) (length sep-char))) + (propertize "\0" + 'display query-replace-from-to-separator + 'separator t) + (propertize query-replace-from-to-separator 'separator t))) + (minibuffer-history + (append + (when separator + (mapcar (lambda (from-to) + (concat (query-replace-descr (car from-to)) + separator + (query-replace-descr (cdr from-to)))) + query-replace-defaults)) + (symbol-value query-replace-from-history-variable))) + (minibuffer-allow-text-properties t) ; separator uses text-properties + (prompt + (cond ((and query-replace-defaults separator) + (format "%s (default %s): " prompt (car minibuffer-history))) + (query-replace-defaults + (format "%s (default %s -> %s): " prompt + (query-replace-descr (caar query-replace-defaults)) + (query-replace-descr (cdar query-replace-defaults)))) + (t (format "%s: " prompt)))) + (from + ;; The save-excursion here is in case the user marks and copies + ;; a region in order to specify the minibuffer input. + ;; That should not clobber the region for the query-replace itself. + (save-excursion + (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 'minibuffer-history) + (read-from-minibuffer + prompt nil nil nil nil (car search-ring) t))))) + (to)) + (if (and (zerop (length from)) query-replace-defaults) + (cons (caar query-replace-defaults) + (query-replace-compile-replacement + (cdar query-replace-defaults) regexp-flag)) + (setq from (query-replace--split-string from)) + (when (consp from) (setq to (cdr from) from (car from))) + (add-to-history query-replace-from-history-variable from nil t) + ;; Warn if user types \n or \t, but don't reject the input. + (and regexp-flag + (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) + (let ((match (match-string 3 from))) + (cond + ((string= match "\\n") + (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) + ((string= match "\\t") + (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) + (sit-for 2))) + (if (not to) + from + (add-to-history query-replace-to-history-variable to nil t) + (add-to-history 'query-replace-defaults (cons from to) nil t) + (cons from (query-replace-compile-replacement to regexp-flag)))))))) (defun query-replace-compile-replacement (to regexp-flag) "Maybe convert a regexp replacement TO to Lisp. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 21 05:24:31 2017 Received: (at 25482) by debbugs.gnu.org; 21 Jan 2017 10:24:31 +0000 Received: from localhost ([127.0.0.1]:36882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUsqV-0002ME-Go for submit@debbugs.gnu.org; Sat, 21 Jan 2017 05:24:31 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUsqT-0002Lz-N0 for 25482@debbugs.gnu.org; Sat, 21 Jan 2017 05:24:30 -0500 Received: by mail-wm0-f50.google.com with SMTP id d140so20222808wmd.0 for <25482@debbugs.gnu.org>; Sat, 21 Jan 2017 02:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=R0LDH8HVuRlKO7UZMn0/7MdfgXVlyRAi3m/Zc8E0dhM=; b=JsvIPeJjo4+X02rgUxg5E/yvRqfwRpM1S49+vaAvGXm9iosFsFhoIu8ImJYO0m5JxM 5UnKWXq67Fh3gHlA6/mBGvt/3XcuPj6NAlPdy3sc8l26eY60u2gafWPWcR2WnWiryj1b 04aOkrA9d9xfeGxYGFel2Dt4ywDd+QapSctFjwM4cr7INpeoxE654O7aulKgeg32IboL P0oUSqG1k6liCw2SH4syoEodgXaRlTuJCj5me4feo096cp0FUbbKjYa72eYeWV0TxnWn UrvoGkMcbwiHYic5EfPITMxO39ss3Tqoj1j7AbG8H34GeZDZy0Fz3bI6N0PFGnVD/tm4 Xl2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=R0LDH8HVuRlKO7UZMn0/7MdfgXVlyRAi3m/Zc8E0dhM=; b=DRYbTArg6hhw+kUCvpSu31FrVMvTVvOT+Xb5/eXyeUuwG2oxHe+qy/mm0gxsEyU/jA U39mzu0Ga3N8/SfnIE35aGb46RIVBbb7bn5XOZiiSEs6QQedpZlGslyJDjabMODmrWaf EDbWb+bquPaMDF2q8E1cuM/3L2Eqxf+TP1Usk13Xb5mq43L4IgmWq7YcrIInw4QiaaKM w79d1dGbJhlsLm71OQRRZ0Z+fmGBm5j07IBs7RUAWSy938RemOKcXvVPWObLqIj+MGsp 6QlwsFPGtjKUgFvGK0oynnvQm2BFzknk7L6HGGzNXyNIHh4BS3KtSHDQbmlfv7K89wMD LaSw== X-Gm-Message-State: AIkVDXJpFtVjZERR8YgB+0Oo9rpq9IPU+HCmYPrvuRvCwY3D7v+MXR06QpF+gHHC0wsSzA== X-Received: by 10.223.131.34 with SMTP id 31mr18780235wrd.119.1484994263996; Sat, 21 Jan 2017 02:24:23 -0800 (PST) Received: from dell-14z ([37.168.21.33]) by smtp.gmail.com with ESMTPSA id n10sm3790286wrb.9.2017.01.21.02.24.22 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 21 Jan 2017 02:24:23 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87a8akiv7c.fsf@gmail.com> User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <87a8akiv7c.fsf@gmail.com> Date: Sat, 21 Jan 2017 11:24:19 +0100 Message-ID: <878tq4iucs.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Thierry Volpiatto writes: > Eli Zaretskii writes: > >> I'm asking whether the (fixed) behavior, whereby using setq to change >> the value to " -> " would add the ASCII string " -> " to the >> minibuffer history, would be acceptable. If not, please tell why. > > Here the patch updated adding the plain string to history when it is an > ascii string. Which fail now when query-replace-from-to-separator is nil but I fixed it here (not resending new patch unless you ask for it). -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 22 14:06:34 2017 Received: (at 25482) by debbugs.gnu.org; 22 Jan 2017 19:06:34 +0000 Received: from localhost ([127.0.0.1]:38465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVNTF-00021M-W5 for submit@debbugs.gnu.org; Sun, 22 Jan 2017 14:06:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVNTD-000218-QE for 25482@debbugs.gnu.org; Sun, 22 Jan 2017 14:06:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVNT3-0005Nl-Js for 25482@debbugs.gnu.org; Sun, 22 Jan 2017 14:06:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVNT3-0005Nd-Gq; Sun, 22 Jan 2017 14:06:21 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3956 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cVNT2-00089E-Ck; Sun, 22 Jan 2017 14:06:21 -0500 Date: Sun, 22 Jan 2017 21:06:15 +0200 Message-Id: <83lgu252zc.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87o9z1n4o3.fsf@gmail.com> (message from Thierry Volpiatto on Fri, 20 Jan 2017 16:16:34 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Fri, 20 Jan 2017 16:16:34 +0100 > > > Eli Zaretskii writes: > > > I'm asking whether the (fixed) behavior, whereby using setq to change > > the value to " -> " would add the ASCII string " -> " to the > > minibuffer history, would be acceptable. If not, please tell why. > > Would be good, but we will have to modify also > `query-replace--split-string` just for this purpose as it assume the > separator is one char long and have a text property 'separator. I'm afraid we are mis-communicating. The current code uses a null character as the separator, giving it a display property and a separator property. The display property uses a non-ASCII character (→). What I wanted to suggest is to keep the same code, and just allow users to specify the ASCII string " -> " for the display property. That should be much simpler than your proposed patch, and I don't really see how it would add non-ASCII characters to your minibuffer history. It also eliminates the need for making changes in query-replace--split-string. What am I missing? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 22 15:14:18 2017 Received: (at 25482) by debbugs.gnu.org; 22 Jan 2017 20:14:18 +0000 Received: from localhost ([127.0.0.1]:38483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVOWo-0003dr-IW for submit@debbugs.gnu.org; Sun, 22 Jan 2017 15:14:18 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVOWm-0003de-6M for 25482@debbugs.gnu.org; Sun, 22 Jan 2017 15:14:16 -0500 Received: by mail-wm0-f43.google.com with SMTP id c85so105475969wmi.1 for <25482@debbugs.gnu.org>; Sun, 22 Jan 2017 12:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=3B7nn8aueottz5jwfZ9WiGXvVcXcfPrKHObcLe2KK7Y=; b=doi3uM2DiB+ywpJp6QemvkAfhYUSPwX3x8NWoy+qizC0OwAyz384+nJVEBYxPtDXIy Y6rHerTXq0icEyI3gxBtk0wnz5gAa3WcL5uxCnpkv2SBKwXK+bbv9OApN2b2ntcGEGm0 PQrPlFv7IXPXzNI4VoFf6Us0z5VGDxeOT9XnBzTjrPXjvT/HK2PsGd2BlnC6n9UqEoQf hzD9wK1tD4U4K0ptDF70jaKE/f3TcybVqJzJ5dk5EfvGckYL5TUASEXVHjtHU9fcFqxs Kw6OqwWw+qgl8eVM/4X0uXmN5ZM5yW6Kc1ka2bdHwkwW3Cvwu+1RM2Nr6q2MjWX8UzxI x3ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=3B7nn8aueottz5jwfZ9WiGXvVcXcfPrKHObcLe2KK7Y=; b=EC2C0siZ3YezvS9759vwcGq/ZbaogDpS7GNPMKdrstUOMqzWVCcOb7HmG7nPbPWACK fjkLIshDrlQ/6jyu/siFUkDNmCLixDee9nv97QTQcr0rysxr3S60uNKLLENHBOSXLVbN 2/HgtxcN7+9de+cTD8OmZnknCqSm2LfCiGpoKzFoR962yRsJA4X1UboC5HqpbRGSPUub BY7ETIOHovGdgt19mwuAv7t7jJg+q+v4kLtd6diBR1nJ/54AFQyNtpt+azEOauzwJ5dB KZwXQHW/lEkGYySwiOiCF2jSHrUJuqIZWhbIYreSGzJjsGT7FGBdsZ3dods8HF3mG0KA OG+w== X-Gm-Message-State: AIkVDXKE4tK8a5YNNC4E5YTfYZYvyRszsiYMnazREPqUTFo1EQm/t0M6BsGoApUPhktdBQ== X-Received: by 10.28.154.143 with SMTP id c137mr10573556wme.34.1485116050303; Sun, 22 Jan 2017 12:14:10 -0800 (PST) Received: from dell-14z ([37.168.243.15]) by smtp.gmail.com with ESMTPSA id p49sm11075576wrb.10.2017.01.22.12.14.08 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 22 Jan 2017 12:14:09 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83lgu252zc.fsf@gnu.org> Date: Sun, 22 Jan 2017 21:14:03 +0100 Message-ID: <87o9yy26pg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: > I'm afraid we are mis-communicating. Yes. > The current code uses a null character as the separator, giving it a > display property and a separator property. The display property uses > a non-ASCII character (→). What I wanted to suggest is to keep the > same code, and just allow users to specify the ASCII string " -> " for > the display property. No change is needed for this, it's what the current code does. > That should be much simpler than your proposed patch, What would be much more simple would be to not use at all properties, the actual implementation is too complex for something quite simple. I will not have much time to continue on this, I will look into this maybe later, if you think this change is not important, just close the bug for now (if you need the last patch I wrote which works fine, let me know). Thanks. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 22 15:32:48 2017 Received: (at 25482) by debbugs.gnu.org; 22 Jan 2017 20:32:48 +0000 Received: from localhost ([127.0.0.1]:38487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVOoi-00045t-72 for submit@debbugs.gnu.org; Sun, 22 Jan 2017 15:32:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVOog-00045h-Lh for 25482@debbugs.gnu.org; Sun, 22 Jan 2017 15:32:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVOoW-00013Y-Gz for 25482@debbugs.gnu.org; Sun, 22 Jan 2017 15:32:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVOoW-00013I-Eo; Sun, 22 Jan 2017 15:32:36 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4133 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cVOoV-0005pN-JF; Sun, 22 Jan 2017 15:32:36 -0500 Date: Sun, 22 Jan 2017 22:32:32 +0200 Message-Id: <83fuka4yzj.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87o9yy26pg.fsf@gmail.com> (message from Thierry Volpiatto on Sun, 22 Jan 2017 21:14:03 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Sun, 22 Jan 2017 21:14:03 +0100 > > What would be much more simple would be to not use at all properties, > the actual implementation is too complex for something quite simple. But why is it a problem in the first place? In any case, some change is still needed, I believe, because you said customization of this is not easy. Can you show a simple recipe that demonstrates the problems with customizing this option? From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 23 03:13:43 2017 Received: (at 25482) by debbugs.gnu.org; 23 Jan 2017 08:13:44 +0000 Received: from localhost ([127.0.0.1]:38665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVZl1-0005ik-Ip for submit@debbugs.gnu.org; Mon, 23 Jan 2017 03:13:43 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVZkz-0005iW-K3 for 25482@debbugs.gnu.org; Mon, 23 Jan 2017 03:13:42 -0500 Received: by mail-wm0-f43.google.com with SMTP id c206so141314753wme.0 for <25482@debbugs.gnu.org>; Mon, 23 Jan 2017 00:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=Qg+XuupZo8RZWqKW1lWK3W2tAizvJCp87CK3vjFsMY0=; b=ln5MRX2Kat9CSKPU7PtwegztHmjPlpyMxuVlHOI7HMTw++V/e9rxyxfxw3otbUpxK0 jQk7m0WoaA0BKVgcnSwzTOiG9+hrUlZRYdcTfiPXsuiDxTf1/otPSgCMPawouhZcq3QN eCh8lmmt/XLTcxBMKLSXbs8USeDPcnaVXSNcTERAPLHObwTFsHHgi37P+Wjvr1oUC0Nx KStX2yD/QkLIJTjI485eYHBq1VGceAont3jWNyHI61WNd+g1KUaKOYv7KrihgWTEMyhg XlD8smzUNVfuW8i9SwNBd+06JUmRAlHBCa2MxCa68RYCXa6G8PxVLhZrzNxUd77ENP7h +LNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=Qg+XuupZo8RZWqKW1lWK3W2tAizvJCp87CK3vjFsMY0=; b=oXINr/U+jgxarhyfq8PvgXv7PpTzGOpCEAYTuxHZe5aqe9cheoSdn0UASBxMi4td87 Q7n16riZ7sgLcgwmMF4hkSJJW6LQca/WISmNkGNxjUuQixnnEvL7GUxaksCQUpawjXEX LL9MRBwxOq58K02RzYuFFwKRCli+wMG9Vhn4f1ZgkcnCK0JNXvPIHsrPZYJ8dHitn5Bc x+eG3E46vbFtA4zh/vdTz96CLLW/JT7CrtR17vmhWxTiQXlpg1/LzRYiKhGmW5cA87hs UgQRtKyKBOveEQJEKzjrUGYXlappFVPayyKfKBlOUB103AAsQE9+1GWabQpsNb1zSr7y hmFA== X-Gm-Message-State: AIkVDXID4sDwZQiH5FhpWepdBejtJAUPum6Ovd3gcSsfNipv2jcKQpY9Fwp2xbBj+akR7g== X-Received: by 10.223.152.18 with SMTP id v18mr22389017wrb.78.1485159215734; Mon, 23 Jan 2017 00:13:35 -0800 (PST) Received: from dell-14z ([37.167.98.61]) by smtp.gmail.com with ESMTPSA id x135sm19708960wme.23.2017.01.23.00.13.33 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 23 Jan 2017 00:13:33 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83fuka4yzj.fsf@gnu.org> Date: Mon, 23 Jan 2017 09:13:31 +0100 Message-ID: <87vat65h3o.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: 25482@debbugs.gnu.org >> Date: Sun, 22 Jan 2017 21:14:03 +0100 >> >> What would be much more simple would be to not use at all properties, >> the actual implementation is too complex for something quite simple. > > But why is it a problem in the first place? The problem is that you endup in the history with a crap string, see https://github.com/emacs-helm/helm/issues/1667. > In any case, some change is still needed, I believe, because you said > customization of this is not easy. Can you show a simple recipe that > demonstrates the problems with customizing this option? I think just looking at the defcustom using a sexp which need delay in the defcustom to ensure char-displayable-p is ready to use and the need to reevaluate this defcustom at each call of query-replace-read-from explain all. This patch don't change the actual behavior, I have removed the fallback to emacs-24.5 behavior, so now setting query-replace-from-to-separator to nil just fallback to " -> ". With this patch the whole string is added to history. Also usage of setq is possible, with actual implementation it is not possible. Finally the implementation is much simpler not relaying on props. I will not have the time for further comments or modifications of patch, I leave it here for memory, if you want to merge it let me know. Thanks. 1 file changed, 28 insertions(+), 35 deletions(-) lisp/replace.el | 63 +++++++++++++++++++++++++-------------------------------- modified lisp/replace.el @@ -79,15 +79,12 @@ That becomes the \"string to replace\".") to the minibuffer that reads the string to replace, or invoke replacements from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") -(defcustom query-replace-from-to-separator - (propertize (if (char-displayable-p ?→) " → " " -> ") - 'face 'minibuffer-prompt) - "String that separates FROM and TO in the history of replacement pairs." - ;; Avoids error when attempt to autoload char-displayable-p fails - ;; while preparing to dump, also stops customize-rogue listing this. - :initialize 'custom-initialize-delay +(defcustom query-replace-from-to-separator " → " + "String that separates FROM and TO in the history of replacement pairs. +When nil or the string provided not displayable the default separator \" -> \" +will be used instead." :group 'matching - :type '(choice string (sexp :tag "Display specification")) + :type '(choice string) :version "25.1") (defcustom query-replace-from-history-variable 'query-replace-history @@ -150,14 +147,12 @@ See `replace-regexp' and `query-replace-regexp-eval'.") (mapconcat 'isearch-text-char-description string "")) (defun query-replace--split-string (string) - "Split string STRING at a character with property `separator'" - (let* ((length (length string)) - (split-pos (text-property-any 0 length 'separator t string))) - (if (not split-pos) - (substring-no-properties string) - (cl-assert (not (text-property-any (1+ split-pos) length 'separator t string))) - (cons (substring-no-properties string 0 split-pos) - (substring-no-properties string (1+ split-pos) length))))) + "Split string STRING at `query-replace-from-to-separator'." + (let ((separator (or query-replace-from-to-separator " -> "))) + (cond ((string-match separator string) + (cons (substring-no-properties string 0 (match-beginning 0)) + (substring-no-properties string (match-end 0)))) + (t (substring-no-properties string))))) (defun query-replace-read-from (prompt regexp-flag) "Query and return the `from' argument of a query-replace operation. @@ -165,43 +160,41 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) - ;; Reevaluating will check char-displayable-p that is - ;; unavailable while preparing to dump. - (custom-reevaluate-setting 'query-replace-from-to-separator) (let* ((history-add-new-input nil) - (separator - (when query-replace-from-to-separator - (propertize "\0" - 'display query-replace-from-to-separator - 'separator t))) + (sep-char (and (stringp query-replace-from-to-separator) + (replace-regexp-in-string + " " "" query-replace-from-to-separator))) + (separator (propertize + (if (and sep-char + (char-displayable-p (string-to-char sep-char))) + query-replace-from-to-separator + " -> ") + 'face 'minibuffer-prompt)) (minibuffer-history (append - (when separator (mapcar (lambda (from-to) (concat (query-replace-descr (car from-to)) separator (query-replace-descr (cdr from-to)))) - query-replace-defaults)) + query-replace-defaults) (symbol-value query-replace-from-history-variable))) - (minibuffer-allow-text-properties t) ; separator uses text-properties (prompt - (if (and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history)) + (if query-replace-defaults + (format "%s (default %s %s %s): " + prompt + (query-replace-descr (caar query-replace-defaults)) + separator + (query-replace-descr (cdar query-replace-defaults))) (format "%s: " prompt))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. ;; That should not clobber the region for the query-replace itself. (save-excursion - (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 'minibuffer-history) (read-from-minibuffer - prompt nil nil nil nil - (car (if regexp-flag regexp-search-ring search-ring)) t))))) + prompt nil nil nil nil (car search-ring) t)))) (to)) (if (and (zerop (length from)) query-replace-defaults) (cons (caar query-replace-defaults) -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 01:50:32 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 06:50:32 +0000 Received: from localhost ([127.0.0.1]:48743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXMqF-0001vS-Qw for submit@debbugs.gnu.org; Sat, 28 Jan 2017 01:50:32 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37069) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXMqD-0001vC-Kb for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 01:50:30 -0500 Received: by mail-wm0-f45.google.com with SMTP id c206so172246560wme.0 for <25482@debbugs.gnu.org>; Fri, 27 Jan 2017 22:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=PrppIVPYp6zX+eyI+I/y4oFGUu6YssfhKyRjqU+GJZw=; b=ClbncmYYPmyxi40L6P73iNybyT0IqirwyqSstYYvlcbMu7CRK9fAJ6nGWvo9uG4Fpq k6xG1fZ+0EfKHDcCSlHhcgtJ8AzOhvYUpSAMrQMmOtoeYOZO5aXYvuCwa6BGoX9stJbc v635YaByCQkpQFqG23ySj+ssrii+qLkwWGNSq+DBmyn/8sY/Jup2MaVkTPXxLUYZZd4U GRWx6nKFeW6omyHRCVuj90OiOUuFYwhafc9v4jX+1nBchsaafIo33to2WR50P9kt7aoY XdHk4JQd0PvMcM3hpMBD1g0ipJYNGHXQRDIO8gxqN4Aap4OQG6bnhT0BHzHllo03Ncdr TLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=PrppIVPYp6zX+eyI+I/y4oFGUu6YssfhKyRjqU+GJZw=; b=rrWeZLE5+R5oqVPrgwuxa9TZejgCm/MsFwzZZBzpu7K7N2pi4pp9/4FGGFKgLF8WVW wTs2BqMqon/qSIuFs8qk9o9DVISxU7wBbkKked1Ghn8lcGe3TOJndbsbm5Tf1NfUVXhh 3UB+ETlPRZdadSVk7uZh+KcrqKT3cYHpfkF63HcOs8+70gBIxzOZh8H9v41KsL1eAo9i 3GNOXo/HWzIq6uqK5mauEzahGqNd0K/kx4D1XSqKTDyuZbrbj2hkCY7Bm1Um59P/3BEC W+zw9ZD9D3/oemb86upq/g1pCqj0qXO2dL2mLbSq/DoA2BIzcyDAi1CYQmlJCChWMu5/ Mmbg== X-Gm-Message-State: AIkVDXLd9Myy/JOzoahlnjqHorZq+OK95qEBMU7gmsLbJA+JoS/duvXVJWhouAXzKPAKRw== X-Received: by 10.28.87.19 with SMTP id l19mr6186070wmb.95.1485586223578; Fri, 27 Jan 2017 22:50:23 -0800 (PST) Received: from dell-14z ([37.169.101.111]) by smtp.gmail.com with ESMTPSA id t123sm7385816wmt.8.2017.01.27.22.50.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 27 Jan 2017 22:50:22 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <87vat65h3o.fsf@gmail.com> Date: Sat, 28 Jan 2017 07:50:19 +0100 Message-ID: <87r33n3cgk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Just to not leave this unfinished, here the last patch I did which simplify code. - defcustom is simple (string or nil). - No need to reevaluate defcustom at every time. - setq is usable. - splitting is now simple with all the text property dance removed. - plain string is added to history instead of a crap string. 1 file changed, 29 insertions(+), 37 deletions(-) lisp/replace.el | 66 +++++++++++++++++++++++++-------------------------------- modified lisp/replace.el @@ -79,15 +79,12 @@ That becomes the \"string to replace\".") to the minibuffer that reads the string to replace, or invoke replacements from Isearch by using a key sequence like `C-s C-s M-%'." "24.3") -(defcustom query-replace-from-to-separator - (propertize (if (char-displayable-p ?→) " → " " -> ") - 'face 'minibuffer-prompt) - "String that separates FROM and TO in the history of replacement pairs." - ;; Avoids error when attempt to autoload char-displayable-p fails - ;; while preparing to dump, also stops customize-rogue listing this. - :initialize 'custom-initialize-delay +(defcustom query-replace-from-to-separator " → " + "String that separates FROM and TO in the history of replacement pairs. +When nil or the string provided not displayable the default separator \" -> \" +will be used instead." :group 'matching - :type '(choice string (sexp :tag "Display specification")) + :type '(choice string) :version "25.1") (defcustom query-replace-from-history-variable 'query-replace-history @@ -149,15 +146,12 @@ See `replace-regexp' and `query-replace-regexp-eval'.") (defun query-replace-descr (string) (mapconcat 'isearch-text-char-description string "")) -(defun query-replace--split-string (string) - "Split string STRING at a character with property `separator'" - (let* ((length (length string)) - (split-pos (text-property-any 0 length 'separator t string))) - (if (not split-pos) - (substring-no-properties string) - (cl-assert (not (text-property-any (1+ split-pos) length 'separator t string))) - (cons (substring-no-properties string 0 split-pos) - (substring-no-properties string (1+ split-pos) length))))) +(defun query-replace--split-string (string separator) + "Split string STRING at `query-replace-from-to-separator'." + (cond ((string-match separator string) + (cons (substring-no-properties string 0 (match-beginning 0)) + (substring-no-properties string (match-end 0)))) + (t (substring-no-properties string)))) (defun query-replace-read-from (prompt regexp-flag) "Query and return the `from' argument of a query-replace operation. @@ -165,49 +159,47 @@ The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) - ;; Reevaluating will check char-displayable-p that is - ;; unavailable while preparing to dump. - (custom-reevaluate-setting 'query-replace-from-to-separator) (let* ((history-add-new-input nil) - (separator - (when query-replace-from-to-separator - (propertize "\0" - 'display query-replace-from-to-separator - 'separator t))) + (sep-char (and (stringp query-replace-from-to-separator) + (replace-regexp-in-string + " " "" query-replace-from-to-separator))) + (separator (propertize + (if (and sep-char + (char-displayable-p (string-to-char sep-char))) + query-replace-from-to-separator + " -> ") + 'face 'minibuffer-prompt)) (minibuffer-history (append - (when separator (mapcar (lambda (from-to) (concat (query-replace-descr (car from-to)) separator (query-replace-descr (cdr from-to)))) - query-replace-defaults)) + query-replace-defaults) (symbol-value query-replace-from-history-variable))) - (minibuffer-allow-text-properties t) ; separator uses text-properties (prompt - (if (and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history)) + (if query-replace-defaults + (format "%s (default %s %s %s): " + prompt + (query-replace-descr (caar query-replace-defaults)) + separator + (query-replace-descr (cdar query-replace-defaults))) (format "%s: " prompt))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. ;; That should not clobber the region for the query-replace itself. (save-excursion - (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 'minibuffer-history) (read-from-minibuffer - prompt nil nil nil nil - (car (if regexp-flag regexp-search-ring search-ring)) t))))) + prompt nil nil nil nil (car search-ring) t)))) (to)) (if (and (zerop (length from)) query-replace-defaults) (cons (caar query-replace-defaults) (query-replace-compile-replacement (cdar query-replace-defaults) regexp-flag)) - (setq from (query-replace--split-string from)) + (setq from (query-replace--split-string from separator)) (when (consp from) (setq to (cdr from) from (car from))) (add-to-history query-replace-from-history-variable from nil t) ;; Warn if user types \n or \t, but don't reject the input. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 02:31:57 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 07:31:57 +0000 Received: from localhost ([127.0.0.1]:48760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXNUL-0002uZ-LA for submit@debbugs.gnu.org; Sat, 28 Jan 2017 02:31:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXNUK-0002uN-4D for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 02:31:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXNUB-0002A7-MV for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 02:31:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXNUB-0002A1-J6; Sat, 28 Jan 2017 02:31:47 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1435 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXNUA-00045H-QJ; Sat, 28 Jan 2017 02:31:47 -0500 Date: Sat, 28 Jan 2017 09:31:38 +0200 Message-Id: <83tw8jzllx.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87r33n3cgk.fsf@gmail.com> (message from Thierry Volpiatto on Sat, 28 Jan 2017 07:50:19 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Sat, 28 Jan 2017 07:50:19 +0100 > > Just to not leave this unfinished, here the last patch I did which > simplify code. > > - defcustom is simple (string or nil). > - No need to reevaluate defcustom at every time. > - setq is usable. > - splitting is now simple with all the text property dance removed. > - plain string is added to history instead of a crap string. Thanks, but I don't understand why you want to get rid of the display property. (I also object to calling the result of that "crap".) I'd rather we left the display property and its supporting code intact, and only moved the char-displayable-p call to the place where the string is used instead of having it in the defcustom, thus allowing customizations with setq. That should solve the real problems with the current code, leaving the style-related issues alone. I realize that you don't like that style, but I think we should respect style preferences of others and not change their code just because we would have written it differently. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 05:44:00 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 10:44:00 +0000 Received: from localhost ([127.0.0.1]:48800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQUB-0007EZ-W1 for submit@debbugs.gnu.org; Sat, 28 Jan 2017 05:44:00 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQU9-0007EL-Tt for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 05:43:58 -0500 Received: by mail-wm0-f54.google.com with SMTP id p192so5825093wme.1 for <25482@debbugs.gnu.org>; Sat, 28 Jan 2017 02:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=wy46w6CQcGsjWi2VJk1NRFtFT5nUl9Oui4e0ltpT29w=; b=kFsXWS8qRAFHp6ywuMRgQuAtuim5HeTR37VFGrBbX9zOjzqbBMzmLn5syQ/xKZRAPt I5woiiekVd07Qt7RlEoQRf5xEn2E3lwCyP3KgREVFiSz5lxpQ6eU8ck3kUI8DeysYHw9 TIHW6t7GDwjG+yCgptvsKnvMGODBy0JSPBtDPLBHghbvc7D3HbpcLvJycBlsDWj4GVf4 Ro2hozhGmusZWqVSvucvHIVoYr2t9j68Q2O3NgNEYH/gA/TUTADqdfQCScivleKd49Yg JehnJVIbX0zjd4fBdoY9NRAV/zbiI3ZJbBu5IcHyrZaRecWR5bCWHBdofBZimNWDvkKn WELg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=wy46w6CQcGsjWi2VJk1NRFtFT5nUl9Oui4e0ltpT29w=; b=GkBD3Olooq0NAFKeCdU+8tPaAW2Mn8JPfLZ5TkgRcyeO2AItyJpZg/3iBKf4VXqv3T TMxcEzDJZlKaOVWxSVXmvZSqEDfLglWOMr0CcDEnmKOzGa6S9e7MHijKR2eylFH3WNGQ qIAqlS5bjWissC4z5jVO1rhoNd4jJXeM1Ku/2f3hRxHUvNJXN3XRWiGNVPW6nMJaOaYN Rc/8bZtXm4pIU1vLXGKGmpWhrpXQfKjUmg6t6eqA05ykO1RApYYcnjFntBlv0jXh15UA ACvDce+FQxHx1+XGpyBqg80jlZxIGVQZy4QJjLJr49nMq+nQTRXzPgLQ8Uddh9P45JLY UVcQ== X-Gm-Message-State: AIkVDXLqArP3wUx0BtOn8Stw8Ku1ZhK8jB1npXM5gHlf1c5oONcxCIcq10cnvrXmGwhIOw== X-Received: by 10.223.138.241 with SMTP id z46mr13507403wrz.30.1485600232194; Sat, 28 Jan 2017 02:43:52 -0800 (PST) Received: from dell-14z ([37.169.101.111]) by smtp.gmail.com with ESMTPSA id e72sm8242803wma.16.2017.01.28.02.43.50 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 28 Jan 2017 02:43:51 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83tw8jzllx.fsf@gnu.org> Date: Sat, 28 Jan 2017 11:43:48 +0100 Message-ID: <87poj7wjkr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: > Thanks, but I don't understand why you want to get rid of the display > property. This complicate the code and force external apps to handle this, see https://github.com/emacs-helm/helm/commit/2b8576c0705145b5d133e41478976eef5b3d7390 > (I also object to calling the result of that "crap".) Sorry, but it is: Selecting foo → bar in a list results in foo^@bar being entered into the minibuffer, not with the query-replace interface but when handling the history list from somewhere else. > I'd rather we left the display property and its supporting code > intact, and only moved the char-displayable-p call to the place where > the string is used instead of having it in the defcustom, thus > allowing customizations with setq. That should solve the real > problems with the current code, leaving the style-related issues > alone. It doesn't see above. > I realize that you don't like that style, but I think we should > respect style preferences of others and not change their code just > because we would have written it differently. The patch change nothing and allow same customization as before. I wrote this patch because I think it makes the code better, allow easier customization and fix issue described above. I understand if you want to keep the code as it is to be sure nothing wrong is introduced in a code that is already "working". Thanks. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 06:01:57 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 11:01:57 +0000 Received: from localhost ([127.0.0.1]:48811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQlZ-0007el-IX for submit@debbugs.gnu.org; Sat, 28 Jan 2017 06:01:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXQlX-0007eZ-SX for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 06:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXQlO-0002MV-8N for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 06:01:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXQlO-0002MR-5W; Sat, 28 Jan 2017 06:01:46 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1824 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXQlN-0008SG-9z; Sat, 28 Jan 2017 06:01:45 -0500 Date: Sat, 28 Jan 2017 13:01:36 +0200 Message-Id: <83inozzbvz.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87poj7wjkr.fsf@gmail.com> (message from Thierry Volpiatto on Sat, 28 Jan 2017 11:43:48 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Sat, 28 Jan 2017 11:43:48 +0100 > > Eli Zaretskii writes: > > > Thanks, but I don't understand why you want to get rid of the display > > property. > > This complicate the code and force external apps to handle this, see > https://github.com/emacs-helm/helm/commit/2b8576c0705145b5d133e41478976eef5b3d7390 Maybe I'm missing something, but the above is no different from the need to adapt to any new feature in core Emacs. > Selecting foo → bar in a list results in foo^@bar being entered into the > minibuffer, not with the query-replace interface but when handling the > history list from somewhere else. Yes, the external packages need to adapt to this, if they want to use the internal features. I don't think this can be avoided in general. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 06:24:05 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 11:24:05 +0000 Received: from localhost ([127.0.0.1]:48826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXR6z-0008Ax-9d for submit@debbugs.gnu.org; Sat, 28 Jan 2017 06:24:05 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:32862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXR6x-0008A3-WB for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 06:24:04 -0500 Received: by mail-wm0-f49.google.com with SMTP id d140so20575455wmd.0 for <25482@debbugs.gnu.org>; Sat, 28 Jan 2017 03:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=0SFTNGqivUQc5tuCZ6cSOeqCsLQ9cwhtW1RgqS5pD2A=; b=aQDxUhHOxDixlUjrn4AwQNoT/T1bO4y8UNXOOV2wdU2Z+bNXZ7IyRx6DqDc11BMPaF 4kTUZ7IPam7XeXW/m4P6cLq0+DXJcBczg/QC9nETtpBA8CuAFbBOmMcPPLnz7Y7bQqs5 BOlUU5/pWbYfpqgah3bsXmCweinRCydDWksKK3RoIQZ5y2A1Vlvt8f/E7ROR/7Qt2FPZ 8zJG6CLd8tiVpalWdhpN7ttOBRClsJnDncOq0JffyI4vddDD/5PBT4WY/dO7HXGFj+ki KrVbE5vyGGCMVJ1eD4dol9zKLYfN0x39cnQXULV68ZVtkKBYUiFOfJYlHPgQIKZZ4sD/ 3U+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=0SFTNGqivUQc5tuCZ6cSOeqCsLQ9cwhtW1RgqS5pD2A=; b=UyjY6Y0CoxCZEbCHzROU/bf4BKmjttM7CETB1xRLsX+GMad04bYXecJPUs7RpM+79B glZxLeN5tDWHrGMakAUjeVWfyldyEJWpFUjOEpDEXHZSRwHz9UxEh+N8g1WgRs8Hw58H 51vy/omkuftKsCUTQlznfofdpMlSgWNx4AZUPBMFliSWFUxxfiehSlhuD5Ng9C/qjcO2 XGn9HCTppCdpjpcmwaV9GtgcPZSTS/q5yepPBKH3+rf/2Xhr/GEIn0Ycs8uN1XP3Ltvq clckYMr+kJoyQAVMe7wgxSA1SbNUy+YIdF1KCPTZqzN4eBw+W3wow88g1tN2mtxSCS/N B91A== X-Gm-Message-State: AIkVDXI78blHzKgTPbJAOCyfM5Z3cuxGDhqvqzSmWUvCoGa11YcFcek1XGZgkWR1+ASh4A== X-Received: by 10.28.92.83 with SMTP id q80mr7007287wmb.69.1485602638128; Sat, 28 Jan 2017 03:23:58 -0800 (PST) Received: from dell-14z ([37.169.101.111]) by smtp.gmail.com with ESMTPSA id t103sm12499794wrc.43.2017.01.28.03.23.56 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 28 Jan 2017 03:23:57 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83inozzbvz.fsf@gnu.org> Date: Sat, 28 Jan 2017 12:23:54 +0100 Message-ID: <87mvebwhpx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: > Yes, the external packages need to adapt to this, if they want to use > the internal features. I don't think this can be avoided in general. What can be avoided is writing complex code when simple code can be used for the same result. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 08:50:50 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 13:50:50 +0000 Received: from localhost ([127.0.0.1]:48857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXTP0-0006Xe-DA for submit@debbugs.gnu.org; Sat, 28 Jan 2017 08:50:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXTOy-0006XP-Fc for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 08:50:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXTOp-0000h6-AM for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 08:50:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXTOp-0000h0-1p; Sat, 28 Jan 2017 08:50:39 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1874 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXTOn-000653-Rt; Sat, 28 Jan 2017 08:50:38 -0500 Date: Sat, 28 Jan 2017 15:50:28 +0200 Message-Id: <83h94jz42j.fsf@gnu.org> From: Eli Zaretskii To: Thierry Volpiatto In-reply-to: <87mvebwhpx.fsf@gmail.com> (message from Thierry Volpiatto on Sat, 28 Jan 2017 12:23:54 +0100) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Thierry Volpiatto > Cc: 25482@debbugs.gnu.org > Date: Sat, 28 Jan 2017 12:23:54 +0100 > > > Yes, the external packages need to adapt to this, if they want to use > > the internal features. I don't think this can be avoided in general. > > What can be avoided is writing complex code when simple code can be used > for the same result. Maybe so, but that ship has sailed more than 2 years ago, and was preceded by a long discussion. I didn't read all of it now, but AFAIU, the reason for using a character with a display property was to make the separator not editable when the user edits the history. So that design decision and the resulting code we have now had some justification, and any replacement will have to support the same features, which I think a simple string will not do. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 11:46:41 2017 Received: (at 25482) by debbugs.gnu.org; 28 Jan 2017 16:46:41 +0000 Received: from localhost ([127.0.0.1]:49335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXW9B-0003t5-Ct for submit@debbugs.gnu.org; Sat, 28 Jan 2017 11:46:41 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXW9A-0003st-EG for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 11:46:40 -0500 Received: by mail-wm0-f41.google.com with SMTP id r126so26332968wmr.1 for <25482@debbugs.gnu.org>; Sat, 28 Jan 2017 08:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=hWAecNx2EADhn15v8/ZfrK3urVUiK3CP+sTcXlAnn1Y=; b=LQKi4nHFtUWnphLeXRK6MrsfUKTKeV0mwb+4vR3R2sO9ZYJ0BRU4cjY9FJauD15muH y9ZGs1KFC106kmo5msn98mvDxYi7b2+cQBHnO3vP5KSuAf/PYeZXC6Nzu86Z1qEoM5dJ 8590yEpT0gu1gaDIlSZxGts3QcVSIz7nI8YQ7IwSWHM1aIJVkt1qglL0LZNIJ1bqNQdP ly3zItkT3xbBuhOKm45MtDscnUPT80Ez1Hr7/XgPQtYNz1759jXhnNnzzDMiiffof2+D psz5BXuPo1c3Vk7dETPx8akLLMLjobqBL6eOVxoSQdb6bvKSMZ2H3kvbuzAyxXHGtC8W dfLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=hWAecNx2EADhn15v8/ZfrK3urVUiK3CP+sTcXlAnn1Y=; b=VNU1ve4+TT/nu7Q6lXIPU2wgXXzLm7v1YNto9dkKtU/rRT1+HpPuM4CvaErbkq4rEn c7TJbQOE+62GozxDU51poTyP8WzHJYicL78WrndhOWG+BLKiTdURe89aBUEZQ0HtXwsU Lj9lvrha8vvyGfMdaqBkoZqTdxraw/6+fxGivHyaty45FboXmPdPGs20fiGjH3scRGwz SX57QWMDRCkkeXdsadjcYYl+LSpyjf4iOySqQ/jHg2WMY2k2TrHr7PQAQ6T7amQfC7uv ElJZocuf3xM819DHdlGL3zGaYfkyc+DL3ke4Vn9/GDXPWD3yN3QSlUX8aFpNCW4VZnZz e1UQ== X-Gm-Message-State: AIkVDXLMSB4e5HNLDvB7qGTirA5j4I7W5YKV/oeZ+wvZyjSVf7nkJiaoMEVzXniar+YLKg== X-Received: by 10.28.126.11 with SMTP id z11mr7938054wmc.13.1485621994709; Sat, 28 Jan 2017 08:46:34 -0800 (PST) Received: from MM061 (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by smtp.gmail.com with ESMTPSA id g71sm9653872wmc.9.2017.01.28.08.46.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jan 2017 08:46:33 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <83h94jz42j.fsf@gnu.org> Date: Sat, 28 Jan 2017 17:46:29 +0100 Message-ID: <87h94jyvx6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.5 (/) Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: 25482@debbugs.gnu.org >> Date: Sat, 28 Jan 2017 12:23:54 +0100 >> >> > Yes, the external packages need to adapt to this, if they want to use >> > the internal features. I don't think this can be avoided in general. >> >> What can be avoided is writing complex code when simple code can be used >> for the same result. > > Maybe so, but that ship has sailed more than 2 years ago, and was > preceded by a long discussion. I didn't read all of it now, but > AFAIU, the reason for using a character with a display property was to > make the separator not editable when the user edits the history. Ok, I understand, don't think many people are editing history file and people doing so, I guess known what they are doing. > So that design decision and the resulting code we have now had some > justification, and any replacement will have to support the same > features, which I think a simple string will not do. Ok, thanks for explanation, perhaps you can close this bug. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 20:03:14 2017 Received: (at 25482) by debbugs.gnu.org; 29 Jan 2017 01:03:14 +0000 Received: from localhost ([127.0.0.1]:49585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXdth-0006vi-Uq for submit@debbugs.gnu.org; Sat, 28 Jan 2017 20:03:14 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:45390 helo=homiemail-a23.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXdtg-0006va-PR for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 20:03:13 -0500 Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id B99C64B006D; Sat, 28 Jan 2017 17:03:09 -0800 (PST) Received: from localhost.linkov.net (m213-100-238-78.cust.tele2.ee [213.100.238.78]) (Authenticated sender: jurta@jurta.org) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id ADEEA4B0063; Sat, 28 Jan 2017 17:03:08 -0800 (PST) From: Juri Linkov To: Thierry Volpiatto Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Organization: LINKOV.NET References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> Date: Sun, 29 Jan 2017 02:59:24 +0200 In-Reply-To: <87h94jyvx6.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 28 Jan 2017 17:46:29 +0100") Message-ID: <87k29ey93n.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.2 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >> So that design decision and the resulting code we have now had some >> justification, and any replacement will have to support the same >> features, which I think a simple string will not do. > > Ok, thanks for explanation, perhaps you can close this bug. [...] Content analysis details: (3.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [69.163.253.7 listed in dnsbl.sorbs.net] 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [69.163.253.7 listed in psbl.surriel.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [69.163.253.7 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_L5 RBL: Very bad reputation (-5) [69.163.253.7 listed in bl.mailspike.net] 0.0 RCVD_IN_MSPIKE_BL Mailspike blacklisted X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, Eli Zaretskii 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: 3.2 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >> So that design decision and the resulting code we have now had some >> justification, and any replacement will have to support the same >> features, which I think a simple string will not do. > > Ok, thanks for explanation, perhaps you can close this bug. [...] Content analysis details: (3.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [69.163.253.7 listed in dnsbl.sorbs.net] 0.0 RCVD_IN_MSPIKE_L5 RBL: Very bad reputation (-5) [69.163.253.7 listed in bl.mailspike.net] 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [69.163.253.7 listed in psbl.surriel.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [69.163.253.7 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_BL Mailspike blacklisted >> So that design decision and the resulting code we have now had some >> justification, and any replacement will have to support the same >> features, which I think a simple string will not do. > > Ok, thanks for explanation, perhaps you can close this bug. Please don't close this bug. I think your idea for customization was good. We just need to find the right implementation that will keep the current default intact, at the same time allowing you to customize the string or set it to nil. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 22:42:52 2017 Received: (at 25482) by debbugs.gnu.org; 29 Jan 2017 03:42:52 +0000 Received: from localhost ([127.0.0.1]:49609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXgOB-0001yH-PJ for submit@debbugs.gnu.org; Sat, 28 Jan 2017 22:42:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXgO9-0001y2-Ok for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 22:42:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXgO1-0005wl-Kq for 25482@debbugs.gnu.org; Sat, 28 Jan 2017 22:42:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXgO1-0005wh-HG; Sat, 28 Jan 2017 22:42:41 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2809 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXgO0-0005di-Oz; Sat, 28 Jan 2017 22:42:41 -0500 Date: Sun, 29 Jan 2017 05:42:35 +0200 Message-Id: <83lgtuy1jo.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87k29ey93n.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 29 Jan 2017 02:59:24 +0200) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87k29ey93n.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Juri Linkov > Cc: Eli Zaretskii , 25482@debbugs.gnu.org > Date: Sun, 29 Jan 2017 02:59:24 +0200 > > >> So that design decision and the resulting code we have now had some > >> justification, and any replacement will have to support the same > >> features, which I think a simple string will not do. > > > > Ok, thanks for explanation, perhaps you can close this bug. > > Please don't close this bug. I think your idea for customization was good. > We just need to find the right implementation that will keep the current > default intact, at the same time allowing you to customize the string > or set it to nil. I intended to move the char-displayable-p call from the defcustom, and remove the re-evaluate call. But if you want to handle this part, it would be even better. It's just that you've been very silent on this issue until now. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 19:34:14 2017 Received: (at 25482) by debbugs.gnu.org; 30 Jan 2017 00:34:14 +0000 Received: from localhost ([127.0.0.1]:50535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXzvC-0007Hr-1e for submit@debbugs.gnu.org; Sun, 29 Jan 2017 19:34:14 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:41953 helo=homiemail-a13.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXzvA-0007Hd-V5 for 25482@debbugs.gnu.org; Sun, 29 Jan 2017 19:34:13 -0500 Received: from homiemail-a13.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTP id 5D3B9334075; Sun, 29 Jan 2017 16:34:10 -0800 (PST) Received: from localhost.linkov.net (m213-100-238-78.cust.tele2.ee [213.100.238.78]) (Authenticated sender: jurta@jurta.org) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 4E89833406C; Sun, 29 Jan 2017 16:34:09 -0800 (PST) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Organization: LINKOV.NET References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87k29ey93n.fsf@mail.linkov.net> <83lgtuy1jo.fsf@gnu.org> Date: Mon, 30 Jan 2017 02:16:10 +0200 In-Reply-To: <83lgtuy1jo.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 29 Jan 2017 05:42:35 +0200") Message-ID: <878tptxv05.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com 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 (/) >> >> So that design decision and the resulting code we have now had some >> >> justification, and any replacement will have to support the same >> >> features, which I think a simple string will not do. >> > >> > Ok, thanks for explanation, perhaps you can close this bug. >> >> Please don't close this bug. I think your idea for customization was = good. >> We just need to find the right implementation that will keep the curre= nt >> default intact, at the same time allowing you to customize the string >> or set it to nil. > > I intended to move the char-displayable-p call from the defcustom, and > remove the re-evaluate call. But if you want to handle this part, it > would be even better. It's just that you've been very silent on this > issue until now. I've been silent because I agreed to your replies to Thierry :) At one point in the beginning of this thread I believe Thierry sent a patch closest to what would be good to have (before =E2=80=9Ccode simpl= ification=E2=80=9D where development went astray). We could return to that patch and test if it does these things right: instead of re-evaluating checks char-displayable-p, but when query-replace-from-to-separator is nil falls back to pre-24.5 that adds strings to the history without ^@. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 19:40:33 2017 Received: (at 25482-done) by debbugs.gnu.org; 13 Feb 2017 00:40:33 +0000 Received: from localhost ([127.0.0.1]:37556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd4gz-0005a6-9b for submit@debbugs.gnu.org; Sun, 12 Feb 2017 19:40:33 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:56009 helo=homiemail-a23.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd4gx-0005Zy-Pp for 25482-done@debbugs.gnu.org; Sun, 12 Feb 2017 19:40:32 -0500 Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id 792054B006D; Sun, 12 Feb 2017 16:40:28 -0800 (PST) Received: from localhost.linkov.net (m83-191-206-160.cust.tele2.ee [83.191.206.160]) (Authenticated sender: jurta@jurta.org) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPA id 744254B0058; Sun, 12 Feb 2017 16:40:27 -0800 (PST) From: Juri Linkov To: Thierry Volpiatto Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Organization: LINKOV.NET References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> Date: Mon, 13 Feb 2017 02:37:56 +0200 In-Reply-To: <87h94jyvx6.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 28 Jan 2017 17:46:29 +0100") Message-ID: <87mvdrncwh.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 25482-done Cc: 25482-done@debbugs.gnu.org, Eli Zaretskii 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.9 (-) >> So that design decision and the resulting code we have now had some >> justification, and any replacement will have to support the same >> features, which I think a simple string will not do. > > Ok, thanks for explanation, perhaps you can close this bug. Thanks, Thierry, I installed your second patch (from 20 Jan) with some modifications. As for your idea of using plain ASCII separators without text properties, the problem is that it will not work if the user wants to replace the same string as is used for the separator, e.g. to replace =E2=86=92 with -> in the current buffer. If you have more ideas how to make the separator unambiguous without using text properties, then please reopen this bug. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 21:24:22 2017 Received: (at 25482) by debbugs.gnu.org; 13 Feb 2017 02:24:22 +0000 Received: from localhost ([127.0.0.1]:37621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd6JS-000808-A2 for submit@debbugs.gnu.org; Sun, 12 Feb 2017 21:24:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd6JR-0007zw-5a for 25482@debbugs.gnu.org; Sun, 12 Feb 2017 21:24:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cd6JL-0007sT-25 for 25482@debbugs.gnu.org; Sun, 12 Feb 2017 21:24:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd6JK-0007sP-V1; Sun, 12 Feb 2017 21:24:14 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cd6JK-0004iM-DP; Sun, 12 Feb 2017 21:24:14 -0500 From: Glenn Morris To: 25482@debbugs.gnu.org Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> X-Spook: cryptographic Flu Airport Manfurov Wave Plane Brownout X-Ran: 4Ha_%Ju2p#:,UBE|1VU-v@:U@ylevWN50G*P?wVd`"6p#RUds8Lms95,$aU1{VKfpr|=8\ X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sun, 12 Feb 2017 21:24:14 -0500 In-Reply-To: <87mvdrncwh.fsf@localhost> (Juri Linkov's message of "Mon, 13 Feb 2017 02:37:56 +0200") Message-ID: <6l37fi7rqp.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25482 Cc: thierry.volpiatto@gmail.com, juri@linkov.net 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: -5.0 (-----) Hi, this doesn't seem to bootstrap: http://hydra.nixos.org/build/48432485 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 22:04:27 2017 Received: (at 25482) by debbugs.gnu.org; 13 Feb 2017 03:04:27 +0000 Received: from localhost ([127.0.0.1]:37647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd6wE-0000UF-Tq for submit@debbugs.gnu.org; Sun, 12 Feb 2017 22:04:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd6wD-0000U2-7C for 25482@debbugs.gnu.org; Sun, 12 Feb 2017 22:04:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cd6w7-0007gI-3T for 25482@debbugs.gnu.org; Sun, 12 Feb 2017 22:04:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd6w7-0007gE-0O; Sun, 12 Feb 2017 22:04:19 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cd6w6-00004v-0x; Sun, 12 Feb 2017 22:04:18 -0500 From: Glenn Morris To: 25482@debbugs.gnu.org Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> <6l37fi7rqp.fsf@fencepost.gnu.org> X-Spook: Breach Exercise emc Storm MILSATCOM National X-Ran: sQpx*]pPU}(^'FLq-6sp|o5?Ka5UJlrVX0d&>TQ{=g8G^c41=,E4@}jJZLD'@q(PgmE8+) X-Hue: brightblack X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sun, 12 Feb 2017 22:04:17 -0500 In-Reply-To: <6l37fi7rqp.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sun, 12 Feb 2017 21:24:14 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25482 Cc: thierry.volpiatto@gmail.com, juri@linkov.net 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: -5.0 (-----) Never mind, it seems there was a trivial fix (ef6132c55fc). From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 13 00:51:45 2017 Received: (at 25482) by debbugs.gnu.org; 13 Feb 2017 05:51:45 +0000 Received: from localhost ([127.0.0.1]:37714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd9Y9-0004Fz-4f for submit@debbugs.gnu.org; Mon, 13 Feb 2017 00:51:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd9Y7-0004Fm-8z for 25482@debbugs.gnu.org; Mon, 13 Feb 2017 00:51:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cd9Xy-0007Ex-TZ for 25482@debbugs.gnu.org; Mon, 13 Feb 2017 00:51:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd9Xy-0007Er-QB; Mon, 13 Feb 2017 00:51:34 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4905 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cd9Xx-0000Cc-Ti; Mon, 13 Feb 2017 00:51:34 -0500 Date: Mon, 13 Feb 2017 07:51:49 +0200 Message-Id: <83mvdq1vuy.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87mvdrncwh.fsf@localhost> (message from Juri Linkov on Mon, 13 Feb 2017 02:37:56 +0200) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Cc: Eli Zaretskii , 25482-done@debbugs.gnu.org > Date: Mon, 13 Feb 2017 02:37:56 +0200 > > >> So that design decision and the resulting code we have now had some > >> justification, and any replacement will have to support the same > >> features, which I think a simple string will not do. > > > > Ok, thanks for explanation, perhaps you can close this bug. > > Thanks, Thierry, I installed your second patch (from 20 Jan) > with some modifications. Thanks, but please also update NEWS and the Emacs manual with the information about the new nil value of the separator. (Maybe it's a good idea to describe in the ELisp manual the structure of query-replace-history elements?) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 13 00:53:48 2017 Received: (at 25482-done) by debbugs.gnu.org; 13 Feb 2017 05:53:48 +0000 Received: from localhost ([127.0.0.1]:37721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd9a7-0004JP-QK for submit@debbugs.gnu.org; Mon, 13 Feb 2017 00:53:47 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd9a5-0004Iz-IU for 25482-done@debbugs.gnu.org; Mon, 13 Feb 2017 00:53:45 -0500 Received: by mail-wm0-f67.google.com with SMTP id v77so17292371wmv.0 for <25482-done@debbugs.gnu.org>; Sun, 12 Feb 2017 21:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=OQ76jGvsXfBqnR0o4gFWdJMzaO0rNQ8vkLzjZ6t1BZY=; b=a4kvEkKZZo7ej8uqbfWiuAVO4pHvnnqPzKXmbn19cKin3cCk0DrXvkDiJs9Iz5wh2Z YdZtG14hQDz0DEQLOVx/ghgVxyBw5D+ShgSGLIa6rXbW7RMjStN/ZlHSvfH2yLVxWM4f 4NZctaP2Ua6zWgTL6SV1qt/gAYoHNrDJcDChYjLC/BAgkbsDwFJY0dNh3afiIcRvy2xp 6pw0LNy19hpzbn+cIqHBpEXb5tKrf/IHvay74ekpnItEVRulzycNnoRkOtALRqqHn1wP oGSRcPQRA1ThtahtWPP13virOoWrhNQeyUwNJdsFSO0TfDwRyW9EYLiM1VRfcj2E3504 Y9kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=OQ76jGvsXfBqnR0o4gFWdJMzaO0rNQ8vkLzjZ6t1BZY=; b=Jw457Am0+C4EzN6MjyETbJjFKXT5mUBpmGMhFM2BvIoDUABUi7pqUYCXIa3GIJcKGK VxBqjMn75j8BU6KYEfQkJj9CgqgsJv9JxVxgfF/eWu1fAzMfa0r3SMSWy+CJW/VPIIqp NMsdzx7fpuwcc6lB0gW4oPMEdo+NmFFoC+PwqNGGb5HGy1NUh/S4TGmBI8Ek6idhzumR nV6Ul7iR5y6aNgRVcuQ0xiX3Lrdch6E30Q9K90aJSy9Cm0Kz0a5egmpJy3tbeB8z70gF Bg/39dlJqOq/54R2nhdNQNp/g2XwE6QuVLd8eyWRI2URrCQv8dlYxY5Y35MPBTQlVChk jK5g== X-Gm-Message-State: AMke39nNma0WFLWmxPp+uYk41v2L9TQTJmYT7qryGomx/GQh2GDAqvwznoE3yge/vvtR6g== X-Received: by 10.28.153.196 with SMTP id b187mr34549167wme.53.1486965219816; Sun, 12 Feb 2017 21:53:39 -0800 (PST) Received: from dell-14z ([37.168.78.140]) by smtp.gmail.com with ESMTPSA id m29sm12364131wrm.38.2017.02.12.21.53.38 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 12 Feb 2017 21:53:38 -0800 (PST) References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto To: Juri Linkov Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil In-reply-to: <87mvdrncwh.fsf@localhost> Date: Mon, 13 Feb 2017 06:53:36 +0100 Message-ID: <87h93yhc0v.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25482-done Cc: 25482-done@debbugs.gnu.org, Eli Zaretskii 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.5 (/) Juri Linkov writes: > Thanks, Thierry, I installed your second patch (from 20 Jan) > with some modifications. Thanks. > As for your idea of using plain ASCII separators without text properties, > the problem is that it will not work if the user wants to replace > the same string as is used for the separator, e.g. to replace > → with -> in the current buffer. So yes, this is a good reason. -- Thierry From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 13 19:09:32 2017 Received: (at 25482) by debbugs.gnu.org; 14 Feb 2017 00:09:32 +0000 Received: from localhost ([127.0.0.1]:39029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdQgV-0006IB-V2 for submit@debbugs.gnu.org; Mon, 13 Feb 2017 19:09:32 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39403 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdQgU-0006I3-Pz for 25482@debbugs.gnu.org; Mon, 13 Feb 2017 19:09:31 -0500 Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 54BE415006D; Mon, 13 Feb 2017 16:09:30 -0800 (PST) Received: from localhost.linkov.net (m83-191-240-183.cust.tele2.ee [83.191.240.183]) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id 52525150069; Mon, 13 Feb 2017 16:09:29 -0800 (PST) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Organization: LINKOV.NET References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> <83mvdq1vuy.fsf@gnu.org> Date: Tue, 14 Feb 2017 02:04:45 +0200 In-Reply-To: <83mvdq1vuy.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Feb 2017 07:51:49 +0200") Message-ID: <87a89pd4de.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com 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.0 (/) > Thanks, but please also update NEWS and the Emacs manual with the > information about the new nil value of the separator. I updated NEWS, but not the Emacs manual because the new nil value is useful only for some old users (who want its old behavior), not for new users. > (Maybe it's a good idea to describe in the ELisp manual the structure > of query-replace-history elements?) Currently the structure of query-replace-history is very simple, but in bug#25591 we are going to find a solution to store more meta-information in the replacement history that might require documenting it in the ELisp manual. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 13 19:24:54 2017 Received: (at 25482) by debbugs.gnu.org; 14 Feb 2017 00:24:54 +0000 Received: from localhost ([127.0.0.1]:39035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdQvO-0006dX-AB for submit@debbugs.gnu.org; Mon, 13 Feb 2017 19:24:54 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdQvM-0006dK-Gw for 25482@debbugs.gnu.org; Mon, 13 Feb 2017 19:24:53 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1E0OjAN027444 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Feb 2017 00:24:45 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v1E0OitB018719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Feb 2017 00:24:45 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v1E0Ogu5004793; Tue, 14 Feb 2017 00:24:43 GMT MIME-Version: 1.0 Message-ID: <54d22a51-4d1c-4697-b3fc-04360e678fea@default> Date: Mon, 13 Feb 2017 16:24:41 -0800 (PST) From: Drew Adams To: Juri Linkov , Eli Zaretskii Subject: RE: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> <83mvdq1vuy.fsf@gnu.org> <87a89pd4de.fsf@localhost> In-Reply-To: <87a89pd4de.fsf@localhost> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25482 Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com 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: -2.3 (--) > > Thanks, but please also update NEWS and the Emacs manual with the > > information about the new nil value of the separator. >=20 > I updated NEWS, but not the Emacs manual because the new nil value > is useful only for some old users (who want its old behavior), > not for new users. Why would you suppose that? The behavior, which includes nil as a possible value, should be described. Let users decide whether this or that value is better for them. Please document the option correctly. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 16 16:05:49 2017 Received: (at 25482) by debbugs.gnu.org; 16 Feb 2017 21:05:49 +0000 Received: from localhost ([127.0.0.1]:42671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceTFN-0001pO-GE for submit@debbugs.gnu.org; Thu, 16 Feb 2017 16:05:49 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:40112 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceTFL-0001pA-Ld for 25482@debbugs.gnu.org; Thu, 16 Feb 2017 16:05:48 -0500 Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 0950015007E; Thu, 16 Feb 2017 13:05:46 -0800 (PST) Received: from localhost.linkov.net (m83-191-240-183.cust.tele2.ee [83.191.240.183]) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id 2BBB0150074; Thu, 16 Feb 2017 13:05:44 -0800 (PST) From: Juri Linkov To: Thierry Volpiatto Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil Organization: LINKOV.NET References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> <87h93yhc0v.fsf@gmail.com> Date: Thu, 16 Feb 2017 22:43:08 +0200 Message-ID: <87d1ehzx2b.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25482 Cc: 25482@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.0 (/) >> As for your idea of using plain ASCII separators without text properti= es, >> the problem is that it will not work if the user wants to replace >> the same string as is used for the separator, e.g. to replace >> =E2=86=92 with -> in the current buffer. > > So yes, this is a good reason. Wait, maybe you are right in the idea to use the separator string as is, instead of the null character. We still need to use text properties to unambiguously mark separator boundaries, so we can't rely on regexp matching to find separator boundaries. But at least =E2=80=9C =E2= =86=92 =E2=80=9D is not more frequent string to replace than the null character. Putting special text properties on the separator itself instead of the null character might be more beneficial for such situations where the separator is exposed without text properties, e.g. when copying the contents of the minibuffer. However, one drawback is that searching in the replacement minibuffer history for the same string as the separator (e.g. =E2=80=9C=E2=86=92=E2=80=9D) will find matc= hes in the separator, not only in replacement strings. This patch demonstrates what we could do. It still uses the =E2=80=98dis= play=E2=80=99 property because I see no other simple way to make the separator string intangible. diff --git a/lisp/replace.el b/lisp/replace.el index b96c883..6600ff6 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -149,14 +149,17 @@ query-replace-descr (mapconcat 'isearch-text-char-description string "")) =20 (defun query-replace--split-string (string) - "Split string STRING at a character with property `separator'" + "Split string STRING at a substring with property `separator'" (let* ((length (length string)) (split-pos (text-property-any 0 length 'separator t string))) (if (not split-pos) (substring-no-properties string) - (cl-assert (not (text-property-any (1+ split-pos) length 'separato= r t string))) (cons (substring-no-properties string 0 split-pos) - (substring-no-properties string (1+ split-pos) length))))) + (substring-no-properties + string (or (text-property-not-all + (1+ split-pos) length 'separator t string) + length) + length))))) =20 (defun query-replace-read-from (prompt regexp-flag) "Query and return the `from' argument of a query-replace operation. @@ -165,17 +168,19 @@ query-replace-read-from (if query-replace-interactive (car (if regexp-flag regexp-search-ring search-ring)) (let* ((history-add-new-input nil) + (separator-string + (when query-replace-from-to-separator + ;; Check if the first non-whitespace char is displayable + (if (char-displayable-p + (string-to-char (replace-regexp-in-string + " " "" query-replace-from-to-separat= or))) + query-replace-from-to-separator + " -> "))) (separator - (when query-replace-from-to-separator - (propertize "\0" - 'display - (propertize - (if (char-displayable-p - (string-to-char (replace-regexp-in-strin= g - " " "" query-replace-fr= om-to-separator))) - query-replace-from-to-separator - " -> ") - 'face 'minibuffer-prompt) + (when separator-string + (propertize separator-string + 'display separator-string + 'face 'minibuffer-prompt 'separator t))) (minibuffer-history (append @@ -203,7 +210,8 @@ query-replace-read-from (minibuffer-with-setup-hook (lambda () (setq-local text-property-default-nonsticky - (cons '(separator . t) text-property-def= ault-nonsticky))) + (append '((separator . t) (face . t)) + text-property-default-nonsticky)= )) (if regexp-flag (read-regexp prompt nil 'minibuffer-history) (read-from-minibuffer From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 18 05:45:00 2017 Received: (at 25482-done) by debbugs.gnu.org; 18 Feb 2017 10:45:00 +0000 Received: from localhost ([127.0.0.1]:44207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf2Vg-0005YC-0n for submit@debbugs.gnu.org; Sat, 18 Feb 2017 05:45:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf2Ve-0005Xw-SP for 25482-done@debbugs.gnu.org; Sat, 18 Feb 2017 05:44:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cf2VV-0007JS-DQ for 25482-done@debbugs.gnu.org; Sat, 18 Feb 2017 05:44:53 -0500 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,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf2VQ-0007Hd-Bx; Sat, 18 Feb 2017 05:44:44 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1186 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cf2VP-0001OU-F8; Sat, 18 Feb 2017 05:44:43 -0500 Date: Sat, 18 Feb 2017 12:45:13 +0200 Message-Id: <838tp3rd52.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <54d22a51-4d1c-4697-b3fc-04360e678fea@default> (message from Drew Adams on Mon, 13 Feb 2017 16:24:41 -0800 (PST)) Subject: Re: bug#25482: 26.0.50; Allow setting `query-replace-from-to-separator` to nil References: <871svzzcn4.fsf@gmail.com> <83lgu76nuf.fsf@gnu.org> <87vatac0a2.fsf@gmail.com> <83a8am6u6q.fsf@gnu.org> <87y3y6ezge.fsf@gmail.com> <8337gd7udo.fsf@gnu.org> <87o9z1n4o3.fsf@gmail.com> <83lgu252zc.fsf@gnu.org> <87o9yy26pg.fsf@gmail.com> <83fuka4yzj.fsf@gnu.org> <87vat65h3o.fsf@gmail.com> <87r33n3cgk.fsf@gmail.com> <83tw8jzllx.fsf@gnu.org> <87poj7wjkr.fsf@gmail.com> <83inozzbvz.fsf@gnu.org> <87mvebwhpx.fsf@gmail.com> <83h94jz42j.fsf@gnu.org> <87h94jyvx6.fsf@gmail.com> <87mvdrncwh.fsf@localhost> <83mvdq1vuy.fsf@gnu.org> <87a89pd4de.fsf@localhost> <54d22a51-4d1c-4697-b3fc-04360e678fea@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25482-done Cc: 25482-done@debbugs.gnu.org, thierry.volpiatto@gmail.com, juri@linkov.net 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 13 Feb 2017 16:24:41 -0800 (PST) > From: Drew Adams > Cc: 25482@debbugs.gnu.org, thierry.volpiatto@gmail.com > > > > Thanks, but please also update NEWS and the Emacs manual with the > > > information about the new nil value of the separator. > > > > I updated NEWS, but not the Emacs manual because the new nil value > > is useful only for some old users (who want its old behavior), > > not for new users. > > Why would you suppose that? The behavior, which includes nil as > a possible value, should be described. Let users decide whether > this or that value is better for them. Please document the option > correctly. Done. From unknown Sat Sep 06 20:02:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 18 Mar 2017 11:24:05 +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