\f
* Editing Changes in Emacs 27.1
-+++
-** New isearch bindings.
-'C-M-w' in isearch changed from isearch-del-char to the new function
-isearch-yank-symbol-or-char. isearch-del-char is now bound to 'C-M-d'.
-
---
** New variable 'x-wait-for-event-timeout'.
This controls how long Emacs will wait for updates to the graphical
`text-property-search-backward' have been added. These provide an
interface that's more like functions like @code{search-forward}.
+---
+** More commands support noncontiguous rectangular regions, namely
+‘upcase-dwim’, ‘downcase-dwim’, ‘replace-string’, ‘replace-regexp’.
+
\f
* Changes in Specialized Modes and Packages in Emacs 27.1
** Search and Replace
++++
+*** New isearch bindings.
+'C-M-w' in isearch changed from isearch-del-char to the new function
+isearch-yank-symbol-or-char. isearch-del-char is now bound to 'C-M-d'.
+
+++
*** 'search-exit-option' provides new options 'move' and 'shift-move'
to extend the search string by yanking text that ends at the new
extends the search string by motion commands while holding down
the shift key.
+---
+*** Isearch now remembers the regexp-based search mode for words/symbols
+and case-sensitivity together with search strings in the search ring.
+
** Edebug
+++
(defun isearch-update-from-string-properties (string)
"Update isearch properties from the isearch string"
- (when (memq 'isearch-case-fold-search (text-properties-at 0 string))
+ (when (plist-member (text-properties-at 0 string) 'isearch-case-fold-search)
(setq isearch-case-fold-search
(get-text-property 0 'isearch-case-fold-search string)))
- (when (memq 'isearch-regexp-function (text-properties-at 0 string))
+ (when (plist-member (text-properties-at 0 string) 'isearch-regexp-function)
(setq isearch-regexp-function
(get-text-property 0 'isearch-regexp-function string))))
(defun isearch--momentary-message (string)
"Print STRING at the end of the isearch prompt for 1 second"
(let ((message-log-max nil))
- (message "%s%s [%s]"
+ (message "%s%s%s"
(isearch-message-prefix nil isearch-nonincremental)
isearch-message
- string))
+ (propertize (format " [%s]" string) 'face 'minibuffer-prompt)))
(sit-for 1))
(isearch-define-mode-toggle lax-whitespace " " nil
(cond
;; 1. Do not use a description on the default search mode,
;; but only if the default search mode is non-nil.
- ((or (and search-default-mode
- (equal search-default-mode regexp-function))
- ;; Special case where `search-default-mode' is t
- ;; (defaults to regexp searches).
- (and (eq search-default-mode t)
- (eq search-default-mode isearch-regexp))) "")
+ ((and (or (and search-default-mode
+ (equal search-default-mode regexp-function))
+ ;; Special case where `search-default-mode' is t
+ ;; (defaults to regexp searches).
+ (and (eq search-default-mode t)
+ (eq search-default-mode isearch-regexp)))
+ ;; Also do not omit description in case of error
+ ;; in default non-literal search.
+ (or isearch-success (not (or regexp-function isearch-regexp))))
+ "")
;; 2. Use the `isearch-message-prefix' set for
;; `regexp-function' if available.
(regexp-function
(< (point) isearch-opoint)))
"over")
(if isearch-wrapped "wrapped ")
+ (if (and (not isearch-success) (not isearch-case-fold-search))
+ "case-sensitive ")
(let ((prefix ""))
(advice-function-mapc
(lambda (_ props)
'face 'minibuffer-prompt)))
(defun isearch-message-suffix (&optional c-q-hack)
- (concat (if c-q-hack "^Q" "")
- (if isearch-error
- (concat " [" isearch-error "]")
- "")
- (or isearch-message-suffix-add "")))
+ (propertize (concat (if c-q-hack "^Q" "")
+ (if isearch-error
+ (concat " [" isearch-error "]")
+ "")
+ (or isearch-message-suffix-add ""))
+ 'face 'minibuffer-prompt))
\f
;; Searching
(isearch-regexp isearch-regexp-lax-whitespace)
(t isearch-lax-whitespace))
search-whitespace-regexp)))
- (condition-case er
- (funcall
- (if isearch-forward #'re-search-forward #'re-search-backward)
- (cond (isearch-regexp-function
- (let ((lax (and (not bound) (isearch--lax-regexp-function-p))))
- (when lax
- (setq isearch-adjusted t))
- (if (functionp isearch-regexp-function)
- (funcall isearch-regexp-function string lax)
- (word-search-regexp string lax))))
- (isearch-regexp string)
- (t (regexp-quote string)))
- bound noerror count)
- (search-failed
- (signal (car er)
- (let ((prefix (get isearch-regexp-function 'isearch-message-prefix)))
- (if (and isearch-regexp-function (stringp prefix))
- (list (format "%s [using %ssearch]" string prefix))
- (cdr er)))))))))
+ (funcall
+ (if isearch-forward #'re-search-forward #'re-search-backward)
+ (cond (isearch-regexp-function
+ (let ((lax (and (not bound) (isearch--lax-regexp-function-p))))
+ (when lax
+ (setq isearch-adjusted t))
+ (if (functionp isearch-regexp-function)
+ (funcall isearch-regexp-function string lax)
+ (word-search-regexp string lax))))
+ (isearch-regexp string)
+ (t (regexp-quote string)))
+ bound noerror count))))
(defun isearch-search-string (string bound noerror)
"Search for the first occurrence of STRING or its translation.
;; If there are no files that match the default pattern ChangeLog.[0-9],
;; return the current buffer to force isearch wrapping to its beginning.
;; If file is nil, multi-isearch-search-fun will signal "end of multi".
- (if (and file (file-exists-p file))
- (find-file-noselect file)
- (current-buffer))))
+ (cond
+ ;; Wrapping doesn't catch errors from the nil arg of file-exists-p,
+ ;; so handle it explicitly.
+ ((and wrap (null file))
+ (current-buffer))
+ ;; When there is no next file, file-exists-p raises the error to be
+ ;; catched by the search function that displays the error message.
+ ((file-exists-p file)
+ (find-file-noselect file))
+ (t
+ (current-buffer)))))
(defun change-log-fill-forward-paragraph (n)
"Cut paragraphs so filling preserves open parentheses at beginning of lines."