Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-02 Thread Ihor Radchenko
Karl Fogel  writes:

> This is now beyond the "trivial fix" level of effort that I was 
> prepared to invest to make this warning go away.  Like Rudolf 
> Adamkovič and others before him, I now retire to my country 
> estate, to simultaneously lick my wounds and rest on my laurels 
> (which I guess is better than licking my laurels and resting on my 
> wounds).

If you want to look into low-effort things to contribute, you may
consider helping to clean up https://tracker.orgmode.org/bugs. A number
of bugs there are already resolved or got no reply and should be closed
- see https://tracker.orgmode.org/howto

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread tomas
On Wed, Nov 01, 2023 at 11:29:23AM -0500, Karl Fogel wrote:

> [...] (which I guess is better than licking my
> laurels and resting on my wounds).

Don't underestimate Medirerranean cooking. Laurels can be...
yummy :)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Karl Fogel

On 01 Nov 2023, Ihor Radchenko wrote:

Bastien  writes:

Karl Fogel  writes:

Hi, everyone.  Small fix attached -- it just makes a warning 
go

away.


Applied against the main branch, thanks!


Unfortunately, fixing this warning breaks org-table logic and 
tests.

See previous discussion in
https://list.orgmode.org/orgmode/20230827214320.46754-1-salu...@me.com/


Oh my goodness.  That is... sigh.  Wow.

This is now beyond the "trivial fix" level of effort that I was 
prepared to invest to make this warning go away.  Like Rudolf 
Adamkovič and others before him, I now retire to my country 
estate, to simultaneously lick my wounds and rest on my laurels 
(which I guess is better than licking my laurels and resting on my 
wounds).


Thank you for noticing, and for adding the FIXME later.

Best regards,
-Karl



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Bastien Guerry
Ihor Radchenko  writes:

> I added a FIXME explaining the issue to make the problem more clear.

Good idea, thanks!

-- 
 Bastien Guerry



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Ihor Radchenko
Bastien  writes:

>> Unfortunately, fixing this warning breaks org-table logic and tests.
>> See previous discussion in
>> https://list.orgmode.org/orgmode/20230827214320.46754-1-salu...@me.com/
>
> Ouch. Reverted.

I added a FIXME explaining the issue to make the problem more clear. I
think this is the third attempted fix of this warning on the list :)

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ef9e144a

Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Bastien
Ihor Radchenko  writes:

> Bastien  writes:
>
>> Karl Fogel  writes:
>>
>>> Hi, everyone.  Small fix attached -- it just makes a warning go
>>> away.
>>
>> Applied against the main branch, thanks!
>
> Unfortunately, fixing this warning breaks org-table logic and tests.
> See previous discussion in
> https://list.orgmode.org/orgmode/20230827214320.46754-1-salu...@me.com/

Ouch. Reverted.

I took back control over my zombie clone and put him back to sleep in
his coffin.

-- 
 Bastien



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Ihor Radchenko
Bastien  writes:

> Karl Fogel  writes:
>
>> Hi, everyone.  Small fix attached -- it just makes a warning go
>> away.
>
> Applied against the main branch, thanks!

Unfortunately, fixing this warning breaks org-table logic and tests.
See previous discussion in
https://list.orgmode.org/orgmode/20230827214320.46754-1-salu...@me.com/

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Fix warning about using `eq' to compare strings.

2023-11-01 Thread Bastien
Hi Karl,

Karl Fogel  writes:

> Hi, everyone.  Small fix attached -- it just makes a warning go
> away.

Applied against the main branch, thanks!

-- 
 Bastien



[PATCH] Fix warning about using `eq' to compare strings.

2023-10-30 Thread Karl Fogel
Hi, everyone.  Small fix attached -- it just makes a warning go 
away.


Best regards,
-Karl

>From a1a939191af1a195f260037510d407e7483ba05f Mon Sep 17 00:00:00 2001
From: Karl Fogel 
Date: Mon, 30 Oct 2023 10:33:29 -0500
Subject: [PATCH] lisp/org-table.el: fix warning about `eq' usage

* lisp/org-table.el (org-table-make-reference): Use `equal' instead of
`eq' to compare strings.

This change makes the following warning go away:

  Warning (comp): org-table.el:2867:23: \
  Warning: `eq' called with literal string that may never match (arg 2)

This change does not affect the behavior of `org-table-make-reference'
because `eq' treats all instances of the empty string as the same
object anyway, e.g., `(eq (string-trim "aaabbb" "a+" "b+") "")' ==> t.
The only effect of this change is to eliminate the warning.
---
 lisp/org-table.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index f5a433c7d..860d7720d 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2864,7 +2864,7 @@ list, `literal' is for the format specifier L."
   (if lispp
 	  (if (eq lispp 'literal)
 	  elements
-	(if (and (eq elements "") (not keep-empty))
+	(if (and (equal elements "") (not keep-empty))
 		""
 	  (prin1-to-string
 	   (if numbers (string-to-number elements) elements
-- 
2.42.0