Subject: bug#78291: [PATCH] Add new gv place definitions

From: Zach Shaftel <[email-masked]>
Date: Sun, 25 May 2025 01:27:56 -0400

an updated patch without the `lookup-key' definition is attached.

>From 6a28665d167af250521bfe64b63bc41dc40b19b2 Mon Sep 17 00:00:00 2001
From: Zach Shaftel <[email-masked]>
Date: Sun, 25 May 2025 01:11:27 -0400
Subject: [PATCH] Add new gv place definitions

* lisp/emacs-lisp/gv.el (char-table-extra-slot, char-table-parent)
(default-toplevel-value, marker-insertion-type, process-plist)
(process-query-on-exit-flag, process-thread, lookup-key)
(window-prev-buffers, window-next-buffers, window-new-normal, font-get)
(charset-plist, get-charset-property): Add gv-setters.
(terminal-parameter): Fix the return value.
---
 lisp/emacs-lisp/gv.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 6c949f1016b..b6c1f2c9f9f 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -367,6 +367,8 @@ 'gv-place
 
 (gv-define-simple-setter aref aset)
 (gv-define-simple-setter char-table-range set-char-table-range)
+(gv-define-simple-setter char-table-extra-slot set-char-table-extra-slot)
+(gv-define-simple-setter char-table-parent set-char-table-parent)
 (gv-define-simple-setter car setcar)
 (gv-define-simple-setter cdr setcdr)
 ;; FIXME: add compiler-macros for `cXXr' instead!
@@ -400,10 +402,12 @@ symbol-value
 ;;; Elisp-specific generalized variables.
 
 (gv-define-simple-setter default-value set-default)
+(gv-define-simple-setter default-toplevel-value set-default-toplevel-value t)
 (gv-define-simple-setter frame-parameter set-frame-parameter 'fix)
-(gv-define-simple-setter terminal-parameter set-terminal-parameter)
+(gv-define-simple-setter terminal-parameter set-terminal-parameter t)
 (gv-define-simple-setter keymap-parent set-keymap-parent)
 (gv-define-simple-setter match-data set-match-data 'fix)
+(gv-define-simple-setter marker-insertion-type set-marker-insertion-type)
 (gv-define-simple-setter overlay-get overlay-put)
 (gv-define-setter overlay-start (store ov)
   (macroexp-let2 nil store store
@@ -415,6 +419,9 @@ process-buffer
 (gv-define-simple-setter process-filter set-process-filter)
 (gv-define-simple-setter process-sentinel set-process-sentinel)
 (gv-define-simple-setter process-get process-put 'fix)
+(gv-define-simple-setter process-plist set-process-plist)
+(gv-define-simple-setter process-query-on-exit-flag set-process-query-on-exit-flag)
+(gv-define-simple-setter process-thread set-process-thread)
 (gv-define-simple-setter window-parameter set-window-parameter)
 (gv-define-setter window-buffer (v &optional w)
   (macroexp-let2 nil v v
@@ -427,6 +434,12 @@ window-dedicated-p
 (gv-define-setter window-hscroll (v &optional w) `(set-window-hscroll ,w ,v))
 (gv-define-setter window-point (v &optional w) `(set-window-point ,w ,v))
 (gv-define-setter window-start (v &optional w) `(set-window-start ,w ,v))
+(gv-define-setter window-prev-buffers (v &optional w) `(set-window-prev-buffers ,w ,v))
+(gv-define-setter window-next-buffers (v &optional w) `(set-window-next-buffers ,w ,v))
+(gv-define-setter window-new-normal (v &optional w) `(set-window-new-normal ,w ,v))
+(gv-define-simple-setter font-get font-put)
+(gv-define-simple-setter charset-plist set-charset-plist)
+(gv-define-simple-setter get-charset-property put-charset-property t)
 
 (gv-define-setter buffer-local-value (val var buf)
   (macroexp-let2 nil v val
-- 
2.49.0

Eli Zaretskii <[email-masked]> writes:

> Ping!  Can we please make some progress with this?
>
>> Cc: [email-masked]
>> Date: Tue, 13 May 2025 13:38:33 -0400
>> From:  Zach Shaftel via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> >> @@ -427,6 +434,14 @@ window-dedicated-p
>> >>  (gv-define-setter window-hscroll (v &optional w) `(set-window-hscroll ,w ,v))
>> >>  (gv-define-setter window-point (v &optional w) `(set-window-point ,w ,v))
>> >>  (gv-define-setter window-start (v &optional w) `(set-window-start ,w ,v))
>> >> +(gv-define-setter window-prev-buffers (v &optional w) `(set-window-prev-buffers ,w ,v))
>> >> +(gv-define-setter window-next-buffers (v &optional w) `(set-window-next-buffers ,w ,v))
>> >> +(gv-define-setter window-new-normal (v &optional w) `(set-window-new-normal ,w ,v))
>> >> +(gv-define-simple-setter font-get font-put)
>> >> +(gv-define-simple-setter charset-plist set-charset-plist)
>> >> +(gv-define-simple-setter get-charset-property put-charset-property t)
>> >> +(gv-define-setter lookup-key (val keymap key &optional _accept-default)
>> >> +  `(define-key ,keymap ,key ,val))
>> >
>> > I'd have to check some of them, but at least the last doesn't look like
>> > a good idea to me, because they don't quite match.  E.g. if you
>> >
>> >     (define-key MAP KEY '(menu-item TEXT CMD))
>> >
>> > The corresponding `lookup-key` will return just CMD rather than
>> > (menu-item TEXT CMD).
>> >
>> >
>> >         Stefan
>> 
>> yeah I knew that one was questionable, and considering the keymap-*
>> functions are now the standard interface to key bindings it probably
>> wouldn't get much use anyway. as far as i could tell, the other setters
>> all accept the same values that the getter would return, but there may
>> be other idiosyncrasies i'm not aware of. let me know what ought to be
>> removed and i can submit a new patch.
>> 
>> 
>> 
>>