Warning, /sdk/kde-dev-scripts/kde-emacs/kde-emacs-tips.texi is written in an unsupported language. File is not indexed.
0001 \input texinfo @c -*-texinfo-*- 0002 0003 @finalout 0004 0005 @c %**start of header 0006 @setfilename kde-emacs-tips 0007 @settitle KDE Emacs usefull programming tips 0008 @footnotestyle end 0009 @c @setchapternewpage odd !! we don't want blank pages 0010 @c %**end of header 0011 0012 @dircategory Emacs 0013 @direntry 0014 * KDE Emacs: (kde-emacs). Emacs mode for editing KDE/QT C++/C code. 0015 @end direntry 0016 0017 @ifnottex 0018 Copyright @copyright{} 2002 Zack Rusin and KDE Development Team 0019 0020 Permission is granted to copy, distribute and/or modify this document 0021 under the terms of the GNU Free Documentation License, Version 1.3 0022 or any later version published by the Free Software Foundation; 0023 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 0024 A copy of the license is included in the section entitled 0025 "Documentation License". 0026 @end ifnottex 0027 0028 @titlepage 0029 @sp 10 0030 0031 @center @titlefont{KDE Emacs Package} 0032 @sp 2 0033 @center @subtitlefont{KDE Emacs package documentation and programming tips.} 0034 @sp 2 0035 @author Zack Rusin 0036 0037 @page 0038 @vskip 0pt plus 1filll 0039 Copyright @copyright{} 2002 Zack Rusin & KDE Development Team 0040 @sp 1 0041 Permission is granted to copy, distribute and/or modify this document 0042 under the terms of the GNU Free Documentation License, Version 1.3 0043 or any later version published by the Free Software Foundation; 0044 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 0045 A copy of the license is included in the section entitled 0046 "Documentation License". 0047 @end titlepage 0048 0049 @node Top, Introduction, (dir), (dir) 0050 @comment node-name, next, previous, up 0051 0052 @macro kdeemacs 0053 KDE Emacs 0054 @end macro 0055 0056 @ifinfo 0057 @top @kdeemacs{} 0058 0059 @kdeemacs{} is an Emacs package with tons of useful features 0060 which ease KDE development process. 0061 KDE Emacs usefull programming tips. 0062 0063 @end ifinfo 0064 0065 @menu 0066 * Introduction:: 0067 * Getting Connected:: 0068 * Generating stubs:: 0069 * Tips:: 0070 * Documentation License:: 0071 @end menu 0072 0073 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0074 @node Introduction, Getting Connected, Top, Top 0075 @comment node-name, next, previous, up 0076 @chapter Introduction 0077 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0078 0079 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0080 @node Getting Connected, Generating stubs, Introduction, Top 0081 @comment node-name, next, previous, up 0082 @chapter Getting Connected 0083 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0084 @menu 0085 * Sect. 2.1:: Installation 0086 * Sect. 2.2:: Files 0087 * Sect. 2.3:: Keybindings 0088 @end menu 0089 0090 @node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 0091 @section @code{Installation} 0092 @comment node-name, next, previous, up 0093 0094 @node Sect. 2.2, Sect. 2.3, Sect. 2.1, Chapter 2 0095 @section @code{Files} 0096 @comment node-name, next, previous, up 0097 0098 @node Sect. 2.3, , Sect 2.2, Chapter 2 0099 @section @code{Keybindings} 0100 @comment node-name, next, previous, up 0101 0102 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0103 @node Generating stubs , Tips, Getting Connected, Top 0104 @comment node-name, next, previous, up 0105 @chapter Generating stubs 0106 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0107 0108 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0109 @node Tips, Documentation License, Generating stubs, Top 0110 @comment node-name, next, previous, up 0111 @chapter Tips 0112 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 0113 0114 @sp 1 0115 @strong{Q.} @emph{How do I hide #ifdef's in source files without 0116 actually changing them?} 0117 0118 @strong{A.} Use @code{hide-ifdef-mode} which supports hiding of ifdef 0119 blocks without actually changing the file. In this mode @kbd{C-c @@ 0120 C-d} hides ifdef block and @kbd{C-c @@ C-s} shows it again. 0121 0122 @sp 1 0123 @strong{Q.} @emph{How do I get more information about the keybindings 0124 of the currently active modes?} 0125 0126 @strong{A.} Type @kbd{M-x describe-mode}. 0127 0128 @sp 1 0129 @strong{Q.} @emph{How do I get automatic syntax higlighting of my 0130 custom types?} 0131 0132 @strong{A.} Use a package named @file{ctypes.el} which does exactly 0133 that. 0134 0135 @sp 1 0136 @strong{Q.} @emph{Is it possible to highlight dangerous syntax, just 0137 like Borland JBuilder does it?} 0138 0139 @strong{A.} Yes, use the @file{cwarn.el} package. 0140 0141 @sp 1 0142 @strong{Q.} @emph{How do I easily customize Emacs faces/colors?} 0143 0144 @strong{A.} Use the @file{color-theme.el} package. 0145 0146 @sp 1 0147 @strong{Q.} @emph{How do I set the taskbar Emacs identification string?} 0148 0149 @strong{A.} To your @file{.emacs} add a line like: 0150 @example 0151 (setq frame-title-format "%b (%m)") 0152 @end example 0153 which will display ``filename (mode)'' type of string in the 0154 taskbar. Type @kbd{C-h v frame-title-format} to get more info. 0155 0156 @sp 1 0157 @strong{Q.} @emph{Can I make Emacs jump to the matching parenthesis 0158 with @kbd{%} just like vi?} 0159 0160 @strong{A.} Yes, just add to your @file{.emacs} something like: 0161 @example 0162 ;; Make the % key jump to the matching {}[]() if on another, like VI 0163 (global-set-key "%" 'match-paren) 0164 0165 (defun match-paren (arg) 0166 "Go to the matching parenthesis if on parenthesis otherwise insert %." 0167 (interactive "p") 0168 (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) 0169 ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) 0170 (t (self-insert-command (or arg 1))))) 0171 @end example 0172 0173 @sp 1 0174 @strong{Q.} @emph{Can I have words like FIXME, TODO, HACK or NOTE 0175 higlighted in documentation strings?} 0176 0177 @strong{A.} Yes, either use @file{code-keywords.el} package or wait 0178 till I'll add it to @kdeemacs{}. 0179 0180 @sp 1 0181 @strong{Q.} @emph{I really, really hate identifiersNamedLikeThis. I'd 0182 like to change them to identifiers_named_like_this but the 0183 maintainer of the application/library that I'm hacking on doesn't 0184 agree with me. What can I do? } 0185 0186 @strong{A.} Use the @file{glasses.el} package which changes 0187 identifiersNamedLikeThis to identifiers_named_like_this in the 0188 buffers you're editing and switches them back to their original form 0189 once you save those buffers. 0190 0191 @sp 1 0192 @strong{Q.} @emph{Is it possible to get function completion or 0193 signature display in Emacs? Will it ever be done?} 0194 0195 @strong{A.} Yes and yes. I've been planning on doing this for quite a 0196 while and hopefully will have this finished pretty soon (no dates 0197 though :) ) The first thing that should be done is writing a few 0198 fixes for the Semantic package (@file{c.bnf} to be more exact), 0199 because Semantic doesn't handle templates, member function declared 0200 as const or KDE access specifiers, once this is done all that will be 0201 left is using semanticdb package which efficiently stores and retrieves 0202 large amounts of tokens and then displaying tokens belonging to types at 0203 point which match current context. 0204 0205 @sp 1 0206 @strong{Q.} @emph{Is there a package that would highlight changes that 0207 I made to a certain file?} 0208 0209 @strong{A.} I wouldn't be writing this if there wouldn't - try 0210 @kbd{M-x highlight-changes-mode}. 0211 0212 @sp 1 0213 @strong{Q.} @emph{How to get a diff between the stuff I have in my 0214 local buffer and the file on disk?} 0215 0216 @strong{A.} Use ibuffer package. After @kbd{M-x ibuffer} typing 0217 @kbd{=} over a file will display a diff between the buffer and the 0218 file on the disk. 0219 0220 @sp 1 0221 @strong{Q.} @emph{I want to temporarily highlight certain variable in 0222 a file, how to do it?} 0223 0224 @strong{A.} Type @kbd{M-x hi-lock-mode}, now @kbd{C-x w h 0225 @emph{regexp} @key{RET} @emph{face} @key{RET}} highlights regexp with 0226 face in the current file and @kbd{C-x w r @emph{regexp} @key{RET}} 0227 unhighlights it. 0228 0229 @node Documentation License, Top, Tips, Top 0230 @comment node-name, next, previous, up 0231 @appendix GNU Free Documentation License 0232 @include fdl.texi 0233 0234 @node Concept Index, , Variables Index, Top 0235 @c node-name, next, previous, up 0236 @unnumbered Concept Index 0237 0238 @printindex cp 0239 0240 @contents 0241 @bye