abo-abo / avy

Jump to things in Emacs tree-style
1.71k stars 109 forks source link

[Smart case] For precise movements that further narrow possible jump locations #295

Closed volodymyrprokopyuk closed 4 years ago

volodymyrprokopyuk commented 4 years ago

Hello,

I'd like to propose to change case insensitive search that highlights all possible jump locations to smart case search that has the following behavior:

Smart case search allows to be more precise in jumping around by further narrowing possible jump locations

abo-abo commented 4 years ago

What exactly do you mean by search? avy-goto-char-timer?

Because we have avy-case-fold-search for avy-goto-char.

volodymyrprokopyuk commented 4 years ago

Hello,

Yes, I mean the avy-goto-char-timer.

I have the below Avy configuration

(add-to-list 'load-path "~/.emacs.d/avy")
(require 'avy)
(global-set-key (kbd "M-j") 'avy-goto-char-timer)

How can I get smart case search described above for the avy-goto-char-timer case?

abo-abo commented 4 years ago

You should set:

(setq avy-case-fold-search nil)

avy-goto-char-timer calls avy--read-candidates, which will behave as you described when avy-case-fold-search is set to nil.

volodymyrprokopyuk commented 4 years ago

Hello,

Worked like a charm!

Thank you very much!

Hi-Angel commented 3 years ago
(setq avy-case-fold-search nil)

I should note though, the avy-case-fold-search documents a different behavior, it says setting it to nil makes it case-sensitive. Quote:

(defcustom avy-case-fold-search t
  "Non-nil if searches should ignore case."
  :type 'boolean)

Which btw is what I'm interested in: is there a way to make searches case-sensitive?

Hi-Angel commented 3 years ago

Although I stand corrected, the sentence "Non-nil if searches should ignore case." is vague, and can imply any behavior for nil value.