commit 8ee1dc8f1f9aa47260f8151c9eea30fb1ccf878a (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sun Apr 7 14:39:42 2024 +0800 Resolve disagreements in accounting of tooltip positions on Android * java/org/gnu/emacs/EmacsService.java (getLocationInWindow): New function. * java/org/gnu/emacs/EmacsWindow.java (translateCoordinates): Derive "root window" position from the origin point of the containing activity's window rather than that of the screen, the two of which differ when "freeform mode" is enabled. diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 34682feeedb..052793eabaf 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -387,6 +387,23 @@ invocation of app_process (through android-emacs) can EmacsService.syncRunnable (task); } + public void + getLocationInWindow (final EmacsView view, final int[] coordinates) + { + FutureTask task; + + task = new FutureTask (new Callable () { + public Void + call () + { + view.getLocationInWindow (coordinates); + return null; + } + }); + + EmacsService.syncRunnable (task); + } + public static void diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 91e97fa8b61..911e082144e 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -1551,10 +1551,11 @@ else if (EmacsWindow.this.isMapped) { int[] array; - /* This is supposed to translate coordinates to the root - window. */ + /* This is supposed to translate coordinates to the root window, + whose origin point, in this context, is that of the toplevel + activity host to this view. */ array = new int[2]; - EmacsService.SERVICE.getLocationOnScreen (view, array); + EmacsService.SERVICE.getLocationInWindow (view, array); /* Now, the coordinates of the view should be in array. Offset X and Y by them. */ commit c7a0e4faa2a584063e4ace0ac4da8fb0ae1c5e50 Author: Lin Sun Date: Fri Apr 5 06:58:07 2024 +0000 * lisp/master.el (master-says): Check nil argument (bug#70230). diff --git a/lisp/master.el b/lisp/master.el index 0caf4d7963f..9151ca212d1 100644 --- a/lisp/master.el +++ b/lisp/master.el @@ -136,6 +136,8 @@ See `recenter'." (defun master-says (&optional command arg) "Display slave buffer and execute COMMAND with ARG in its window." (interactive) + (unless master-of + (error "Current buffer is not a master of any other buffer")) (if (null (buffer-live-p (get-buffer master-of))) (error "Slave buffer has disappeared") (let ((window (selected-window))) commit ae296d762bc7366879e74f9dca90bc7edd89e860 Author: Po Lu Date: Sun Apr 7 12:15:39 2024 +0800 Port new Android window management strategy to Android 5.0 * doc/emacs/android.texi (Android Windowing): Revise to match. * java/org/gnu/emacs/EmacsWindowManager.java (registerWindow) (removeWindowConsumer, pruneWindows): Decrease minimum API for monitoring of tasks to Android 5.0. (getTaskToken): Ignore misleading documentation and access baseIntent by way of RecentTaskInfo. diff --git a/doc/emacs/android.texi b/doc/emacs/android.texi index ebc00c74ede..3f784bc9637 100644 --- a/doc/emacs/android.texi +++ b/doc/emacs/android.texi @@ -876,7 +876,7 @@ distributors. @item When the user or the system closes any window created by Emacs on behalf of a specific frame, Emacs deletes the frame displayed within that -window, unless the system is Android 10.0 or later, where such windows +window, unless the system is Android 5.0 or later, where such windows are treated identically to the window created at startup, albeit with no proviso regarding window inactivity. @end itemize diff --git a/java/org/gnu/emacs/EmacsWindowManager.java b/java/org/gnu/emacs/EmacsWindowManager.java index 41ea3a15809..22629cad329 100644 --- a/java/org/gnu/emacs/EmacsWindowManager.java +++ b/java/org/gnu/emacs/EmacsWindowManager.java @@ -23,9 +23,9 @@ import java.util.List; import android.app.ActivityManager.AppTask; +import android.app.ActivityManager.RecentTaskInfo; import android.app.ActivityManager; import android.app.ActivityOptions; -import android.app.TaskInfo; import android.content.Context; import android.content.Intent; @@ -60,7 +60,7 @@ class are relevant on all versions of Android: getAttachmentToken () should return a token uniquely identifying a consumer, which, on API - 29 and up, enables attributing the tasks of activities to the windows + 21 and up, enables attributing the tasks of activities to the windows for which they were created, and with that, consistent interaction between user-visible window state and their underlying frames. */ @@ -182,7 +182,21 @@ && isWindowEligible (consumer, window)) /* Intent.FLAG_ACTIVITY_NEW_DOCUMENT is lamentably unavailable on older systems than Lolipop. */ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) - intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT); + { + intent.addFlags (Intent.FLAG_ACTIVITY_NEW_DOCUMENT); + + /* Bind this window to the activity in advance, i.e., before its + creation, so that its ID will be recorded in the RecentTasks + list. */ + token = ++nextActivityToken; + } + else + /* APIs required for linking activities to windows are not + available in earlier Android versions. */ + token = -2; + + window.attachmentToken = token; + intent.putExtra (ACTIVITY_TOKEN, token); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) EmacsService.SERVICE.startActivity (intent); @@ -191,19 +205,6 @@ && isWindowEligible (consumer, window)) /* Specify the desired window size. */ options = ActivityOptions.makeBasic (); options.setLaunchBounds (window.getGeometry ()); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) - /* Bind this window to the activity in advance, i.e., before - its creation, so that its ID will be recorded in the - RecentTasks list. */ - token = ++nextActivityToken; - else - /* APIs required for linking activities to windows are not - available in earlier Android versions. */ - token = -2; - - window.attachmentToken = token; - intent.putExtra (ACTIVITY_TOKEN, token); EmacsService.SERVICE.startActivity (intent, options.toBundle ()); } @@ -228,7 +229,7 @@ && isWindowEligible (consumer, window)) the system-started task. */ if (isFinishing && (!(consumer instanceof EmacsMultitaskActivity) - || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)) + || Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)) window.onActivityDetached (); } @@ -297,12 +298,17 @@ && isWindowEligible (consumer, window)) private static long getTaskToken (AppTask task) { - TaskInfo info; + RecentTaskInfo info; + + info = task.getTaskInfo (); - info = (TaskInfo) task.getTaskInfo (); + /* baseIntent is a member of info's superclass, TaskInfo, on Android + 10 and later. Prior to this release, it had been a member of + RecentTaskInfo since SDK 1, and whatever the misleading + documentation might suggest, a reference to `baseIntent' through + TaskInfo is just as good a reference to RecentTaskInfo. */ return (info.baseIntent != null - ? info.baseIntent.getLongExtra (ACTIVITY_TOKEN, - -1l) + ? info.baseIntent.getLongExtra (ACTIVITY_TOKEN, -1l) : 0); } @@ -319,7 +325,7 @@ && isWindowEligible (consumer, window)) long taskToken; boolean set; - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP || EmacsService.SERVICE == null) return; commit ec25f5ad3d4323b56f239a06186f965c8d4cb695 Author: Juri Linkov Date: Sat Apr 6 21:32:04 2024 +0300 ; * etc/NEWS: Add entry about tab-bar-mode-map (bug#69578). diff --git a/etc/NEWS b/etc/NEWS index 375c27a03de..d4bba66e4aa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -349,6 +349,12 @@ the appearance of every tab on the tab bar. --- *** New hook 'tab-bar-tab-post-select-functions'. +--- +*** New keymap 'tab-bar-mode-map'. +By default it contains a keybinding 'C-TAB' to switch tabs, +but only when 'C-TAB' is not bound globally. You can unbind it +if it conflicts with 'C-TAB' in other modes. + +++ ** New optional argument for modifying directory-local variables. The commands 'add-dir-local-variable', 'delete-dir-local-variable' and commit e6535e41027662238e89591e6620e92b496c90b2 Author: Eli Zaretskii Date: Sat Apr 6 11:15:36 2024 -0400 ; Commit autogenerated files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index b434ee0e37f..8f9b11e3df1 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -1453,7 +1453,19 @@ point is moved into the passwords (see `authinfo-hide-elements'). \\{authinfo-mode-map} (fn)" t) -(register-definition-prefixes "auth-source" '("auth")) +(autoload 'read-passwd "auth-source" "\ +Read a password, prompting with PROMPT, and return it. +If optional CONFIRM is non-nil, read the password twice to make sure. +Optional DEFAULT is a default password to use instead of empty input. + +This function echoes `*' for each character that the user types. +You could let-bind `read-hide-char' to another hiding character, though. + +Once the caller uses the password, it can erase the password +by doing (clear-string STRING). + +(fn PROMPT &optional CONFIRM DEFAULT)") +(register-definition-prefixes "auth-source" '("auth" "read-passwd-")) ;;; Generated autoloads from auth-source-pass.el @@ -2452,8 +2464,8 @@ The variables `browse-url-browser-function', `browse-url-handlers', and `browse-url-default-handlers' determine which browser function to use. -This command prompts for a URL, defaulting to the URL at or -before point. +Interactively, this command prompts for a URL, defaulting to the +URL at or before point. The additional ARGS are passed to the browser function. See the doc strings of the actual functions, starting with @@ -2461,7 +2473,9 @@ doc strings of the actual functions, starting with significance of ARGS (most of the functions ignore it). If ARGS are omitted, the default is to pass -`browse-url-new-window-flag' as ARGS. +`browse-url-new-window-flag' as ARGS. Interactively, pass the +prefix arg as ARGS; if `browse-url-new-window-flag' is non-nil, +invert the prefix arg instead. (fn URL &rest ARGS)" t) (autoload 'browse-url-at-point "browse-url" "\ @@ -2945,7 +2959,7 @@ Major mode for editing C, powered by tree-sitter. This mode is independent from the classic cc-mode.el based `c-mode', so configuration variables of that mode, like -`c-basic-offset', doesn't affect this mode. +`c-basic-offset', don't affect this mode. To use tree-sitter C/C++ modes by default, evaluate @@ -2954,7 +2968,7 @@ To use tree-sitter C/C++ modes by default, evaluate (add-to-list \\='major-mode-remap-alist \\='(c-or-c++-mode . c-or-c++-ts-mode)) -in your configuration. +in your init files. (fn)" t) (autoload 'c++-ts-mode "c-ts-mode" "\ @@ -2971,7 +2985,7 @@ To use tree-sitter C/C++ modes by default, evaluate (add-to-list \\='major-mode-remap-alist \\='(c-or-c++-mode . c-or-c++-ts-mode)) -in your configuration. +in your init files. Since this mode uses a parser, unbalanced brackets might cause some breakage in indentation/fontification. Therefore, it's @@ -2987,7 +3001,7 @@ matching on file name insufficient for detecting major mode that should be used. This function attempts to use file contents to determine whether -the code is C or C++ and based on that chooses whether to enable +the code is C or C++, and based on that chooses whether to enable `c-ts-mode' or `c++-ts-mode'." t) (make-obsolete 'c-or-c++-ts-mode 'c-or-c++-mode "30.1") (register-definition-prefixes "c-ts-mode" '("c-ts-")) @@ -5320,6 +5334,48 @@ The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG)" t) +(put 'global-completion-preview-mode 'globalized-minor-mode t) +(defvar global-completion-preview-mode nil "\ +Non-nil if Global Completion-Preview mode is enabled. +See the `global-completion-preview-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-completion-preview-mode'.") +(custom-autoload 'global-completion-preview-mode "completion-preview" nil) +(autoload 'global-completion-preview-mode "completion-preview" "\ +Toggle Completion-Preview mode in all buffers. +With prefix ARG, enable Global Completion-Preview mode if ARG is +positive; otherwise, disable it. + +If called from Lisp, toggle the mode if ARG is `toggle'. +Enable the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +Completion-Preview mode is enabled in all buffers where +`completion-preview-mode' would do it. + +See `completion-preview-mode' for more information on +Completion-Preview mode. + +`global-completion-preview-modes' is used to control which modes this +minor mode is used in. + +(fn &optional ARG)" t) +(defvar global-completion-preview-modes '((not minibuffer-mode special-mode) t) "\ +Which major modes `completion-preview-mode' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list.") +(custom-autoload 'global-completion-preview-modes "completion-preview" t) (register-definition-prefixes "completion-preview" '("completion-preview-")) @@ -13270,7 +13326,7 @@ For instance: (?l . \"ls\"))) Each %-spec may contain optional flag, width, and precision -modifiers, as follows: +specifiers, as follows: %character @@ -13283,7 +13339,7 @@ The following flags are allowed: * ^: Convert to upper case. * _: Convert to lower case. -The width and truncation modifiers behave like the corresponding +The width and precision specifiers behave like the corresponding ones in `format' when applied to %s. For example, \"%<010b\" means \"substitute into the output the @@ -15684,6 +15740,17 @@ Produce an nroff buffer containing the doc-strings from the DOC file. Produce a texinfo buffer with sorted doc-strings from the DOC file. (fn FILE)" t) +(autoload 'help-fns-function-name "help-fns" "\ +Return a short buttonized string representing FUNCTION. +The string is propertized with a button; clicking on that +provides further details about FUNCTION. +FUNCTION can be a function, a built-in, a keyboard macro, +or a compile function. +This function is intended to be used to display various +callable symbols in buffers in a way that allows the user +to find out more details about the symbols. + +(fn FUNCTION)") (register-definition-prefixes "help-fns" '("describe-" "help-" "keymap-name-history")) @@ -15696,6 +15763,10 @@ window listing and describing the options. A value of nil means skip the middle step, so that \\[help-command] \\[help-command] gives the window that lists the options.") (custom-autoload 'three-step-help "help-macro" t) +(autoload 'help--help-screen "help-macro" "\ + + +(fn HELP-LINE HELP-TEXT HELPED-MAP BUFFER-NAME)") (register-definition-prefixes "help-macro" '("make-help-screen")) @@ -15810,10 +15881,10 @@ Provide help for current mode." t) ;;; Generated autoloads from hexl.el (autoload 'hexl-mode "hexl" "\ -\\A mode for editing binary files in hex dump format. -This is not an ordinary major mode; it alters some aspects +A mode for editing binary files in hex dump format. +\\This is not an ordinary major mode; it alters some aspects of the current mode's behavior, but not all; also, you can exit -Hexl mode and return to the previous mode using `hexl-mode-exit'. +Hexl mode and return to the previous mode using \\[hexl-mode-exit]. This function automatically converts a buffer into the hexl format using the function `hexlify-buffer'. @@ -19132,7 +19203,7 @@ Major mode for editing JSON, powered by tree-sitter. ;;; Generated autoloads from jsonrpc.el -(push (purecopy '(jsonrpc 1 0 24)) package--builtin-versions) +(push (purecopy '(jsonrpc 1 0 25)) package--builtin-versions) (register-definition-prefixes "jsonrpc" '("jsonrpc-")) @@ -29970,24 +30041,6 @@ For example: to sort lines in the region by the first word on each line RECORD-REGEXP would be \"^.*$\" and KEY would be \"\\\\=\\\" (fn REVERSE RECORD-REGEXP KEY-REGEXP BEG END)" t) -(autoload 'sort-on "sort" "\ -Sort SEQUENCE by calling PREDICATE on sort keys produced by ACCESSOR. -SEQUENCE should be the input sequence to sort. -Elements of SEQUENCE are sorted by keys which are obtained by -calling ACCESSOR on each element. ACCESSOR should be a function of -one argument, an element of SEQUENCE, and should return the key -value to be compared by PREDICATE for sorting the element. -PREDICATE is the function for comparing keys; it is called with two -arguments, the keys to compare, and should return non-nil if the -first key should sort before the second key. -The return value is always a new list. -This function has the performance advantage of evaluating -ACCESSOR only once for each element in the input SEQUENCE, and is -therefore appropriate when computing the key by ACCESSOR is an -expensive operation. This is known as the \"decorate-sort-undecorate\" -paradigm, or the Schwartzian transform. - -(fn SEQUENCE PREDICATE ACCESSOR)") (autoload 'sort-columns "sort" "\ Sort lines in region alphabetically by a certain range of columns. For the purpose of this command, the region BEG...END includes @@ -33382,7 +33435,7 @@ Add archive file name handler to `file-name-handler-alist'." (when (and tramp-ar ;;; Generated autoloads from transient.el -(push (purecopy '(transient 0 5 2)) package--builtin-versions) +(push (purecopy '(transient 0 6 0)) package--builtin-versions) (autoload 'transient-insert-suffix "transient" "\ Insert a SUFFIX into PREFIX before LOC. PREFIX is a prefix command, a symbol. @@ -37830,6 +37883,11 @@ run a specific program. The program must be a member of (register-definition-prefixes "tramp-androidsu" '("tramp-androidsu-")) + +;;; Generated autoloads from progmodes/peg.el + +(push (purecopy '(peg 1 0 1)) package--builtin-versions) +(register-definition-prefixes "peg" '("bob" "bol" "bos" "bow" "define-peg-rule" "eob" "eol" "eos" "eow" "fail" "null" "peg" "with-peg-rules")) ;;; End of scraped data @@ -37838,8 +37896,8 @@ run a specific program. The program must be a member of ;; Local Variables: ;; version-control: never ;; no-update-autoloads: t -;; no-native-compile: t ;; no-byte-compile: t +;; no-native-compile: t ;; coding: utf-8-emacs-unix ;; End: commit b4864ca4affe6527b5958214ef2aa7198eb09220 Merge: 7aea688ee93 3d87d74a23d Author: Eli Zaretskii Date: Sat Apr 6 11:13:35 2024 -0400 Merge from origin/emacs-29 3d87d74a23d ; * etc/PROBLEMS: Entry about slow mouse-wheel with GTK3 ... c6899603b9c ; * doc/lispref/tips.texi (Documentation Tips): Improve (... bd2c4d825db ; Update admin/make-tarball.txt f107dc26e37 ; * etc/PROBLEMS: Add an entry about WebKitGTK (bug#66068). commit 7aea688ee93cc9ce9f8a8bdd5837414bcf250c37 Merge: 5f89da1423b 305e35b2d87 Author: Eli Zaretskii Date: Sat Apr 6 11:13:35 2024 -0400 ; Merge from origin/emacs-29 The following commit was skipped: 305e35b2d87 Adapt Tramp versio (don't merge) commit 5f89da1423bfa17717c2237130bc9a6ff1a57394 Merge: eaec6cc3d7c 46b8746b38e Author: Eli Zaretskii Date: Sat Apr 6 11:13:34 2024 -0400 Merge from origin/emacs-29 46b8746b38e Fix warning-suppress for list type "warning type" 910ea5f1e55 Make object init more robust (bug#69571) commit eaec6cc3d7cc247377524225f2a51407a4cb20c7 Author: Eli Zaretskii Date: Sat Apr 6 13:43:50 2024 +0300 ; Minor fixes of doc strings referencing keymaps. * lisp/edmacro.el (edmacro-mode): * lisp/info.el (Info-mouse-follow-nearest-node): Move the reference to mode keymap from the first line. (Bug#70163) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index abfc380d154..b7435edaa31 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -460,8 +460,8 @@ of a line, that final line is excluded." (goto-char final-position))) (defun edmacro-mode () - "\\Keyboard Macro Editing mode. Press \ -\\[edmacro-finish-edit] to save and exit. + "Keyboard Macro Editing mode. +\\Press \\[edmacro-finish-edit] to save and exit. To abort the edit, just kill this buffer with \\[kill-buffer] \\`RET'. Press \\[edmacro-insert-key] to insert the name of any key by typing the key. diff --git a/lisp/info.el b/lisp/info.el index 1e478cdbee9..901f0384c62 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4063,8 +4063,8 @@ ERRORSTRING optional fourth argument, controls action on no match: (error "No %s around position %d" errorstring pos)))))))) (defun Info-mouse-follow-nearest-node (click) - "\\Follow a node reference near point. -Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where you click. + "Follow a node reference near point. +\\Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where you click. At end of the node's text, moves to the next node, or up if none." (interactive "e" Info-mode) (mouse-set-point click) commit 73569eb957e47e99d8181950afd7977a1ffa1acc Author: Eli Zaretskii Date: Sat Apr 6 13:31:06 2024 +0300 ; * INSTALL: Mention installation without root access (bug#70071). diff --git a/INSTALL b/INSTALL index 2aaa02f37d7..90ae622f340 100644 --- a/INSTALL +++ b/INSTALL @@ -59,6 +59,15 @@ sections if you need to. where SOURCE-DIR is the top-level Emacs source directory. + 2c. If you don't have write access to the default directory where + Emacs and its data files will be installed, specify an alternative + installation directory: + + ./configure --prefix=/SOME/OTHER/DIRECTORY + + where /SOME/OTHER/DIRECTORY is a directory writeable by your user, + for example, a subdirectory of your home directory. + 3. When 'configure' finishes, it prints several lines of details about the system configuration. Read those details carefully looking for anything suspicious, such as wrong CPU and operating @@ -440,6 +449,12 @@ should put emacs and its data files. This defaults to '/usr/local'. (where CONFIGURATION is the configuration name, like i686-pc-linux-gnu), unless the '--exec-prefix' option says otherwise. +If you don't have write access to the default '/usr/local' tree, and +cannot have root access (without which "make install" will fail), +specify '--prefix=PREFIXDIR' where PREFIXDIR is a directyory writeable +by your user, for example your HOME directory or some subdirectory of +it. + The '--exec-prefix=EXECDIR' option allows you to specify a separate portion of the directory tree for installing architecture-specific files, like executables and utility programs. If specified, commit fab58ffc224de5e4e20ce7ea19f06ed33a036129 Author: Eli Zaretskii Date: Sat Apr 6 13:13:27 2024 +0300 ; * doc/lispref/commands.texi (Focus Events): Fix markup of last change. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 335a41dbb44..ea6e84e3730 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2324,7 +2324,7 @@ sequence---that is, after a prefix key---then Emacs reorders the events so that the focus event comes either before or after the multi-event key sequence, and not within it. -@heading Focus events for frames +@subsubheading Focus events for frames The normal definition of a focus event that switches frames, in the global keymap, is to select that new frame within Emacs, as the user @@ -2347,7 +2347,7 @@ actually types a keyboard key or presses a mouse button in the new frame; just moving the mouse between frames does not generate a focus event. -@heading Focus events for windows +@subsubheading Focus events for windows When @var{mouse-autoselect-window} is set, moving the mouse over a new window within a frame can also switch the selected window. @xref{Mouse commit 9260904072d01e4b0f585825bfbc077310c8a974 Author: Jared Finder Date: Sat Mar 30 13:14:43 2024 -0700 Add documentation for 'switch-window' event * doc/lispref/commands.texi (Focus Events): Add documentation for the structure of 'switch-window' events. Make sure to be clear when referring to window system windows vs Emacs windows. * doc/lispref/windows.texi (Mouse Window Auto-selection): Adding cross-reference to "Focus Events". (Bug#69915) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 4fe4969c0db..335a41dbb44 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2303,15 +2303,34 @@ touch sequence after it is called. @subsection Focus Events @cindex focus event +This section talks about both window systems and Emacs frames. When +talking about just ``frames'' or ``windows'', it refers to Emacs frames +and Emacs windows. When talking about window system windows, which are +also Emacs frames, this section always says ``window system window''. + +@noindent Window systems provide general ways for the user to control which window -gets keyboard input. This choice of window is called the @dfn{focus}. -When the user does something to switch between Emacs frames, that -generates a @dfn{focus event}. The normal definition of a focus event, -in the global keymap, is to select a new frame within Emacs, as the user -would expect. @xref{Input Focus}, which also describes hooks related -to focus events. +system window, or Emacs frame, gets keyboard input. This choice of +window system window is called the @dfn{focus}. When the user does +something to switch between Emacs frames, that generates a @dfn{focus +event}. Emacs also generates focus events when using +@var{mouse-autoselect-window} to switch between Emacs windows within +Emacs frames. + +A focus event in the middle of a key sequence would garble the +sequence. So Emacs never generates a focus event in the middle of a key +sequence. If the user changes focus in the middle of a key +sequence---that is, after a prefix key---then Emacs reorders the events +so that the focus event comes either before or after the multi-event key +sequence, and not within it. -Focus events are represented in Lisp as lists that look like this: +@heading Focus events for frames + +The normal definition of a focus event that switches frames, in the +global keymap, is to select that new frame within Emacs, as the user +would expect. @xref{Input Focus}, which also describes hooks related to +focus events for frames. Focus events for frames are represented in +Lisp as lists that look like this: @example (switch-frame @var{new-frame}) @@ -2321,19 +2340,28 @@ Focus events are represented in Lisp as lists that look like this: where @var{new-frame} is the frame switched to. Some X window managers are set up so that just moving the mouse into a -window is enough to set the focus there. Usually, there is no need -for a Lisp program to know about the focus change until some other -kind of input arrives. Emacs generates a focus event only when the -user actually types a keyboard key or presses a mouse button in the -new frame; just moving the mouse between frames does not generate a -focus event. +frame is enough to set the focus there. Usually, there is no need for a +Lisp program to know about the focus change until some other kind of +input arrives. Emacs generates a focus event only when the user +actually types a keyboard key or presses a mouse button in the new +frame; just moving the mouse between frames does not generate a focus +event. -A focus event in the middle of a key sequence would garble the -sequence. So Emacs never generates a focus event in the middle of a key -sequence. If the user changes focus in the middle of a key -sequence---that is, after a prefix key---then Emacs reorders the events -so that the focus event comes either before or after the multi-event key -sequence, and not within it. +@heading Focus events for windows + +When @var{mouse-autoselect-window} is set, moving the mouse over a new +window within a frame can also switch the selected window. @xref{Mouse +Window Auto-selection}, which describes the behavior for different +values. When the mouse is moved over a new window, a focus event for +switching windows is generated. Focus events for windows are +reperesented in Lisp as lists that look like this: + +@example +(select-window @var{new-window}) +@end example + +@noindent +where @var{new-window} is the window switched to. @node Xwidget Events @subsection Xwidget events diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index b2c1b79780d..104420235df 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6207,7 +6207,7 @@ The following option enables automatically selecting the window under the mouse pointer. This accomplishes a policy similar to that of window managers that give focus to a frame (and thus trigger its subsequent selection) whenever the mouse pointer enters its -window-system window (@pxref{Input Focus}). +window-system window (@pxref{Input Focus}, @pxref{Focus Events}). @defopt mouse-autoselect-window If this variable is non-@code{nil}, Emacs will try to automatically commit abe39d57889cf354add083681d438d79ab28b662 Author: Olaf Rogalsky Date: Sat Mar 30 17:00:51 2024 +0100 Support 'mouse-autoselect-window' in xterm-mouse Generate select-window events, so that 'mouse-autoselect-window' takes effect on TTY frames, when 'xterm-mouse-mode' is enabled. * lisp/xt-mouse.el (xterm-mouse-translate-1): If 'mouse-autoselect-window' is non-nil, add select-window events to 'unread-command-events'. (Bug#69915) diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 081b8f32456..783718b4ba4 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -60,7 +60,9 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (let* ((event (xterm-mouse-event extension)) (ev-command (nth 0 event)) (ev-data (nth 1 event)) + (ev-window (nth 0 ev-data)) (ev-where (nth 1 ev-data)) + (last-window (terminal-parameter nil 'xterm-mouse-last-window)) (vec (vector event)) (is-move (eq 'mouse-movement ev-command)) (is-down (string-match "down-" (symbol-name ev-command)))) @@ -73,6 +75,9 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." 'mouse-movement 'mouse-click))) + ;; remember window of current mouse position + (set-terminal-parameter nil 'xterm-mouse-last-window ev-window) + (cond ((null event) nil) ;Unknown/bogus byte sequence! (is-down @@ -84,10 +89,22 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." vec) (is-move (xterm-mouse--handle-mouse-movement) - (if track-mouse vec - ;; Mouse movement events are currently supposed to be - ;; suppressed. Return no event. - [])) + ;; after mouse movement autoselect the mouse window, but ... + (cond ((and mouse-autoselect-window + ;; ignore modeline, tab-bar, menu-bar and so forth ... + (windowp ev-window) + ;; and don't deselect the minibuffer ... + (not (window-minibuffer-p (selected-window))) + ;; and select only, if mouse is over a new window ... + (not (eq ev-window last-window)) + ;; which is different from the selected window + (not (eq ev-window (selected-window)))) + (put 'select-window 'event-kind 'switch-frame) + (push `(select-window (,ev-window)) unread-command-events) + []) + ;;(vector `(select-window (,ev-window)))) + (track-mouse vec) + (t []))) (t (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) (down-data (nth 1 down)) commit 3d87d74a23d13e853f202cc589eb750c40f9e2be Author: Eli Zaretskii Date: Sat Apr 6 12:14:26 2024 +0300 ; * etc/PROBLEMS: Entry about slow mouse-wheel with GTK3 (bug#70002). diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 642c3d0169e..16521e257dd 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2069,6 +2069,16 @@ For such programs to function again, Emacs must be run on an X server where the input extension is disabled, or alternatively be configured with the "--without-xinput2" option. +*** Scrolling with mouse-wheel lags in GTK3 builds. + +We don't know why this happens, but one workaround is to build Emacs +with a different toolkit. For example: + + ./configure --without-toolkit-scroll-bars --with-x-toolkit=athena + +This produces a build which uses Athena toolkit, and disables toolkit +scroll bars which could sometimes be slow. + * Runtime problems on character terminals ** The meta key does not work on xterm. commit c6899603b9c2e5de590ecfd6397a7125d1dab08b Author: Eli Zaretskii Date: Thu Apr 4 16:28:31 2024 +0300 ; * doc/lispref/tips.texi (Documentation Tips): Improve (bug#70163). diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index d538f416740..ae8b9c0c0ba 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -834,13 +834,15 @@ it substitutes whatever key is currently bound to @code{forward-char}. user has moved key bindings.) @xref{Keys in Documentation}. @item -In documentation strings for a major mode, you will want to refer to the -key bindings of that mode's local map, rather than global ones. +In documentation strings for a major mode, you will want to refer to +the key bindings of that mode's local map, rather than global ones. Therefore, use the construct @samp{\\<@dots{}>} once in the documentation string to specify which key map to use. Do this before -the first use of @samp{\\[@dots{}]}. The text inside the -@samp{\\<@dots{}>} should be the name of the variable containing the -local keymap for the major mode. +the first use of @samp{\\[@dots{}]}, and not in the middle of a +sentence (since if the map is not loaded, the reference to the map +will be replaced with a sentence saying the map is not currently +defined). The text inside the @samp{\\<@dots{}>} should be the name +of the variable containing the local keymap for the major mode. Each use of @samp{\\[@dots{}]} slows the display of the documentation string by a tiny amount. If you use a lot of them, these tiny commit bd2c4d825db69eeb592102edff9e3afb69c5a231 Author: Eli Zaretskii Date: Thu Apr 4 15:23:49 2024 +0300 ; Update admin/make-tarball.txt * admin/make-tarball.txt: Add text about preparing bundled packages for an emergency release. Suggested by Michael Albinus . diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 5704e8e8922..9d3de2fa201 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -27,6 +27,13 @@ Steps to take before starting on the first pretest in any release sequence: file against the previously released Emacs version to see what has changed. +5. If this is an emergency release without a prior pretest, inform the + maintainers of the bundled packages which are developed separately + to make sure they install adjustments required for an official + release. Currently, these packages include: + + . Tramp + General steps (for each step, check for possible errors): 1. git pull # fetch from the repository commit f107dc26e37c7cc24b158b5dfd21b4fd8eb145f2 Author: Eli Zaretskii Date: Mon Apr 1 15:24:47 2024 +0300 ; * etc/PROBLEMS: Add an entry about WebKitGTK (bug#66068). diff --git a/etc/PROBLEMS b/etc/PROBLEMS index b4df40f5d8e..642c3d0169e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -178,6 +178,32 @@ The relevant bug report is here: A workaround is to set XLIB_SKIP_ARGB_VISUALS=1 in the environment before starting Emacs, or run Emacs as root. +** Emacs built with xwidgets aborts when displaying WebKit xwidgets + +This happens, for example, when 'M-x xwidget-webkit-browse-url' +prompts for a URL and you type the URL at the prompt. + +The error message might look like this: + + X protocol error: GLXBadWindow on protocol request 151 + Serial no: 4286 + Failing resource ID (if any): 0x3c001c5 + Minor code: 32 + +This happens because starting from version 2.42.1, the WebKitGTK +developers discontinued support for off-screen windows, by presuming +that every window holding a WebView widget is an X server window +eligible for an OpenGL context. Emacs requires placing these widgets +within offscreen windows managed by GTK, for each xwidget might be +displayed in multiple distinct windows, and its contents must be +captured and reproduced within all of them if that be the case. + +To put this another way, WebKitGTK doesn't support displaying a single +widget more than once anymore. + +A possible workaround is to make sure xwidgets are not shown in more +than one window. + ** Emacs crashes with SIGTRAP when trying to start a WebKit xwidget. This could happen if the version of WebKitGTK installed on your system commit 305e35b2d871fdf86e7a349443fc4507d540e11e Author: Michael Albinus Date: Sun Mar 31 14:13:14 2024 +0200 Adapt Tramp versio (don't merge) * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.6.3". (customize-package-emacs-version-alist): Adapt Tramp version integrated in Emacs 29.3. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 956d055fdaf..fcbcab60bc7 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -7,7 +7,7 @@ @c In the Tramp GIT, the version number and the bug report address @c are auto-frobbed from configure.ac. -@set trampver 2.6.3-pre +@set trampver 2.6.3 @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 26.1 diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 1647960ef0e..c7e3e6eafc0 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.6.3-pre +;; Version: 2.6.3 ;; Package-Requires: ((emacs "26.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.6.3-pre" +(defconst tramp-version "2.6.3" "This version of Tramp.") ;;;###tramp-autoload @@ -78,7 +78,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-version-lessp emacs-version "26.1")) "ok" - (format "Tramp 2.6.3-pre is not fit for %s" + (format "Tramp 2.6.3 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) @@ -105,7 +105,7 @@ ("2.3.5.26.3" . "26.3") ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2") ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2") ("2.5.4" . "28.3") - ("2.6.0.29.1" . "29.1") ("2.6.2.29.2" . "29.2"))) + ("2.6.0.29.1" . "29.1") ("2.6.2.29.2" . "29.2") ("2.6.3-pre" . "29.3"))) (add-hook 'tramp-unload-hook (lambda () commit 46b8746b38e26ae3f216f57f231f5fc8aec22873 Author: Xuan Wang Date: Thu Mar 28 20:34:23 2024 -0400 Fix warning-suppress for list type "warning type" Per the documentation of 'warning-suppress-types' and the implementation of 'warning-suppress-p', a warning type can be either a symbol or a list of symbols. The previous implementation could generate wrong 'warning-suppress-types': old behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '(((pkg subtype))) Incorrect Now we check whether type is a cons cell first. (Should not use listp here, as listp returns t for nil.) new behavior: type warning-suppress-types pkg -> '((pkg)) Correct (pkg subtype) -> '((pkg subtype)) Correct * lisp/emacs-lisp/warnings.el (warnings-suppress): Fix saving warning types in 'warning-suppress-types'. (Bug#70063) Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 61aa0a2fe22..9bed714aa11 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -224,10 +224,14 @@ SUPPRESS-LIST is the list of kinds of warnings to suppress." (?q "quit and do nothing")))) (?y (customize-save-variable 'warning-suppress-log-types - (cons (list type) warning-suppress-log-types))) + (if (consp type) + (cons type warning-suppress-log-types) + (cons (list type) warning-suppress-log-types)))) (?n (customize-save-variable 'warning-suppress-types - (cons (list type) warning-suppress-types))) + (if (consp type) + (cons type warning-suppress-types) + (cons (list type) warning-suppress-types)))) (_ (message "Exiting")))) ;;;###autoload commit 910ea5f1e55793fa29292730a59397867b4e868f Author: Theodor Thornhill Date: Sun Mar 31 10:43:44 2024 +0200 Make object init more robust (bug#69571) * lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Make the regex same as before, but conditionally check other heuristics rather than crazy regex shenanigans. diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 2740d34e3b2..607360f737a 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -500,7 +500,15 @@ compilation and evaluation time conflicts." ;; Also, deal with the possible end of line obscured by a ;; trailing comment. (goto-char (c-point 'iopl)) - (looking-at "^[^//]*new[^//]*;$"))) + (when (looking-at-p ".*new.*") + (if (re-search-forward ";" (pos-eol) t 1) + ;; If the ';' is inside a comment, the statement hasn't + ;; likely ended, so we should accept as object init. + ;; Example: + ;; var x = new // This should return true ; + ;; var x = new(); // This should return false ; + (nth 4 (syntax-ppss (point))) + t)))) ;; Line should not already be terminated (save-excursion (goto-char (c-point 'eopl)) diff --git a/test/lisp/progmodes/csharp-mode-resources/indent.erts b/test/lisp/progmodes/csharp-mode-resources/indent.erts index a676ecc9728..e03ba80d709 100644 --- a/test/lisp/progmodes/csharp-mode-resources/indent.erts +++ b/test/lisp/progmodes/csharp-mode-resources/indent.erts @@ -16,4 +16,82 @@ public class Foo { } // [2] } } + +public class Foo { + void Bar () { + var x = new X(); + for (;;) { + x(); + } // [2] + } +} + +public class Foo { + void Bar () { + var x = new X() + { + var b = 3; + }; + for (;;) { + x(); + } // [2] + } +} + +public class Foo { + void Bar () { + var x = new X() // Hello + { + var b = 3; + }; + for (;;) { + x(); + } // [2] + } +} + +public class Foo { + void Bar () { + var x = new X() // Hello ; + { + var b = 3; + }; + for (;;) { + x(); + } // [2] + } +} + +public class Foo { + void Bar () { + var x = new X // Hello ; + { + var b = 3; + }; + for (;;) { + x(); + } // [2] + } +} + +public class Foo { + void Bar () { + var x = new X(); // Hello ; + for (;;) { + x(); + } // [2] + } +} + +public class Foo +{ + void Bar () + { + var x = new X(); // Hello ; + for (;;) + { + x(); + } // [2] + } +} =-=-=