summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-04-14 18:57:30 -0700
committerSean Whitton <spwhitton@spwhitton.name>2018-04-14 18:57:30 -0700
commitc905879720417e97fb192aff282aa3ae72129fbd (patch)
tree145a2037fe611e787e12208692dfa40534def11f
parent9214e272eadc0b1e01e60afebbd58d4dbde4bdd2 (diff)
downloaddotfiles-c905879720417e97fb192aff282aa3ae72129fbd.tar.gz
use some Emacs Lisp idioms found by bytecompiler
-rw-r--r--.emacs.d/init.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index c3841d80..bdc6e2d4 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1229,10 +1229,10 @@ actually calls `org-edit-src-code'."
(goto-char (point-min))
(while (search-forward-regexp "^[[:space:]\\)]*\)[[:space:]\\)]*$" nil "noerror")
(save-excursion
- (previous-line)
+ (forward-line -1)
(beginning-of-line)
(when (not (looking-at ".*;.*"))
- (next-line)
+ (forward-line 1)
(delete-indentation))))))
(defun spw--cleanup ()
@@ -1241,7 +1241,7 @@ actually calls `org-edit-src-code'."
Note that `ws-butler-mode' is also at work."
(save-restriction
(when (use-region-p)
- (narrow-to-region))
+ (narrow-to-region (region-beginning) (region-end)))
(case major-mode
(haskell-mode
(spw--compact-blank-lines)
@@ -1362,7 +1362,8 @@ Originally from <http://blog.gleitzman.com/post/35416335505/hunting-for-unicode-
(loop for (key . value) in unicode-map
do
(goto-char (point-min))
- (replace-regexp key value)))))
+ (while (re-search-forward key nil t)
+ (replace-match value))))))
(bind-key "C-c g u" 'gleitzman--unicode-hunt)
;;; saving lines