about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index cdd4110..1a7e7f2 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -123,20 +123,20 @@ FILENAME and CONFIRM are passed directly to `write-file'."
123 "Replace \r\n with \n in BUFFER." 123 "Replace \r\n with \n in BUFFER."
124 (interactive "*b") 124 (interactive "*b")
125 (save-excursion 125 (save-excursion
126 (goto-char (point-min)) 126 (with-current-buffer buffer
127 (while (search-forward (string ?\C-m ?\C-j) nil t) 127 (goto-char (point-min))
128 (replace-match (string ?\C-j) nil t)))) 128 (while (search-forward (string ?\C-m ?\C-j) nil t)
129 129 (replace-match (string ?\C-j) nil t)))))
130(defun expand-file-name-exists-p (&rest expand-file-name-args) 130
131 "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning 131(defun expand-file-name-exists-p (&rest args)
132 its name if it exists, or NIL otherwise." 132 "Return `expand-file-name' ARGS if it exists, or nil."
133 (let ((file (apply #'expand-file-name expand-file-name-args))) 133 (let ((file (apply #'expand-file-name args)))
134 (if (file-exists-p file) 134 (if (file-exists-p file)
135 file 135 file
136 nil))) 136 nil)))
137 137
138(defun kill-region-or-backward-word (arg) 138(defun kill-region-or-backward-word (arg)
139 "Kill region if active, or backward word if not." 139 "If region is active, kill; otherwise kill word backward with ARG."
140 (interactive "p") 140 (interactive "p")
141 (if (region-active-p) 141 (if (region-active-p)
142 (kill-region (region-beginning) (region-end)) 142 (kill-region (region-beginning) (region-end))