all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Is there a way to make emacs display different functions in different colors?
Date: Wed, 17 Sep 2014 01:08:07 +0200	[thread overview]
Message-ID: <87mw9zupt4.fsf@debian.uxu> (raw)
In-Reply-To: ab408ebe-e25c-4e27-a2b4-54d855e52a35@googlegroups.com

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


  reply	other threads:[~2014-09-16 23:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 22:45 Is there a way to make emacs display different functions in different colors? yoyobeermam
2014-09-16 23:08 ` Emanuel Berg [this message]
2014-09-17 12:15 ` Gian Uberto Lauri
2014-09-18  7:23   ` Tassilo Horn
     [not found]   ` <mailman.9083.1411025573.1147.help-gnu-emacs@gnu.org>
2014-09-18 21:09     ` Emanuel Berg
     [not found] ` <mailman.9030.1410956159.1147.help-gnu-emacs@gnu.org>
2014-09-17 21:14   ` Emanuel Berg
2014-09-17 21:24     ` Stefan Monnier
2014-09-18  7:42       ` Gian Uberto Lauri
2014-09-18  7:40     ` Gian Uberto Lauri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mw9zupt4.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.