commit 0c410206aa91b9bc9a0922d63ec34de765eb86a6 (HEAD, refs/remotes/origin/master) Merge: e154ba196a 582ea6a1e9 Author: Stefan Kangas Date: Mon Aug 22 06:30:29 2022 +0200 Merge from origin/emacs-28 582ea6a1e9 Update to Org 9.5.4-19-g4dff42 7a3ae3cb62 ; * lisp/find-file.el (ff-other-file-alist): Fix typo. c3087b59f0 ; * lisp/find-file.el (ff-other-file-alist): Another doc f... 1e1263b00b * lisp/find-file.el (ff-other-file-alist): Doc fix. (Bug#... commit e154ba196a38c1398d506f9c1c8ba58966d9aa3e Author: Po Lu Date: Mon Aug 22 09:50:45 2022 +0800 Fix child frame focus for MPX environments * src/xterm.c (handle_one_xevent): Set child frame click-to focus on the pointer device's attachment. diff --git a/src/xterm.c b/src/xterm.c index 200ef1d11f..103573d1fd 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -20270,7 +20270,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { block_input (); XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), - RevertToParent, CurrentTime); + RevertToParent, event->xbutton.time); if (FRAME_PARENT_FRAME (f)) XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); unblock_input (); @@ -21852,8 +21852,26 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) { block_input (); +#if defined HAVE_GTK3 || (!defined USE_GTK && !defined USE_X_TOOLKIT) + if (device) + { + /* This can generate XI_BadDevice if the + device's attachment was destroyed + server-side. */ + x_ignore_errors_for_next_request (dpyinfo); + XISetFocus (dpyinfo->display, device->attachment, + /* Note that the input extension + only supports RevertToParent-type + behavior. */ + FRAME_OUTER_WINDOW (f), xev->time); + x_stop_ignoring_errors (dpyinfo); + } +#else + /* Non-no toolkit builds without GTK 3 use core + events to handle focus. */ XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), - RevertToParent, CurrentTime); + RevertToParent, xev->time); +#endif if (FRAME_PARENT_FRAME (f)) XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); unblock_input (); commit 15d628f1960ba71912cc9c3e8deaded77b953ccb Author: Gonzalo Larumbe Date: Mon Aug 22 01:29:08 2022 +0200 Fix more lexical-binding fallout in vhdl-speedbar-insert-hierarchy * lisp/progmodes/vhdl-mode.el (vhdl-speedbar-insert-hierarchy): Check the input arguments, not the dynamically bound `end-arglist' (bug#57327). diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 39c5eb453b..18219db740 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -14958,8 +14958,8 @@ otherwise use cached data." (defun vhdl-speedbar-insert-hierarchy ( ent-alist-arg conf-alist-arg package-alist ent-inst-list depth) - "Insert hierarchy of ENT-ALIST, CONF-ALIST, and PACKAGE-ALIST." - (if (not (or ent-alist conf-alist package-alist)) + "Insert hierarchy of ENT-ALIST-ARG, CONF-ALIST-ARG, and PACKAGE-ALIST." + (if (not (or ent-alist-arg conf-alist-arg package-alist)) (vhdl-speedbar-make-title-line "No VHDL design units!" depth) (let ((ent-alist ent-alist-arg) (conf-alist conf-alist-arg) commit 643990336f4b5d7db13757d59479f445e59d6b3a Author: Lars Ingebrigtsen Date: Mon Aug 22 00:37:29 2022 +0200 Make *Help* display info about generalized variables * lisp/help-fns.el (help-fns--generalized-variable): New function to document generalized variables. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 74e18285e6..e06f2dec5c 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1155,6 +1155,15 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode) (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro 100) +(defun help-fns--generalized-variable (function) + (when (get function 'gv-expander) + (insert (format-message " `%s' is also a " function) + (buttonize "generalized variable" + (lambda (_) (info "(elisp)Generalized Variables"))) + ".\n"))) +(add-hook 'help-fns-describe-function-functions + #'help-fns--generalized-variable) + ;; Variables commit ae5fe348fb481c88bb2447197098ed9a47f128d6 Author: Lars Ingebrigtsen Date: Mon Aug 22 00:14:07 2022 +0200 Revert "Make the generalized buffer-local-variable obsolete" This reverts commit bfe222288e02472bff0e1ab5ba7ef26af6a2769a. This led to the local modes not working. diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 2a53535405..e5adb0dda7 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -666,13 +666,12 @@ To toggle the mode in a single buffer, use `electric-pair-local-mode'." ;;;###autoload (define-minor-mode electric-pair-local-mode "Toggle `electric-pair-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-pair-mode (current-buffer)) (cond ((eq electric-pair-mode (default-value 'electric-pair-mode)) (kill-local-variable 'electric-pair-mode)) ((not (default-value 'electric-pair-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-pair-mode) (electric-pair-mode 1) ; Setup the hooks. (setq-default electric-pair-mode nil) ; But keep it globally disabled. ))) diff --git a/lisp/electric.el b/lisp/electric.el index ae9b5ee162..f2ff837333 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -340,13 +340,12 @@ use `electric-indent-local-mode'." ;;;###autoload (define-minor-mode electric-indent-local-mode "Toggle `electric-indent-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-indent-mode (current-buffer)) (cond ((eq electric-indent-mode (default-value 'electric-indent-mode)) (kill-local-variable 'electric-indent-mode)) ((not (default-value 'electric-indent-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-indent-mode 1) ; Setup the hooks. (setq-default electric-indent-mode nil) ; But keep it globally disabled. ))) @@ -485,13 +484,12 @@ The variable `electric-layout-rules' says when and how to insert newlines." ;;;###autoload (define-minor-mode electric-layout-local-mode "Toggle `electric-layout-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-layout-mode (current-buffer)) (cond ((eq electric-layout-mode (default-value 'electric-layout-mode)) (kill-local-variable 'electric-layout-mode)) ((not (default-value 'electric-layout-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-layout-mode 1) ; Setup the hooks. (setq-default electric-layout-mode nil) ; But keep it globally disabled. ))) @@ -663,13 +661,12 @@ use `electric-quote-local-mode'." ;;;###autoload (define-minor-mode electric-quote-local-mode "Toggle `electric-quote-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'electric-quote-mode (current-buffer)) (cond ((eq electric-quote-mode (default-value 'electric-quote-mode)) (kill-local-variable 'electric-quote-mode)) ((not (default-value 'electric-quote-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'electric-indent-mode) (electric-quote-mode 1) ; Setup the hooks. (setq-default electric-quote-mode nil) ; But keep it globally disabled. ))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ebc9aa75e5..5dde2d2bfb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1355,7 +1355,6 @@ FORMAT and ARGS are as in `byte-compile-warn'." (let ((byte-compile-form-stack (cons arg byte-compile-form-stack))) (apply #'byte-compile-warn format args))) -;;;###autoload (defun byte-compile-warn-obsolete (symbol type) "Warn that SYMBOL (a variable, function or generalized variable) is obsolete. TYPE is a string that say which one of these three types it is." diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index db902d9db8..0c374ec5e3 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -141,18 +141,6 @@ all the parts of PLACE that can be evaluated and then runs E. (declare (indent 2) (debug (sexp form def-body))) `(gv-get ,place (lambda ,vars ,@body))) -(defun make-obsolete-generalized-variable (obsolete-name current-name when) - "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. -The warning will say that CURRENT-NAME should be used instead. - -If CURRENT-NAME is a string, that is the `use instead' message. - -WHEN should be a string indicating when the variable was first -made obsolete, for example a date or a release number." - (put obsolete-name 'byte-obsolete-generalized-variable - (purecopy (list current-name when))) - obsolete-name) - ;; Different ways to declare a generalized variable. ;;;###autoload (defmacro gv-define-expander (name handler) @@ -407,7 +395,6 @@ The return value is the last VAL in the list. (gv-define-setter buffer-local-value (val var buf) (macroexp-let2 nil v val `(with-current-buffer ,buf (set (make-local-variable ,var) ,v)))) -(make-obsolete-generalized-variable 'buffer-local-value nil "29.1") (gv-define-expander alist-get (lambda (do key alist &optional default remove testfn) @@ -632,6 +619,18 @@ REF must have been previously obtained with `gv-ref'." ;;; Generalized variables. +(defun make-obsolete-generalized-variable (obsolete-name current-name when) + "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. + +If CURRENT-NAME is a string, that is the `use instead' message. + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number." + (put obsolete-name 'byte-obsolete-generalized-variable + (purecopy (list current-name when))) + obsolete-name) + ;; Some Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) (make-obsolete-generalized-variable diff --git a/lisp/paren.el b/lisp/paren.el index 5a73e3fce6..4c268dbf77 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -149,7 +149,7 @@ use `show-paren-local-mode'." ;;;###autoload (define-minor-mode show-paren-local-mode "Toggle `show-paren-mode' only in this buffer." - :lighter nil + :variable (buffer-local-value 'show-paren-mode (current-buffer)) (cond ((eq show-paren-mode (default-value 'show-paren-mode)) (unless show-paren-mode @@ -157,7 +157,6 @@ use `show-paren-local-mode'." (kill-local-variable 'show-paren-mode)) ((not (default-value 'show-paren-mode)) ;; Locally enabled, but globally disabled. - (make-local-variable 'show-paren-mode) (show-paren-mode 1) ; Setup the timer. (setq-default show-paren-mode nil) ; But keep it globally disabled. ) commit 29a989c02089162dd30132ab80e6eb4afb224446 Author: Lars Ingebrigtsen Date: Sun Aug 21 23:38:20 2022 +0200 Regenerated ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 855f5a25b1..07dfc23a09 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -2714,6 +2714,11 @@ Normally you should let-bind `byte-compile-warnings' before calling this, else the global value will be modified. (fn WARNING)") +(autoload 'byte-compile-warn-obsolete "bytecomp" "\ +Warn that SYMBOL (a variable, function or generalized variable) is obsolete. +TYPE is a string that say which one of these three types it is. + +(fn SYMBOL TYPE)") (autoload 'byte-force-recompile "bytecomp" "\ Recompile every `.el' file in DIRECTORY that already has a `.elc' file. Files in subdirectories of DIRECTORY are processed also. @@ -5150,13 +5155,9 @@ PersistMoniker=file://Folder.htt (fn)" t) (autoload 'conf-javaprop-mode "conf-mode" "\ Conf Mode starter for Java properties files. -Comments start with `#' but are also recognized with `//' or -between `/*' and `*/'. -For details see `conf-mode'. Example: +Comments start with `#'. Example: # Conf mode font-locks this right with \\[conf-javaprop-mode] (Java properties) -// another kind of comment -/* yet another */ name:value name=value @@ -14553,7 +14554,7 @@ simple PLACEs such as (symbol-function \\='foo) which will also work in dynamic binding mode. (fn PLACE)" nil t) -(register-definition-prefixes "gv" '("gv-")) +(register-definition-prefixes "gv" '("gv-" "make-obsolete-generalized-variable")) ;;; Generated autoloads from play/handwrite.el @@ -17086,9 +17087,8 @@ Key bindings: (autoload 'image-minor-mode "image-mode" "\ Toggle Image minor mode in this buffer. -Image minor mode provides the key \\\\[image-toggle-display], -to switch back to `image-mode' and display an image file as the -actual image. +Image minor mode provides the key \\\\[image-toggle-display], to switch back to +`image-mode' and display an image file as the actual image. This is a minor mode. If called interactively, toggle the `Image minor mode' mode. If the prefix argument is positive, enable the commit bfe222288e02472bff0e1ab5ba7ef26af6a2769a Author: Lars Ingebrigtsen Date: Sun Aug 21 23:38:09 2022 +0200 Make the generalized buffer-local-variable obsolete * lisp/paren.el (show-paren-local-mode): * lisp/electric.el (electric-indent-local-mode) (electric-layout-local-mode, electric-quote-local-mode): * lisp/elec-pair.el (electric-pair-local-mode): Don't use it. * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Autoload. * lisp/emacs-lisp/gv.el (buffer-local-variable): Make obsolete (bug#26624). * lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable): Move to allow usage. diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index e5adb0dda7..2a53535405 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -666,12 +666,13 @@ To toggle the mode in a single buffer, use `electric-pair-local-mode'." ;;;###autoload (define-minor-mode electric-pair-local-mode "Toggle `electric-pair-mode' only in this buffer." - :variable (buffer-local-value 'electric-pair-mode (current-buffer)) + :lighter nil (cond ((eq electric-pair-mode (default-value 'electric-pair-mode)) (kill-local-variable 'electric-pair-mode)) ((not (default-value 'electric-pair-mode)) ;; Locally enabled, but globally disabled. + (make-local-variable 'electric-pair-mode) (electric-pair-mode 1) ; Setup the hooks. (setq-default electric-pair-mode nil) ; But keep it globally disabled. ))) diff --git a/lisp/electric.el b/lisp/electric.el index f2ff837333..ae9b5ee162 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -340,12 +340,13 @@ use `electric-indent-local-mode'." ;;;###autoload (define-minor-mode electric-indent-local-mode "Toggle `electric-indent-mode' only in this buffer." - :variable (buffer-local-value 'electric-indent-mode (current-buffer)) + :lighter nil (cond ((eq electric-indent-mode (default-value 'electric-indent-mode)) (kill-local-variable 'electric-indent-mode)) ((not (default-value 'electric-indent-mode)) ;; Locally enabled, but globally disabled. + (make-local-variable 'electric-indent-mode) (electric-indent-mode 1) ; Setup the hooks. (setq-default electric-indent-mode nil) ; But keep it globally disabled. ))) @@ -484,12 +485,13 @@ The variable `electric-layout-rules' says when and how to insert newlines." ;;;###autoload (define-minor-mode electric-layout-local-mode "Toggle `electric-layout-mode' only in this buffer." - :variable (buffer-local-value 'electric-layout-mode (current-buffer)) + :lighter nil (cond ((eq electric-layout-mode (default-value 'electric-layout-mode)) (kill-local-variable 'electric-layout-mode)) ((not (default-value 'electric-layout-mode)) ;; Locally enabled, but globally disabled. + (make-local-variable 'electric-indent-mode) (electric-layout-mode 1) ; Setup the hooks. (setq-default electric-layout-mode nil) ; But keep it globally disabled. ))) @@ -661,12 +663,13 @@ use `electric-quote-local-mode'." ;;;###autoload (define-minor-mode electric-quote-local-mode "Toggle `electric-quote-mode' only in this buffer." - :variable (buffer-local-value 'electric-quote-mode (current-buffer)) + :lighter nil (cond ((eq electric-quote-mode (default-value 'electric-quote-mode)) (kill-local-variable 'electric-quote-mode)) ((not (default-value 'electric-quote-mode)) ;; Locally enabled, but globally disabled. + (make-local-variable 'electric-indent-mode) (electric-quote-mode 1) ; Setup the hooks. (setq-default electric-quote-mode nil) ; But keep it globally disabled. ))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5dde2d2bfb..ebc9aa75e5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1355,6 +1355,7 @@ FORMAT and ARGS are as in `byte-compile-warn'." (let ((byte-compile-form-stack (cons arg byte-compile-form-stack))) (apply #'byte-compile-warn format args))) +;;;###autoload (defun byte-compile-warn-obsolete (symbol type) "Warn that SYMBOL (a variable, function or generalized variable) is obsolete. TYPE is a string that say which one of these three types it is." diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 0c374ec5e3..db902d9db8 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -141,6 +141,18 @@ all the parts of PLACE that can be evaluated and then runs E. (declare (indent 2) (debug (sexp form def-body))) `(gv-get ,place (lambda ,vars ,@body))) +(defun make-obsolete-generalized-variable (obsolete-name current-name when) + "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. + +If CURRENT-NAME is a string, that is the `use instead' message. + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number." + (put obsolete-name 'byte-obsolete-generalized-variable + (purecopy (list current-name when))) + obsolete-name) + ;; Different ways to declare a generalized variable. ;;;###autoload (defmacro gv-define-expander (name handler) @@ -395,6 +407,7 @@ The return value is the last VAL in the list. (gv-define-setter buffer-local-value (val var buf) (macroexp-let2 nil v val `(with-current-buffer ,buf (set (make-local-variable ,var) ,v)))) +(make-obsolete-generalized-variable 'buffer-local-value nil "29.1") (gv-define-expander alist-get (lambda (do key alist &optional default remove testfn) @@ -619,18 +632,6 @@ REF must have been previously obtained with `gv-ref'." ;;; Generalized variables. -(defun make-obsolete-generalized-variable (obsolete-name current-name when) - "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. -The warning will say that CURRENT-NAME should be used instead. - -If CURRENT-NAME is a string, that is the `use instead' message. - -WHEN should be a string indicating when the variable was first -made obsolete, for example a date or a release number." - (put obsolete-name 'byte-obsolete-generalized-variable - (purecopy (list current-name when))) - obsolete-name) - ;; Some Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) (make-obsolete-generalized-variable diff --git a/lisp/paren.el b/lisp/paren.el index 4c268dbf77..5a73e3fce6 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -149,7 +149,7 @@ use `show-paren-local-mode'." ;;;###autoload (define-minor-mode show-paren-local-mode "Toggle `show-paren-mode' only in this buffer." - :variable (buffer-local-value 'show-paren-mode (current-buffer)) + :lighter nil (cond ((eq show-paren-mode (default-value 'show-paren-mode)) (unless show-paren-mode @@ -157,6 +157,7 @@ use `show-paren-local-mode'." (kill-local-variable 'show-paren-mode)) ((not (default-value 'show-paren-mode)) ;; Locally enabled, but globally disabled. + (make-local-variable 'show-paren-mode) (show-paren-mode 1) ; Setup the timer. (setq-default show-paren-mode nil) ; But keep it globally disabled. ) commit 582ea6a1e9f98c124a7b044f1db7d4c63da5646d (refs/remotes/origin/emacs-28) Author: Kyle Meyer Date: Sun Aug 21 17:25:39 2022 -0400 Update to Org 9.5.4-19-g4dff42 diff --git a/lisp/org/ob-julia.el b/lisp/org/ob-julia.el index 50a44bcf44..de69f25fc3 100644 --- a/lisp/org/ob-julia.el +++ b/lisp/org/ob-julia.el @@ -26,6 +26,9 @@ ;; Org-Babel support for evaluating julia code ;; ;; Based on ob-R.el by Eric Schulte and Dan Davison. +;; +;; Session support requires the installation of the DataFrames and CSV +;; Julia packages. ;;; Code: (require 'cl-lib) @@ -62,6 +65,7 @@ (defvar ess-current-process-name) ; dynamically scoped (defvar ess-local-process-name) ; dynamically scoped (defvar ess-eval-visibly-p) ; dynamically scoped +(defvar ess-local-customize-alist); dynamically scoped (defun org-babel-edit-prep:julia (info) (let ((session (cdr (assq :session (nth 2 info))))) (when (and session @@ -281,7 +285,8 @@ last statement in BODY, as elisp." (value (with-temp-buffer (insert (org-babel-chomp body)) - (let ((ess-local-process-name + (let ((ess-local-customize-alist t) + (ess-local-process-name (process-name (get-buffer-process session))) (ess-eval-visibly-p nil)) (ess-eval-buffer nil))) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 915c3f63c7..353d533c06 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.5.4-17-g6e991f")) + (let ((org-git-version "release_9.5.4-19-g4dff42")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/ox-icalendar.el b/lisp/org/ox-icalendar.el index 7e40f5bcd0..148e111fd4 100644 --- a/lisp/org/ox-icalendar.el +++ b/lisp/org/ox-icalendar.el @@ -276,14 +276,14 @@ re-read the iCalendar file.") ;;; Define Back-End (org-export-define-derived-backend 'icalendar 'ascii - :translate-alist '((clock . ignore) - (footnote-definition . ignore) - (footnote-reference . ignore) + :translate-alist '((clock . nil) + (footnote-definition . nil) + (footnote-reference . nil) (headline . org-icalendar-entry) (inner-template . org-icalendar-inner-template) - (inlinetask . ignore) - (planning . ignore) - (section . ignore) + (inlinetask . nil) + (planning . nil) + (section . nil) (template . org-icalendar-template)) :options-alist '((:exclude-tags commit 7a3ae3cb626e02ff25757eed2ef2977ed577a9be Author: Stefan Kangas Date: Sun Aug 21 22:31:05 2022 +0200 ; * lisp/find-file.el (ff-other-file-alist): Fix typo. diff --git a/lisp/find-file.el b/lisp/find-file.el index 999cdd164e..614ff420f2 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el @@ -192,7 +192,7 @@ filename that EXTRACT returned." The value could be an alist or a symbol whose value is an alist. Each element of the alist has the form - (REGEXP (ETXENSION...)) + (REGEXP (EXTENSION...)) or (REGEXP FUNCTION) commit efd95300c7ce5fcd565bb891b8559c1430873072 Author: Lars Ingebrigtsen Date: Sun Aug 21 22:18:49 2022 +0200 Adjust autorevert tests to recent change * test/lisp/autorevert-tests.el (auto-revert--wait-for-revert): Adjust test to code change. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 54b1a16b5d..4bbff6d057 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -105,7 +105,7 @@ This expects `auto-revert--messages' to be bound by (auto-revert--timeout)) (null (string-match (format-message - "Reverting buffer `%s'\\." (buffer-name buffer)) + "Reverting buffer `%s'" (buffer-name buffer)) (or auto-revert--messages "")))) (if (and (or file-notify--library (file-remote-p temporary-file-directory)) commit 48aacbf292fbe8d4be7761f83bf87de93497df27 Author: Lars Ingebrigtsen Date: Sun Aug 21 22:12:43 2022 +0200 Make many seldom-used generalized variables obsolete The vast majority of these are unused in-tree, and many of them perform actions that aren't obvious when reading the code. * lisp/server.el (server-ensure-safe-dir): Prefer with-file-modes over letf-ing default-file-modes. (server-start): Ditto. * lisp/winner.el (winner-set-conf): Don't use generalized variable window-height. * lisp/emacs-lisp/gv.el: Make most little-used generalized variables obsolete. * lisp/org/oc-basic.el (org-cite-basic--set-keymap): Adjust buffer-substring generalized variable usage. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 4618a34926..0c374ec5e3 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -633,24 +633,54 @@ made obsolete, for example a date or a release number." ;; Some Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) +(make-obsolete-generalized-variable + 'buffer-file-name 'set-visited-file-name "29.1") + (gv-define-setter buffer-modified-p (flag &optional buf) (macroexp-let2 nil buffer `(or ,buf (current-buffer)) `(with-current-buffer ,buffer (set-buffer-modified-p ,flag)))) +(make-obsolete-generalized-variable + 'buffer-modified-p 'set-buffer-modified-p "29.1") + (gv-define-simple-setter buffer-name rename-buffer t) +(make-obsolete-generalized-variable 'buffer-name 'rename-buffer "29.1") + (gv-define-setter buffer-string (store) `(insert (prog1 ,store (erase-buffer)))) +(make-obsolete-generalized-variable 'buffer-string nil "29.1") + (gv-define-simple-setter buffer-substring cl--set-buffer-substring) +(make-obsolete-generalized-variable 'buffer-substring nil "29.1") + (gv-define-simple-setter current-buffer set-buffer) +(make-obsolete-generalized-variable 'current-buffer 'set-buffer "29.1") + (gv-define-simple-setter current-column move-to-column t) +(make-obsolete-generalized-variable 'current-column 'move-to-column "29.1") + (gv-define-simple-setter current-global-map use-global-map t) +(make-obsolete-generalized-variable 'current-global-map 'use-global-map "29.1") + (gv-define-setter current-input-mode (store) `(progn (apply #'set-input-mode ,store) ,store)) +(make-obsolete-generalized-variable 'current-input-mode nil "29.1") + (gv-define-simple-setter current-local-map use-local-map t) +(make-obsolete-generalized-variable 'current-local-map 'use-local-map "29.1") + (gv-define-simple-setter current-window-configuration set-window-configuration t) +(make-obsolete-generalized-variable + 'current-window-configuration 'set-window-configuration "29.1") + (gv-define-simple-setter default-file-modes set-default-file-modes t) +(make-obsolete-generalized-variable + 'default-file-modes 'set-default-file-modes "29.1") + (gv-define-simple-setter documentation-property put) +(make-obsolete-generalized-variable 'documentation-property 'put "29.1") + (gv-define-setter face-background (x f &optional s) `(set-face-background ,f ,x ,s)) (gv-define-setter face-background-pixmap (x f &optional s) @@ -661,43 +691,96 @@ made obsolete, for example a date or a release number." (gv-define-setter face-underline-p (x f &optional s) `(set-face-underline ,f ,x ,s)) (gv-define-simple-setter file-modes set-file-modes t) + (gv-define-setter frame-height (x &optional frame) `(set-frame-height (or ,frame (selected-frame)) ,x)) +(make-obsolete-generalized-variable 'frame-height 'set-frame-height "29.1") + (gv-define-simple-setter frame-parameters modify-frame-parameters t) (gv-define-simple-setter frame-visible-p cl--set-frame-visible-p) +(make-obsolete-generalized-variable 'frame-visible-p nil "29.1") + (gv-define-setter frame-width (x &optional frame) `(set-frame-width (or ,frame (selected-frame)) ,x)) (gv-define-simple-setter getenv setenv t) (gv-define-simple-setter get-register set-register) + (gv-define-simple-setter global-key-binding global-set-key) +(make-obsolete-generalized-variable 'global-key-binding 'global-set-key "29.1") + (gv-define-simple-setter local-key-binding local-set-key) +(make-obsolete-generalized-variable 'local-key-binding 'local-set-key "29.1") + (gv-define-simple-setter mark set-mark t) +(make-obsolete-generalized-variable 'mark 'set-mark "29.1") + (gv-define-simple-setter mark-marker set-mark t) +(make-obsolete-generalized-variable 'mark-marker 'set-mark "29.1") + (gv-define-simple-setter marker-position set-marker t) +(make-obsolete-generalized-variable 'marker-position 'set-marker "29.1") + (gv-define-setter mouse-position (store scr) `(set-mouse-position ,scr (car ,store) (cadr ,store) (cddr ,store))) +(make-obsolete-generalized-variable 'mouse-position 'set-mouse-position "29.1") + (gv-define-simple-setter point goto-char) +(make-obsolete-generalized-variable 'point 'goto-char "29.1") + (gv-define-simple-setter point-marker goto-char t) +(make-obsolete-generalized-variable 'point-marker 'goto-char "29.1") + (gv-define-setter point-max (store) `(progn (narrow-to-region (point-min) ,store) ,store)) +(make-obsolete-generalized-variable 'point-max 'narrow-to-region "29.1") + (gv-define-setter point-min (store) `(progn (narrow-to-region ,store (point-max)) ,store)) +(make-obsolete-generalized-variable 'point-min 'narrow-to-region "29.1") + (gv-define-setter read-mouse-position (store scr) `(set-mouse-position ,scr (car ,store) (cdr ,store))) +(make-obsolete-generalized-variable + 'read-mouse-position 'set-mouse-position "29.1") + (gv-define-simple-setter screen-height set-screen-height t) +(make-obsolete-generalized-variable 'screen-height 'set-screen-height "29.1") + (gv-define-simple-setter screen-width set-screen-width t) +(make-obsolete-generalized-variable 'screen-width 'set-screen-width "29.1") + (gv-define-simple-setter selected-window select-window) +(make-obsolete-generalized-variable 'selected-window 'select-window "29.1") + (gv-define-simple-setter selected-screen select-screen) +(make-obsolete-generalized-variable 'selected-screen 'select-screen "29.1") + (gv-define-simple-setter selected-frame select-frame) +(make-obsolete-generalized-variable 'selected-frame 'select-frame "29.1") + (gv-define-simple-setter standard-case-table set-standard-case-table) +(make-obsolete-generalized-variable 'standard-case-table 'set-standard-case-table "29.1") + (gv-define-simple-setter syntax-table set-syntax-table) +(make-obsolete-generalized-variable 'syntax-table 'set-syntax-table "29.1") + (gv-define-simple-setter visited-file-modtime set-visited-file-modtime t) +(make-obsolete-generalized-variable + 'visited-file-modtime 'set-visited-file-modtime "29.1") + (gv-define-setter window-height (store) `(progn (enlarge-window (- ,store (window-height))) ,store)) +(make-obsolete-generalized-variable 'window-height 'enlarge-window "29.1") + (gv-define-setter window-width (store) `(progn (enlarge-window (- ,store (window-width)) t) ,store)) +(make-obsolete-generalized-variable 'window-width 'enlarge-window "29.1") + (gv-define-simple-setter x-get-secondary-selection x-own-secondary-selection t) +(make-obsolete-generalized-variable + 'x-get-secondary-selection 'x-own-secondary-selection "29.1") + ;; More complex setf-methods. diff --git a/lisp/org/oc-basic.el b/lisp/org/oc-basic.el index 8c76e200e4..398d2e2d3f 100644 --- a/lisp/org/oc-basic.el +++ b/lisp/org/oc-basic.el @@ -460,12 +460,13 @@ substitutes for the unknown key. Finally, it may be the symbol (_ (lambda () (interactive) - (setf (buffer-substring beg end) - (concat "@" - (if (= 1 (length suggestions)) - (car suggestions) - (completing-read "Did you mean: " - suggestions nil t)))))))) + (goto-char beg) + (delete-region beg end) + (insert "@" + (if (= 1 (length suggestions)) + (car suggestions) + (completing-read "Did you mean: " + suggestions nil t))))))) (put-text-property beg end 'keymap km))) (defun org-cite-basic-activate (citation) diff --git a/lisp/server.el b/lisp/server.el index a06f2f952f..dd7bccaf33 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -544,7 +544,8 @@ Creates the directory if necessary and makes sure: (setq dir (directory-file-name dir)) (let ((attrs (file-attributes dir 'integer))) (unless attrs - (cl-letf (((default-file-modes) ?\700)) (make-directory dir t)) + (with-file-modes ?\700 + (make-directory dir t)) (setq attrs (file-attributes dir 'integer))) ;; Check that it's safe for use. @@ -691,7 +692,7 @@ server or call `\\[server-force-delete]' to forcibly disconnect it.")) (server-ensure-safe-dir server-dir) (when server-process (server-log (message "Restarting server"))) - (cl-letf (((default-file-modes) ?\700)) + (with-file-modes ?\700 (add-hook 'suspend-tty-functions #'server-handle-suspend-tty) (add-hook 'delete-frame-functions #'server-handle-delete-frame) (add-hook 'kill-emacs-query-functions diff --git a/lisp/winner.el b/lisp/winner.el index 38ab5f5101..89f337170c 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -217,8 +217,7 @@ You may want to include buffer names such as *Help*, *Apropos*, ((window-minibuffer-p) (other-window 1))) (when (/= minisize (window-height miniwin)) (with-selected-window miniwin - (setf (window-height) minisize))))) - + (enlarge-window (- minisize (window-height))))))) (defvar winner-point-alist nil) commit 6ddcf67052545a0f77233f1a952dc90e296cda35 Author: Lars Ingebrigtsen Date: Sun Aug 21 21:46:14 2022 +0200 Make it possible to mark generalized variables as obsolete * doc/lispref/variables.texi (Adding Generalized Variables): Document it. * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Alter the interface so that it can also be used by generalized variable warnings. (byte-compile-function-warn): Adjust caller. (byte-compile-check-variable): Adjust caller. * lisp/emacs-lisp/gv.el (gv-get): Warn about obsolete generalized variables (bug#49730). (make-obsolete-generalized-variable): New function. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 242b1a3be9..ed119a709c 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2822,6 +2822,16 @@ expression manipulating @var{place} via @var{getter} and @var{setter}. Consult the source file @file{gv.el} for more details. +@defun make-obsolete-generalized-variable obsolete-name current-name when +This function makes the byte compiler warn that the generalized +variable @var{obsolete-name} is obsolete. If @var{current-name} is a +symbol, then the warning message says to use @var{current-name} +instead of @var{obsolete-name}. If @var{current-name} is a string, +this is the message. @var{when} should be a string indicating when +the variable was first made obsolete (usually a version number +string). +@end defun + @cindex CL note---no @code{setf} functions @quotation @b{Common Lisp note:} Common Lisp defines another way to specify the diff --git a/etc/NEWS b/etc/NEWS index c41b7ac6e8..2f68472163 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2588,6 +2588,11 @@ patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el. * Lisp Changes in Emacs 29.1 ++++ +** New function 'make-obsolete-generalized-variable'. +This can be used to mark setters used by 'setf' as obsolete, and the +byte-compiler will then warn about using them. + +++ ** New functions 'pos-eol' and 'pos-bol'. These are like 'line-end-position' and 'line-beginning-position' diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 4a2860cd43..9a56ba0f7a 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -568,7 +568,6 @@ ACCESS-TYPE if non-nil should specify the kind of access that will trigger (purecopy (list current-name access-type when))) obsolete-name) - (defmacro define-obsolete-variable-alias ( obsolete-name current-name when &optional docstring) "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 1115ce391d..5dde2d2bfb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1355,16 +1355,22 @@ FORMAT and ARGS are as in `byte-compile-warn'." (let ((byte-compile-form-stack (cons arg byte-compile-form-stack))) (apply #'byte-compile-warn format args))) -(defun byte-compile-warn-obsolete (symbol) - "Warn that SYMBOL (a variable or function) is obsolete." +(defun byte-compile-warn-obsolete (symbol type) + "Warn that SYMBOL (a variable, function or generalized variable) is obsolete. +TYPE is a string that say which one of these three types it is." (when (byte-compile-warning-enabled-p 'obsolete symbol) - (let* ((funcp (get symbol 'byte-obsolete-info)) - (msg (macroexp--obsolete-warning - symbol - (or funcp (get symbol 'byte-obsolete-variable)) - (if funcp "function" "variable")))) - (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs)) - (byte-compile-warn-x symbol "%s" msg))))) + (byte-compile-warn-x + symbol "%s" + (macroexp--obsolete-warning + symbol + (pcase type + ("function" + (get symbol 'byte-obsolete-info)) + ("variable" + (get symbol 'byte-obsolete-variable)) + ("generalized variable" + (get symbol 'byte-obsolete-generalized-variable))) + type)))) (defun byte-compile-report-error (error-info &optional fill) "Report Lisp error in compilation. @@ -1468,8 +1474,8 @@ when printing the error message." (defun byte-compile-function-warn (f nargs def) (when (and (get f 'byte-obsolete-info) - (byte-compile-warning-enabled-p 'obsolete f)) - (byte-compile-warn-obsolete f)) + (not (memq f byte-compile-not-obsolete-funcs))) + (byte-compile-warn-obsolete f "function")) ;; Check to see if the function will be available at runtime ;; and/or remember its arity if it's unknown. @@ -3604,7 +3610,7 @@ lambda-expression." ('set (not (eq access-type 'reference))) ('get (eq access-type 'reference)) (_ t)))) - (byte-compile-warn-obsolete var)))) + (byte-compile-warn-obsolete var "variable")))) (defsubst byte-compile-dynamic-variable-op (base-op var) (let ((tmp (assq var byte-compile-variables))) diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 54ddc7ac75..4618a34926 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -92,6 +92,9 @@ DO must return an Elisp expression." (t (let* ((head (car place)) (gf (function-get head 'gv-expander 'autoload))) + (when (and (symbolp head) + (get head 'byte-obsolete-generalized-variable)) + (byte-compile-warn-obsolete head "generalized variable")) (if gf (apply gf do (cdr place)) (let ((me (macroexpand-1 place ;; (append macroexpand-all-environment @@ -616,6 +619,18 @@ REF must have been previously obtained with `gv-ref'." ;;; Generalized variables. +(defun make-obsolete-generalized-variable (obsolete-name current-name when) + "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. + +If CURRENT-NAME is a string, that is the `use instead' message. + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number." + (put obsolete-name 'byte-obsolete-generalized-variable + (purecopy (list current-name when))) + obsolete-name) + ;; Some Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) (gv-define-setter buffer-modified-p (flag &optional buf) commit c3087b59f062b8d48b554b5dc3ac67f511058070 Author: Eli Zaretskii Date: Sun Aug 21 22:06:34 2022 +0300 ; * lisp/find-file.el (ff-other-file-alist): Another doc fix. (Bug#57325) diff --git a/lisp/find-file.el b/lisp/find-file.el index e137397d24..999cdd164e 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el @@ -192,12 +192,16 @@ filename that EXTRACT returned." The value could be an alist or a symbol whose value is an alist. Each element of the alist has the form - (REGEXP (ETXENSION...)) + (REGEXP (ETXENSION...)) +or + (REGEXP FUNCTION) where REGEXP is the regular expression matching a file's extension, -and EXTENSIONs is the list of literal file-name extensions to search for. -This list should contain the most used extensions before the others, -since the search algorithm searches sequentially through each +EXTENSIONs is the list of literal file-name extensions to search for, +and FUNCTION is a function of one argument, the current file's name, +that returns the list of extensions to search for. +The list of extensions should contain the most used extensions before the +others, since the search algorithm searches sequentially through each directory specified in `ff-search-directories'. If a file is not found, a new one is created with the first matching extension (`.cc' yields `.hh'). This alist should be set by the major mode." commit 1e1263b00b9cb722216fde7e45c42259960ab38a Author: Eli Zaretskii Date: Sun Aug 21 21:48:58 2022 +0300 * lisp/find-file.el (ff-other-file-alist): Doc fix. (Bug#57325) diff --git a/lisp/find-file.el b/lisp/find-file.el index 809592413d..e137397d24 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el @@ -189,6 +189,13 @@ filename that EXTRACT returned." (defcustom ff-other-file-alist 'cc-other-file-alist "Alist of extensions to find given the current file's extension. +The value could be an alist or a symbol whose value is an alist. +Each element of the alist has the form + + (REGEXP (ETXENSION...)) + +where REGEXP is the regular expression matching a file's extension, +and EXTENSIONs is the list of literal file-name extensions to search for. This list should contain the most used extensions before the others, since the search algorithm searches sequentially through each directory specified in `ff-search-directories'. If a file is not found, commit 958924a8126cf532d44c4b446d13ed744438cc9b Author: Lars Ingebrigtsen Date: Sun Aug 21 18:17:56 2022 +0200 Mention delete-line in shortdoc * lisp/emacs-lisp/shortdoc.el (buffer): Mention delete-line. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 43fefc8ed0..8a8ab9bf54 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -999,6 +999,8 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), :no-value (delete-region (point-min) (point-max))) (erase-buffer :no-value (erase-buffer)) + (delete-line + :no-value (delete-line)) (insert :no-value (insert "This string will be inserted in the buffer\n")) (subst-char-in-region commit 102258fe1c0bdd2a4c1d9e7ea6c0209f9d62f735 Author: Lars Ingebrigtsen Date: Sun Aug 21 18:13:00 2022 +0200 Simplify `delete-line' * lisp/subr.el (delete-line): Simplify. diff --git a/lisp/subr.el b/lisp/subr.el index cd6a9be099..3fde0551cc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6904,10 +6904,7 @@ OBJECT if it is readable." (defun delete-line () "Delete the current line." - (delete-region (line-beginning-position) - (progn - (forward-line 1) - (point)))) + (delete-region (pos-bol) (pos-bol 2))) (defun ensure-empty-lines (&optional lines) "Ensure that there are LINES number of empty lines before point. commit 52b240b29b7bfc9819f52e8312ce95c9aaa2a78e Author: Stefan Kangas Date: Sun Aug 21 18:00:53 2022 +0200 Prefer pos-bol and pos-eol in bookmark.el * lisp/bookmark.el (bookmark--set-fringe-mark) (bookmark--remove-fringe-mark, bookmark-kill-line) (bookmark--jump-via): Prefer pos-bol and pos-eol. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index b3b3660902..8dfc16bf9f 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -495,7 +495,7 @@ In other words, return all information but the name." (defun bookmark--set-fringe-mark () "Apply a colorized overlay to the bookmarked location. See user option `bookmark-fringe-mark'." - (let ((bm (make-overlay (point-at-bol) (1+ (point-at-bol))))) + (let ((bm (make-overlay (pos-bol) (1+ (pos-bol))))) (overlay-put bm 'category 'bookmark) (overlay-put bm 'evaporate t) (overlay-put bm 'before-string @@ -518,7 +518,7 @@ See user option `bookmark-fringe-mark'." (setq overlays (save-excursion (goto-char pos) - (overlays-in (point-at-bol) (1+ (point-at-bol))))) + (overlays-in (pos-bol) (1+ (pos-bol))))) (while (and (not found) (setq temp (pop overlays))) (when (eq 'bookmark (overlay-get temp 'category)) (delete-overlay (setq found temp)))))))))) @@ -1014,7 +1014,7 @@ the list of bookmarks.)" "Kill from point to end of line. If optional arg NEWLINE-TOO is non-nil, delete the newline too. Does not affect the kill ring." - (let ((eol (line-end-position))) + (let ((eol (pos-eol))) (delete-region (point) eol) (when (and newline-too (= (following-char) ?\n)) (delete-char 1)))) @@ -1221,7 +1221,7 @@ and then show any annotations for this bookmark." ;; FIXME: we used to only run bookmark-after-jump-hook in ;; `bookmark-jump' itself, but in none of the other commands. (when bookmark-fringe-mark - (let ((overlays (overlays-in (point-at-bol) (1+ (point-at-bol)))) + (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) temp found) (while (and (not found) (setq temp (pop overlays))) (when (eq 'bookmark (overlay-get temp 'category)) commit fe194f179d74de54128a3fdc294175e361146caf Author: Lars Ingebrigtsen Date: Sun Aug 21 18:01:22 2022 +0200 Remove a newline from the end of an error message * src/pdumper.c (dump_native_comp_unit): Remove newline from end of error message. diff --git a/src/pdumper.c b/src/pdumper.c index fb70df994a..11cbc7d0ae 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2911,7 +2911,7 @@ dump_native_comp_unit (struct dump_context *ctx, struct Lisp_Native_Comp_Unit *comp_u) { if (!CONSP (comp_u->file)) - error ("Trying to dump non fixed-up eln file\n"); + error ("Trying to dump non fixed-up eln file"); /* Have function documentation always lazy loaded to optimize load-time. */ comp_u->data_fdoc_v = Qnil; commit b061782fa6ea028628598f0566b7e21975f794ba Author: Mattias Engdegård Date: Sun Aug 21 17:50:42 2022 +0200 Fix eshell-pipe-broken signalling * lisp/eshell/esh-io.el (eshell-output-object-to-target): Second argument to `signal` should be a list. diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index 27703976f6..e5977c9580 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -501,7 +501,7 @@ Returns what was actually sent, or nil if nothing was sent." (condition-case nil (process-send-string target object) ;; If `process-send-string' raises an error, treat it as a broken pipe. - (error (signal 'eshell-pipe-broken target)))) + (error (signal 'eshell-pipe-broken (list target))))) ((consp target) (apply (car target) object (cdr target)))) commit 70fd2e03e5a194c427746d7fa2f8f82f8750eb87 Author: Stefan Kangas Date: Sun Aug 21 17:48:03 2022 +0200 Mark another esh-proc test as unstable * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/pipeline-connection-type/middle): Mark test as unstable as it fails quite a lot. diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el index 63aa5384c8..62e784e8f6 100644 --- a/test/lisp/eshell/esh-proc-tests.el +++ b/test/lisp/eshell/esh-proc-tests.el @@ -74,6 +74,8 @@ (ert-deftest esh-proc-test/pipeline-connection-type/middle () "Test that all streams are pipes when a command is in the middle of a pipeline." + ;; Repeated unreproducible errors. + :tags '(:unstable) (skip-unless (and (executable-find "sh") (executable-find "cat"))) (eshell-command-result-equal commit 85480527d571640a027343d3a145b1cbfcfe8c11 Author: Stefan Kangas Date: Sun Aug 21 17:33:55 2022 +0200 Prefer pos-bol and pos-eol in tests * test/lisp/calendar/todo-mode-tests.el (todo-test-toggle-item-header02, todo-test-edit-item-date-month) (todo-test-multiline-item-indentation-1) (todo-test-multiline-item-indentation-2) (todo-test-multiline-item-indentation-3): * test/lisp/cedet/semantic-utest-ia.el (semantic-ia-utest-buffer) (semantic-sr-utest-buffer-refs): * test/lisp/cedet/semantic-utest.el (semantic-utest-kill-indicator) (semantic-utest-unkill-indicator): * test/lisp/dired-tests.el (dired-test-bug27968): * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--verify-single-and-multi-line): * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--find-library-verbose): * test/lisp/erc/erc-tests.el (erc-ring-previous-command) (erc-log-irc-protocol): * test/lisp/gnus/message-tests.el (message-mode-propertize): * test/lisp/info-xref-tests.el (info-xref-test-emacs-manuals): * test/lisp/mail/footnote-tests.el (footnote-tests-same-place): * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-completion-at-point): * test/lisp/progmodes/f90-tests.el (f90-test-bug38415): * test/lisp/progmodes/python-tests.el (python-indent-electric-comma-inside-multiline-string) (python-indent-electric-comma-after-multiline-string) (python-indent-electric-colon-1, python-indent-electric-colon-2) (python-indent-electric-colon-3, python-indent-electric-colon-4) (python-mark-defun-2, python-mark-defun-3, python-mark-defun-4) (python-mark-defun-5, python-nav-end-of-defun-2) (python-nav-end-of-statement-1, python-nav-end-of-block-1) (python-indent-dedent-line-backspace-2) (python-indent-dedent-line-backspace-3) (python-eldoc--get-symbol-at-point-1) (python-info-beginning-of-statement-p-1) (python-info-beginning-of-statement-p-2): * test/lisp/replace-tests.el (replace-occur-revert-bug32543) (replace-occur-revert-bug32987): * test/lisp/simple-tests.el (simple-delete-indentation-boundaries) (simple-delete-indentation-region) (line-number-at-pos-in-narrow-buffer) (line-number-at-pos-keeps-restriction): * test/lisp/textmodes/css-mode-tests.el (css-mode-test-selectors) (scss-mode-test-selectors): * test/lisp/textmodes/fill-tests.el (fill-test-unbreakable-paragraph) (fill-test-breakable-paragraph): * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): * test/src/lread-tests.el (lread-tests--last-message): * test/src/process-tests.el (set-process-filter-t): * test/src/undo-tests.el (undo-test-skip-invalidated-markers): Prefer pos-bol and pos-eol. diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el index 0102b62c10..95855d1e63 100644 --- a/test/lisp/calendar/todo-mode-tests.el +++ b/test/lisp/calendar/todo-mode-tests.el @@ -459,7 +459,7 @@ the top done item should be the first done item." todo-date-pattern "\\( " diary-time-regexp "\\)?" (regexp-quote todo-nondiary-end) "?") - (line-end-position) t) + (pos-eol) t) (forward-char) (point))) (start1 (save-excursion (funcall find-start))) @@ -854,7 +854,7 @@ item's date should be adjusted accordingly." (let ((current-prefix-arg t) ; For todo-edit-item--header. (get-date (lambda () (save-excursion - (todo-date-string-matcher (line-end-position)) + (todo-date-string-matcher (pos-eol)) (buffer-substring-no-properties (match-beginning 1) (match-end 0)))))) (should (equal (funcall get-date) "Jan 1, 2020")) @@ -903,7 +903,7 @@ tab character." (todo-test--insert-item item 1) (re-search-forward (concat todo-date-string-start todo-date-pattern (regexp-quote todo-nondiary-end) " ") - (line-end-position) t) + (pos-eol) t) (should (looking-at (regexp-quote (concat item0 "\n\t" item1))))))) (ert-deftest todo-test-multiline-item-indentation-2 () ; bug#43068 @@ -917,7 +917,7 @@ begin with a tab character." (todo-edit-item--text 'multiline) (insert (concat "\n" item1)) (todo-edit-quit) - (goto-char (line-beginning-position)) + (goto-char (pos-bol)) (should (looking-at (regexp-quote (concat item0 "\n\t" item1))))))) (ert-deftest todo-test-multiline-item-indentation-3 () @@ -930,7 +930,7 @@ since all non-initial item lines must begin with whitespace." (item1 "Second line.")) (todo-edit-file) (should (looking-at (regexp-quote item0))) - (goto-char (line-end-position)) + (goto-char (pos-eol)) (insert (concat "\n" item1)) (should-error (todo-edit-quit) :type 'user-error)))) diff --git a/test/lisp/cedet/semantic-utest-ia.el b/test/lisp/cedet/semantic-utest-ia.el index caf20fa8e0..fa3b3185ed 100644 --- a/test/lisp/cedet/semantic-utest-ia.el +++ b/test/lisp/cedet/semantic-utest-ia.el @@ -194,7 +194,7 @@ (goto-char a) - (let ((bss (buffer-substring-no-properties (point) (point-at-eol)))) + (let ((bss (buffer-substring-no-properties (point) (pos-eol)))) (condition-case nil (setq desired (read bss)) (error (setq desired (format " FAILED TO PARSE: %S" @@ -215,8 +215,8 @@ ) fail))) - (setq p nil a nil) - (setq idx (1+ idx))) + (setq p nil a nil) + (setq idx (1+ idx))) ) (when fail @@ -353,7 +353,7 @@ (when (re-search-forward regex-p nil t) (setq tag (semantic-current-tag)) (goto-char (match-end 0)) - (setq desired (read (buffer-substring (point) (point-at-eol)))) + (setq desired (read (buffer-substring (point) (pos-eol)))) )) tag) @@ -451,7 +451,7 @@ tag that contains point, and return that." (when (re-search-forward regex-p nil t) (goto-char (match-end 0)) (skip-syntax-backward "w") - (setq desired (read (buffer-substring (point) (point-at-eol)))) + (setq desired (read (buffer-substring (point) (pos-eol)))) (setq start (match-beginning 0)) (goto-char start) (setq actual (semantic-symref-test-count-hits-in-tag)) @@ -463,7 +463,7 @@ tag that contains point, and return that." (list (format "Symref id %d: No results." idx)) - fail)) + fail)) ) diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el index 78bbbbf459..24a467474b 100644 --- a/test/lisp/cedet/semantic-utest.el +++ b/test/lisp/cedet/semantic-utest.el @@ -736,8 +736,8 @@ JAVE this thing would need to be recursive to handle java and csharp" (beginning-of-line) (setq semantic-utest-last-kill-pos (point)) (setq semantic-utest-last-kill-text - (buffer-substring (point) (point-at-eol))) - (delete-region (point) (point-at-eol)) + (buffer-substring (point) (pos-eol))) + (delete-region (point) (pos-eol)) (insert insertme) (sit-for 0) ) @@ -745,7 +745,7 @@ JAVE this thing would need to be recursive to handle java and csharp" (defun semantic-utest-unkill-indicator () "Unkill the last indicator." (goto-char semantic-utest-last-kill-pos) - (delete-region (point) (point-at-eol)) + (delete-region (point) (pos-eol)) (insert semantic-utest-last-kill-text) (sit-for 0) ) diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 0e89325907..9cf0151905 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -313,7 +313,7 @@ (save-excursion (goto-char 1) (forward-line 1) - (- (point-at-eol) (point))))) + (- (pos-eol) (point))))) orig-len len diff pos line-nb) (make-directory subdir 'parents) (with-current-buffer (dired-noselect subdir) @@ -331,7 +331,7 @@ (forward-line 1) (let ((inhibit-read-only t) (new-header " test-bug27968")) - (delete-region (point) (point-at-eol)) + (delete-region (point) (pos-eol)) (when (= orig-len (length new-header)) ;; Wow lucky guy! I must buy lottery today. (setq new-header (concat new-header " :-)"))) diff --git a/test/lisp/emacs-lisp/backtrace-tests.el b/test/lisp/emacs-lisp/backtrace-tests.el index b08695a22b..b42de06776 100644 --- a/test/lisp/emacs-lisp/backtrace-tests.el +++ b/test/lisp/emacs-lisp/backtrace-tests.el @@ -274,16 +274,16 @@ line contains the strings \"lambda\" and \"number\"." ;; Verify the form now spans multiple lines. (let ((pos (point))) (search-forward "number") - (should-not (= pos (point-at-bol)))) + (should-not (= pos (pos-bol)))) ;; Collapse the form. (backtrace-single-line) ;; Verify that the form is now back on one line, ;; and that point is at the same place. (should (string= (backtrace-tests--get-substring (- (point) 6) (point)) "number")) - (should-not (= (point) (point-at-bol))) + (should-not (= (point) (pos-bol))) (should (string= (backtrace-tests--get-substring - (point-at-bol) (1+ (point-at-eol))) + (pos-bol) (1+ (pos-eol))) line))) (ert-deftest backtrace-tests--print-circle () diff --git a/test/lisp/emacs-lisp/find-func-tests.el b/test/lisp/emacs-lisp/find-func-tests.el index 420c61acb5..d18a9dc1a9 100644 --- a/test/lisp/emacs-lisp/find-func-tests.el +++ b/test/lisp/emacs-lisp/find-func-tests.el @@ -109,9 +109,7 @@ expected function symbol and function library, respectively." (skip-chars-backward "\n") (should (string-match-p ".join-line. is an alias for .delete-indentation." - (buffer-substring - (line-beginning-position) - (point))))))) + (buffer-substring (pos-bol) (point))))))) ;; Avoid a byte-compilation warning that may confuse people reading ;; the result of the following test. diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 0f222edacf..55efe2fd2d 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -522,7 +522,7 @@ (erc-send-current-line) (should (ring-p erc-input-ring)) (should (zerop (ring-member erc-input-ring "/one"))) ; equal - (should (save-excursion (forward-line -1) (goto-char (point-at-bol)) + (should (save-excursion (forward-line -1) (goto-char (pos-bol)) (looking-at-p "[*]+ echo: one"))) (should-not erc-input-ring-index) (erc-bol) @@ -575,15 +575,15 @@ (goto-char (point-min)) (search-forward "Version") (search-forward "\r\n\r\n") - (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position)) + (search-forward "myproxy.localhost:6667 >> PASS" (pos-eol)) (forward-line) - (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position)) + (search-forward "irc.gnu.org << :irc.gnu.org 001" (pos-eol)) (forward-line) - (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position)) + (search-forward "irc.gnu.org << :irc.gnu.org 002" (pos-eol)) (forward-line) - (search-forward "FooNet << :irc.gnu.org 422" (line-end-position)) + (search-forward "FooNet << :irc.gnu.org 422" (pos-eol)) (forward-line) - (search-forward "BarNet << :irc.gnu.org 221" (line-end-position))) + (search-forward "BarNet << :irc.gnu.org 221" (pos-eol))) (when noninteractive (kill-buffer "*erc-protocol*") (should-not erc-debug-irc-protocol))) diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el index 8f3c1250a9..a724428ecb 100644 --- a/test/lisp/gnus/message-tests.el +++ b/test/lisp/gnus/message-tests.el @@ -47,14 +47,10 @@ (setq-local parse-sexp-lookup-properties t) (backward-sexp) (should (string= "here's an opener " - (buffer-substring-no-properties - (line-beginning-position) - (point)))) + (buffer-substring-no-properties (pos-bol) (point)))) (forward-sexp) (should (string= "and here's a closer )" - (buffer-substring-no-properties - (line-beginning-position) - (point))))) + (buffer-substring-no-properties (pos-bol) (point))))) (set-buffer-modified-p nil)))) diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el index acfd6e82f1..117170ba33 100644 --- a/test/lisp/info-xref-tests.el +++ b/test/lisp/info-xref-tests.el @@ -161,8 +161,7 @@ text. (should (search-backward "done" nil t)) (should (string-match-p " [0-9]\\{3,\\} good, 0 bad" - (buffer-substring-no-properties (line-beginning-position) - (line-end-position))))))) + (buffer-substring-no-properties (pos-bol) (pos-eol))))))) ;;; info-xref-tests.el ends here diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el index e33b59bc41..f3a35e3dfc 100644 --- a/test/lisp/mail/footnote-tests.el +++ b/test/lisp/mail/footnote-tests.el @@ -40,7 +40,7 @@ (footnote-back-to-message) (should (equal (buffer-substring (point-min) (point)) "hello[1]")) - (should (equal (buffer-substring (point-min) (line-end-position)) + (should (equal (buffer-substring (point-min) (pos-eol)) "hello[1][2] world")))) (provide 'footnote-tests) diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 8e4dfa8bb8..8074d8d706 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -1084,7 +1084,7 @@ evaluation of BODY." (insert "f-test-compl") (completion-at-point) (goto-char (point-min)) - (should (search-forward "f-test-complete-me" (line-end-position) t)) + (should (search-forward "f-test-complete-me" (pos-eol) t)) (goto-char (point-min)) (should (string= (symbol-name (read (current-buffer))) "elisp--foo-test-complete-me")) diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el index 3fe5eecd1b..b857a25bf2 100644 --- a/test/lisp/progmodes/f90-tests.el +++ b/test/lisp/progmodes/f90-tests.el @@ -285,14 +285,14 @@ real :: x end") (f90-indent-line) (should (equal " function foo" - (buffer-substring (point) (line-end-position)))) + (buffer-substring (point) (pos-eol)))) (goto-char (point-max)) (insert "\nmodule subroutine bar(x) real :: x end") (f90-indent-line) (should (equal " subroutine bar" - (buffer-substring (point) (line-end-position)))))) + (buffer-substring (point) (pos-eol)))))) ;;; f90-tests.el ends here diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index a11716a7b5..12ac871fdf 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -1639,7 +1639,7 @@ a = ( " (python-tests-look-at "- bar") (should (eq (car (python-indent-context)) :inside-string)) - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ",") (should (= (current-indentation) 0)))) @@ -1654,7 +1654,7 @@ a = ( " (python-tests-look-at "- bar'''") (should (eq (car (python-indent-context)) :inside-string)) - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ",") (should (= (current-indentation) 0)))) @@ -1668,7 +1668,7 @@ def a(): def b() " (python-tests-look-at "def b()") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ":") (should (= (current-indentation) 0)))) @@ -1682,7 +1682,7 @@ if do: outside " (python-tests-look-at "else") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ":") (should (= (current-indentation) 0)) (python-tests-look-at "outside") @@ -1699,7 +1699,7 @@ if do: that) " (python-tests-look-at "that)") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ":") (python-tests-look-at "elif" -1) (should (= (current-indentation) 0)) @@ -1724,7 +1724,7 @@ def f(): else " (python-tests-look-at "else") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (python-tests-self-insert ":") (python-tests-look-at "else" -1) (should (= (current-indentation) 4)))) @@ -1984,7 +1984,7 @@ class C: (expected-mark-beginning-position (progn (python-tests-look-at "def __init__(self):") - (1- (line-beginning-position)))) + (1- (pos-bol)))) (expected-mark-end-position-1 (save-excursion (python-tests-look-at "self.b = 'b'") @@ -2041,7 +2041,7 @@ class C: (progn (python-tests-look-at "def fun(self):") (python-tests-look-at "(self):") - (1- (line-beginning-position)))) + (1- (pos-bol)))) (expected-mark-end-position (save-excursion (python-tests-look-at "return self.b") @@ -2066,7 +2066,7 @@ def foo(x): (let ((expected-mark-beginning-position (progn (python-tests-look-at "def foo(x):") - (1- (line-beginning-position)))) + (1- (pos-bol)))) (expected-mark-end-position (point-max))) (python-tests-look-at "return bar") (python-mark-defun 1) @@ -2086,7 +2086,7 @@ def \\ (expected-mark-beginning-position (progn (python-tests-look-at "def ") - (1- (line-beginning-position)))) + (1- (pos-bol)))) (expected-mark-end-position (save-excursion (python-tests-look-at "return x") @@ -2438,21 +2438,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3): (point)) (save-excursion (python-tests-look-at "return wwrap") - (line-beginning-position)))) + (pos-bol)))) (should (= (save-excursion (python-tests-look-at "def wrapped_f(*args):") (python-nav-end-of-defun) (point)) (save-excursion (python-tests-look-at "return wrapped_f") - (line-beginning-position)))) + (pos-bol)))) (should (= (save-excursion (python-tests-look-at "f(*args)") (python-nav-end-of-defun) (point)) (save-excursion (python-tests-look-at "return wrapped_f") - (line-beginning-position)))))) + (pos-bol)))))) (ert-deftest python-nav-end-of-defun-3 () (python-tests-with-temp-buffer @@ -2765,14 +2765,14 @@ string (point)) (save-excursion (python-tests-look-at "789") - (line-end-position)))) + (pos-eol)))) (python-tests-look-at "v2 =") (should (= (save-excursion (python-nav-end-of-statement) (point)) (save-excursion (python-tests-look-at "value4)") - (line-end-position)))) + (pos-eol)))) (python-tests-look-at "v3 =") (should (= (save-excursion (python-nav-end-of-statement) @@ -2780,7 +2780,7 @@ string (save-excursion (python-tests-look-at "'continue previous line')") - (line-end-position)))) + (pos-eol)))) (python-tests-look-at "v4 =") (should (= (save-excursion (python-nav-end-of-statement) @@ -3004,21 +3004,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3): (point)) (save-excursion (python-tests-look-at "return wrapped_f") - (line-end-position)))) + (pos-eol)))) (end-of-line) (should (= (save-excursion (python-nav-end-of-block) (point)) (save-excursion (python-tests-look-at "return wrapped_f") - (line-end-position)))) + (pos-eol)))) (python-tests-look-at "f(*args)") (should (= (save-excursion (python-nav-end-of-block) (point)) (save-excursion (python-tests-look-at "print 'After f(*args)'") - (line-end-position)))))) + (pos-eol)))))) (ert-deftest python-nav-end-of-block-2 () "Ensure that `python-nav-end-of-block' does not enter an infinite loop." @@ -3308,11 +3308,11 @@ if x: \tabcdefg " (python-tests-look-at "abcdefg") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (call-interactively #'python-indent-dedent-line-backspace) (should (string= (buffer-substring-no-properties - (line-beginning-position) (line-end-position)) + (pos-bol) (pos-eol)) "\tabcdef"))))) (ert-deftest python-indent-dedent-line-backspace-3 () @@ -3325,27 +3325,27 @@ if x: \t abcdefg " (python-tests-look-at "abcdefg") - (goto-char (line-end-position)) + (goto-char (pos-eol)) (call-interactively #'python-indent-dedent-line-backspace) (should (string= (buffer-substring-no-properties - (line-beginning-position) (line-end-position)) + (pos-bol) (pos-eol)) "\t abcdef")) (back-to-indentation) (call-interactively #'python-indent-dedent-line-backspace) (should (string= (buffer-substring-no-properties - (line-beginning-position) (line-end-position)) + (pos-bol) (pos-eol)) "\tabcdef")) (call-interactively #'python-indent-dedent-line-backspace) (should (string= (buffer-substring-no-properties - (line-beginning-position) (line-end-position)) + (pos-bol) (pos-eol)) " abcdef")) (call-interactively #'python-indent-dedent-line-backspace) (should (string= (buffer-substring-no-properties - (line-beginning-position) (line-end-position)) + (pos-bol) (pos-eol)) "abcdef"))))) (ert-deftest python-bob-infloop-avoid () @@ -4358,11 +4358,11 @@ map(codecs.open('somefile' " (python-tests-look-at "ap(xx") (should (string= (python-eldoc--get-symbol-at-point) "map")) - (goto-char (line-end-position)) + (goto-char (pos-eol)) (should (string= (python-eldoc--get-symbol-at-point) "map")) (python-tests-look-at "('somefile'") (should (string= (python-eldoc--get-symbol-at-point) "map")) - (goto-char (line-end-position)) + (goto-char (pos-eol)) (should (string= (python-eldoc--get-symbol-at-point) "codecs.open")))) (ert-deftest python-eldoc--get-symbol-at-point-2 () @@ -4875,7 +4875,7 @@ def long_function_name( (should (not (python-info-beginning-of-statement-p))) (python-tests-look-at "print (var_one)") (should (python-info-beginning-of-statement-p)) - (goto-char (line-beginning-position)) + (goto-char (pos-bol)) (should (not (python-info-beginning-of-statement-p))))) (ert-deftest python-info-beginning-of-statement-p-2 () @@ -4895,7 +4895,7 @@ if width == 0 and height == 0 and \\ (should (not (python-info-beginning-of-statement-p))) (python-tests-look-at "raise ValueError(") (should (python-info-beginning-of-statement-p)) - (goto-char (line-beginning-position)) + (goto-char (pos-bol)) (should (not (python-info-beginning-of-statement-p))))) (ert-deftest python-info-end-of-statement-p-1 () diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index ef1e5c3eaf..23ec24840f 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -378,7 +378,7 @@ Each element has the format: (goto-char (point-min)) (should (string-match "\\`2 matches for \"and\" in buffer: " (buffer-substring-no-properties - (point) (line-end-position))))))) + (point) (pos-eol))))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) @@ -401,7 +401,7 @@ Each element has the format: (goto-char (point-min)) (should (string-match "\\`2 matches for \"and\" in buffer: " (buffer-substring-no-properties - (point) (line-end-position))))))) + (point) (pos-eol))))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index b4576889dc..97f425f6f4 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -321,7 +321,7 @@ See bug#35036." ;; Stay at BOB. (forward-line -1) (save-restriction - (narrow-to-region (point) (line-end-position)) + (narrow-to-region (point) (pos-eol)) (should-not (delete-indentation)) (should (equal (simple-test--buffer-substrings) '("" . " second "))) @@ -344,27 +344,23 @@ See bug#35036." (should (equal (simple-test--buffer-substrings) '(" first " . ""))) ;; Single line. - (should-not (delete-indentation - nil (line-beginning-position) (1- (point)))) + (should-not (delete-indentation nil (pos-bol) (1- (point)))) (should (equal (simple-test--buffer-substrings) '("" . " first "))) - (should-not (delete-indentation nil (1+ (point)) (line-end-position))) + (should-not (delete-indentation nil (1+ (point)) (pos-eol))) (should (equal (simple-test--buffer-substrings) '(" " . "first "))) - (should-not (delete-indentation - nil (line-beginning-position) (line-end-position))) + (should-not (delete-indentation nil (pos-bol) (pos-eol))) (should (equal (simple-test--buffer-substrings) '("" . " first "))) ;; Multiple lines. (goto-char (point-max)) (insert "\n second \n third \n fourth ") (goto-char (point-min)) - (should-not (delete-indentation - nil (line-end-position) (line-beginning-position 2))) + (should-not (delete-indentation nil (pos-eol) (pos-bol 2))) (should (equal (simple-test--buffer-substrings) '(" first" . " second \n third \n fourth "))) - (should-not (delete-indentation - nil (point) (1+ (line-beginning-position 2)))) + (should-not (delete-indentation nil (point) (1+ (pos-bol 2)))) (should (equal (simple-test--buffer-substrings) '(" first second" . " third \n fourth "))) ;; Prefix argument overrides region. @@ -808,7 +804,7 @@ See Bug#21722." (insert "a\nb\nc\nd\n") (goto-char (point-min)) (forward-line (1- target-line)) - (narrow-to-region (line-beginning-position) (line-end-position)) + (narrow-to-region (pos-bol) (pos-eol)) (should (equal (line-number-at-pos) 1)) (should (equal (line-number-at-pos nil t) target-line))))) @@ -817,7 +813,7 @@ See Bug#21722." (insert "a\nb\nc\nd\n") (goto-char (point-min)) (forward-line 2) - (narrow-to-region (line-beginning-position) (line-end-position)) + (narrow-to-region (pos-bol) (pos-eol)) (should (equal (line-number-at-pos) 1)) (line-number-at-pos nil t) (should (equal (line-number-at-pos) 1)))) diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index a746edf894..1d2d556992 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -435,7 +435,7 @@ 'css-selector) (should-not (format "Didn't recognize %s as a selector" (buffer-substring-no-properties - (point) (line-end-position))))))) + (point) (pos-eol))))))) ;; Test many selectors. (dolist (selector selectors) (with-temp-buffer @@ -451,7 +451,7 @@ 'css-selector) (should-not (format "Didn't recognize %s as a selector" (buffer-substring-no-properties - (point) (line-end-position))))))) + (point) (pos-eol))))))) ;; Test wrong separators. (dolist (selector selectors) (with-temp-buffer @@ -467,7 +467,7 @@ 'css-selector) (should-not (format "Recognized %s as a selector" (buffer-substring-no-properties - (point) (line-end-position)))))))))) + (point) (pos-eol)))))))))) (ert-deftest scss-mode-test-selectors () (let ((selectors @@ -485,7 +485,7 @@ 'css-selector) (should-not (format "Didn't recognize %s as a selector" (buffer-substring-no-properties - (point) (line-end-position)))))))))) + (point) (pos-eol)))))))))) (provide 'css-mode-tests) diff --git a/test/lisp/textmodes/fill-tests.el b/test/lisp/textmodes/fill-tests.el index b730de5a69..f2a0daf812 100644 --- a/test/lisp/textmodes/fill-tests.el +++ b/test/lisp/textmodes/fill-tests.el @@ -53,8 +53,8 @@ (goto-char (point-min)) (search-forward "b") (let* ((pos (point)) - (beg (line-beginning-position)) - (end (line-end-position)) + (beg (pos-bol)) + (end (pos-eol)) (fill-prefix (make-string (- pos beg) ?\s)) ;; `fill-column' is too small to accommodate the current line (fill-column (- end beg 10))) @@ -68,8 +68,8 @@ (goto-char (point-min)) (search-forward "b") (let* ((pos (point)) - (beg (line-beginning-position)) - (end (line-end-position)) + (beg (pos-bol)) + (end (pos-eol)) (fill-prefix (make-string (- pos beg) ?\s)) ;; `fill-column' is too small to accommodate the current line (fill-column (- end beg 10))) diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index 8361d58b55..55e37b71d8 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el @@ -147,13 +147,11 @@ (string-to-number line-limit1)))) (goto-char (point-min)) (if (> limit-number 0) - (should (= search-limit (line-beginning-position - (1+ limit-number)))) + (should (= search-limit (pos-bol (1+ limit-number)))) (should (= search-limit (point-max)))) (goto-char (point-max)) (if (< limit-number 0) - (should (= start (line-beginning-position - (1+ limit-number)))) + (should (= start (pos-bol (1+ limit-number)))) (should (= start (point-min))))) (if (equal start1 "") (should (equal ts-start time-stamp-start)) diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 2f25de4cc3..57143dd81e 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -128,7 +128,7 @@ (save-excursion (goto-char (point-max)) (skip-chars-backward "\n") - (buffer-substring (line-beginning-position) (point))))) + (buffer-substring (pos-bol) (point))))) (ert-deftest lread-tests--unescaped-char-literals () "Check that loading warns about unescaped character diff --git a/test/src/process-tests.el b/test/src/process-tests.el index db8a504478..6e1e148332 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el @@ -160,8 +160,7 @@ process to complete." (setq count (1+ count)))))))) (set-process-query-on-exit-flag proc nil) (send-string proc "one\n") - (while (not (equal (buffer-substring - (line-beginning-position) (point-max)) + (while (not (equal (buffer-substring (pos-bol) (point-max)) "1> ")) (accept-process-output proc)) ; Read "one". (should (equal (buffer-string) "0> one\n1> ")) @@ -171,8 +170,7 @@ process to complete." (accept-process-output proc 1)) ; Can't read "two" yet. (should (equal (buffer-string) "0> one\n1> ")) (set-process-filter proc nil) ; Resume reading from proc. - (while (not (equal (buffer-substring - (line-beginning-position) (point-max)) + (while (not (equal (buffer-substring (pos-bol) (point-max)) "2> ")) (accept-process-output proc)) ; Read "Two". (should (equal (buffer-string) "0> one\n1> two\n2> ")))))) diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el index c84ed74f0b..cb0822fb1b 100644 --- a/test/src/undo-tests.el +++ b/test/src/undo-tests.el @@ -460,11 +460,10 @@ Demonstrates bug 25599." (delete-overlay ov)))))) (save-excursion (goto-char (point-min)) - (let ((ov (make-overlay (line-beginning-position 2) - (line-end-position 2)))) + (let ((ov (make-overlay (pos-bol 2) (pos-eol 2)))) (overlay-put ov 'insert-in-front-hooks (list overlay-modified))))) - (kill-region (point-min) (line-beginning-position 2)) + (kill-region (point-min) (pos-bol 2)) (undo-boundary) (undo))) commit 79560aaa51adaa0ec60b3faa68bef4e8167a146f Author: Stefan Kangas Date: Sun Aug 21 17:28:14 2022 +0200 Don't end autorevert message with a period * lisp/autorevert.el (auto-revert-handler): Don't end message with a period. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 918c0c7f19..872a896689 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -800,7 +800,7 @@ This is an internal function used by Auto-Revert Mode." (when revert (when (and auto-revert-verbose (not (eq revert 'fast))) - (message "Reverting buffer `%s'." (buffer-name))) + (message "Reverting buffer `%s'" (buffer-name))) ;; If point (or a window point) is at the end of the buffer, we ;; want to keep it at the end after reverting. This allows one ;; to tail a file. commit 6dc61aa69ad68c3cd4857d6d42e44f2b4f9359d8 Author: Lars Ingebrigtsen Date: Sun Aug 21 17:14:46 2022 +0200 Tweak emacs-bug--system-description * lisp/mail/emacsbug.el (emacs-bug--system-description): Fill the commonly-overlong Emacs version bit. diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 6cc99c2134..d72809b186 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -387,10 +387,12 @@ copy text to your preferred mail program.\n" (goto-char user-point))) (defun emacs-bug--system-description () - (insert "\nIn " (emacs-version)) - (if emacs-build-system - (insert " built on " emacs-build-system)) - (insert "\n") + (let ((start (point))) + (insert "\nIn " (emacs-version)) + (if emacs-build-system + (insert " built on " emacs-build-system)) + (insert "\n") + (fill-region-as-paragraph start (point))) (if (stringp emacs-repository-version) (insert "Repository revision: " emacs-repository-version "\n")) commit 965fad0d36f7fe9392736c66c8ccd39b83ce6713 Author: Mattias Engdegård Date: Sun Aug 21 16:17:45 2022 +0200 Update function properties and optimisations * lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): Recognise boolean identity in aset, put, function-put and puthash. * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Mark more functins as non-nil-returning, including the new pos-bol and pos-eol. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark pos-bol and pos-eol as side-effect-free. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 2467b468a4..27b0d33d3e 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -728,17 +728,20 @@ for speeding up processing.") (while (let ((head (car-safe form))) (cond ((memq head '( progn inline save-excursion save-restriction save-current-buffer)) - (setq form (car (last form))) + (setq form (car (last (cdr form)))) t) - ((memq head '(let let* setq setcar setcdr)) + ((memq head '(let let*)) (setq form (car (last (cddr form)))) t) ((memq head '( prog1 unwind-protect copy-sequence identity reverse nreverse sort)) (setq form (nth 1 form)) t) - ((eq head 'mapc) + ((memq head '(mapc setq setcar setcdr puthash)) (setq form (nth 2 form)) + t) + ((memq head '(aset put function-put)) + (setq form (nth 3 form)) t)))) form) @@ -757,17 +760,18 @@ for speeding up processing.") format format-message substring substring-no-properties string-replace replace-regexp-in-string symbol-name make-symbol - compare-strings + compare-strings string-distance mapconcat vector make-vector vconcat make-record record regexp-quote regexp-opt buffer-string buffer-substring buffer-substring-no-properties - current-buffer buffer-size + current-buffer buffer-size get-buffer-create point point-min point-max buffer-end count-lines - following-char preceding-char max-char + following-char preceding-char get-byte max-char region-beginning region-end line-beginning-position line-end-position + pos-bol pos-eol + - * / % 1+ 1- min max abs mod expt logb logand logior logxor lognot ash logcount floor ceiling round truncate @@ -783,11 +787,13 @@ for speeding up processing.") string-as-multibyte string-as-unibyte string-to-multibyte string-to-unibyte string-make-multibyte string-make-unibyte + string-width char-width make-hash-table hash-table-count unibyte-char-to-multibyte multibyte-char-to-unibyte sxhash sxhash-equal sxhash-eq sxhash-eql sxhash-equal-including-properties make-marker copy-marker point-marker mark-marker + kbd key-description always)) t) ((eq head 'if) @@ -1586,7 +1592,7 @@ See Info node `(elisp) Integer Basics'." keymap-parent lax-plist-get ldexp length length< length> length= - line-beginning-position line-end-position + line-beginning-position line-end-position pos-bol pos-eol 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 mark marker-buffer max commit 563ec6abc4f194eb8d89cc2f5adefb7f68017149 Author: Mattias Engdegård Date: Sun Aug 21 15:56:26 2022 +0200 ; Complete renaming to pos-bol and pos-eol diff --git a/src/editfns.c b/src/editfns.c index febc9f8fda..cd5cddee79 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -748,7 +748,7 @@ This function does not move point. Also see `line-beginning-position'. */) DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_position, 0, 1, 0, doc: /* Return the position of the first character in the current line/field. -This function is like `bol' (which see), but respects fields. +This function is like `pos-bol' (which see), but respects fields. This function constrains the returned position to the current field unless that position would be on a different line from the original, @@ -804,7 +804,7 @@ DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. -This function is like `eol' (which see), but respects fields. +This function is like `pos-eol' (which see), but respects fields. This function constrains the returned position to the current field unless that would be on a different line from the original, commit f57297c8b2344d822fcf56fb3fc3b543e1e747bf Author: Mattias Engdegård Date: Sun Aug 21 15:48:08 2022 +0200 * lisp/emacs-lisp/shortdoc.el (buffer): Add missing functions Add preceding-char and char-before because following-char and char-after were already there. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 6fb6100bd2..43fefc8ed0 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -984,8 +984,13 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), (following-char :no-eval (following-char) :eg-result 67) + (preceding-char + :no-eval (preceding-char) + :eg-result 38) (char-after :eval (char-after 45)) + (char-before + :eval (char-before 13)) (get-byte :no-eval (get-byte 45) :eg-result-string "#xff") commit a6ccb82fdaacb731295545f867765d60726c5044 Author: Gerd Möllmann Date: Sun Aug 21 15:57:40 2022 +0200 Fix src-depending-on-lisp target * Makefile.in (src-depending-on-lisp): Pass BIN_DESTDIR and ELN_DESTDIR to make -C src (bug#57309). diff --git a/Makefile.in b/Makefile.in index 78103f897f..7541e8d6b6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -367,7 +367,7 @@ all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp # .pdmp containing the new autoloads. .PHONY: src-depending-on-lisp src-depending-on-lisp: lisp - ${MAKE} -C src + ${MAKE} -C src BIN_DESTDIR='$(BIN_DESTDIR)' ELN_DESTDIR='$(ELN_DESTDIR)' # If configure were to just generate emacsver.tex from emacsver.tex.in # in the normal way, the timestamp of emacsver.tex would always be commit ae2199258f6eba3a8a066616dad1a7bf666ec8be Author: Lars Ingebrigtsen Date: Sun Aug 21 15:32:34 2022 +0200 Mark esh-proc test as unstable * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/pipeline-connection-type/last): Mark test as unstable as it fails quite a lot. diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el index 2369bb5cc0..63aa5384c8 100644 --- a/test/lisp/eshell/esh-proc-tests.el +++ b/test/lisp/eshell/esh-proc-tests.el @@ -82,6 +82,8 @@ pipeline." (ert-deftest esh-proc-test/pipeline-connection-type/last () "Test that only output streams are PTYs when a command ends a pipeline." + ;; Repeated unreproducible errors. + :tags '(:unstable) (skip-unless (executable-find "sh")) (eshell-command-result-equal (concat "echo | " esh-proc-test--detect-pty-cmd) commit 982bd6952047ea7a97ef87e5f42cf4328538215f Author: Eli Zaretskii Date: Sun Aug 21 16:12:03 2022 +0300 ; * src/xterm.c (handle_one_xevent): Avoid compiler warning. diff --git a/src/xterm.c b/src/xterm.c index 4f9b0b83b5..200ef1d11f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -21534,7 +21534,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, else { dpyinfo->grabbed &= ~(1 << xev->detail); - device->grab &= ~(1 << xev->detail); + if (device) + device->grab &= ~(1 << xev->detail); } #ifdef XIPointerEmulated } commit 2614e5321639008dc75f740236769d1e9213aae2 Author: Lars Ingebrigtsen Date: Sun Aug 21 14:04:52 2022 +0200 Rename newly-added eol/bol functions to pos-eol/pos-bol * lisp/emacs-lisp/shortdoc.el (buffer): * doc/lispref/positions.texi (Text Lines): Adjust. * src/editfns.c (Fpos_bol): Rename from Fpos. (Fpos_eol): Rename from Feol. diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 53846ed297..7945232bf8 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -387,12 +387,12 @@ Return the position that @code{(end-of-line @var{count})} would move to. @end defun -@defun bol &optional count +@defun pos-bol &optional count Like @code{line-beginning-position}, but ignores fields (and is more efficient). @end defun -@defun eol &optional count +@defun pos-eol &optional count Like @code{line-end-position}, but ignores fields (and is more efficient). @end defun diff --git a/etc/NEWS b/etc/NEWS index 0274e3b153..c41b7ac6e8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2589,7 +2589,7 @@ patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el. * Lisp Changes in Emacs 29.1 +++ -** New functions 'eol' and 'bol'. +** New functions 'pos-eol' and 'pos-bol'. These are like 'line-end-position' and 'line-beginning-position' (respectively), but ignore fields (and are more efficient). diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index acf294ede1..6fb6100bd2 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -941,10 +941,10 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), :eval (point-min)) (point-max :eval (point-max)) - (eol - :eval (eol)) - (bol - :eval (bol)) + (pos-eol + :eval (pos-eol)) + (pos-bol + :eval (pos-bol)) (bolp :eval (bolp)) (eolp diff --git a/src/editfns.c b/src/editfns.c index 1626238199..febc9f8fda 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -729,7 +729,7 @@ bol (Lisp_Object n, ptrdiff_t *out_count) return charpos; } -DEFUN ("bol", Fbol, Sbol, 0, 1, 0, +DEFUN ("pos-bol", Fpos_bol, Spos_bol, 0, 1, 0, doc: /* Return the position of the first character on the current line. With optional argument N, scan forward N - 1 lines first. If the scan reaches the end of the buffer, return that position. @@ -784,7 +784,7 @@ eol (Lisp_Object n) NULL); } -DEFUN ("eol", Feol, Seol, 0, 1, 0, +DEFUN ("pos-eol", Fpos_eol, Spos_eol, 0, 1, 0, doc: /* Return the position of the last character on the current line. With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. @@ -4642,8 +4642,8 @@ with an optional argument LOCK non-nil. */); defsubr (&Sline_beginning_position); defsubr (&Sline_end_position); - defsubr (&Sbol); - defsubr (&Seol); + defsubr (&Spos_bol); + defsubr (&Spos_eol); defsubr (&Ssave_excursion); defsubr (&Ssave_current_buffer);