unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Python fix for def and class highlighting
@ 2009-12-28 19:51 Nathaniel Flath
  2010-01-02  4:15 ` Nathaniel Flath
  0 siblings, 1 reply; 4+ messages in thread
From: Nathaniel Flath @ 2009-12-28 19:51 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 304 bytes --]

In python-mode, def and class are not highlighted as keywords until the
function or class name is started.  The attached patch will highlight these
properly without requiring whitespace or a name afterwards.  This makes it
more like elisp-mode, java-mode, cc-mode, and js2-mode.

Thanks,
Nathaniel Flath

[-- Attachment #1.2: Type: text/html, Size: 320 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: python-highlighting.patch --]
[-- Type: text/x-patch; name="python-highlighting.patch", Size: 988 bytes --]

Index: python.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v
retrieving revision 1.102
diff -u -r1.102 python.el
--- python.el	7 Dec 2009 20:06:31 -0000	1.102
+++ python.el	28 Dec 2009 19:50:30 -0000
@@ -106,9 +106,9 @@
     (,(rx symbol-start "None" symbol-end)	; see § Keywords in 2.5 manual
      . font-lock-constant-face)
     ;; Definitions
-    (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_))))
+    (,(rx symbol-start (group "class") (? (1+ space) (group (1+ (or word ?_)))))
      (1 font-lock-keyword-face) (2 font-lock-type-face))
-    (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_))))
+    (,(rx symbol-start (group "def") (? (1+ space) (group (1+ (or word ?_)))))
      (1 font-lock-keyword-face) (2 font-lock-function-name-face))
     ;; Top-level assignments are worth highlighting.
     (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=")

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

* Re: Python fix for def and class highlighting
  2009-12-28 19:51 Python fix for def and class highlighting Nathaniel Flath
@ 2010-01-02  4:15 ` Nathaniel Flath
  2010-01-02  8:35   ` Andreas Roehler
  2010-01-04 17:11   ` Davis Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Nathaniel Flath @ 2010-01-02  4:15 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

Just throwing this out again.  Is there a more specific list I should email?

Thanks,
Nathaniel Flath

On Mon, Dec 28, 2009 at 2:51 PM, Nathaniel Flath <flat0103@gmail.com> wrote:

> In python-mode, def and class are not highlighted as keywords until the
> function or class name is started.  The attached patch will highlight these
> properly without requiring whitespace or a name afterwards.  This makes it
> more like elisp-mode, java-mode, cc-mode, and js2-mode.
>
> Thanks,
> Nathaniel Flath
>

[-- Attachment #2: Type: text/html, Size: 799 bytes --]

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

* Re: Python fix for def and class highlighting
  2010-01-02  4:15 ` Nathaniel Flath
@ 2010-01-02  8:35   ` Andreas Roehler
  2010-01-04 17:11   ` Davis Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Roehler @ 2010-01-02  8:35 UTC (permalink / raw)
  To: Nathaniel Flath; +Cc: emacs-devel

Nathaniel Flath wrote:
> Just throwing this out again.  Is there a more specific list I should email?

AFAIK not. Seems core people are a little bit busy for the moment with switch to bazaar...
Maybe address the author?

Andreas



> 
> Thanks,
> Nathaniel Flath
> 
> On Mon, Dec 28, 2009 at 2:51 PM, Nathaniel Flath <flat0103@gmail.com
> <mailto:flat0103@gmail.com>> wrote:
> 
>     In python-mode, def and class are not highlighted as keywords until
>     the function or class name is started.  The attached patch will
>     highlight these properly without requiring whitespace or a name
>     afterwards.  This makes it more like elisp-mode, java-mode, cc-mode,
>     and js2-mode.
> 
>     Thanks,
>     Nathaniel Flath
> 
> 






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

* Re: Python fix for def and class highlighting
  2010-01-02  4:15 ` Nathaniel Flath
  2010-01-02  8:35   ` Andreas Roehler
@ 2010-01-04 17:11   ` Davis Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Davis Herring @ 2010-01-04 17:11 UTC (permalink / raw)
  To: Nathaniel Flath; +Cc: emacs-devel

> Just throwing this out again.  Is there a more specific list I should
> email?
>
> Thanks,
> Nathaniel Flath

File it as a bug report.  Then it will (eventually) be seen without the
need for manual reminders.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




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

end of thread, other threads:[~2010-01-04 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-28 19:51 Python fix for def and class highlighting Nathaniel Flath
2010-01-02  4:15 ` Nathaniel Flath
2010-01-02  8:35   ` Andreas Roehler
2010-01-04 17:11   ` Davis Herring

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).