aaronbieber / dotfiles

The skeleton of my wonderful *NIX home folders and scripts.
309 stars 46 forks source link

air-org-set-tags--why use delq ""? #8

Closed rieje closed 6 years ago

rieje commented 6 years ago

In your air-org-set-tags function here, why did you use delq ""? This guy uses the same function but omitted it. Just curious--is it redundant?

P.S. I came across this from your blog and you also mentioned internal functions have double hyphens in their name as a convention. I have the follow code is the function considered an "internal function" and should it have double hyphens? It's not really a helper function (right?) but it's also not an interactive function, so I'm not sure whether to use double hyphens for best practices.

Thanks.

aaronbieber commented 6 years ago

C-h f delq<RET> will open the manual page for the delq function. There, it says:

Delete members of LIST which are ‘eq’ to ELT, and return the result. More precisely, this function skips any members ‘eq’ to ELT at the front of LIST, then removes members ‘eq’ to ELT from the remaining sublist by modifying its list structure, then returns the resulting list.

I must have done this because org-get-tags returns some empty strings and I didn't want to present those as selectable options.

To your second question, the double hyphen is a convention that is generally known to mean that the function is not to be used by the user themselves. Typically these are utility functions called directly by other functions. There are no hard and fast rules about this, it is part of your package's API design.