commit 7aa106b8bf382f18342975e388720399554e2968 (HEAD, refs/remotes/origin/master) Author: Sean Whitton Date: Wed Oct 2 09:22:52 2024 +0800 Move error check from vc-next-action to diff-vc-deduce-fileset * lisp/vc/diff-mode.el (diff-vc-deduce-fileset): Signal user-error when the buffer is narrowed. * lisp/vc/vc.el (vc-next-action): Remove code signalling a user-error when the buffer is narrowed. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 948d89c579e..51e7d90f98b 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -3202,6 +3202,17 @@ hunk text is not found in the source file." ;;;###autoload (defun diff-vc-deduce-fileset () + (when (buffer-narrowed-p) + ;; If user used `diff-restrict-view' then we may not have the + ;; file header, and the commit will not succeed (bug#73387). + (user-error "Cannot commit patch when narrowed; consider %s" + (mapconcat (lambda (c) + (key-description + (where-is-internal c nil t))) + '(widen + diff-delete-other-hunks + vc-next-action) + " "))) (let ((backend (vc-responsible-backend default-directory)) files) (save-excursion diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index fce98d091bf..597a1622f5a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1302,17 +1302,6 @@ from which to check out the file(s)." ;; Fileset comes from a diff-mode buffer, see ;; 'diff-vc-deduce-fileset', and the buffer is the patch to apply. ((eq model 'patch) - (when (buffer-narrowed-p) - ;; If user used `diff-restrict-view' then we may not have the - ;; file header, and the commit will not succeed (bug#73387). - (user-error "Cannot commit patch when narrowed; consider %s" - (mapconcat (lambda (c) - (key-description - (where-is-internal c nil t))) - '(widen - diff-delete-other-hunks - vc-next-action) - " "))) (vc-checkin files backend nil nil nil (buffer-string))) ((or (null state) (eq state 'unregistered)) (cond (verbose commit fb42a253bdcbdc9f8af5f934cab4aa24d5b541bd Author: Stefan Kangas Date: Wed Oct 2 02:28:52 2024 +0200 Warn about bad defcustom :local keyword at compile time * lisp/emacs-lisp/bytecomp.el (bytecomp--custom-declare): Warn about invalid values for the defcustom :local keyword. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defcustom-local): New test. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5ed058e0a14..72953502f51 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -5467,7 +5467,13 @@ FORM is used to provide location, `bytecomp--cus-function' and (when (and name byte-compile-current-file ; only when compiling a whole file (eq fun 'custom-declare-group)) - (setq byte-compile-current-group name)))) + (setq byte-compile-current-group name)) + + ;; Check :local + (when-let ((val (and (eq fun 'custom-declare-variable) + (plist-get keyword-args :local))) + (_ (not (memq val '(t permanent permanent-only))))) + (bytecomp--cus-warn form ":local keyword does not accept %S" val)))) (byte-compile-normal-call form)) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index ca9849f351b..69918e9c0c3 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1985,6 +1985,14 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \ (dc 'integerp)) )) +(ert-deftest bytecomp-test-defcustom-local () + (cl-flet ((dc (local) `(defcustom mytest nil "doc" :type 'sexp :local ',local :group 'test))) + (bytecomp--with-warning-test + (rx ":local keyword does not accept 'symbol") (dc 'symbol)) + (bytecomp--with-warning-test + (rx ":local keyword does not accept \"string\"") (dc "string")) + )) + (ert-deftest bytecomp-test-defface-spec () (cl-flet ((df (spec) `(defface mytest ',spec "doc" :group 'test))) (bytecomp--with-warning-test commit 9ad73f92617da1286724f9774b34bb7ce6a4299d Author: Stefan Kangas Date: Wed Oct 2 01:03:08 2024 +0200 New value 'permanent-only' for defcustom :local keyword * lisp/custom.el (custom-declare-variable): Make the :local keyword accept the symbol 'permanent-local', meaning that the variable is permanent but not marked as automatically buffer-local. (defcustom): * doc/lispref/customize.texi (Variable Definitions): Document the above change. * test/lisp/custom-tests.el (custom-tests-defcustom-:local-keyword): New test. diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 33708d7faaa..b32f9dbb903 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -448,7 +448,10 @@ the build-time context. This also has the side-effect that the @kindex local@r{, @code{defcustom} keyword} If the @var{value} is @code{t}, mark @var{option} as automatically buffer-local; if the value is @code{permanent}, also set @var{option}s -@code{permanent-local} property to @code{t}. @xref{Creating Buffer-Local}. +@code{permanent-local} property to @code{t}. Finally, if the value is +@code{permanent-only}, set @var{option}s @code{permanent-local} property +to @code{t} without marking it as automatically buffer-local. +@xref{Creating Buffer-Local}. @item :risky @var{value} @kindex risky@r{, @code{defcustom} keyword} diff --git a/etc/NEWS b/etc/NEWS index bc1d0cf52c8..6262405cdd2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -492,6 +492,11 @@ sup-mouse.el, terminal.el, vi.el, vip.el, ws-mode.el, and yow.el. * Lisp Changes in Emacs 31.1 ++++ +** The 'defcustom' :local keyword can now be 'permanent-only'. +This means that the variable's 'permanent-local' property is set to t, +without marking it as automatically buffer-local. + --- ** The obsolete face attribute ':reverse-video' has been removed. Use ':inverse-video' instead. diff --git a/lisp/custom.el b/lisp/custom.el index c7ce47d4e57..1eb6bb7d64d 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -204,7 +204,7 @@ set to nil, as the value is no longer rogue." ((eq keyword :local) (when (memq value '(t permanent)) (setq buffer-local t)) - (when (eq value 'permanent) + (when (memq value '(permanent permanent-only)) (put symbol 'permanent-local t))) ((eq keyword :type) (put symbol 'custom-type (purecopy value))) @@ -300,6 +300,8 @@ The following keywords are meaningful: :local If VALUE is t, mark SYMBOL as automatically buffer-local. If VALUE is `permanent', also set SYMBOL's `permanent-local' property to t. + If VALUE is `permanent-only', set SYMBOL's `permanent-local' + property to t, but do not mark it as automatically buffer-local. The following common keywords are also meaningful. diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index c009abfe0d1..e963314fcca 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -325,4 +325,33 @@ ;; But it was only for the current session, so this should not happen. (should-not (get 'custom--test-bug-21355-after 'saved-value))))) +(defcustom custom-tests--:local-nil nil + "Not local or permanent." + :type 'number + :group 'emacs) +(defcustom custom-tests--:local-t nil + "Automatically local but not permanent." + :type 'number + :local t + :group 'emacs) +(defcustom custom-tests--:local-permanent nil + "Automatically local and permanent." + :type 'number + :local 'permanent + :group 'emacs) +(defcustom custom-tests--:local-permanent-only nil + "Permanent but not automatically local." + :type 'number + :local 'permanent-only + :group 'emacs) +(ert-deftest custom-tests-defcustom-:local-keyword () + (should-not (local-variable-if-set-p 'custom-tests--:local-nil)) + (should-not (get 'custom-tests--:local-nil 'permanent-local)) + (should (local-variable-if-set-p 'custom-tests--:local-t)) + (should-not (get 'custom-tests--:local-t 'permanent-local)) + (should (local-variable-if-set-p 'custom-tests--:local-permanent)) + (should (get 'custom-tests--:local-permanent 'permanent-local)) + (should-not (local-variable-if-set-p 'custom-tests--:local-permanent-only)) + (should (get 'custom-tests--:local-permanent-only 'permanent-local))) + ;;; custom-tests.el ends here commit 6a68334d54667f78879deb2b03676e4c28d7a6a6 Author: Stefan Kangas Date: Tue Oct 1 23:55:00 2024 +0200 Prefer defcustom :local specifier in semantic * lisp/cedet/semantic/db-find.el (semanticdb-find-default-throttle): * lisp/cedet/semantic/imenu.el (semantic-imenu-summary-function) (semantic-imenu-bucketize-file, semantic-imenu-buckets-to-submenu) (semantic-imenu-expand-type-members) (semantic-imenu-bucketize-type-members) (semantic-imenu-sort-bucket-function): * lisp/cedet/semantic/senator.el (senator-highlight-found): * lisp/cedet/semantic/symref.el (semantic-symref-tool): Prefer defcustom :local specifier to using 'make-variable-buffer-local' directly. diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index 586cb1cf23b..f980e52c315 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el @@ -166,9 +166,8 @@ the following keys: in `semanticdb-project-system-databases'. The Emacs Lisp system DB is an omniscience database." :group 'semanticdb - :type semanticdb-find-throttle-custom-list) - -(make-variable-buffer-local 'semanticdb-find-default-throttle) + :type semanticdb-find-throttle-custom-list + :local t) (defun semanticdb-find-throttle-active-p (access-type) "Non-nil if ACCESS-TYPE is an active throttle type." diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el index e13eec209ed..6043e096a0a 100644 --- a/lisp/cedet/semantic/imenu.el +++ b/lisp/cedet/semantic/imenu.el @@ -60,14 +60,14 @@ (defcustom semantic-imenu-summary-function 'semantic-format-tag-abbreviate "Function to use when creating items in Imenu. Some useful functions are found in `semantic-format-tag-functions'." - :type semantic-format-tag-custom-list) -(make-variable-buffer-local 'semantic-imenu-summary-function) + :type semantic-format-tag-custom-list + :local t) ;;;###autoload (defcustom semantic-imenu-bucketize-file t "Non-nil if tags in a file are to be grouped into buckets." - :type 'boolean) -(make-variable-buffer-local 'semantic-imenu-bucketize-file) + :type 'boolean + :local t) (defcustom semantic-imenu-adopt-external-members t "Non-nil if types in a file should adopt externally defined members. @@ -78,21 +78,21 @@ definition." (defcustom semantic-imenu-buckets-to-submenu t "Non-nil if buckets of tags are to be turned into submenus. This option is ignored if `semantic-imenu-bucketize-file' is nil." - :type 'boolean) -(make-variable-buffer-local 'semantic-imenu-buckets-to-submenu) + :type 'boolean + :local t) ;;;###autoload (defcustom semantic-imenu-expand-type-members t "Non-nil if types should have submenus with members in them." - :type 'boolean) -(make-variable-buffer-local 'semantic-imenu-expand-type-members) + :type 'boolean + :local t) (defcustom semantic-imenu-bucketize-type-members t "Non-nil if members of a type should be grouped into buckets. A nil value means to keep them in the same order. Overridden to nil if `semantic-imenu-bucketize-file' is nil." - :type 'boolean) -(make-variable-buffer-local 'semantic-imenu-bucketize-type-members) + :type 'boolean + :local t) (defcustom semantic-imenu-sort-bucket-function nil "Function to use when sorting tags in the buckets of functions. @@ -107,8 +107,8 @@ on this function." (const semantic-sort-tags-by-name-decreasing-ci) (const semantic-sort-tags-by-type-increasing-ci) (const semantic-sort-tags-by-type-decreasing-ci) - (function))) -(make-variable-buffer-local 'semantic-imenu-sort-bucket-function) + (function)) + :local t) (defcustom semantic-imenu-index-directory nil "Non-nil to index the entire directory for tags. diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index aec251a0dc6..94d91105fda 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -85,8 +85,8 @@ tag, where possible." (defcustom senator-highlight-found nil "If non-nil, Senator commands momentarily highlight found tags." - :type 'boolean) -(make-variable-buffer-local 'senator-highlight-found) + :type 'boolean + :local t) ;;; Faces (defface senator-momentary-highlight-face diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el index 5c487a7f44d..a9148bd80ed 100644 --- a/lisp/cedet/semantic/symref.el +++ b/lisp/cedet/semantic/symref.el @@ -81,8 +81,8 @@ The tool symbol can be `detect', or a symbol that is the name of a tool that can be used for symbol referencing." :type 'symbol + :local t :group 'semantic) -(make-variable-buffer-local 'semantic-symref-tool) ;;; TOOL SETUP ;; commit df8d8a786f10de780235618cdf9af7fbc139620c Author: Stefan Kangas Date: Tue Oct 1 23:40:56 2024 +0200 Prefer defcustom :local specifier in allout * lisp/allout-widgets.el (allout-widgets-track-decoration): * lisp/allout.el (allout-inhibit-auto-fill) (allout-inhibit-auto-fill-on-headline, allout-use-hanging-indents) (allout-reindent-bodies, allout-show-bodies, allout-header-prefix) (allout-primary-bullet, allout-plain-bullets-string) (allout-distinctive-bullets-string, allout-old-style-prefixes) (allout-stylish-prefixes, allout-numbered-bullet) (allout-presentation-padding, allout-encrypt-unencrypted-on-saves) (allout-enable-file-variable-adjustment): Prefer defcustom :local specifier to using 'make-variable-buffer-local' directly. diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 6808a68681a..df62bd9f54b 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -275,8 +275,8 @@ buffer rather than as a prevailing configuration (but it's handy to publicize it by making it a customization variable)." :version "24.1" :type 'boolean + :local t :group 'allout-widgets-developer) -(make-variable-buffer-local 'allout-widgets-track-decoration) ;;;_ : Mode context - variables, hookup, and hooks ;;;_ . internal mode variables diff --git a/lisp/allout.el b/lisp/allout.el index e3fe8d08841..e49bdfc9cd0 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -382,23 +382,23 @@ value that `normal-auto-fill-function', if any, when allout mode starts, or else allout's special hanging-indent maintaining auto-fill function, `allout-auto-fill'." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-inhibit-auto-fill) ;;;_ = allout-inhibit-auto-fill-on-headline (defcustom allout-inhibit-auto-fill-on-headline nil "If non-nil, auto-fill will be inhibited while on topic's header line." :version "24.1" :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-inhibit-auto-fill-on-headline) ;;;_ = allout-use-hanging-indents (defcustom allout-use-hanging-indents t "If non-nil, topic body text auto-indent defaults to indent of the header. I.e., it is indented to be just past the header prefix. This is relevant mostly for situations where auto-fill occurs." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-use-hanging-indents) ;;;###autoload (put 'allout-use-hanging-indents 'safe-local-variable #'booleanp) ;;;_ = allout-reindent-bodies @@ -414,9 +414,9 @@ A value of t enables reindent in non-programming-code buffers, ie those that do not have the variable `comment-start' set. A value of `force' enables reindent whether or not `comment-start' is set." :type '(choice (const nil) (const t) (const text) (const force)) + :local t :group 'allout) -(make-variable-buffer-local 'allout-reindent-bodies) ;;;###autoload (put 'allout-reindent-bodies 'safe-local-variable (lambda (x) (memq x '(nil t text force)))) @@ -425,8 +425,8 @@ those that do not have the variable `comment-start' set. A value of (defcustom allout-show-bodies nil "If non-nil, show entire body when exposing a topic, rather than just the header." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-show-bodies) ;;;###autoload (put 'allout-show-bodies 'safe-local-variable #'booleanp) @@ -498,8 +498,8 @@ header prefix, which mostly have the value of this var at their front. Level 1 topics are exceptions. They consist of only a single character, which is typically set to the `allout-primary-bullet'." :type 'string + :local t :group 'allout) -(make-variable-buffer-local 'allout-header-prefix) ;;;###autoload (put 'allout-header-prefix 'safe-local-variable #'stringp) ;;;_ = allout-primary-bullet @@ -515,8 +515,8 @@ with the original Emacs outline mode. See `allout-plain-bullets-string' and `allout-distinctive-bullets-string' for the range of available bullets." :type 'string + :local t :group 'allout) -(make-variable-buffer-local 'allout-primary-bullet) ;;;###autoload (put 'allout-primary-bullet 'safe-local-variable #'stringp) ;;;_ = allout-plain-bullets-string @@ -531,8 +531,8 @@ DO NOT include the close-square-bracket, `]', as a bullet. Outline mode has to be reactivated in order for changes to the value of this var to take effect." :type 'string + :local t :group 'allout) -(make-variable-buffer-local 'allout-plain-bullets-string) ;;;###autoload (put 'allout-plain-bullets-string 'safe-local-variable #'stringp) ;;;_ = allout-distinctive-bullets-string @@ -579,8 +579,8 @@ adopt changes of this value. DO NOT include the close-square-bracket, `]', on either of the bullet strings." :type 'string + :local t :group 'allout) -(make-variable-buffer-local 'allout-distinctive-bullets-string) ;;;###autoload (put 'allout-distinctive-bullets-string 'safe-local-variable #'stringp) @@ -646,8 +646,8 @@ like the original Emacs-outline style prefixes. Whatever the setting of this variable, both old and new style prefixes are always respected by the topic maneuvering functions." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-old-style-prefixes) ;;;###autoload (put 'allout-old-style-prefixes 'safe-local-variable #'booleanp) ;;;_ = allout-stylish-prefixes -- alternating bullets @@ -694,8 +694,8 @@ this variable setting. The setting of this var is not relevant when `allout-old-style-prefixes' is non-nil." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-stylish-prefixes) ;;;###autoload (put 'allout-stylish-prefixes 'safe-local-variable #'booleanp) @@ -708,8 +708,8 @@ sequence-number tacked on, just after the bullet. Conventionally set to \"#\", you can set it to a bullet of your choice. A nil value disables numbering maintenance." :type '(choice (const nil) string) + :local t :group 'allout) -(make-variable-buffer-local 'allout-numbered-bullet) ;;;###autoload (put 'allout-numbered-bullet 'safe-local-variable #'string-or-null-p) ;;;_ = allout-file-xref-bullet @@ -725,9 +725,8 @@ Set this var to the bullet you want to use for file cross-references." (defcustom allout-presentation-padding 2 "Presentation-format white-space padding factor, for greater indent." :type 'integer + :local t :group 'allout) - -(make-variable-buffer-local 'allout-presentation-padding) ;;;###autoload (put 'allout-presentation-padding 'safe-local-variable #'integerp) @@ -809,11 +808,10 @@ text for editing though the file system copy is encrypted. \(Auto-saves are handled differently. Buffers with plain-text exposed encrypted topics are exempted from auto saves until all such topics are encrypted.)" - :type 'boolean + :local t :version "23.1" :group 'allout-encryption) -(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) (defvar allout-auto-save-temporarily-disabled nil "Non-nil while topic encryption is pending and auto-saving was active. @@ -842,8 +840,8 @@ is nil. Operations potentially causing edits include allout encryption routines. For details, see `allout-toggle-current-subtree-encryption's docstring." :type 'boolean + :local t :group 'allout) -(make-variable-buffer-local 'allout-enable-file-variable-adjustment) ;;;_* CODE -- no user customizations below. commit bf3129d5821bb8804e486bc5d51de04846a31f12 Author: john muhl Date: Mon Jul 8 15:54:02 2024 -0500 Use defvar-keymap in lua-ts-mode * lisp/progmodes/lua-ts-mode.el (lua-ts-mode-map): Replace 'defvar' with 'defvar-keymap'. (Bug#73585) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 06daadbc1fd..d167215326c 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -720,14 +720,12 @@ Calls REPORT-FN directly." ((buffer-live-p (process-buffer process)))) (with-current-buffer buffer (comint-write-input-ring)))) -(defvar lua-ts-mode-map - (let ((map (make-sparse-keymap "Lua"))) - (keymap-set map "C-c C-n" 'lua-ts-inferior-lua) - (keymap-set map "C-c C-c" 'lua-ts-send-buffer) - (keymap-set map "C-c C-l" 'lua-ts-send-file) - (keymap-set map "C-c C-r" 'lua-ts-send-region) - map) - "Keymap for `lua-ts-mode' buffers.") +(defvar-keymap lua-ts-mode-map + :doc "Keymap for `lua-ts-mode' buffers." + "C-c C-n" #'lua-ts-inferior-lua + "C-c C-c" #'lua-ts-send-buffer + "C-c C-l" #'lua-ts-send-file + "C-c C-r" #'lua-ts-send-region) (easy-menu-define lua-ts-mode-menu lua-ts-mode-map "Menu bar entry for `lua-ts-mode'." commit e1815536622c646ce56a06c0b85801003b303a01 Author: Stefan Kangas Date: Tue Oct 1 21:19:49 2024 +0200 Fix warning in dictionary.el * lisp/net/dictionary.el (dictionary-word-entry-face): Fix face attribute. diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index f17dc160997..3d3dd6d28fa 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -336,7 +336,7 @@ Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." (((type tty) (class color)) (:foreground "green")) (t - (:inverse t))) + (:inverse-video t))) "The face that is used for displaying the initial word entry line." :group 'dictionary :version "28.1") commit e792856b001f260572b4012241748c41e045c638 Author: Stefan Kangas Date: Tue Oct 1 20:22:34 2024 +0200 Prefer defvar-local where possible * lisp/editorconfig.el (editorconfig-properties-hash): * lisp/emacs-lisp/comp-run.el (comp-last-scanned-async-output): * lisp/info-look.el (info-lookup-mode): * lisp/mh-e/mh-folder.el (mh-generate-sequence-font-lock): * lisp/net/tramp.el (tramp-temp-buffer-file-name): * lisp/obsolete/iswitchb.el (iswitchb-eoinput): * lisp/obsolete/longlines.el (longlines-wrap-beg, longlines-wrap-end) (longlines-wrap-point, longlines-showing, longlines-decoded): * lisp/obsolete/tpu-edt.el (tpu-newline-and-indent-p) (tpu-newline-and-indent-string, tpu-saved-delete-func) (tpu-buffer-local-map, tpu-mark-flag): * lisp/progmodes/python.el (python-check-custom-command): * lisp/textmodes/reftex.el (reftex-docstruct-symbol) (reftex-isearch-minor-mode): Prefer defvar-local where possible, and the package does not support Emacs 24.3 or earlier. diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el index 8d239229dcb..c21e12559a6 100644 --- a/lisp/editorconfig.el +++ b/lisp/editorconfig.el @@ -283,14 +283,11 @@ If set, enable that mode when `trim_trailing_whitespace` is set to true. Otherwise, use `delete-trailing-whitespace'." :type 'symbol) -(defvar editorconfig-properties-hash nil +(defvar-local editorconfig-properties-hash nil "Hash object of EditorConfig properties that was enabled for current buffer. Set by `editorconfig-apply' and nil if that is not invoked in current buffer yet.") -(make-variable-buffer-local 'editorconfig-properties-hash) -(put 'editorconfig-properties-hash - 'permanent-local - t) +(put 'editorconfig-properties-hash 'permanent-local t) (defvar editorconfig-lisp-use-default-indent nil "Selectively ignore the value of indent_size for Lisp files. @@ -464,9 +461,7 @@ heuristic for those modes not found there." (defvar-local editorconfig--apply-coding-system-currently nil "Used internally.") -(put 'editorconfig--apply-coding-system-currently - 'permanent-local - t) +(put 'editorconfig--apply-coding-system-currently 'permanent-local t) (defun editorconfig-merge-coding-systems (end-of-line charset) "Return merged coding system symbol of END-OF-LINE and CHARSET." diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index a659d7f68b7..3c7802c2ee0 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -186,8 +186,7 @@ processes from `comp-async-compilations'" (max 1 (/ (num-processors) 2)))) native-comp-async-jobs-number)) -(defvar comp-last-scanned-async-output nil) -(make-variable-buffer-local 'comp-last-scanned-async-output) +(defvar-local comp-last-scanned-async-output nil) ;; From warnings.el (defvar warning-suppress-types) (defun comp--accept-and-process-async-output (process) diff --git a/lisp/info-look.el b/lisp/info-look.el index 2baf133c7d3..ea35540d5c0 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -46,11 +46,10 @@ "Major mode sensitive help agent." :group 'help :group 'languages) -(defvar info-lookup-mode nil +(defvar-local info-lookup-mode nil "Symbol of the current buffer's help mode. Help is provided according to the buffer's major mode if value is nil. Automatically becomes buffer local when set in any fashion.") -(make-variable-buffer-local 'info-lookup-mode) (defcustom info-lookup-other-window-flag t "Non-nil means pop up the Info buffer in another window." diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index c90537f1502..7cbcf9f1c0f 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -454,11 +454,10 @@ FACE is the font-lock face used to display the matching scan lines." (let ((cache (intern (format "mh-folder-%s-seq-cache" prefix))) (func (intern (format "mh-folder-font-lock-%s" prefix)))) `(progn - (defvar ,cache nil + (defvar-local ,cache nil "Internal cache variable used for font-lock in MH-E. Should only be non-nil through font-lock stepping, and nil once font-lock is done highlighting.") - (make-variable-buffer-local ',cache) (defun ,func (limit) "Return unseen message lines to font-lock between point and LIMIT." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 806010624b2..0a8d2d4cb2c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -853,11 +853,9 @@ filename part, though.") "Buffer name for a temporary buffer. It shall be used in combination with `generate-new-buffer-name'.") -(defvar tramp-temp-buffer-file-name nil +(defvar-local tramp-temp-buffer-file-name nil "File name of a persistent local temporary file. Useful for \"rsync\" like methods.") - -(make-variable-buffer-local 'tramp-temp-buffer-file-name) (put 'tramp-temp-buffer-file-name 'permanent-local t) (defcustom tramp-syntax 'default diff --git a/lisp/obsolete/iswitchb.el b/lisp/obsolete/iswitchb.el index e1ea9141f0d..abd5005e54d 100644 --- a/lisp/obsolete/iswitchb.el +++ b/lisp/obsolete/iswitchb.el @@ -410,10 +410,9 @@ Its value is one of `samewindow', `otherwindow', `display', `otherframe', `maybe-frame' or `always-frame'. See `iswitchb-default-method' for details of values.") -(defvar iswitchb-eoinput 1 +(defvar-local iswitchb-eoinput 1 "Point where minibuffer input ends and completion info begins. Copied from `icomplete-eoinput'.") -(make-variable-buffer-local 'iswitchb-eoinput) (defvar iswitchb-buflist nil "Stores the current list of buffers that will be searched through. diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el index f065bcaff26..3cfde4cb298 100644 --- a/lisp/obsolete/longlines.el +++ b/lisp/obsolete/longlines.el @@ -80,17 +80,11 @@ This is used when `longlines-show-hard-newlines' is on." ;;; Internal variables -(defvar longlines-wrap-beg nil) -(defvar longlines-wrap-end nil) -(defvar longlines-wrap-point nil) -(defvar longlines-showing nil) -(defvar longlines-decoded nil) - -(make-variable-buffer-local 'longlines-wrap-beg) -(make-variable-buffer-local 'longlines-wrap-end) -(make-variable-buffer-local 'longlines-wrap-point) -(make-variable-buffer-local 'longlines-showing) -(make-variable-buffer-local 'longlines-decoded) +(defvar-local longlines-wrap-beg nil) +(defvar-local longlines-wrap-end nil) +(defvar-local longlines-wrap-point nil) +(defvar-local longlines-showing nil) +(defvar-local longlines-decoded nil) ;;; Mode diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el index 62431662baa..4447a8d1001 100644 --- a/lisp/obsolete/tpu-edt.el +++ b/lisp/obsolete/tpu-edt.el @@ -604,21 +604,17 @@ GOLD is the ASCII 7-bit escape sequence OP.") ;;; ;;; Buffer Local Variables ;;; -(defvar tpu-newline-and-indent-p nil +(defvar-local tpu-newline-and-indent-p nil "If non-nil, Return produces a newline and indents.") -(make-variable-buffer-local 'tpu-newline-and-indent-p) -(defvar tpu-newline-and-indent-string nil +(defvar-local tpu-newline-and-indent-string nil "Mode line string to identify AutoIndent mode.") -(make-variable-buffer-local 'tpu-newline-and-indent-string) -(defvar tpu-saved-delete-func nil +(defvar-local tpu-saved-delete-func nil "Saved value of the delete key.") -(make-variable-buffer-local 'tpu-saved-delete-func) -(defvar tpu-buffer-local-map nil +(defvar-local tpu-buffer-local-map nil "TPU-edt buffer local key map.") -(make-variable-buffer-local 'tpu-buffer-local-map) ;;; @@ -631,8 +627,7 @@ GOLD is the ASCII 7-bit escape sequence OP.") ;;; (defvar tpu-original-mm-alist minor-mode-alist) -(defvar tpu-mark-flag "") -(make-variable-buffer-local 'tpu-mark-flag) +(defvar-local tpu-mark-flag "") (defun tpu-set-mode-line (for-tpu) "Set `minor-mode-alist' for TPU-edt, or reset it to default Emacs." diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d4a213466f3..a9fb3e3de6a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5574,10 +5574,8 @@ def __FFAP_get_module_path(objstr): "Buffer name used for check commands." :type 'string) -(defvar python-check-custom-command nil +(defvar-local python-check-custom-command nil "Internal use.") -;; XXX: Avoid `defvar-local' for compat with Emacs<24.3 -(make-variable-buffer-local 'python-check-custom-command) (defun python-check (command) "Check a Python file (default current buffer's file). diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index efe38337001..165afd5a746 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -273,8 +273,7 @@ on the menu bar. (defvar reftex-multifile-index 0) ;; Variable holding the symbol with the label list of the document. -(defvar reftex-docstruct-symbol nil) -(make-variable-buffer-local 'reftex-docstruct-symbol) +(defvar-local reftex-docstruct-symbol nil) (defun reftex-next-multifile-index () ;; Return the next free index for multifile symbols. @@ -2116,8 +2115,7 @@ IGNORE-WORDS List of words which should be removed from the string." ;; Define a menu for the menu bar if Emacs is running under X -(defvar reftex-isearch-minor-mode nil) -(make-variable-buffer-local 'reftex-isearch-minor-mode) +(defvar-local reftex-isearch-minor-mode nil) (easy-menu-define reftex-mode-menu reftex-mode-map "Menu used in RefTeX mode." commit ff87166227b2634e45591e8c73db9b102734ab77 Author: Stefan Monnier Date: Tue Oct 1 14:46:06 2024 -0400 * lisp/emacs-lisp/package.el (package-isolate): Use `package-activate-all` `package-initialize` is used to initialize the whole machinery needed to list/download/install/remove packages, whereas here we only need to use the installed packages. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7cae8d68bc0..90d6150ed0b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2690,7 +2690,7 @@ the Emacs user directory is set to a temporary directory." `(add-to-list 'package-directory-list ,dir)) (cons package-user-dir package-directory-list)) (setq package-load-list ',package-load-list) - (package-initialize))))))) + (package-activate-all))))))) ;;;; Package description buffer. commit 372ce6adbf39c5b9ec92e103abe70af872085119 Author: Andrea Corallo Date: Tue Oct 1 18:15:02 2024 +0200 * Don't iterate over an hash table while modifyiong it in comp. * lisp/emacs-lisp/comp.el: Don't iterate over the hash values directly as 'comp--add-cond-cstrs-target-block' can modify the hash content. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index f1c8f02ebc3..342212f5185 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1974,7 +1974,11 @@ TARGET-BB-SYM is the symbol name of the target block." (defun comp--add-cond-cstrs-simple () "`comp--add-cstrs' worker function for each selected function." (cl-loop - for b being each hash-value of (comp-func-blocks comp-func) + ;; Don't iterate over hash values directly as + ;; `comp--add-cond-cstrs-target-block' can modify the hash table + ;; content. + for b in (cl-loop for b being each hash-value of (comp-func-blocks comp-func) + collect b) do (cl-loop named in-the-basic-block commit 3e92f952aa15ff3dd3f9a8523646252dcb1dc412 Author: Sean Whitton Date: Tue Oct 1 09:15:44 2024 +0800 ; * lisp/emacs-lisp/cond-star.el (cond*): Fix typo. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 543386bfcf5..9495ad96a6c 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -58,7 +58,7 @@ When a clause's condition is true, and it exits the `cond*' or is the last clause, the value of the last expression in its body becomes the return value of the `cond*' construct. -Mon-exit clause: +Non-exit clause: If a clause has only one element, or if its first element is t, or if it ends with the keyword :non-exit, then commit b64f69f6dcc08e5aeea0464f6d8b560ed7002d36 Author: Sean Whitton Date: Mon Sep 30 21:08:38 2024 +0800 New command diff-delete-other-hunks * lisp/vc/diff-mode.el (diff-delete-other-hunks): New command (bug#73387). (diff-mode-map): Bind the new command to C-c RET n. (diff-mode-menu): New entry for the new command. (vc-next-action): Stop, and warn, if the user attempts to commit a patch from a narrowed buffer (bug#73387). * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the new command. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index a3a8c854aa6..67a1a3be3ff 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1703,6 +1703,11 @@ confirm you really want to revert and kill the hunk. You can customize Apply all the hunks in the buffer (@code{diff-apply-buffer}). If the diffs were applied successfully, save the changed buffers. +@findex diff-delete-other-hunks +@item C-c @key{RET} n +Delete all hunks other than the current hunk. If the region is active, +then delete all hunks that the region does not overlap. + @findex diff-refine-hunk @item C-c C-b Highlight the changes of the hunk at point with a finer granularity diff --git a/etc/NEWS b/etc/NEWS index 37568ffdbea..bc1d0cf52c8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -382,6 +382,13 @@ Previously, 'diff-file-prev' and 'diff-hunk-prev' would move when point is after the corresponding file or hunk header, but not when inside it. Now they will always move to the start of the current header. ++++ +*** New command 'diff-delete-other-hunks' bound to C-c RET n. +This command deletes all hunks other than the current hunk. It is +useful to prepare a *vc-diff* buffer for committing a single hunk. +When the region is active, it deletes all hunks that the region does not +overlap. + ** php-ts-mode --- diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 25c6238765d..948d89c579e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -220,6 +220,7 @@ The default \"-b\" means to ignore whitespace-only changes, "C-c C-a" #'diff-apply-hunk "C-c M-r" #'diff-revert-and-kill-hunk "C-c C-m a" #'diff-apply-buffer + "C-c C-m n" #'diff-delete-other-hunks "C-c C-e" #'diff-ediff-patch "C-c C-n" #'diff-restrict-view "C-c C-s" #'diff-split-hunk @@ -278,6 +279,8 @@ The default \"-b\" means to ignore whitespace-only changes, :help "Kill current hunk"] ["Kill current file's hunks" diff-file-kill :help "Kill all current file's hunks"] + ["Delete other hunks" diff-delete-other-hunks + :help "Delete hunks other than the current hunk"] "-----" ["Previous Hunk" diff-hunk-prev :help "Go to the previous count'th hunk"] @@ -814,6 +817,37 @@ If the prefix ARG is given, restrict the view to the current file instead." (goto-char (car bounds)) (ignore-errors (diff-beginning-of-hunk t))))) +;; This is not `diff-kill-other-hunks' because we might need to make +;; copies of file headers in order to ensure the new kill ring entry +;; would be a patch with the same meaning. That is not implemented +;; because it does not seem like it would be useful. +(defun diff-delete-other-hunks (&optional beg end) + "Delete all hunks other than the current hunk. +Interactively, if the region is active, then delete all hunks that the +region does not overlap. When called from Lisp, the optional arguments +BEG and END specify the region of hunks not to delete." + (interactive (list (use-region-beginning) (use-region-end))) + (when (buffer-narrowed-p) + (user-error "Command is not safe in a narrowed buffer")) + (let ((inhibit-read-only t)) + (save-excursion + (cond ((xor beg end) + (error "Require exactly zero or two arguments")) + (beg + (goto-char beg) + (setq beg (car (diff-bounds-of-hunk))) + (goto-char end) + (setq end (cadr (diff-bounds-of-hunk)))) + (t + (pcase-setq `(,beg ,end) (diff-bounds-of-hunk)))) + (delete-region end (point-max)) + (goto-char beg) + (diff-beginning-of-file) + (diff-hunk-next) + (delete-region (point) beg) + (diff-beginning-of-file-and-junk) + (delete-region (point-min) (point))))) + (defun diff-beginning-of-file-and-junk () "Go to the beginning of file-related diff-info. This is like `diff-beginning-of-file' except it tries to skip back over leading diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 597a1622f5a..fce98d091bf 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1302,6 +1302,17 @@ from which to check out the file(s)." ;; Fileset comes from a diff-mode buffer, see ;; 'diff-vc-deduce-fileset', and the buffer is the patch to apply. ((eq model 'patch) + (when (buffer-narrowed-p) + ;; If user used `diff-restrict-view' then we may not have the + ;; file header, and the commit will not succeed (bug#73387). + (user-error "Cannot commit patch when narrowed; consider %s" + (mapconcat (lambda (c) + (key-description + (where-is-internal c nil t))) + '(widen + diff-delete-other-hunks + vc-next-action) + " "))) (vc-checkin files backend nil nil nil (buffer-string))) ((or (null state) (eq state 'unregistered)) (cond (verbose commit f95d4208b6bcfbbf95c956d8a66faa92aa5e4965 Author: Stefan Kangas Date: Mon Sep 30 20:34:24 2024 +0200 cond-star: Fix copyright * lisp/emacs-lisp/cond-star.el: Fix copyright year and license statement. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index f6a37c08fde..543386bfcf5 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -1,18 +1,18 @@ ;;; cond-star.el --- Extended form of `cond' construct -*-lexical-binding: t; -*- -;; Copyright (C) 1985-2024 Free Software Foundation, Inc. +;; Copyright (C) 2024 Free Software Foundation, Inc. -;; Maintainer: rms@gnu.org +;; Maintainer: Richard Stallman ;; Package: emacs -;; This file is part of GNU Emacs. It implements `cond*'. +;; This file is part of GNU Emacs. -;; cond* is free software: you can redistribute it and/or modify +;; GNU Emacs 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 of the License, or ;; (at your option) any later version. -;; cond* is distributed in the hope that it will be useful, +;; GNU Emacs 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. @@ -22,6 +22,8 @@ ;;; Commentary: +;; This library implements `cond*', an alternative to 'pcase'. + ;; Here is the list of functions the generated code is known to call: ;; car, cdr, car-safe, cdr-safe, nth, nthcdr, null, eq, equal, eql, =, ;; vectorp, length. commit 4197a8450669e08c2d26f4a7d77dcb2771bd9492 Author: Jeremy Bryant Date: Thu Aug 8 23:01:13 2024 +0100 cond-star: Fix trivial typos, checkdoc fixes, etc. * lisp/emacs-lisp/cond-star.el (cond*): Add header and footer as per checkdoc fixes. (match*, cond*-non-exit-clause-substance) (cond*-convert-clause, cond*-convert-condition) (cond*-match, cond*-subpat) (cond*-used-within, cond-star): Fix typos in comments, and apply checkdoc fixes. (Bug#72546) diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 5ff921bb35e..f6a37c08fde 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -1,4 +1,4 @@ -;;; -*-lexical-binding: t; -*- +;;; cond-star.el --- Extended form of `cond' construct -*-lexical-binding: t; -*- ;; Copyright (C) 1985-2024 Free Software Foundation, Inc. @@ -20,6 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;; Here is the list of functions the generated code is known to call: ;; car, cdr, car-safe, cdr-safe, nth, nthcdr, null, eq, equal, eql, =, ;; vectorp, length. @@ -32,6 +34,8 @@ ;;; as a pattern? Currently `cond*-non-exit-clause-substance' explicitly ;;; prevents that by adding t at the front of its value. +;;; Code: + (defmacro cond* (&rest clauses) "Extended form of traditional Lisp `cond' construct. A `cond*' construct is a series of clauses, and a clause @@ -80,51 +84,51 @@ REGEXP matches a string if REGEXP matches it. The match must cover the entire string from its first char to its last. ATOM (meaning any other kind of non-list not described above) matches anything `equal' to it. -(rx REGEXP) uses a regexp specified in s-expression form, +\(rx REGEXP) uses a regexp specified in s-expression form, as in the function `rx', and matches the data that way. -(rx REGEXP SYM0 SYM1...) uses a regexp specified in s-expression form, +\(rx REGEXP SYM0 SYM1...) uses a regexp specified in s-expression form, and binds the symbols SYM0, SYM1, and so on to (match-string 0 DATUM), (match-string 1 DATUM), and so on. You can use as many SYMs as regexp matching supports. `OBJECT matches any value `equal' to OBJECT. -(cons CARPAT CDRPAT) +\(cons CARPAT CDRPAT) matches a cons cell if CARPAT matches its car and CDRPAT matches its cdr. -(list ELTPATS...) +\(list ELTPATS...) matches a list if the ELTPATS match its elements. The first ELTPAT should match the list's first element. The second ELTPAT should match the list's second element. And so on. -(vector ELTPATS...) +\(vector ELTPATS...) matches a vector if the ELTPATS match its elements. The first ELTPAT should match the vector's first element. The second ELTPAT should match the vector's second element. And so on. -(cdr PATTERN) matches PATTERN with strict checking of cdrs. +\(cdr PATTERN) matches PATTERN with strict checking of cdrs. That means that `list' patterns verify that the final cdr is nil. Strict checking is the default. -(cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. +\(cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. That means that `list' patterns do not examine the final cdr. -(and CONJUNCTS...) matches each of the CONJUNCTS against the same data. +\(and CONJUNCTS...) matches each of the CONJUNCTS against the same data. If all of them match, this pattern succeeds. If one CONJUNCT fails, this pattern fails and does not try more CONJUNCTS. -(or DISJUNCTS...) matches each of the DISJUNCTS against the same data. +\(or DISJUNCTS...) matches each of the DISJUNCTS against the same data. If one DISJUNCT succeeds, this pattern succeeds and does not try more DISJUNCTs. If all of them fail, this pattern fails. -(COND*-EXPANDER ...) +\(COND*-EXPANDER ...) Here the car is a symbol that has a `cond*-expander' property which defines how to handle it in a pattern. The property value is a function. Trying to match such a pattern calls that function with one argument, the pattern in question (including its car). The function should return an equivalent pattern to be matched instead. -(PREDICATE SYMBOL) +\(PREDICATE SYMBOL) matches datum if (PREDICATE DATUM) is true, then binds SYMBOL to DATUM. -(PREDICATE SYMBOL MORE-ARGS...) +\(PREDICATE SYMBOL MORE-ARGS...) matches datum if (PREDICATE DATUM MORE-ARGS...) is true, then binds SYMBOL to DATUM. MORE-ARGS... can refer to symbols bound earlier in the pattern. -(constrain SYMBOL EXP) +\(constrain SYMBOL EXP) matches datum if the form EXP is true. EXP can refer to symbols bound earlier in the pattern." (ignore datum) @@ -212,7 +216,7 @@ This is used for conditional exit clauses." (let* ((bindings (cdr condition)) (first-binding (car bindings)) (first-variable (if (symbolp first-binding) first-binding - (car first-binding))) + (car first-binding))) (first-value (if (symbolp first-binding) nil (cadr first-binding))) (init-gensym (gensym "init")) @@ -584,7 +588,7 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (setq expression (cdr result)) ;; Were any bindings made by this arm of the disjunction? (when (not (eq bindings bindings-before-or)) - ;; Ok, arrange to clear their backtrack aliases + ;; OK, arrange to clear their backtrack aliases ;; if this arm does not match. (setq bindings-to-clear bindings) (let (clearing) @@ -708,3 +712,7 @@ That is safe for the purpose this is used for." (cons (car args) (cond*-un-backquote-list* (cdr args))) (mapcar (lambda (x) (list 'quote x)) (cadr (car args))))) + +(provide 'cond-star) + +;;; cond-star.el ends here commit 84261bd2b702605da58c6e12660ffd076a898766 Author: Eli Zaretskii Date: Mon Sep 30 18:45:25 2024 +0300 ; * nt/inc/ms-w32.h: Fix comments (bug#73444). diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 4d721244afe..d2217ced9a7 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -256,7 +256,7 @@ extern void w32_reset_stack_overflow_guard (void); #define fopen sys_fopen #define link sys_link #define localtime sys_localtime -/* we override read after including io.h, see #73444 */ +/* We redirect 'read' below, after including io.h, see bug#73444. */ #define rename sys_rename #define rmdir sys_rmdir #define select sys_select @@ -379,7 +379,7 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #define fileno _fileno #endif -/* Here we override CRT read with our own, see #73444 */ +/* Here we redirect CRT's 'read' to our own implementation, see bug#73444. */ #undef read #define read sys_read int sys_read (int, char *, unsigned int); commit e376a27cf27d453f3b1c2728626950d4c4478f48 Author: oscar Date: Mon Sep 23 23:04:36 2024 +0200 Fix redirection of read when _FORTIFY_SOURCE is defined When _FORTIFY_SOURCE is defined mingw-w64 provides an inline definition of read in io.h. This makes our previous redirection to sys_read ineffective. The prototype of sys_read is now required because we don't touch the prototype of read. * nt/inc/ms-w32.h (read): Move the redirection after io.h. Add prototype for sys_read (Bug#73444) diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 7212e4d2984..4d721244afe 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -256,8 +256,7 @@ extern void w32_reset_stack_overflow_guard (void); #define fopen sys_fopen #define link sys_link #define localtime sys_localtime -#undef read -#define read sys_read +/* we override read after including io.h, see #73444 */ #define rename sys_rename #define rmdir sys_rmdir #define select sys_select @@ -380,6 +379,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #define fileno _fileno #endif +/* Here we override CRT read with our own, see #73444 */ +#undef read +#define read sys_read +int sys_read (int, char *, unsigned int); + /* Defines that we need that aren't in the standard signal.h. */ #define SIGHUP 1 /* Hang up */ #define SIGQUIT 3 /* Quit process */