about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
authorCase Duckworth2021-05-01 15:24:43 -0500
committerCase Duckworth2021-05-01 15:24:43 -0500
commit0d73ec519244748643b49c933316898be437d8c5 (patch)
treead3960aeed936083e68e6a8c6a6f58d2001ab933 /lisp/acdw.el
parentConfigure Gnus Cloud (diff)
downloademacs-0d73ec519244748643b49c933316898be437d8c5.tar.gz
emacs-0d73ec519244748643b49c933316898be437d8c5.zip
Add `dos2unix'
Does the same thing (in general) as the dos2unix C program.  By which I mean,
it converts \r\n to \n in the buffer.  It doesn't do anything else.

... So it really doesn't do much of the same thing as dos2unix.
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index ab02a9e..f297691 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -30,6 +30,14 @@
30 30
31;;; Utility functions 31;;; Utility functions
32 32
33(defun dos2unix (buffer)
34 "Replace \r\n with \n in BUFFER."
35 (interactive "*b")
36 (save-excursion
37 (goto-char (point-min))
38 (while (search-forward (string ?\C-m ?\C-j) nil t)
39 (replace-match (string ?\C-j) nil t))))
40
33(defun expand-file-name-exists-p (&rest expand-file-name-args) 41(defun expand-file-name-exists-p (&rest expand-file-name-args)
34 "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning 42 "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning
35 its name if it exists, or NIL otherwise." 43 its name if it exists, or NIL otherwise."