Beispiel #1
0
 def surrounding_text() -> SurroundingText:
     try:
         raw_info = rpc.call(
             "voicemacs-surrounding-text",
             [":chars-before", 30000, ":chars-after", 30000],
             # Use a very long timeout
             timeout=10,
             changes_state=False,
         )
     except porthole.PortholeConnectionError:
         return None
     return SurroundingText(text_before=raw_info["text-before"],
                            text_after=raw_info["text-after"])
Beispiel #2
0
 def emacs_company_highlight(number: int) -> None:
     """Move to a specific company candidate."""
     rpc.call("voicemacs-company-highlight", [number])
Beispiel #3
0
 def emacs_helm_goto_line(line_number: int):
     """Move to a specific line in the helm buffer."""
     # HACK: Technically it does change the state, but it doesn't mater if
     #   we do it multiple times.
     rpc.call("voicemacs-helm-goto-line", [line_number],
              changes_state=False)
Beispiel #4
0
 def emacs_company_show_doc(number: int) -> None:
     """Pop doc for a specific company candidate."""
     rpc.call("voicemacs-company-pop-doc", [number])
Beispiel #5
0
 def emacs_company_complete(number: int) -> None:
     """Pick & complete a numbered company candidate."""
     rpc.call("voicemacs-company-complete", [number])
Beispiel #6
0
 def org_set_todo(state: str) -> None:
     """Set the current item to a specific TODO state."""
     rpc.call("org-todo", [str(state)])
Beispiel #7
0
 def emacs_dired_highlight(number: int) -> None:
     """Move cursor to a Dired candidate by number."""
     # HACK: Technically it does change the state, but it doesn't mater if
     #   we do it multiple times.
     rpc.call("voicemacs-dired-move-to-item", [number], changes_state=False)
 def emacs_insert_yasnippet(snippet_name: str) -> None:
     """Insert a yasnippet by name."""
     rpc.call("voicemacs-insert-snippet", [snippet_name])