From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Is there a way to make emacs display different functions in different colors? Date: Wed, 17 Sep 2014 01:08:07 +0200 Organization: Aioe.org NNTP Server Message-ID: <87mw9zupt4.fsf@debian.uxu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410909026 3469 80.91.229.3 (16 Sep 2014 23:10:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Sep 2014 23:10:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 17 01:10:19 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XU1t5-0006Rn-5i for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Sep 2014 01:10:19 +0200 Original-Received: from localhost ([::1]:41208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XU1t4-0000uG-JA for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2014 19:10:18 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 74 Original-NNTP-Posting-Host: P0uMB9BthHuWo8+BJXB4Mw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:+xZkRZsL0mszap7+yUGRrdXONso= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:207696 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99968 Archived-At: yoyobeermam@gmail.com writes: > For example, in Monodevelop, when you make a comment > in your script like this > > //This text is only a filler > > it will turn it green. Other functions have differing > colors too. I would like to know if it is possible to > make Emacs do this? Indeed, this is known as syntax highlighting and in the Emacs world it is sometimes called font-lock. Normally you don't need to worry about that, you only need to put Emacs in the correct mode. Try open a C source file (a file with a .c extension) - that should put you in the C mode, with highlighting included (specific highlighting for the C language). For scripts, there is something called the hash-bang line (hash = #, bang = !) in the beginning of the script (the first line). For zsh scripts, it can look like this: #! /bin/zsh or: #!/bin/zsh the path (/bin/zsh) is the path to the program that will execute the script if it is executed, in this case, the zsh interpreter itself. Scripts often don't have an extension (a suffix, like .c in the other example) which is why the hash-bang, rather than the suffix, is used by Emacs to put the buffer in the correct mode, which in turn will get you mode-specific highlighting. > you let me know of a script editor that supports C# > and this functionality? C# (and all other .NET things) on Linux must be done with tools like Mono, which I would strongly discourage from. Why don't you do C, or C++, instead? If you must do C# there might be a mode for that, as well (use Google - check out MELPA and the EmacsWiki in particular). If there isn't a C# mode, you can use the C++ or C mode: try M-x and then c-mode or c++-mode, after opening the C# source file - C# isn't that different. Then, take your completed file to Mono and you are all set. But trust me: the thing with the MS tools (and Apple for that matter) is, if you can stand them, they actually work and you can do wonderful things. If you can't stand them, but your boss or teacher tells you you must use them, just say that won't work, period. If you think you can sneak around the problem, using the Linux power tools and Emacs and all, my experience is that that will only make you more frustrated and involve even more overhead. Anyway, good luck! -- underground experts united