9

I sometimes use M-/ to complete words but it is not case sensitive. For example :

the word is : showPublic and when I write show and then put M-/, It completes as showpublic. How can I fix this ?

Or at least, how can I see the possible completion ?

Drew
  • 75,699
  • 9
  • 109
  • 225
Vivian Maya
  • 787
  • 1
  • 6
  • 17

2 Answers2

5

See options dabbrev-case-fold-search and dabbrev-upcase-means-case-search:

dabbrev-case-fold-search is a variable defined in `dabbrev.el'.
Its value is case-fold-search

  This variable can be risky when used as a file-local variable.

Documentation:
Control whether dabbrev searches should ignore case.
A value of nil means case is significant.
A value of `case-fold-search' means case is significant
 if `case-fold-search' is nil.
Any other non-nil version means case is not significant.

You can customize this variable.

dabbrev-upcase-means-case-search is a variable defined in `dabbrev.el'.
Its value is nil

Documentation:
The significance of an uppercase character in an abbreviation.
A nil value means case fold search when searching for possible expansions;
non-nil means case sensitive search.

This variable has an effect only when the value of
`dabbrev-case-fold-search' says to ignore case.

You can customize this variable.
Drew
  • 75,699
  • 9
  • 109
  • 225
3

-- this is meant to be a comment but I don't have enough reputation for it --

I did a quick test with emacs -Q

I typed "showPublic" then "show M-/" and it completed as "showPublic" (emacs 24.4) so I think it might be a configuration problem.

Could you retry editing your document in context while launching emacs with the -Q option?

If the completion is correct then it would be a configuration problem. Sorry to not be able to help more...

freakhill
  • 171
  • 4
  • It's fine, thank you for your attention, actually if I have only showPublic then yes It might complete fine, but If I don't or I do not really know why but generally when a buffer is big enough it doesn't complete right at all. – Vivian Maya Jan 17 '15 at 04:11
  • Try with both "showpublic" and "showPublic", with "showpublic" before point and "showPublic" after point. So the new entry will be in between the two. Now type "showP" and use M-/ ; it will complete to "showpublic", ignoring "showPublic" (even when pressing M-/ multiple times). – 9769953 Jul 04 '22 at 08:59