Add HTML versions of my init files
[website] / SYinits / 03-c-mode.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <!-- Created by htmlize-1.34 in css mode. -->
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5   <head>
6     <title>03-c-mode.el</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <meta name="author" content="Steve Youngs" />
9     <meta name="owner" content="steve@sxemacs.org" />
10     <style type="text/css">
11     <!--
12       body {
13         color: #ffffff;
14         background-color: #000000;
15       }
16       .comment {
17         /* font-lock-comment-face */
18         color: #87ceeb;
19       }
20       .doc-string {
21         /* font-lock-doc-string-face */
22         color: #32cd32;
23       }
24       .function-name {
25         /* font-lock-function-name-face */
26         color: #ffff00;
27         font-weight: bold;
28       }
29       .keyword {
30         /* font-lock-keyword-face */
31         color: #fa8072;
32       }
33       .reference {
34         /* font-lock-reference-face */
35         color: #40e0d0;
36       }
37       .string {
38         /* font-lock-string-face */
39         color: #00cd00;
40       }
41       .variable-name {
42         /* font-lock-variable-name-face */
43         color: #ffdab9;
44       }
45
46       a {
47         color: #FF0000;
48         background-color: inherit;
49         font: inherit;
50         font-weight: bold;
51         text-decoration: underline;
52       }
53       a:hover {
54         color: #FFFFFF;
55         background-color: #FD00FD;
56         text-decoration: underline;
57       }
58       .img a:hover {
59         background-color: #000000;
60         text-decoration: none;
61       }
62     -->
63     </style>
64   </head>
65   <body>
66     <pre>
67 <span class="comment">;; 03-c-mode.el --- Set up C mode
68 </span>
69 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
70 </span>
71 <span class="comment">;;     Author: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
72 ;; Maintainer: Steve Youngs &lt;<a href="mailto:steve&#64;sxemacs.org">steve&#64;sxemacs.org</a>&gt;
73 ;;    Created: &lt;2007-12-02&gt;
74 ;; Time-stamp: &lt;Thursday Apr  9, 2020 06:45:27 steve&gt;
75 ;;   Download: &lt;<a href="https://downloads.sxemacs.org/SYinits/">https://downloads.sxemacs.org/SYinits/</a>&gt;
76 ;;   HTMLised: &lt;<a href="https://www.sxemacs.org/SYinits/03-c-mode.html">https://www.sxemacs.org/SYinits/03-c-mode.html</a>&gt;
77 ;;   Git Repo: git clone https://git.sxemacs.org/syinit
78 ;;   Keywords: init, compile
79 </span>
80 <span class="comment">;; This file is part of SYinit
81 </span>
82 <span class="comment">;; Redistribution and use in source and binary forms, with or without
83 ;; modification, are permitted provided that the following conditions
84 ;; are met:
85 ;;
86 ;; 1. Redistributions of source code must retain the above copyright
87 ;;    notice, this list of conditions and the following disclaimer.
88 ;;
89 ;; 2. Redistributions in binary form must reproduce the above copyright
90 ;;    notice, this list of conditions and the following disclaimer in the
91 ;;    documentation and/or other materials provided with the distribution.
92 ;;
93 ;; 3. Neither the name of the author nor the names of any contributors
94 ;;    may be used to endorse or promote products derived from this
95 ;;    software without specific prior written permission.
96 ;;
97 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
98 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
99 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
100 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
101 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
102 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
103 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
104 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
105 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
106 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
107 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108 </span>
109 <span class="comment">;;; Commentary:
110 ;;   This sets up my C programming styles.  Note, too, that with this
111 ;;   setup I am able to have different styles for different projects.
112 ;;   It is a little kludgy, but it works.
113 </span>
114 <span class="comment">;;; Credits:
115 ;;
116 ;;   The HTML version of this file was created with Hrvoje Niksic's
117 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
118 ;;
119 </span>
120 <span class="comment">;;; Todo:
121 ;;
122 ;;     
123 </span>
124 <span class="comment">;;; Code:
125 ;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
126 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Defaults
127 </span>(setq c-comment-leader "<span class="doc-string">  </span>")
128 (setq c-default-style
129       '((c-mode . "<span class="string">linux</span>")
130         (c++-mode . "<span class="string">linux</span>")
131         (java-mode . "<span class="string">java</span>")
132         (python-mode . "<span class="string">python</span>")
133         (other . "<span class="string">gnu</span>")))
134
135 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
136 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Special style for Linux source files
137 </span>(<span class="keyword">defun</span> <span class="function-name">linux-c-mode</span> ()
138   "<span class="doc-string">C mode with adjusted defaults for use with the Linux kernel.
139
140 Key-bindings:
141 \\{c-mode-map}</span>"
142   (c-mode)
143   (c-set-style "<span class="string">linux</span>")
144   (setq mode-name "<span class="string">Linux/C</span>"))
145
146 (add-to-list
147  'auto-mode-alist '("<span class="string">^.*/linux.*/.*\\.[ch]$</span>" . linux-c-mode))
148
149 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
150 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> C style for XEmacs core source files
151 </span>(<span class="keyword">defun</span> <span class="function-name">xemacs-c-mode</span> ()
152   "<span class="doc-string">C mode with adjusted defaults for use with XEmacs core sources.
153
154 Key-bindings:
155 \\{c-mode-map}</span>"
156   (c-mode)
157   (c-set-style "<span class="string">gnu</span>")
158   (setq mode-name "<span class="string">XE/C</span>"))
159
160 (add-to-list
161  'auto-mode-alist '("<span class="string">^.*/xemacs.*/.*\\.[ch]$</span>" . xemacs-c-mode))
162
163 <span class="comment">;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
164 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> C style for SXEmacs core source files
165 </span>(<span class="keyword">defvar</span> <span class="variable-name">c-enable-xemacs-performance-kludge-p</span>)
166 (<span class="keyword">defun</span> <span class="function-name">sxemacs-c-mode</span> ()
167   "<span class="doc-string">C mode with adjusted defaults for use with SXEmacs core sources.
168
169 Key-bindings:
170 \\{c-mode-map}</span>"
171   (c-mode)
172   (c-set-style "<span class="string">linux</span>")
173   (setq mode-name "<span class="string">SXE/C</span>")
174   (make-variable-buffer-local 'c-enable-xemacs-performance-kludge-p)
175   (setq c-enable-xemacs-performance-kludge-p t))
176
177 (add-to-list
178  'auto-mode-alist '("<span class="string">^.*/sxemacs.*/.*\\.[ch]$</span>" . sxemacs-c-mode))
179
180 <span class="comment">;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</span></span><span class="comment">
181 </span>(message "<span class="doc-string">C mode initialised.</span>")
182 </pre>
183   <!--  SXEmacs Logo -->
184     <div class="img">
185       <a href="https://www.sxemacs.org/" target="_parent">
186         <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
187           src="/Images/cbsx.png"
188           title="This page was created entirely in SXEmacs"
189           alt="Created with SXEmacs" />
190       </a>
191 <!--  End SXEmacs Logo -->
192 <!--  Valid XHTML 1.0 -->
193       <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f03-c-mode.html" target="_blank">
194        <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
195           src="/Images/valid-xhtml10.png"
196           title="Valid XHTML 1.0 Transitional!"
197           alt="Valid XHTML 1.0 Transitional!" />
198       </a>
199     </div>
200 <!--  End Valid XHTML 1.0 -->
201
202     <h6>Copyright &#169; 2020 Steve Youngs<br />
203      Verbatim copying and distribution is permitted in any medium,
204     providing this notice is preserved.<br />
205 <!-- hhmts start -->
206 Last modified: Wed Apr 15 18:11:21 AEST 2020
207 <!-- hhmts end -->
208    </h6>
209
210 </body>
211 </html>