Created
March 19, 2020 13:53
-
-
Save Jegeva/d77519db0d94d369a14ec938eae2f494 to your computer and use it in GitHub Desktop.
emacs nxml comment atag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
(defun nxml-comment-next-tag (&optional arg) | |
(interactive "^p") | |
(or arg (setq arg 1)) | |
(nxml-forward-element) | |
(nxml-backward-element) | |
(let (p1 p2) | |
(setq p1 (point)) | |
(nxml-forward-element) | |
(setq p2 (point)) | |
(goto-char p1) | |
(push-mark p2) | |
(setq mark-active t) | |
(kill-region p1 p2) | |
(kill-append " -->" nil) | |
(kill-append "<!-- " t) | |
(yank) | |
) | |
) | |
(define-key nxml-mode-map (kbd "C-c C-c") 'nxml-comment-next-tag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment