Add dos2unix & unix2dos conversion commands

This commit is contained in:
Henrik Lissner 2019-02-18 01:58:50 -05:00
parent 6956525f79
commit 4437d80133
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -281,6 +281,19 @@ selected, then the current line."
(setq beg (line-beginning-position) end (line-end-position))) (setq beg (line-beginning-position) end (line-end-position)))
(comment-or-uncomment-region beg end))) (comment-or-uncomment-region beg end)))
;;;###autoload
(defun doom/dos2unix ()
"Convert the current buffer to a Unix file encoding."
(interactive)
(set-buffer-file-coding-system 'undecided-unix nil))
;;;###autoload
(defun doom/unix2dos ()
"Convert the current buffer to a DOS file encoding."
(interactive)
(set-buffer-file-coding-system 'undecided-dos nil))
;; ;;
;; Advice ;; Advice