Browse Source

Tag index experimentation, more faces customization

* Face customization for magit diffs
* Turned on show-trailing-whitespace globally, and made the face more
muted so it isn't too annoying
master
Macoy Madson 2 years ago
parent
commit
a55707e18a
  1. 5
      Emacs/index-management.el
  2. 2
      Emacs/search.el
  3. 22
      Emacs/tags-and-autocompletion.el
  4. 16
      Emacs/visual-late.el

5
Emacs/index-management.el

@ -4,7 +4,8 @@
;; Index management: determine which index files to use for things like tags, codesearch, etc.
(defun macoy-set-index-directories (&optional code-dir data-dir)
"Change which directories Codesearch, tags, and other utilities create their indexes for"
"Change which directories Codesearch, tags, and other utilities create their indexes for.
Note that this does not perform any indexing."
(interactive)
(setq macoy-active-code-dir
(if code-dir
@ -30,5 +31,3 @@
(setq codesearch-cindex-args
(list "-reset" "-exclude" (format "%s/csearchIgnorePatterns" macoy-active-code-dir)))
(setq macoy-codesearch-search-data-dir macoy-active-data-search-dir))
;; TODO: Make codesearch support multiple index files. Is that possible?

2
Emacs/search.el

@ -122,7 +122,7 @@ If there's a string at point, offer that as a default."
(if (projectile-project-p)
(setq ag-arguments '("--smart-case" "--stats" "-G"
"(\\.txt|\\.org|\\.cpp|\\.c|\\.h|\\.inl|\\.html|\\.css|\\.lua|\\.js|\\.py|\\.cdm|\\.el)"
"--ignore" "AutoGen"))
"--ignore" ".*AutoGen.*"))
(setq ag-arguments '("--smart-case" "--stats")))
(if (and pattern directory)
(ag pattern directory)

22
Emacs/tags-and-autocompletion.el

@ -8,13 +8,16 @@
;; Don't prompt me to load tags
(setq tags-revert-without-query 1)
;; This sets tags-table-list in macoy-ido-find-tag-refresh
(setq macoy-tags-files nil)
;; Refresh and load tags
;; TODO: Use projectile refresh ctags instead
(if (eq system-type 'gnu/linux)
(setq ctags-path "ctags")
(setq ctags-path "C:/programsMacoy/ctags58/ctags.exe"))
(defun generateTags ()
(defun generateTags-ProjectileRoot ()
"Create tags file"
;; Doesn't do anything for start-process
;;(let ((default-directory "F:/CJUNCTIONS/src/")))
@ -36,6 +39,7 @@
)))
(set-process-sentinel ctagsProc
(lambda (ctagsProc _string)
(add-to-list 'macoy-tags-files (format "%s/TAGS" projectile-project-root))
(call-interactively 'macoy-ido-find-tag-refresh)))))
(defun loadTagsFromParent ()
@ -54,7 +58,7 @@
(lambda ()
(interactive)
;; Note that these are both subprocesses so they will run at the same time
(generateTags)
(generateTags-ProjectileRoot)
(macoy-codesearch-index-default)))
;; Tags keybinding
@ -75,11 +79,11 @@
(setq ac-auto-start 3)
;; Custom fuzzy completion stuff
(defun macoy-ido-example ()
"Test ido custom"
(interactive)
(setq mylist (list "red" "blue" "yellow" "clear" "i-dont-know"))
(ido-completing-read "What, ... is your favorite color? " mylist))
;; (defun macoy-ido-example ()
;; "Test ido custom"
;; (interactive)
;; (setq mylist (list "red" "blue" "yellow" "clear" "i-dont-know"))
;; (ido-completing-read "What, ... is your favorite color? " mylist))
;; Fuzzy find tag like Sublime's C-S-r
;; Also used for auto-completion
@ -89,13 +93,15 @@
"Refresh ido tag list"
(interactive)
(message "Refreshing tags table")
(setq tags-table-list macoy-tags-files)
(message "%s" tags-table-list)
;; tags-completion-table() early-outs if the table has already been created
;; This is problematic if TAGS has changed
;; Clearing it here ensures the table won't get out of sync
(when tags-completion-table
(setq tags-completion-table nil))
(tags-completion-table)
(message "Refreshing ido tags list")
;; Reset to remove "empty" value as well as avoid duplicates
(setq macoy-tag-names nil)

16
Emacs/visual-late.el

@ -22,8 +22,7 @@
'(80 70)
'(85 70)
'(90 70)
'(100 100)
))
'(100 100)))
(setq macoy-transparency-index 0)
(defun macoy-cycle-transparency (&optional index)
@ -153,6 +152,9 @@
(set-face-attribute 'magit-diff-removed nil
:foreground (face-foreground 'diff-added)
:background "#381e1e")
(set-face-foreground 'magit-diff-context (face-foreground 'font-lock-comment-face))
(set-face-foreground 'magit-diff-context-highlight (face-foreground 'font-lock-comment-face))
)
;; Get rid of the strange light gray background
@ -212,6 +214,16 @@
(diminish 'org-indent-mode)
)
;; Hide search term highlight in Occur (I think)
(setq list-matching-lines-face nil)
(set-face-foreground 'escape-glyph (face-foreground 'font-lock-warning-face))
;; Bad whitespace display
(setq-default show-trailing-whitespace t)
;; Ensure whitespace isn't shown in e.g. ido vertical (the ido-specific hooks didn't do the trick)
(add-hook 'minibuffer-inactive-mode-hook (lambda () (setq show-trailing-whitespace nil)))
(add-hook 'compilation-mode-hook (lambda () (setq show-trailing-whitespace nil)))
(set-face-foreground 'trailing-whitespace (face-foreground 'font-lock-comment-delimiter-face))
(set-face-background 'trailing-whitespace (face-foreground 'font-lock-comment-delimiter-face))

Loading…
Cancel
Save