Skip to content

Commit

Permalink
Add deft-case-fold-search variable
Browse files Browse the repository at this point in the history
This lets you override the global value for `case-fold-search` when
searching with Deft.
  • Loading branch information
Dale Sedivec authored and jrblevin committed Jul 7, 2021
1 parent 9a3b12d commit 00ccfc6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions deft.el
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@ example, set this variable to \"%FT%T%z\". See
:type 'boolean
:group 'deft)

(defcustom deft-case-fold-search t
"If non-nil, searching is case-insensitive."
:type 'boolean
:group 'deft)

(defcustom deft-incremental-search t
"Use incremental string search when non-nil and regexp search when nil.
During incremental string search, substrings separated by spaces are
Expand Down Expand Up @@ -939,9 +944,10 @@ Available methods are 'mtime and 'title.")
"Function to use when matching files against filter strings STR.
This function calls `search-forward' when `deft-incremental-search'
is non-nil and `re-search-forward' otherwise."
(if deft-incremental-search
(search-forward str nil t)
(re-search-forward str nil t)))
(let ((case-fold-search deft-case-fold-search))
(if deft-incremental-search
(search-forward str nil t)
(re-search-forward str nil t))))

(defun deft-set-mode-name ()
"Set the mode line text based on search mode."
Expand Down

0 comments on commit 00ccfc6

Please sign in to comment.