Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tellEmacs(self, state):
# log.info("telling emacs cursor state: %s" % state)
runEmacsCmd("(md-new-mic-state \"%s\")" % state)
def _noChoice(self):
runEmacsCmd("(md-switch-to-next-buffer-in-list %s)" % self.query, queryOnly=False)
def _query(self, ev=None):
output = runEmacsCmd(self.var)
try:
output = int(output)
except ValueError:
pass
self._met(output == self.value)
def _select(self, cmd, choice):
runEmacsCmd("(switch-to-buffer \"%s\")" % choice, queryOnly=False)
def _print(self, words):
# There's no good elisp way to handle putting characters into
# the search box AFAIK. You can get text in there but giving it
# focus disables search as you type.
inSearchMode = runEmacsCmd("isearch-mode") != 'nil'
inMiniBuffer = '*Minibuf-' in runEmacsCmd("(with-current-buffer (buffer-name))")
words = words if not self.allCaps else [i.upper() for i in words]
if inSearchMode or inMiniBuffer:
Text._print(self, words)
else:
runEmacsCmd("(md-insert-text \"%s\" %s %s)" % (words, emacsBool(self.spaceCheck),
emacsBool(self.capitalCheck)), dolog=True,
queryOnly=False)
def tellEmacs(self):
# this isn't ideal, because it only takes into account one type of requirement
# however that is the most common kind
keywordString = "'(" + " ".join([("\"%s\"" % x[0]) for x in self.keywords]) + ")"
for m in self.requirements:
if isinstance(m, ModeRequirement):
for mode in m.modes:
runEmacsCmd("(md-register-mode-keywords '%s %s)" % (mode, keywordString))
def onWordEvent(ev):
runEmacsCmd(u"(mandimus-word-event \"%s\")" % ev.words)