Source string Read only

(itstool) path: sect1/title
15/150
Context English State
The first thing to do is find out if whizbang comes with any files that tell Emacs about the language. These usually end in <filename>.el</filename>, short for <quote>Emacs Lisp</quote>. For example, if whizbang is a FreeBSD port, we can locate these files by doing
<prompt>%</prompt> <userinput>find /usr/ports/lang/whizbang -name "*.el" -print</userinput>
and install them by copying them into the Emacs site Lisp directory. On FreeBSD, this is <filename>/usr/local/share/emacs/site-lisp</filename>.
So for example, if the output from the find command was
/usr/ports/lang/whizbang/work/misc/whizbang.el
we would do
<prompt>#</prompt> <userinput>cp /usr/ports/lang/whizbang/work/misc/whizbang.el /usr/local/share/emacs/site-lisp</userinput>
Next, we need to decide what extension whizbang source files have. Let us say for the sake of argument that they all end in <filename>.wiz</filename>. We need to add an entry to our <filename>.emacs</filename> to make sure Emacs will be able to use the information in <filename>whizbang.el</filename>.
Find the <symbol>auto-mode-alist entry</symbol> in <filename>.emacs</filename> and add a line for whizbang, such as:
<lineannotation>…</lineannotation>
("\\.lsp$" . lisp-mode)
("\\.wiz$" . whizbang-mode)
("\\.scm$" . scheme-mode)
<lineannotation>…</lineannotation>
This means that Emacs will automatically go into <function>whizbang-mode</function> when you edit a file ending in <filename>.wiz</filename>.
Just below this, you will find the <symbol>font-lock-auto-mode-list</symbol> entry. Add <function>whizbang-mode</function> to it like so:
;; Auto font lock mode
(defvar font-lock-auto-mode-list
(list 'c-mode 'c++-mode 'c++-c-mode 'emacs-lisp-mode 'whizbang-mode 'lisp-mode 'perl-mode 'scheme-mode)
"List of modes to always start in font-lock-mode")
This means that Emacs will always enable <function>font-lock-mode</function> (ie syntax highlighting) when editing a <filename>.wiz</filename> file.
And that is all that is needed. If there is anything else you want done automatically when you open up <filename>.wiz</filename>, you can add a <function>whizbang-mode hook</function> (see <function>my-scheme-mode-hook</function> for a simple example that adds <function>auto-indent</function>).
Further Reading
For information about setting up a development environment for contributing fixes to FreeBSD itself, please see <citerefentry><refentrytitle>development</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
Brian Harvey and Matthew Wright <emphasis>Simply Scheme</emphasis> MIT 1994. ISBN 0-262-08226-8
Randall Schwartz <emphasis>Learning Perl</emphasis> O'Reilly 1993 ISBN 1-56592-042-2
Patrick Henry Winston and Berthold Klaus Paul Horn <emphasis>Lisp (3rd Edition)</emphasis> Addison-Wesley 1989 ISBN 0-201-08319-1
Brian W. Kernighan and Rob Pike <emphasis>The Unix Programming Environment</emphasis> Prentice-Hall 1984 ISBN 0-13-937681-X
Brian W. Kernighan and Dennis M. Ritchie <emphasis>The C Programming Language (2nd Edition)</emphasis> Prentice-Hall 1988 ISBN 0-13-110362-8
Bjarne Stroustrup <emphasis>The C++ Programming Language</emphasis> Addison-Wesley 1991 ISBN 0-201-53992-6
W. Richard Stevens <emphasis>Advanced Programming in the Unix Environment</emphasis> Addison-Wesley 1992 ISBN 0-201-56317-7
W. Richard Stevens <emphasis>Unix Network Programming</emphasis> Prentice-Hall 1990 ISBN 0-13-949876-1
Secure Programming
This chapter describes some of the security issues that have plagued <trademark class="registered">UNIX</trademark> programmers for decades and some of the new tools available to help programmers avoid writing exploitable code.
Secure Design Methodology
Writing secure applications takes a very scrutinous and pessimistic outlook on life. Applications should be run with the principle of <quote>least privilege</quote> so that no process is ever running with more than the bare minimum access that it needs to accomplish its function. Previously tested code should be reused whenever possible to avoid common mistakes that others may have already fixed.
One of the pitfalls of the <trademark class="registered">UNIX</trademark> environment is how easy it is to make assumptions about the sanity of the environment. Applications should never trust user input (in all its forms), system resources, inter-process communication, or the timing of events. <trademark class="registered">UNIX</trademark> processes do not execute synchronously so logical operations are rarely atomic.
Buffer Overflows
Component Translation Difference to current string
This translation Translated FreeBSD Doc/books_developers-handbook
The following strings have the same context and source.
Translated FreeBSD Doc/articles_gjournal-desktop
Translated FreeBSD Doc/articles_pr-guidelines
Translated FreeBSD Doc/articles_problem-reports
Translated FreeBSD Doc/articles_pam

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/title
Flags
read-only
Source string location
book.translate.xml:2921
String age
a year ago
Source string age
a year ago
Translation file
books/developers-handbook.pot, string 467