Kinneyzhang / gkroam

A lightweight roam replica on top of emacs org-mode.
GNU General Public License v3.0
195 stars 8 forks source link

Develop #9

Closed llcc closed 4 years ago

Kinneyzhang commented 4 years ago

Thanks for your pull request! I have learned a lot techniques about how to write good Elisp code from your PR. The only problem is the indentation, your indentation fix does not displayed well in my emacs, mine is well displayed. I don't know the reason.

llcc commented 4 years ago

thanks for accepting those PRs. Basically they do not change any behavior of your package, except some coding optimizations.

Well, it seems that you use both space and tab for indenting. Mixing of them may cause some indentation problems.

Kinneyzhang commented 4 years ago

Well, it seems that you use both space and tab for indenting. Mixing of them may cause some indentation problems.

I use the following code to indent buffer or region, have you got the idea what's the problem here?

;; indent buffer
(defun indent-buffer()
  (interactive)
  (indent-region (point-min) (point-max)))

(defun indent-region-or-buffer()
  (interactive)
  (save-excursion
    (if (region-active-p)
    (progn
      (indent-region (region-beginning) (region-end))
      (message "Indent selected region."))
      (progn
    (indent-buffer)
    (message "Indent buffer.")))))
llcc commented 4 years ago

(setq-default indent-tabs-mode nil) will disable tab indentation by only using space. please check Emacs wiki: no tabs. I also suggest you to use the following two awesome elisp-coding packages:

  1. lispy
  2. aggressive-indent
Kinneyzhang commented 4 years ago

Thanks!