Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Did you add the code above to your dotfile, and restart Emacs? Then, what is the value of the post-self-insert-hook while you are woking in some LaTeX buffer?
I have not looked further into the problem, but I guess you can simply define a function (defun nottexmathp () (not (texmathp))) and use it as condition :cond #'nottexmathp.
I am not sure what you are trying to do, but I see a root.mainloop(), so I guess you would want to set compile-command and then use M-x (re)compile (you can prefix it with a universal argument to run the compile buffer in comint-mode, i.e. make it interactive). You can use the following to set the compile command automatically (add-hook 'python-mode-hook (lambda () (setq-local compile-command (format "python %s" buffer-file-name))))
If you'd like to use a debugger, then probably LSP-mode will be easiest to use. Otherwise, indeed, as mentioned by @Ian, go with eglot. Personally, I think the best option for a starter is to use a starter kit like Spacemacs or Doom Emacs, they are great (and can be used with Emacs keybindings, although the experience is better when using vim/evil keybindings).
Not sure what exactly causes this message, but maybe you can try installing elpy via M-x package-list-packages, while making sure that you install from the 'melpa-stable' archive.
I am not sure what is the goal here; or why you could not just use: (let ((a 5)) (format "%d" (transform a))) (you could surround that (transfrom a) with a replacer and/or replace %d with %s if necessary). Could you clear that up? B.t.w. a sexp does not have to start with a ( (see e.g. Parsing Expressions).
And I forgot to mention that I printed out also (buffer-substring (point) (point-max)) and indeed then we can see that point ends up at various places.
Okay, I can reproduce it now indeed. Weird indeed. As the comment before the line-move-1 definition says it is the gut of previous-line, I have tried using previous-line also, then the behavior is even more weird. Also, I have tried (forward -1) in which case the function seems to work correctly. Furthermore, I have used all variants of move-around within test.txt itself, in which case all variants seem to work fine. I have no idea what happens here (you could file a bug and you might get an answer), but at least using (forward-line -1) seems to work correctly.
Your question is not completely clear to me, but can't you just use org-sort? Just make sure that your cursor is placed before the first heading (it works fine here).