Hi, at stake is a command which closes forms at point in a general way: may it be a string, list, loop - whatever. https://github.com/emacs-berlin/general-close.git While it works with python-mode meanwhile, the related test fails in a strangely - see attachement. Note: the wrong result of parse-partial-sexp does not happen when called normally - only inside this temp-buffer. Any ideas? Thanks, Andreas