|
|
|
@ -28,14 +28,25 @@
|
|
|
|
|
(beginning-of-line) |
|
|
|
|
(looking-at-p "[[:space:]]*$"))) |
|
|
|
|
|
|
|
|
|
(defun fez/current-line-comment-p () |
|
|
|
|
"Checks if the current line is a commented out one or not." |
|
|
|
|
(save-excursion |
|
|
|
|
(beginning-of-line) |
|
|
|
|
(let ((a (point))) |
|
|
|
|
(end-of-line) |
|
|
|
|
(let ((b (point))) |
|
|
|
|
(comment-only-p a b))))) |
|
|
|
|
|
|
|
|
|
(defun fez/flash-region (&optional timeout) |
|
|
|
|
"Temporarily highlight region from START to END. Taken from SLIME source code and modified." |
|
|
|
|
(interactive) |
|
|
|
|
(transient-mark-mode) |
|
|
|
|
(save-excursion |
|
|
|
|
(mark-defun) |
|
|
|
|
;; Don't mark the line above the s-expression. |
|
|
|
|
(while (fez/current-line-empty-p) |
|
|
|
|
;; Don't mark the line or the comments above the s-expression. |
|
|
|
|
(while (or (fez/current-line-empty-p) |
|
|
|
|
(fez/current-line-comment-p)) |
|
|
|
|
;; Can probably be optimized... |
|
|
|
|
(forward-char)) |
|
|
|
|
(let* ((start (region-beginning)) |
|
|
|
|
(end (region-end)) |
|
|
|
@ -93,6 +104,8 @@
|
|
|
|
|
|
|
|
|
|
;;; Keybinds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; C-x C-z and C-z are normally mapped to suspend-frame, an absolutely useless function. |
|
|
|
|
;; Unbind them before making the keybind useful. |
|
|
|
|
(global-unset-key (kbd "C-x C-z")) |
|
|
|
|