unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
@ 2024-10-15 23:14 Alex Bochannek
       [not found] ` <87ldynk8un.fsf@jeremybryant.net>
  2024-11-26 21:56 ` Philip Kaludercic
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Bochannek @ 2024-10-15 23:14 UTC (permalink / raw)
  To: 73827

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Hello!

I have not submitted patches against an ELPA package before, so I hope
this format is OK. I tried to follow the instruction on pulling ELPA
from Git, but the make step failed for me.

The register-list mode throws an error on start-up when there are
unknown register types in the register-alist. This can happen with
window configurations and saved session state after a restart. The
reason for this is a simple line flip in the register-list-get-type
function.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 475 bytes --]

--- /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el.~1~	2023-01-10 19:36:23
+++ /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el	2024-10-15 15:49:37
@@ -483,8 +483,8 @@
 	    (t "error"))
     (cond ((window-configuration-p (car key)) "W")
 	  ((frame-configuration-p (car key)) "F")
-	  ((stringp (car key)) "R")
 	  ((string= "Unprintable entity" (car key)) "?")
+	  ((stringp (car key)) "R")
 	  (t "error"))))
 
 ;;; Edit key/value of the register

[-- Attachment #3: Type: text/plain, Size: 177 bytes --]


Apologies again for the format of this submission. If someone could
point me at instructions for how to make your life easier next time, I'd
appreciate it.

Thanks!

-- 
Alex.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
       [not found] ` <87ldynk8un.fsf@jeremybryant.net>
@ 2024-10-17  2:43   ` Alex Bochannek
  2024-11-25 23:02     ` Alex Bochannek
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Bochannek @ 2024-10-17  2:43 UTC (permalink / raw)
  To: Jeremy Bryant; +Cc: 73827

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

Jeremy Bryant <jb@jeremybryant.net> writes:

> Alex Bochannek <alex@bochannek.com> writes:
>
>> Hello!
>>
>> I have not submitted patches against an ELPA package before, so I hope
>
> Philip, any comments?
>
>>
>> Apologies again for the format of this submission. If someone could
>> point me at instructions for how to make your life easier next time, I'd
>> appreciate it.
>
> Please read the file CONTRIBUTE in the Emacs source tree.

Figured out my issue with populating the ELPA repo (new computer, old
version of gmake) and I am including the patch in the proper format now.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-unprintable-register-display-logic.patch --]
[-- Type: text/x-patch, Size: 799 bytes --]

From dafcff7c7a9cb6952aa740ef34a67eb61fd2a90d Mon Sep 17 00:00:00 2001
From: Alex Bochannek <alex@bochannek.com>
Date: Wed, 16 Oct 2024 19:35:33 -0700
Subject: [PATCH] Fix unprintable register display logic

---
 register-list.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/register-list.el b/register-list.el
index 846d3efe49..5a81b1b7bb 100644
--- a/register-list.el
+++ b/register-list.el
@@ -478,8 +478,8 @@ the register or copy its value into the kill ring."
 	    (t "error"))
     (cond ((window-configuration-p (car key)) "W")
 	  ((frame-configuration-p (car key)) "F")
-	  ((stringp (car key)) "R")
 	  ((string= "Unprintable entity" (car key)) "?")
+	  ((stringp (car key)) "R")
 	  (t "error"))))
 
 ;;; Edit key/value of the register
-- 
2.39.5 (Apple Git-154)


[-- Attachment #3: Type: text/plain, Size: 11 bytes --]


-- 
Alex.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
  2024-10-17  2:43   ` Alex Bochannek
@ 2024-11-25 23:02     ` Alex Bochannek
  2024-11-26 21:35       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Bochannek @ 2024-11-25 23:02 UTC (permalink / raw)
  To: Jeremy Bryant; +Cc: 73827

Anything else that's needed from me here? I have another trivial fix for
register-list I would like to submit.

Thanks!

Alex Bochannek <alex@bochannek.com> writes:

> Jeremy Bryant <jb@jeremybryant.net> writes:
>
>> Alex Bochannek <alex@bochannek.com> writes:
>>
>>> Hello!
>>>
>>> I have not submitted patches against an ELPA package before, so I hope
>>
>> Philip, any comments?
>>
>>>
>>> Apologies again for the format of this submission. If someone could
>>> point me at instructions for how to make your life easier next time, I'd
>>> appreciate it.
>>
>> Please read the file CONTRIBUTE in the Emacs source tree.
>
> Figured out my issue with populating the ELPA repo (new computer, old
> version of gmake) and I am including the patch in the proper format now.
>
> From dafcff7c7a9cb6952aa740ef34a67eb61fd2a90d Mon Sep 17 00:00:00 2001
> From: Alex Bochannek <alex@bochannek.com>
> Date: Wed, 16 Oct 2024 19:35:33 -0700
> Subject: [PATCH] Fix unprintable register display logic
>
> ---
>  register-list.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/register-list.el b/register-list.el
> index 846d3efe49..5a81b1b7bb 100644
> --- a/register-list.el
> +++ b/register-list.el
> @@ -478,8 +478,8 @@ the register or copy its value into the kill ring."
>  	    (t "error"))
>      (cond ((window-configuration-p (car key)) "W")
>  	  ((frame-configuration-p (car key)) "F")
> -	  ((stringp (car key)) "R")
>  	  ((string= "Unprintable entity" (car key)) "?")
> +	  ((stringp (car key)) "R")
>  	  (t "error"))))
>  
>  ;;; Edit key/value of the register
> -- 
> 2.39.5 (Apple Git-154)

-- 
Alex.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
  2024-11-25 23:02     ` Alex Bochannek
@ 2024-11-26 21:35       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 6+ messages in thread
From: Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-26 21:35 UTC (permalink / raw)
  To: Alex Bochannek; +Cc: Philip Kaludercic, 73827

Alex Bochannek <alex@bochannek.com> writes:

> Anything else that's needed from me here? I have another trivial fix for
> register-list I would like to submit.

Thanks alex for your contribution.

Adding Philip, any comments or suggestions on this short ELPA patch?

>
> Thanks!
>
> Alex Bochannek <alex@bochannek.com> writes:
>
>> Jeremy Bryant <jb@jeremybryant.net> writes:
>>
>>> Alex Bochannek <alex@bochannek.com> writes:
>>>
>>>> Hello!
>>>>
>>>> I have not submitted patches against an ELPA package before, so I hope
>>>
>>> Philip, any comments?
>>>
>>>>
>>>> Apologies again for the format of this submission. If someone could
>>>> point me at instructions for how to make your life easier next time, I'd
>>>> appreciate it.
>>>
>>> Please read the file CONTRIBUTE in the Emacs source tree.
>>
>> Figured out my issue with populating the ELPA repo (new computer, old
>> version of gmake) and I am including the patch in the proper format now.
>>
>> From dafcff7c7a9cb6952aa740ef34a67eb61fd2a90d Mon Sep 17 00:00:00 2001
>> From: Alex Bochannek <alex@bochannek.com>
>> Date: Wed, 16 Oct 2024 19:35:33 -0700
>> Subject: [PATCH] Fix unprintable register display logic
>>
>> ---
>>  register-list.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/register-list.el b/register-list.el
>> index 846d3efe49..5a81b1b7bb 100644
>> --- a/register-list.el
>> +++ b/register-list.el
>> @@ -478,8 +478,8 @@ the register or copy its value into the kill ring."
>>  	    (t "error"))
>>      (cond ((window-configuration-p (car key)) "W")
>>  	  ((frame-configuration-p (car key)) "F")
>> -	  ((stringp (car key)) "R")
>>  	  ((string= "Unprintable entity" (car key)) "?")
>> +	  ((stringp (car key)) "R")
>>  	  (t "error"))))
>>  
>>  ;;; Edit key/value of the register
>> -- 
>> 2.39.5 (Apple Git-154)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
  2024-10-15 23:14 bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers Alex Bochannek
       [not found] ` <87ldynk8un.fsf@jeremybryant.net>
@ 2024-11-26 21:56 ` Philip Kaludercic
  2024-11-27  1:39   ` Alex Bochannek
  1 sibling, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2024-11-26 21:56 UTC (permalink / raw)
  To: Alex Bochannek; +Cc: 73827

Alex Bochannek <alex@bochannek.com> writes:

> Hello!
>
> I have not submitted patches against an ELPA package before, so I hope
> this format is OK. I tried to follow the instruction on pulling ELPA
> from Git, but the make step failed for me.
>
> The register-list mode throws an error on start-up when there are
> unknown register types in the register-alist. This can happen with
> window configurations and saved session state after a restart. The
> reason for this is a simple line flip in the register-list-get-type
> function.
>
> --- /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el.~1~	2023-01-10 19:36:23
> +++ /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el	2024-10-15 15:49:37
> @@ -483,8 +483,8 @@
>  	    (t "error"))
>      (cond ((window-configuration-p (car key)) "W")
>  	  ((frame-configuration-p (car key)) "F")
> -	  ((stringp (car key)) "R")
>  	  ((string= "Unprintable entity" (car key)) "?")

The change confuses me, are we sure that (car key) must be a string at
this point?  If not, should be prefer `equal' over `string='?

> +	  ((stringp (car key)) "R")
>  	  (t "error"))))
>  
>  ;;; Edit key/value of the register
>
>
> Apologies again for the format of this submission. If someone could
> point me at instructions for how to make your life easier next time, I'd
> appreciate it.

You can try out

  M-x package-vc-install register-list RET

that should give you a checkout.  You can then make your changes as
usual and then prepare a patch using vc-prepare-patch or git-format-patch(1).

> Thanks!





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers
  2024-11-26 21:56 ` Philip Kaludercic
@ 2024-11-27  1:39   ` Alex Bochannek
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Bochannek @ 2024-11-27  1:39 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 73827

Philip Kaludercic <philipk@posteo.net> writes:

> Alex Bochannek <alex@bochannek.com> writes:
>
>> --- /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el.~1~	2023-01-10 19:36:23
>> +++ /Users/awb/.emacs.d/elpa/register-list-0.1/register-list.el	2024-10-15 15:49:37
>> @@ -483,8 +483,8 @@
>>  	    (t "error"))
>>      (cond ((window-configuration-p (car key)) "W")
>>  	  ((frame-configuration-p (car key)) "F")
>> -	  ((stringp (car key)) "R")
>>  	  ((string= "Unprintable entity" (car key)) "?")
>
> The change confuses me, are we sure that (car key) must be a string at
> this point?  If not, should be prefer `equal' over `string='?
>
>> +	  ((stringp (car key)) "R")

The change simply swaps the stringp and string= predicates in the cond.
If there is a register with "Unprintable entity" (which desktop.el
produces), it would not show up correctly as a "?" (assuming "?" has
been added to register-list-default-type).

Looking at register-alist in my .emacs.desktop, it is always the string
"Unprintable entity" and never a symbol. Whether it's string= or equal
shouldn't matter, because the difference in error handling between the
two isn't relevant here.

Unrelated, I looked into how to get frameset support in register-list
and the way framesets are stored in register-alist is very different.
I'll submit another patch for that, although it isn't particularly
elegant.

> You can try out
>
>   M-x package-vc-install register-list RET
>
> that should give you a checkout.  You can then make your changes as
> usual and then prepare a patch using vc-prepare-patch or git-format-patch(1).

Perfect, thank you! Didn't know about package-vc-install.

-- 
Alex.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-27  1:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15 23:14 bug#73827: [ELPA] [PATCH] register-list fails on "Unprintable entity" registers Alex Bochannek
     [not found] ` <87ldynk8un.fsf@jeremybryant.net>
2024-10-17  2:43   ` Alex Bochannek
2024-11-25 23:02     ` Alex Bochannek
2024-11-26 21:35       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-26 21:56 ` Philip Kaludercic
2024-11-27  1:39   ` Alex Bochannek

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).