Skip to content

Commit

Permalink
Show mode enable/disable message only if it is called interactively
Browse files Browse the repository at this point in the history
  • Loading branch information
syohex committed May 1, 2024
1 parent e93ea08 commit a0718c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

* Improvements:
- Apply url-unescape against URL in an inline link [GH-805][]
- Show mode toggle message only if it is called interactively

[gh-780]: https://github.com/jrblevin/markdown-mode/issues/780
[gh-802]: https://github.com/jrblevin/markdown-mode/issues/802
Expand Down
35 changes: 16 additions & 19 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1905,10 +1905,10 @@ See `markdown-hide-markup' for additional details."
(not markdown-hide-markup)
(> (prefix-numeric-value arg) 0)))
(if markdown-hide-markup
(progn (add-to-invisibility-spec 'markdown-markup)
(message "markdown-mode markup hiding enabled"))
(progn (remove-from-invisibility-spec 'markdown-markup)
(message "markdown-mode markup hiding disabled")))
(add-to-invisibility-spec 'markdown-markup)
(remove-from-invisibility-spec 'markdown-markup))
(when (called-interactively-p 'interactive)
(message "markdown-mode markup hiding %s" (if markdown-hide-markup "enabled" "disabled")))
(markdown-reload-extensions))


Expand Down Expand Up @@ -8286,9 +8286,8 @@ and disable it otherwise."
(if (eq arg 'toggle)
(not markdown-hide-urls)
(> (prefix-numeric-value arg) 0)))
(if markdown-hide-urls
(message "markdown-mode URL hiding enabled")
(message "markdown-mode URL hiding disabled"))
(when (called-interactively-p 'interactive)
(message "markdown-mode URL hiding %s" (if markdown-hide-urls "enabled" "disabled")))
(markdown-reload-extensions))


Expand Down Expand Up @@ -8524,9 +8523,8 @@ and disable it otherwise."
(if (eq arg 'toggle)
(not markdown-enable-wiki-links)
(> (prefix-numeric-value arg) 0)))
(if markdown-enable-wiki-links
(message "markdown-mode wiki link support enabled")
(message "markdown-mode wiki link support disabled"))
(when (called-interactively-p 'interactive)
(message "markdown-mode wiki link support %s" (if markdown-enable-wiki-links "enabled" "disabled")))
(markdown-reload-extensions))

(defun markdown-setup-wiki-link-hooks ()
Expand Down Expand Up @@ -8779,13 +8777,12 @@ if ARG is omitted or nil."
(not markdown-enable-math)
(> (prefix-numeric-value arg) 0)))
(if markdown-enable-math
(progn
(font-lock-add-keywords
'markdown-mode markdown-mode-font-lock-keywords-math)
(message "markdown-mode math support enabled"))
(font-lock-add-keywords
'markdown-mode markdown-mode-font-lock-keywords-math)
(font-lock-remove-keywords
'markdown-mode markdown-mode-font-lock-keywords-math)
(message "markdown-mode math support disabled"))
'markdown-mode markdown-mode-font-lock-keywords-math))
(when (called-interactively-p 'interactive)
(message "markdown-mode math support %s" (if markdown-enable-math "enabled" "disabled")))
(markdown-reload-extensions))


Expand Down Expand Up @@ -9036,9 +9033,9 @@ and disable otherwise."
(if (eq arg 'toggle)
(not markdown-fontify-code-blocks-natively)
(> (prefix-numeric-value arg) 0)))
(if markdown-fontify-code-blocks-natively
(message "markdown-mode native code block fontification enabled")
(message "markdown-mode native code block fontification disabled"))
(when (called-interactively-p 'interactive)
(message "markdown-mode native code block fontification %s"
(if markdown-fontify-code-blocks-natively "enabled" "disabled")))
(markdown-reload-extensions))

;; This is based on `org-src-lang-modes' from org-src.el
Expand Down

0 comments on commit a0718c7

Please sign in to comment.