Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight builtins #39230

Closed
fisheggs mannequin opened this issue Sep 14, 2003 · 9 comments
Closed

Highlight builtins #39230

fisheggs mannequin opened this issue Sep 14, 2003 · 9 comments
Assignees

Comments

@fisheggs
Copy link
Mannequin

fisheggs mannequin commented Sep 14, 2003

BPO 805830
Nosy @rhettinger, @kbkaiser
Files
  • idlefork-builtin.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/kbkaiser'
    closed_at = <Date 2004-03-16.03:50:32.000>
    created_at = <Date 2003-09-14.01:29:46.000>
    labels = ['expert-IDLE']
    title = 'Highlight builtins'
    updated_at = <Date 2004-03-16.03:50:32.000>
    user = 'https://bugs.python.org/fisheggs'

    bugs.python.org fields:

    activity = <Date 2004-03-16.03:50:32.000>
    actor = 'kbk'
    assignee = 'kbk'
    closed = True
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2003-09-14.01:29:46.000>
    creator = 'fisheggs'
    dependencies = []
    files = ['5584']
    hgrepos = []
    issue_num = 805830
    keywords = ['patch']
    message_count = 9.0
    messages = ['44624', '44625', '44626', '44627', '44628', '44629', '44630', '44631', '44632']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'kbk', 'fisheggs']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue805830'
    versions = ['Python 2.4']

    @fisheggs
    Copy link
    Mannequin Author

    fisheggs mannequin commented Sep 14, 2003

    There was a recent discussion on c.l.p regarding shadowing builtins. (Summary, DONT).

    The point was made that decent editors should highlight builtins and keywords.

    The attached patch enables hightlighting of all entries in __builtin__ excluding those starting with a '_'

    @fisheggs fisheggs mannequin closed this as completed Sep 14, 2003
    @fisheggs fisheggs mannequin assigned kbkaiser Sep 14, 2003
    @fisheggs fisheggs mannequin added topic-IDLE labels Sep 14, 2003
    @kbkaiser
    Copy link
    Contributor

    kbkaiser commented Mar 8, 2004

    Logged In: YES
    user_id=149084

    Thanks for the patch!

    This also implemented a fix for IDLEfork bug
    [ 693418 ] Normal text background color not refreshed
    which is a significant contribution!

    Add a highlight theme for builtin keywords.
    Python Patch 805830 Nigel Rowe

    M ClassBrowser.py 1.8
    M ColorDelegator.py 1.13
    M EditorWindow.py 1.56
    M NEWS.txt 1.31
    M PyShell.py 1.87
    M TreeWidget.py 1.9
    M config-highlight.def 1.8
    M configDialog.py 1.57
    M configHandler.py 1.34

    @kbkaiser
    Copy link
    Contributor

    kbkaiser commented Mar 8, 2004

    Logged In: YES
    user_id=149084

    This also fixed
    Python [897872 ] Unknown color name on HP-UX

    @kbkaiser
    Copy link
    Contributor

    Logged In: YES
    user_id=149084

    There's bug in the patch: if a builtin keyword is typed after
    a ' or " (without an intervening space), the comment attribute
    is removed from the quote and the rest of the line is colorized
    as if it were not quoted.

    ## builtin = r"([^\\\\.]\b|^)" + any("BUILTIN", builtinlist) + r"\b"

    builtin = r"\b" + any("BUILTIN", builtinlist) + r"\b"

    seems to fix the symptom but the original obviously had a
    purpose (which I've been unable to decipher).

    @fisheggs
    Copy link
    Mannequin Author

    fisheggs mannequin commented Mar 11, 2004

    Logged In: YES
    user_id=756090

    The purpose of the r"([^\\\\.]\b|^)" is to prevent member vars with the
    same name as a builtin from being colorised.

    ie given self.file=file(filename) only the second 'file' should be colorised as
    the first one is NOT shadowing the builtin.

    However, you are quite right WRT the quoting bug.

    Changeing the r"([^\\\\.]\b|^)" to r"([^\\\\.'\\"]\b|^)" seems to fix it so that
    self.file = file("file")
    is colorised correctly. Ie the first 'file' is in Normal color, the second is in
    Builtins color and the third is in Strings color.

    --
    Nigel

    @fisheggs
    Copy link
    Mannequin Author

    fisheggs mannequin commented Mar 11, 2004

    Logged In: YES
    user_id=756090

    Damm that word wrap!!

    Nigel 
    

    @rhettinger
    Copy link
    Contributor

    Logged In: YES
    user_id=80475

    Can this be closed? This or something like it is already in.

    FWIW, the barney purple made the code harder to read rather
    that easier. I immediately switched to a color (drk brown)
    that was closer to the black used for surrounding text --
    that gave some differentiation without being distracting.

    @kbkaiser
    Copy link
    Contributor

    Logged In: YES
    user_id=149084

    I don't understand why SF doesn't fix it. It's a real
    aggravation for everyone. Gotta be trivial.

    Thanks for the fix!

    ColorDelegator 1.14

    @kbkaiser
    Copy link
    Contributor

    Logged In: YES
    user_id=149084

    Raymond must have a traumatic experience in his past.

    I muted the barney purple to royal purple. Don't blame
    Nigel Rowe, he used brown! I'm trying to keep the
    colors bright in the default scheme as I've seen comments
    that people like it that way. Maybe we need another scheme,
    say "Big Muddy" or "Arizona". But the config system just
    proved its worth :-) You don't like it, change it.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants