emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
@ 2022-10-07  5:14 Ihor Radchenko
  2022-10-07  7:33 ` Max Nikulin
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2022-10-07  5:14 UTC (permalink / raw)
  To: emacs-orgmode, Kyle Meyer

Kyle,

The following commit adds `string-trim', which is not yet available in
Emacs 26.

98e168b489e4350430d1600f7ece57215de1027c
Author:     Kyle Meyer <kyle@kyleam.com>
AuthorDate: Tue Oct 4 17:42:27 2022 -0400
Commit:     Kyle Meyer <kyle@kyleam.com>
CommitDate: Tue Oct 4 18:38:25 2022 -0400
compat: Add compatibility wrapper for string-clean-whitespace
* lisp/org-compat.el (org-string-clean-whitespace): New compatibility
function.
* lisp/ox.el (org-export-resolve-radio-link): Use
org-string-clean-whitespace.

This is a follow-up to the port of Emacs's 70341cab3.

Best,
Ihor


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

* Re: [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2022-10-07  5:14 [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
@ 2022-10-07  7:33 ` Max Nikulin
  2022-10-07 15:30   ` Kyle Meyer
  0 siblings, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2022-10-07  7:33 UTC (permalink / raw)
  To: emacs-orgmode, Kyle Meyer

On 07/10/2022 12:14, Ihor Radchenko wrote:
> 
> The following commit adds `string-trim', which is not yet available in
> Emacs 26.

It is available in Emacs-26, however (require 'subr-x) should be added.

There is `org-trim' and despite it is less generic, likely it can be 
used if subr-x is avoided for some reason.


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

* Re: [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2022-10-07  7:33 ` Max Nikulin
@ 2022-10-07 15:30   ` Kyle Meyer
  2022-10-08  5:04     ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Kyle Meyer @ 2022-10-07 15:30 UTC (permalink / raw)
  To: Ihor Radchenko, Max Nikulin; +Cc: emacs-orgmode

Max Nikulin writes:

> On 07/10/2022 12:14, Ihor Radchenko wrote:
>> 
>> The following commit adds `string-trim', which is not yet available in
>> Emacs 26.
>
> It is available in Emacs-26, however (require 'subr-x) should be added.
>
> There is `org-trim' and despite it is less generic, likely it can be
> used if subr-x is avoided for some reason.

Ihor, sorry for overlooking that.  As Max mentions, indeed string-trim
used to be in subr-x.  It's been available since Emacs 24 and was
relocated with Emacs 28's a4ececf004e (Move string-trim functions to
subr.el, 2021-03-24).

I won't be at my computer much today or tomorrow, but, when I get a
chance, I'll plan to add something like

  (eval-when-compile (require 'subr-x))  ; Emacs < 28

And of course please feel free to beat me to it and fix it however you
see fit.  Thanks.


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

* Re: [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2022-10-07 15:30   ` Kyle Meyer
@ 2022-10-08  5:04     ` Ihor Radchenko
  2022-10-08  5:41       ` Kyle Meyer
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2022-10-08  5:04 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Max Nikulin, emacs-orgmode

Kyle Meyer <kyle@kyleam.com> writes:

>> It is available in Emacs-26, however (require 'subr-x) should be added.
>>
>> There is `org-trim' and despite it is less generic, likely it can be
>> used if subr-x is avoided for some reason.
>
> Ihor, sorry for overlooking that.  As Max mentions, indeed string-trim
> used to be in subr-x.  It's been available since Emacs 24 and was
> relocated with Emacs 28's a4ececf004e (Move string-trim functions to
> subr.el, 2021-03-24).
>
> I won't be at my computer much today or tomorrow, but, when I get a
> chance, I'll plan to add something like
>
>   (eval-when-compile (require 'subr-x))  ; Emacs < 28

I am a bit confused about usage of subr-x in Org.

I do recall Nicolas repeatedly voicing against usage of subr-x staff:

https://orgmode.org/list/87wo4en8qk.fsf@nicolasgoaziou.fr
>>>       2. we don't use "subr-x.el" in the code base. In particular, it would be
>>>	  nice to replace `when-let' with `when' + `let'. This change costs
>>>	  only one loc.

However, he did not mention the reasoning behind this, except a single
massage I was able to find:

https://orgmode.org/list/8737t0b2c9.fsf@nicolasgoaziou.fr
>>>  ... you are not using `if-let' anywhere if this patch. Besides, we still
>>>  cannot use subr-x, since it is a 24.4 library, and, AFAIR, we didn't
>>>  drop support for 24.3 yet.

If supporting Emacs 24 is the only blocker for subr-x, it should be safe
to use it.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2022-10-08  5:04     ` Ihor Radchenko
@ 2022-10-08  5:41       ` Kyle Meyer
  2022-10-09  3:30         ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Kyle Meyer @ 2022-10-08  5:41 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Max Nikulin, emacs-orgmode

Ihor Radchenko writes:

> I do recall Nicolas repeatedly voicing against usage of subr-x staff:
>
> https://orgmode.org/list/87wo4en8qk.fsf@nicolasgoaziou.fr
>>>>       2. we don't use "subr-x.el" in the code base. In particular, it would be
>>>>	  nice to replace `when-let' with `when' + `let'. This change costs
>>>>	  only one loc.
>
> However, he did not mention the reasoning behind this, except a single
> massage I was able to find:
>
> https://orgmode.org/list/8737t0b2c9.fsf@nicolasgoaziou.fr
>>>>  ... you are not using `if-let' anywhere if this patch. Besides, we still
>>>>  cannot use subr-x, since it is a 24.4 library, and, AFAIR, we didn't
>>>>  drop support for 24.3 yet.
>
> If supporting Emacs 24 is the only blocker for subr-x, it should be safe
> to use it.

Right, as far as I understand, support for Emacs 24.3 was the main
reason to avoid it; subr-x.el wasn't added until Emacs 24.4, when it was
renamed from helpers.el.  (There may be the general stylistic question
of whether to use when-let{,*} and friends, but that's not relevant in
this context.)

I've pushed 04d9d4b3d, but please feel free to adjust as needed if some
other reason to avoid loading subr-x surfaces.


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

* Re: [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)]
  2022-10-08  5:41       ` Kyle Meyer
@ 2022-10-09  3:30         ` Ihor Radchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2022-10-09  3:30 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Max Nikulin, emacs-orgmode

Kyle Meyer <kyle@kyleam.com> writes:

> I've pushed 04d9d4b3d, but please feel free to adjust as needed if some
> other reason to avoid loading subr-x surfaces.

Thanks! I see no reason to avoid subr-x.

Also, leaving the patch link for easy reference in future
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=04d9d4b3db84e0025e21e9248bc2d218cd3c0e9b

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2022-10-09  3:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07  5:14 [BUG] Re: 98e168b48 Add compatibility wrapper for string-clean-whitespace (Emacs 26 compatibility) [9.6-pre (release_9.5.5-920-g057193 @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2022-10-07  7:33 ` Max Nikulin
2022-10-07 15:30   ` Kyle Meyer
2022-10-08  5:04     ` Ihor Radchenko
2022-10-08  5:41       ` Kyle Meyer
2022-10-09  3:30         ` Ihor Radchenko

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).