Thread: emacs highlight~

  1. #1
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    Arrow emacs highlight~

    Hi,all~

    I heard that emacs could supply syntax highlight for some programming languages such as C++, how to customize that please ? and what languages could enjoy that ?

    thanx in advance~



    Never end on learning~

  2. #2
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    ISBN: 1565921526

    It says how to do it in this book. You have to know what transient mode is.

    I think that this information is available online as well.
    < http://www.cs.utah.edu/dept/old/texi...emacs_toc.html >
    Last edited by Troll_King; 09-28-2002 at 05:08 AM.

  3. #3
    K.A.J
    Guest
    Ye, emacs can highlight syntax, there's many options that you can use to highlight keywords etc.

    it's well documented, and explains alot, but it's quite easy to use if you only want to highlight key words in your syntax, there should be a menu on emacs called options, check it out.

  4. #4
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    thanx for Troll_King, I'll check that for help~

    also thanx for K.A.J, I have that options menu but find no item about syntax highlight etc. my OS is RedHat7.1, could you show me something in details ?
    Never end on learning~

  5. #5
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    i recommend updating your emacs version before going on. the one that comes with redhat 7.1 is outdated, imho. not that it won't work, but the newer emacs has some extra features that relate to graphics.

    anyway, what kind of change do you want to make? emacs should come with c++ syntax highlighting already.

  6. #6
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Emacs hilighting can suck my [edited]. Did you see Mandrake 9.0? It's the best OS i've ever seen.

  7. #7
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    Whenever I save a file as a .c or a .cpp, it highlights the syntax for me. I didnt have to change any options for that, I guess it came setup for me.
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  8. #8
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    Originally posted by ygfperson
    i recommend updating your emacs version before going on. the one that comes with redhat 7.1 is outdated, imho. not that it won't work, but the newer emacs has some extra features that relate to graphics.

    anyway, what kind of change do you want to make? emacs should come with c++ syntax highlighting already.
    I'd like to practise with emacs about C++ and Python. I think my old version one didnt support Python as well~
    Never end on learning~

  9. #9
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Code:
    (set-background-color "wheat")
    (line-number-mode 1)
    (column-number-mode 1)
    (global-font-lock-mode)
    (setq visible-bell t)
    
    (setq auto-mode-alist
          (append
           '(("\\.h$"  . c++-mode))
           auto-mode-alist))
    
    (add-hook 'c-mode-common-hook
              (lambda ()
                (c-set-style "stroustrup")
                (setq c-basic-offset 4)))
    
    (custom-set-variables)
    (custom-set-faces
     '(font-lock-comment-face ((((class color) (background light)) (:foreground "Sienna"))))
     '(font-lock-string-face ((((class color) (background light)) (:foreground "DarkGreen"))))
     '(font-lock-keyword-face ((((class color) (background light)) (:foreground "Firebrick")))\
    )
     '(font-lock-constant-face ((((class color) (background light)) (:foreground "Navy"))))
     '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "Navy"))\
    ))
     '(font-lock-builtin-face ((((class color) (background light)) (:foreground "Navy")))))
    Like this. I hope Dean isn't stuck using GNU style?

  10. #10
    Registered User stautze's Avatar
    Join Date
    Apr 2002
    Posts
    195
    nick, that is out of your .emacs file?
    'During my service in the United States Congress, I took the initiative in creating the Internet.' - Al Gore, March 9, 1999: On CNN's Late Edition

  11. #11
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Yeah, it's a pretty simple one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. emacs characters size and feel
    By hamsteroid in forum Tech Board
    Replies: 10
    Last Post: 03-29-2007, 01:51 PM
  2. Emacs frames
    By frenchfry164 in forum Tech Board
    Replies: 2
    Last Post: 12-28-2003, 02:04 PM
  3. copying and pasting from emacs
    By curlious in forum Linux Programming
    Replies: 1
    Last Post: 12-13-2003, 10:08 PM
  4. Telnet Emacs
    By gnu-ehacks in forum Linux Programming
    Replies: 8
    Last Post: 12-10-2001, 01:02 PM
  5. configuring emacs
    By greenRoom in forum Linux Programming
    Replies: 2
    Last Post: 10-25-2001, 05:23 PM