• I edit source code in both Emacs and VS Code. auto-revert-mode should enabled be so that Emacs can automatically reload a buffer whenever the associated file is modified in VS Code.
  • scroll-all-mode is used to synchronize cursor movement in opened windows in a same frame. When comparing two similar files, this mode is very useful.
  • I enable flyspell-prog-mode when editing source code, which will limit spell checking to comment.
  • I enable texfrag-mode to render LaTeX fragments in the comment. A filter function should be defined to transform the LaTeX fragments written in Doxygen format to LaTeX code.

    (defun texfrag-cpp-filter (str)
      "`texfrag-cpp-filter' filtering STR for C++ programming"
      (setq str (replace-regexp-in-string "^ *\\(/\\*\\)\\|\\(\\* \\)" "" str)))
    

    Then we assign this function to texfrag-equation-filter

    (setq texfrag-equation-filter #'texfrag-cpp-filter)
    

    img

  • When writing commit message in Magit, I enable flyspell-mode for spell checking and auto-fill-mode for wrapping long lines. Because the commit messages will not be wrapped when being viewed in Gitlab, auto-fill-mode is needed.

    Now detailed commit messages in Gitlab are easy to read as below.

    img