emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Leaving out non-applicable commands on Mx


From: Drew Adams
Subject: RE: Leaving out non-applicable commands on Mx
Date: Fri, 8 Jan 2016 19:09:30 -0800 (PST)

> It is necessary to annotate the functions with the context they are
> suppossed to work on. Something like
> 
> (defun foo-something ()
>   "docstring"
>   (interactive)
>   (declare this-applies-to-foo-mode)
>   ...)

(put 'foo-something 'applies-to-foo-mode)

Or maybe:

(put 'foo-something
     (cl-pushnew 'foo-mode (get 'foo-something 'applicable-modes)))

> Doing that for every function is unnecessary work, so a method for
> saying "all the functions defined on this .el file apply to foo-mode,
> except foo-bar and foo-zoo" is a sensible enhancement. (We also could
> exploit the fact that we know wich functions are autoladed. Most
> autoloaded functions are context-free, while the non-autoloaded
> functions on the same file are context-specific).
> 
> Maintaining all this information on an external resource is
> unmanageable, it simply wont work.

Why not?

> So yes, the Elisp source files need
> to be annotated (that's the work I'm volunteering for).

If you can annotate them then you can put those annotations
on their symbols as a property used by your new library, no?

> For reading the annotations (and, possibly, for performance reasons,
> applying the filter) modifications are required on some Emacs
> infrastructure. 

Why?  What's wrong with `(get SYMBOL 'applies-to-foo-mode)'?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]