improve fez/flash-region, remove string syntax highlighting
This commit is contained in:
parent
18cae6b35b
commit
271a5cedb6
17
custom.el
17
custom.el
|
@ -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"))
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
(font-lock-preprocessor-face (:foreground fg))
|
||||
(font-lock-regexp-grouping-backslash (:foreground fg))
|
||||
(font-lock-regexp-grouping-construct-face (:foreground fg))
|
||||
(font-lock-string-face (:foreground c9))
|
||||
(font-lock-string-face (:foreground fg))
|
||||
(font-lock-reference-face (:foreground fg))
|
||||
(font-lock-type-face (:foreground fg))
|
||||
(font-lock-variable-name-face (:foreground fg))
|
||||
|
|
Loading…
Reference in New Issue