From d29032522aa0025035823c2ae0a70865f8c38bce Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 8 Sep 2021 08:02:13 -0500 Subject: blep --- lisp/acdw.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lisp') 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'." "Replace \r\n with \n in BUFFER." (interactive "*b") (save-excursion - (goto-char (point-min)) - (while (search-forward (string ?\C-m ?\C-j) nil t) - (replace-match (string ?\C-j) nil t)))) - -(defun expand-file-name-exists-p (&rest expand-file-name-args) - "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning - its name if it exists, or NIL otherwise." - (let ((file (apply #'expand-file-name expand-file-name-args))) + (with-current-buffer buffer + (goto-char (point-min)) + (while (search-forward (string ?\C-m ?\C-j) nil t) + (replace-match (string ?\C-j) nil t))))) + +(defun expand-file-name-exists-p (&rest args) + "Return `expand-file-name' ARGS if it exists, or nil." + (let ((file (apply #'expand-file-name args))) (if (file-exists-p file) file nil))) (defun kill-region-or-backward-word (arg) - "Kill region if active, or backward word if not." + "If region is active, kill; otherwise kill word backward with ARG." (interactive "p") (if (region-active-p) (kill-region (region-beginning) (region-end)) -- cgit 1.4.1-21-gabe81