unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C++ mode.
@ 2003-05-20 14:38 K Hollingworth
  2003-05-27  7:18 ` Lars Brange
  2003-05-27 13:25 ` Rob Thorpe
  0 siblings, 2 replies; 11+ messages in thread
From: K Hollingworth @ 2003-05-20 14:38 UTC (permalink / raw)


According to emacs I have 

GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
porky.devel.redhat.com

I would like to customise c++ mode so that lines starting std::cerr are
marked in a different red as most of them are for debugging and it
would be nice to be able to spot them easily.  Is this possible?  It
would be acceptable to mark everything in the std namespace in red.

I'm a bit of a newbie with emacs so apologies as I don't know all the
terminology yet!

-- 
 Kirsty Hollingworth                                <kh25@york.ac.uk>
      Department of Biology, University of York, York, YO10 5YW

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

* Re: C++ mode.
  2003-05-20 14:38 C++ mode K Hollingworth
@ 2003-05-27  7:18 ` Lars Brange
  2003-05-27 13:25 ` Rob Thorpe
  1 sibling, 0 replies; 11+ messages in thread
From: Lars Brange @ 2003-05-27  7:18 UTC (permalink / raw)



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

Look at the font-lock function in the manual. See below for an example from
my .emacs file.

(defun lars-setup-color-faces ()
  (custom-set-faces
   '(font-lock-comment-face             ((t (:foreground "darkblue" :bold
nil))) t)
   '(font-lock-string-face              ((t (:foreground "darkgreen"))) t)
   '(font-lock-keyword-face             ((t (:foreground "red" :bold nil)))
t)
   '(font-lock-builtin-face             ((t (:foreground "black" :bold nil)))
t)
   '(font-lock-function-name-face       ((t (:foreground "black" :bold t)))
t)
   '(font-lock-variable-name-face       ((t (:foreground "black"))) t)
   '(font-lock-type-face                ((t (:foreground "red" :bold nil)))
t)
   '(font-lock-constant-face            ((t (:foreground "black" :bold t)))
t)
   '(font-lock-warning-face             ((t (:foreground "black" :bold t)))
t)
   '(font-lock-reference-face           ((t (:foreground "green" :bold t)))
t)
   '(font-lock-doc-string-face          ((t (:foreground "blue"))) t)

   '(highlight                          ((t (:foreground "cyan" :background
"darkblue"))) t)
   '(zmacs-region                       ((t (:foreground "white" :background
"darkblue"))) t)
   '(isearch                            ((t (:foreground "white" :background
"darkblue"))) t)

   '(irchat-my-nick-highlight           ((t (:foreground "yellow" :background
"blue" :bold t))) t)

   '(dired-face-permissions             ((t (:foreground "white" :background
"blue"))) t)

   '(gnus-cite-face-1                   ((t (:foreground "green"))) t)
   '(gnus-cite-face-2                   ((t (:foreground "cyan"))) t)
   '(gnus-cite-face-3                   ((t (:foreground "pink"))) t)
   '(gnus-cite-face-4                   ((t (:foreground "red"))) t)))


(lars-setup-color-faces)
(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)


Lars

K Hollingworth wrote:

> According to emacs I have
>
> GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
> porky.devel.redhat.com
>
> I would like to customise c++ mode so that lines starting std::cerr are
> marked in a different red as most of them are for debugging and it
> would be nice to be able to spot them easily.  Is this possible?  It
> would be acceptable to mark everything in the std namespace in red.
>
> I'm a bit of a newbie with emacs so apologies as I don't know all the
> terminology yet!
>
> --
>  Kirsty Hollingworth                                <kh25@york.ac.uk>
>       Department of Biology, University of York, York, YO10 5YW




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

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: C++ mode.
  2003-05-20 14:38 C++ mode K Hollingworth
  2003-05-27  7:18 ` Lars Brange
@ 2003-05-27 13:25 ` Rob Thorpe
  2003-05-27 15:55   ` K Hollingworth
  1 sibling, 1 reply; 11+ messages in thread
From: Rob Thorpe @ 2003-05-27 13:25 UTC (permalink / raw)


K Hollingworth <kh25@york.ac.uk> wrote in message news:<badelr$paa$2@pump1.york.ac.uk>...
> According to emacs I have 
> 
> GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
> porky.devel.redhat.com
> 
> I would like to customise c++ mode so that lines starting std::cerr are
> marked in a different red as most of them are for debugging and it
> would be nice to be able to spot them easily.  Is this possible?  It
> would be acceptable to mark everything in the std namespace in red.
> 
> I'm a bit of a newbie with emacs so apologies as I don't know all the
> terminology yet!

M-x highlight-phrase RET std:cerr RET

In the buffer when you need it would be what I would do.

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

* Re: C++ mode.
  2003-05-27 13:25 ` Rob Thorpe
@ 2003-05-27 15:55   ` K Hollingworth
  2003-05-28  8:18     ` Rob Thorpe
  0 siblings, 1 reply; 11+ messages in thread
From: K Hollingworth @ 2003-05-27 15:55 UTC (permalink / raw)


Rob Thorpe <robert.thorpe@antenova.com> wrote:
> K Hollingworth <kh25@york.ac.uk> wrote in message news:<badelr$paa$2@pump1.york.ac.uk>...
>> According to emacs I have 
>> 
>> GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
>> porky.devel.redhat.com
>> 
>> I would like to customise c++ mode so that lines starting std::cerr are
>> marked in a different red as most of them are for debugging and it
>> would be nice to be able to spot them easily.  Is this possible?  It
>> would be acceptable to mark everything in the std namespace in red.
>> 
>> I'm a bit of a newbie with emacs so apologies as I don't know all the
>> terminology yet!

> M-x highlight-phrase RET std:cerr RET

> In the buffer when you need it would be what I would do.

Do I need to load another package to get that?   Emacs says "no match"
when I try that command and if I try matching "highlight" I only get the
following completions:

highlight-changes-mode		   highlight-changes-next-change
highlight-changes-previous-change  highlight-changes-remove-highlight
highlight-changes-rotate-faces	   highlight-compare-with-file


-- 
 Kirsty Hollingworth                                <kh25@york.ac.uk>
      Department of Biology, University of York, York, YO10 5YW

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

* Re: C++ mode.
  2003-05-27 15:55   ` K Hollingworth
@ 2003-05-28  8:18     ` Rob Thorpe
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Thorpe @ 2003-05-28  8:18 UTC (permalink / raw)


K Hollingworth <kh25@york.ac.uk> wrote in message news:<bb01p9$qhu$1@pump1.york.ac.uk>...
> Rob Thorpe <robert.thorpe@antenova.com> wrote:
> > K Hollingworth <kh25@york.ac.uk> wrote in message news:<badelr$paa$2@pump1.york.ac.uk>...
> >> According to emacs I have 
> >> 
> >> GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit) of Fri Mar 16 2001 on
> >> porky.devel.redhat.com
> >> 
> >> I would like to customise c++ mode so that lines starting std::cerr are
> >> marked in a different red as most of them are for debugging and it
> >> would be nice to be able to spot them easily.  Is this possible?  It
> >> would be acceptable to mark everything in the std namespace in red.
> >> 
> >> I'm a bit of a newbie with emacs so apologies as I don't know all the
> >> terminology yet!
>  
> > M-x highlight-phrase RET std:cerr RET
>  
> > In the buffer when you need it would be what I would do.
> 
> Do I need to load another package to get that?   Emacs says "no match"
> when I try that command and if I try matching "highlight" I only get the
> following completions:
> 
> highlight-changes-mode		   highlight-changes-next-change
> highlight-changes-previous-change  highlight-changes-remove-highlight
> highlight-changes-rotate-faces	   highlight-compare-with-file

Sorry about that, this function is new in Emacs 21 I hadn't noticed. 
Look for hi-lock.el if you can't use Emacs 21.  I can't find it
elsewhere I'm afraid.  You probably could adapt C++ mode, but I don't
know how.

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

* c++ mode
@ 2006-11-11 20:28 Gary Wessle
  2006-11-11 20:54 ` Markus Triska
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Gary Wessle @ 2006-11-11 20:28 UTC (permalink / raw)


Hi

I have c++ mode on but can not get the feature where you hit ";, {, }"and
it will go to next line.
is there a variable need setting?

thanks

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

* Re: c++ mode
  2006-11-11 20:28 c++ mode Gary Wessle
@ 2006-11-11 20:54 ` Markus Triska
  2006-11-11 21:18 ` David Hansen
       [not found] ` <mailman.441.1163280215.2155.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: Markus Triska @ 2006-11-11 20:54 UTC (permalink / raw)


Gary Wessle <phddas@yahoo.com> writes:


> I have c++ mode on but can not get the feature where you hit ";, {,
> }"and it will go to next line.  is there a variable need setting?

,----
| C-c C-a runs the command c-toggle-auto-newline
|    which is an interactive compiled Lisp function in `cc-cmds.el'.
| It is bound to C-c C-a, <menu-bar> <C++> <Toggle...> <Auto newline>.
| (c-toggle-auto-newline &optional arg)
| 
| Toggle auto-newline feature.
| Optional numeric arg, if supplied, turns on auto-newline when
| positive, turns it off when negative, and just toggles it when zero or
| left out.
| 
| Turning on auto-newline automatically enables electric indentation.
| 
| When the auto-newline feature is enabled (indicated by "/la" on the
| modeline after the mode name) newlines are automatically inserted
| after special characters such as brace, comma, semi-colon, and colon.
`----


Best wishes! -- Markus Triska

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

* Re: c++ mode
  2006-11-11 20:28 c++ mode Gary Wessle
  2006-11-11 20:54 ` Markus Triska
@ 2006-11-11 21:18 ` David Hansen
       [not found] ` <mailman.441.1163280215.2155.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: David Hansen @ 2006-11-11 21:18 UTC (permalink / raw)


On 12 Nov 2006 07:28:42 +1100 Gary Wessle wrote:

> I have c++ mode on but can not get the feature where you hit ";, {, }"and
> it will go to next line.
> is there a variable need setting?

C-c C-a should do it.

David

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

* Re: c++ mode
       [not found] ` <mailman.441.1163280215.2155.help-gnu-emacs@gnu.org>
@ 2006-11-12  3:57   ` Gary Wessle
  2006-11-12 11:12     ` David Hansen
  2006-11-13 16:08     ` Kevin Rodgers
  0 siblings, 2 replies; 11+ messages in thread
From: Gary Wessle @ 2006-11-12  3:57 UTC (permalink / raw)


David Hansen <david.hansen@gmx.net> writes:

> On 12 Nov 2006 07:28:42 +1100 Gary Wessle wrote:
> 
> > I have c++ mode on but can not get the feature where you hit ";, {, }"and
> > it will go to next line.
> > is there a variable need setting?
> 
> C-c C-a should do it.
> 
> David
c-toggle-auto-line-whatever...
I don't have this variable
GNU Emacs 21.4.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2006-03-07 on hs20-bc1-6.build.redhat.com 

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

* Re: c++ mode
  2006-11-12  3:57   ` Gary Wessle
@ 2006-11-12 11:12     ` David Hansen
  2006-11-13 16:08     ` Kevin Rodgers
  1 sibling, 0 replies; 11+ messages in thread
From: David Hansen @ 2006-11-12 11:12 UTC (permalink / raw)


On 12 Nov 2006 14:57:42 +1100 Gary Wessle wrote:

> David Hansen <david.hansen@gmx.net> writes:
>
>> On 12 Nov 2006 07:28:42 +1100 Gary Wessle wrote:
>> 
>> > I have c++ mode on but can not get the feature where you hit ";, {, }"and
>> > it will go to next line.
>> > is there a variable need setting?
>> 
>> C-c C-a should do it.
>> 
>> David
> c-toggle-auto-line-whatever...
> I don't have this variable
> GNU Emacs 21.4.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
> of 2006-03-07 on hs20-bc1-6.build.redhat.com 

Sorry, I'm running Emacs 22 here.  Have a look at the cc-mode
manual.  I'm pretty sure the feature exists on Emacs 22 too.

David

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

* Re: c++ mode
  2006-11-12  3:57   ` Gary Wessle
  2006-11-12 11:12     ` David Hansen
@ 2006-11-13 16:08     ` Kevin Rodgers
  1 sibling, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2006-11-13 16:08 UTC (permalink / raw)


Gary Wessle wrote:
> David Hansen <david.hansen@gmx.net> writes:
> 
>> On 12 Nov 2006 07:28:42 +1100 Gary Wessle wrote:
>>
>>> I have c++ mode on but can not get the feature where you hit ";, {, }"and
>>> it will go to next line.
>>> is there a variable need setting?
>> C-c C-a should do it.
>>
>> David
> c-toggle-auto-line-whatever...
> I don't have this variable
> GNU Emacs 21.4.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars)
> of 2006-03-07 on hs20-bc1-6.build.redhat.com 

c-toggle-auto-newline is a command, not a variable.  You need to call
(c-toggle-auto-newline 1) in an appropriate hook, probably
c-mode-common-hook.

-- 
Kevin

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

end of thread, other threads:[~2006-11-13 16:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-20 14:38 C++ mode K Hollingworth
2003-05-27  7:18 ` Lars Brange
2003-05-27 13:25 ` Rob Thorpe
2003-05-27 15:55   ` K Hollingworth
2003-05-28  8:18     ` Rob Thorpe
  -- strict thread matches above, loose matches on Subject: below --
2006-11-11 20:28 c++ mode Gary Wessle
2006-11-11 20:54 ` Markus Triska
2006-11-11 21:18 ` David Hansen
     [not found] ` <mailman.441.1163280215.2155.help-gnu-emacs@gnu.org>
2006-11-12  3:57   ` Gary Wessle
2006-11-12 11:12     ` David Hansen
2006-11-13 16:08     ` Kevin Rodgers

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).