all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Regex to match underscore in function name in Python Mode?
@ 2017-07-23  2:12 Nate Bargmann
  2017-07-23  3:06 ` John Mastro
  2017-07-23  3:20 ` Skip Montanaro
  0 siblings, 2 replies; 10+ messages in thread
From: Nate Bargmann @ 2017-07-23  2:12 UTC (permalink / raw)
  To: help-gnu-emacs

In C mode I have the following in my ~/.emacs that will highlight a 
function name:

;; Highlight punctuation in C mode
(add-hook
 'c-mode-common-hook
 (lambda ()
   (font-lock-add-keywords
    nil
    '(("[<>:&*=+^%!~,.?;/-]"
       0 font-lock-warning-face nil)))
   ))

In C mode this will highlight all characters in a function name (left of 
the opening parentheses) to the word boundary including underscores.  I 
am attempting to use the same for python mode, however, the regex matches 
up to the first underscore, if there is one, but no further.  I'll admit 
to not be intimately familiar with Emacs regexes and I did try re-builder 
and was unable to get a match on the underscore.

Is it possible that Python Mode is blocking the regex from matching 
underscores?

TIA

- Nate

--

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://www.n0nb.us


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-29 23:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-23  2:12 Regex to match underscore in function name in Python Mode? Nate Bargmann
2017-07-23  3:06 ` John Mastro
2017-07-24 18:38   ` John Mastro
2017-07-24 21:09     ` Emanuel Berg
2017-07-24 21:23       ` John Mastro
2017-07-24 23:43         ` Emanuel Berg
2017-07-29  2:10     ` Nate Bargmann
2017-07-29 23:21       ` Emanuel Berg
2017-07-23  3:20 ` Skip Montanaro
2017-07-23  3:34   ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.