Skip to content

Commit

Permalink
Allow for entering obsidian-mode from gfm-mode (#81)
Browse files Browse the repository at this point in the history
I see many people (including me) using gfm-mode instead of markdown-mode for .md files, and it should be reasonable to use derived-mode-p here.
  • Loading branch information
knu authored Dec 3, 2023
1 parent f83c5d3 commit ab32faf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions obsidian.el
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ Optional argument ARG word to complete."

(defun obsidian-enable-minor-mode ()
"Check if current buffer is an `obsidian-file-p' and toggle `obsidian-mode'."
(when (equal major-mode 'markdown-mode)
(when (obsidian-file-p)
(obsidian-mode t))))
(and (derived-mode-p 'markdown-mode)
(obsidian-file-p)
(obsidian-mode t)))

(defun obsidian-update ()
"Command update everything there is to update in obsidian.el (tags, links etc.)."
Expand Down

0 comments on commit ab32faf

Please sign in to comment.