emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Why not push?
@ 2015-02-15 10:23 Marcin Borkowski
  2015-02-15 10:38 ` Nicolas Goaziou
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Marcin Borkowski @ 2015-02-15 10:23 UTC (permalink / raw)
  To: Org-Mode mailing list

Hi there,

I don't want to be nitpicking, but I'm just curious.  I'm looking at the
function `org-split-string'.  It uses (two times) the following
construction:

(setq list (cons (something) list))

Is there any particular reason for not using `push' there?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Why not push?
  2015-02-15 10:23 Why not push? Marcin Borkowski
@ 2015-02-15 10:38 ` Nicolas Goaziou
  2015-02-15 10:42   ` Eric Abrahamsen
  2015-02-15 21:22   ` Yuri Niyazov
  2015-02-15 11:35 ` Rasmus
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2015-02-15 10:38 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

Hello,

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
> function `org-split-string'.  It uses (two times) the following
> construction:
>
> (setq list (cons (something) list))
>
> Is there any particular reason for not using `push' there?

No. Good luck with refactoring "org.el". ;)


Regards,

-- 
Nicolas Goaziou

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

* Re: Why not push?
  2015-02-15 10:38 ` Nicolas Goaziou
@ 2015-02-15 10:42   ` Eric Abrahamsen
  2015-02-15 10:56     ` Marcin Borkowski
  2015-02-15 21:22   ` Yuri Niyazov
  1 sibling, 1 reply; 15+ messages in thread
From: Eric Abrahamsen @ 2015-02-15 10:42 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
>> function `org-split-string'.  It uses (two times) the following
>> construction:
>>
>> (setq list (cons (something) list))
>>
>> Is there any particular reason for not using `push' there?
>
> No. Good luck with refactoring "org.el". ;)

Shhh... if you don't say anything, he might go and do it!

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

* Re: Why not push?
  2015-02-15 10:42   ` Eric Abrahamsen
@ 2015-02-15 10:56     ` Marcin Borkowski
  2015-02-15 12:26       ` Eric Abrahamsen
  0 siblings, 1 reply; 15+ messages in thread
From: Marcin Borkowski @ 2015-02-15 10:56 UTC (permalink / raw)
  To: emacs-orgmode


On 2015-02-15, at 11:42, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> Hello,
>>
>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>>
>>> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
>>> function `org-split-string'.  It uses (two times) the following
>>> construction:
>>>
>>> (setq list (cons (something) list))
>>>
>>> Is there any particular reason for not using `push' there?
>>
>> No. Good luck with refactoring "org.el". ;)
>
> Shhh... if you don't say anything, he might go and do it!

;-)

Actually, not.  (Though it might make a nice student project.  And it
would be a good idea to do it.)  But I haven't signed the FSF papers.

OTOH, I have a personal project where I devote some amount of time every
day to read someone else's code.  I started with parts of simple.el, and
now the time has come for ox-latex (and its dependencies).

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Why not push?
  2015-02-15 10:23 Why not push? Marcin Borkowski
  2015-02-15 10:38 ` Nicolas Goaziou
@ 2015-02-15 11:35 ` Rasmus
  2015-02-15 22:33   ` Marcin Borkowski
  2015-02-16  9:03 ` Sebastien Vauban
  2015-08-05  0:00 ` Bastien Guerry
  3 siblings, 1 reply; 15+ messages in thread
From: Rasmus @ 2015-02-15 11:35 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Hi there,
>
> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
> function `org-split-string'.  It uses (two times) the following
> construction:
>
> (setq list (cons (something) list))
>
> Is there any particular reason for not using `push' there?

These days you even have split-string in subr which you can make behave
like org-split-string.

Oh, and there's all the cl re-implementations...  I like org-some better
than cl-some just cause it sounds nice when you say it (try): 

     org (tiny pause) some.

—Rasmus

-- 
When in doubt, do it!

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

* Re: Why not push?
  2015-02-15 10:56     ` Marcin Borkowski
@ 2015-02-15 12:26       ` Eric Abrahamsen
  2015-02-15 22:31         ` Marcin Borkowski
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Abrahamsen @ 2015-02-15 12:26 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> On 2015-02-15, at 11:42, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>>
>>> Hello,
>>>
>>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>>>
>>>> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
>>>> function `org-split-string'.  It uses (two times) the following
>>>> construction:
>>>>
>>>> (setq list (cons (something) list))
>>>>
>>>> Is there any particular reason for not using `push' there?
>>>
>>> No. Good luck with refactoring "org.el". ;)
>>
>> Shhh... if you don't say anything, he might go and do it!
>
> ;-)
>
> Actually, not.  (Though it might make a nice student project.  And it
> would be a good idea to do it.)  But I haven't signed the FSF papers.
>
> OTOH, I have a personal project where I devote some amount of time every
> day to read someone else's code.  I started with parts of simple.el, and
> now the time has come for ox-latex (and its dependencies).

Ah well, maybe we'll trick someone else into it :)

My own personal project is to spend a bit of every day working on the
emacs packages that make my computing life possible: Org, Gnus, and
BBDB. I'd prefer to spend most of it on Org, but the fact is that when
your email setup is broken, that always takes priority. Org and Gnus
both suffer (and both benefit) from wild and messy codebases. Org has
Nicolas to help whip it into shape; Gnus doesn't.

If you're just reading code, ox-latex is a great place to start. If
you're fixing code, org-agenda could use some love...

Eric

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

* Re: Why not push?
  2015-02-15 10:38 ` Nicolas Goaziou
  2015-02-15 10:42   ` Eric Abrahamsen
@ 2015-02-15 21:22   ` Yuri Niyazov
  2015-02-15 21:31     ` Nicolas Goaziou
  2015-02-15 21:40     ` Marcin Borkowski
  1 sibling, 2 replies; 15+ messages in thread
From: Yuri Niyazov @ 2015-02-15 21:22 UTC (permalink / raw)
  To: Org-Mode mailing list

On Sun, Feb 15, 2015 at 2:38 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> No. Good luck with refactoring "org.el". ;)

Could you clarify what you think are the biggest issues with
refactoring org.el ?

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

* Re: Why not push?
  2015-02-15 21:22   ` Yuri Niyazov
@ 2015-02-15 21:31     ` Nicolas Goaziou
  2015-02-15 21:40     ` Marcin Borkowski
  1 sibling, 0 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2015-02-15 21:31 UTC (permalink / raw)
  To: Yuri Niyazov; +Cc: Org-Mode mailing list

Yuri Niyazov <yuri.niyazov@gmail.com> writes:

> Could you clarify what you think are the biggest issues with
> refactoring org.el ?

Its size.

Regards,

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

* Re: Why not push?
  2015-02-15 21:22   ` Yuri Niyazov
  2015-02-15 21:31     ` Nicolas Goaziou
@ 2015-02-15 21:40     ` Marcin Borkowski
  1 sibling, 0 replies; 15+ messages in thread
From: Marcin Borkowski @ 2015-02-15 21:40 UTC (permalink / raw)
  To: Org-Mode mailing list


On 2015-02-15, at 22:22, Yuri Niyazov <yuri.niyazov@gmail.com> wrote:

> On Sun, Feb 15, 2015 at 2:38 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>> No. Good luck with refactoring "org.el". ;)
>
> Could you clarify what you think are the biggest issues with
> refactoring org.el ?

IMHO, the biggest and most useful thing would be to divide the humongous
functions into smaller, reusable parts.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Why not push?
  2015-02-15 12:26       ` Eric Abrahamsen
@ 2015-02-15 22:31         ` Marcin Borkowski
  0 siblings, 0 replies; 15+ messages in thread
From: Marcin Borkowski @ 2015-02-15 22:31 UTC (permalink / raw)
  To: emacs-orgmode


On 2015-02-15, at 13:26, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> Ah well, maybe we'll trick someone else into it :)

;-)

> My own personal project is to spend a bit of every day working on the
> emacs packages that make my computing life possible: Org, Gnus, and
> BBDB. I'd prefer to spend most of it on Org, but the fact is that when
> your email setup is broken, that always takes priority. Org and Gnus
> both suffer (and both benefit) from wild and messy codebases. Org has
> Nicolas to help whip it into shape; Gnus doesn't.

That is a good one.  It wouldn't work for me, though, for reason I've
explained earlier.

> If you're just reading code, ox-latex is a great place to start. If
> you're fixing code, org-agenda could use some love...

Well, since I want to write a modification of the LaTeX exporter,
ox-latex seems a natural thing to look at.  OTOH, org-agenda looks scary
;-).

> Eric

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Why not push?
  2015-02-15 11:35 ` Rasmus
@ 2015-02-15 22:33   ` Marcin Borkowski
  0 siblings, 0 replies; 15+ messages in thread
From: Marcin Borkowski @ 2015-02-15 22:33 UTC (permalink / raw)
  To: emacs-orgmode


On 2015-02-15, at 12:35, Rasmus <rasmus@gmx.us> wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> Hi there,
>>
>> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
>> function `org-split-string'.  It uses (two times) the following
>> construction:
>>
>> (setq list (cons (something) list))
>>
>> Is there any particular reason for not using `push' there?
>
> These days you even have split-string in subr which you can make behave
> like org-split-string.

Interesting.  I'll look into it.

> Oh, and there's all the cl re-implementations...  I like org-some better
> than cl-some just cause it sounds nice when you say it (try): 

Yes, it seems to me that reinventing the wheel is quite common in Emacs
libraries.

>      org (tiny pause) some.

At least one lame pun comes to mind...

> —Rasmus

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: Why not push?
  2015-02-15 10:23 Why not push? Marcin Borkowski
  2015-02-15 10:38 ` Nicolas Goaziou
  2015-02-15 11:35 ` Rasmus
@ 2015-02-16  9:03 ` Sebastien Vauban
  2015-08-05  0:00 ` Bastien Guerry
  3 siblings, 0 replies; 15+ messages in thread
From: Sebastien Vauban @ 2015-02-16  9:03 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Marcin,

Marcin Borkowski wrote:
> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
> function `org-split-string'.  It uses (two times) the following
> construction:
>
> (setq list (cons (something) list))
>
> Is there any particular reason for not using `push' there?

IIUC, Emacs developers did not like needing

  (require 'cl)

in the packages' code base.  Not sure why (they did not like it, or why
they did not integrate such handy functions in the Emacs core).

And it seems to have changed.  They even have a lot of `cl-*' functions
now.

Though, for whatever reason, they don't have `cl-push', but well
`cl-pushnew'...

Not all that clear to me.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Why not push?
  2015-02-15 10:23 Why not push? Marcin Borkowski
                   ` (2 preceding siblings ...)
  2015-02-16  9:03 ` Sebastien Vauban
@ 2015-08-05  0:00 ` Bastien Guerry
  2015-08-05  6:21   ` Nicolas Goaziou
  3 siblings, 1 reply; 15+ messages in thread
From: Bastien Guerry @ 2015-08-05  0:00 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

Hi Marcin,

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> I don't want to be nitpicking, but I'm just curious.  I'm looking at the
> function `org-split-string'.  It uses (two times) the following
> construction:
>
> (setq list (cons (something) list))
>
> Is there any particular reason for not using `push' there?

I pushed a tiny clean up here.  Next question is: why not using

(split-string STRING SEPARATORS t)

?

-- 
 Bastien

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

* Re: Why not push?
  2015-08-05  0:00 ` Bastien Guerry
@ 2015-08-05  6:21   ` Nicolas Goaziou
  2015-08-05  7:07     ` Bastien Guerry
  0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Goaziou @ 2015-08-05  6:21 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: Org-Mode mailing list, Marcin Borkowski

Hello,

Bastien Guerry <bzg@gnu.org> writes:

> I pushed a tiny clean up here.  Next question is: why not using
>
> (split-string STRING SEPARATORS t)
>
> ?

It's a first step. It would be nice to get rid of `org-split-string'
altogether in the long run. We may make `org-split-string' an obsolete
alias for `split-string', and update code base accordingly.

Regards,

-- 
Nicolas Goaziou

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

* Re: Why not push?
  2015-08-05  6:21   ` Nicolas Goaziou
@ 2015-08-05  7:07     ` Bastien Guerry
  0 siblings, 0 replies; 15+ messages in thread
From: Bastien Guerry @ 2015-08-05  7:07 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-Mode mailing list, Marcin Borkowski

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> It's a first step. It would be nice to get rid of `org-split-string'
> altogether in the long run. We may make `org-split-string' an obsolete
> alias for `split-string', and update code base accordingly.

Agreed.  I was unclear, I meant: why not using split-string instead of
org-split-string. 

-- 
 Bastien

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

end of thread, other threads:[~2015-08-05  7:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-15 10:23 Why not push? Marcin Borkowski
2015-02-15 10:38 ` Nicolas Goaziou
2015-02-15 10:42   ` Eric Abrahamsen
2015-02-15 10:56     ` Marcin Borkowski
2015-02-15 12:26       ` Eric Abrahamsen
2015-02-15 22:31         ` Marcin Borkowski
2015-02-15 21:22   ` Yuri Niyazov
2015-02-15 21:31     ` Nicolas Goaziou
2015-02-15 21:40     ` Marcin Borkowski
2015-02-15 11:35 ` Rasmus
2015-02-15 22:33   ` Marcin Borkowski
2015-02-16  9:03 ` Sebastien Vauban
2015-08-05  0:00 ` Bastien Guerry
2015-08-05  6:21   ` Nicolas Goaziou
2015-08-05  7:07     ` Bastien Guerry

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).