From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nate Bargmann Newsgroups: gmane.emacs.help Subject: Regex to match underscore in function name in Python Mode? Date: Sun, 23 Jul 2017 02:12:00 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1500776131 19208 195.159.176.226 (23 Jul 2017 02:15:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Jul 2017 02:15:31 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 23 04:15:26 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZ6QX-0004aZ-JH for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Jul 2017 04:15:25 +0200 Original-Received: from localhost ([::1]:48957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZ6Qa-0005TY-Sh for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jul 2017 22:15:28 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: Wlfd5sCJfRT8LR8i0V0nfQ.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Original-Xref: usenet.stanford.edu gnu.emacs.help:219151 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113834 Archived-At: 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