X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=doc%2Felisp.py;h=1b0392e6528c71f29de10f9e9883c6075ec0012b;hb=HEAD;hp=1a96b12a900012cd8cd5be7d8612f710bc0b8893;hpb=4d367ac0b4d7bc5110a068856d958d8e88eb4f12;p=notmuch diff --git a/doc/elisp.py b/doc/elisp.py index 1a96b12a..1b0392e6 100644 --- a/doc/elisp.py +++ b/doc/elisp.py @@ -110,6 +110,13 @@ class EmacsLispSymbol(ObjectDescription): 'defface': 'face' } + category_for_objtype = { + 'defcustom': 'Emacs variable (customizable)', + 'defconst': 'Emacs constant', + 'defvar': 'Emacs variable', + 'defface': 'Emacs face' + } + @property def cell(self): """The cell in which to store symbol metadata.""" @@ -120,6 +127,11 @@ class EmacsLispSymbol(ObjectDescription): """The label for the documented object type.""" return self.objtype + @property + def category(self): + """Index category""" + return self.category_for_objtype[self.objtype] + def handle_signature(self, signature, signode): """Create nodes in ``signode`` for the ``signature``. @@ -137,7 +149,7 @@ class EmacsLispSymbol(ObjectDescription): def _add_index(self, name, target): index_text = '{name}; {label}'.format( - name=name, label=self.label) + name=name, label=self.category) self.indexnode['entries'].append( ('pair', index_text, target, '', None)) @@ -215,7 +227,7 @@ class EmacsLispFunction(EmacsLispSymbol): class EmacsLispKey(ObjectDescription): """A directive to document interactive commands via their bindings.""" - label = 'Interactive command' + label = 'Emacs command' def handle_signature(self, signature, signode): """Create nodes to ``signode`` for ``signature``. @@ -266,7 +278,7 @@ class EmacsLispKey(ObjectDescription): line=self.lineno) keymap[binding] = self.env.docname - index_text = '{name}; key binding'.format(name=binding) + index_text = '{name}; Emacs key binding'.format(name=binding) self.indexnode['entries'].append( ('pair', index_text, reftarget, '', None)) @@ -302,7 +314,7 @@ class EmacsLispDomain(Domain): """A domain to document Emacs Lisp code.""" name = 'el' - label = 'Emacs Lisp' + label = '' object_types = { # TODO: Set search prio for object types