alphapapa / org-make-toc

Automatic tables of contents for Org-mode files
GNU General Public License v3.0
108 stars 18 forks source link

Use cadr instead of second #6

Closed benley closed 4 years ago

benley commented 5 years ago

second is an alias to cadr that comes from cl.el (I think) - and this package doesn't otherwise require cl.el.

alphapapa commented 5 years ago

I don't know why I used one over the other here, but they're both standard. cl is a standard Emacs package used by Emacs itself, so it's always loaded, so there's no benefit to not using it; it's not like an external dependency.

benley commented 5 years ago

Huh, ok. Somehow I've ended up with a setup where second is not defined, which seems weird:

Screenshot from 2019-04-27 19-04-22

(screenshot taken after running M-x org-make-toc)

I added (defalias 'second 'cadr) to my init.el as a workaround but it's odd that I should need that if cl is meant to always be loaded.

This is emacs 26.1 with various things loaded from melpa via use-package, including org-make-toc, but nothing super fancy. I'll try to figure out what's going on but if you have any pointers I would appreciate hearing them :-)

alphapapa commented 5 years ago

Sorry, I must have had a brain cramp when I replied. I forgot to mention that all of cl's functions were given the cl- prefix, so this package should use either cadr or cl-second. I don't know why your Emacs doesn't have second defined, as I thought that alias still existed. But anyway, you're right that a change needs to be made here. So I'll go ahead and merge this PR (soon; I need to update changelogs and stuff). Thanks for the submission.

alphapapa commented 4 years ago

Apparently I forgot to close this issue when I pushed e92fd443c998532ff786361ae72b6981dc1f2ff0. Thanks for your patience.