diff options
author | defanor <defanor@uberspace.net> | 2018-04-24 03:07:38 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2018-04-24 03:07:38 +0300 |
commit | 7a7e5714f2e4966203b0bc25f8bd33827c96b24b (patch) | |
tree | 561989aa11ba4def7c4daba5371be598f985a2d9 /html-wysiwyg.el | |
parent | c3c944ec936b1980abc0f8adc2615d4e458da8f3 (diff) |
Rely on minor mode activation/deactivation to hide/show links, remove
unnecessary key bindings.
Diffstat (limited to 'html-wysiwyg.el')
-rw-r--r-- | html-wysiwyg.el | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/html-wysiwyg.el b/html-wysiwyg.el index 1a069fe..f5cab97 100644 --- a/html-wysiwyg.el +++ b/html-wysiwyg.el @@ -36,17 +36,15 @@ (define-minor-mode html-wysiwyg-mode "A minor mode for partial WYSIWYG editing of HTML, akin to org." - :after-hook (html-wysiwyg-initialise) - :keymap `((,(kbd "C-c , e") . html-wysiwyg-edit-link-at-point) - (,(kbd "C-c , h") . html-wysiwyg-hide-links) - (,(kbd "C-c , s") . html-wysiwyg-show-links))) - -(defun html-wysiwyg-initialise () - "Initialises html-wysiwyg-mode." - (interactive) - (add-to-list 'font-lock-extra-managed-props 'invisible) - (add-to-list 'font-lock-extra-managed-props 'help-echo) - (html-wysiwyg-hide-links)) + :keymap `((,(kbd "C-c , e") . html-wysiwyg-edit-link-at-point)) + (if html-wysiwyg-mode + ;; Enabled + (progn + (add-to-list 'font-lock-extra-managed-props 'invisible) + (add-to-list 'font-lock-extra-managed-props 'help-echo) + (html-wysiwyg-hide-links)) + ;; Disabled + (html-wysiwyg-show-links))) (defvar html-wysiwyg-link-match (rx (group "<a" (+? (not (any "<" ">"))) "href=" (syntax string-quote)) |