tag:blogger.com,1999:blog-2304251215826746968.post7121228017629550626..comments2023-08-25T07:40:19.012-07:00Comments on Life Is Too Short For Bad Code: Emacs Tip #17: flyspell and flyspell-prog-modeahttp://www.blogger.com/profile/03202031495623868181noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-2304251215826746968.post-90008098858607280532013-01-15T01:07:05.916-08:002013-01-15T01:07:05.916-08:00Thanks! I didn't know this "flyspell-prog...Thanks! I didn't know this "flyspell-prog-mode". Now I do :)דרור עתריהhttps://www.blogger.com/profile/08225224513037677503noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-19210684109156582242011-12-20T10:51:26.779-08:002011-12-20T10:51:26.779-08:00@awhan
This should work:
(add-hook 'c-mode-co...@awhan<br /><br />This should work:<br />(add-hook 'c-mode-common-hook 'flyspell-prog-mode)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-28761472581069643462010-01-22T08:45:25.758-08:002010-01-22T08:45:25.758-08:00@BFW The issue is that C/C++ mode puts the content...@BFW The issue is that C/C++ mode puts the contents of <> in the font-lock-string-face face, which is one of the faces in flyspell-prog-text-faces. Thus, flyspell checks it. One could create a separate face for #include files, based on font-lock-string-face so that it has the same display characteristics, but with a different symbol so that it is not found in flyspell-prog-text-faces.<br /Brad Howeshttps://www.blogger.com/profile/08528573706003500744noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-91303993353001418032009-07-29T11:46:49.114-07:002009-07-29T11:46:49.114-07:00@awhan You've got me stumped. It does indeed ...@awhan You've got me stumped. It does indeed look like flyspell is checking all the words.<br /><br />The last ideas I have are<br /><br />1) check the value of flyspell-generic-check-word-predicate - in prog mode, it should be set to 'flyspell-generic-progmode-verify.<br /><br />(that's the only difference between prog mode and normal)<br /><br />2) if that doesn't solve it, ahttps://www.blogger.com/profile/03202031495623868181noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-56494533549635616762009-07-24T10:10:35.661-07:002009-07-24T10:10:35.661-07:00Yes I did try M-x flyspell-prog-mode and it works....Yes I did try M-x flyspell-prog-mode and it works. The relevant content of my .emacs is as follows :<br /><br />(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)<br />(add-hook 'message-mode-hook 'turn-on-flyspell)<br />(add-hook 'text-mode-hook 'turn-on-flyspell)<br />(add-hook 'c-mode-common-hook 'flyspell-prog-mode)<br />(awhanhttps://www.blogger.com/profile/06671072876210284951noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-59357932680846171752009-07-23T06:00:13.879-07:002009-07-23T06:00:13.879-07:00@awhan Have you tried just doing M-x flyspell-prog...@awhan Have you tried just doing M-x flyspell-prog-mode when in a C++ buffer? If that works, then you just need to find the right hook to add 'turn-on-flyspell to the right hook, which for C/C++ should be (add-hook 'c-mode-common-hook 'flyspell-prog-mode)ahttps://www.blogger.com/profile/03202031495623868181noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-34689429973524757172009-07-23T02:41:05.455-07:002009-07-23T02:41:05.455-07:00i can't seem to enable flyspell-prog-mode for ...i can't seem to enable flyspell-prog-mode for .cpp files. could you help me with the correct .emacs settings ?awhanhttps://www.blogger.com/profile/06671072876210284951noreply@blogger.comtag:blogger.com,1999:blog-2304251215826746968.post-85160902437317093862008-04-07T11:34:00.000-07:002008-04-07T11:34:00.000-07:00I've been using flyspell mode for quite a while an...I've been using flyspell mode for quite a while and love it. However, your tip made me discover the flyspell-prog-mode, which will come in much more handy for code. ThanksAndrewhttps://www.blogger.com/profile/16084965122388934878noreply@blogger.com