Browse Source

improve fez/flash-region, remove string syntax highlighting

master
opfez 1 year ago
parent
commit
271a5cedb6
  1. 17
      custom.el
  2. 2
      themes/magik-theme.el
  3. 3
      tweaks.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"))

2
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))

3
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")

Loading…
Cancel
Save