all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* marrying braket for ?: operator
@ 2005-07-28  5:20 Baloff
  2005-07-28  7:48 ` Alan Mackenzie
  0 siblings, 1 reply; 7+ messages in thread
From: Baloff @ 2005-07-28  5:20 UTC (permalink / raw)


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

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

end of thread, other threads:[~2005-07-31 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28  5:20 marrying braket for ?: operator Baloff
2005-07-28  7:48 ` Alan Mackenzie
2005-07-28 20:06   ` Robert Marshall
2005-07-28 20:37     ` Kevin Rodgers
2005-07-28 22:04     ` Alan Mackenzie
2005-07-29  8:22       ` Baloff
2005-07-31 12:20         ` Alan Mackenzie

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.