[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
marrying braket for ?: operator
From: |
Baloff |
Subject: |
marrying braket for ?: operator |
Date: |
28 Jul 2005 15:20:51 +1000 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Hello
when I move my pointer to a braket, it highlight its marring braket.
but how can I get it to do the same with the ternary if-else operator (?:)
I hope this is a good group for this question otherwise please point
me.
--------------------------------------------------
say this .cpp file for example
(i < 10)? \\open 1
(i > 5)? \\open 2
cout << "5 < i < 10" << endl
: \\close 2
cout << "i <= 5" << endl
: \\close 1
cout << "i >= 10" << endl;
--------------------------------------------------
the files below have been copied from some source I don't remember, and I
am not lisp boy at all.
I am coding c++ using emacs and have
(load "~/.emacs-mc394")
in my ~/.emacs
~/.emacs-mc394 looks like this
**************************************************
;; Modified by Mike Hvidsten from MC38J emacs file
;; Feb. 4, 2004
(c-add-style "mc394-style"
'("cc-mode"
(c-basic-offset . 3) ; In general, indent 3 spaces
(c-hanging-braces-alist
(defun-open after)) ; brace that opens a function
definition
(c-cleanup-list brace-else-brace
brace-elseif-brace
empty-defun-braces
defun-close-semi
scope-operator)
(c-hanging-braces-alist
; These determine whether a newline appears before
; and/or after a brace in various situations.
(brace-list-open)
(block-open after) ; statement block open brace
(defun-open after) ; brace that opens a function
definition
(substatement-open after); the brace that opens a substatement
block
(block-close . c-snug-do-while))
(c-hanging-colons-alist
(access-label after)) ; Newline after protected: or private:
(c-hungry-delete-key t))) ; delete black space all at once
;; Variable should be t if we are running xemacs.
(defvar xemacs-p
(string-match "XEmacs" emacs-version))
(if (not xemacs-p)
(progn
(global-font-lock-mode t)
; If using global-font-lock-mode, make control-L update colors
(global-set-key "\C-l"
(function (lambda (arg) (interactive "P")
(font-lock-fontify-block 100)
(recenter arg))))))
(setq auto-mode-alist (append '(("\\.h$" . c++-mode)) auto-mode-alist))
**************************************************
- marrying braket for ?: operator,
Baloff <=