Malabarba / names

A Namespace implementation for Emacs-Lisp
250 stars 19 forks source link

Questions About Using With Evil Macros #24

Open noctuid opened 8 years ago

noctuid commented 8 years ago

First off, thank you for the great package.

I want to use this for my packages that create evil text objects, and I noticed that I still have to type the namespace prefix when using evil-define-text-object. I'm guessing this is because the macro's debug section does not have what Names is looking for:

(debug (&define name lambda-list
                           [&optional stringp]
                           [&rest keywordp sexp]
                           def-body))

Is there another way to get names to correctly handle this or does the debug section in the macro have to be changed?

Also, when not using Names, magic autoload comments don't recognize evil-define-text-object, so the full autoload has to be specified (e.g. ;;;###autoload (autoload 'name ...). Can this be done with :autoload?

Malabarba commented 8 years ago

Hey there. At first sight I don't see anything wrong with that debug spec. But I haven't had my morning coffee yet, so I might be missing something silly. Could you give a concrete example where you need to write the full namespaces? Then I can try to investigate why it doesn't work for you.

As for the autoloads, I can't say I understand you. :) (But maybe I'm just half-asleep still). Inside a define-namespace, the :autoload keywords should work just like the ;;;###autload cookies. Could you give an example of your situation?

noctuid commented 8 years ago

As an example, if the namespace is evil-textobj-anyblock-, I still have to type it out after evil-define-text-object:

(evil-define-text-object evil-textobj-anyblock-inner-block (..args...)
...)

This will not be touched and will end up defined just as inner-block using Names:

(evil-define-text-object inner-block (..args...)
...)

If you need to see more, this is the package I'm using Names with.

As for the autoloads, can they be followed by a sexp corresponding to the full autoload that needs to be generated? I'm just checking to make sure that :autoload works how I would expect it to when something like a defun does not follow it.

This is what I would have without Names:

;;;###autoload (autoload 'evil-textobj-anyblock-inner-block "evil-textobj-anyblock" nil t)

This is what I would want to have with Names:

:autoload (autoload 'evil-textobj-anyblock-inner-block "evil-textobj-anyblock" nil t)

The sexp after :autoload would be put into the autoload file as it is.