commit f79354460d3bef4a3f859f78c6cc77738437d670 (HEAD, refs/remotes/origin/master) Author: Gerd Möllmann Date: Tue Mar 11 07:22:12 2025 +0100 ; Remove TODO item for writing to the bottom-right corner on TTYs diff --git a/etc/TODO b/etc/TODO index 1900cd5b159..ecd3bc6ded4 100644 --- a/etc/TODO +++ b/etc/TODO @@ -1806,12 +1806,6 @@ https://lists.gnu.org/r/emacs-devel/2012-06/msg00354.html It wouldn't have to be a complete replacement, just enough for vc-rcs-update-changelog. -** Allow Emacs to use the bottom-right corner of a TTY -Emacs doesn't use the bottom-right corner of a TTY when terminfo -capability "am" (auto_right_margin) is defined. It could use the -bottom-right corner nonetheless when certain other capabilities are -defined. See bug#57607. - ** Replace tramp-archive.el by a native libarchive(3) implementation. The former is based on the GVFS archive backend, which makes it available on GNU/Linux only. That implementation has further commit f6a56ddb5dd84c9984d49c9c223e043844ae47ae Author: Po Lu Date: Tue Mar 11 10:14:30 2025 +0800 ; * src/android.c (android_rewrite_spawn_argv): Fix typo. diff --git a/src/android.c b/src/android.c index 6a6996a438b..0be3e10dea4 100644 --- a/src/android.c +++ b/src/android.c @@ -7426,7 +7426,7 @@ android_rewrite_spawn_argv (const char ***argv) /* Allocate a buffer in which to save the rewritten argument array. */ - if (n_new_args != nargs) + if (n_new_args != nargs + 2) { new_args = xrealloc (new_args, sizeof *new_args * (nargs + 3)); n_new_args = nargs + 2; commit 672df0288b55f8bb7ebacdce5335f9e11955482e Author: Stefan Kangas Date: Tue Mar 11 01:15:41 2025 +0100 Bump python.el package version to 0.30 * lisp/progmodes/python.el: Bump package version to 0.30. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9dd7b2eb760..741b94e187b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5,7 +5,7 @@ ;; Author: Fabián E. Gallina ;; Maintainer: emacs-devel@gnu.org ;; URL: https://github.com/fgallina/python.el -;; Version: 0.29 +;; Version: 0.30 ;; Package-Requires: ((emacs "29.1") (compat "29.1.1.0") (seq "2.23") (project "0.1") (flymake "1.0")) ;; Created: Jul 2010 ;; Keywords: languages commit 46f9ebaec309e45d4a1a19d1a5e69eab881d54e9 Author: Stefan Kangas Date: Tue Mar 11 01:14:35 2025 +0100 Make python.el compatible with Emacs 29.1 * lisp/progmodes/python.el (python--treesit-fontify-string): Don't call treesit--compute-font-lock-level unless it is fboundp. (Bug#76873) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fa9dd636f1d..9dd7b2eb760 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1108,11 +1108,14 @@ fontified." 'font-lock-doc-face 'font-lock-string-face)) - (ignore-interpolation (not - (seq-some - (lambda (feats) (memq 'string-interpolation feats)) - (seq-take treesit-font-lock-feature-list - (treesit--compute-font-lock-level treesit-font-lock-level))))) + (ignore-interpolation + (not (seq-some + (lambda (feats) (memq 'string-interpolation feats)) + (seq-take treesit-font-lock-feature-list + (if (fboundp 'treesit--compute-font-lock-level) + (treesit--compute-font-lock-level + treesit-font-lock-level) + treesit-font-lock-level))))) ;; If interpolation is enabled, highlight only ;; string_start/string_content/string_end children. Do not ;; touch interpolation node that can occur inside of the commit 8ea65ac642c5ae29610ef6a14f852953821dee45 Author: Stefan Kangas Date: Tue Mar 11 01:01:33 2025 +0100 ; Temporarily disable proced tests on macOS (Bug#76898) * test/lisp/proced-tests.el (proced-format-test, proced-update-test) (proced-revert-test, proced-color-test): Disable tests on macOS. diff --git a/test/lisp/proced-tests.el b/test/lisp/proced-tests.el index ecf23c5d037..6dc05acbf75 100644 --- a/test/lisp/proced-tests.el +++ b/test/lisp/proced-tests.el @@ -87,6 +87,7 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'." #'proced--assert-process-valid-cpu-refinement-explainer) (ert-deftest proced-format-test () + (skip-when (eq system-type 'darwin)) ; Bug#76898 (dolist (format '(short medium long verbose)) (proced--within-buffer format @@ -94,6 +95,7 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'." (proced--assert-emacs-pid-in-buffer)))) (ert-deftest proced-update-test () + (skip-when (eq system-type 'darwin)) ; Bug#76898 (proced--within-buffer 'short 'user @@ -101,6 +103,7 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'." (proced--assert-emacs-pid-in-buffer))) (ert-deftest proced-revert-test () + (skip-when (eq system-type 'darwin)) ; Bug#76898 (proced--within-buffer 'short 'user @@ -108,6 +111,7 @@ CPU is as in `proced--assert-process-valid-cpu-refinement'." (proced--assert-emacs-pid-in-buffer))) (ert-deftest proced-color-test () + (skip-when (eq system-type 'darwin)) ; Bug#76898 (let ((proced-enable-color-flag t)) (proced--within-buffer 'short commit 1393b71c2ce05128200350a0b6e4da930794f438 Author: Stefan Kangas Date: Tue Mar 11 00:51:43 2025 +0100 Prefer defvar-keymap in some additional Gnus libraries * lisp/gnus/gnus-sum.el (gnus-dead-summary-mode-map): * lisp/gnus/gnus.el (gnus-article-mode-map) (gnus-summary-mode-map, gnus-group-mode-map): * lisp/gnus/mm-decode.el (mm-viewer-completion-map): Prefer defvar-keymap. * lisp/gnus/gnus.el (gnus-suppress-keymap): Declare obsolete. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d484d16ba95..fa909cc93f4 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -7323,15 +7323,17 @@ The state which existed when entering the ephemeral is reset." ;;; Dead summaries. -(defvar gnus-dead-summary-mode-map - (let ((map (make-keymap))) - (suppress-keymap map) - (substitute-key-definition 'undefined 'gnus-summary-wake-up-the-dead map) - (dolist (key '("\C-d" "\r" "\177" [delete])) - (define-key map key 'gnus-summary-wake-up-the-dead)) - (dolist (key '("q" "Q")) - (define-key map key 'bury-buffer)) - map)) +(defvar-keymap gnus-dead-summary-mode-map + :full t :suppress t + "C-d" #'gnus-summary-wake-up-the-dead + "RET" #'gnus-summary-wake-up-the-dead + "DEL" #'gnus-summary-wake-up-the-dead + "" #'gnus-summary-wake-up-the-dead + "q" #'bury-buffer + "Q" #'bury-buffer) + +(keymap-substitute gnus-dead-summary-mode-map + 'undefined 'gnus-summary-wake-up-the-dead) (define-minor-mode gnus-dead-summary-mode "Minor mode for Gnus summary buffers." diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 6fad088a6c9..53b7c332ded 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2803,23 +2803,27 @@ See Info node `(gnus)Formatting Variables'." ;;; (defun gnus-suppress-keymap (keymap) + (declare (obsolete nil "31.1")) (suppress-keymap keymap) (let ((keys '([delete] "\177" "\M-u"))) ;[mouse-2] (while keys (define-key keymap (pop keys) 'undefined)))) -(defvar gnus-article-mode-map - (let ((keymap (make-sparse-keymap))) - (gnus-suppress-keymap keymap) - keymap)) -(defvar gnus-summary-mode-map - (let ((keymap (make-keymap))) - (gnus-suppress-keymap keymap) - keymap)) -(defvar gnus-group-mode-map - (let ((keymap (make-keymap))) - (gnus-suppress-keymap keymap) - keymap)) +(defvar-keymap gnus-article-mode-map + :suppress t + "" #'undefined + "DEL" #'undefined + "M-u" #'undefined) +(defvar-keymap gnus-summary-mode-map + :full t :suppress t + "" #'undefined + "DEL" #'undefined + "M-u" #'undefined) +(defvar-keymap gnus-group-mode-map + :full t :suppress t + "" #'undefined + "DEL" #'undefined + "M-u" #'undefined) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 8273c48ff97..87acd4dd515 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -536,13 +536,11 @@ result of the verification." (item :tag "ask" nil)) :group 'mime-security) -(defvar mm-viewer-completion-map - (let ((map (make-sparse-keymap 'mm-viewer-completion-map))) - (set-keymap-parent map minibuffer-local-completion-map) - ;; Should we bind other key to minibuffer-complete-word? - (define-key map " " 'self-insert-command) - map) - "Keymap for input viewer with completion.") +(defvar-keymap mm-viewer-completion-map + :doc "Keymap for input viewer with completion." + :parent minibuffer-local-completion-map + ;; Should we bind other key to minibuffer-complete-word? + "SPC" #'self-insert-command) ;;; The functions. commit 4980089960ab467ad00fb2b3369b26f477cb0186 Author: Stefan Monnier Date: Mon Mar 10 15:47:58 2025 -0400 lisp/emacs-lisp/track-changes.el: Make GNU ELPA release diff --git a/lisp/emacs-lisp/track-changes.el b/lisp/emacs-lisp/track-changes.el index 1ac7feb3b77..b0d753e1cbd 100644 --- a/lisp/emacs-lisp/track-changes.el +++ b/lisp/emacs-lisp/track-changes.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2024-2025 Free Software Foundation, Inc. ;; Author: Stefan Monnier -;; Version: 1.2 +;; Version: 1.3 ;; Package-Requires: ((emacs "24")) ;; This file is part of GNU Emacs. @@ -76,7 +76,12 @@ ;;; News: -;; Since v1.1: +;; v1.3: +;; +;; - Fix bug#73041. +;; - New `trace' setting for `track-changes-record-errors'. +;; +;; v1.2: ;; ;; - New function `track-changes-inconsistent-state-p'. commit bab17c7fb5161d3ed4820bf51d0cec6ee1cbb525 Author: Stefan Kangas Date: Mon Mar 10 20:33:47 2025 +0100 ; Add comment to explain recent change * lisp/vc/log-edit.el (log-edit-font-lock-keywords): Add comment to explain recent change. Proposed by Eli Zaretskii . Ref: https://lists.gnu.org/r/emacs-devel/2025-03/msg00587.html diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 3eb614f6030..19994508ca7 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -458,8 +458,13 @@ The first subexpression is the actual text of the field.") 'log-edit-header) nil lax)) ("^\n" - (and (not (bound-and-true-p git-commit-mode)) - (progn (goto-char (match-end 0)) (1+ (match-end 0)))) nil + (and + ;; This fixes a bug with `git-commit-mode', a NonGNU ELPA package + ;; used by Magit. Without this check, we get a wrong display + ;; when `git-commit-major-mode' is set to `log-edit-mode'. + (not (bound-and-true-p git-commit-mode)) + (progn (goto-char (match-end 0)) (1+ (match-end 0)))) + nil (0 '( face log-edit-headers-separator display-line-numbers-disable t rear-nonsticky t)))) (log-edit--match-first-line (0 'log-edit-summary)))) commit fd4de89460e20a1bbe0229f2e8c125f9f33bb088 Author: Martin Rudalics Date: Mon Mar 10 18:42:00 2025 +0100 Fix setting dedicatedness of WINDOW in 'window--display-buffer' (Bug#76911) * lisp/window.el (window--display-buffer): Consult WINDOW's 'window-side' parameter in order to find out whether it is a side window (Bug#76911). diff --git a/lisp/window.el b/lisp/window.el index 4dbe4a9c4e3..1e8f4e323bc 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7690,7 +7690,8 @@ Return WINDOW if BUFFER and WINDOW are live." ;; Don't dedicate WINDOW if it is dedicated because it shows ;; BUFFER already or it is reused and is not a side window. ((or (window-dedicated-p window) - (and (eq type 'reuse) (not (eq (cdr alist-dedicated) 'side))))) + (and (eq type 'reuse) + (not (window-parameter window 'window-side))))) ;; Otherwise, if ALIST contains a 'dedicated' entry, use that ;; entry's value (which may be nil). (alist-dedicated commit 7a72589847107f26d0ebdc22f9cfa61962d02af4 Author: Po Lu Date: Mon Mar 10 20:43:02 2025 +0800 ; Fix compiler warning in html-ts-mode.el * lisp/textmodes/html-ts-mode.el (treesit-node-end) (treesit-node-start): Declare. diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index f6d20685ea3..5df489db3e7 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -125,6 +125,9 @@ Return nil if there is no name or if NODE is not a defun node." (treesit-search-subtree node "\\`tag_name\\'" nil nil 2) t))) +(declare-function treesit-node-end "treesit.c") +(declare-function treesit-node-start "treesit.c") + (defun html-ts-mode--outline-predicate (node) "Limit outlines to multi-line elements." (when (string-match-p "element" (treesit-node-type node)) commit 6d99b74ef7701f00ccf6fe76ba7dbcbde00e241a Author: Mauro Aranda Date: Mon Mar 10 07:45:21 2025 -0300 Fix Package name for cond-star * lisp/emacs-lisp/cond-star.el: Fix name. (Bug#76861) diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 7e21f74e2d2..7c4c1043948 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2024-2025 Free Software Foundation, Inc. ;; Maintainer: Richard Stallman -;; Package: emacs +;; Package: cond-star ;; Version: 1.0 ;; Package-Requires: ((emacs "24.3")) commit 442d16266ee1c83ab56809acb414ac7b41c56f42 Author: Harald Jörg Date: Mon Mar 10 11:40:10 2025 +0100 ; cperl-mode.el: Improve docstring cperl-fontify-trailer * lisp/progmodes/cperl-mode.el (cperl-fontify-trailer): Document that this setting also affects indentation (Bug#76868). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index e75cfd85c5f..388c47d2158 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -575,12 +575,12 @@ This way enabling/disabling of menu items is more correct." (defcustom cperl-fontify-trailer 'perl-code - "How to fontify text after an \"__END__\" or \"__DATA__\" token. -If \"perl-code\", treat as Perl code for fontification, and -examine for imenu entries. Use this setting if you have trailing -POD documentation, or for modules which use AutoLoad or -AutoSplit. If \"comment\", treat as comment, and do not look for -imenu entries." + "How to treat text after an \"__END__\" or \"__DATA__\" token. +If \"perl-code\", treat as Perl code for fontification, examine for +imenu entries, and indent according to Perl syntax. Use this setting if +you have trailing POD documentation, or for modules which use AutoLoad +or AutoSplit. If \"comment\", treat as comment, do not look for imenu +entries, and do not change indentation." :type '(choice (const perl-code) (const comment)) :version "30.1" commit 6d62a293aff9af73d5f53ba0c7f226f29c6e35a2 Author: Sean Whitton Date: Mon Mar 10 17:13:14 2025 +0800 vc-setup-buffer: Don't set current buffer as parent (bug#59457) * lisp/vc/vc-dispatcher.el (vc-setup-buffer): Don't set the current buffer as parent (bug#59457). diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 5ae8cbd6eaa..d7577da6c19 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -189,9 +189,12 @@ Another is that undo information is not kept." ;; Kill also this permanent local var in case the VC command that ;; created BUF was invoked from a different directory (bug#44698). (kill-local-variable 'file-local-variables-alist) - (setq-local vc-parent-buffer camefrom) - (setq-local vc-parent-buffer-name - (concat " from " (buffer-name camefrom))) + ;; If we are refreshing an existing view, + ;; don't throw away where we really came from (bug#59457). + (unless (eq camefrom (current-buffer)) + (setq-local vc-parent-buffer camefrom) + (setq-local vc-parent-buffer-name + (concat " from " (buffer-name camefrom)))) (setq default-directory olddir) (let ((buffer-undo-list t) (inhibit-read-only t)) commit e09a80143d5952b1d1d1ade2b0f2e217835e917d Author: Sean Whitton Date: Mon Mar 10 17:08:04 2025 +0800 vc-setup-buffer: Kill local file-local-variables-alist too * lisp/vc/vc-dispatcher.el (vc-setup-buffer): Kill file-local-variables-alist variable, too (bug#44698). * lisp/vc/vc.el (vc-log-internal-common): Don't call kill-all-local-variables here, that's vc-setup-buffer's job. diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 8d09c345bf4..5ae8cbd6eaa 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -186,6 +186,9 @@ Another is that undo information is not kept." ;; want any of its output to appear from now on. (when oldproc (delete-process oldproc))) (kill-all-local-variables) + ;; Kill also this permanent local var in case the VC command that + ;; created BUF was invoked from a different directory (bug#44698). + (kill-local-variable 'file-local-variables-alist) (setq-local vc-parent-buffer camefrom) (setq-local vc-parent-buffer-name (concat " from " (buffer-name camefrom))) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 9a58cd87990..bc96173d198 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2990,9 +2990,6 @@ Each function runs in the log output buffer without args.") rev-buff-func) (let (retval (buffer (get-buffer-create buffer-name))) (with-current-buffer buffer - ;; Ensure we drop any directory-local variables from the last - ;; directory from which a log buffer was generated (bug#44698). - (kill-all-local-variables 'kill-permanent) (setq-local vc-log-view-type type)) (setq retval (funcall backend-func backend buffer-name type files)) (with-current-buffer buffer commit cbad6215cf4fef826fa9c3600765a7c696872eaf Author: Martin Rudalics Date: Mon Mar 10 09:33:17 2025 +0100 Fix handling of frame position values * src/frame.c (tty_child_pos_param): Handle additional position values. New SIZE argument. (tty_child_frame_rect): Process size before position. (Fmake_terminal_frame): Do not store calculated size/position values in parameters to avoid that a negative absolute position is later interpreted as position relative to bottom/right edge of parent. (Fmodify_frame_parameters): For tty child frames process size before position values so the latter can take a new size into account. * src/frame.h: Adjust declaration of tty_child_pos_param. * src/gtkutil.c (xg_set_geometry): Handle negative frame position specifications. * src/msdos.c (IT_set_frame_parameters): For tty child frames process size before position parameters. * src/xfns.c (x_window): In the non-GTK toolkit variant leave negative position values unchanged - the toolkit should know how to handle them. Process child frame position parameters separately. In the non-toolkit variant process child frame parameters separately. diff --git a/src/frame.c b/src/frame.c index b386839f34c..bd175c0f860 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1489,17 +1489,43 @@ get_future_frame_param (Lisp_Object parameter, #endif int -tty_child_pos_param (struct frame *child, Lisp_Object key, - Lisp_Object params, int dflt) +tty_child_pos_param (struct frame *f, Lisp_Object key, + Lisp_Object params, int pos, int size) { + struct frame *p = XFRAME (f->parent_frame); Lisp_Object val = Fassq (key, params); + if (CONSP (val)) { val = XCDR (val); - if (FIXNUMP (val)) - return XFIXNUM (val); + + if (EQ (val, Qminus)) + pos = (EQ (key, Qtop) + ? p->pixel_height - size + : p->pixel_width - size); + else if (TYPE_RANGED_FIXNUMP (int, val)) + { + pos = XFIXNUM (val); + + if (pos < 0) + /* Handle negative value. */ + pos = (EQ (key, Qtop) + ? p->pixel_height - size + pos + : p->pixel_width - size + pos); + } + else if (CONSP (val) && EQ (XCAR (val), Qplus) + && CONSP (XCDR (val)) + && TYPE_RANGED_FIXNUMP (int, XCAR (XCDR (val)))) + pos = XFIXNUM (XCAR (XCDR (val))); + else if (CONSP (val) && EQ (XCAR (val), Qminus) + && CONSP (XCDR (val)) + && RANGED_FIXNUMP (-INT_MAX, XCAR (XCDR (val)), INT_MAX)) + pos = (EQ (key, Qtop) + ? p->pixel_height - size - XFIXNUM (XCAR (XCDR (val))) + : p->pixel_width - size - XFIXNUM (XCAR (XCDR (val)))); } - return dflt; + + return pos; } int @@ -1546,10 +1572,10 @@ static void tty_child_frame_rect (struct frame *f, Lisp_Object params, int *x, int *y, int *w, int *h) { - *x = tty_child_pos_param (f, Qleft, params, 0); - *y = tty_child_pos_param (f, Qtop, params, 0); *w = tty_child_size_param (f, Qwidth, params, FRAME_TOTAL_COLS (f)); *h = tty_child_size_param (f, Qheight, params, FRAME_TOTAL_LINES (f)); + *x = tty_child_pos_param (f, Qleft, params, 0, *w); + *y = tty_child_pos_param (f, Qtop, params, 0, *h); } #endif /* !HAVE_ANDROID */ @@ -1688,10 +1714,6 @@ affects all frames on the same terminal device. */) f->left_pos = x; f->top_pos = y; - store_in_alist (&parms, Qleft, make_fixnum (x)); - store_in_alist (&parms, Qtop, make_fixnum (y)); - store_in_alist (&parms, Qwidth, make_fixnum (width)); - store_in_alist (&parms, Qheight, make_fixnum (height)); store_in_alist (&parms, Qtty_type, build_string (t->display_info.tty->type)); store_in_alist (&parms, Qtty, @@ -3951,8 +3973,11 @@ list, but are otherwise ignored. */) if (is_tty_child_frame (f)) { - int x = tty_child_pos_param (f, Qleft, params, f->left_pos); - int y = tty_child_pos_param (f, Qtop, params, f->top_pos); + int w = tty_child_size_param (f, Qwidth, params, f->total_cols); + int h = tty_child_size_param (f, Qheight, params, f->total_lines); + int x = tty_child_pos_param (f, Qleft, params, f->left_pos, w); + int y = tty_child_pos_param (f, Qtop, params, f->top_pos, h); + if (x != f->left_pos || y != f->top_pos) { f->left_pos = x; @@ -3960,8 +3985,6 @@ list, but are otherwise ignored. */) SET_FRAME_GARBAGED (root_frame (f)); } - int w = tty_child_size_param (f, Qwidth, params, f->total_cols); - int h = tty_child_size_param (f, Qheight, params, f->total_lines); if (w != f->total_cols || h != f->total_lines) change_frame_size (f, w, h, false, false, false); diff --git a/src/frame.h b/src/frame.h index c9cc65e597d..a70d9caf5df 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1461,7 +1461,7 @@ extern struct frame *make_initial_frame (void); extern struct frame *make_frame (bool); extern bool frame_redisplay_p (struct frame *); extern int tty_child_pos_param (struct frame *, Lisp_Object, - Lisp_Object, int); + Lisp_Object, int, int); extern int tty_child_size_param (struct frame *, Lisp_Object, Lisp_Object, int); #ifdef HAVE_WINDOW_SYSTEM diff --git a/src/gtkutil.c b/src/gtkutil.c index 0770874eb40..c192102730c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1070,19 +1070,27 @@ xg_set_geometry (struct frame *f) be off by scrollbar width + window manager decorations. */ #ifndef HAVE_PGTK if (f->size_hint_flags & XNegative) - f->left_pos = (x_display_pixel_width (FRAME_DISPLAY_INFO (f)) + f->left_pos = ((FRAME_PARENT_FRAME (f) + ? FRAME_PIXEL_WIDTH (FRAME_PARENT_FRAME (f)) + : x_display_pixel_width (FRAME_DISPLAY_INFO (f))) - FRAME_PIXEL_WIDTH (f) + f->left_pos); if (f->size_hint_flags & YNegative) - f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) + f->top_pos = ((FRAME_PARENT_FRAME (f) + ? FRAME_PIXEL_HEIGHT (FRAME_PARENT_FRAME (f)) + : x_display_pixel_height (FRAME_DISPLAY_INFO (f))) - FRAME_PIXEL_HEIGHT (f) + f->top_pos); #else if (f->size_hint_flags & XNegative) - f->left_pos = (pgtk_display_pixel_width (FRAME_DISPLAY_INFO (f)) + f->left_pos = ((FRAME_PARENT_FRAME (f) + ? FRAME_PIXEL_WIDTH (FRAME_PARENT_FRAME (f)) + : pgtk_display_pixel_width (FRAME_DISPLAY_INFO (f))) - FRAME_PIXEL_WIDTH (f) + f->left_pos); if (f->size_hint_flags & YNegative) - f->top_pos = (pgtk_display_pixel_height (FRAME_DISPLAY_INFO (f)) + f->top_pos = ((FRAME_PARENT_FRAME (f) + ? FRAME_PIXEL_HEIGHT (FRAME_PARENT_FRAME (f)) + : pgtk_display_pixel_height (FRAME_DISPLAY_INFO (f))) - FRAME_PIXEL_HEIGHT (f) + f->top_pos); #endif diff --git a/src/msdos.c b/src/msdos.c index 49403ba72f4..ec36d0b2df3 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1715,8 +1715,13 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) a nuumber of other flags. */ if (is_tty_child_frame (f)) { - int x = tty_child_pos_param (f, Qleft, alist, f->left_pos); - int y = tty_child_pos_param (f, Qtop, alist, f->top_pos); + int w = tty_child_size_param (f, Qwidth, alist, f->total_cols); + int h = tty_child_size_param (f, Qheight, alist, f->total_lines); + if (w != f->total_cols || h != f->total_lines) + change_frame_size (f, w, h, false, false, false); + + int x = tty_child_pos_param (f, Qleft, alist, f->left_pos, w); + int y = tty_child_pos_param (f, Qtop, alist, f->top_pos, h); if (x != f->left_pos || y != f->top_pos) { f->left_pos = x; @@ -1724,11 +1729,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) SET_FRAME_GARBAGED (root_frame (f)); } - int w = tty_child_size_param (f, Qwidth, alist, f->total_cols); - int h = tty_child_size_param (f, Qheight, alist, f->total_lines); - if (w != f->total_cols || h != f->total_lines) - change_frame_size (f, w, h, false, false, false); - Lisp_Object visible = Fassq (Qvisibility, alist); if (CONSP (visible)) SET_FRAME_VISIBLE (f, !NILP (Fcdr (visible))); diff --git a/src/xfns.c b/src/xfns.c index d8a3ce0b3b1..67b15428bf0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4251,37 +4251,42 @@ x_window (struct frame *f, long window_prompting) Note that we do not specify here whether the position is a user-specified or program-specified one. We pass that information later, in x_wm_set_size_hint. */ - { - int left = f->left_pos; - bool xneg = (window_prompting & XNegative) != 0; - int top = f->top_pos; - bool yneg = (window_prompting & YNegative) != 0; - if (xneg) - left = -left; - if (yneg) - top = -top; - - if (window_prompting & USPosition) - sprintf (f->shell_position, "=%dx%d%c%d%c%d", + bool xneg = (window_prompting & XNegative) != 0; + bool yneg = (window_prompting & YNegative) != 0; + + if (FRAME_PARENT_FRAME (f)) + { + if (window_prompting & XNegative) + f->left_pos = (FRAME_PIXEL_WIDTH (FRAME_PARENT_FRAME (f)) + - FRAME_PIXEL_WIDTH (f) + f->left_pos); + + if (window_prompting & YNegative) + f->top_pos = (FRAME_PIXEL_HEIGHT (FRAME_PARENT_FRAME (f)) + - FRAME_PIXEL_HEIGHT (f) + f->top_pos); + + window_prompting &= ~ (XNegative | YNegative); + } + + if (window_prompting & USPosition) + sprintf (f->shell_position, "=%dx%d%c%d%c%d", + FRAME_PIXEL_WIDTH (f) + extra_borders, + FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders, + (xneg ? '-' : '+'), f->left_pos, + (yneg ? '-' : '+'), f->top_pos); + else + { + sprintf (f->shell_position, "=%dx%d", FRAME_PIXEL_WIDTH (f) + extra_borders, - FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders, - (xneg ? '-' : '+'), left, - (yneg ? '-' : '+'), top); - else - { - sprintf (f->shell_position, "=%dx%d", - FRAME_PIXEL_WIDTH (f) + extra_borders, - FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders); - - /* Setting x and y when the position is not specified in - the geometry string will set program position in the WM hints. - If Emacs had just one program position, we could set it in - fallback resources, but since each make-frame call can specify - different program positions, this is easier. */ - XtSetArg (gal[gac], XtNx, left); gac++; - XtSetArg (gal[gac], XtNy, top); gac++; - } - } + FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders); + + /* Setting x and y when the position is not specified in + the geometry string will set program position in the WM hints. + If Emacs had just one program position, we could set it in + fallback resources, but since each make-frame call can specify + different program positions, this is easier. */ + XtSetArg (gal[gac], XtNx, f->left_pos); gac++; + XtSetArg (gal[gac], XtNy, f->top_pos); gac++; + } XtSetArg (gal[gac], XtNgeometry, f->shell_position); gac++; XtSetValues (shell_widget, gal, gac); @@ -4460,6 +4465,19 @@ x_window (struct frame *f) attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | CWOverrideRedirect | CWColormap); + if (FRAME_PARENT_FRAME (f)) + { + if (f->size_hint_flags & XNegative) + f->left_pos = (FRAME_PIXEL_WIDTH (FRAME_PARENT_FRAME (f)) + - FRAME_PIXEL_WIDTH (f) + f->left_pos); + + if (f->size_hint_flags & YNegative) + f->top_pos = (FRAME_PIXEL_HEIGHT (FRAME_PARENT_FRAME (f)) + - FRAME_PIXEL_HEIGHT (f) + f->top_pos); + + f->size_hint_flags &= ~ (XNegative | YNegative); + } + block_input (); FRAME_X_WINDOW (f) = XCreateWindow (FRAME_X_DISPLAY (f),