;;; replace.el --- replace commands for Emacs
-;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2014 Free
+;; Copyright (C) 1985-1987, 1992, 1994, 1996-1997, 2000-2015 Free
;; Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
from Isearch by using a key sequence like `C-s C-s M-%'." "24.3")
(defcustom query-replace-from-to-separator
- (propertize
- (or (ignore-errors
- (if (char-displayable-p ?\u2192) " \u2192 " " -> "))
- " -> ")
- 'face 'minibuffer-prompt)
+ (propertize (if (char-displayable-p ?\u2192) " \u2192 " " -> ")
+ '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
:group 'matching
:type 'sexp
:version "25.1")
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
(cdar query-replace-defaults) regexp-flag))
(let* ((to (if (and (string-match separator from)
(get-text-property (match-beginning 0) 'separator from))
- (query-replace-compile-replacement
- (substring-no-properties from (match-end 0)) regexp-flag)))
+ (substring-no-properties from (match-end 0))))
(from (if to (substring-no-properties from 0 (match-beginning 0))
(substring-no-properties from))))
(add-to-history query-replace-from-history-variable from nil t)
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 to)))))))
+ (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.
(ido-ignore-item-temp-list bufs))
(while (not (string-equal
(setq buf (read-buffer
- (if (eq read-buffer-function 'ido-read-buffer)
+ (if (eq read-buffer-function #'ido-read-buffer)
"Next buffer to search (C-j to end): "
"Next buffer to search (RET to end): ")
nil t))