masasam / emacs-easy-hugo

Emacs major mode for managing hugo
https://gohugo.io/tools/editors/#emacs
GNU General Public License v3.0
362 stars 26 forks source link

I can't move to next blog when there is only 1 blog in easy-hugo-bloglist. #80

Closed xyslope closed 6 months ago

xyslope commented 8 months ago

Hi, I am using easy hugo for some years. I really like it.

The follwing code will do nothing when there is only 1 blog in easy-hugo-bloglist. (defun easy-hugo-next-blog () "Go to next blog." (when (< 1 (length easy-hugo-bloglist)) (if (eq (- (length easy-hugo-bloglist) 1) easy-hugo--current-blog) (setq easy-hugo--current-blog 0)

In that case, (length easy-hugo-bloglist) return 1 and exit the function.

Should it be either of the following code?

(boundp 'easy-hugo-bloglist) or (when (< 0 (length easy-hugo-bloglist))

Well, I am trying to fix this issue but haven't got good solution.

masasam commented 8 months ago

Hi, @xyslope ! Thank you for comment. I don't understand the situation, so could you show me the part of your init.el related to easy-hugo?

xyslope commented 6 months ago

I am really sorry. I can't remember what I wanted to say at that time. I will examine source codes later and make an new issue.

Thank you.