summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2014-04-10 19:33:37 +0100
committerAlan Pearce2014-04-10 19:33:37 +0100
commitd5e878314c0579cbd80df63beb7df7b416bb33a8 (patch)
tree48ac278b7d779bdc0734b03665bdcdde31277f95 /emacs
parent55b9f757183ff0e603482f7a085bab75a1a8643d (diff)
downloaddotfiles-d5e878314c0579cbd80df63beb7df7b416bb33a8.tar.lz
dotfiles-d5e878314c0579cbd80df63beb7df7b416bb33a8.tar.zst
dotfiles-d5e878314c0579cbd80df63beb7df7b416bb33a8.zip
Emacs: remove Windows line endings
Diffstat (limited to 'emacs')
-rw-r--r--emacs/elisp/ap-functions.el94
1 files changed, 47 insertions, 47 deletions
diff --git a/emacs/elisp/ap-functions.el b/emacs/elisp/ap-functions.el
index 37b8863..bdc7fae 100644
--- a/emacs/elisp/ap-functions.el
+++ b/emacs/elisp/ap-functions.el
@@ -1,47 +1,47 @@
-;;;###autoload

-(defun ap/remove-extra-cr ()

-  "Remove extraneous CR codes from a file"

-  (interactive)

-  (save-excursion

-    (goto-char (point-min))

-    (while (search-forward "

-" nil t)

-      (replace-match ""))))

-

-;;;###autoload

-(defun copy-rectangle (start end)

-  "Copy the region-rectangle."

-  (interactive "r")

-  (setq killed-rectangle (extract-rectangle start end)))

-

-;;;###autoload

-(defun eval-and-replace ()

-  "Replace the preceding sexp with its value."

-  (interactive)

-  (backward-kill-sexp)

-  (condition-case nil

-      (prin1 (eval (read (current-kill 0)))

-             (current-buffer))

-    (error (message "Invalid expression")

-           (insert (current-kill 0)))))

-

-;;;###autoload

-(defun shell-execute (to-current-buffer)

-  (interactive "P")

-  (let ((file-buffer (if (buffer-file-name)

-                         (file-name-nondirectory (buffer-file-name))

-                       ""))

-        (command (read-shell-command "Shell command: " nil nil nil)))

-    (shell-command (replace-regexp-in-string "%" file-buffer command) to-current-buffer)))

-

-;;;###autoload

-(defun narrow-to-region-indirect (start end)

-  "Restrict editing in this buffer to the current region, indirectly."

-  (interactive "r")

-  (deactivate-mark)

-  (let ((buf (clone-indirect-buffer nil nil)))

-    (with-current-buffer buf

-      (narrow-to-region start end))

-      (switch-to-buffer buf)))

-

-(provide 'ap-functions)

+;;;###autoload
+(defun ap/remove-extra-cr ()
+  "Remove extraneous CR codes from a file"
+  (interactive)
+  (save-excursion
+    (goto-char (point-min))
+    (while (search-forward "
+" nil t)
+      (replace-match ""))))
+
+;;;###autoload
+(defun copy-rectangle (start end)
+  "Copy the region-rectangle."
+  (interactive "r")
+  (setq killed-rectangle (extract-rectangle start end)))
+
+;;;###autoload
+(defun eval-and-replace ()
+  "Replace the preceding sexp with its value."
+  (interactive)
+  (backward-kill-sexp)
+  (condition-case nil
+      (prin1 (eval (read (current-kill 0)))
+             (current-buffer))
+    (error (message "Invalid expression")
+           (insert (current-kill 0)))))
+
+;;;###autoload
+(defun shell-execute (to-current-buffer)
+  (interactive "P")
+  (let ((file-buffer (if (buffer-file-name)
+                         (file-name-nondirectory (buffer-file-name))
+                       ""))
+        (command (read-shell-command "Shell command: " nil nil nil)))
+    (shell-command (replace-regexp-in-string "%" file-buffer command) to-current-buffer)))
+
+;;;###autoload
+(defun narrow-to-region-indirect (start end)
+  "Restrict editing in this buffer to the current region, indirectly."
+  (interactive "r")
+  (deactivate-mark)
+  (let ((buf (clone-indirect-buffer nil nil)))
+    (with-current-buffer buf
+      (narrow-to-region start end))
+      (switch-to-buffer buf)))
+
+(provide 'ap-functions)