commit a691e811e23dee48674e9e0716429074fdbe3d7b (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Mon Oct 31 02:51:14 2022 +0200 Fix semantic-symref-perform-search when dir contains a space * lisp/cedet/semantic/symref/grep.el (semantic-symref-grep--local-dir): New variable. (semantic-symref-perform-search): Use it. And use "." when expanding the template to substitute for the current dir. (semantic-symref-parse-tool-output-one-line): Use it (bug#55016) diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 27ea80fc32..076775bfec 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -139,6 +139,8 @@ This shell should support pipe redirect syntax." (lambda (s) (concat "\\" s)) string nil t)) +(defvar semantic-symref-grep--local-dir nil) + (cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep)) "Perform a search with Grep." ;; Grep doesn't support some types of searches. @@ -170,11 +172,12 @@ This shell should support pipe redirect syntax." (erase-buffer) (setq default-directory rootdir) (let ((cmd (semantic-symref-grep-use-template - (directory-file-name (file-local-name rootdir)) + "." filepattern grepflags greppat))) (process-file semantic-symref-grep-shell nil b nil shell-command-switch cmd))) - (setq ans (semantic-symref-parse-tool-output tool b)) + (let ((semantic-symref-grep--local-dir (directory-file-name (file-local-name rootdir)))) + (setq ans (semantic-symref-parse-tool-output tool b))) ;; Return the answer ans)) @@ -190,12 +193,12 @@ Moves cursor to end of the match." ((eq (oref tool resulttype) 'line-and-text) (when (re-search-forward grep-re nil t) (list (string-to-number (match-string line-group)) - (match-string file-group) + (concat semantic-symref-grep--local-dir (substring (match-string file-group) 1)) (buffer-substring-no-properties (point) (line-end-position))))) (t (when (re-search-forward grep-re nil t) (cons (string-to-number (match-string line-group)) - (match-string file-group)) + (concat semantic-symref-grep--local-dir (substring (match-string file-group) 1))) ))))) (provide 'semantic/symref/grep) commit 1712dec0c030c6fb64968a9d937b02e3cfe79e87 Author: Dmitry Gutov Date: Mon Oct 31 02:48:16 2022 +0200 Speed up vc-default-checkin-patch a little * lisp/vc/vc.el (vc-default-checkin-patch): Drop some 'revert-buffer' calls to speed up the process a little (bug#52349). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index df51f52bc7..3e78b8cfe9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1715,9 +1715,6 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." "--no-backup-if-mismatch" "-i" "-")) (user-error "Patch failed: %s" (buffer-string)))) - (dolist (f files) - (with-current-buffer (get-file-buffer f) - (revert-buffer t t t))) (vc-call-backend backend 'checkin files comment)) (dolist (f files) (copy-file (expand-file-name f tmpdir) commit e5da2c3d61e96fc3d711e777b0c2d3c49346302a Author: Stefan Kangas Date: Sun Oct 30 21:30:41 2022 +0100 Prefer defvar-keymap in simula.el * lisp/progmodes/simula.el (simula-mode-map): Prefer defvar-keymap. diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index a1794d3f70..9aa8a994ed 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -245,20 +245,19 @@ for SIMULA mode to function correctly." (defvar simula-font-lock-keywords simula-font-lock-keywords-1 "Default expressions to highlight in Simula mode.") -(defvar simula-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-u" #'simula-backward-up-level) - (define-key map "\C-c\C-p" #'simula-previous-statement) - (define-key map "\C-c\C-d" #'simula-forward-down-level) - (define-key map "\C-c\C-n" #'simula-next-statement) - ;; (define-key map "\C-c\C-g" #'simula-goto-definition) - ;; (define-key map "\C-c\C-h" #'simula-standard-help) - (define-key map "\177" #'backward-delete-char-untabify) - (define-key map ":" #'simula-electric-label) - (define-key map "\e\C-q" #'simula-indent-exp) - ;; (define-key map "\t" #'simula-indent-command) - map) - "Keymap used in `simula-mode'.") +(defvar-keymap simula-mode-map + :doc "Keymap used in `simula-mode'." + "C-c C-u" #'simula-backward-up-level + "C-c C-p" #'simula-previous-statement + "C-c C-d" #'simula-forward-down-level + "C-c C-n" #'simula-next-statement + ;; "C-c C-g" #'simula-goto-definition + ;; "C-c C-h" #'simula-standard-help + "DEL" #'backward-delete-char-untabify + ":" #'simula-electric-label + "C-M-q" #'simula-indent-exp + ;; "TAB" #'simula-indent-command + ) (easy-menu-define simula-mode-menu simula-mode-map "Menu for `simula-mode'." commit e6881f2e153bdaafa7522614347155d7ab655351 Author: Stefan Kangas Date: Sun Oct 30 21:26:45 2022 +0100 ; Delete duplicate definition from simula.el * lisp/progmodes/simula.el (simula-mode-menu): Delete duplicate menu definition. diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index 7e9aeab8fe..a1794d3f70 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -1,7 +1,6 @@ ;;; simula.el --- SIMULA 87 code editing commands for Emacs -*- lexical-binding: t; -*- -;; Copyright (C) 1992, 1994, 1996, 2001-2022 Free Software Foundation, -;; Inc. +;; Copyright (C) 1992-2022 Free Software Foundation, Inc. ;; Author: Hans Henrik Eriksen ;; Maintainer: emacs-devel@gnu.org @@ -246,17 +245,6 @@ for SIMULA mode to function correctly." (defvar simula-font-lock-keywords simula-font-lock-keywords-1 "Default expressions to highlight in Simula mode.") -; The following function is taken from cc-mode.el, -; it determines the flavor of the Emacs running - -(defvar simula-mode-menu - '(["Indent Line" simula-indent-line t] - ["Backward Statement" simula-previous-statement t] - ["Forward Statement" simula-next-statement t] - ["Backward Up Level" simula-backward-up-level t] - ["Forward Down Statement" simula-forward-down-level t]) - "Emacs menu for SIMULA mode.") - (defvar simula-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-u" #'simula-backward-up-level) @@ -1560,7 +1548,6 @@ If not nil and not t, move to limit of search and return nil." (let (abbrevs-changed) (simula-install-standard-abbrevs)) -;; Hilit mode support. ;; obsolete commit 73953b23aad5af80275838cd3b1c88e045e1856e Author: Juri Linkov Date: Sun Oct 30 19:38:41 2022 +0200 * lisp/tab-line.el: Allow user-defined cache-key function (bug#57848) (tab-line-cache-key-default): New function. (tab-line-cache-key-function): New variable. (tab-line-format): Funcall tab-line-cache-key-function. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 3aa03e543a..e5e5b7b2ec 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -572,19 +572,31 @@ For use in `tab-line-tab-face-functions'." (defvar tab-line-auto-hscroll) +(defun tab-line-cache-key-default (_tabs) + "Return default list of cache keys." + (list + ;; for setting face 'tab-line-tab-current' + (mode-line-window-selected-p) + ;; for `tab-line-tab-face-modified' + (and (memq 'tab-line-tab-face-modified + tab-line-tab-face-functions) + (buffer-file-name) + (buffer-modified-p)))) + +(defvar tab-line-cache-key-function #'tab-line-cache-key-default + "Function that adds more cache keys. +It has one argument with a list of tabs, and returns a list of cache keys. +You can use `add-function' to add more cache keys.") + (defun tab-line-format () "Format for displaying the tab line of the selected window." (let* ((tabs (funcall tab-line-tabs-function)) - (cache-key (list tabs - ;; handle buffer renames - (buffer-name (window-buffer)) - ;; handle tab-line scrolling - (window-parameter nil 'tab-line-hscroll) - ;; for setting face 'tab-line-tab-current' - (mode-line-window-selected-p) - (and (memq 'tab-line-tab-face-modified - tab-line-tab-face-functions) - (buffer-file-name) (buffer-modified-p)))) + (cache-key (append (list tabs + ;; handle buffer renames + (buffer-name (window-buffer)) + ;; handle tab-line scrolling + (window-parameter nil 'tab-line-hscroll)) + (funcall tab-line-cache-key-function tabs))) (cache (window-parameter nil 'tab-line-cache))) ;; Enable auto-hscroll again after it was disabled on manual scrolling. ;; The moment to enable it is when the window-buffer was updated. commit 44c29155526dd2f3d749c2e91c9d0854e00f42ab Author: Juri Linkov Date: Sun Oct 30 19:36:06 2022 +0200 * lisp/tab-line.el: Escape %-constructs in tab names (bug#57848) (tab-line-tab-name-format-default): Replace % with %% in tab name to escape %-constructs from processing by mode-line-format. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index a4e95bbc75..3aa03e543a 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -483,7 +483,7 @@ which the tab will represent." (dolist (fn tab-line-tab-face-functions) (setf face (funcall fn tab tabs face buffer-p selected-p))) (apply 'propertize - (concat (propertize name + (concat (propertize (string-replace "%" "%%" name) ;; (bug#57848) 'keymap tab-line-tab-map 'help-echo (if selected-p "Current tab" "Click to select tab") commit 3fa4cca3d244f51e471e7779c934278731fc21e9 Author: Stefan Monnier Date: Sun Oct 30 09:39:45 2022 -0400 * lisp/url/url-util.el (url-insert-entities-in-string): Simplify diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 147a643c9f..95c0fe14f3 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -63,9 +63,9 @@ If a list, it is a list of the types of messages to be logged." (and (listp url-debug) (memq tag url-debug))) (with-current-buffer (get-buffer-create "*URL-DEBUG*") (goto-char (point-max)) - (insert (symbol-name tag) " -> " (apply 'format args) "\n") + (insert (symbol-name tag) " -> " (apply #'format args) "\n") (if (numberp url-debug) - (apply 'message args))))) + (apply #'message args))))) ;;;###autoload (defun url-parse-args (str &optional nodowncase) @@ -125,23 +125,13 @@ conversion. Replaces these characters as follows: < ==> < > ==> > \" ==> "" - (if (string-match "[&<>\"]" string) - (with-current-buffer (get-buffer-create " *entity*") - (erase-buffer) - (buffer-disable-undo (current-buffer)) - (insert string) - (goto-char (point-min)) - (while (progn - (skip-chars-forward "^&<>\"") - (not (eobp))) - (insert (cdr (assq (char-after (point)) - '((?\" . """) - (?& . "&") - (?< . "<") - (?> . ">"))))) - (delete-char 1)) - (buffer-string)) - string)) + (replace-regexp-in-string "[&<>\"]" + (lambda (c) (cdr (assq (aref c 0) + '((?\" . """) + (?& . "&") + (?< . "<") + (?> . ">"))))) + string)) ;;;###autoload (defun url-normalize-url (url) @@ -169,7 +159,7 @@ Will not do anything if `url-show-status' is nil." (= url-lazy-message-time (setq url-lazy-message-time (time-convert nil 'integer)))) nil - (apply 'message args))) + (apply #'message args))) ;;;###autoload (defun url-get-normalized-date (&optional specified-time) @@ -186,7 +176,7 @@ Will not do anything if `url-show-status' is nil." #'string-trim-left "29.1") (define-obsolete-function-alias 'url-pretty-length - 'file-size-human-readable "24.4") + #'file-size-human-readable "24.4") ;;;###autoload (defun url-display-message (fmt &rest args) @@ -206,7 +196,7 @@ Will not do anything if `url-show-status' is nil." (round (* 100 (/ x (float y))))) ;;;###autoload -(defalias 'url-basepath 'url-file-directory) +(defalias 'url-basepath #'url-file-directory) ;;;###autoload (defun url-file-directory (file) @@ -395,8 +385,7 @@ if character N is allowed." (aref url-encoding-table byte))) (if (multibyte-string-p string) (encode-coding-string string 'utf-8) - string) - "")) + string))) (defconst url-host-allowed-chars ;; Allow % to avoid re-encoding %-encoded sequences. commit 311c95fd67c219565fc750afedea3867f087aef7 Author: Stefan Monnier Date: Sun Oct 30 09:37:23 2022 -0400 dom-print: Fix missing entities quoting Also use `?\s` for the space character. * lisp/dom.el (dom-print): Properly quote special characters to avoid generating invalid HTML/XML. (dom-tag, dom-attributes, dom-children, dom-node) (dom-add-child-before): Simplify. (dom-set-attribute): Add at beginning rather than at end (slightly more efficient and less destructive). diff --git a/lisp/dom.el b/lisp/dom.el index f8c794a300..01bdef3a07 100644 --- a/lisp/dom.el +++ b/lisp/dom.el @@ -30,23 +30,17 @@ (defsubst dom-tag (node) "Return the NODE tag." ;; Called on a list of nodes. Use the first. - (if (consp (car node)) - (caar node) - (car node))) + (car (if (consp (car node)) (car node) node))) (defsubst dom-attributes (node) "Return the NODE attributes." ;; Called on a list of nodes. Use the first. - (if (consp (car node)) - (cadr (car node)) - (cadr node))) + (cadr (if (consp (car node)) (car node) node))) (defsubst dom-children (node) "Return the NODE children." ;; Called on a list of nodes. Use the first. - (if (consp (car node)) - (cddr (car node)) - (cddr node))) + (cddr (if (consp (car node)) (car node) node))) (defun dom-non-text-children (node) "Return all non-text-node children of NODE." @@ -62,10 +56,11 @@ (defun dom-set-attribute (node attribute value) "Set ATTRIBUTE in NODE to VALUE." (setq node (dom-ensure-node node)) - (let ((old (assoc attribute (cadr node)))) + (let* ((attributes (cadr node)) + (old (assoc attribute attributes))) (if old (setcdr old value) - (setcar (cdr node) (nconc (cadr node) (list (cons attribute value))))))) + (setcar (cdr node) (cons (cons attribute value) attributes))))) (defun dom-remove-attribute (node attribute) "Remove ATTRIBUTE from NODE." @@ -80,7 +75,7 @@ A typical attribute is `href'." (defun dom-text (node) "Return all the text bits in the current node concatenated." - (mapconcat 'identity (cl-remove-if-not 'stringp (dom-children node)) " ")) + (mapconcat #'identity (cl-remove-if-not #'stringp (dom-children node)) " ")) (defun dom-texts (node &optional separator) "Return all textual data under NODE concatenated with SEPARATOR in-between." @@ -195,9 +190,7 @@ ATTRIBUTE would typically be `class', `id' or the like." (defun dom-node (tag &optional attributes &rest children) "Return a DOM node with TAG and ATTRIBUTES." - (if children - `(,tag ,attributes ,@children) - (list tag attributes))) + `(,tag ,attributes ,@children)) (defun dom-append-child (node child) "Append CHILD to the end of NODE's children." @@ -215,11 +208,7 @@ If BEFORE is nil, make CHILD NODE's first child." (let ((pos (if before (cl-position before children) 0))) - (if (zerop pos) - ;; First child. - (setcdr (cdr node) (cons child (cddr node))) - (setcdr (nthcdr (1- pos) children) - (cons child (nthcdr pos children)))))) + (push child (nthcdr (+ 2 pos) node)))) node) (defun dom-ensure-node (node) @@ -247,7 +236,7 @@ white-space." (insert (format "(%S . %S)" (car elem) (cdr elem))) (if (zerop (cl-decf times)) (insert ")") - (insert "\n" (make-string column ? )))))) + (insert "\n" (make-string column ?\s)))))) (let* ((children (if remove-empty (cl-remove-if (lambda (child) @@ -258,16 +247,16 @@ white-space." (times (length children))) (if (null children) (insert ")") - (insert "\n" (make-string (1+ column) ? )) + (insert "\n" (make-string (1+ column) ?\s)) (dolist (child children) (if (stringp child) - (if (or (not remove-empty) - (not (string-match "\\`[\n\r\t  ]*\\'" child))) + (if (not (and remove-empty + (string-match "\\`[\n\r\t  ]*\\'" child))) (insert (format "%S" child))) (dom-pp child remove-empty)) (if (zerop (cl-decf times)) (insert ")") - (insert "\n" (make-string (1+ column) ? )))))))) + (insert "\n" (make-string (1+ column) ?\s)))))))) (defun dom-print (dom &optional pretty xml) "Print DOM at point as HTML/XML. @@ -279,18 +268,19 @@ If XML, generate XML instead of HTML." (dolist (elem attr) ;; In HTML, these are boolean attributes that should not have ;; an = value. - (if (and (memq (car elem) - '(async autofocus autoplay checked - contenteditable controls default - defer disabled formNoValidate frameborder - hidden ismap itemscope loop - multiple muted nomodule novalidate open - readonly required reversed - scoped selected typemustmatch)) - (cdr elem) - (not xml)) - (insert (format " %s" (car elem))) - (insert (format " %s=%S" (car elem) (cdr elem)))))) + (insert (if (and (memq (car elem) + '(async autofocus autoplay checked + contenteditable controls default + defer disabled formNoValidate frameborder + hidden ismap itemscope loop + multiple muted nomodule novalidate open + readonly required reversed + scoped selected typemustmatch)) + (cdr elem) + (not xml)) + (format " %s" (car elem)) + (format " %s=\"%s\"" (car elem) + (url-insert-entities-in-string (cdr elem))))))) (let* ((children (dom-children dom)) (non-text nil)) (if (null children) @@ -301,7 +291,7 @@ If XML, generate XML instead of HTML." (insert child) (setq non-text t) (when pretty - (insert "\n" (make-string (+ column 2) ? ))) + (insert "\n" (make-string (+ column 2) ?\s))) (dom-print child pretty xml))) ;; If we inserted non-text child nodes, or a text node that ;; ends with a newline, then we indent the end tag. @@ -310,7 +300,7 @@ If XML, generate XML instead of HTML." non-text)) (unless (bolp) (insert "\n")) - (insert (make-string column ? ))) + (insert (make-string column ?\s))) (insert (format "" (dom-tag dom))))))) (provide 'dom) commit 2fa8f1b77a66a486d67aaa0ced062b1eb4ff9f88 Author: Stefan Kangas Date: Sun Oct 30 14:30:56 2022 +0100 elide-head: Make trailing "/" in URL optional * lisp/elide-head.el (elide-head-headers-to-hide): Make trailing "/" in the gnu.org URL optional for the GPL. * test/lisp/elide-head-tests.el (elide-head--test-headers-to-hide/gpl3-5): New test. diff --git a/lisp/elide-head.el b/lisp/elide-head.el index 90bf1fe35b..75a3612df9 100644 --- a/lisp/elide-head.el +++ b/lisp/elide-head.el @@ -53,8 +53,8 @@ `(;; GNU GPL ("is free software[:;] you can redistribute it" . ,(rx (or (seq "If not, see " (? "<") - "http" (? "s") "://www.gnu.org/licenses/" - (? ">") (? " ")) + "http" (? "s") "://www.gnu.org/licenses" + (? "/") (? ">") (? " ")) (seq "Boston, MA " (? " ") "0211" (or "1-1307" "0-1301") (or " " ", ") "USA") diff --git a/test/lisp/elide-head-tests.el b/test/lisp/elide-head-tests.el index 6f351170f1..429ef26657 100644 --- a/test/lisp/elide-head-tests.el +++ b/test/lisp/elide-head-tests.el @@ -3,7 +3,6 @@ ;; Copyright (C) 2020-2022 Free Software Foundation, Inc. ;; Author: Simen Heggestøyl -;; Keywords: ;; This file is part of GNU Emacs. @@ -20,10 +19,6 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;;; Commentary: - -;; - ;;; Code: (require 'elide-head) @@ -169,6 +164,22 @@ ***************************************************************************/ " "This program is distributed in the hope that") +;; from mentor.el [no "/" in the gnu.org URL] +(elide-head--add-test gpl3-5 "\ +;; Mentor is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; Mentor is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Mentor. If not, see . +" "Mentor is distributed in the hope that") + ;;; GPLv2 commit b1fa7974bb416b3b44234966ff14c6a4719d7997 Author: Damien Cassou Date: Wed Oct 26 17:12:14 2022 +0200 Make previous-buffer and next-buffer repeatable * lisp/bindings.el (buffer-navigation-repeat-map): Add new map. * lisp/bindings.el (previous-buffer, next-buffer): Mark as repeatable. (Bug#58800) diff --git a/lisp/bindings.el b/lisp/bindings.el index 2e32128274..c1ad5f7520 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1029,6 +1029,14 @@ if `inhibit-field-text-motion' is non-nil." (define-key global-map [XF86Back] 'previous-buffer) (put 'previous-buffer :advertised-binding [?\C-x left]) +(defvar-keymap buffer-navigation-repeat-map + :doc "Keymap to repeat `next-buffer' and `previous-buffer'. Used in `repeat-mode'." + "" #'next-buffer + "" #'previous-buffer) + +(put 'next-buffer 'repeat-map 'buffer-navigation-repeat-map) +(put 'previous-buffer 'repeat-map 'buffer-navigation-repeat-map) + (let ((map minibuffer-local-map)) (define-key map "\en" 'next-history-element) (define-key map [next] 'next-history-element) commit cb8918d7cc028988bad79b66cbf577f2f37413e1 Author: Eli Zaretskii Date: Sun Oct 30 14:45:18 2022 +0200 ; Fix unclean code in w32fns.c * src/w32fns.c (setup_w32_kbdhook): Fix a typo and check errors from the call to StringFromGUID2. Reported by Juanma Barranquero . diff --git a/src/w32fns.c b/src/w32fns.c index 5f652ae9e4..93b7f80f26 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2734,8 +2734,7 @@ setup_w32_kbdhook (void) int i; CoCreateGuid (&guid); - StringFromGUID2 (&guid, newTitle, 64); - if (newTitle != NULL) + if (oldTitle != NULL && StringFromGUID2 (&guid, newTitle, 64)) { GetConsoleTitleW (oldTitle, 1024); SetConsoleTitleW (newTitle); commit 0922e755d219eb411c5c1ba42140790538aa3b0d Author: Damien Cassou Date: Wed Oct 26 16:53:23 2022 +0200 Make winner key sequences repeatable in repeat-mode * lisp/winner.el (winner-repeat-map): New variable. (winner-undo, winner-redo): Put 'repeat-map' property with 'winner-repeat-map'. (Bug#58799) diff --git a/lisp/winner.el b/lisp/winner.el index 174b698e7b..c8354b18be 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -328,6 +328,14 @@ You may want to include buffer names such as *Help*, *Apropos*, map) "Keymap for Winner mode.") +(defvar-keymap winner-repeat-map + :doc "Keymap to repeat winner key sequences. Used in `repeat-mode'." + "" #'winner-undo + "" #'winner-redo) + +(put #'winner-undo 'repeat-map 'winner-repeat-map) +(put #'winner-redo 'repeat-map 'winner-repeat-map) + ;;;###autoload (define-minor-mode winner-mode commit 16686bdb868721069088600704f8375feb9c0d81 Author: Stefan Kangas Date: Sun Oct 30 13:14:57 2022 +0100 Prefer defvar-keymap in etags.el * lisp/progmodes/etags.el (select-tags-table-mode-map): Prefer defvar-keymap. diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 85c5992998..cbdb0994cb 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1,7 +1,6 @@ ;;; etags.el --- etags facility for Emacs -*- lexical-binding: t -*- -;; Copyright (C) 1985-1986, 1988-1989, 1992-1996, 1998, 2000-2022 Free -;; Software Foundation, Inc. +;; Copyright (C) 1985-2022 Free Software Foundation, Inc. ;; Author: Roland McGrath ;; Maintainer: emacs-devel@gnu.org @@ -2006,16 +2005,15 @@ see the doc of that variable if you want to add names to the list." (set-buffer-modified-p nil) (select-tags-table-mode)) -(defvar select-tags-table-mode-map ; Doc string? - (let ((map (make-sparse-keymap))) - (set-keymap-parent map button-buffer-map) - (define-key map "t" 'push-button) - (define-key map " " 'next-line) - (define-key map "\^?" 'previous-line) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "q" 'select-tags-table-quit) - map)) +(defvar-keymap select-tags-table-mode-map + :doc "Keymap for `select-tags-table-mode'." + :parent button-buffer-map + "t" #'push-button + "SPC" #'next-line + "DEL" #'previous-line + "n" #'next-line + "p" #'previous-line + "q" #'select-tags-table-quit) (define-derived-mode select-tags-table-mode special-mode "Select Tags Table" "Major mode for choosing a current tags table among those already loaded." commit d4dffae72c9042b10e73ff418b33faa8bf3a6b44 Author: Eli Zaretskii Date: Sun Oct 30 13:16:30 2022 +0200 ; Change parent language-environment of Kharoshthi * lisp/language/misc-lang.el ("Kharoshthi"): Change its parent to "Indian". (Bug#58376) * lisp/international/mule-cmds.el (set-language-info-alist): Fix indentation. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index dfd2e1438e..61a26b504c 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1238,7 +1238,8 @@ in the European submenu in each of those two menus." (if (symbolp (setq parent-symbol (car parents))) (setq parent (symbol-name parent)) (setq parent parent-symbol parent-symbol (intern parent))) - (setq describe-map (lookup-key describe-language-environment-map (vector parent-symbol))) + (setq describe-map (lookup-key describe-language-environment-map + (vector parent-symbol))) ;; This prompt string is for define-prefix-command, so ;; that the map it creates will be suitable for a menu. (or describe-map (setq prompt (format "%s Environment" parent))) @@ -1246,19 +1247,25 @@ in the European submenu in each of those two menus." (setq describe-map (intern (format "describe-%s-environment-map" (downcase parent)))) (define-prefix-command describe-map nil prompt) - (define-key-after describe-language-environment-map (vector parent-symbol) - (cons parent describe-map))) - (setq setup-map (lookup-key setup-language-environment-map (vector parent-symbol))) + (define-key-after + describe-language-environment-map + (vector parent-symbol) (cons parent describe-map))) + (setq setup-map (lookup-key setup-language-environment-map + (vector parent-symbol))) (unless setup-map (setq setup-map (intern (format "setup-%s-environment-map" (downcase parent)))) (define-prefix-command setup-map nil prompt) - (define-key-after setup-language-environment-map (vector parent-symbol) - (cons parent setup-map))) + (define-key-after + setup-language-environment-map + (vector parent-symbol) (cons parent setup-map))) (setq parents (cdr parents)) - (set-language-info-setup-keymap lang-env alist (symbol-value describe-map) (symbol-value setup-map)))) - (set-language-info-setup-keymap lang-env alist - describe-language-environment-map setup-language-environment-map)) + (set-language-info-setup-keymap + lang-env alist + (symbol-value describe-map) (symbol-value setup-map)))) + (set-language-info-setup-keymap + lang-env alist + describe-language-environment-map setup-language-environment-map)) (dolist (elt alist) (set-language-info-internal lang-env (car elt) (cdr elt))) (if (equal lang-env current-language-environment) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index c34017d9b3..230db3b100 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -253,7 +253,7 @@ in this language environment.")) (documentation . "\ Language environment for Gāndhārī, Sanskrit, and other languages using the Kharoṣṭhī script.")) - '("Misc")) + '("Indian")) (let ((consonant "[\U00010A00\U00010A10-\U00010A35]") (vowel "[\U00010A01-\U00010A06]") commit fa249fd82455148781410b7d48295ff51881d30e Author: Visuwesh Date: Mon Oct 10 23:49:06 2022 +0530 Fix set-language-info-alist when multiple PARENTS are given * lisp/international/mule-cmds.el (set-language-info-setup-keymap): Function factored out from... (set-language-info-alist): ...here. Do not mess up the keymaps when multiple parents are given in PARENTS. (Bug#58376) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 48e5c9aa1f..dfd2e1438e 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1208,6 +1208,16 @@ Arguments are the same as `set-language-info'." (list 'const lang)) (sort (mapcar 'car language-info-alist) 'string<)))))) +(defun set-language-info-setup-keymap (lang-env alist describe-map setup-map) + "Setup menu items for LANG-ENV. +See `set-language-info-alist' for details of other arguments." + (let ((doc (assq 'documentation alist))) + (when doc + (define-key-after describe-map (vector (intern lang-env)) + (cons lang-env 'describe-specified-language-support)))) + (define-key-after setup-map (vector (intern lang-env)) + (cons lang-env 'setup-specified-language-environment))) + (defun set-language-info-alist (lang-env alist &optional parents) "Store ALIST as the definition of language environment LANG-ENV. ALIST is an alist of KEY and INFO values. See the documentation of @@ -1222,51 +1232,37 @@ in the European submenu in each of those two menus." (setq lang-env (symbol-name lang-env))) ((stringp lang-env) (setq lang-env (purecopy lang-env)))) - (let ((describe-map describe-language-environment-map) - (setup-map setup-language-environment-map)) - (if parents - (let ((l parents) - map parent-symbol parent prompt) - (while l - (if (symbolp (setq parent-symbol (car l))) - (setq parent (symbol-name parent)) - (setq parent parent-symbol parent-symbol (intern parent))) - (setq map (lookup-key describe-map (vector parent-symbol))) - ;; This prompt string is for define-prefix-command, so - ;; that the map it creates will be suitable for a menu. - (or map (setq prompt (format "%s Environment" parent))) - (if (not map) - (progn - (setq map (intern (format "describe-%s-environment-map" - (downcase parent)))) - (define-prefix-command map nil prompt) - (define-key-after describe-map (vector parent-symbol) - (cons parent map)))) - (setq describe-map (symbol-value map)) - (setq map (lookup-key setup-map (vector parent-symbol))) - (if (not map) - (progn - (setq map (intern (format "setup-%s-environment-map" - (downcase parent)))) - (define-prefix-command map nil prompt) - (define-key-after setup-map (vector parent-symbol) - (cons parent map)))) - (setq setup-map (symbol-value map)) - (setq l (cdr l))))) - - ;; Set up menu items for this language env. - (let ((doc (assq 'documentation alist))) - (when doc - (define-key-after describe-map (vector (intern lang-env)) - (cons lang-env 'describe-specified-language-support)))) - (define-key-after setup-map (vector (intern lang-env)) - (cons lang-env 'setup-specified-language-environment)) - - (dolist (elt alist) - (set-language-info-internal lang-env (car elt) (cdr elt))) - - (if (equal lang-env current-language-environment) - (set-language-environment lang-env)))) + (if parents + (while parents + (let (describe-map setup-map parent-symbol parent prompt) + (if (symbolp (setq parent-symbol (car parents))) + (setq parent (symbol-name parent)) + (setq parent parent-symbol parent-symbol (intern parent))) + (setq describe-map (lookup-key describe-language-environment-map (vector parent-symbol))) + ;; This prompt string is for define-prefix-command, so + ;; that the map it creates will be suitable for a menu. + (or describe-map (setq prompt (format "%s Environment" parent))) + (unless describe-map + (setq describe-map (intern (format "describe-%s-environment-map" + (downcase parent)))) + (define-prefix-command describe-map nil prompt) + (define-key-after describe-language-environment-map (vector parent-symbol) + (cons parent describe-map))) + (setq setup-map (lookup-key setup-language-environment-map (vector parent-symbol))) + (unless setup-map + (setq setup-map (intern (format "setup-%s-environment-map" + (downcase parent)))) + (define-prefix-command setup-map nil prompt) + (define-key-after setup-language-environment-map (vector parent-symbol) + (cons parent setup-map))) + (setq parents (cdr parents)) + (set-language-info-setup-keymap lang-env alist (symbol-value describe-map) (symbol-value setup-map)))) + (set-language-info-setup-keymap lang-env alist + describe-language-environment-map setup-language-environment-map)) + (dolist (elt alist) + (set-language-info-internal lang-env (car elt) (cdr elt))) + (if (equal lang-env current-language-environment) + (set-language-environment lang-env))) (defun read-language-name (key prompt &optional default) "Read a language environment name which has information for KEY. commit 3ceaa918295e3038fcca9950410ada5d46edfdbe Author: Eli Zaretskii Date: Sun Oct 30 10:31:00 2022 +0200 ; * src/sqlite.c (Fsqlite_select): Doc fix. (Bug#58885) diff --git a/src/sqlite.c b/src/sqlite.c index d6cb38a29a..08bf696b8c 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -528,14 +528,15 @@ DEFUN ("sqlite-select", Fsqlite_select, Ssqlite_select, 2, 4, 0, If VALUES is non-nil, it should be a list or a vector specifying the values that will be interpolated into a parameterized statement. -By default, the return value is a list where the first element is a -list of column names, and the rest of the elements are the matching data. - -RETURN-TYPE can be either nil (which means that the matching data -should be returned as a list of rows), or `full' (the same, but the -first element in the return list will be the column names), or `set', -which means that we return a set object that can be queried with -`sqlite-next' and other functions to get the data. */) +By default, the return value is a list, whose contents depend on +the value of the optional argument RETURN-TYPE. + +If RETURN-TYPE is nil or omitted, the function returns a list of rows +matching QUERY. If RETURN-TYPE is `full', the function returns a +list whose first element is the list of column names, and the rest +of the elements are the rows matching QUERY. If RETURN-TYPE is `set', +the function returns a set object that can be queried with functions +like `sqlite-next' etc., in order to get the data. */) (Lisp_Object db, Lisp_Object query, Lisp_Object values, Lisp_Object return_type) { commit b489ca507058c7d23df6a3339bd30a6dc39fa55e Author: Juri Linkov Date: Sun Oct 30 09:33:38 2022 +0200 * lisp/tab-bar.el: Minibuffer follows selected tabs (bug#58728) (tab-bar-select-tab): Set set-window-configuration arg DONT-SET-MINIWINDOW to t. Reselect the previously active minibuffer and unselect unnecessarily selected minibuffer. (tab-bar-history-back, tab-bar-history-forward): Set set-window-configuration arg DONT-SET-MINIWINDOW to t. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 9c746b8978..2032689c65 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1110,7 +1110,8 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar." (to-number (cond ((< tab-number 0) (+ (length tabs) (1+ tab-number))) ((zerop tab-number) (1+ from-index)) (t tab-number))) - (to-index (1- (max 1 (min to-number (length tabs)))))) + (to-index (1- (max 1 (min to-number (length tabs))))) + (minibuffer-was-active (minibuffer-window-active-p (selected-window)))) (unless (eq from-index to-index) (let* ((from-tab (tab-bar--tab)) @@ -1136,7 +1137,7 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar." (wc-history-back (alist-get 'wc-history-back to-tab)) (wc-history-forward (alist-get 'wc-history-forward to-tab))) - (set-window-configuration wc) + (set-window-configuration wc nil t) ;; set-window-configuration does not restore the value of ;; point in the current buffer, so restore it separately. @@ -1164,8 +1165,22 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar." tab-bar-history-forward)))) (ws + ;; `window-state-put' fails when called in the minibuffer + (when (minibuffer-selected-window) + (select-window (minibuffer-selected-window))) (window-state-put ws nil 'safe))) + ;; Select the minibuffer when it was active before switching tabs + (when (and minibuffer-was-active (active-minibuffer-window)) + (select-window (active-minibuffer-window))) + + ;; When the minibuffer was activated in one tab, but exited in + ;; another tab, then after going back to the first tab, it has + ;; such inconsistent state that the current buffer is the minibuffer, + ;; but its window is not active. So try to undo this mess. + (when (and (minibufferp) (not (active-minibuffer-window))) + (other-window 1)) + (when tab-bar-history-mode (setq tab-bar-history-omit t)) @@ -1900,7 +1915,7 @@ This navigates back in the history of window configurations." (cons tab-bar-history-old (gethash (selected-frame) tab-bar-history-forward)) tab-bar-history-forward) - (set-window-configuration wc) + (set-window-configuration wc nil t) (when (and (markerp wc-point) (marker-buffer wc-point)) (goto-char wc-point))) (message "No more tab back history")))) @@ -1919,7 +1934,7 @@ This navigates forward in the history of window configurations." (cons tab-bar-history-old (gethash (selected-frame) tab-bar-history-back)) tab-bar-history-back) - (set-window-configuration wc) + (set-window-configuration wc nil t) (when (and (markerp wc-point) (marker-buffer wc-point)) (goto-char wc-point))) (message "No more tab forward history"))))