From 271a5cedb6920d5aacae5ce0b19b5c8f9230adb5 Mon Sep 17 00:00:00 2001 From: opfez Date: Sun, 13 Jun 2021 12:11:06 +0200 Subject: [PATCH] improve fez/flash-region, remove string syntax highlighting --- custom.el | 17 +++++++++++++++-- themes/magik-theme.el | 2 +- tweaks.el | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/custom.el b/custom.el index 6a00039..b4f2b05 100644 --- a/custom.el +++ b/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")) diff --git a/themes/magik-theme.el b/themes/magik-theme.el index 8726853..136408a 100644 --- a/themes/magik-theme.el +++ b/themes/magik-theme.el @@ -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)) diff --git a/tweaks.el b/tweaks.el index 846152e..af1be35 100644 --- a/tweaks.el +++ b/tweaks.el @@ -14,6 +14,9 @@ (horizontal-scroll-bars . nil)))) (add-hook 'after-make-frame-functions 'my/disable-scroll-bars) +;; Disable startup screen +(setq inhibit-startup-screen t) + ;; Make sure UTF-8 is used. (set-language-environment "UTF-8")