commit 94de186686662462d391dd23a4f15d43a7a33bb2 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Thu Apr 22 03:07:53 2021 +0200 * lisp/strokes.el: Doc fix; update URL. diff --git a/lisp/strokes.el b/lisp/strokes.el index 575092a71d..18595cb094 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -138,15 +138,14 @@ ;; the user to enter strokes which "remove the pencil from the paper" ;; so to speak, so one character can have multiple strokes. -;; NOTE (Oct 7, 2006): The URLs below seem to be invalid!!! - ;; You can read more about strokes at: -;; http://www.mit.edu/people/cadet/strokes-help.html +;; https://web.archive.org/web/20041209171947/http://www.mit.edu/people/cadet/strokes-help.html ;; If you're interested in using strokes for writing English into Emacs ;; using strokes, then you'll want to read about it on the web page above -;; or just download from http://www.mit.edu/people/cadet/strokes-abc.el, +;; or just download from: +;; https://web.archive.org/web/20041204163338/http://www.mit.edu/people/cadet/strokes-abc.el ;; which is nothing but a file with some helper commands for inserting ;; alphanumerics and punctuation. @@ -307,12 +306,6 @@ the corresponding interactive function.") ;;; Macros... -;; unused -;; (defmacro strokes-while-inhibiting-garbage-collector (&rest forms) -;; "Execute FORMS without interference from the garbage collector." -;; `(let ((gc-cons-threshold 134217727)) -;; ,@forms)) - (defsubst strokes-click-p (stroke) "Non-nil if STROKE is really click." (< (length stroke) 2)) commit fa81ed6be90127dbc8122ed5fc922b7fe5321146 Author: Dmitry Gutov Date: Thu Apr 22 03:09:13 2021 +0300 Use khaki1 as 'match' background * lisp/replace.el (match): Use khaki1 as the background color for light backgrounds (bug#47574). diff --git a/lisp/replace.el b/lisp/replace.el index 71c6e651c7..b5dea61924 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1433,7 +1433,7 @@ This is a compatibility function for \\[next-error] invocations." (defface match '((((class color) (min-colors 88) (background light)) - :background "yellow1") + :background "khaki1") (((class color) (min-colors 88) (background dark)) :background "RoyalBlue3") (((class color) (min-colors 8) (background light)) commit 3a526b6f7ea2df29c795e8315e16a21b101eb284 Author: Stefan Kangas Date: Wed Apr 21 23:27:13 2021 +0200 * lisp/emacs-lisp/package.el (package-archives): Bump :version. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 068deee582..64d7d56019 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -225,7 +225,7 @@ security." :type '(alist :key-type (string :tag "Archive name") :value-type (string :tag "URL or directory name")) :risky t - :version "26.1") ; gnutls test + :version "28.1") (defcustom package-menu-hide-low-priority 'archive "If non-nil, hide low priority packages from the packages menu. commit 85ef248ec47f34188297675dac127fcffcc4af87 Author: Stefan Kangas Date: Wed Apr 21 23:24:50 2021 +0200 * lisp/emacs-lisp/package.el: Doc fix. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 2ecd92cee9..068deee582 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -73,9 +73,9 @@ ;; M-x list-packages ;; Enters a mode similar to buffer-menu which lets you manage ;; packages. You can choose packages for install (mark with "i", -;; then "x" to execute) or deletion (not implemented yet), and you -;; can see what packages are available. This will automatically -;; fetch the latest list of packages from ELPA. +;; then "x" to execute) or deletion, and you can see what packages +;; are available. This will automatically fetch the latest list of +;; packages from ELPA. ;; ;; M-x package-install-from-buffer ;; Install a package consisting of a single .el file that appears @@ -89,7 +89,7 @@ ;; Install a package from the indicated file. The package can be ;; either a tar file or a .el file. A tar file must contain an ;; appropriately-named "-pkg.el" file; a .el file must be properly -;; formatted as with package-install-from-buffer. +;; formatted as with `package-install-from-buffer'. ;;; Thanks: ;;; (sorted by sort-lines): commit db39e2d86983dce72cf3f150712aa29a4241094a Author: Philip K Date: Wed Apr 21 22:17:27 2021 +0200 Make outline commands repeatable (bug#47878) * outline.el (outline-navigation-repeat-map): Add new map. (outline-editing-repeat-map): Add new map. diff --git a/lisp/outline.el b/lisp/outline.el index bce9c6b9e4..fa7c1a27d9 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1274,6 +1274,45 @@ Return either 'hide-all, 'headings-only, or 'show-all." (setq outline--cycle-buffer-state 'show-all) (message "Show all"))))) +(defvar outline-navigation-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-b") #'outline-backward-same-level) + (define-key map (kbd "b") #'outline-backward-same-level) + (define-key map (kbd "C-f") #'outline-forward-same-level) + (define-key map (kbd "f") #'outline-forward-same-level) + (define-key map (kbd "C-n") #'outline-next-visible-heading) + (define-key map (kbd "n") #'outline-next-visible-heading) + (define-key map (kbd "C-p") #'outline-previous-visible-heading) + (define-key map (kbd "p") #'outline-previous-visible-heading) + (define-key map (kbd "C-u") #'outline-up-heading) + (define-key map (kbd "u") #'outline-up-heading) + map)) + +(dolist (command '(outline-backward-same-level + outline-forward-same-level + outline-next-visible-heading + outline-previous-visible-heading + outline-up-heading)) + (put command 'repeat-map 'outline-navigation-repeat-map)) + +(defvar outline-editing-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-v") #'outline-move-subtree-down) + (define-key map (kbd "v") #'outline-move-subtree-down) + (define-key map (kbd "C-^") #'outline-move-subtree-up) + (define-key map (kbd "^") #'outline-move-subtree-up) + (define-key map (kbd "C->") #'outline-demote) + (define-key map (kbd ">") #'outline-demote) + (define-key map (kbd "C-<") #'outline-promote) + (define-key map (kbd "<") #'outline-promote) + map)) + +(dolist (command '(outline-move-subtree-down + outline-move-subtree-up + outline-demote + outline-promote)) + (put command 'repeat-map 'outline-editing-repeat-map)) + (provide 'outline) (provide 'noutline) commit a7cc19e5ff0425289616135ab6b4674baf02c12b Author: Mattias EngdegÄrd Date: Wed Apr 21 17:27:14 2021 +0200 Don't erroneously declare `mark` as error-free * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns) (side-effect-and-error-free-fns): `mark` is side-effect-free but not error-free. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index e526537531..43e9395967 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1324,7 +1324,7 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.") line-beginning-position line-end-position local-variable-if-set-p local-variable-p locale-info log log10 logand logb logcount logior lognot logxor lsh - make-byte-code make-list make-string make-symbol marker-buffer max + make-byte-code make-list make-string make-symbol mark marker-buffer max member memq memql min minibuffer-selected-window minibuffer-window mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string parse-colon-path plist-get plist-member @@ -1374,7 +1374,7 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.") invocation-directory invocation-name keymapp keywordp list listp - make-marker mark mark-marker markerp max-char + make-marker mark-marker markerp max-char memory-limit mouse-movement-p natnump nlistp not null number-or-marker-p numberp commit 8c83231dae0f4701c2a6ddf140df13fe028b3612 Author: Juri Linkov Date: Wed Apr 21 23:39:27 2021 +0300 * lisp/isearch.el (isearch-forward-thing-at-point): New command (bug#39512). (search-map): Bind "M-s M-." to isearch-forward-thing-at-point. (isearch-forward-thing-at-point): New defcustom. diff --git a/etc/NEWS b/etc/NEWS index 1fe49bbbd6..559ffd6d8f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -958,6 +958,13 @@ authentication mechanism by setting a value for the key 'smtp-auth'. ** Search and Replace +*** New key 'M-s M-.' starts isearch with the thing found at point. +This key is bound to the new command 'isearch-forward-thing-at-point'. +The new user option 'isearch-forward-thing-at-point' defines +a list of symbols to try to get the "thing" at point. By default, +the first element of the list is 'region' that tries to yank +the currently active region to the search string. + *** New user option 'isearch-wrap-pause' defines how to wrap the search. There are choices to disable wrapping completely and to wrap immediately. When wrapping immediately, it consistently handles the numeric arguments diff --git a/lisp/isearch.el b/lisp/isearch.el index fb2633dbe8..f1c61fc167 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -972,12 +972,13 @@ Each element is an `isearch--state' struct where the slots are (defvar-local isearch-mode nil) ;; Name of the minor mode, if non-nil. (define-key global-map "\C-s" 'isearch-forward) -(define-key esc-map "\C-s" 'isearch-forward-regexp) +(define-key esc-map "\C-s" 'isearch-forward-regexp) (define-key global-map "\C-r" 'isearch-backward) -(define-key esc-map "\C-r" 'isearch-backward-regexp) -(define-key search-map "w" 'isearch-forward-word) -(define-key search-map "_" 'isearch-forward-symbol) -(define-key search-map "." 'isearch-forward-symbol-at-point) +(define-key esc-map "\C-r" 'isearch-backward-regexp) +(define-key search-map "w" 'isearch-forward-word) +(define-key search-map "_" 'isearch-forward-symbol) +(define-key search-map "." 'isearch-forward-symbol-at-point) +(define-key search-map "\M-." 'isearch-forward-thing-at-point) ;; Entry points to isearch-mode. @@ -1157,6 +1158,42 @@ positive, or search for ARGth symbol backward if ARG is negative." (isearch-push-state) (isearch-update))))) +(defcustom isearch-forward-thing-at-point '(region url symbol sexp) + "A list of symbols to try to get the \"thing\" at point. +Each element of the list should be one of the symbols supported by +`bounds-of-thing-at-point'. This variable is used by the command +`isearch-forward-thing-at-point' to yank the initial \"thing\" +as text to the search string." + :type '(repeat (symbol :tag "Thing symbol")) + :version "28.1") + +(defun isearch-forward-thing-at-point () + "Do incremental search forward for the \"thing\" found near point. +Like ordinary incremental search except that the \"thing\" found at point +is added to the search string initially. The \"thing\" is defined by +`bounds-of-thing-at-point'. You can customize the variable +`isearch-forward-thing-at-point' to define a list of symbols to try +to find a \"thing\" at point. For example, when the list contains +the symbol `region' and the region is active, then text from the +active region is added to the search string." + (interactive) + (isearch-forward nil 1) + (let ((bounds (seq-some (lambda (thing) + (bounds-of-thing-at-point thing)) + isearch-forward-thing-at-point))) + (cond + (bounds + (when (use-region-p) + (deactivate-mark)) + (when (< (car bounds) (point)) + (goto-char (car bounds))) + (isearch-yank-string + (buffer-substring-no-properties (car bounds) (cdr bounds)))) + (t + (setq isearch-error "No thing at point") + (isearch-push-state) + (isearch-update))))) + ;; isearch-mode only sets up incremental search for the minor mode. ;; All the work is done by the isearch-mode commands. commit 57805231b2580d304dc2e0e642644ebe52c24f33 Author: Juri Linkov Date: Wed Apr 21 22:37:05 2021 +0300 * lisp/thingatpt.el (region): Put property bounds-of-thing-at-point, bug#39512 diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index c52fcfcc05..8ca0f429ca 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -600,10 +600,14 @@ with angle brackets.") (buffer-substring-no-properties (car boundary-pair) (cdr boundary-pair)))))) -;; Buffer +;; Buffer and region (put 'buffer 'end-op (lambda () (goto-char (point-max)))) (put 'buffer 'beginning-op (lambda () (goto-char (point-min)))) +(put 'region 'bounds-of-thing-at-point + (lambda () + (when (use-region-p) + (cons (region-beginning) (region-end))))) ;; UUID commit 4c6d302da8dcf511d92243f1702f40c3ad97a797 Author: Philipp Stephani Date: Wed Apr 21 20:54:32 2021 +0200 Remove a self-reference from the Emacs Lisp manual. * doc/lispref/minibuf.texi (Programmed Completion): Remove self-reference. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index b861819985..f012bfef07 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1972,7 +1972,7 @@ was entered. The return value of @code{completion-table-dynamic} is a function that can be used as the 2nd argument to @code{try-completion} and @code{all-completions}. Note that this function will always return -empty metadata and trivial boundaries (@pxref{Programmed Completion}). +empty metadata and trivial boundaries. @end defun @defun completion-table-with-cache function &optional ignore-case commit cecfbf076e4862555409cb9caa3db832316c16b4 Author: Stefan Kangas Date: Wed Apr 21 18:19:46 2021 +0200 Improve error message for missing Info manual * lisp/info.el (Info-find-file): Improve error message for missing Info manual. (Bug#46236) Fix suggested by Eli Zaretskii . diff --git a/lisp/info.el b/lisp/info.el index 5efac6f25f..82f0eb37ae 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -916,7 +916,8 @@ find a node." (when (and (not no-pop-to-dir) (not Info-current-file)) (Info-directory)) - (user-error "Info file %s does not exist" filename))) + (user-error "Info file `%s' does not exist; consider installing it" + filename))) filename)))) (defun Info-find-node (filename nodename &optional no-going-back strict-case) commit 3e727cf20baf33ae77e1955a1751c4d86a32af98 Author: Philip K Date: Wed Apr 14 19:19:01 2021 +0200 sgml-mode: Only set sgml-xml-mode if guessed to be an XML file * lisp/textmodes/sgml-mode.el (sgml-mode): Don't override sgml-xml-mode if the result of the guess is used as the buffer local value. (Bug#47877) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 67f731917e..d5930e82df 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -623,7 +623,8 @@ Do \\[describe-key] on the following bindings to discover what they do. (setq-local syntax-propertize-function #'sgml-syntax-propertize) (setq-local syntax-ppss-table sgml-tag-syntax-table) (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) - (setq-local sgml-xml-mode (sgml-xml-guess)) + (when (sgml-xml-guess) + (setq-local sgml-xml-mode t)) (unless sgml-xml-mode (setq-local skeleton-transformation-function sgml-transformation-function)) ;; This will allow existing comments within declarations to be commit e2464c534e7edd303031a0885be8cdf24a86ff70 Author: Eli Zaretskii Date: Wed Apr 21 15:29:49 2021 +0300 ; * lisp/mail/rmailmm.el (rmail-mime-set-bulk-data): Fix last change. diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 1295a086f5..99bff66657 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -785,7 +785,7 @@ directly." (setq size (- (aref body 1) (aref body 0))) (cond ((string= encoding "base64") ;; https://en.wikipedia.org/wiki/Base64#MIME - (setq size (max (* (- size 814) 0.73) 100))) + (setq size (* size 0.73))) ((string= encoding "quoted-printable") ;; Assume most of the text is ASCII... (setq size (/ (* size 5) 7)))))))