From abc16ef68c7f184ab46ba8b6c073983137576e30 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 4 Aug 2021 10:45:53 -0400 Subject: [PATCH] refactor(cli): make all searches case-sensitive This is more predictable, and is safe as a global default in CLI sessions (but not in interactive ones). This indirectly fixes case insensitivity in our commit linter rules. --- core/cli/autoloads.el | 3 +-- core/cli/ci.el | 7 +++---- core/core-cli.el | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index 87d629f5f..c78fd1071 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -197,8 +197,7 @@ one wants that.") (defun doom-autoloads--scan (files &optional exclude literal) (require 'autoload) - (let (case-fold-search ; case-sensitive regexp from here on - autoloads) + (let (autoloads) (dolist (file files (nreverse (delq nil autoloads))) (when (and (or (null exclude) (seq-remove (doom-rpartial #'string-match-p file) diff --git a/core/cli/ci.el b/core/cli/ci.el index 0806d69a9..c512acafc 100644 --- a/core/cli/ci.el +++ b/core/cli/ci.el @@ -182,8 +182,7 @@ (defun doom-cli--ci-lint-commits (from &optional to) (let ((errors? 0) - commits - case-fold-search) + commits) (with-temp-buffer (insert (cdr (doom-call-process @@ -201,8 +200,8 @@ (point-max)))))) commits))) (dolist (commit commits) - (let (errors) - (with-temp-buffer + (with-temp-buffer + (let (errors) (save-excursion (insert (cdr commit))) (dolist (rule doom-cli-commit-rules) (save-excursion diff --git a/core/core-cli.el b/core/core-cli.el index e98cc3897..65510bf85 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -69,6 +69,8 @@ purpose.") (setq make-backup-files nil) ;; Stop user configuration from interfering with package management (setq enable-dir-local-variables nil) +;; Reduce ambiguity, embrace specificity. It's more predictable. +(setq-default case-fold-search nil) ;; Default to using all cores, rather than half of them, since we compile things ;; ahead-of-time in a non-interactive session.