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 ?

2 Answers 2

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.
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...

2
  • 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. Jan 17, 2015 at 4: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 4, 2022 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.