GNU bug report logs - #66165
30.0.50; Issue with process-get as a place

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sat, 23 Sep 2023 06:55:02 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 66165 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66165; Package emacs. (Sat, 23 Sep 2023 06:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 23 Sep 2023 06:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Issue with process-get as a place
Date: Sat, 23 Sep 2023 08:53:34 +0200
In some buffer with a process, I get this result:

  (let ((proc (get-buffer-process (current-buffer))))
    (process-put proc 'test 0)
    (cl-incf (process-get proc 'test))
)

  => (test 1)

I would expect of course to back just a number, as with a regular plist:

  (let ((place '(test 0))) (cl-incf (plist-get place 'test)))

  => 1

This happens because process-put doesn't follow the convention of
returning VALUE.  If it's too late to change that, perhaps process-get
needs a special implementation as a generalized variable.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66165; Package emacs. (Sun, 24 Sep 2023 05:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 66165 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 66165 <at> debbugs.gnu.org
Subject: Re: bug#66165: 30.0.50; Issue with process-get as a place
Date: Sun, 24 Sep 2023 07:27:19 +0200
Augusto Stoffel <arstoffel <at> gmail.com> writes:

> In some buffer with a process, I get this result:
>
>   (let ((proc (get-buffer-process (current-buffer))))
>     (process-put proc 'test 0)
>     (cl-incf (process-get proc 'test))
> )
>
>   => (test 1)

> This happens because process-put doesn't follow the convention of
> returning VALUE.  If it's too late to change that,

I guess it is.

> perhaps process-get needs a special implementation as a generalized
> variable.

AFAIK we can use the optional arg of `gv-define-simple-setter' in
this case:

  (gv-define-simple-setter process-get process-put 'fix)

Does that work as expected?


Michael.




This bug report was last modified 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.